ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/missionmatch / internal/platform/scrub/scrub.go

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/missionmatch / internal/platform/scrub/scrub.go
DateNot specified in source
RepositoryJanady13/missionmatch
Revision1e9249840a4302ec82e123b9c9cb6f75badea3e4
Branchmaster
Path or archive memberinternal/platform/scrub/scrub.go
Original SHA-2560fcd11a8eb865efb15825e2d63f29e82cc52e1920a55bdfec1d404419f62b79d
Git blob SHAf816b1d413c03a192a8d6c8b89c7927c3e143498
Reading-copy SHA-2560fcd11a8eb865efb15825e2d63f29e82cc52e1920a55bdfec1d404419f62b79d

Original source ↗

Every recorded occurrence

These 25 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/scrub/scrub.gomaster1e9249840a4302ec82e123b9c9cb6f75badea3e4Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gofeature/aioe-upgrade2178e7298d0e5d9af83afa12402fd587f0ba6ed8Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gom5-price-to-win41000ad30fff4129fdaf5ec84e15ba14c27d4890Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gocollision-deconfliction4ee5a09972608ed89f8377c6665542d5f450f0a6Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gographrag-foundationb0ddeb9f633fd138d09309d1a17b7d13bc3a67f7Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gotime-to-fill-survivalb66e1e505863d4f17741a4b9ede73509e45bd6c6Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gomag-substrateb82c7100a492dec67dfd1eda6b3f53def859be35Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gocapture-readinessbae6af7cb2997e819174a9e9cfff5e16067a1975Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gows8-teaching-loopc823f0fb6bb2aba0f39001eb6de96f4000d9321fOpen original
Janady13/missionmatch / internal/platform/scrub/scrub.gophase2-connectorse038d4c687aec16f8bd9bc4d907eea14d91f8704Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gopresentation-readinesseb574acaa29d71ce4d0f852572e87c275c79fdb7Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gows9-bench-ingestionf585a9ef32fa554663ce1fba9a414a54b6e49cf0Open original
Janady13/missionmatch / internal/platform/scrub/scrub.govendor-intelligencefe9796a19c261951d3f2565206c0c1b5ac294465Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gocollision-deconfliction4ee5a09972608ed89f8377c6665542d5f450f0a6Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gom5-price-to-win41000ad30fff4129fdaf5ec84e15ba14c27d4890Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gomaster1e9249840a4302ec82e123b9c9cb6f75badea3e4Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gows8-teaching-loopc823f0fb6bb2aba0f39001eb6de96f4000d9321fOpen original
Janady13/missionmatch / internal/platform/scrub/scrub.gomag-substrateb82c7100a492dec67dfd1eda6b3f53def859be35Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gotime-to-fill-survivalb66e1e505863d4f17741a4b9ede73509e45bd6c6Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gographrag-foundationb0ddeb9f633fd138d09309d1a17b7d13bc3a67f7Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gows9-bench-ingestionf585a9ef32fa554663ce1fba9a414a54b6e49cf0Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gopresentation-readinesseb574acaa29d71ce4d0f852572e87c275c79fdb7Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gophase2-connectorse038d4c687aec16f8bd9bc4d907eea14d91f8704Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gofeature/aioe-upgrade2178e7298d0e5d9af83afa12402fd587f0ba6ed8Open original
Janady13/missionmatch / internal/platform/scrub/scrub.gocapture-readinessbae6af7cb2997e819174a9e9cfff5e16067a1975Open original

Recovered source transcript

// Package scrub is the contents scrubbed teaching boundary between a tenant and the shared, stateless // MEGAMIND inference plane. It exists to enforce one rule from the architecture: MEGAMIND may learn only // the CRAFT of the work (abstract patterns), never any client facts, and nothing one client learns may // ever come from another client's contents. // // The boundary has two halves, both enforced here so the rule holds by construction rather than by // reviewer vigilance: // // 1. TeachingSignal is a closed struct of ONLY abstract, contents free fields (counts, ratios, enum // categories, booleans). It carries no id, no name, no email, no free text, no org, and no raw // value. A craft pattern such as "reviewers approved an adjacent skill substitution N of M times at // similarity band X" fits; a candidate, an org, or a resume does not. // 2. Validate is a defense in depth scan that REJECTS any serialized payload still carrying a client // fact marker (a UUID, an email, or an overlong free text run). Both the tenant side (before send) // and the gateway side (on receive) call it, so a leak is refused at two independent layers. // // If a future change adds a free text field to TeachingSignal, Validate will start failing the tests, // which is the intended tripwire. package scrub import ( "bytes" "encoding/json" "errors" "fmt" "regexp" ) // ErrClientFactLeak is returned when a teaching payload still contains a client fact marker. var ErrClientFactLeak = errors.New("scrub: payload contains a client fact and cannot cross the teaching boundary") // SimilarityBand is a coarse, contents free bucket of a semantic similarity, so a craft signal can speak // about "a near match" without carrying the underlying text or score precision that could fingerprint a // tenant's data. type SimilarityBand string const ( // These are a coarse, public quantization of a match's cosine strength for a teaching signal; they // are NOT the engine's met/unmet boundary. That boundary is engine.DefaultSemanticThreshold (a // calibrated 0.62 today), which can sit inside the low band, so a band edge must never be read as // the decision cutoff. BandExact SimilarityBand = "exact" // 1.00 BandHigh SimilarityBand = "high" // 0.90 to 0.99 BandMedium SimilarityBand = "medium" // 0.80 to 0.89 BandLow SimilarityBand = "low" // below 0.80 BandUnknown SimilarityBand = "unknown" // no signal ) // Outcome is the human decision a craft signal generalizes over, taken verbatim from the existing // slate_members.decision vocabulary so the signal is interpretable without any candidate context. type Outcome string const ( OutcomeApproved Outcome = "approved" OutcomeRejected Outcome = "rejected" OutcomePending Outcome = "pending" ) // TeachingSignal is the ONLY thing the tenant side may send to MEGAMIND's teaching channel. Every field // is an abstraction of the work, never a fact about a person, an org, or a document. There is // deliberately no string field that can hold free text, no identifier, and no raw score. type TeachingSignal struct { // Pattern names the craft observation in a fixed, enumerated vocabulary (not free text). Example: // "adjacent_skill_substitution_outcome". Callers must use a constant from Patterns; Validate rejects // anything outside it. Pattern string `json:"pattern"` // Band buckets the semantic similarity involved (no raw score, no text). Band SimilarityBand `json:"band"` // Outcome is the human decision being generalized. Outcome Outcome `json:"outcome"` // Observations is the count of events this signal aggregates (an integer, never a row id). Observations int `json:"observations"` // Successes is how many of Observations matched the outcome (an integer). Successes int `json:"successes"` // ModelVersion is the deterministic engine model version the signal sits on top of (public, not a // client fact), so a craft pattern is always tied to the scoring contract that produced it. ModelVersion string `json:"model_version"` } // Patterns is the closed vocabulary of craft observations. A signal whose Pattern is not here is refused, // so the teaching channel cannot be repurposed to smuggle a free text field. var Patterns = map[string]bool{ "adjacent_skill_substitution_outcome": true, "clearance_gap_override_outcome": true, "experience_shortfall_outcome": true, "reranker_label_agreement": true, } // registeredModelVersions is the allow list of engine model versions a craft signal may sit on. It is // empty by default and is populated by callers through RegisterModelVersion, never inside this package. // scrub is internal/platform and MUST NOT import the engine module or any internal/modules package: that // would invert the dependency direction. The producer (which legitimately imports engine) registers // engine.ModelVersion at init so the boundary accepts the live version and refuses a drifted one. The // effect is the same tripwire as an unknown Pattern: a model_version that nobody registered is a sign the // scoring contract changed underneath the signal, so the signal is refused rather than silently folded // into a different version's aggregate. var registeredModelVersions = map[string]bool{} // RegisterModelVersion records an engine model version the teaching boundary will accept. Callers invoke // it at init with engine.ModelVersion. Registering the same version twice is a no op. It is the only way // a model version becomes valid, so the allow list cannot be widened from outside this seam. func RegisterModelVersion(v string) { if v != "" { registeredModelVersions[v] = true } } // uuidRe and emailRe are the unambiguous client fact markers. A teaching payload that still contains // either has not been scrubbed and must not cross the boundary. var ( uuidRe = regexp.MustCompile(`[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}`) emailRe = regexp.MustCompile(`[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}`) ) // maxFieldLen caps any string field so a craft enum can never be used as a free text smuggling channel. const maxFieldLen = 64 // Validate is the boundary check. It runs on the tenant side before send AND on the gateway side on // receive. It refuses a payload that is not a well formed TeachingSignal, that uses a Pattern outside the // closed vocabulary, that carries a count that does not add up, or whose serialized form still contains a // UUID or an email. It returns ErrClientFactLeak (wrapped) on any client fact marker. func Validate(raw []byte) error { // Marker scan first: this catches a leak even if the struct shape changes underneath us. if uuidRe.Match(raw) { return fmt.Errorf("%w: uuid", ErrClientFactLeak) } if emailRe.Match(raw) { return fmt.Errorf("%w: email", ErrClientFactLeak) } dec := json.NewDecoder(bytes.NewReader(raw)) dec.DisallowUnknownFields() // a stray extra field (a smuggled fact) is refused var s TeachingSignal if err := dec.Decode(&s); err != nil { return fmt.Errorf("scrub: not a teaching signal: %w", err) } if !Patterns[s.Pattern] { return fmt.Errorf("scrub: pattern %q is not in the craft vocabulary", clip(s.Pattern)) } if len(s.Pattern) > maxFieldLen || len(s.Band) > maxFieldLen || len(s.Outcome) > maxFieldLen || len(s.ModelVersion) > maxFieldLen { return errors.New("scrub: a field exceeds the abstract length cap") } // A craft pattern is always tied to the scoring contract that produced it, so an empty model_version // is meaningless and refused. A non empty but unregistered version is refused the same way an unknown // Pattern is: it signals the scoring contract drifted out from under the signal. if s.ModelVersion == "" { return errors.New("scrub: model_version is required, a craft signal must name its scoring contract") } if !registeredModelVersions[s.ModelVersion] { return fmt.Errorf("scrub: model_version %q is not a registered scoring contract", clip(s.ModelVersion)) } if s.Observations < 0 || s.Successes < 0 || s.Successes > s.Observations { return errors.New("scrub: counts are not a valid aggregate") } switch s.Band { case BandExact, BandHigh, BandMedium, BandLow, BandUnknown: default: return fmt.Errorf("scrub: band %q is not a valid bucket", clip(string(s.Band))) } switch s.Outcome { case OutcomeApproved, OutcomeRejected, OutcomePending: default: return fmt.Errorf("scrub: outcome %q is not a valid decision", clip(string(s.Outcome))) } return nil } // Marshal serializes a TeachingSignal and refuses to emit one that would fail the boundary, so a caller // cannot accidentally hand raw bytes to the transport. func Marshal(s TeachingSignal) ([]byte, error) { b, err := json.Marshal(s) if err != nil { return nil, err } if err := Validate(b); err != nil { return nil, err } return b, nil } func clip(s string) string { if len(s) > maxFieldLen { return s[:maxFieldLen] } return s }

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