DEM-CONTRACT (1/2): the deterministic enrichment-mapping interpreter (D-DEM-2(4)) - #31
Merged
Conversation
…-2(4))
DEM-GOV §9 slot DEM-CONTRACT, owner-authorized 2026-08-12. PURE by decision:
no fs, no afi-config dependency, no I/O - the caller supplies the parsed
mapping document and enriched view. No runtime invokes this yet (slot text);
the runtime seam is DEM-BIND, separately owner-gated.
validators/EnrichmentMappingInterpreter.ts
- Closed operator vocabulary bind/band/recode (+ default inside a bind's
optionality; namespace-default as the top-level list) per D-DEM-3(1);
computation is inexpressible by construction (D-DEM-3(2)); the producer
escape hatch is a reference, never code (D-DEM-3(3)); one source path
per binding (D-DEM-3(5)).
- Normative ABSENCE definition matching the retired adapter's ??/!= null
semantics exactly (namespace missing/undefined/null; own key missing;
value undefined or null) - including the live projection's
key-written-with-undefined class. Two DECLARED divergences pin DEM-BIND's
byte-for-byte obligation to the typed finite domain: present wrong-type
refuses (source-type-mismatch), present non-finite refuses
(non-finite-number).
- Fired-default set per D-DEM-5(3): bind-optionality firings and
band/recode absent-member firings; recode fallback on a PRESENT
unrecognized value is NOT fired (AR-GOV D-AR-3 total-table law).
- Totality: every call ends in a deep-frozen result or a thrown
EnrichmentMappingError with a machine-checkable reason - that class only.
Own-property read-once discipline throughout (UwrProfileLoader idiom).
validators/__tests__/EnrichmentMappingInterpreter.test.ts
- Totality over the 12 inline invalid-vector mirrors with exact reasons;
hostile non-objects; purity (frozen inputs, structuredClone compare,
determinism); adapter-oracle byte-equality on the expressible subset
across band boundaries, recode branches, grandfather firings, absent/null
namespaces, null-valued sources, and undefined-valued own keys; result
immutability; and a dev-only sibling-checkout describe that deep-equals
each mirror against the canonical afi-config vector files (drift fails
mechanically whenever the sibling exists).
Gate: 279 tests green (sibling integration ACTIVE against the companion
afi-config branch); zero bytes anywhere in afi-reactor.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Kilo Code Review could not run — your account is out of credits. Add credits or switch to a free model to enable reviews on this change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slot authorization
DEM-GOV §9 slot
DEM-CONTRACT, authorized by the founder instruction of 2026-08-12 recorded in the decision's Status line (option-2 pattern: first slot authorized by the commissioning instruction, FCP-GOV precedent). Companion: afi-config PR (2/2) — the contract family. This PR merges first (referenced by nothing; the D-DEM-2(5)(a) rationale).What this is
The pure, total, side-effect-free mapping interpreter — the kernel that will one day replace the bespoke
froggy.enrichment_adapter.tsseam with registered data (that replacement is DEM-BIND, a separately owner-gated slot; no runtime invokes this yet, per the slot text).bind/band/recode+ optionality defaults + namespace-defaults) — computation is inexpressible by construction (D-DEM-3(2)).??/!= nullbehavior exactly — including the live projection's key-written-with-undefinedclass. This was the adversarial review's one blocking finding on the plan; without it, DEM-BIND's byte-for-byte gate would have been unsatisfiable.fallbackon a present value is not (AR-GOV D-AR-3).Gate (slot row, decision :198)
git statusclean, full 691-test suite green untouched,312da118…126e06pin passing, plain-grep negatives forenrichment-mapping/mappingRef/EnrichmentMappingInterpreterall empty.🤖 Generated with Claude Code