Repository navigation
Phase C.1: v2.lens.determinism — grounded map_keys root, emergent boundary-relative determinism lens + live contract - #6570
Merged
Merged
Conversation
…e authority
Replace the forked, inert determinism model with one grounded authority.
- dag/std/determinism.dag: Determinism = Deterministic | NonDeterministic{source: DeclarationRef},
built on std.perturbation (determinism_from_perturbation bridges ResponseConsistent/Violation) +
determinism_compose. The leak source is a reference to the reached root (emergent), not a
NonDetSource label enum. Deletes the orphaned DeterminismAxis.
- src/v2/std/determinism.dag: imports the authority; keeps only the signature binding
(DeterminismFact) and the Bool projection (v2 side of the Bool fork). Deletes NonDetSource,
the forked DeterminismClass, and the phantom-symbol roster.
- determinism_contract_test.dag: rewritten to the grounded shape. 6 claims green by execution;
discriminating RED verified (break compose -> propagation claims FAIL, revert -> PASS).
Also fixes the CI red at bfd97ca, where a mid-edit snapshot paired the new v2 module with the
stale test still importing the deleted symbols.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…minism §3 collision), dissolve determinism_is_deterministic Bool projection into a test-local helper, reconcile signed design doc with the emergent/perturbation pivot Two REQUEST_CHANGES reviews on #6551: - claude-opus-4-7: stale NON_FOLD_RESIDUE_ROSTER entries (fixed in 96cc568). - cursor/composer-2.5: (1) type Determinism collided with std.behavioral.Determinism -> renamed back to DeterminismAxis (the signed-doc core name); the single-Determinism rename + behavioral dissolution stays in Phase E where EventuallyConsistent is handled. (2) determinism_is_deterministic was a v2.std coproduct->Bool predicate dissolution -> dissolved out of substrate; the contract test asserts via a test-local helper, mirroring the descent_evidence_lattice precedent. (3) signed design doc unreconciled -> supersession note records the operator's 2026-07-13 emergent/perturbation direction (no forged re-sign; new shape's details remain open to operator shape-review). Green-by-execution: 6 contract claims PASS, non_fold_residue_clean_holds PASS (unrostered+stale=0), discriminating RED confirmed (break compose left-propagation -> FAIL). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ndary-relative fold, live contract + discriminating witness The determinism authority (Phase A, #6551) gains its first live consumer. A new lens v2.lens.determinism grounds ^map_keys as the single nondeterministic root (its sibling sorted_map_keys canonicalizes it) and DERIVES a node's determinism by folding its structural closure to that root via std.determinism.determinism_compose — emergent, not labeled; boundary-relative (within-function structural closure). Unregistered callees contribute Deterministic at that boundary (map_keys is always a readable atom, never missed); cross-function reach is Phase F (resolved call edges), other roots (clock/entropy) Phase B (kind:Observation seed work). Mirrors cardinality.dag exactly: grounded List<DeterminismRoot> registry + first-match fold lookup + fold_node catamorphism (determinism_axis_for_node) + Witness<DeterminismFact> contract (determinism_contract_witness) that Violates (located) on a nondeterministic reach. Enrolled in the lens registry (LensIdV0 Determinism arm + bound row). Scope is explicit, NOT silently narrowed: this is the mechanism + the contract over the clean v2 emit layer (src/v2 has zero map_keys — a forward-looking wall that reds the instant one enters). v1 05_emit_rust.dag stays under the x2 gate: its map_keys sites are order-safe (|>count, |>sort_by, let-bound) and need binding-aware dataflow (Phase C.2) before the gate can be deleted (Phase D / O1(b)). Green-by-execution: 5 witness claims PASS (map_keys+nested->Violates, sorted_map_keys+clean ->Holds, axis->NonDeterministic); registry coverage 2 PASS; discriminating RED confirmed (disable the map_keys root -> determinism_flags_map_keys_reach FAIL). Hygiene floors green: non_fold_residue, inert_carrier, wiring_liveness, and 10 enforcement gate_test consumers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
briansrls
added a commit
that referenced
this pull request
Jul 14, 2026
1 of 2 tasks
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.
Phase C.1 —
v2.lens.determinism: the determinism authority's first live consumerPhase A (#6551) landed the grounded
DeterminismAxisauthority but left it inert (self-test only). This PR gives it a live consumer: a lens that derives a node's determinism by folding its structure to grounded nondeterministic roots.What it does
^map_keysas the single nondeterministic root (DeterminismRootregistry, mirroringcardinality.dag'smeasure_descent_fact_registry); its siblingsorted_map_keyscanonicalizes the order.determinism_axis_for_nodeis afold_nodecatamorphism whose fold body isstd.determinism.determinism_compose— a node isNonDeterministic { source }iff its structural closure reaches a registered root; the leak carries aDeclarationRefto the reached root, not a coined tag.Deterministicat that boundary — sound, becausemap_keysis always a readable atom and never missed. This is not the agent-proposed fail-closed-to-NonDeterministicdefault, which would red every function that calls any unregistered builtin.determinism_contract_witnessis the fail-closed contract surface:Violates(located at the offending node) on a reach,Holdsotherwise.LensIdV0Determinismarm + bound row).Scope is explicit, not silently narrowed
src/v2has zeromap_keys— so this is the mechanism plus a forward-looking contract over the clean v2 emit layer (reds the instant a baremap_keysenters). Deliberately deferred:05_emit_rust.dag(wheremap_keysalso appears order-safe:|> count,|> sort_by, let-bound). Required before the x2 gate can be deleted (Phase D / O1(b)); until then v1 emit stays under the x2 gate.kind: Observationseed work).Green-by-execution
map_keys+ nested-in-subtree →Violates;sorted_map_keyssibling + clean call →Holds; axis →NonDeterministic.Determinismresolves to exactly one bound row).map_keysroot →determinism_flags_map_keys_reachFAILs; revert → PASS.non_fold_residue,inert_carrier,wiring_liveness, and 10 enforcementgate_testconsumers ofLensIdV0.gunbc compile --target dag: 0 diagnostics.🤖 Generated with Claude Code