ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/missionmatch / internal/modules/opportunities/capture_handler_test.go

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/missionmatch / internal/modules/opportunities/capture_handler_test.go
DateNot specified in source
RepositoryJanady13/missionmatch
Revision720d47fae476b0d38477ae4401697d372b1ea2bc
Branchfeature/opportunity-to-outcome
Path or archive memberinternal/modules/opportunities/capture_handler_test.go
Original SHA-256123c9bacc1830dca50517b787adf800b4fe6a5cd423dc25e1ffea91658226dbf
Git blob SHA65fafd3e59a1c955f73ed5910ffc2dfb44db2616
Reading-copy SHA-256123c9bacc1830dca50517b787adf800b4fe6a5cd423dc25e1ffea91658226dbf

Original source ↗

Recovered source transcript

package opportunities import ( "net/http" "testing" "github.com/go-chi/chi/v5" ) // TestCaptureRoutesRegister is the module level route contract: it asserts the tenant capture surface mounts // exactly the expected method and path set. It does not touch the database; it proves the wiring, so a route // dropped or renamed in a refactor fails here rather than in production. func TestCaptureRoutesRegister(t *testing.T) { h := NewHandler(NewService(nil, nil)) r := chi.NewRouter() h.CaptureRoutes(r) got := map[string]bool{} err := chi.Walk(r, func(method, route string, _ http.Handler, _ ...func(http.Handler) http.Handler) error { got[method+" "+route] = true return nil }) if err != nil { t.Fatalf("walking the capture router: %v", err) } want := []string{ "POST /opportunities/tracked", "GET /opportunities/tracked", "GET /opportunities/tracked/{id}", "PATCH /opportunities/tracked/{id}", "GET /opportunities/tracked/{id}/scope", "POST /opportunities/tracked/{id}/scope/items", "PATCH /opportunities/tracked/{id}/scope/items/{item_id}", // Split and merge, Phase 2 item 4. They are listed here because the contract test only asserts what it // is TOLD to expect: an unlisted route passes silently, so adding a route without adding it here leaves // it unguarded, which is exactly how the promotion routes once sat unmounted. "POST /opportunities/tracked/{id}/scope/items/{item_id}/split", "POST /opportunities/tracked/{id}/scope/items/{item_id}/merge", "GET /opportunities/tracked/{id}/requirement-drafts", // Generation and manual completion, Phase 2 item 5. Both are held at scope.review, deliberately below // the promotion gate, so shaping a draft can never be the same act as making it live. "POST /opportunities/tracked/{id}/requirement-drafts/generate", "PATCH /requirement-drafts/{id}", "GET /opportunities/tracked/{id}/amendments", // The promotion gate. If either of these is ever unmounted, the safety path that lets a named human // turn a draft into a live requirement becomes unreachable, which is how it sat before this test. "POST /requirement-drafts/{id}/approve", "POST /requirement-drafts/{id}/reject", } for _, route := range want { if !got[route] { t.Errorf("capture route not registered: %s", route) } } }

Search equations, builds, manuscript text, and recovered sources.