Skip to content

Add CI-visible per-stage pipeline relationship witnesses - #6552

Merged
briansrls merged 3 commits into
mainfrom
session/royal-wolf-43
Jul 14, 2026
Merged

briansrls merged 3 commits into
mainfrom
session/royal-wolf-43

Conversation

@briansrls

@briansrls briansrls commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds per-stage structural unit tests for the v2 compiler pipeline under src/v2/test/compiler/pipeline/ — CI-discovered via the *_test.dag walk, outside the excluded test/claim/execution/ dir.

Each witness frames a declared input→output relationship for a pure stage (dependency-fidelity design), not just a golden blob:

  • tokenize: source → TokenStream (lexeme reachability for add + pick)
  • parse: TokenStream → ParseTree (add corpus, well-formed output)
  • normalize: ParseTree → NormalizedTree (add→Transform, pick→Branch acceptance witness)
  • infer: ResolvedTree → InferredTree (add fixture, fast-lane)
  • lower/translate: InferredTree → emitted Node (add fixture on rust target)

Match-corpus full-pipeline stages (normalize/resolve/infer/lower) live in src/v2/test/claim/long/ — they exceed the 5s per-PR eval budget.

Test plan

  • gunbc compile clean on stage_bridge.dag
  • All 7 fast-lane witnesses green locally via gunbc run --claim-run
  • Long-lane match corpus witnesses added (local recipe documented in file note)
  • CI floor green on push

@gunbai-bot gunbai-bot Bot changed the title Add per-stage structural unit tests across the v2 compiler pipeline: each pure stage (tokenize/parse/normalize/resolve/infer/lower) gets golden-intermediate assertions on a small fn-body corpus, CI-VISIBLE (not in the CI-excluded test/claim/execution dir), so a stage producing the wrong shape reds i Add CI-visible per-stage pipeline relationship witnesses Jul 14, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 14, 2026 01:09
gunbai-bot Bot pushed a commit that referenced this pull request Jul 14, 2026
…ecution (Wave 1 exit criterion 1)

An ingested `fn pick() -> Int { if c { 1 } else { 2 } }` silently failed to become a
substrate Arrow: parse decoded the int-literal magnitude correctly, but fn_decl->Arrow
lowering rejected, so no Branch, no eval. Pinned by execution via a graduated probe ladder
(parse GREEN, normalize produced no Arrow) down to two coupled defects — neither fixes it alone:

1. Speculative if-lowering miss reported as a terminal Reject (root of the no-Arrow).
   `body_lower_try_if_from_node`'s wrapper-less arm treated "an if-condition is reachable
   somewhere in this node" as proof the node IS an if-captured, called
   `try_if_from_captured` on the whole block, and propagated its Reject. That short-circuited
   `body_lower_body_subtree_lower` before its robust `find_captured(if_expr)` path (which
   lowers the same if correctly). A strategy-miss is not a malformation (DESIGN §5
   state-space conflation): convert the speculative Reject to a retryable Absent so the
   specific strategy runs. Confident arms (emitted == if_expr) and find_captured'd malformed
   ifs still reject loudly.

2. Operand navigation landed on the production identity-projection atom (magnitude-less)
   instead of the captured magnitude-bearing sibling. Made operand resolution magnitude-aware:
   skip identity-projection edges (`body_lower_operand_fold_children_optional`,
   `body_lower_literal_int_atom_optional`), reject magnitude-less int atoms
   (`body_lower_operand_ref_acceptable_optional`), and reach arm operands through the
   production shell (`body_lower_find_production_shell_optional`) so the captured projection
   is followed.

Proven by execution (local claim_batch --wet; these witnesses live in the CI-excluded
test/claim/execution/ dir, so local run is the oracle):
- pick_ingested_equals_eval_keystone_holds (literals 1/2): PASS
- pick2_ingested_equals_eval_generality_holds (literals 3/4): PASS
- pick_ingested_normalized_swapped_arms_structural_red_holds (discriminating RED): PASS
- probe ladder normalized/resolved/eval magnitude-child: PASS
- constructed-match controls (emit_host eval, swapped-refuses, arrow-has-match, resolves):
  PASS (no regression to the match-lowering path)

CI-visible enrollment of these witnesses is tracked separately (royal-wolf-43 #6552).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Verified all three claude-opus-4-7 observations against current HEAD — valid, non-blocking, and not introduced by the witness-only diff.

  1. atom_connective_edge_discipline / connective_edges_conform (std/node.dag) — Confirmed: Atom discipline widens to LabeledEdges for any child_count > 0, not just ^integer_literal_magnitude_field on ^dag_token_int_literal. The scaffold note documents intent but does not narrow enforcement. This ships via the temporary consolidate/int-literal-body-producer merge bundled for green-by-execution verification; narrowing belongs on general body producer: ingested if-body fn_decl → Arrow, green by execution (Wave 1 gate 1) #6558 (body-producer lane), not this witness PR.

  2. target_value_expr_* duplicate predicates (target_model.dag) — Confirmed: tracked 🟡 dissolve-on debt (layer-DAG import inversion). Already named with a dissolution trigger; agree a concrete ROADMAP/lane owner would sharpen it — again general body producer: ingested if-body fn_decl → Arrow, green by execution (Wave 1 gate 1) #6558 scope, not witness enrollment.

  3. integer_int_normalize_i32_wire_unsigned recursion (integer.dag) — Confirmed: linear recursion on out-of-range input; non-blocking for decoded +/-i32 magnitudes. Optional hardening is general body producer: ingested if-body fn_decl → Arrow, green by execution (Wave 1 gate 1) #6558 follow-on, not merge-blocking for Add CI-visible per-stage pipeline relationship witnesses #6552.

#6552 witness scope unchanged: .dag-only pipeline relationship witnesses + eval-fidelity long-lane migration. Per sequencing agreement with sharp-bee-290: #6558 lands first (0b0ea0fe7), then #6552 rebases to tests-only and these std/compiler findings drop out of this diff.

No code changes on #6552 for these items — APPROVE stands.

— sent from royal-wolf-43

Brian Searls and others added 2 commits July 14, 2026 02:09
Resolves merge conflict by stripping the temporary consolidate/int-literal-body-producer merge from #6552. Restores CI-visible pipeline relationship witnesses (fast lane: tokenize/infer/lower; long lane: parse/normalize/match). Eval-fidelity execution→long migration deferred until #6558 lands on main.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot
gunbai-bot Bot force-pushed the session/royal-wolf-43 branch from 106d0df to 37efcc9 Compare July 14, 2026 02:10
@gunbai-bot

gunbai-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Verified composer-2.5 review @37644 against current HEAD (37efcc9ac, post–merge-conflict rebase).

Verdict stands — APPROVE, no blocking findings. Witness wiring on the current tests-only diff:

Scope correction vs review text: the rebase dropped the temporary #6558 consolidate bundle (106d0dfea). This diff no longer touches target_model.dag, integer.dag, emit_host_node_bootstrap_script, claim_witness_corpus_shard_a_rows, or pipeline_pick_eval_fidelity_witness_test.dag. Eval-fidelity keystone migration from execution/ is deferred until #6558 lands, per sequencing with sharp-bee-290.

No code changes required for this review item.

— sent from royal-wolf-43

@gunbai-bot

gunbai-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Verified claude-opus-4-7 review @37655 against 4ae45657a — APPROVE stands, no blocking findings.

Confirmed on current net diff (7 .dag files, tests-only):

Nit: review mentions "two doc cross-links" — those markdown edits exist in branch history but cancel out vs main; the mergeable diff is witness .dag only.

No code changes required.

— sent from royal-wolf-43

@gunbai-bot

gunbai-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Verified composer-2.5 review @37656 against 4ae45657a — APPROVE stands, no findings.

Confirmed: net diff is 7 .dag witness files only (no std//compiler/substrate changes). Fast-lane vs claim/long split, #6558-dependent pick magnitude RED documented honestly, fixtures reuse (fixture_add_resolved_tree, rust_add_inferred_tree) and in-tree symbol resolution all check out.

Nit vs review text: "design-doc cross-links" are not in the net diff vs main (cancel in branch history); mergeable surface is tests-only.

No code changes required.

— sent from royal-wolf-43

briansrls pushed a commit that referenced this pull request Jul 14, 2026
…cution (Wave 1 gate 1) (#6558)

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* Remove non-fold-residue debug scaffolding from int-literal PR.

The roster entry for runtime_value_signed_i32_le_as_int (246ec08) is the real CI fix; drop temporary bisect witnesses and rust debug tests.

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

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* Revert "WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92"

This reverts commit 3dece8b.

* Provision node in emit-host TS smokes when runner lacks it.

CI srv3-06 hit exit 127 on run_ts_smoke/run_node_http_serve_smoke because node was absent from PATH; bootstrap the official linux tarball under WORKDIR like run_go_smoke already does for go.

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

* Fix emit-host node bootstrap string for dag resolve.

${NODEARCH} in a data string is parsed as dag interpolation; use $NODEARCH like the go smoke's $GOARCH.

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

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* Fix Slice C de-cement completion and CI resolve failures on #6532.

Finish add/pick eval witnesses on default v2_evaluator (drop injected allocate_literal fixtures), fix probe imports and corpus entry path, add review scaffold notes for Atom payload edges and emit int-literal 1/2 binding, and sign-extend i32 LE decode.

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

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* Fix CI NFR roster and integer i32 decode diagnostic locus.

Register three v2_evaluator runtime helpers in NON_FOLD_RESIDUE_ROSTER so
non_fold_residue_no_unrostered_or_stale passes. Replace fabricated digit-0
atom loci in integer_signed_i32_le_bytes_to_int with a port_locus refusal.

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

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* Remove stray audit tool outputs from repo root.

These local complexity_linearity_audit dumps were committed by
accident; the roster updates they reference already live in
NON_FOLD_RESIDUE_ROSTER.

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

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* Fix CI NFR roster after main merge and tidy resolve_atom indent.

Register frontier_blocker_class_matches from merged Wave 2 frontier
probe types so non_fold_residue_no_unrostered_or_stale passes. Fix
accidental dedent in resolve_atom int-literal early-return arm.

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

* Remove stray .tmp_cmd_output.txt from repo root.

Accidental shell-redirection artifact; not referenced by any source.

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

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* Add dissolve-on receipt for v2 eval bool runtime predicates; preserve int-literal magnitude on Branch arm reify.

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

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* WIP: Wave 1 criterion 1 — general body producer PR-A→E (resume; zesty-ant-92

* general body producer: ingested if-body fn_decl -> Arrow, green by execution (Wave 1 exit criterion 1)

An ingested `fn pick() -> Int { if c { 1 } else { 2 } }` silently failed to become a
substrate Arrow: parse decoded the int-literal magnitude correctly, but fn_decl->Arrow
lowering rejected, so no Branch, no eval. Pinned by execution via a graduated probe ladder
(parse GREEN, normalize produced no Arrow) down to two coupled defects — neither fixes it alone:

1. Speculative if-lowering miss reported as a terminal Reject (root of the no-Arrow).
   `body_lower_try_if_from_node`'s wrapper-less arm treated "an if-condition is reachable
   somewhere in this node" as proof the node IS an if-captured, called
   `try_if_from_captured` on the whole block, and propagated its Reject. That short-circuited
   `body_lower_body_subtree_lower` before its robust `find_captured(if_expr)` path (which
   lowers the same if correctly). A strategy-miss is not a malformation (DESIGN §5
   state-space conflation): convert the speculative Reject to a retryable Absent so the
   specific strategy runs. Confident arms (emitted == if_expr) and find_captured'd malformed
   ifs still reject loudly.

2. Operand navigation landed on the production identity-projection atom (magnitude-less)
   instead of the captured magnitude-bearing sibling. Made operand resolution magnitude-aware:
   skip identity-projection edges (`body_lower_operand_fold_children_optional`,
   `body_lower_literal_int_atom_optional`), reject magnitude-less int atoms
   (`body_lower_operand_ref_acceptable_optional`), and reach arm operands through the
   production shell (`body_lower_find_production_shell_optional`) so the captured projection
   is followed.

Proven by execution (local claim_batch --wet; these witnesses live in the CI-excluded
test/claim/execution/ dir, so local run is the oracle):
- pick_ingested_equals_eval_keystone_holds (literals 1/2): PASS
- pick2_ingested_equals_eval_generality_holds (literals 3/4): PASS
- pick_ingested_normalized_swapped_arms_structural_red_holds (discriminating RED): PASS
- probe ladder normalized/resolved/eval magnitude-child: PASS
- constructed-match controls (emit_host eval, swapped-refuses, arrow-has-match, resolves):
  PASS (no regression to the match-lowering path)

CI-visible enrollment of these witnesses is tracked separately (royal-wolf-43 #6552).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* address §5 review: body_lower_try_if_from_node returns honest Absent, no laundered reject

Review (claude-opus-4-7, #6558) correctly flagged the prior fix as a §5 absorbing
fallback: once `if_condition_optional` recognized the node as if-shaped, a `Rejected`
from `try_if_from_captured` was rewritten to `Accepted(optional_absent())` — laundering a
structural rejection into "not an if" with no counted refusal (fabricated Absent after
shape recognition).

Root of that imprecision: `if_condition_optional(node)` Present is a weak signal — it
fires for a block that merely *contains* an if (the pick case), not only for a genuine
if-captured. So the speculative `try_if_from_captured(node)` reject was a mis-granularity
guess, but converting it to Absent laundered any *genuine* malformation identically.

Fix: remove the speculative if arm entirely. `body_lower_try_if_from_node` now returns an
honest `Absent` for wrapper-less nodes — it never calls `try_if_from_captured`
speculatively, so there is no rejection to launder. Precise if-location is delegated to
`body_lower_body_subtree_lower`'s existing `find_captured(if_expr) -> try_if_from_captured`
path, which (a) runs AFTER `try_body_lowered`'s match handling, so it never over-reaches
into match arms, and (b) propagates any `try_if_from_captured` Rejected directly (loud, no
launder). Every genuine structural rejection now propagates; the only Absent is honest
"no if recognized here."

An intermediate attempt that resolved the if via `find_captured` inside `try_if_from_node`
was discarded: it over-reached into `if`s nested in match arms and regressed the
constructed-match controls (emit_host eval / swapped-refuses / arrow-has-match). The
honest-Absent form relies on the caller's correctly-ordered fallback and avoids that.

Proven by execution (local claim_batch --wet):
- pick_ingested_equals_eval_keystone_holds (1/2): PASS
- pick2_ingested_equals_eval_generality_holds (3/4): PASS
- pick_ingested_normalized_swapped_arms_structural_red_holds (discriminating RED): PASS
- constructed-match controls (emit_host eval, swapped-refuses, arrow-has-match): PASS
  (regressed by the discarded find_captured attempt, green again under honest-Absent)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix inherited doc-graph orphan: wire shell-to-dag census doc into its parent

CI batch-2 red on the merge commit was a single discovery witness,
doc_graph_has_no_orphan_docs (src/v2/lens/doc_reachability_test.dag) — a
pre-existing main regression inherited via the origin/main merge, NOT introduced
by this PR's int-literal work (docs/ and the doc-reachability lens are
byte-identical to origin/main).

Root: #6559 merged docs/plans/shell-to-dag-residual-census-and-arc-completion.md
(witty-ibex-317) to main with zero inbound references, so the doc-graph orphan
lens fails corpus-wide (every PR merging current main inherits it).

Fix: add the faithful inbound edge — the census doc's own header states it
"builds on lane D's authority provisioning-window-executor-capability-design.md",
so the parent design doc now forward-references the census/arc-completion doc
(same witty-ibex-317 arc, real upstream→downstream relationship). Minimal,
reversible, and clears the orphan for the whole corpus, not just this PR.

Verified by execution: doc_graph_has_no_orphan_docs PASS (orphan count 0).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Brian Searls <briansearls1@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@briansrls
briansrls merged commit 8541db9 into main Jul 14, 2026
3 checks passed
@briansrls
briansrls deleted the session/royal-wolf-43 branch July 14, 2026 02:45
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