Skip to content

v4 T-4.13/L-4 Lane C: model machine_code.dag + lean.dag — language-models bundle (D2 resolver shape: alias-identity + grounding-map + operation-semantics, NOT re-declared algebra inhabitance per DECISIONS.md D2; D2 scope-negative = inhabitance-form-only NOT LanguageModel-grammar; declarative-first, - #3208

Merged
briansrls merged 50 commits into
mainfrom
session/zesty-fox-441
May 18, 2026

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Auto-opened by session-dashboard for session zesty-fox-441.
Pushing to session/zesty-fox-441 advances this PR.

Worker attestation

Before flipping this PR to ready for review, confirm each item:

  • Title describes the change (not the session id or branch).
  • PR body summarises what and why (replace the TODO below).
  • Tests run: name the command (e.g. npm test, cargo test) and the result.
  • If this closes a work item, the body contains a Closes #N directive.
  • No commits on this branch are surprises (no fork/cherry-pick I did not make).
  • No secrets / credentials / large binaries staged.

Summary

TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.

Test plan

  • TODO: list the commands that ran (or "no tests changed; relied on CI") and the outcome.

@briansrls
briansrls marked this pull request as ready for review May 16, 2026 21:58
@briansrls

briansrls commented May 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks. I verified the three exploratory points against current head 901711c:

  • LeanProofCheckSemantics<IRCarrier> and MachineIntegerOperationSemantics<IRCarrier> do use phantom type parameters today. That is intentional: the carrier is shaped for future D2a(3) resolver rows keyed by the alias target, while the actual rows remain deferred until the shared GroundingMap / operation-realization path lands.
  • LeanTermNode is intentionally side-table vocabulary keyed by LeanName; LeanTermRef keeps subterms name-referenced instead of producer-inlined per A1/K-1. The proof artifact points through refs by design.
  • ImmediateOperand.order is the decoded immediate-field byte order selected by the enclosing ISA production. It is not intended as an independent authority from EncodedInstruction.isa; future production rows should derive/populate it from the ISA grammar, not let it disagree.

I’m not pushing comment-only clarification churn because the review is APPROVE, these are non-blocking exploratory observations, CI is green, the dashboard readiness gate is met, and the T-4 manager explicitly asked to keep HEAD settled/no churn. — sent from zesty-fox-441

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 82a5dbdb · Trigger: schedule
  • Thinking: 244s wall

BLOCKING (5)

Root Cause

  • src/v4/extdeps/languages/lean.dag Lean proof export mixes declaration taxonomy, proof artifact payload, and kernel checking rules as flat classifiers → split declaration-specific payloads and model simultaneous checker facts as coordinated fields or resolver rows.
  • src/v4/extdeps/languages/machine_code.dag Machine operation semantics conflates arithmetic overflow and architectural flag effects → keep one authority for flag writes and add dissolution receipts for remaining substrate sums.

⚠️ The D2 direction looks aligned, but these substrate shapes need tightening before downstream consumers depend on them.

}


type LeanTerminationClause

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against current head 863600f: this is already addressed. LeanTerminationClause has a full Practice-4 receipt immediately above the declaration at src/v4/extdeps/languages/lean.dag:227-243, including the 🟢 GREEN classification and all five dissolution checks. No code change needed for this stale inline finding. — sent from zesty-fox-441

Comment thread src/v4/extdeps/languages/lean.dag Outdated
// LeanProofArtifact — the PROOF-1 export unit. The source evidence is a
// Node-side proof artifact read by lenses; this file models the Lean
// target term boundary, not a new gunbc proof system.
type LeanProofArtifact {

This comment was marked as resolved.

Comment thread src/v4/extdeps/languages/lean.dag Outdated
// resolver facts; they are not algebra-inhabitance rows.
// Anchor: Lean 4.20.0 Reference Manual, reduction and opaque constants:
// https://lean-lang.org/doc/reference/4.20.0/
type LeanReductionSemantics

This comment was marked as resolved.

// Anchor: version-pinned ISA instruction-format sections named above.
type Operand
= RegisterOperand { register: RegisterRef }
| ImmediateOperand { bytes: ByteSequence, order: ByteOrder }

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against current head 863600f: this is already addressed. Operand has a full Practice-4 receipt immediately above the declaration at src/v4/extdeps/languages/machine_code.dag:264-278, including the 🟢 GREEN classification and all five dissolution checks. No code change needed for this stale inline finding. — sent from zesty-fox-441

// 20240411 integer computational instructions.
type MachineIntegerOverflowBehavior
= WrapModuloWidth
| TrapOnOverflow

This comment was marked as resolved.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 863600fb · Trigger: schedule
  • Thinking: 227s wall

BLOCKING (1)

Root Cause

  • src/v4/extdeps/languages/machine_code.dag ISA instruction-production authority is referenced in prose but not modeled -> add an ISA-scoped instruction-production or operand-shape carrier and have EncodedInstruction reference that row.

⚠️ The prior comments are fixed, but the machine instruction boundary still needs a typed ISA production authority before this substrate lands.

// The opcode is an opaque Symbol resolved through the ISA grammar table.
type EncodedInstruction {
isa: Isa
opcode: Symbol

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against current head bef71c4: this is already addressed in the current shape. EncodedInstruction no longer exists in non-comment code; the carrier is DecodedInstruction { production: InstructionProductionRef, operands: List<OperandBinding> }. InstructionProductionRef scopes the opcode through the pinned Isa, and OperandBinding ties each operand value to a production slot, so the current model is not a free opcode plus unconstrained operand list. No code change needed for this stale inline finding. — sent from zesty-fox-441

@briansrls

briansrls commented May 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Verified the two exploratory observations against current head bef71c4:

  • The IRCarrier parameters on LeanProofCheckSemantics<IRCarrier> and MachineIntegerOperationSemantics<IRCarrier> are intentionally phantom at this stage. They preserve the D2a(3) operation-semantics carrier shape while the actual GroundingMap / operation-realization rows remain deferred to the shared canonical path.
  • Isa.revision: Symbol is intentionally the opaque version identity for this L-2 model. InstructionProductionRef and InstructionByteLimitRef rely on that ISA-scoped Symbol identity until the LanguageModel resolver owns the canonical production table / version namespace.

I am not pushing comment-only clarification churn for these non-blocking observations because the structural codex findings are fixed, current GitHub checks are green, and the manager asked to keep the head settled unless new blocking feedback lands. — sent from zesty-fox-441

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 249fa9b5 · Trigger: schedule
  • Thinking: 186s wall

BLOCKING (1)

Root Cause

  • src/v4/extdeps/languages/lean.dag LeanTermForm treats universe levels as either a Sort Symbol or a C5 failure feature → add a LeanLevel carrier and carry resolved level lists on LeanConst before proof artifacts consume terms.

⚠️ One substrate fidelity issue remains in the Lean kernel-term model.

Comment thread src/v4/extdeps/languages/lean.dag Outdated

type LeanTermForm
= LeanSort { level: Symbol }
| LeanConst { name: LeanName }

This comment was marked as resolved.

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified the LeanDefinitionTermination exploratory observation against current head d757a8b7c and the Lean 4 recursive-definitions reference. The reference describes decreasing_by as the optional custom proof clause that comes after termination_by, and treats the two as complementary termination hints, not two order-distinct declaration programs.

So the current LeanTerminationByWithDecreasingBy { measure, proof } shape is intentionally presence/cardinality-based: it records that both fixed roles are present, while the concrete surface order is fixed by Lean's grammar/emitter rather than represented as another semantic degree of freedom. I am not pushing comment-only wording churn while the current-head openai-pro review is still running. — sent from zesty-fox-441

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: d757a8b7 · Trigger: manual
  • Comparison: main @ df121272 ... session/zesty-fox-441 @ d757a8b7
  • Conversation: View conversation

1. Story of the diff

This PR turns two v4 language-model stubs into declarative extdeps models. src/v4/extdeps/languages/lean.dag models Lean as a proof/checking target for the first theorem-export slice: declaration kinds, names, universe levels, binders, kernel-ish term forms, termination clauses, proof artifacts, C5 fidelity dispositions, Lean proof-check semantics, and D2 alias/scaffold rows. src/v4/extdeps/languages/machine_code.dag models machine code as one ISA-parameterized language boundary rather than a per-ISA file family: ISA identity, byte order, instruction length/word scaffolds, registers, addressing, operands, decoded instructions, C5 dispositions, machine integer operation semantics, fixed-width integer aliases, and tracked D2 scaffolds.

The intended mechanism is declarative-first and resolver-shaped: both files avoid Rust implementation, avoid local diagnostics/results, avoid re-declaring algebra inhabitance, and push unresolved GroundingMap / per-operation rows into named future shared homes. The machine-code side mostly follows the stated D2 shape by aliasing fixed-width std integer carriers (MachineI8/MachineU8 etc.) and keeping target-specific facts in operation-semantics carriers; the Lean side has one alias that does not appear to be faithful to Lean’s actual primitive numeric surface.

2. Invariant categories

1. LAYER MODEL — Finding, BLOCKING

src/v4/extdeps/languages/lean.dag:407-416 says the aliases are “Lean’s language-level primitive names,” then declares:

src/v4/extdeps/languages/lean.dag:416: type LeanUInt = UInt

That makes the v4 language-model substrate claim that Lean has a language-level primitive UInt corresponding to the abstract std UInt carrier. Lean’s reference surface instead enumerates fixed-width unsigned integer types by size/word size: USize, UInt8, UInt16, UInt32, and UInt64; it describes fixed-width integers as available in 8, 16, 32, 64, plus architecture word size. Lean Language This is substrate-facing modeling, not implementation-only: once this alias exists, downstream grounding can treat an abstract unsigned integer as a Lean primitive name even though the target spec distinguishes the fixed-width family.

2. INVARIANTS.md + modeling-discipline.md — Finding, BLOCKING

This violates P1: Modeling Faithfulness / Grounding completeness. THESIS.md:175 requires target-side primitive types to be structurally modeled from the target language reference and not as name-keyed shortcuts, while INVARIANTS.md:25-29 says constructs must ground in an identifiable external fact. The diff line that breaks that is again:

src/v4/extdeps/languages/lean.dag:416: type LeanUInt = UInt

The fix shape should be either to delete LeanUInt until the shared grounding-map layer can express the family, or replace it with faithful alias-identity rows for the actual Lean fixed-width names, mirroring the machine-code shape at src/v4/extdeps/languages/machine_code.dag:438-448.

3. CODING.md — Compliant

The diff is declarative .dag modeling, not Rust implementation, and it stays in the project’s “data + pure functions” posture. The only functions added are pure projections over closed feature carriers — lean_feature_disposition at src/v4/extdeps/languages/lean.dag:378 and machine_feature_disposition at src/v4/extdeps/languages/machine_code.dag:369 — with no hidden state, filesystem effects, builders, or object-style APIs.

4. TESTING.md — Finding, NON-BLOCKING as a separate item; covered by the blocking fix above

No tests or .dag TestClaim receipts are added with these new language-model surfaces. That is mostly acceptable for a declarative model PR if existing parse/bootstrap coverage exercises the files, but the LeanUInt issue shows a missing behavior-level guard: a small alias-fidelity check should reject target primitive aliases that are not present in the referenced target spec. The concrete diff line that motivates the test gap is:

src/v4/extdeps/languages/lean.dag:416: type LeanUInt = UInt

I would not make “tests missing” a second blocker independent of the modeling bug, but the fix should add or rely on a check that would have caught this.

5. LOCKED DESIGN DECISIONS — Finding, BLOCKING

The PR text and file comments intentionally align to the locked D2 resolver shape: alias-identity + grounding-map + operation-semantics, not re-declared algebra inhabitance. The Lean comments state that alias rows are target primitive identities at src/v4/extdeps/languages/lean.dag:84-90 and src/v4/extdeps/languages/lean.dag:407-409; LeanUInt = UInt at src/v4/extdeps/languages/lean.dag:416 weakens that locked shape by substituting an abstract std carrier for a target primitive identity. Machine code does the locked shape correctly with fixed-width aliases at src/v4/extdeps/languages/machine_code.dag:438-448; Lean should do the same kind of target-faithful aliasing or leave unsigned grounding deferred.

6. TRACKED vs UNTRACKED DEBT — Compliant

The explicit scaffolds are tracked with bounds and dissolution triggers. src/v4/extdeps/languages/lean.dag:419-429 defers D2a(2) GroundingMap rows and D2a(3) data rows until the shared homes are pinned and explicitly forbids declaring a local GroundingMap. src/v4/extdeps/languages/machine_code.dag:451-462 does the same for machine-code grounding maps and per-instruction operation-semantics rows. The InstructionWord scaffold at src/v4/extdeps/languages/machine_code.dag:198-211 names the current bound and a dissolution trigger: fixed-cardinality / Nat-indexed width carriers landing in std/machine.dag or std/cardinality.dag.

2.5. Top-down PM intent review

Finding, BLOCKING. The highest-level intent is that target growth costs one declarative language spec while preserving faithful grounding, not that the spec file can invent target primitive names. THESIS.md:175 says target primitives are modeled from the target language reference and unknown grounding must fail closed; the diff contradicts that at src/v4/extdeps/languages/lean.dag:416 with type LeanUInt = UInt. From a PM/executive perspective, landing this would let a worker faithfully follow the new Lean model and still route unsigned Lean grounding through a non-target primitive shape, which is exactly the semantic dilution D2 is supposed to avoid.

3. Verdict

REQUEST_CHANGES

The PR is directionally strong: it is declarative, mostly D2-shaped, and the machine-code side handles fixed-width alias identity cleanly. I would block on the Lean unsigned alias because it is a substrate/modeling error, not a local implementation nit; fix LeanUInt by using actual Lean fixed-width aliases or deferring the row, and add a small alias-fidelity/parse receipt so this class does not recur.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: d757a8b7 · Trigger: schedule
  • Thinking: 260s wall

BLOCKING (1)

Root Cause

  • src/v4/extdeps/languages/lean.dag Resolved kernel universe levels and elaboration-only unresolved levels share one LeanLevel carrier → split the resolved proof-artifact level shape from the fail-closed unresolved-universe feature.

⚠️ One substrate fidelity issue remains at the Lean universe-level boundary.

name: LeanName
}


This comment was marked as resolved.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 93b385cf · Trigger: manual
  • Comparison: main @ ba9337f1 ... session/zesty-fox-441 @ 93b385cf
  • Conversation: View conversation

1. Story of the diff

This PR turns src/v4/extdeps/languages/lean.dag and src/v4/extdeps/languages/machine_code.dag from placeholder language-model modules into declarative extdep specs. The Lean side models the proof-export slice: Lean names, universe levels, binders, kernel-term forms, termination clauses, proof artifacts, C5 fidelity dispositions, Lean-specific proof-check semantics, and primitive alias rows back to std/ carriers. The machine-code side models one ISA-parameterized machine-code boundary rather than per-ISA files: ISA identity, byte order, instruction length/width, register/addressing/operand shapes, decoded instruction shape, fidelity dispositions, integer operation semantics, and fixed-width primitive aliases. Both files are careful about the D2 resolver split: alias-identity rows land now, grounding-map rows are deferred to the shared GroundingMap home, and no local algebra inhabitance rows are introduced.

The main shape is aligned with the brief, but I found one substrate-level modeling issue in the machine-code decoded-instruction model: the ISA identity is carried independently by the production and by nested register references, so the type admits cross-ISA decoded instructions.

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation). Finding — BLOCKING.

This diff is substrate/modeling work: it adds .dag language-model carriers under src/v4/extdeps/languages/. In machine_code.dag, RegisterRef independently carries isa: Isa at src/v4/extdeps/languages/machine_code.dag:243-246, while InstructionProductionRef also independently carries isa: Isa at src/v4/extdeps/languages/machine_code.dag:323-326; DecodedInstruction then combines a production with arbitrary operand bindings at src/v4/extdeps/languages/machine_code.dag:344-346, and Operand can embed a RegisterOperand { register: RegisterRef } at src/v4/extdeps/languages/machine_code.dag:309-312. That makes an illegal state representable: an x86 production can be paired with an AArch64 register operand. For substrate, this should be unrepresentable, not left to a downstream checker. A likely fix is to make decoded operand register names production-relative, or otherwise carry a same-ISA witness so the production remains the single authority for the instruction’s ISA.

  1. INVARIANTS.md + modeling-discipline.md. Finding — BLOCKING.

Same issue, under P2 Boundary Discipline / single-authority metadata and illegal states unrepresentable. The diff itself says the production is “the authority for opcode and operand-slot legality” at src/v4/extdeps/languages/machine_code.dag:338-343, but the nested register reference still carries a second ISA authority at src/v4/extdeps/languages/machine_code.dag:243-246. This violates the shared-reads-vs-parallel-representations rule: consumers are not just reading the same resolved ISA; they can receive two independently-authored ISA values that disagree.

  1. CODING.md. Compliant.

The new executable-looking surfaces are pure .dag projections, not hidden-state implementation code: lean_feature_disposition is a total match over LeanFidelityFeature at src/v4/extdeps/languages/lean.dag:385-395, and machine_feature_disposition is the analogous total match over MachineFidelityFeature at src/v4/extdeps/languages/machine_code.dag:390-400.

  1. TESTING.md. N/A — declaration-only diff.

No tests were added. For this PR, I would not flag test absence by itself because the diff adds language-model declarations and does not add a new runner, emitter, parser path, or bugfix behavior; the blocking issue above is structural and should be fixed in the model rather than covered by a behavior test.

  1. LOCKED DESIGN DECISIONS. Compliant.

The D2 split is explicit and respected: Lean states alias-identity rows with algebra owned by std/ at src/v4/extdeps/languages/lean.dag:91-97 and implements only aliases at src/v4/extdeps/languages/lean.dag:420-427; machine code makes the same commitment and explicitly avoids OrderedRing<MachineI32> / Semiring<MachineU32> rows at src/v4/extdeps/languages/machine_code.dag:91-98, with aliases at src/v4/extdeps/languages/machine_code.dag:459-469. The scope negatives also stay in-bounds: Lean excludes general proof search and adjacent provers at src/v4/extdeps/languages/lean.dag:99-102, while machine code excludes per-ISA file splitting, disassembler procedure code, object formats, relocation, and ABI layers at src/v4/extdeps/languages/machine_code.dag:75-103.

  1. TRACKED vs UNTRACKED DEBT. Compliant.

The actual staged shapes are tracked: InstructionWord is marked 🟡 TRACKED-SCAFFOLD, bounded to the current width vocabulary, and names the fixed-cardinality/Nat-indexed carrier trigger at src/v4/extdeps/languages/machine_code.dag:198-211; Lean’s D2 grounding-map/data-row deferral names the shared GroundingMap and operation-realization triggers at src/v4/extdeps/languages/lean.dag:430-440; machine code’s equivalent D2 deferral does the same at src/v4/extdeps/languages/machine_code.dag:472-483. I did not see untracked TODO/scaffold text in the diff.

2.5. Top-down PM intent review

Compliant. The PR preserves the PM-level direction: declarative-first language-model specs, D2 alias identity plus deferred grounding maps plus target-specific operation semantics, no re-declared algebra inhabitance, and no per-ISA or proof-search subsystem expansion. The one blocking finding is a local substrate integrity problem inside that intended shape, not a semantic dilution of the work plan.

3. Verdict

REQUEST_CHANGES. The PR is directionally right and mostly disciplined, but the machine-code decoded-instruction model currently admits cross-ISA operand/production drift. Because that is substrate-level and would push a core invariant into convention or downstream validation, I would fix it before landing.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 93b385cf · Trigger: schedule
  • Thinking: 310s wall

BLOCKING (2)

Root Cause

  • src/v4/extdeps/languages/lean.dag Lean level recursion was split through refs without landing the single authority for resolved level expressions → add LeanLevelNode { name, form: LeanLevel } or carry LeanLevel directly where recursion is not needed.
  • src/v4/extdeps/languages/machine_code.dag The ISA grammar production authority was modeled as an opaque reference instead of a declared carrier → add a production shape that owns opcode, operand slots, register/immediate/addressing constraints, and bind DecodedInstruction operands to that authority.

⚠️ The previous comments are mostly addressed, but these two substrate authority gaps should be fixed before the model becomes a pattern for downstream consumers.

| LeanLevelParam { name: Symbol }


type LeanLevelRef {

This comment was marked as resolved.

// production. `opcode` is not a free spelling authority; it is resolved
// in the namespace of the pinned `isa` production table.
type InstructionProductionRef {
isa: Isa

This comment was marked as resolved.

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified against current head 0e0235d2be: this finding is already addressed in the current code. LeanLevelMVar does not exist in src/v4/extdeps/languages/lean.dag; LeanLevel only admits resolved kernel level forms (Zero, Succ, Max, IMax, Param), and the ledger explicitly says unresolved metavariables fail closed through LeanUnresolvedUniverseLevel rather than reaching LeanSort / LeanConst as kernel-term payloads.

No code change needed for this stale inline finding. — sent from zesty-fox-441

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified against current head 0e0235d2be: this Lean level-ref finding is already addressed. src/v4/extdeps/languages/lean.dag declares LeanLevelNode { name: LeanName, level: LeanLevel }, so LeanLevelRef is not an opaque universe fact without a resolved-expression side table. No code change needed for this stale inline finding. — sent from zesty-fox-441

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified against current head 59bf67b03: the instruction-production finding is addressed in the current code. machine_code.dag now declares InstructionProduction { reference, slots }, category-specific slot refs (RegisterOperandSlotRef, ImmediateOperandSlotRef, MemoryOperandSlotRef), InstructionOperandSlot variants that own the production slot constraints, and OperandBinding variants that bind decoded values to compatible slot-ref categories rather than a free Symbol slot plus unconstrained operand value.

The remote v4 compile gate passed with 0 diagnostics before the branch advanced to this head. — sent from zesty-fox-441

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 59bf67b0 · Trigger: schedule
  • Thinking: 221s wall

BLOCKING (2)

Root Cause

  • src/v4/extdeps/languages/lean.dag termination clause cardinality was modeled before the Lean termination-hint variants → split termination_by into well-founded and structural forms or explicitly fail structural recursion closed.
  • src/v4/extdeps/languages/machine_code.dag production slots were modeled as category/value carriers instead of constraint schemas → add separate slot constraint carriers for immediate width/target and memory addressing forms, then bind decoded operands to those constraints.

⚠️ The prior review points are mostly addressed, but two substrate authority gaps remain before this language-model shape should land.

// Anchor: Lean 4.20.0 Reference Manual, termination checking /
// `termination_by` and `decreasing_by`:
// https://lean-lang.org/doc/reference/4.20.0/
type LeanTerminationMeasure {

This comment was marked as resolved.

// 4. Dimensional — FAILS: one production slot accepts one operand
// category in this L-2 model.
// 5. Parameterized family — FAILS: heterogeneous payloads.
type InstructionOperandSlot

This comment was marked as resolved.

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified against current head 59bf67b03: this instruction-production finding is already addressed in the current code. machine_code.dag declares InstructionProduction { reference, slots }, category-specific slot refs (RegisterOperandSlotRef, ImmediateOperandSlotRef, MemoryOperandSlotRef), an InstructionOperandSlot coproduct that owns the production slot constraints, and an OperandBinding coproduct that binds decoded values to compatible slot-ref categories. OperandBinding.slot is no longer a free Symbol field paired with an unconstrained operand value.

No code change needed for this stale inline finding. — sent from zesty-fox-441

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified against current head 59bf67b03: both codex findings were valid structural §2 authority gaps in the survivable vocabulary, so I pushed ca3ed842d.

Fixes:

  • Lean termination hints now distinguish structural recursion from well-founded recursion via LeanTerminationBy = LeanStructuralTermination | LeanWellFoundedTermination { measure }; declaration-level termination forms now carry LeanTerminationBy rather than collapsing all termination_by clauses into LeanTerminationMeasure.
  • Machine instruction production slots now carry constraint schemas: ImmediateOperandConstraint records width/order/target, ImmediateOperandTarget distinguishes literal/PC-relative/absolute-address immediates, and MemoryOperandConstraint models the addressing-form constraints separately from decoded AddressingMode values. InstructionOperandSlot now owns those schemas and decoded operand bindings continue to use category-specific slot refs.

Validation: remote ctrl-build v4 compile gate passed with 0 diagnostics before push. D2-held posture remains unchanged; this is not a merge-readiness claim. — sent from zesty-fox-441

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 979b774a · Trigger: schedule
  • Thinking: 199s wall

BLOCKING (2)

Root Cause

  • src/v4/extdeps/languages/lean.dag structural termination was modeled as a clause kind instead of a clause payload → add the decreasing-parameter carrier to LeanStructuralTermination.
  • src/v4/extdeps/languages/machine_code.dag instruction length limits and operand field widths were collapsed into one reference type → introduce a separate operand-field width carrier and use it for immediate and displacement constraints.

⚠️ Two substrate modeling gaps remain in the new Lean structural termination shape and machine operand width authority.

Comment thread src/v4/extdeps/languages/lean.dag Outdated
// well-founded.
// 5. Parameterized family — FAILS: heterogeneous payloads.
type LeanTerminationBy
= LeanStructuralTermination

This comment was marked as resolved.



type ImmediateOperandConstraint {
width: InstructionByteLimitRef

This comment was marked as resolved.

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified against current head 979b774a: this finding is already addressed in the current code. InstructionOperandSlot no longer models immediate slots as only byte order or memory slots by reusing decoded AddressingMode values. Immediate production slots carry ImmediateOperandConstraint { width, order, target }, where target is ImmediateOperandTarget, and memory production slots carry MemoryOperandConstraint variants for absolute, register-indirect, base-displacement, base-index-scale, and PC-relative forms.

Decoded operands still carry decoded values (ImmediateOperand bytes/order and MemoryOperand mode), but the production-slot authority is now the separate constraint schema, not the operand value carrier. No code change needed for this stale inline finding. — sent from zesty-fox-441

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified against current review head 979b774a: both codex findings were valid survivable §2 modeling gaps, and current head 718ce89e5 addresses them.

Fixes now present:

  • LeanStructuralTermination carries the selected decreasing parameter: LeanStructuralTermination { decreasing_parameter: LeanName }, so termination_by structural no longer collapses the required parameter fact into a nullary clause kind.
  • Operand field widths use a separate OperandFieldWidthRef authority. ImmediateOperandConstraint.width and memory displacement widths now use OperandFieldWidthRef, while InstructionByteLimitRef remains scoped to whole-instruction maximum byte lengths.

Validation: remote ctrl-build v4 compile gate passed with 0 diagnostics before the branch advanced to 718ce89e5. D2-held posture remains unchanged; this is not a merge-readiness claim. — sent from zesty-fox-441

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 718ce89e · Trigger: schedule
  • Thinking: 325s wall

Non-blocking — Strengths

  • src/v4/extdeps/languages/lean.dag Classified as .dag model work; the Lean changes are now aligned with the relevant extdeps/modeling discipline checks.
  • src/v4/extdeps/languages/machine_code.dag Classified as .dag model work; the machine-code changes now separate instruction-length, operand-field width, production slots, and operation semantics cleanly.

✅ No blocking concerns found in the current PR diff.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 930e441c · Trigger: schedule
  • Thinking: 163s wall

Non-blocking — Strengths

  • src/v4/extdeps/languages/lean.dag The Lean model is aligned with the relevant extdeps fidelity and coproduct-discipline requirements for this PR scope.
  • src/v4/extdeps/languages/machine_code.dag The machine-code model now separates production identity, slot constraints, operand values, overflow behavior, flag writes, and deferred grounding-map rows cleanly.

✅ No blocking concerns found in the current PR diff.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 4064b273 · Trigger: schedule
  • Thinking: 296s wall

Non-blocking — Strengths

  • src/v4/extdeps/languages/lean.dag The Lean model now keeps coproducts receipt-backed while preserving simultaneous checker facts as product fields where appropriate.
  • src/v4/extdeps/languages/machine_code.dag The machine-code model now separates production identity, slot constraints, operand bindings, overflow behavior, and flag writes cleanly.

✅ No blocking concerns found in the current PR diff.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 995869ea · Trigger: schedule
  • Thinking: 286s wall

BLOCKING (2)

Root Cause

  • src/v4/DECISIONS.md P4-3208 receipts only the coproduct ledger while the same PR still carries superseded D2 alias-identity rows → add an explicit D2-REV/T-30 reconciliation or move these primitive rows to the fact-bundle lane.

⚠️ The prior inline issues look fixed, but the remaining D2-REV conflict should be reconciled before this T-4 language-model PR lands.



// Anchor: https://lean-lang.org/doc/reference/4.20.0/Basic-Types/Fixed-Precision-Integers/
type LeanBool = Bool

This comment was marked as resolved.



// Anchor: https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html
type MachineI8 = Int8

This comment was marked as resolved.

@briansrls

briansrls commented May 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Verified the current held/rework-class findings against #3208:

  • The Lean primitive alias block and machine primitive alias block still contain bare std/ aliases.
  • LeanFidelityDisposition and MachineFidelityDisposition duplicate the same Modeled | DeclaredNormalized | FailClosed C5-fidelity disposition shape.
  • lean_feature_disposition / machine_feature_disposition are predicate/data-row dissolution candidates under the suspended Practice-10 advisory tier.

These are known held/superseded content, not local fix-forward targets. #3208 is D2-HARD-HELD under src/v4/DECISIONS.md D2-REV: fact-bundle modeling supersedes the alias-identity model, and the post-D2-REV rework owns the shared C5-fidelity-classifier consolidation/placement and disposition-row conversion. The reconciliation is the gated T-4 fact-bundle rework, blocked on T-3, T-29, T-30, and T-25-core.

Disposition: 🟡 — bound to the post-D2-REV shared-C5-fidelity / fact-bundle rework. Trigger: that rework executes after T-30 and the remaining T-4 feeders clear. Fixing these rows/carriers/functions inside the current D2-shaped PR would be the reversed-D2 / shared-placement churn the unwind is meant to prevent. So these findings are acknowledged as valid against the current held content, but intentionally not fix-forwarded here. #3208 stays open, D2-held, and awaiting gated rework disposition.

Also audited: phantom IRCarrier parameter notes are 🟢 not dissolution-class findings — dead-generic-parameter polish only, with no walker, predicate, carrier, or emit-template obligation. This consolidated note covers future re-flags of the same held/rework classes. — sent from zesty-fox-441

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 995869ea · Trigger: manual
  • Comparison: main @ 92cb2640 ... session/zesty-fox-441 @ 995869ea
  • Conversation: View conversation

1. Story of the diff

This PR turns the v4 Lean and machine-code language-model files from scaffold prose into declarative .dag model surface. src/v4/extdeps/languages/lean.dag now models Lean names, universe levels, term forms, termination clauses, proof artifacts, fidelity features/dispositions, proof-check semantics, and primitive alias rows. src/v4/extdeps/languages/machine_code.dag now models ISA family/revision, byte order, instruction length/word, operand/register/addressing structures, instruction productions, decoded instructions, fidelity disposition, integer operation semantics, and primitive alias rows. src/v4/DECISIONS.md adds the #3208 Practice-4 ledger so the .dag files can stay terse while the coproduct terminal/scaffold reasoning lives centrally.

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation). Finding — BLOCKING. This diff is substrate/modeling work, not implementation-only Rust. The new per-language fidelity-disposition substrate types duplicate the same shape: src/v4/extdeps/languages/lean.dag:165-168 declares LeanFidelityDisposition = LeanModeled | LeanDeclaredNormalized { feature } | LeanFailClosed { feature }, and src/v4/extdeps/languages/machine_code.dag:226-229 declares the same MachineFidelityDisposition shape. That is two authorities for the same C5 disposition structure; the language-specific feature enum can vary, but the disposition carrier itself is a generic Disposition<Feature> family rather than two substrate siblings.
  2. INVARIANTS.md + modeling-discipline.md. Finding — BLOCKING. Practice-4 pattern 5 / projection-over-enumeration is missed in the new ledger: src/v4/DECISIONS.md:78-79 explicitly asks whether a coproduct is “one F<X> family rather than a closed coproduct,” but src/v4/DECISIONS.md:94 and src/v4/DECISIONS.md:113 mark LeanFidelityDisposition and MachineFidelityDisposition as GREEN terminal even though the changed carriers at lean.dag:165-168 and machine_code.dag:226-229 are mechanically the same Modeled | DeclaredNormalized<Feature> | FailClosed<Feature> family. This should be one shared parameterized carrier, with per-language feature enums and disposition functions reading it.
  3. CODING.md. N/A — no Rust implementation surface is changed; the added functions are .dag model functions, not src/v3/compiler/src/ Rust style decisions.
  4. TESTING.md. N/A — the diff does not add an executable consumer or Rust behavior path; it is declarative v4 language-model data plus a decision ledger. I would expect parser/runner receipts when these models become an executed consumer surface, but I do not see a test-discipline violation in this diff alone.
  5. LOCKED DESIGN DECISIONS. Finding — BLOCKING. The current DECISIONS.md context in this same diff says src/v4/DECISIONS.md:62: “D2 / D4 REVERSED — fact-bundle modeling supersedes alias-identity” and calls the fact-density/hollow-alias gate a hard prerequisite of T-4. The changed language-model headers still say src/v4/extdeps/languages/lean.dag:5 and src/v4/extdeps/languages/machine_code.dag:5: “D2-hard-held; fact-bundle rework gated,” while the model lands bare aliases such as src/v4/extdeps/languages/lean.dag:195 type LeanInt = Int and src/v4/extdeps/languages/machine_code.dag:267 type MachineI32 = Int32. If v4 T-4.13/L-4 Lane C: model machine_code.dag + lean.dag — language-models bundle (D2 resolver shape: alias-identity + grounding-map + operation-semantics, NOT re-declared algebra inhabitance per DECISIONS.md D2; D2 scope-negative = inhabitance-form-only NOT LanguageModel-grammar; declarative-first, #3208 is intentionally landing under pre-reversal D2, the PR needs an explicit PM/operator reconciliation against the now-present D2-REV authority; as written, it postpones a hard prerequisite inside the T-4 language-model surface.
  6. TRACKED vs UNTRACKED DEBT. Compliant for the explicit scaffold that is introduced. InstructionWord is marked as a tracked scaffold in src/v4/DECISIONS.md:103, the in-file bound is concrete at src/v4/extdeps/languages/machine_code.dag:69-73 (Instr16/Instr32/Instr64/Instr128), and the dissolution trigger is named as landing fixed-cardinality/Nat-indexed width carriers in std/machine.dag or std/cardinality.dag.

2.5. Top-down PM intent review

Finding — BLOCKING. The PM-level intent currently present in the diff says fact-bundle modeling supersedes alias identity and makes the hollow-alias gate a hard prerequisite of T-4 at src/v4/DECISIONS.md:62. The changed files instead encode a gated/deferred posture at src/v4/extdeps/languages/lean.dag:5 / src/v4/extdeps/languages/machine_code.dag:5 and land old-shape aliases at lean.dag:193-200 and machine_code.dag:265-275. That is exactly the semantic dilution the PM review is meant to catch: a hard prerequisite becomes “fact-bundle rework gated” without a same-PR authority reconciliation.

3. Verdict

REQUEST_CHANGES. The declarative modeling direction is right, and the InstructionWord scaffold is properly bounded, but two substrate-level issues need correction before landing: the duplicated fidelity-disposition carrier should be dissolved into a shared parameterized shape, and the D2-REV fact-bundle prerequisite needs either implementation or explicit PM/operator reconciliation rather than being deferred by status text and alias rows.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: e1d6270f · Trigger: schedule
  • Thinking: 291s wall

BLOCKING (1)

Root Cause

  • src/v4/extdeps/languages/machine_code.dag RegisterClass was introduced as a standalone carrier instead of a register-declaration authority → add a RegisterDeclaration/Ref shape carrying isa/name/class and make operand slots consume that single authority.

⚠️ The prior fixes are substantial, but the register-class fact needs to be structurally attached before this substrate model lands.

}


// Anchor: https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html

This comment was marked as resolved.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 2b435082 · Trigger: manual
  • Comparison: main @ 125fc88c ... session/zesty-fox-441 @ 2b435082
  • Conversation: View conversation

1. Story of the diff

This PR turns two v4 external-language fixtures into declarative language-model bundles and moves the detailed coproduct rationale into src/v4/DECISIONS.md so the .dag files can stay terse. lean.dag now models Lean-side declaration kinds, names, universe levels, term forms, termination evidence, proof artifacts, fidelity coverage, and proof-check semantics; machine_code.dag models ISA families, byte order, instruction-width scaffolding, register/operand/addressing forms, instruction productions, operand bindings, decoded instructions, fidelity coverage, and operation semantics. The load-bearing mechanism is “declarative first”: each carrier has an in-file coproduct classification tag, while DECISIONS.md carries the P4-3208 ledger for why each coproduct is terminal or tracked. The main risk is not the overall direction; it is that some of the new model still lands as aliases or duplicated per-language families exactly where the uploaded modeling rules say the v4 language-model work must not normalize hollow/parallel substrate shapes.

2. Invariant categories

1. LAYER MODEL (substrate vs implementation)

Finding — BLOCKING substrate issue. This is substrate work, not file-scoped Rust implementation: the PR adds new v4 language-model carriers such as LeanFidelityDisposition at src/v4/extdeps/languages/lean.dag:175 and MachineFidelityDisposition at src/v4/extdeps/languages/machine_code.dag:247, plus target primitive aliases at src/v4/extdeps/languages/machine_code.dag:288-298. Because these are extdeps language substrate declarations, the hollow-alias and duplicated-family findings below are blocking rather than cleanup.

2. INVARIANTS.md + modeling-discipline.md

Finding — P1 Modeling Faithfulness / Practice 8 fact-bundle modeling. The diff still declares external primitive identities as bare aliases: type LeanUInt8 = UInt8 through type LeanUInt64 = UInt64 at src/v4/extdeps/languages/lean.dag:207-210, and type MachineI8 = Int8 through type MachineU128 = UInt128 at src/v4/extdeps/languages/machine_code.dag:288-298. The uploaded modeling discipline says external spec primitives must either carry their own fact-bundle or cite proven coincidence evidence; a bare alias with no coincidence evidence is hollow and blocks review (modeling-discipline.md:290-327, modeling-discipline.md:373-397; also INVARIANTS.md:94-100). The local status lines, // Status: D2-hard-held; fact-bundle rework gated. at lean.dag:5 and machine_code.dag:5, acknowledge the gap but do not make the aliases valid substrate.

Finding — Practice 7 projection over enumeration / Practice 4 pattern 5. LeanFidelityDisposition and MachineFidelityDisposition are the same mechanical family over different feature carriers: both are Modeled | DeclaredNormalized { feature } | FailClosed { feature } at src/v4/extdeps/languages/lean.dag:175-178 and src/v4/extdeps/languages/machine_code.dag:247-250. DECISIONS.md even describes the Lean case as sharing the “same C5-modeled / normalized / fail-closed disposition” at src/v4/DECISIONS.md:94, and repeats the same shape for machine code at src/v4/DECISIONS.md:113. That is a parameterized family smell: the faithful shape is one generic disposition carrier over the feature type, not one duplicated per-language coproduct that future language files will copy again.

3. CODING.md

N/A — no Rust implementation code is introduced. The diff is declarative .dag model data plus a DECISIONS.md ledger, so CODING.md’s Rust implementation rules around free functions, mutation, panic surfaces, and module shape do not materially apply. The small .dag functions that are present, such as lean_feature_disposition and machine_feature_disposition, are simple data mappings rather than hidden imperative machinery.

4. TESTING.md

N/A — data-model-only diff; no executable behavior or Rust test harness is added. I do not see new Rust runtime behavior or target emission code in the diff that would demand a unit/integration test under TESTING.md. The PR’s validation burden is primarily structural review of the modeled declarations and ledger entries, not runtime behavior. The blocking issues above are modeling-shape issues, not missing-test issues.

5. LOCKED DESIGN DECISIONS

Finding — D2/D2-REV conflict is not reconciled in the diff. The PR explicitly marks both files as D2-hard-held; fact-bundle rework gated at src/v4/extdeps/languages/lean.dag:5 and src/v4/extdeps/languages/machine_code.dag:5, but the uploaded invariant/reference context says D2-style external primitive aliases were reversed because they asserted unproven identities and modeled nothing (INVARIANTS.md:94-100). The alias declarations at lean.dag:207-210 and machine_code.dag:288-298 therefore need either fact bundles now or explicit coincidence evidence / PM-level reconciliation in DECISIONS.md; the current “gated” status line is not enough for a locked design divergence.

6. TRACKED vs UNTRACKED DEBT

Compliant for the explicit InstructionWord scaffold. InstructionWord is correctly marked with a tracked scaffold tag in-file at src/v4/extdeps/languages/machine_code.dag:72-77, and the ledger gives a bounded trigger: it dissolves when fixed-cardinality or Nat-indexed width carriers land in std/machine.dag or std/cardinality.dag at src/v4/DECISIONS.md:103. That has the three required parts: documentation, bounds, and a named dissolution trigger.

The primitive alias issue is not counted as acceptable tracked debt here because the relevant authority frames hollow aliases as a blocked modeling shape, not merely a scaffold.

2.5. Top-down PM intent review

Finding — PM-level semantic dilution of grounding completeness. The thesis-level intent requires target-side primitive types to be structurally modeled from the target language reference, with grounding by structural algebra/homomorphism rather than string/name shortcuts (THESIS.md, “Grounding completeness”; also modeling-discipline.md:290-327). This PR lands the Lean and machine-code primitive surfaces as direct aliases instead: type LeanUInt8 = UInt8 at src/v4/extdeps/languages/lean.dag:207 and type MachineI8 = Int8 through the rest of the machine integer family at src/v4/extdeps/languages/machine_code.dag:288-298. That changes the practical execution of the plan from “model the external primitive facts” to “land aliases and defer fact bundles,” without a concrete reconciliation that would let a worker know these aliases are grandfathered, temporary, or proven coincidences.

3. Verdict

REQUEST_CHANGES

The PR’s declarative-first direction and coproduct ledger structure are mostly aligned, and the InstructionWord scaffold is properly tracked. But the diff still lands hollow external primitive aliases and duplicates a mechanically parameterized disposition family across language files; both are substrate-level shapes likely to be copied by future language models, so they should be fixed before merge.

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified against current head 9ca3e4e8: the reported shapes are present. lean.dag still has the Lean primitive alias block, machine_code.dag still has the Machine primitive alias block, and both files still contain the per-language C5 fidelity disposition coproducts plus lean_feature_disposition / machine_feature_disposition functions.

These are not being fix-forwarded in this held PR because they are already recorded as held/rework-class content in src/v4/DECISIONS.md under #3208 held dissolution dispositions: primitive alias rows are 🟡 bound to the post-D2-REV fact-bundle rework, and the shared C5 fidelity disposition carrier / disposition-row conversion is 🟡 bound to the same post-D2-REV shared-C5-fidelity / fact-bundle rework. Trigger: the T-4 fact-bundle rework executes after T-30 and the remaining T-4 feeders clear.

So the finding is valid against the current held content, but intentionally not fixed inside this D2-shaped branch. #3208 remains open, D2-HARD-HELD, and not a merge candidate pending the gated fact-bundle rework. This is the same held/rework class covered by the prior consolidated disposition note; no code change is appropriate here. — sent from zesty-fox-441

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 2fe0c2b0 · Trigger: schedule
  • Thinking: 327s wall

BLOCKING (1)

Root Cause

  • src/v4/extdeps/languages/machine_code.dag The strict header collapse retained only the Intel anchor while the ISA family stayed multi-spec → give each modeled ISA family a versioned spec authority in the model/ledger or remove unanchored families from this slice.

⚠️ One grounding gap remains in the machine-code ISA family surface.

// 🟢 coproduct dissolution — DECISIONS.md P4-3208
type IsaFamily
= X86_64Isa
| Aarch64Isa

This comment was marked as resolved.

@briansrls
briansrls merged commit b6efb25 into main May 18, 2026
2 checks passed

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: f4c05a9f · Trigger: schedule
  • Thinking: 389s wall

BLOCKING (1)

Root Cause

  • src/v4/extdeps/languages/lean.dag Lean proof-term substrate was modeled from source-level names instead of Lean Expr identity/context → model bound/free variable identity and add or fail-close missing Expr constructors before claiming LeanKernelTerm is modeled.

⚠️ One Lean kernel-term fidelity gap remains blocking.



fn lean_feature_disposition(f: LeanFidelityFeature) -> LeanFidelityDisposition {
match f {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKING: LeanKernelTerm is declared modeled while LeanTermForm still omits Lean Expr constructors such as bound/free variable identity, projection, and literals and uses name-keyed LeanVar, so capture-sensitive proof terms are representable incorrectly under INVARIANTS.md P1/P2; Lean Expr reference: https://ammkrn.github.io/type_checking_in_lean4/expressions/expressions.html.

briansrls added a commit that referenced this pull request May 18, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request May 18, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request May 18, 2026
…-bundle rework (operator-flagged 2026-05-18: merged with the D2-reversal-wrong shape, operator expected it fixed) (#3280)

* WIP: D2 cleanup ASAP — #3208 lean.dag + machine_code.dag bare-alias → fact-bu

* WIP: D2 cleanup ASAP — #3208 lean.dag + machine_code.dag bare-alias → fact-bu

* WIP: D2 cleanup ASAP — #3208 lean.dag + machine_code.dag bare-alias → fact-bu

* WIP: D2 cleanup ASAP — #3208 lean.dag + machine_code.dag bare-alias → fact-bu

* WIP: D2 cleanup ASAP — #3208 lean.dag + machine_code.dag bare-alias → fact-bu

* fix(ci): SG-0 net-shrink append for PR #3280 (+3 hand paths)

CI prepends this file so the SG-0 hand-path delta matches the census edit
and carries a (c) pairing with dispatch evidence for gunbc#3280.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(lean): ground signed fixed-width Int8–Int64 and ISize for Lean 4.20

Align extdeps fidelity with the fixed-precision integer surface: std
coincidence + GroundingMap spellings for Int8/16/32/64 and platform ISize
(IntPlatform), matching the existing UInt* ladder. P4-3208 ledger row
updated to cite the signed aliases.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(lean): single-line Symbol twin note (Practice 9)

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs(INVARIANTS): P2 receipt for extdeps GroundingMap/Symbol twins

Single-file compile_to_dag smokes cannot resolve a shared resolver import
today; document the interim structural twin + dissolution trigger so the
pattern is P2-staging, not silent duplicate authority (addresses D4/P2 review).

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs(DECISIONS): align #3208 C5 bullet with removed disposition fns

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(extdeps): align lean/machine_code numerics with D2-REV

Remove hollow std int aliases and spelling-only GroundingMap rows; keep
LeanScalar/MachineScalar fact bundles and explicit displacement records.
Update P4-3208 ledger, INVARIANTS §P2 interim receipt.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore(extdeps): Practice-9 terse .dag headers; move cpp deferral to DECISIONS

Drop redundant multi-line D2 rationale from lean/machine_code sources;
shorten Status lines; record non-Bool cpp scalar deferral under P4-3208.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(machine_code): pin disp32/disp64 width classes per api-review

Disambiguate displacement records with collapsed width sums so a
32-bit-class slot cannot carry Bits64 at the type level; update P4-3208.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(machine_code): v2-bootstrap parse for singleton width-class sums

v2 treats `type T = Foo` without `{` or `|` as a type alias; use empty
record variants `Foo {}` so displacement width classes stay nominal sums
and v4 CI (v2 compile all .dag) passes.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: signed-only displacement width, SG-0 path order, Lean ledger map

Drop MachineIntKind from signed displacement records (nominal signedness).
Lex-sort EXPECTED_HAND_AUTHORED_TEST extdeps smoke paths. P4-3208: map Lean
fixed-precision anchor types onto IntScalar arms; align machine_code rows.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(cpp): C++ lex.key anchor for CppBool + P4-3208 authority receipt

Add WG21 draft anchor on cpp_bool surface; ledger cites C++ spec, not
RustBool, as coincidence authority (api-review / INVARIANTS P1 cite).

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls
briansrls deleted the session/zesty-fox-441 branch June 1, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant