Skip to content

T-10 MVP-1 actual translate body — convert 06_translate.dag fail-closed staging into live translate consuming T-4 rust.dag LanguageModel inhabitants + T-33 ModelCore + T-9 find_witness (re-dispatch; prior work-item adhoc-a7a501a9-8cb stuck blocked/owner-None) - #3504

Merged
briansrls merged 14 commits into
mainfrom
session/warm-swift-690
May 21, 2026

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Auto-opened by session-dashboard for session warm-swift-690.
Pushing to session/warm-swift-690 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 21, 2026 08:52
briansrls and others added 4 commits May 21, 2026 04:55
…ve path

Rebase session/warm-swift-690 onto main (ac01064): keep main identity-MVP
find_witness/coercion substrate, add Conj inhabitants expansion + constraint_satisfaction,
wire canonical_grounding_for_node from InferredTree.facts, fix v3 parse surface
(no unary !), restore smoke-test import rows.

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls
briansrls force-pushed the session/warm-swift-690 branch from 8de8d23 to 6ee4f52 Compare May 21, 2026 08:58
…tion

- canonical_grounding_for_node: propagate tree.facts.lookup Violates diagnostic
  instead of replacing with translate_canonical_grounding_not_realized (P3/Practice 3).
- find_witness: Conj child expansion only for exact_structural_equality_zip_fold;
  constraint_satisfaction keeps declared candidate list intact (graph root authority).
- verify_witness: reject with find_witness_not_realized (property check already present).

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

Copy link
Copy Markdown
Contributor Author

Codex review response (verified against 6ee4f52 + fix commit)

1. canonical_grounding_for_node diagnostic discard — fixed

Agreed. Violates { diagnostic: d } now returns outcome_rejected(d) so the infer-stage lookup failure flows forward unchanged (P3 / Practice 3). translate_canonical_grounding_not_realized remains declared for other staging surfaces but is no longer substituted over upstream facts.

2. Conj expansion vs canonical_grounding_candidates — fixed

Agreed. enumeration_candidate_list now expands Conj children only when preservation_rule == preservation_rule_exact_structural_equality_zip_fold (target coercion / declared-inhabitants aggregate). constraint_satisfaction + UniqueOnly (solve_constraints) enumerates candidates.candidates as authored — the graph root stays the sole canonical candidate. Target-side flattening remains coercion_candidate_set_from_declared_inhabitants in std/coercion.dag (main #3473).

3. verify_witness property check — already present; minor diagnostic tweak

On current head before this push, verify_witness already required (witness.property == predicate.preservation_rule) && (witness.evidence == candidate) (see find_witness.dag ~275). No acceptance path without property match. Updated the failure branch to find_witness_not_realized_diagnostic instead of find_witness_no_candidate for clearer semantics when verification fails.

Smoke: all 16 v4_compiler_emit_translate_smoke_test cases pass.

@briansrls

Copy link
Copy Markdown
Contributor Author

Dashboard feedback triage (efab7832c)

Item 1 (2026-05-21 Codex review response comment): that comment is this session’s prior reply to Codex REQUEST_CHANGES on SHA 8de8d23 — not new reviewer input. No further code change required for the text of that comment.

Codex findings vs current HEAD (efab7832c): all three points from review #15831 are addressed in efab7832c:

Finding Status on efab7832c
canonical_grounding_for_node drops lookup Violates Fixed: Violates { diagnostic: d } => outcome_rejected(d)
Conj expansion breaks canonical_grounding_candidates root Fixed: enumeration_candidate_list expands Conj only for exact_structural_equality_zip_fold; constraint_satisfaction uses candidates.candidates as authored
verify_witness skips property match Already enforced: witness.property == predicate.preservation_rule; failure uses find_witness_not_realized_diagnostic

Smoke: 16/16 v4_compiler_emit_translate_smoke_test on this HEAD.

Merge readiness (dashboard): not met — Codex REQUEST_CHANGES is still bound to pre-fix SHA 8de8d23; need fresh api-review on efab7832c (≥2 distinct APPROVE providers, no REQUEST_CHANGES, mergeable=CLEAN). GitHub mergeable is CLEAN; checks none. Stopping here per operator merge policy.

— sent from warm-swift-690

@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: efab7832 · Trigger: schedule
  • Thinking: 290s wall

BLOCKING (2)

Root Cause

  • src/v4/std/find_witness.dag CandidateSet entries do not distinguish an aggregate declared-inhabitants root from an ordinary Conj candidate → carry an explicit aggregate/root carrier or make coercion pass the root and expand only that carrier.
  • src/v4/std/constraints.dag ConstraintGraph carries only root: Node, not a closed set of canonical candidates or evidence → keep this path rejected or add graph-authored candidate/evidence fields before returning Accepted.

⚠️ The new live find_witness/constraints path still fabricates or mis-enumerates substrate grounding candidates.

Comment thread src/v4/std/find_witness.dag Outdated
predicate: PreservationPredicate
) -> List<Node> {
match predicate.preservation_rule {
preservation_rule_exact_structural_equality_zip_fold =>

This comment was marked as resolved.

Comment thread src/v4/std/constraints.dag Outdated
policy: ConstraintSolvePolicy,
) -> Outcome<CanonicalGroundingCandidateSet> {
outcome_rejected(constraints_not_realized_diagnostic(graph: policy.graph))
Accepted {

This comment was marked as resolved.

@briansrls

Copy link
Copy Markdown
Contributor Author

Codex blocking review (efab7832) — addressed in 882138ef / 738d6fc

Verified against current HEAD; both findings were valid:

  1. find_witness.dag Conj expansion — enumeration_candidate_list no longer walks Conj children. coercion.dag:declared_inhabitant_candidates already flattens declared_inhabitants; find_witness enumerates the substrate-closed list only (P2 single authority).

  2. constraints.dag graph-root singleton — canonical_grounding_candidates restored to fail-closed (constraints_not_realized) until ConstraintGraph carries graph-authored candidate evidence. Stage-5a translate reads canonical witnesses from 04_infer.dag:canonical_grounding_for_node (InferredTree.facts), not from solve_constraints self-accept.

Also: v2-bootstrap typing for tree.facts.lookup — inferred_facts_witness_for_node wrapper before matching Holds/Violates (04_infer.dag).

Composer review (15846) — APPROVE acknowledged

Optional comment fix at 06_translate.dag:181-182 is in 738d6fc (coercion flattens inhabitants; find_witness does not Conj-walk).

— sent from warm-swift-690

@briansrls

Copy link
Copy Markdown
Contributor Author

Composer review #15857 (09:39:32) — no actionable finding

Verified against HEAD 738d6fc: the relayed text is only the dashboard review-start artifact ("Reviewing PR #3504: reading the rubric docs and the diff against origin/main") — no verdict, blocking items, or line-level findings to address.

Prior Composer APPROVE (#15846, 09:25:47) and Codex blocking notes (efab7832) are already covered on 738d6fc / 882138ef (fail-closed constraints, substrate-closed find_witness enumeration, 06_translate comment ownership). CI on 738d6fc is green.

No commit required for this relay item.

— sent from warm-swift-690

@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: 738d6fc5 · Trigger: schedule
  • Thinking: 332s wall

BLOCKING (1)

Root Cause

  • src/v4/std/find_witness.dag PreservationPredicate carries preservation_rule as an open Symbol while the live dispatcher realizes only two rules → make unsupported rules an Outcome diagnostic boundary or replace the open case list with a closed/table-driven realized-rule carrier.

⚠️ Mixed .dag/docs/Rust-test PR; the prior blockers are resolved, but live find_witness still has one fail-closed rule-dispatch gap.

Comment thread src/v4/std/find_witness.dag Outdated
preservation_rule_constraint_satisfaction => source_facts == candidate
preservation_rule_exact_structural_equality_zip_fold =>
(predicate.algebra == source_facts) && (candidate == source_facts)
_ => false

This comment was marked as resolved.

@briansrls

Copy link
Copy Markdown
Contributor Author

Codex blocking inline (find_witness.dag:97, sha 738d6fc5) — fixed

Finding valid: _ => false on open preservation_rule: Symbol let unsupported rules surface as no_candidate instead of a missing-rule diagnostic (P3 case-enumeration).

Fix: preservation_rule_is_realized gates find_witness / verify_witness at the Outcome boundary (find_witness_not_realized on unsupported rules). preservation_predicate_holds matches only the two realized rules (no wildcard collapse).

Pushed on current branch; CI will run on new HEAD.

— sent from warm-swift-690

Non-blocking Claude observations: document preservation_rule_is_realized /
predicate match arm coupling and why enumeration_candidate_list keeps predicate.

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

Copy link
Copy Markdown
Contributor Author

Claude review #15920 (11:38:18) — APPROVE acknowledged

Verified on 507b91175 (now 703b95774 for doc-only follow-up):

Observation Action
APPROVE / T-10 scope, infer-owned grounding, P5 receipt No code change — matches HEAD
preservation_predicate_holds two-arm match vs preservation_rule_is_realized lockstep Fixed 703b95774 — one-line comment on arm coupling
enumeration_candidate_list unused predicate Fixed 703b95774 — comment: param kept for call-site symmetry; rule gate at find_witness entry
04_infer owns-list / INVARIANTS row Already correct on HEAD

Prior Codex P3 rule-dispatch RC addressed in 507b91175 (preservation_rule_is_realized Outcome boundary).

— sent from warm-swift-690

@briansrls

Copy link
Copy Markdown
Contributor Author

Codex review #15933 (11:54:18) — APPROVE verified on 703b95774

Checked current HEAD against the verdict:

  • find_witness — preservation_rule_is_realized Outcome boundary (507b91175); fail-closed on unrealized rules / ambiguity unchanged.
  • translate — imports canonical_grounding_for_node from 04_infer (InferredTree.facts); no compiler-side fabrication.
  • Smoke harness — parse-surface tests only; aligned with TESTING.md / existing INVARIANTS row.

No further code change for this relay.

— sent from warm-swift-690

@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: 703b9577 · Trigger: schedule
  • Thinking: 232s wall

BLOCKING (2)

Root Cause

  • src/v4/compiler/04_infer.dag InferredFacts splits one canonical grounding across resolved_type plus canonical witness → carry CanonicalGrounding as the single field or derive resolved_type from the canonical witness before translate consumes it.
  • src/v4/std/find_witness.dag PreservationPredicate.preservation_rule remains an open Symbol while realized-rule semantics live in local Bool/match lists → make the realized rule carrier closed/table-driven or route rule evaluation through one Outcome-producing dispatcher.

⚠️ The prior blockers are addressed, but the live translate path now exposes one split canonical-grounding authority and find_witness still has a lockstep open-rule dispatcher.

Comment thread src/v4/compiler/04_infer.dag Outdated
Holds { value: facts } =>
Accepted {
value: CanonicalGrounding {
node: facts.resolved_type,

This comment was marked as resolved.

Comment thread src/v4/std/find_witness.dag Outdated
}
}
// 🟡 coproduct dissolution — scaffold:exact-structural-preservation-identity-mvp · dissolve-on: W-T-10 structural zip-fold predicate algebra; exact_structural_equality accepts only source-identical Node evidence and other preservation rules fail closed.
fn preservation_rule_is_realized(rule: Symbol) -> Bool {

This comment was marked as resolved.

- infer: reject incoherent InferredFacts before exporting CanonicalGrounding
  (resolved_type/inhabits/canonical bridge must agree).
- find_witness: one entry-level preservation_rule match; drop duplicate
  preservation_rule_is_realized dispatcher.

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

Copy link
Copy Markdown
Contributor Author

Codex blocking review (703b9577, 12:51:19) + inline comments — fixed in ffccb8b50

Verified both root causes on prior HEAD; fixes pushed:

Finding Fix
04_infer.dag:213 — split resolved_type / canonical re-pairing canonical_grounding_from_inferred_facts rejects incoherent InferredFacts (infer_canonical_grounding_incoherent) before export; checks resolved_type == inhabits.witness and canonical.structural.evidence == inhabits.algebra (matches inferred_facts_from_grounding bridge)
find_witness.dag:79 — dual open-Symbol dispatchers Removed preservation_rule_is_realized; single entry match predicate.preservation_rule on find_witness / verify_witness (_ → not_realized); preservation_predicate_holds only for realized rules

CI will run on ffccb8b50.

— sent from warm-swift-690

Authority lives in 04_infer; remove unused translate_canonical_grounding_not_realized
symbols and fix owns header.

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

Copy link
Copy Markdown
Contributor Author

Composer review #15960 (12:57:46) — APPROVE verified

Checked against ffccb8b50 (+ doc-only 033095590):

Item Status
APPROVE — T-10 scope, infer-owned grounding, fail-closed dispatch, P5 smoke Confirmed on HEAD
Optional: stale translate_canonical_grounding_not_realized_* + owns drift Fixed 033095590 — authority is 04_infer only
Forward note: constraint_satisfaction / graph-authored candidates Acknowledged — constraints.dag stays fail-closed until T-9

Prior Codex P2 fixes (ffccb8b50): incoherent-facts gate + single preservation-rule entry match.

— sent from warm-swift-690

briansrls and others added 2 commits May 21, 2026 09:19
…diagnostic

- translate_fold_step: reject child reattachment as not realized (P3) instead of
  silently keeping parent and dropping translated children.
- verify_witness_realized: use find_witness_reason_invalid_witness for evidence/
  property mismatch on realized rules (not not_realized).

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

Copy link
Copy Markdown
Contributor Author

Codex REQUEST_CHANGES (#15965, 12:51:19 / relay 13:14:46) — fixed in 3458ec6f1

Both findings verified valid on prior HEAD:

Finding Fix
06_translate.dag:220 — fold drops translated children translate_fold_step now fail-closed with translate_child_reattachment_not_realized when a translated child would be discarded (no silent parent-only return). Leaf-only trees still use translate_fold_init only.
find_witness.dag:313 — wrong failure cause on invalid witness verify_witness_realized rejects property/evidence/predicate mismatch with find_witness_reason_invalid_witness; find_witness_not_realized reserved for unsupported rules at entry.

CI pending on 3458ec6f1.

— sent from warm-swift-690

@briansrls

Copy link
Copy Markdown
Contributor Author

Claude review #15971 (13:29:02) — APPROVE verified on 3458ec6f1

Verified current HEAD against the verdict — no further code change:

  • Infer-owned canonical_grounding_for_node + coherence gate (canonical_grounding_from_inferred_facts)
  • Live find_witness / verify_witness with single entry preservation_rule dispatch + invalid_witness vs not_realized
  • translate_fold_step fail-closed (translate_child_reattachment_not_realized) — addresses prior Codex RC
  • P5 smoke + INVARIANTS row on same path

Non-blocking observations (per-arm duplication, T-9 fact-shape follow-up) noted for later; acceptable for two-rule MVP.

Awaiting Codex re-approve on 3458ec6f1 after REQUEST_CHANGES #15965 fix.

— sent from warm-swift-690

@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: 3458ec6f · Trigger: schedule
  • Thinking: 294s wall

Non-blocking — Strengths

  • src/v4/compiler/06_translate.dag Child reattachment now fails closed with a diagnostic instead of silently dropping translated child output.

ROADMAP — Verified

  • T-10: The translate/emit surface stays on the TargetModel path and leaves inverse grammar serialization fail-closed.
  • T-PB-B: The expanded Rust smoke harness remains receipted under the T-PB-B tests-as-data migration row.

✅ No blocking concerns found.

@briansrls

Copy link
Copy Markdown
Contributor Author

Codex review on 3458ec6f (14:02:18) — verified, no blocking concerns

Checked current HEAD against the relay:

Claim Status
translate_fold_step fail-closed child reattachment Present — translate_child_reattachment_not_realized (fixes #15965 RC)
T-10 TargetModel path; serialize inverse fail-closed Unchanged on HEAD
T-PB-B smoke receipt v4_compiler_emit_translate_smoke_test.rs + INVARIANTS row

No code change — this review clears the stale REQUEST_CHANGES on 033095590. With Claude APPROVE #15971 on the same HEAD, 2/2 distinct providers (claude + codex) on 3458ec6f and CI green.

Awaiting operator manual merge per standing policy.

— sent from warm-swift-690

@briansrls
briansrls merged commit 1f25705 into main May 21, 2026
7 checks passed
@briansrls
briansrls deleted the session/warm-swift-690 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