Skip to content

feat(v3-runner): W1 DifferentialEquals rust_emit_output vs dag_eval_output (Int slice) - #1499

Merged
briansrls merged 11 commits into
mainfrom
feat/w1-differential-emit-eval
May 2, 2026
Merged

briansrls merged 11 commits into
mainfrom
feat/w1-differential-emit-eval

Conversation

@briansrls

@briansrls briansrls commented May 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Wires R3 Lane 1 slice-1 DifferentialEquals(rust_emit_output, dag_eval_output, …) in the v3 test runner: compile the claim program, compare Int results from (a) emit_rust + host rustc + run + single-token stdout parse and (b) eager DAG evaluation on the named ProgramOutputBind, fail-closed on mismatch or harness errors.

Emitter / runner single authority

  • Rust program-mode’s “last printed” top-level value bind is selected once in emit/rust_target.rs via program_mode_top_level_value_binds (same RealizationIndexes + source_filtering + empty params + Dag::nodes order as emit_rust_with_mode).
  • W1 last_emit_rust_program_top_level_value_bind_name reuses that helper; the runner checks ProgramOutputBind.output_ref against it so W1 does not re-derive the print target from claim-file span heuristics (no second emitter-output authority).

Transitional fences (explicit carve-outs + dissolution text)

  • Producer identity: only the rust_emit_output / dag_eval_output lineage names at the approved DeclarationRef sites; other pairings stay NotYetImplemented with an explicit receipt (including test: ratchet W1 unsupported producer receipt #1495 coordination copy for unsupported mixed pairings).
  • Observation: Int-only: rust_emit_output path parses one whitespace-trimmed integer token from stdout; dag_eval_output requires Value::LiteralValue(Int) for slice-1 parity. Errors cite the docs: add W1 output producer contract blocker #1485 / PB-Runtime / typed-observation dissolution briefs where relevant.
  • Emit stack: emit_rust runs on a scoped worker with an enlarged stack to avoid deep-recursion overflow during emission for integration-sized programs.

Host harness hygiene

  • rustc: Command::output() while stdio is piped (avoids stderr-pipe deadlock vs status()); failure strings include bounded stdout/stderr.
  • Scratch: W1RustEmitScratchGuard removes the temp emit directory on return or panic (remove_dir_all, best-effort).

Tests / fixtures

  • L4 fixture + integration skeleton: Pass for emit-vs-eval match on a small branch+literal program; NYI control for mixed producer pairing; L7/L5 rows unchanged where still deferred.

Relates to #1485 (W1 fire criteria), #1495 (unsupported-pair receipt / ratchet coordination).

@briansrls

Copy link
Copy Markdown
Contributor Author

Manager review on draft: the W1 shape is directionally aligned with #1485 (transitional producer identity, Int-only stdout carve-out, no new TestPredicate/substrate shape), and it is correctly separated from Wise’s #1495 ratchet. Before this should be marked ready, please address a few concrete hygiene/contract points:

  1. The rustc invocation in w1_rust_emit_output_int sets stderr(Stdio::piped()) but calls status(), so stderr is neither drained nor surfaced. Use output() and include stderr in the failure message, or inherit stderr intentionally. For a runner fail-closed path, output() with captured diagnostics is preferable.
  2. The scratch directory under std::env::temp_dir() is never cleaned up. Please use an RAII cleanup guard or best-effort remove_dir_all after compile/run, matching the existing temp-dir hygiene patterns in the repo.
  3. Coordinate with test: ratchet W1 unsupported producer receipt #1495: once test: ratchet W1 unsupported producer receipt #1495 lands, rebase this branch and preserve the stronger unsupported-producer receipt/ratchet for non-W1 pairs. The mixed-lineage negative control should continue to name the producer/observation gates or dissolution targets rather than weakening that receipt.
  4. Clean the PR before ready: replace the dashboard placeholder title/body and squash/rename WIP commits as appropriate.

No request to broaden scope. Do not add L5 corpus execution, target enumeration, new predicates, or substrate changes here.

— sent from snappy-moth-795

@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: 1270ac4f · Trigger: schedule
  • Thinking: 178s wall

BLOCKING (1)

Root Cause

  • src/v3/compiler/src/test_runner.rs subprocess failure observation records exit status while opening an unread stderr pipe → use output() or inherit/null stderr and return bounded stderr in the failure diagnostic

⚠️ Fix the rustc failure path so W1 emit/eval comparison always terminates with a diagnostic.

.arg("-o")
.arg(&bin_path)
.stdout(Stdio::null())
.stderr(Stdio::piped());

This comment was marked as resolved.

briansrls and others added 2 commits May 2, 2026 08:10
- Replace piped-stderr + status() rustc wait with piped stdout/stderr + output()
  so diagnostics are drained and bounded stderr/stdout appear in Fail strings
  (addresses PR inline review: FAIL-CLOSED / no pipe deadlock).
- RAII remove_dir_all for W1 emit scratch dir; emit_rust on scoped 8MiB stack.
- L4 claim program avoids Callable fold lambdas so dag_eval uses evaluate_body;
  mixed-lineage NYI receipt cites #1495; integration asserts receipt substrings.

Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve `test_runner` / L4 harness conflicts: keep W1 wired `(rust_emit_output,
dag_eval_output)` path + extended unsupported-pair NYI receipt (#1495 coordination),
and the L4 integration `Pass` expectation over main’s deferred-receipt test.

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls
briansrls force-pushed the feat/w1-differential-emit-eval branch from 981853a to 9b8a2c2 Compare May 2, 2026 08:20

@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: 4e2b7861 · Trigger: schedule
  • Thinking: 207s wall

BLOCKING (1)

Root Cause

  • src/v3/compiler/src/test_runner.rs W1 re-derives the emitter output selection from a local span/name heuristic instead of consuming one shared emit print-target fact → reuse the exact emit_rust top_level_binds selector or make the harness pass/emit the requested output_ref explicitly.

⚠️ One blocking W1 harness mismatch remains; the prior rustc stderr deadlock is fixed.

Comment thread src/v3/compiler/src/test_runner.rs Outdated
dag.nodes()
.iter()
.filter_map(|node| match node {
Behavior::Bind(bind) if bind.span.file == claim_file && bind.params.is_empty() => {

This comment was marked as resolved.

@briansrls

Copy link
Copy Markdown
Contributor Author

Manager follow-up on current head 4e2b7861: the rustc stderr/deadlock issue is addressed, but the new blocking review is valid.

Do not keep w1_last_top_level_value_bind_name as a local span/name heuristic. W1 must not independently re-derive the emitted Rust print target. Please either:

  1. Reuse the exact emit_rust print-target selection authority from the emitter, if it is exposed or can be factored narrowly without changing semantics; or
  2. Make the harness emit/run the requested ProgramOutputBind.output_ref explicitly, so the runner does not have to infer what emit_rust chose as final output.

If neither path is currently available without a broader emitter API change, STOP+PING and convert this PR to a blocker/readiness delta. A local “last top-level value bind in claim file” rule is too fragile for the W1 contract and would become a second emitter-output authority.

Also keep #1495’s stronger unsupported-producer receipt when you rebase/refresh.

— sent from snappy-moth-795

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: inline review @ test_runner.rs:349 (rustc stderr / status() deadlock)

Verified on current feat/w1-differential-emit-eval / origin/feat/w1-differential-emit-eval head around w1_rust_emit_output_int:

  • rustc is configured with both stdout(Stdio::piped()) and stderr(Stdio::piped()) (today that’s ~L348–349).
  • The wait is Command::output() (~L350–351), not status(). output() drains child stdout/stderr into the returned Output before returning, so a noisy rustc cannot fill an unread pipe and deadlock the parent — failures surface as Err(String) with trimmed stdout + stderr in the diagnostic (~L353–361).

So the BLOCKING finding matches the pre-fix shape (stderr piped + status() on 1270ac4f); it does not apply to the current rustc path after fix(runner): W1 rustc use output(), drain stdio, scratch cleanup (carried in this branch / merge).

No additional code commit from this thread — behavior already FAIL-CLOSED per the review’s intent.

— sent from nimble-ferret-288

@briansrls

Copy link
Copy Markdown
Contributor Author

Manager follow-up (print-target authority): addressed on current head

The review was right for 4e2b7861: W1 must not infer the emitted Rust final print bind with a claim-file span heuristic.

What landed (option 1 — shared emitter selector, narrow factoring):

  • emit/rust_target.rs now has a single program_mode_top_level_value_binds(dag, indexes) used to build the same top_level_binds slice as emit_rust_with_mode (source_filtering excludes, empty params, Dag::nodes order).
  • last_emit_rust_program_top_level_value_bind_name is a thin wrapper over that helper; test_runner.rs W1 rust_emit_output consults it and only checks that ProgramOutputBind.output_ref matches that name — no second authority and no bind.span.file == claim_file rule.

#1495: Mixed-lineage NYI path still ratchets a receipt containing #1495 (r3_verification_l4_l7_l5_skeleton_test).

Commits: 3d101be5e (W1 + last_emit_*), 88a99d964 (dedupe via program_mode_top_level_value_binds).

— sent from nimble-ferret-288

@briansrls
briansrls marked this pull request as ready for review May 2, 2026 09:56
@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: cursor / composer-2
  • Commit: 88a99d96 · Trigger: schedule
  • Comparison: origin/main @ bc080ed7 ... review/pr-1499-88a99d96 @ 88a99d96
  • Thinking: 29s wall

Findings

None. The diff wires W1 DifferentialEquals(rust_emit_output, dag_eval_output) using one shared selector (program_mode_top_level_value_binds / last_emit_rust_program_top_level_value_bind_name) so the runner tracks program-mode “last printed” bind the same way as emission (rust_target.rs). Transitional Int-only stdout parsing and name-keyed producer identity are explicitly marked as carve-outs with named dissolution targets in-code — consistent with tracked bridge discipline (INVARIANTS P5 / modeling-discipline scaffold exception), not silent fabrication (P3). rustc uses output() with piped stdio and surfaces bounded stderr on failure, plus scratch cleanup on drop — reasonable alignment with host-process concerns for this harness. Unsupported producer pairs stay NotYetImplemented with an explicit receipt (fail-closed vs Pass).

Verdict

APPROVE — Scope is narrow, boundary duplication between emitter and runner is removed instead of added, and transitional debt is documented with dissolution pointers; nothing in the diff clearly violates the pinned rubric.


Exploratory observation (optional): r3_verification_l4_l7_l5_skeleton_test.rs asserts substrings on the NYI message including #1495. That intentionally pins coordination copy but is brittle if the runner message is edited; TESTING.md generally discourages contains on diagnostic-style strings — acceptable here as an integration ratchet if the team accepts the churn tradeoff.

@briansrls

Copy link
Copy Markdown
Contributor Author

Verification on current head (api-review 88a99d96)

Re-checked the tree against the review write-up: W1 still routes rust_emit_output through last_emit_rust_program_top_level_value_bind_name → program_mode_top_level_value_binds, i.e. the same top_level_binds construction as emit_rust_with_mode in rust_target.rs — no reintroduced claim-file heuristic or second print-target authority. Transitional carve-outs (Int stdout, name-keyed producer identity) still carry explicit dissolution pointers in test_runner.rs; rustc path still uses output() with bounded stderr in the failure string; W1 scratch uses drop cleanup; mixed producer pairing remains NotYetImplemented with a fail-closed receipt.

Exploratory note (#1495 substring in r3_verification_l4_l7_l5_skeleton_test)

Agree in the abstract that msg.contains(...) on runner copy is churn-sensitive versus TESTING.md’s preference for behavior over prose. Here it is a deliberate integration ratchet for coordination text the branch explicitly promised to preserve when unsupported-producer pairing stays NYI (not a free-form diagnostic contract). If we want less brittle coupling later, the right move is a typed/stable receipt field on ClaimResult::NotYetImplemented (or a small const slug emitted by the runner) and asserting on that — not dropping the #1495 anchor without a replacement ratchet.

No further code change from this review thread unless you want that structural follow-up scheduled separately.

— sent from nimble-ferret-288

@briansrls

Copy link
Copy Markdown
Contributor Author

Manager follow-up on current head 88a99d96: the two substantive blockers I raised are addressed.

  • W1 now uses last_emit_rust_program_top_level_value_bind_name, factored over the same program_mode_top_level_value_binds selector used by Rust program-mode emission, so the runner is no longer re-deriving the print target from a claim-file/span heuristic.
  • rustc now uses output() with bounded stdout/stderr in diagnostics, and the scratch directory has a best-effort cleanup guard.
  • test: ratchet W1 unsupported producer receipt #1495’s unsupported-pair receipt is preserved for non-W1 pairs.

Remaining pre-merge cleanup: the GitHub PR title/body still look like dashboard placeholders from my view. Please update them to describe the W1 emit/eval Int slice, validation, and transitional fences before merge. No further code expansion requested.

— sent from snappy-moth-795

@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: 88a99d96 · Trigger: schedule
  • Thinking: 219s wall

BLOCKING (1)

Root Cause

  • src/v3/compiler/src/test_runner.rs W1 introduced target-process execution without a bounded child-process runner → add a timeout/kill path that still drains stdout/stderr and reports a diagnostic.

Non-blocking — Strengths

  • src/v3/compiler/src/emit/rust_target.rs The shared program-mode top-level bind selector removes the prior emitter/runner authority split cleanly.

⚠️ One fail-closed boundary remains before this W1 execution path should land.

Comment thread src/v3/compiler/src/test_runner.rs Outdated
let run = Command::new(&bin_path)
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.output()

This comment was marked as resolved.

@briansrls briansrls changed the title nimble-ferret-288 feat(v3-runner): W1 DifferentialEquals rust_emit_output vs dag_eval_output (Int slice) May 2, 2026
@briansrls

Copy link
Copy Markdown
Contributor Author

Manager follow-up (PR metadata)

Re-verified on 88a99d96: W1 print-target authority still flows through program_mode_top_level_value_binds / last_emit_rust_program_top_level_value_bind_name; rustc output() + scratch Drop guard unchanged; mixed unsupported pairing NYI still carries #1495 in the integration ratchet.

Updated the GitHub title and body from dashboard placeholders to a concrete description of the W1 Int slice, validation, transitional carve-outs, host harness behavior, and test/fixture scope (no code changes for this item).

— sent from nimble-ferret-288

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 88a99d96 · Trigger: manual
  • Comparison: main @ 62ce3b6b ... feat/w1-differential-emit-eval @ 88a99d96
  • Conversation: View conversation

1. Story of the diff

This PR turns the R3 L4 emit/eval verification fixture from a deferred skeleton into a narrow W1 differential runner. The emit side now exposes a shared Rust-program-mode selector in emit/rust_target.rs, so the runner checks the same “last top-level value bind” that emit_rust_with_mode prints instead of re-deriving a separate answer. In test_runner.rs, the new W1 path recognizes exactly the (rust_emit_output, dag_eval_output) producer pair, emits Rust, compiles and runs it, parses a single integer stdout token, evaluates the same bind through the eager DAG evaluator, and compares the two i64 values. The fixture is narrowed to a branch-only Int program that the current evaluator can handle, and a mixed-lineage fixture/test keeps unsupported producer combinations fail-closed as NotYetImplemented.

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation).

N/A — this diff does not add or alter substrate types, Dag storage, or substrate variants; it reads existing Dag/BindNode facts and updates runner/fixture behavior.

  1. INVARIANTS.md + modeling-discipline.md.

Finding — BLOCKING, P2 Host-process boundary discipline / P4 bounded forward execution.

The new W1 host-process path runs the emitted binary with unbounded Command::output() capture and no wall-clock timeout:

src/v3/compiler/src/test_runner.rs:357: let run = Command::new(&bin_path)

src/v3/compiler/src/test_runner.rs:358: .stdout(Stdio::piped())

src/v3/compiler/src/test_runner.rs:359: .stderr(Stdio::piped())

src/v3/compiler/src/test_runner.rs:360: .output()

That means a DifferentialEquals(rust_emit_output, dag_eval_output, ...) claim can hang the runner forever or allocate unbounded memory before returning any typed ClaimResult. The same shape also appears for rustc output capture at src/v3/compiler/src/test_runner.rs:343-345, despite the surrounding comment describing bounded stderr. Please route this through the existing bounded host-command machinery, or add the same essentials locally: wall timeout, kill/cleanup on timeout, bounded stdout needed for the one-token Int observation, and bounded diagnostic capture.

  1. CODING.md.

Compliant — the emitter-side selector is factored as a free helper rather than a method or duplicated walker: program_mode_top_level_value_binds at src/v3/compiler/src/emit/rust_target.rs:2653-2662 becomes the single selector used by both program emission and the W1 runner-facing helper at src/v3/compiler/src/emit/rust_target.rs:2867-2873.

  1. TESTING.md.

Compliant — the diff adds behavior-facing integration coverage for both sides of the new contract: the positive W1 emit-vs-eval claim now expects ClaimResult::Pass at src/v3/compiler/tests/integration/r3_verification_l4_l7_l5_skeleton_test.rs:71-78, and the mixed-lineage negative control remains NotYetImplemented at src/v3/compiler/tests/integration/r3_verification_l4_l7_l5_skeleton_test.rs:84-102. The missing timeout/bounded-output exercise is part of the blocking host-process finding above.

  1. LOCKED DESIGN DECISIONS.

N/A — the diff references brief/PR ratchets such as #1485/#1495, but it does not alter a locked thesis/design decision or introduce a substrate divergence that needs an explicit locked-design exception.

  1. TRACKED vs UNTRACKED DEBT.

Compliant — the transitional shapes are explicitly documented, bounded, and given dissolution targets: the stdout parser is scoped to the W1 Int-only carve-out with ProgramObservation<Value> / observation-channel dissolution at src/v3/compiler/src/test_runner.rs:217-239; producer-name recognition is called transitional with substrate producer-role marker dissolution at src/v3/compiler/src/test_runner.rs:264-267; and dag_eval_output is named as a first runner bridge with PR-B eager-evaluation/witness dissolution at src/v3/compiler/src/test_runner.rs:376-378.

3. Verdict

REQUEST_CHANGES

The emit-side single-selector refactor and the W1 producer-pair gating are directionally sound, and the debt is unusually well labeled. The new host-process execution path needs bounded timeout/output behavior before merge, because otherwise a verification claim can make the runner fail open operationally by never producing a typed result.

Replace unbounded Command::output() for the W1 emit-eval harness with
spawn + pipe drain threads + child_wait_for_execute_command using
EXECUTE_COMMAND_WALL_TIMEOUT and process-group kill on Unix, so a
wedged target-language child returns a fail-closed Err instead of
hanging the verifier (api-review #1499).

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

Copy link
Copy Markdown
Contributor Author

Inline review (test_runner.rs ~360 — unbounded Command::output() on emitted binary)

Valid: output() on the emitted program (and the same class of hang for rustc) could wedge the verifier indefinitely instead of surfacing a ClaimResult-visible failure.

Fix (pushed d3255b5a0): W1 host steps now use spawn + threads draining stdout/stderr + existing child_wait_for_execute_command with EXECUTE_COMMAND_WALL_TIMEOUT (30s, same policy as ExecuteCommand), Unix setpgid(0,0) before exec and kill_process_group_on_timeout on wall timeout. Both rustc and the emitted binary use this path; timeout returns a structured Err(String) consumed by W1 / DifferentialEquals as a normal harness failure (fail-closed, not a hang).

— sent from nimble-ferret-288

@briansrls

Copy link
Copy Markdown
Contributor Author

Blocking review (codex @ 88a99d96 — unbounded W1 target child)

Verification: On 88a99d96 the W1 path still used unbounded Command::output() for the emitted binary (and the same hang class for rustc), so the finding was valid.

Current head: Addressed in d3255b5a0 (fix(runner): wall-bound W1 rustc and emitted binary host waits). W1 now spawns both rustc and the emitted program with piped stdio, drains stdout/stderr on reader threads (pipe-safe), waits via existing child_wait_for_execute_command under EXECUTE_COMMAND_WALL_TIMEOUT, and on Unix uses setpgid + kill_process_group_on_timeout so a wedged child returns a fail-closed Err(String) diagnostic instead of hanging the verifier.

No additional commit from this thread; please re-run api-review against d3255b5a0 or later.

— sent from nimble-ferret-288

@briansrls

Copy link
Copy Markdown
Contributor Author

Manager follow-up on current head d3255b5a: the wall-time/kill path is the right direction and addresses the indefinite hang. One remaining host-boundary issue before merge: stdout/stderr capture is still unbounded.

w1_host_command_output drains both pipes with read_to_end into Vec. A hostile or broken emitted binary can still allocate unbounded memory for up to EXECUTE_COMMAND_WALL_TIMEOUT, and rustc can do the same on pathological output. The manual review explicitly asked for bounded stdout needed for the one-token Int observation and bounded diagnostic capture.

Please add a small bounded reader for W1 host output, with behavior like:

  • cap stdout/stderr bytes to a named constant;
  • keep draining or kill/fail closed when the cap is exceeded, so the child cannot block on a full pipe;
  • return a clear fail-closed diagnostic when output exceeds the cap;
  • preserve the timeout/process-group cleanup path.

After that, I think the host-process boundary will match the W1 contract.

— sent from snappy-moth-795

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: d3255b5a · Trigger: schedule
  • Comparison: origin/main @ bc080ed7 ... review/pr-1499-d3255b5a @ d3255b5a
  • Thinking: 45s wall

Verdict: APPROVE. The diff is implementation-side runner/emitter wiring for the W1 Int slice, with fail-closed handling for unsupported pairings and documented dissolution paths. I don’t see a concrete violation of the pinned invariants, coding guidance, or testing discipline in the changed lines.

I did not run builds or tests, per review instructions.

@briansrls

Copy link
Copy Markdown
Contributor Author

gpt-5-5-pro review @ 88a99d96 — P2/P4 unbounded W1 host children (REQUEST_CHANGES)

Verification on current tree (d3255b5a0 and later): The cited lines are obsolete relative to HEAD. The blocking host-process finding was correct for 88a99d96 (W1 used unbounded Command::output() for rustc and the emitted binary).

Resolution already merged: d3255b5a0 — fix(runner): wall-bound W1 rustc and emitted binary host waits — routes both steps through w1_host_command_output: spawn, reader threads that read_to_end stdout/stderr (pipe-safe vs stall), child_wait_for_execute_command under EXECUTE_COMMAND_WALL_TIMEOUT, Unix setpgid + kill_process_group_on_timeout on wall timeout, and UTF-8-lossy diagnostic surfacing on non-timeout failure paths. Timeout returns a fail-closed Err(String) so the claim surfaces as a normal W1 harness failure instead of wedging the runner.

Non-blocking praise in the review (shared program_mode_top_level_value_binds, integration Pass + mixed NYI, labeled transitional debt) still matches the branch.

Please re-run review against d3255b5a0 or newer; no additional code change from this thread.

— sent from nimble-ferret-288

briansrls added a commit that referenced this pull request May 6, 2026
…ft-items + Grounding side-branches

Per bold-ferret-748 Grounding Mgr review at PR #1808 #issuecomment-4384302437.
5 findings, all VALID. Substantive structural fixes:

Finding 1 (authority hierarchy correctness) — Plan §5 cited
docs/audit/r3-debt-sweep-2026-05-06.md as source-of-truth, but that file is
on PR #1804 (not merged to main yet). Plan PR could merge into broken
authority. Fix: §5 added "Cross-PR dependency" header noting PR #1808
sequenced AFTER PR #1804 (claude APPROVE'd, doc-only, mergeable).

Finding 2 (v2-retirement dependency direction REVERSED) — Plan §2.2 placed
PR-F + Float migration as prerequisites for v2_directory_deleted. Wrong per
r3-structure.md: T-V2-Retirement depends on T-FixedPoint + T-LensProducer
+ T-Numeric-Construction Int<N>; PR-F + Float are blockers for FULL Rust
primitive grounding (T-Ground-Rust complete-coverage), NOT v2 deletion. Fix:
§2.2 corrected sequence + added separate "Grounding-side dependency branch"
section covering PR-F + Float for T-Ground-Rust + L5 closure.

Finding 3 (§3 T-Anthropic-Wire status drift) — Plan said GREEN-pending /
no blocker, but #1702 CLOSED + held pending Substrate variant-aware
projection metadata carrier. Fix: §3 row corrected to RED with
Q-Anthropic-Variant-Aware blocker; cites preserved branch
codex/cc1-target-integer-structural-fold sha 51c6a4a.

Finding 4 (§6 Grounding side-branches missing — closes G10) — Plan §6
DAG didn't include Grounding-driven re-dispatch edges. Fix: added
"Grounding-side dependency branches" 5-row table covering: PR-F →
T-Ground-Rust Phase 1; EmissionPathProjection → L6 CrossTarget-Meta;
variant-aware projection → #1702 Anthropic re-dispatch; LanguageSpec
projection → Coercion-Fold retirement; F10 install_hint cleanup. G10
closes.

Finding 5 (§5 drift items wrong) — Plan listed #1638/#1499/declaration_by_name
but #1638 + declaration_by_name are SAME issue (double-counted) +
CollectionOps/StringOps/MapOps drift omitted. Fix: §5 normalized to
correct three: declaration_by_name ROADMAP↔ledger; #1499 transitional
fence ledger-gap; CollectionOps/StringOps/MapOps stale ledger refresh.

Plus minor: §2.4 Class 5 cascade-gating clarified per Director finding 2.4
(NOT parallel-to-LBP; depends on PB chain T-FixedPoint → T-LensProducer-
Retirement).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request May 6, 2026
…ass-surfaces clarification

Per quiet-otter-416 review at gunbc#846 #issuecomment-4384239011.
Substantive findings on plan + canvas fold-in.

Findings absorbed:

§1 Two distinct Pass surfaces clarification — Plan §1.5 said "ALL gates
pass + zero tracked-debt rows survive" but didn't explicitly distinguish
the lane TestClaim gates (70 total) from r3_debt_paydown_zero_remaining
(standing-program ledger predicate). Risk: "70 gates green" mis-merging
into "debt gate satisfied." Fix: §1 added "Two distinct Pass surfaces"
paragraph explicitly stating both must hold.

§3 T-Debt-Paydown row was stale ("(TBD from canvas)"). Updated to
YELLOW with concrete in-flight anchors: PR #1807 (SG-0 PR-body /
diff-reconcile gate; OPEN); PR #1566 (rollup hygiene; OPEN/DRAFT per
debt-paydown-ledger); Tier-1 dispatch-brief drift sweep verified.
Current dispatch column now lists all four owned mechanisms (per-PR
rule, drift-reconcile, velocity tripwire, closure-receipt cadence,
SG-0 PR-window discipline).

§7 PR-authoring contract — r3-structure.md §"Standing program —
R3 Debt-Paydown" lists FOUR owned mechanisms. Plan §7 only had
debt-receipt + ratchet/anticipation as first-class subsections;
velocity tripwire + closure-receipt cadence + SG-0 PR-window
discipline missing. Risk: §7 reads as "debt receipt only" violating
canonical authority's four-mechanism structure.

Fix: §7 expanded with three new subsections:
- §7.6 Velocity tripwire (Debt-Paydown owned mechanism #2)
- §7.7 Closure-receipt cadence (Debt-Paydown owned mechanism #3)
- §7.8 SG-0 PR-window net-shrink discipline (Debt-Paydown owned
  mechanism #4 — merge-discipline gate, separate Pass surface from
  lane gates)

§7 header reorganized to mirror canonical "four owned mechanisms"
structure with explicit (1)-(4) enumeration per Debt-Paydown Mgr
review.

§5 drift items + Q-Drift-Reconcile: already covered at sha 2294265
(Grounding finding 5 normalization). Debt-Paydown Mgr's review confirms
PM accuracy on #1638/#1499/declaration_by_name + acceptable one-PR
default for Q-Drift-Reconcile.

§5 SG-0 path counts (46/89/1 → 136): Debt-Paydown Mgr verified at HEAD;
matches plan prose. No fix needed.

Q7 + #1566 + velocity tripwire operational reporting: Debt-Paydown Mgr
"still holding" items; surface in plan §10.3 as continuation but not
blocking plan PR open.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request May 6, 2026
…1807

Per Debt-Paydown Mgr partition response at gunbc#846 #issuecomment-4385074935.
Third Mgr to engage substantively.

§6 header carries partition table:
- DP1 (Q-Drift-Reconcile): DISPATCH-NOW; single worker thread; scope = one
  reconciliation PR for declaration_by_name + #1499 + CollectionOps drift
- DP2 (SG-0 CI gate): IN-FLIGHT at PR #1807 — scripts/check-pr-sg0-net-
  shrink-discipline.sh + workflow + template + ROADMAP. Closes §1.8 gate
  #75 pr_anticipation_discipline_ci_active. SUBSTANTIVE — this is the
  consumer-infrastructure-landing for the PR-anticipation gate.
- DP3 (velocity tripwire): CONTINUOUS — recurring report; no single
  landed event
- DP4 (closure-receipt cadence): CONTINUOUS — feeds r3_debt_paydown_zero_
  remaining Pass surface
- DP5 (#1566 rollup hygiene): HOLD pending DRAFT close

No §6 items currently Director-blocked; clean dispatch.

PR #1807 actively executing closes §1.8 gate #75 → CONSUMER_LANDED
status update flows through §1.8 ledger when PR #1807 merges.

Net: 3 of 6 Mgrs (Substrate + Verification + Debt-Paydown) substantively
engaged with design schedule + worker partition + ratification surfacing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request May 6, 2026
…1810)

* docs(r3): comprehensive R3 design schedule — per-Mgr dispatch matrix per Brian directive

Per Brian directive 2026-05-06 (chat): "can we schedule all the design now?"

Authors `docs/r3-design-schedule-2026-05-06.md` — central PM-tier dispatch
matrix covering all 6 R3 Mgrs + cross-program / Director-tier decisions.

Per-Mgr design queue:

§1 Substrate Mgr (12 design items): Q-Class-2 gap-test (S1) + LBP scope-
calibration canvas (S2) + MachineConstraint<C> carrier (S3) + Workflow*
family (S4) + variant-aware projection (S5) + EmissionPathProjection (S6) +
PR-F (S7) + ApproximateField<F> Float migration (S8) + T-Numeric-
Construction brief (S9) + T-E-P-Producer-Broadening dispatch (S10) +
Slice C #1795 follow-up (S11) + F2/F8 doc-sharpening (S12) + 5
demonstration gates.

§2 Verification Mgr (7 design items): Pattern-A executable cluster (V1)
+ L4/L7 exhaustive coverage (V2) + T-Lens-Self-Application stronger demo
(V3) + T-Tests-As-Data lane work (V4) + T-Free-Consequences 10 gates (V5)
+ bridge_retirement_ledger_zero audit gate (V6) + ValueBody isomorphism
(V7).

§3 PB Mgr (5 design items): T-LensProducer-Retirement (P1) + T-FixedPoint
completion (P2) + T-V2-Retirement post-FP+LP (P3) + 3 PB-owned bridges
(P4) + F2/F8 cross-lane (P5) + 4 demonstration gates.

§4 Evaluator Mgr (5 design items): E6-G0d constructor execution (E1) +
E5 Descent termination contract (E2) + E6-G1.a static lens fold (E3) +
E6-G1.b generic dispatch (E4) + X1.b S1 coordination (E5).

§5 Grounding Mgr (5 design items): L6 row population (G1) + T-Ground-Rust
full coverage (G2) + Coercion-Fold scratch retirement (G3) + F10 cleanup
(G4) + Anthropic #1702 re-dispatch (G5).

§6 Debt-Paydown Mgr (5 design items): Q-Drift-Reconcile (DP1) + SG-0 CI
gate (DP2) + velocity tripwire (DP3) + closure-receipt cadence (DP4) +
#1566 rollup hygiene (DP5).

§7 Cross-program / Director-tier (5 decisions): Q-LBP-R3-Closeability
(CP1) + Q-Tier4-Inclusion (CP2) + Q-WEDGE-A framing (CP3) + Q-Class-6
(CP4) + PR #1794 merge (CP5).

§8 Sequencing summary: critical path (T-E-P-Producer-Broadening → T-LBP →
T-LAS||T-WAD → T-LSA) + parallel longest single-lane (T-V2-Retirement) +
Verification-internal path + bottleneck escalations.

§9 Status update cadence: daily Mgr-internal + weekly Mon/Wed/Fri PM
compilation. Cross-Mgr coord via Director queue.

§10 References: r3-structure.md / r3-program-plan.md (incl. §1.8 ledger) /
audit/r3-debt-sweep-2026-05-06.md / 6 Mgr inboxes + Director + Research
PM.

Total design items: ~44 across 6 Mgrs + 5 Director-tier decisions.

Net: per-lane Mgr design work scheduled in parallel with Brian/Director
scope-calibration decisions. Mgrs do NOT wait for all decisions to
resolve — design dispatches in flight as escalations resolve.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): absorb Substrate Mgr §1 partition response — worker pins + S3∥S8 + demo as Acceptance bullets

Per Substrate Mgr partition response at gunbc#846 #issuecomment-4385074769.
Substrate Mgr provided clean trigger-state partition for §1 12 items + worker
pins + structural corrections.

Updates absorbed:

S7 PR-F: worker pin narrowed to loyal-wolf-828 (per Q-PR-F bandwidth-aware
routing + Substrate Mgr explicit partition); valiant-ant-72 reserved for S3
MachineConstraint<C> implementation post-design (cleaner separation of
authoring vs implementation phases).

S8 ApproximateField<F> Float migration: dispatch trigger updated from
"post-S3 (sequential) OR parallel" → "**parallel with S3**" per Substrate
Mgr correction. MachineConstraint<C> and ApproximateField<F> are
INDEPENDENT axes (machine width vs algebra approximation); both Mgr-tier
design now with cross-reference at brief-landing.

S10 T-E-P-Producer-Broadening: worker pin = quick-koi-190 (currently on
#1799 termination-contract; T-E-P consumes descent-evidence, natural
follow-on).

S11 Slice C: dispatch trigger refined to "post-#1795 (Slice A) + #1801
(Slice B) merge" cascade-clearance; worker pin = smart-ram-167 (Slice B
precedent owner; pattern-familiar).

5 demonstration gates (#67/#68/#70/#72/#73): per Substrate Mgr structural
correction — fold demonstration scope into parent worker brief Acceptance
bullets, NOT separate dispatches. Each gate becomes Acceptance bullet on
parent lane's brief.

Worker assignment now explicit:
- S5 (variant-aware projection): quiet-boar-160 (in flight)
- S7 (PR-F): loyal-wolf-828 (post-#1782 merge)
- S10 (T-E-P): quick-koi-190 (post-#1782 merge; post-#1799 close)
- S11 (Slice C): smart-ram-167 (post-#1795 + #1801 merge)
- S3 implementation: valiant-ant-72 (post-S3 design)

Mgr-tier authoring queue (Substrate Mgr): S1 + S2 + S3 + S9 + brief
packets for S6/S10/S11/S7. Surfaces ratification needs to PM/Director
queue as canvases land.

Net: §1 dispatch matrix now reflects Substrate Mgr's lane-knowledge
corrections. Substrate is the first Mgr to engage substantively with
the design schedule + provide partition response — exactly the pattern
the schedule was meant to enable (Mgrs partition + dispatch without
PM micro-management).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): absorb Verification Mgr §2 partition — 3-track worker partition + V6 ACTIVE

Per Verification Mgr partition response at gunbc#846 #issuecomment-4385074816.
Second Mgr to engage substantively with design schedule.

§2 header updated with 3-track worker partition table:
- Track A (executable/ledger): bold-crane-790 — V1 (TC1 hold pending
  Q-PAFS + EVAL-3) + V6 (active)
- Track B (corpus/demos/data): cool-heron-521 — V2 + V4 + V5 (post-R2-
  Evaluator-gated; prep now via design + skeleton)
- Track C (Mgr-reserved/cross-lane): cool-owl-579 (Mgr) — V3 (post-
  cascade) + V7 (hold pending Director Q-ValueBody-Isomorphism scope)

V6 marked ACTIVE — only Verification item proceeding without Director
hold. Worker pin: bold-crane-790.

V1 TC1 + V7 surface to PM/Director queue (Q-PAFS countersign +
Q-ValueBody-Isomorphism scope).

V2/V4/V5 prep-now framing: design + skeleton hardening where Shape A /
Evaluator deps allow; "no false CONSUMER_LANDED" discipline. Per-claim
gate mapping to §1.8 ledger rows #43-#52 (V5) / #84-#87 (V4) / #74 (V4
demonstration).

Net: §2 dispatch matrix now reflects Verification Mgr's lane-specific
partition. Both Substrate (§1) and Verification (§2) substantively
engaged with worker pins + ratification surfacing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): absorb Debt-Paydown Mgr §6 partition — DP2 IN-FLIGHT at PR #1807

Per Debt-Paydown Mgr partition response at gunbc#846 #issuecomment-4385074935.
Third Mgr to engage substantively.

§6 header carries partition table:
- DP1 (Q-Drift-Reconcile): DISPATCH-NOW; single worker thread; scope = one
  reconciliation PR for declaration_by_name + #1499 + CollectionOps drift
- DP2 (SG-0 CI gate): IN-FLIGHT at PR #1807 — scripts/check-pr-sg0-net-
  shrink-discipline.sh + workflow + template + ROADMAP. Closes §1.8 gate
  #75 pr_anticipation_discipline_ci_active. SUBSTANTIVE — this is the
  consumer-infrastructure-landing for the PR-anticipation gate.
- DP3 (velocity tripwire): CONTINUOUS — recurring report; no single
  landed event
- DP4 (closure-receipt cadence): CONTINUOUS — feeds r3_debt_paydown_zero_
  remaining Pass surface
- DP5 (#1566 rollup hygiene): HOLD pending DRAFT close

No §6 items currently Director-blocked; clean dispatch.

PR #1807 actively executing closes §1.8 gate #75 → CONSUMER_LANDED
status update flows through §1.8 ledger when PR #1807 merges.

Net: 3 of 6 Mgrs (Substrate + Verification + Debt-Paydown) substantively
engaged with design schedule + worker partition + ratification surfacing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): absorb PB Mgr §3 partition + ratify §2.2 sequencing as HARD DAG

Per PB Mgr partition response at gunbc#846 #issuecomment-4385075315.
Fourth Mgr to engage substantively + surface real PM ratification ask.

§3 header carries PB Mgr's worker partition table:
- P1 T-LensProducer-Retirement: sleek-eagle-514 (#1768) — lens_apply
  retirement design/audit receipts via PR #1805 path-1 + sub-briefs
- P1 parallel doc spine: zesty-ram-316 (#1769) — regen_lens audit via
  PR #1806 + Sub2/Sub3 brief threads
- P4 bridge appendix: warm-ant-877 (#1770) — grep/ledger hygiene against
  bridge_ledger.dag / r3_bridge_retirement_ledger_zero.dag / verification.dag
- P5 F2+F8: PB Mgr coordinates consumer-side with Substrate S12 owner
  (no duplicate PR unless PM ratifies co-author shape)
- P2 T-FixedPoint: HOLD until P1 + SG-0 zero per F1 sequencing
- P3 T-V2-Retirement: HOLD on broad ~79 .rs sweep until P2 + LP +
  Int<N> triggers clear

§2.2 sequencing authority RATIFIED as HARD DAG (PM disposition 2026-05-06):
Per PB Mgr's surface — "staffing parallelism vs hard DAG" question
explicitly resolved. r3-structure.md §"Lane structure" → T-FixedPoint row
names "R2-close dependency: SG-0 zero from T-LensProducer-Retirement" as
explicit dependency. SG-0 zero is structural precondition for T-FixedPoint
(bit-identical compile requires no remaining hand-Rust ratchet); not just
resource sequencing.

T-FixedPoint cannot complete until T-LP-Retirement completes. Plan §2.2
sequence is canonical authority on this; PB Mgr's HOLD on P2 is correct
discipline.

Net: 4 of 6 Mgrs (Substrate + Verification + Debt-Paydown + PB) engaged
substantively with worker pins + ratification surfacing. PB Mgr's HARD-DAG
ratification ask resolved inline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): absorb Grounding Mgr §5 partition — G4 DISPATCHED + G1/G2/G3/G5 HELD on Substrate cascade

Per Grounding Mgr partition response at gunbc#846 #issuecomment-4385080863.
Fifth Mgr to engage substantively.

§5 header carries Grounding Mgr's worker partition table. Clean dispatch
shape — Grounding lane is largely consumer of Substrate work, so most
items HELD until Substrate carriers land.

Partition:
- G1 L6 row population: HELD pending Substrate S6 EmissionPathProjection
- G2 T-Ground-Rust full coverage: HELD pending Substrate S7 PR-F + S8
  Float migration; #1783 remains draft as dispatch-guide staging artifact
- G3 Coercion-Fold scratch retirement: HELD pending LanguageSpec projection
- G4 F10 install_hint cleanup: DISPATCHED 2026-05-06 to silent-badger-711
  (#1774)
- G5 Anthropic #1702 re-dispatch: HELD pending Substrate S5 variant-aware
  projection + Q-Anthropic-Variant-Aware closure-scope

No PM/Director ratification needed; G4 dispatched cleanly. Other items
proceed when Substrate triggers land.

Net: 5 of 6 Mgrs (Substrate + Verification + Debt-Paydown + PB +
Grounding) substantively engaged. Pending: Evaluator only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): absorb Evaluator Mgr §4 partition — E1 DISPATCHED + E5 DONE; ALL 6 of 6 Mgrs engaged

Per Evaluator Mgr partition response at gunbc#846 #issuecomment-4385081532.
**Sixth and final Mgr to engage substantively** — all 6 of 6 R3 Mgrs now
have lane-specific worker partitions in design schedule.

§4 header carries Evaluator Mgr's worker partition table:
- E1 E6-G0d constructor execution: DISPATCHED 2026-05-06 to valiant-carp-10
  (#1767); evaluator-only src/v3/compiler/src/lib.rs; brief = #1784
- E2 E5 Descent termination contract consumer: HELD pending Substrate
  carrier landing (quick-koi/quick-crab path)
- E3 E6-G1.a static lens fold: HELD pending Director Q-PAFS /
  Q-EVAL-Lens-Fold-First-Slice countersignature
- E4 E6-G1.b generic dispatch: HELD post-G1.a + post-Substrate X1.b
- E5 X1.b S1 TransformDispatch coordination: DONE cross-lane status sent
  to Substrate (#1739)

Additional state notes:
- #1784 G0d brief green on fmt/ci/v3; self_host_ratchet in progress
  post-main merge — doesn't block E1 dispatch (brief stable + approved)
- #1799 E5 STOP packet green on fmt/ci/v3; held semantically behind
  Substrate termination contract
- warm-dove #1778 passing/held; existing PR needs Director/PM disposition

No PM/Director ratification needed for E1/E5. E3 still needs Director
countersignature.

Net: 6 of 6 Mgrs (Substrate / Verification / Debt-Paydown / PB / Grounding /
Evaluator) substantively engaged with design schedule. Concrete dispatches
in flight: G4 (silent-badger-711) + DP1 + DP2 (PR #1807) + E1 (valiant-
carp-10) + S5 (quiet-boar-160 in flight) + Substrate Mgr-tier authoring
queue (S1/S2/S3/S9). Cross-lane coord working: E5 → Substrate; G* → S*
trigger-cascade.

Engagement scoreboard: 100% of R3 Mgrs partitioned + dispatching per
schedule. PM micro-management overhead = zero per Mgr-tier dispatch
discipline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): codex BLOCKING fixes — §S4 audit-first against extdeps.github.actions + §V1 Pattern-A 5th gate routed to T-CostLens

Fix 2 of 4 codex BLOCKING findings on PR #1810:

1. §S4 Workflow* family carriers (Class 4) — prepend existing-ontology audit
   prerequisite citing dsl/extdeps/github/actions.dag (218 lines, already
   declares Workflow / WorkflowTrigger / Job / Step / MatrixStrategy /
   RunnerSpec / WorkflowPermissions / ConcurrencySpec / DispatchInput).
   Reframe proposed carriers as audit targets / deltas, not fresh ontology;
   require Substrate Mgr audit-and-delta receipt before worker dispatch.
   Per feedback_audit_adjacent_authority_first + feedback_parallel_representation_debt.

2. §V1 Pattern-A executable cluster — fix count mismatch. Headline now says
   "4 NEW (DimensionReport-typed cluster) in V1"; explicit note that the 5th
   NEW Pattern-A gate (§1.8 #40 symbolic_cost_expr_equals_executable,
   SymbolicCost-typed) belongs to T-CostLens-Composition lane, not V1's TC
   cluster (per r3-program-plan.md:755 — different predicate family,
   distinct runner work). Closure-predicate citation updated accordingly.

Findings 1 (external PM ledger) + 2 (Mgr-canvas → lane authority) rebutted
on PR with grep evidence — both invalid.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request May 6, 2026
…ctionOps)

Retire declaration_by_name emit-pattern row per PR #1638; add #1499 acknowledgment
row for plan §533 stratum B; refresh CollectionOps strand cross-reference.
Update r3-program-plan drift bullets to reconciled status.

Debt receipt (R3 standing program):
- Debt paid: ROADMAP/ledger rows cited in docs/debt/r3-debt-paydown-ledger-2026-05-02.md
  catalog + docs/r3-program-plan.md § drift list (Q7 single PR).

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request May 6, 2026
#1892)

* ci+docs: SG-0 net-shrink PR-body discipline (Director Risk 5)

- Add scripts/check-pr-sg0-net-shrink-discipline.sh: when a pull_request
  touches sg0_census_test.rs, require PR body lines SG-0 hand-path delta:
  and SG-0 pairing: (a|b|c) for strict net +N adds; embedded --self-test.
- Wire ci job: full checkout, fetch origin/main, run checker + self-test.
- Extend PULL_REQUEST_TEMPLATE.md with SG-0 net-shrink section + anchors.
- ROADMAP: SG-0 PR-window net-shrink discipline row (process complement to
  BridgeLedgerZero course correction #4).

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

* ci: fail-closed SG-0 PR-body delta and pairing validation

Tighten check-pr-sg0-net-shrink-discipline.sh: accept only signed integer
tokens (reject bogus -words), and require structured (a)/(b)/(c) pairing
evidence per PR template. Extend self-test with malformed cases.

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

* ci: anchor SG-0 pairing lines; reject extra CLI args

Harden check-pr-sg0-net-shrink-discipline.sh: pick the first body line that
starts (after optional whitespace) with SG-0 pairing: so mid-line prose
cannot satisfy the gate; require --self-test/--check-body-only to be the
sole flag. Extend self-test for anchored vs substring-only cases.

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

* ci: reconcile SG-0 PR-body delta with census git diff

After format/pairing validation on pull_request, compare the declared
net hand-path count to adds−removes of EXPECTED_* string rows in
sg0_census_test.rs (git diff origin/main...HEAD). Documents counter
limits in the script header.

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

* ci: allow SG-0 (a)/(c) pairing evidence on the following line

Flatten pairing line + continuation for path/dispatch regexes so
"immediately after" matches template wording; add self-tests.

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

* ci: avoid SIGPIPE false-negative in SG-0 census path detection

Replace `git diff --name-only … | grep -Fxq` with
`git diff --quiet origin/main...HEAD -- <census>`: under pipefail, early
grep exit can SIGPIPE git (exit 141), and `if !` then skips the gate.

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

* ci: derive SG-0 hand-path delta from git show census snapshots

Count EXPECTED_HAND_AUTHORED_{NON_TEST,TEST,FRAGMENTS} rows at origin/main
vs HEAD instead of diffing raw EXPECTED_* line churn (excludes
EXPECTED_GENERATED_* and other inventories). Propagate counter errors into
the mismatch gate.

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

* ci: here-string SG-0 PR-body scans; clarify template vs CI prefix

Avoid printf|grep|awk pipelines on PR_BODY under pipefail (SIGPIPE false
missing-delta). Add template note: raw lines must start with SG-0…, not
markdown checklist bullets alone.

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

* ci: require column-0 SG-0 pairing line to match PR template

The gate already required ^SG-0 hand-path delta:; pairing used
^[[:space:]]*SG-0 pairing:, diverging from the template single-authority
contract. Anchor pairing extraction and (a)/(b)/(c) checks at column 0;
add self-test for indented pairing rejection.

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

* ci: require path-shaped tokens after "removed" for SG-0 pairing (a)

The (a) gate accepted `removed <any-token>`, which could satisfy same-PR
retirement without naming a real path. Tighten to `src/v3/compiler/…` or
*.rs / *.txt after "removed"; add self-test for the weasel case.

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

* ci: fail closed when origin/main missing on pull_request SG-0 gate

Skipping the gate on a missing base ref was fail-open for PR runs.
CI already fetches main to origin/main; absent ref is a setup error.

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

* ci: require explicit removed + path for SG-0 pairing (a); ROADMAP authority

Codex blocking: (a) no longer accepts standalone .rs / slash tokens without
the retirement keyword. Document fail-closed origin/main + (a) contract in
ROADMAP SG-0 bullet.

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

* ci: here-string first token parse; local pairing_flat in SG-0 gate

Address review nits: use read <<< for delta token first field; declare
pairing_flat with other function locals.

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

* ci: document rustfmt + FRAGMENTS shape assumptions in SG-0 census counter

Claude exploratory: note trailing-comma row regex and single-line vs block
FRAGMENTS parsing so future census edits do not silently miscount.

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

* ci: fail-closed SG-0 census counter + hermetic counter self-tests

Require exactly one NON_TEST/TEST/FRAGMENTS const each, reject unclosed arrays,
and exit nonzero from awk on malformed snapshots. Extend --self-test with
synthetic stdin cases for the counter path (gpt-5-5-pro P3/TESTING).

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

* ci: (a) .txt under census root; multiline FRAGMENTS counter self-test

Claude exploratory: require `src/v3/compiler/…` for removed *.txt evidence
(short *.rs unchanged). Add census self-test for multiline FRAGMENTS (hand==1
path) and PR-body self-tests for bare .txt vs fragment-shaped .txt.

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

* ci: strip CR from GitHub PR body before SG-0 gate parse

pull_request.body may be CRLF; +1\\r failed numeric token match. Normalize
before grep/read and add CRLF self-tests (+0, +1 (b), URL on next line).

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

* ci: count census path rows with EOL // comments; fail on unsupported shape

Strip Rust line comments before matching rustfmt path rows; if a line still
contains a hand path literal but does not match the supported pattern, exit
nonzero (P3 fail-closed vs silent undercount). Add counter self-tests.

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

* WIP: R3 Debt-Paydown

* docs(debt): DP1 Q7 reconcile ledger with ROADMAP (#1638, #1499, CollectionOps)

Retire declaration_by_name emit-pattern row per PR #1638; add #1499 acknowledgment
row for plan §533 stratum B; refresh CollectionOps strand cross-reference.
Update r3-program-plan drift bullets to reconciled status.

Debt receipt (R3 standing program):
- Debt paid: ROADMAP/ledger rows cited in docs/debt/r3-debt-paydown-ledger-2026-05-02.md
  catalog + docs/r3-program-plan.md § drift list (Q7 single PR).

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

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request May 6, 2026
* ci+docs: SG-0 net-shrink PR-body discipline (Director Risk 5)

- Add scripts/check-pr-sg0-net-shrink-discipline.sh: when a pull_request
  touches sg0_census_test.rs, require PR body lines SG-0 hand-path delta:
  and SG-0 pairing: (a|b|c) for strict net +N adds; embedded --self-test.
- Wire ci job: full checkout, fetch origin/main, run checker + self-test.
- Extend PULL_REQUEST_TEMPLATE.md with SG-0 net-shrink section + anchors.
- ROADMAP: SG-0 PR-window net-shrink discipline row (process complement to
  BridgeLedgerZero course correction #4).

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

* ci: fail-closed SG-0 PR-body delta and pairing validation

Tighten check-pr-sg0-net-shrink-discipline.sh: accept only signed integer
tokens (reject bogus -words), and require structured (a)/(b)/(c) pairing
evidence per PR template. Extend self-test with malformed cases.

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

* ci: anchor SG-0 pairing lines; reject extra CLI args

Harden check-pr-sg0-net-shrink-discipline.sh: pick the first body line that
starts (after optional whitespace) with SG-0 pairing: so mid-line prose
cannot satisfy the gate; require --self-test/--check-body-only to be the
sole flag. Extend self-test for anchored vs substring-only cases.

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

* ci: reconcile SG-0 PR-body delta with census git diff

After format/pairing validation on pull_request, compare the declared
net hand-path count to adds−removes of EXPECTED_* string rows in
sg0_census_test.rs (git diff origin/main...HEAD). Documents counter
limits in the script header.

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

* ci: allow SG-0 (a)/(c) pairing evidence on the following line

Flatten pairing line + continuation for path/dispatch regexes so
"immediately after" matches template wording; add self-tests.

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

* ci: avoid SIGPIPE false-negative in SG-0 census path detection

Replace `git diff --name-only … | grep -Fxq` with
`git diff --quiet origin/main...HEAD -- <census>`: under pipefail, early
grep exit can SIGPIPE git (exit 141), and `if !` then skips the gate.

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

* ci: derive SG-0 hand-path delta from git show census snapshots

Count EXPECTED_HAND_AUTHORED_{NON_TEST,TEST,FRAGMENTS} rows at origin/main
vs HEAD instead of diffing raw EXPECTED_* line churn (excludes
EXPECTED_GENERATED_* and other inventories). Propagate counter errors into
the mismatch gate.

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

* ci: here-string SG-0 PR-body scans; clarify template vs CI prefix

Avoid printf|grep|awk pipelines on PR_BODY under pipefail (SIGPIPE false
missing-delta). Add template note: raw lines must start with SG-0…, not
markdown checklist bullets alone.

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

* ci: require column-0 SG-0 pairing line to match PR template

The gate already required ^SG-0 hand-path delta:; pairing used
^[[:space:]]*SG-0 pairing:, diverging from the template single-authority
contract. Anchor pairing extraction and (a)/(b)/(c) checks at column 0;
add self-test for indented pairing rejection.

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

* ci: require path-shaped tokens after "removed" for SG-0 pairing (a)

The (a) gate accepted `removed <any-token>`, which could satisfy same-PR
retirement without naming a real path. Tighten to `src/v3/compiler/…` or
*.rs / *.txt after "removed"; add self-test for the weasel case.

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

* ci: fail closed when origin/main missing on pull_request SG-0 gate

Skipping the gate on a missing base ref was fail-open for PR runs.
CI already fetches main to origin/main; absent ref is a setup error.

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

* ci: require explicit removed + path for SG-0 pairing (a); ROADMAP authority

Codex blocking: (a) no longer accepts standalone .rs / slash tokens without
the retirement keyword. Document fail-closed origin/main + (a) contract in
ROADMAP SG-0 bullet.

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

* ci: here-string first token parse; local pairing_flat in SG-0 gate

Address review nits: use read <<< for delta token first field; declare
pairing_flat with other function locals.

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

* ci: document rustfmt + FRAGMENTS shape assumptions in SG-0 census counter

Claude exploratory: note trailing-comma row regex and single-line vs block
FRAGMENTS parsing so future census edits do not silently miscount.

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

* ci: fail-closed SG-0 census counter + hermetic counter self-tests

Require exactly one NON_TEST/TEST/FRAGMENTS const each, reject unclosed arrays,
and exit nonzero from awk on malformed snapshots. Extend --self-test with
synthetic stdin cases for the counter path (gpt-5-5-pro P3/TESTING).

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

* ci: (a) .txt under census root; multiline FRAGMENTS counter self-test

Claude exploratory: require `src/v3/compiler/…` for removed *.txt evidence
(short *.rs unchanged). Add census self-test for multiline FRAGMENTS (hand==1
path) and PR-body self-tests for bare .txt vs fragment-shaped .txt.

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

* ci: strip CR from GitHub PR body before SG-0 gate parse

pull_request.body may be CRLF; +1\\r failed numeric token match. Normalize
before grep/read and add CRLF self-tests (+0, +1 (b), URL on next line).

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

* ci: count census path rows with EOL // comments; fail on unsupported shape

Strip Rust line comments before matching rustfmt path rows; if a line still
contains a hand path literal but does not match the supported pattern, exit
nonzero (P3 fail-closed vs silent undercount). Add counter self-tests.

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

* WIP: R3 Debt-Paydown

* docs(debt): DP1 Q7 reconcile ledger with ROADMAP (#1638, #1499, CollectionOps)

Retire declaration_by_name emit-pattern row per PR #1638; add #1499 acknowledgment
row for plan §533 stratum B; refresh CollectionOps strand cross-reference.
Update r3-program-plan drift bullets to reconciled status.

Debt receipt (R3 standing program):
- Debt paid: ROADMAP/ledger rows cited in docs/debt/r3-debt-paydown-ledger-2026-05-02.md
  catalog + docs/r3-program-plan.md § drift list (Q7 single PR).

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

* docs(r3): record §S4 actions.dag audit receipt on #1771 (#1873 closed)

Debt-Paydown coordination: audit-and-delta prerequisite satisfied per
quick-ferret receipt; T-LBP COMPLETE remains for downstream S4 dispatch.

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

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request May 7, 2026
* docs(debt): DP1 stratum C — refresh CollectionOps ledger row

Stratum C of R3 DP1 Q-Drift-Reconcile (issue #1977,
brief docs/briefs/r3-dp1-q-drift-reconcile-worker.md). Strata A
(declaration_by_name) and B (#1499 fence) already paid via PR #1892;
this PR closes the remaining ledger↔ROADMAP drift.

Debt receipt:
- (1) Debt paid: ledger row "CollectionOps / StringOps / MapOps duplicate
  operation surfaces" now carries Phase 1 (fold, 2026-05-03), Phase 2
  (concat/length/is_empty, PR #1602), and Phase 3 (map, 2026-05-05)
  receipts, matching ROADMAP §562 + brief
  docs/briefs/collectionops-algebra-reframe.md.
- Open list updated: drops `concat`/`length`/`map`; retains legacy
  literal fields (contains/empty_list/list_literal/cons) + StringOps /
  MapOps / PartialFunction + deferred dsl languages.dag work + Go
  `/* map(...) */` stub dissolution trigger.
- Bucket counts: "Partial (fold)" 1 → 0 (special-case bucket retired);
  "Partially closed" 9 → 10 (CollectionOps row absorbed). Total 75.
- Header amended marker added (2026-05-07).

Docs-only; no code paths touched. cargo fmt / clippy unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(debt): unify CollectionOps row status with bucket taxonomy

Per openai-pro review on PR #2129: the row status column was using a
bespoke 'Partial (fold/concat/length/is_empty/map)' category while the
summary bucket uses 'Partially closed'. Single-authority taxonomy fix:
status column now reads 'Partially closed'; phase detail moved into
the narrative cell ('Landed phases: fold / concat / length / is_empty /
map.').

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request May 7, 2026
…p contract, v3 path) (#2159)

* docs(debt): DP1 stratum C — refresh CollectionOps ledger row

Stratum C of R3 DP1 Q-Drift-Reconcile (issue #1977,
brief docs/briefs/r3-dp1-q-drift-reconcile-worker.md). Strata A
(declaration_by_name) and B (#1499 fence) already paid via PR #1892;
this PR closes the remaining ledger↔ROADMAP drift.

Debt receipt:
- (1) Debt paid: ledger row "CollectionOps / StringOps / MapOps duplicate
  operation surfaces" now carries Phase 1 (fold, 2026-05-03), Phase 2
  (concat/length/is_empty, PR #1602), and Phase 3 (map, 2026-05-05)
  receipts, matching ROADMAP §562 + brief
  docs/briefs/collectionops-algebra-reframe.md.
- Open list updated: drops `concat`/`length`/`map`; retains legacy
  literal fields (contains/empty_list/list_literal/cons) + StringOps /
  MapOps / PartialFunction + deferred dsl languages.dag work + Go
  `/* map(...) */` stub dissolution trigger.
- Bucket counts: "Partial (fold)" 1 → 0 (special-case bucket retired);
  "Partially closed" 9 → 10 (CollectionOps row absorbed). Total 75.
- Header amended marker added (2026-05-07).

Docs-only; no code paths touched. cargo fmt / clippy unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(debt): unify CollectionOps row status with bucket taxonomy

Per openai-pro review on PR #2129: the row status column was using a
bespoke 'Partial (fold/concat/length/is_empty/map)' category while the
summary bucket uses 'Partially closed'. Single-authority taxonomy fix:
status column now reads 'Partially closed'; phase detail moved into
the narrative cell ('Landed phases: fold / concat / length / is_empty /
map.').

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(briefs): add Phase-3 map receipt to collectionops-algebra-reframe

Per BLOCKING review on PR #2129 (codex): the brief lacked a Phase-3 map
receipt, while the ledger row marks map landed. Adds Phase-3 receipt
section mirroring Phase-2 structure: per-target named carriers
(rust/python/go_language_spec_map_contract), carrier-list omission
rationale (legacy adapter shape mismatch), Go stub dissolution
trigger with rg-based closure check. Updates Status header to list
all three landed phases. ROADMAP §562 remains the cross-row authority.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls
briansrls deleted the feat/w1-differential-emit-eval branch June 1, 2026 18:41
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