ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/missionmatch / internal/modules/matching/engine/types.go

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/missionmatch / internal/modules/matching/engine/types.go
DateNot specified in source
RepositoryJanady13/missionmatch
Revisione4dada4601c6eb101830f9d223a9655dfa120616
Branchws2-alias-relationship
Path or archive memberinternal/modules/matching/engine/types.go
Original SHA-256e710f60d24a561a40aa5a0dbea2aac134202f6609b1e60c93cadf09f84db07fa
Git blob SHA4ce6c5970455ff3dfcfe645b5a6b954931d3700b
Reading-copy SHA-256e710f60d24a561a40aa5a0dbea2aac134202f6609b1e60c93cadf09f84db07fa

Original source ↗

Recovered source transcript

// Package engine is the PURE, deterministic missionMATCH scoring core. // // It is the product's core IP and a compliance asset (an Automated Employment Decision Tool), // so it is held to three hard rules from CLAUDE.md: // // 1. PURE: no database, no I/O, no clock, no randomness. The skill matcher is INJECTED. // 2. DETERMINISTIC: all scoring math is decimal (never float64) and every input order is // normalized, so the same inputs always yield byte-identical scores and explanations. // 3. FAIR + EXPLAINABLE: it never reads a demographic/EEO attribute or a proxy for one, and // every score carries a per-component breakdown, a human-readable rationale, a gap summary, // and the matched required→candidate skill pairs with their similarity (the decision trace). // // Fixed weights (CLAUDE.md, do NOT change without explicit instruction): // // Clearance .25 Skills .25 Certifications .15 CustomerExperience .15 Experience .10 Location .10 package engine import ( "context" "github.com/shopspring/decimal" ) // ---------- Clearance model ---------- // ClearanceLevel is the ordered US personnel-security hierarchy. Higher ordinal satisfies lower // (TS/SCI satisfies Secret; Secret does NOT satisfy TS/SCI). Unknown is the safe default zero. type ClearanceLevel int const ( ClearanceUnknown ClearanceLevel = iota // missing/unparseable, scores 0 ClearanceNone // no clearance / public trust ClearanceConfidential ClearanceSecret ClearanceTopSecret ClearanceTSSCI // Top Secret with SCI access ) func (c ClearanceLevel) String() string { switch c { case ClearanceNone: return "None" case ClearanceConfidential: return "Confidential" case ClearanceSecret: return "Secret" case ClearanceTopSecret: return "Top Secret" case ClearanceTSSCI: return "TS/SCI" default: return "Unknown" } } // Polygraph is an additional access gate layered on a clearance. Full-scope satisfies CI. type Polygraph int const ( PolyNone Polygraph = iota PolyCI // counterintelligence PolyFullScope // full-scope / lifestyle (satisfies CI) ) func (p Polygraph) String() string { switch p { case PolyCI: return "CI Poly" case PolyFullScope: return "Full Scope Poly" default: return "No Poly" } } // ClearanceStatus gates the clearance: only an Active clearance can score. Expired/Unknown = 0. type ClearanceStatus int const ( StatusUnknown ClearanceStatus = iota StatusActive StatusExpired StatusInactive ) // Clearance is a candidate's held clearance (or a requirement's required clearance via RequiredLevel/RequiredPoly). type Clearance struct { Level ClearanceLevel Poly Polygraph Status ClearanceStatus } // ---------- Candidate & Requirement (pure value inputs, NOT the DB models) ---------- // CandidateSkill is a single skill on a candidate, already normalized to the ontology upstream. // SkillID is the ontology id (stable); Name is the display label. The engine compares by SkillID // for exact matches and defers to the injected SkillMatcher for semantic matches. type CandidateSkill struct { SkillID string Name string } // Candidate is the pure scoring input for one person. It deliberately contains NO demographic field. type Candidate struct { ID string Clearance Clearance Skills []CandidateSkill Certifications []string // normalized cert names CustomerExperience []string // government customers/agencies the candidate has supported YearsExperience int Location string Remote bool // candidate can/will work remotely Relocatable bool Available bool // available to staff now } // RequiredSkill is a skill a requirement demands. Mandatory drives the gap summary (an unmet // mandatory skill is a hard gap); a non-mandatory required skill still counts toward the skill score. type RequiredSkill struct { SkillID string Name string Mandatory bool } // Requirement is the pure scoring input for one role/labor-category. type Requirement struct { ID string RequiredLevel ClearanceLevel RequiredPoly Polygraph RequiredSkills []RequiredSkill RequiredCerts []string CustomerAgency string // "" means no specific customer required RequiredYears int WorkLocation string RemoteAllowed bool KeyPersonnel bool // a Key Personnel slot (surfaced; does not alter the score) } // ---------- Skill matching (INJECTED, keeps the engine pure & testable) ---------- // SkillMatch records that a required skill was satisfied by a candidate skill, and how. type SkillMatch struct { RequiredSkillID string RequiredSkillName string CandidateSkillID string // "" when unmatched CandidateName string Similarity decimal.Decimal // 1.0 for an exact match; the cosine similarity for a semantic match Exact bool AliasMatched bool // flags a match that came from a curated alias rather than an exact name or id match, for audit Matched bool } // SkillMatcher resolves a required skill against a candidate's skills: exact first, then semantic. // It is injected so the engine has no embedding/DB dependency and tests are fully deterministic. // Implementations MUST be deterministic for a given input. Threshold is the engine's semantic cutoff. type SkillMatcher interface { // Match returns the best candidate skill satisfying the required skill at or above threshold. // On an exact id/name match it returns Exact=true, Similarity=1.0. ok is false when nothing // meets the threshold. ctx carries the request deadline and cancellation to any provider call. Match(ctx context.Context, required RequiredSkill, candidateSkills []CandidateSkill, threshold decimal.Decimal) (m SkillMatch, ok bool) } // ---------- Result ---------- // Band is the proposal-readiness classification of a total score. type Band int const ( BandRed Band = iota // Recruiting Required (< 75) BandYellow // Potential (75–89.99) BandGreen // Proposal Ready (>= 90) ) func (b Band) String() string { switch b { case BandGreen: return "Green" case BandYellow: return "Yellow" default: return "Red" } } // Label is the human-facing band name used in slates and explanations. func (b Band) Label() string { switch b { case BandGreen: return "Proposal Ready" case BandYellow: return "Potential" default: return "Recruiting Required" } } // ComponentScore is one weighted row of the decision trace (the AEDT/explainability artifact). type ComponentScore struct { Component string // "Clearance", "Skills", ... Weight decimal.Decimal // 0.25, 0.15, ... Raw decimal.Decimal // the 0–100 sub-score Weighted decimal.Decimal // Raw * Weight (contribution to the total) Rationale string // human-readable reason for the sub-score } // MatchResult is the full, explainable, reproducible outcome of scoring one candidate vs one requirement. type MatchResult struct { CandidateID string RequirementID string Clearance decimal.Decimal Skills decimal.Decimal Certifications decimal.Decimal CustomerExperience decimal.Decimal Experience decimal.Decimal Location decimal.Decimal Total decimal.Decimal // 0–100, rounded to 2 dp Band Band Explanation string // a human-readable summary GapSummary []string // unmet MANDATORY items (clearance, mandatory skills, required certs, ...) MatchedSkills []SkillMatch // required→candidate pairs with similarity (and the unmatched ones) Trace []ComponentScore // per-component weighted breakdown, the decision trace }

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