ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/missionmatch / internal/platform/missionclass/missionclass_test.go

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/missionmatch / internal/platform/missionclass/missionclass_test.go
DateNot specified in source
RepositoryJanady13/missionmatch
Revision720d47fae476b0d38477ae4401697d372b1ea2bc
Branchfeature/opportunity-to-outcome
Path or archive memberinternal/platform/missionclass/missionclass_test.go
Original SHA-256a2477045f87fdc904ce0840ada6cf9164c975dc6ac10fdf2e8f3197ab91ecca9
Git blob SHAb808827380f260a4ac8221cd413bfebe6c31f8e3
Reading-copy SHA-256a2477045f87fdc904ce0840ada6cf9164c975dc6ac10fdf2e8f3197ab91ecca9

Original source ↗

Every recorded occurrence

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

Original recordBranch or archiveRevision / identifierOriginal location
Janady13/missionmatch / internal/platform/missionclass/missionclass_test.gofeature/opportunity-to-outcome720d47fae476b0d38477ae4401697d372b1ea2bcOpen original
Janady13/missionmatch / internal/platform/missionclass/missionclass_test.gocollision-deconfliction4ee5a09972608ed89f8377c6665542d5f450f0a6Open original
Janady13/missionmatch / internal/platform/missionclass/missionclass_test.gom5-price-to-win41000ad30fff4129fdaf5ec84e15ba14c27d4890Open original
Janady13/missionmatch / internal/platform/missionclass/missionclass_test.gomaster1e9249840a4302ec82e123b9c9cb6f75badea3e4Open original
Janady13/missionmatch / internal/platform/missionclass/missionclass_test.gows8-teaching-loopc823f0fb6bb2aba0f39001eb6de96f4000d9321fOpen original
Janady13/missionmatch / internal/platform/missionclass/missionclass_test.gomag-substrateb82c7100a492dec67dfd1eda6b3f53def859be35Open original
Janady13/missionmatch / internal/platform/missionclass/missionclass_test.gotime-to-fill-survivalb66e1e505863d4f17741a4b9ede73509e45bd6c6Open original
Janady13/missionmatch / internal/platform/missionclass/missionclass_test.gographrag-foundationb0ddeb9f633fd138d09309d1a17b7d13bc3a67f7Open original
Janady13/missionmatch / internal/platform/missionclass/missionclass_test.gows9-bench-ingestionf585a9ef32fa554663ce1fba9a414a54b6e49cf0Open original
Janady13/missionmatch / internal/platform/missionclass/missionclass_test.gopresentation-readinesseb574acaa29d71ce4d0f852572e87c275c79fdb7Open original
Janady13/missionmatch / internal/platform/missionclass/missionclass_test.govendor-intelligencefe9796a19c261951d3f2565206c0c1b5ac294465Open original
Janady13/missionmatch / internal/platform/missionclass/missionclass_test.gows7-federal-signal6a9f6ce9cfb13345ffb47770d4960e7c2d9c17c2Open original
Janady13/missionmatch / internal/platform/missionclass/missionclass_test.gophase2-connectorse038d4c687aec16f8bd9bc4d907eea14d91f8704Open original
Janady13/missionmatch / internal/platform/missionclass/missionclass_test.gofeature/aioe-upgrade2178e7298d0e5d9af83afa12402fd587f0ba6ed8Open original
Janady13/missionmatch / internal/platform/missionclass/missionclass_test.gocapture-readinessbae6af7cb2997e819174a9e9cfff5e16067a1975Open original

Recovered source transcript

package missionclass import "testing" // codesOf extracts just the mission codes from a slice of hits, preserving order. func codesOf(hits []Hit) []string { out := make([]string, 0, len(hits)) for _, h := range hits { out = append(out, h.Code) } return out } // equal reports whether two string slices are identical in length, order, and contents. nil and an // empty slice compare equal so a no match (nil) matches the want of nil. func equal(a, b []string) bool { if len(a) != len(b) { return false } for i := range a { if a[i] != b[i] { return false } } return true } func contains(s []string, want string) bool { for _, v := range s { if v == want { return true } } return false } func TestClassifyKeyword(t *testing.T) { cases := []struct { text string want []string // mission codes, in Codes order }{ {"Provide SIGINT collection and COMSEC support", []string{"SIGINT", "COMSEC"}}, {"signals intelligence analysis for the customer", []string{"SIGINT"}}, {"satellite command and control operations", []string{"SAT_C2"}}, {"a cross domain solution accreditation effort", []string{"CDS"}}, {"general administrative support services", nil}, {"", nil}, // bare acronym must not match inside a longer word {"the cdsa framework", nil}, } for _, tc := range cases { got := codesOf(ClassifyKeyword(tc.text)) if !equal(got, tc.want) { t.Fatalf("ClassifyKeyword(%q) = %v, want %v", tc.text, got, tc.want) } } } func TestClassifyAlias(t *testing.T) { idx := NewAliasIndex(map[string]string{ "sigint analyst": "SIGINT", "signals intelligence": "SIGINT", "comsec custodian": "COMSEC", }) got := codesOf(ClassifyAlias("seeking a SIGINT Analyst and a COMSEC Custodian", idx)) want := []string{"SIGINT", "COMSEC"} if !equal(got, want) { t.Fatalf("ClassifyAlias = %v, want %v", got, want) } // Empty text yields no hit. if got := ClassifyAlias("", idx); len(got) != 0 { t.Fatalf("ClassifyAlias of empty text should yield nothing, got %v", got) } // The alias mechanism and evidence phrase are recorded for traceability. hits := ClassifyAlias("hiring a SIGINT Analyst", idx) if len(hits) != 1 || hits[0].Mechanism != MechAlias || hits[0].Evidence != "sigint analyst" { t.Fatalf("alias hit must carry the alias mechanism and matched phrase, got %+v", hits) } } func TestClassifyCodes(t *testing.T) { // The AC PSC prefix (R&D, National Defense) is the one curated mapping: it yields SIGINT and EW. got := codesOf(ClassifyCodes("AC12", "")) if !contains(got, "SIGINT") || !contains(got, "EW") { t.Fatalf("AC PSC prefix must map to SIGINT and EW, got %v", got) } if len(got) != 2 { t.Fatalf("AC PSC prefix must yield exactly the two curated codes, got %v", got) } // The hits carry the psc mechanism and the uppercased code as evidence. for _, h := range ClassifyCodes("ac12", "") { if h.Mechanism != MechPSC || h.Evidence != "AC12" { t.Fatalf("psc hit must carry the psc mechanism and uppercased code, got %+v", h) } } // An unknown PSC and NAICS yields no mission rather than a wrong one. if got := ClassifyCodes("ZZZZ", "999999"); len(got) != 0 { t.Fatalf("unknown PSC and NAICS should yield no mission, got %v", got) } // A deliberately broad NAICS that is intentionally empty yields nothing. if got := ClassifyCodes("", "541330"); len(got) != 0 { t.Fatalf("intentionally broad NAICS 541330 must yield no mission, got %v", got) } } func TestClassifyUnion(t *testing.T) { // "case officer" carries HUMINT in the alias layer but has no keyword form, so the alias mechanism is // the only path to HUMINT and genuinely wins (it is not shadowed by a keyword hit). idx := NewAliasIndex(map[string]string{ "case officer": "HUMINT", }) // A record with a keyword hit (SIGINT), an alias only hit (HUMINT via case officer), and a code hit // (AC prefix => SIGINT, EW). SIGINT is reached by both keyword and code; the union dedupes by code and // the keyword mechanism wins because keyword is unioned first. hits := Classify("SIGINT collection led by a Case Officer", "AC10", "", idx) got := codesOf(hits) want := []string{"SIGINT", "HUMINT", "EW"} if !equal(got, want) { t.Fatalf("Classify union = %v, want %v", got, want) } byCode := map[string]Hit{} for _, h := range hits { byCode[h.Code] = h } if byCode["SIGINT"].Mechanism != MechKeyword { t.Fatalf("SIGINT was reached by keyword and code, keyword must win, got %q", byCode["SIGINT"].Mechanism) } if byCode["HUMINT"].Mechanism != MechAlias { t.Fatalf("HUMINT came only from the alias layer, got %q", byCode["HUMINT"].Mechanism) } if byCode["EW"].Mechanism != MechPSC { t.Fatalf("EW came only from the PSC crosswalk, got %q", byCode["EW"].Mechanism) } }

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