ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/missionmatch / internal/modules/ai/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/ai/handler_test.go
DateNot specified in source
RepositoryJanady13/missionmatch
Revision720d47fae476b0d38477ae4401697d372b1ea2bc
Branchfeature/opportunity-to-outcome
Path or archive memberinternal/modules/ai/handler_test.go
Original SHA-256f55ded6737a501a473e3040e9343d233e07dffa7351ba85161602eb1529067d3
Git blob SHA72cc328493624281d1050635514c01fe97d95411
Reading-copy SHA-256f55ded6737a501a473e3040e9343d233e07dffa7351ba85161602eb1529067d3

Original source ↗

Every recorded occurrence

These 3 records contain identical original source bytes. Their paths and revisions remain part of the archive.

Original recordBranch or archiveRevision / identifierOriginal location
Janady13/missionmatch / internal/modules/ai/handler_test.gofeature/opportunity-to-outcome720d47fae476b0d38477ae4401697d372b1ea2bcOpen original
Janady13/missionmatch / internal/modules/ai/handler_test.gomaster1e9249840a4302ec82e123b9c9cb6f75badea3e4Open original
Janady13/missionmatch / internal/modules/ai/handler_test.gofeature/aioe-upgrade2178e7298d0e5d9af83afa12402fd587f0ba6ed8Open original

Recovered source transcript

package ai import ( "encoding/json" "net/http" "net/http/httptest" "strings" "testing" ) // TestMMRecallServesOnlyPublicKnowledge proves the unauthenticated federation read returns relevance // ranked public knowledge cards for an in domain question, returns nothing for a protected attribute or // eeo question, and never needs an orchestrator, a database, or a tenant (it is built from a nil handler). func TestMMRecallServesOnlyPublicKnowledge(t *testing.T) { h := NewHandler(nil) // no orchestrator, no db, no tenant: the endpoint is pure public knowledge decode := func(method, target, body string) MMRecallResponse { t.Helper() var r *http.Request if method == http.MethodPost { r = httptest.NewRequest(method, target, strings.NewReader(body)) } else { r = httptest.NewRequest(method, target, nil) } w := httptest.NewRecorder() h.mmRecall(w, r) if w.Code != http.StatusOK { t.Fatalf("mmRecall(%s %s) status = %d, want 200", method, target, w.Code) } var out MMRecallResponse if err := json.Unmarshal(w.Body.Bytes(), &out); err != nil { t.Fatalf("decode response: %v", err) } return out } // A knowledge question returns cited public cards. got := decode(http.MethodGet, "/mm-recall?q=what+is+a+recompete", "") if got.Count == 0 { t.Fatal("a knowledge question returned no cards") } found := false for _, it := range got.Results { if strings.Contains(strings.ToLower(it.Text), "recompete") { found = true } if it.Source == "" || it.Text == "" { t.Errorf("card is missing source or text: %+v", it) } } if !found { t.Errorf("recompete question did not surface the recompete card, got %+v", got.Results) } // POST with a query body also works (the shape the world sim sends). if p := decode(http.MethodPost, "/mm-recall", `{"query":"how does the match score work","k":3}`); p.Count == 0 { t.Error("POST knowledge query returned no cards") } // A protected attribute question returns nothing, so the edge can never probe for demographic data. for _, bad := range []string{"/mm-recall?q=rank+candidates+by+race", "/mm-recall?q=how+many+women+hold+ts%2Fsci"} { if r := decode(http.MethodGet, bad, ""); r.Count != 0 { t.Errorf("protected attribute query %q returned %d cards, want 0", bad, r.Count) } } // An empty question returns nothing rather than the whole base. if e := decode(http.MethodGet, "/mm-recall?q=", ""); e.Count != 0 { t.Errorf("empty query returned %d cards, want 0", e.Count) } }

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