ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/missionmatch / internal/modules/matching/service_test.go

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/missionmatch / internal/modules/matching/service_test.go
DateNot specified in source
RepositoryJanady13/missionmatch
Revision720d47fae476b0d38477ae4401697d372b1ea2bc
Branchfeature/opportunity-to-outcome
Path or archive memberinternal/modules/matching/service_test.go
Original SHA-25669250a706a85e163862268c79a4820932448f650273c6675697b1913257d521f
Git blob SHA5aa70f96b226ce17c6d259acbe521b379f13ca1a
Reading-copy SHA-25669250a706a85e163862268c79a4820932448f650273c6675697b1913257d521f

Original source ↗

Every recorded occurrence

These 2 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/matching/service_test.gofeature/opportunity-to-outcome720d47fae476b0d38477ae4401697d372b1ea2bcOpen original
Janady13/missionmatch / internal/modules/matching/service_test.gofeature/aioe-upgrade2178e7298d0e5d9af83afa12402fd587f0ba6ed8Open original

Recovered source transcript

package matching import ( "context" "testing" "time" "github.com/google/uuid" "github.com/shopspring/decimal" "github.com/missionworkforce/missionmatch/internal/modules/matching/engine" "github.com/missionworkforce/missionmatch/internal/platform/database/dbgen" ) // fakeQ implements just the Querier methods generateSlate touches; the rest panic via the nil embed. type fakeQ struct { dbgen.Querier req dbgen.Requirement cands []dbgen.Candidate slateID uuid.UUID added []dbgen.AddSlateMemberParams } func (f *fakeQ) GetRequirement(context.Context, uuid.UUID) (dbgen.Requirement, error) { return f.req, nil } func (f *fakeQ) ListRequiredSkills(context.Context, uuid.UUID) ([]dbgen.ListRequiredSkillsRow, error) { return nil, nil } func (f *fakeQ) ListRequiredCertifications(context.Context, uuid.UUID) ([]string, error) { return nil, nil } func (f *fakeQ) ListCandidates(context.Context, dbgen.ListCandidatesParams) ([]dbgen.Candidate, error) { return f.cands, nil } func (f *fakeQ) ListCandidateSkills(context.Context, uuid.UUID) ([]dbgen.ListCandidateSkillsRow, error) { return nil, nil } func (f *fakeQ) ListCandidateCertifications(context.Context, uuid.UUID) ([]string, error) { return nil, nil } func (f *fakeQ) ListCandidateCustomerExperience(context.Context, uuid.UUID) ([]string, error) { return nil, nil } func (f *fakeQ) CreateSlate(_ context.Context, arg dbgen.CreateSlateParams) (dbgen.Slate, error) { return dbgen.Slate{ID: f.slateID, OrganizationID: arg.OrganizationID, RequirementID: arg.RequirementID, Name: arg.Name, Status: arg.Status}, nil } func (f *fakeQ) AddSlateMember(_ context.Context, arg dbgen.AddSlateMemberParams) (dbgen.SlateMember, error) { f.added = append(f.added, arg) return dbgen.SlateMember{}, nil } func TestGenerateSlateRanksBandsAndPersists(t *testing.T) { orgID, reqID := uuid.New(), uuid.New() // Requirement needs Secret; everything else open. req := dbgen.Requirement{ID: reqID, RequiredLevel: "secret", RequiredPoly: "none", RequiredYears: 0} // cA: meets Secret, available -> 100.00 (green) // cB: only Confidential (clearance 0), available -> 75.00 (red, v1.4.0 clearance gap cap) // cC: Confidential + NOT available (clearance 0, location 50) -> 70.00 (red) // v1.4.0: cB held Confidential but Secret was required, so clearance scores 0 and the clearance // gap cap lowers Yellow to Red. The total (75.00) is unchanged; only the band changes. cA := dbgen.Candidate{ID: uuid.New(), OrganizationID: orgID, ClearanceLevel: "secret", ClearancePoly: "none", ClearanceStatus: "active", Available: true} cB := dbgen.Candidate{ID: uuid.New(), OrganizationID: orgID, ClearanceLevel: "confidential", ClearancePoly: "none", ClearanceStatus: "active", Available: true} cC := dbgen.Candidate{ID: uuid.New(), OrganizationID: orgID, ClearanceLevel: "confidential", ClearancePoly: "none", ClearanceStatus: "active", Available: false} f := &fakeQ{req: req, cands: []dbgen.Candidate{cC, cA, cB}, slateID: uuid.New()} // intentionally unsorted in := GenerateSlateInput{RequirementID: reqID, Name: "Engineer Slate", MaxCandidates: 10} // The default scorer stands in for the AIOE profile closure: frozen engine, default weights. defaultScore := func(ctx context.Context, ec engine.Candidate, er engine.Requirement) engine.MatchResult { return engine.ScoreCandidate(ctx, ec, er, nil) } res, err := generateSlate(context.Background(), f, orgID, in, defaultScore, time.Now(), nil, 0) if err != nil { t.Fatalf("generateSlate: %v", err) } if res.SlateID != f.slateID || len(res.Members) != 3 { t.Fatalf("unexpected result: %+v", res) } want := []struct { id uuid.UUID total string band string rank int }{ {cA.ID, "100.00", "green", 1}, // cB total is still 75.00 but band is red due to v1.4.0 clearance gap cap. {cB.ID, "75.00", "red", 2}, {cC.ID, "70.00", "red", 3}, } for i, w := range want { m := res.Members[i] if m.CandidateID != w.id.String() || m.Total != w.total || m.Band != w.band || m.Rank != w.rank { t.Fatalf("member %d = %+v, want id=%s total=%s band=%s rank=%d", i, m, w.id, w.total, w.band, w.rank) } } // Persisted in rank order, with DB band codes and the perfect 100 fitting numeric(7,4). if len(f.added) != 3 { t.Fatalf("want 3 persisted members, got %d", len(f.added)) } // v1.4.0: cB is now red (clearance gap cap), so all three are ranked but two are red. if f.added[0].Band != "green" || f.added[1].Band != "red" || f.added[2].Band != "red" { t.Fatalf("persisted bands wrong: %q %q %q", f.added[0].Band, f.added[1].Band, f.added[2].Band) } if !f.added[0].TotalScore.Equal(decimal.NewFromInt(100)) { t.Fatalf("rank-1 total should be exactly 100, got %s", f.added[0].TotalScore) } if *f.added[0].Rank != 1 || *f.added[2].Rank != 3 { t.Fatalf("persisted ranks wrong") } }

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