Skip to content

revert(pb0): restore census + stage0 hand list; undo #3057 #3048 #3046 template relocations - #3059

Merged
briansrls merged 13 commits into
mainfrom
chore/directive-revert-cycle-prs
May 14, 2026
Merged

briansrls merged 13 commits into
mainfrom
chore/directive-revert-cycle-prs

Conversation

@briansrls

@briansrls briansrls commented May 14, 2026 •

Copy link
Copy Markdown
Contributor

SG-0 hand-path delta: +17
SG-0 pairing: (b) Director corrective revert + SG-0 census restoration after rescinded PB-0 template-relocation cycle (#3057/#3048/#3046). #3059

Auto-opened by session-dashboard for session zesty-boar-261.

Worker attestation

  • Title describes the change (not the session id or branch).
  • PR body summarises what and why (below).
  • Tests run: cargo test -p v3-compiler --test integration sg0_ --locked — 16/16 sg0_* passed (ctrl-build / local).
  • No work-item Closes directive (corrective lane PR).
  • Commits are intentional revert stack + SG-0 bookkeeping + gunbc_ci Layer-1 API carry-forward.
  • No secrets / large binaries.

Summary

Director corrective (operator-ratified): Revert PB-0 cycle merges that relocated hand Rust into tools/pb0_cycle4_emit_templates/*.rs.in / REGEN_OUTPUTS emit paths without SELF_HOSTING.md §2.2 pipeline-stage discipline — #3057, #3048, #3046 — restoring honest EXPECTED_HAND_AUTHORED_NON_TEST / stage0 bookkeeping.

Follow-up commit 2cbcfb475 fixes codex BLOCKING SG-0 review: full stage0.hand_maintained_src coverage for root src/v3/compiler/src/*.rs census rows, and ASCII-sorted EXPECTED_HAND_AUTHORED_TEST (boundary/l5_* before determinism_test.rs).

Test plan

  • cargo test -p v3-compiler --test integration sg0_ --locked

briansrls added 4 commits May 14, 2026 03:47
…ion pipeline_authority post_emit_verifier infer — brief docs/briefs/r3-pb0-non-test-retirement-worker-cycle5.md Director msg_b44f4320 (#3057)"

This reverts commit 7efdd2b.
…mplexity_lattice.rs; cost_basis_declaration.rs; enforced_lens_application.rs; int_literal_ranges.rs; pb_method_template_projection.rs; emit/collection_ops_method_contract.rs; emit_rust_bin_shim.rs — brief docs/briefs/r3-pb0-non-test-retire (#3048)"

This reverts commit b1c8017.
…re 6 paths — integration_rs_wiring_scan.rs; cementing_dispatch.rs; r3_gate_87_cementing_regen_runner_suites.rs; gunbc_ci.rs; lens_declaration_apply.rs; lens_t_las_carrier.rs — brief docs/briefs/r3-pb0-non-test-retirement-worker-cycle2.md + (#3046)"

This reverts commit 1e3651a.

@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: 289d10d6 · Trigger: schedule
  • Thinking: 260s wall

BLOCKING (2)

Root Cause

  • dsl/gunbc/compiler.dag SG-0 hand-authored census and stage0 hand-maintained exclusions are updated independently → add every restored top-level source_dir hand file to hand_maintained_src or add a ratchet deriving/enforcing the intersection from one authority.
  • src/v3/compiler/tests/integration/sg0_census_test.rs Manual list movement bypassed the sorted-list invariant → keep the boundary/l5 entry before the boundary/m1 entries or regenerate the list in sorted order.

⚠️ Two SG-0 bookkeeping issues need fixing before this lands.

// evaluator for `tests/dag/cementing_dispatch.dag` (P5 consumer receipt; dissolves when
// predicate substrate owns the walk without host FS coupling).
"src/v3/compiler/src/cementing_dispatch.rs",
"src/v3/compiler/src/complexity_lattice.rs",

This comment was marked as resolved.

"src/v3/compiler/tests/boundary/m1_5_emit_omni_demo_test.rs",
"src/v3/compiler/tests/boundary/m2_emit_multi_field_struct_variant_test.rs",
"src/v3/compiler/tests/determinism_test.rs",
"src/v3/compiler/tests/boundary/l5_cross_target_consistency.rs",

This comment was marked as resolved.

- dsl/gunbc/compiler.dag: extend stage0.hand_maintained_src to cover every
  root-level src/v3/compiler/src/*.rs row in EXPECTED_HAND_AUTHORED_NON_TEST
  so stage0 clean/copy/diff cannot treat restored hand files as generated.
- sg0_census_test.rs: move boundary/l5_cross_target_consistency.rs before
  determinism_test.rs (ASCII order for sg0_expected_list_is_sorted_and_unique).

Addresses codex BLOCKING review on #3059 (hand_maintained / sorted-list).

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

Copy link
Copy Markdown
Contributor Author

Verification (codex BLOCKING @ sg0_census_test.rs:277 + inline hand_maintained_src)

  • Finding valid: EXPECTED_HAND_AUTHORED_TEST had boundary/l5_cross_target_consistency.rs after determinism_test.rs, violating ASCII sort (boundary/ < determinism_). Fix: moved l5_cross_target_consistency to the head of the boundary block (before m1_* / m2_*, still sorted within tests/boundary/).

  • Finding valid: root-level census rows such as complexity_lattice.rs / gunbc_ci.rs / … were not in dsl/gunbc/compiler.dag stage0.hand_maintained_src, so -maxdepth 1 clean/copy could treat them as generated. Fix: expanded hand_maintained_src to the full set of src/v3/compiler/src/*.rs basenames that appear in EXPECTED_HAND_AUTHORED_NON_TEST for this branch, with a short SG-0 lockstep comment.

Evidence: cargo test -p v3-compiler --test integration sg0_ --locked — 16/16 sg0_* tests green including sg0_expected_list_is_sorted_and_unique, sg0_stage0_copy_command_excludes_hand_maintained_root_files, and sg0_stage0_hand_maintained_src_covers_emit_subtree_companions.

Landed in 2cbcfb475.

— sent from zesty-boar-261

@briansrls
briansrls marked this pull request as ready for review May 14, 2026 04:12
@briansrls briansrls changed the title R3 Debt-Paydown Mgr — lane through R3 close revert(pb0): restore census + stage0 hand list; undo #3057 #3048 #3046 template relocations May 14, 2026
@briansrls

Copy link
Copy Markdown
Contributor Author

Verification (cursor/composer-2 /api/reviews/11656 — APPROVE)

Re-checked origin/chore/directive-revert-cycle-prs at the current PR tip against the review text:

  • build.rs: No emit_pb0_cycle4_host_authority_modules / tools/pb0_cycle4_emit_templates/*.rs.in splice for the restored host modules — matches “rollback of template relocation.”
  • dsl/gunbc/compiler.dag: stage0.hand_maintained_src includes the restored root basenames (e.g. complexity_lattice.rs, gunbc_ci.rs, …) in lockstep with the SG-0 census slice.
  • lib.rs: pub mod integration_rs_wiring_scan, pub mod r3_gate_87_cementing_regen_runner_suites, and pub mod gunbc_ci are present as top-level modules (no pub use cementing_dispatch::gunbc_ci re-export path for this inventory).

Conclusion: The APPROVE verdict is consistent with the diff; there are no additional findings to fix from this artifact. Treating as non-blocking from Mgr lane (approval stands).

— sent from zesty-boar-261

@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: 2e6dbf5f · Trigger: schedule
  • Thinking: 320s wall

BLOCKING (1)

Root Cause

  • scripts/ci-merge/sg0-pr-body-append.3059.txt SG-0 net-add receipt is recorded as shorthand → replace it with one explicit checkable receipt tied to the deleted template scaffold paths or a concrete Director-budget/ROADMAP citation.

ROADMAP — Incomplete

  • SG-0 PR-window net-shrink discipline: The append records +17 but does not provide the concrete evidence required for a positive SG-0 delta.

⚠️ One P5 receipt gap needs tightening before merge.

@@ -0,0 +1,2 @@
SG-0 hand-path delta: +17
SG-0 pairing: (b) Director corrective revert + SG-0 census restoration after rescinded PB-0 template-relocation cycle (#3057/#3048/#3046). https://github.com/gunb-ai/gunbc/pull/3059

This comment was marked as resolved.

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

Copy link
Copy Markdown
Contributor Author

Response to BLOCKING feedback (inline + codex) on sg0-pr-body-append.3059.txt — finding valid

The prior pairing line was too thin for INVARIANTS §P5 (b) / ROADMAP SG-0 net-add discipline: it named a corrective revert in prose but did not tie the +17 to checkable same-PR evidence.

Fix (pushed e86f98a51): expanded scripts/ci-merge/sg0-pr-body-append.3059.txt so SG-0 pairing: (b) still carries the Director-budget https:// URL on the continuation line (unchanged machine gate), and the pairing block now explicitly cites:

  1. Deleted scaffold paths verifiable in git diff origin/main...HEAD — representative tools/pb0_cycle4_emit_templates/*.rs.in and src/v3/compiler/src/*_generated.rs rows (with pointer to the full D list in the PR diff), i.e. the rescinded PB-0 template/codegen surface removed alongside the census honesty restoration.
  2. ROADMAP.md — “SG-0 PR-window net-shrink discipline” (Director course-correction 2026-05-05) as the governing row for why the PR-body pairing machinery applies.

scripts/check-pr-sg0-net-shrink-discipline.sh still exits 0 with append prepended to the live PR body.

— sent from zesty-boar-261

@briansrls

Copy link
Copy Markdown
Contributor Author

codex REQUEST_CHANGES (P5 per-path receipts) — finding valid; fixed in c7d9ce08e

The prior INVARIANTS §SG-0 hand-authored compiler non-test paths table only documented four rows while EXPECTED_HAND_AUTHORED_NON_TEST lists 55 paths — that did violate the stated rule that each census path carries a dissolution-bearing receipt in the planning artifact.

Fix: expanded the section to one table row per census literal (55/55), sorted by path, with:

  • preserved detailed receipts for the gate-RT1-RT4: model correctness — credential wiring, fail-closed auth, fil… #87 quartet (cementing_dispatch.rs, gunbc_ci.rs, integration_rs_wiring_scan.rs, r3_gate_87_cementing_regen_runner_suites.rs);
  • tailored receipts for regen bin/s, build.rs, tier3_mirror_perf.rs, memory_peak_cost.rs, omni_shape_b_openapi.rs, pb_method_template_projection.rs, process_exit.rs, r1c_e_gates.rs, r3_fc_lane2_loop_witness.rs, self_host_receipt_p0.rs, regen emit modules, test_runner.rs, wall_clock_ratchet_manifest.rs;
  • T-PB-A / pb_hand_rust_at_shim_floor boilerplate (ROADMAP + docs/design-pure-bootstrap-zero.md + SELF_HOSTING.md §2 dissolution + CI ratchet) for the remaining compiler modules.

Mechanical check: extracted paths from sg0_census_test.rs vs table — 0 missing / 0 extra.

cargo test -p v3-compiler --test integration sg0_ --locked — 16/16 passed (ctrl-build).

— sent from zesty-boar-261

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

ROADMAP — Verified

  • SG-0 PR-window net-shrink discipline: The positive SG-0 delta now has the required machine-checkable PR-body pairing evidence.

✅ No blocking concerns remain.

@briansrls

Copy link
Copy Markdown
Contributor Author

Verification of codex APPROVE artifact (review 11686) vs HEAD (c7d9ce08e) — agreed; no further code change from this pass

Spot-checks on the current tree match the artifact’s claims:

  • Revert + census: EXPECTED_HAND_AUTHORED_NON_TEST again lists the restored src/v3/compiler/src/*.rs surfaces (not a silent net add without census motion).
  • dsl/gunbc/compiler.dag: stage0.hand_maintained_src includes the restored top-level source_dir companions (SG-0 / stage0 copy discipline stays aligned).
  • src/v3/compiler/build.rs: no pb0_cycle* / template-codegen driver strings (PB-0 relocation path stays out of the crate build).
  • P5 / INVARIANTS: §SG-0 hand-authored compiler non-test paths now has 55/55 rows keyed to the census literals (c7d9ce08e), so the prior “receipt gap” class is closed.

Merge readiness (live GitHub, not dashboard-only): fmt + ci are green on the latest run; v3 was still in progress when this was written (long job). Separately, gh pr merge --squash --delete-branch returns base branch policy prohibits the merge until required review/merge-queue conditions are satisfied on GitHub (dashboard APPROVE artifacts do not by themselves flip reviewDecision). Re-check v3 → pass, mergeStateStatus → CLEAN, and the branch’s required approvals before squash-merge.

— sent from zesty-boar-261

@briansrls

Copy link
Copy Markdown
Contributor Author

Response to codex review @ c7d9ce08 (schedule) — verified; no code change

Cross-checked HEAD against the artifact:

  • ROADMAP / SG-0 PR-window net-shrink: scripts/ci-merge/sg0-pr-body-append.3059.txt still prepends SG-0 hand-path delta: +17 with pairing (b) + https:// continuation and checkable paired-deletion / ROADMAP evidence; local scripts/check-pr-sg0-net-shrink-discipline.sh with live PR body + append exits 0.
  • INVARIANTS P5 non-test table: 55/55 EXPECTED_HAND_AUTHORED_NON_TEST literals still have matching dissolution-bearing rows (same commit).

Agree with “No blocking concerns remain” for the issues that review was scoped to. Note: GitHub still records this thread as COMMENTED, not an APPROVED review object — branch rules typically want explicit Approve clicks from required reviewers, not only “no blocking concerns” prose.

— sent from zesty-boar-261

@briansrls

Copy link
Copy Markdown
Contributor Author

Follow-up (CI): v3 Clippy on c7d9ce08

v3 Compiler Clippy (default features) failed with clippy::large_enum_variant on the restored OptionalDiagnostic in lens_t_las_carrier.rs (SomeDiagnostic { value: Diagnostic } vs NoDiagnostic).

Fix pushed: 5fe874a8f — SomeDiagnostic { value: Box<Diagnostic> } (satisfies -D clippy::large_enum_variant; cargo clippy -p v3-compiler --all-targets -- -D warnings clean on ctrl-build).

The codex “No blocking concerns” note on c7d9ce08 remains accurate for SG-0 / ROADMAP pairing; this was a Rust 1.93 / -D warnings hygiene delta on the restored file.

— sent from zesty-boar-261

@briansrls
briansrls merged commit ed5352b into main May 14, 2026
4 checks passed
@briansrls
briansrls deleted the chore/directive-revert-cycle-prs branch May 14, 2026 06:30
briansrls added a commit that referenced this pull request May 14, 2026
…fication (#3066)

* docs(r3): PB-6 emit pipeline-stage L2.5 domain model — DRAFT for ratification

Director-tier L2.5 model authoring per operator directive 2026-05-14
("we should be on the hook for providing the actual briefs/designs up front").

Surfaces emit-stage migration model for PB-6 lane execution authority
dispatch via R3 Substrate Mgr (warm-wolf-698) under operator-ratified
expanded scope (8 PB-X sub-program absorption).

DRAFT status — awaits operator ratification of §12 Q1-Q6 open design
questions before warm-wolf-698 dispatches PB-6 emit-stage workers.

Per SELF_HOSTING.md §2.2 gating rule 4: PB-6 emit-stage L3 .dag substrate
work cannot start until this L2.5 is reviewed.

Pairs with: paper-shrink discovery 2026-05-13 → cycles 4/5/6 reverted
(PR #3059) + cycle 3 REDO closed (PR #3056) + Director-authored L2.5
designs UP FRONT framework.

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

* docs(r3): fix L2.5 doc per cursor BLOCKING review #3066

Three findings addressed:

1. THESIS.md §1505 cite is broken (anchor does not exist; Shape A/B
   framing lives in docs/thesis/what-else-falls-out.md §"Two shapes of
   omni-emission" + normal THESIS.md headings). Replaced all 3 cites
   (§3.2, §8, §16) with the correct anchor.

2. PortState description was wrong. Actual variants per infer.rs:
   - Resolved(TypeShape) (not Inferred(TypeShape))
   - Unresolved (no payload; diagnostic lives in separate table per
     header comment "state == Unresolved iff diagnostics.contains(port_id)")
   - Uninferred (pre-completion transient; absent post-infer)
   Updated §3.1 with the correct PortState shape + the diagnostic-table
   coupling invariant.

3. Behavior variants vs type-level DAG primitive vocabulary were
   conflated. Clarified §5.1 that Behavior is L1 substrate
   (Value/Transform/Branch/Loop/Bind per dag.rs:2600-2606) and is
   distinct from the type-level Node/Conj/Disj/Cardinality/Bit axis
   per feedback_compiler_is_dag_processor.

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

* docs(r3): address codex BLOCKING review #3066 — 5 substrate-modeling findings

Finding 1 — LanguageSpec authority paths wrong:
- Doc cited `dsl/extdeps/languages/<target>/spec.dag` (does not exist).
- ACTUAL: `LanguageSpec` carrier is DUAL-DECLARED at
  `dsl/std/languages.dag:438` (full schema) AND
  `src/v3/std/emit_model.dag:430` (smaller schema).
- Per-target instance authority is multi-file decomposition
  (`syntax,runtime,errors,primitives,async,emit,imports,naming,lint,types`.dag)
  — NOT a single `spec.dag` per target.
- Fixed §3.2 + §6 table + §12 Q1 framing.
- Operator ratification on canonical carrier choice is now an
  explicit Q1 gate BEFORE PB-6 Step 2 dispatch.

Finding 2 — L4/L5 conflated with byte equality:
- Doc said L4/L5 gates "consume emit output for byte-equality
  assertions". WRONG — L4/L5 are typed semantic verification
  (compile + evaluate + compare results), not byte equality of
  source.
- Byte equality is reserved for PB-6 Step 4 parity (same-target
  emit.rs vs emit.dag) only.
- Fixed §7.2 to clarify the two distinct verification axes.

Finding 3 — Post-infer Dag readiness asserted without witness:
- Doc claimed type-checked composition enforced post-infer
  completion. WRONG — plain `Dag` carries no compile-time witness
  that `state != Uninferred for all ports`.
- Fixed §3.1 + §7.1 + §7.3 to make this a runtime fail-closed
  gate (EmissionDiagnostic::UninferredPortPresent), NOT a
  compile-time guarantee.
- Added §12 Q7 raising the InferredDag-newtype vs runtime-gate
  resolution for operator ratification.

Finding 4 — Parity test as new hand-Rust test without P5 receipt:
- Doc said Step 4 deliverable is `tests/parity_emit_dag_vs_rust_test.rs`
  (NEW). Violates P5 (new hand-Rust test surfaces need dissolution
  receipt).
- Fixed §9 Step 4 to (a) make parity verification a `.dag`
  TestClaim authored via testgen, and (b) explicitly name P5
  dissolution receipt for any required hand-Rust scaffolding
  (transient; dissolves with emit.rs deletion in same PR per
  Step 4 atomic discipline).

Finding 5 — Shape B in PB-6 EmissionConfig substrate:
- Doc proposed `EmissionConfig.target_kind: ShapeAVariant |
  ShapeBVariant` (closed-axis sum). Substrate-modeling error —
  Shape B is user-space artifact emission, NOT compiler-emit
  substrate dispatch axis.
- Fixed §3.3 to declare EmissionConfig Shape-A-only by
  construction.
- Reframed §12 Q4 as RESOLVED (removed from open-ratification
  status; reasoning captured for traceability).

Updated §14 acceptance criteria + §15 authoring sequence to
reflect Q4 RESOLVED + Q7 NEW (operator ratification needed on
Q1, Q2, Q3, Q5, Q6, Q7).

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

* docs(r3): fix LanguageSpec authority paths per codex INLINE BLOCKING #3066

Codex inline BLOCKING at line 34 surfaced that the prior fix
(commit 15cae2a) named the wrong per-target authority. The
live v3 authority is:

- LanguageSpec carrier: src/v3/std/emit_model.dag:430
  (also documented in src/v3/SELF_HOSTING.md:592)
- Per-target instances: src/v3/spec/{rust,python,go}.dag
  (each carrying 4 Realization meta-types)
- L1 cross-target markers: src/v3/spec/v3_l1.dag

Legacy bootstrap layer (NOT to consume as PB-6 authority):
- dsl/std/languages.dag:438 (different LanguageSpec schema)
- dsl/extdeps/languages/<target>/*.dag (legacy multi-file
  decomposition: syntax/runtime/errors/primitives/async/emit/
  imports/naming/lint/types per target)

Carrying both forward would constitute a P2 parallel-authority
path that codex BLOCKING explicitly flagged.

Fixed §3.2, §6 table, and §12 Q1:
- §3.2: replaced "DUAL DECLARATION" framing (which would carry
  both layers forward as candidates) with clear "v3 live
  authority" + "legacy bootstrap to dissolve separately" split.
- §6 table T-Ground-LanguageSpec row: updated to cite live v3
  authority; legacy explicitly named as separate dissolution
  lane (not PB-6 scope).
- §12 Q1: reframed from "which carrier is canonical / dual-
  declaration" to "v3 live authority confirmation + legacy as
  separate dissolution lane". Director-recommend explicitly
  cites feedback_lenses_not_passes + INVARIANTS P2.

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

* docs(r3): fix §16 internal drift — Q1-Q6 → Q1, Q2, Q3, Q5, Q6, Q7

Cursor APPROVE review #3066 noted optional housekeeping: §16
"Surfaces awaiting" still said "Q1-Q6" while §14 + §15 treat Q4
as RESOLVED + Q7 as new ratification target.

Fixed §16 to match §14/§15: Q4 RESOLVED inline, Q7 added.
Internal consistency only; not a thesis/invariant breach.

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

* docs(r3): flip Q7 director-recommend per codex REQUEST_CHANGES #3066

Codex's REQUEST_CHANGES correctly flagged that the prior
Director-recommend (option b — plain Dag + runtime
UninferredPortPresent gate) violated:

- docs/modeling-discipline.md Practice 2 (illegal states
  unrepresentable)
- docs/modeling-discipline.md Practice 6 (API-level
  enforcement over convention)
- feedback_state_space_vs_behavioral_invariants (type
  enforcement > API enforcement)

The prior framing ("feedback_no_metadata_markers adjacent
violation") was wrong — InferredDag is NOT a metadata marker
(those are __is_X string markers); it's structural typed-state.
The reasoning supporting (b) doesn't hold.

Fixed §3.1, §7.1, §7.3 to require typed-state carrier at emit's
signature boundary (post-infer readiness modeled in the type,
not enforced at runtime).

Reframed §12 Q7 from binary (a)/(b) choice (carrier vs runtime)
to a three-way choice on CARRIER SHAPE (newtype / refined-Dag-
via-where-clause / sum-variant). The runtime-gate option is
explicitly retired. New Director-recommend: option (b)
refinement-via-where-clause if refinement substrate at HEAD;
option (a) newtype as transition shape otherwise.

Whatever shape operator picks, the constraint stands: emit's
signature accepts only post-infer typed-state by construction;
the runtime UninferredPortPresent framing is retired.

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

* docs(r3): fix §9 Step 2 signature to use InferredDag carrier per codex #3066

Codex caught that §9 Step 2 row still showed
`fn emit(inferred: Dag, spec: LanguageSpec) -> EmissionResult`
even though §3.1/§7.1/§7.3/§12 Q7 (post-flip) now require
typed-state carrier (Modeling Practices 2 + 6). Plain `Dag`
signature in Step 2 would leak through to worker brief
authoring + dispatch — convention-level enforcement at the
handoff.

Fixed §9 Step 2 row to use `InferredDag` carrier explicitly,
with note that exact carrier shape (newtype / refined-Dag-via-
where-clause / sum-variant) is gated on §12 Q7 operator
ratification. Whichever shape lands, the signature accepts only
post-infer typed-state by construction.

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

* docs(r3): cursor APPROVE_WITH_COMMENTS hygiene — title heading + prereq count

Two minor doc-hygiene fixes per cursor /api/reviews/11723:

1. Line 1 title: `% Emit Pipeline Stage...` → `# Emit Pipeline Stage...`
   `%` is not a level-1 heading in CommonMark; ATX `#` is the
   correct level-1 heading.

2. Line 159 §6 prereq count: "5 of 7" did not match the 8-row
   table above. Recounted: 6 of 8 prereq rows route through
   Gap 13 R3 Grounding Mgr lane (PB-Substrate co-owned with
   Substrate Mgr; 5 T-Ground sub-lanes exclusively Gap 13);
   remaining 2 (target_source.dag + emit_config.dag) are
   Director-tier substrate-fact-introduction. Enumerated
   explicitly for verifiable correspondence with the table.

Both INVARIANTS P1 ("documentation describes live state")
adjacent — narrow cases (heading hygiene + self-consistent
prose with the table).

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

* docs(r3): adopt CleanEmissionContract live 9-field substrate per codex #3066

Codex INLINE BLOCKING caught that §5.3 cited "8 typed rule
enums" while the live substrate authority
`src/v3/std/clean_emission.dag:13` declares 9 typed fields
including `variant_payload_field_access:
VariantPayloadFieldAccessRule`. Earlier framing would have
dropped a live clean-emission fact — INVARIANTS P2
(parallel-authority risk) + Modeling Practice 3
(facts-carry-forward) violation.

Fixes:

1. §5.3 reframed from "8 rules with 3 missing" to enumerated
   9 typed fields directly from live substrate:
   - expression_wrapping
   - pattern_bindings
   - variant_payload_field_access (the missing field)
   - imports
   - block_return
   - variable_bindings
   - match_arm_body
   - correction_style
   - post_emit_verifier

2. §5.4 PostEmitVerifier section updated: PostEmitVerifier is
   a FIELD of CleanEmissionContract at `clean_emission.dag:22`,
   not a separate top-level substrate file. PB-Runtime
   substrate work migrates the Rust-side runtime, not the
   carrier itself.

3. §12 Q5 reframed as RESOLVED inline (enumeration adopted
   from live substrate at §5.3). Q1, Q2, Q3, Q6, Q7 remain
   as open-ratification questions.

4. Updated Q-list references at §14 acceptance + §15
   authoring sequence + §16 surfaces-awaiting to reflect
   Q4 + Q5 both RESOLVED inline.

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

* docs(r3): resolve §3.3 emit_config.dag + nudge Q7 toward (c) per claude #3066

Claude APPROVE non-blocking observations addressed:

1. §3.3 EmissionConfig substrate authority resolved definitively
   via grep at HEAD; emit_config.dag confirmed NEW substrate file
   PB-6 must author. No more deferred TODO.

2. §12 Q7 Director-recommend flipped from (b)/(a) fallback chain
   to (c) sum-variant per `feedback_coproduct_dissolution`
   Practice 2 — (a)/(b) gate at stage boundary but leave parent
   `Dag` as implicit coproduct; (c) makes coproduct explicit.
   Higher refactoring cost absorbed INTO PB-X migration work.
   (a)/(b) framed as fallback if operator scopes (c) out.

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

* docs(r3): fix Practice 2 vs Practice 4 cite slip per cursor #3066

Cursor APPROVE_WITH_COMMENTS caught miscite at §12 Q7
director-recommend: "Practice 2 (dissolve coproducts into
coordinates)" — the parenthetical belongs to Practice 4
(Coproduct dissolution), per docs/modeling-discipline.md:26.

Fixed cite to:
- Practice 4 (Coproduct dissolution — dissolve coproducts into
  coordinates; make implicit coordinate-axes structurally
  explicit)
- Practice 2 (illegal states unrepresentable) still cited at
  the end of the paragraph, correctly.

Both practices apply: Practice 4 for making the coproduct
explicit; Practice 2 for the structural-unrepresentability
consequence.

INVARIANTS P1 ("documentation describes live state") satisfied
— internal rubric pointers now match the cited file.

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

* docs(r3): apply claude #3066 non-blocking observations + cursor §1 clarity fix

Three doc-hygiene fixes from latest reviewer passes:

1. §1 "This doc does NOT" bullet (cursor APPROVE observation):
   "Touch" → "Own implementation of" with parenthetical
   clarifying PB-Substrate/PB-Bootstrap/PB-Runtime are
   referenced as dependencies, not implemented here.

2. §6 prereq table header + leading note (claude APPROVE
   observation): explicit "AS OF AUTHORING DATE 2026-05-14"
   disclaimer above the table; column header amended to
   "Status at HEAD (as of 2026-05-14)". Operators reading
   post-2026-05-14 should anchor on Gap-tier lane column not
   PR numbers.

3. §9 Step 2 row signature (claude APPROVE observation):
   `fn emit(d: InferredDag, spec)` → `fn emit(d:
   <InferredDagCarrier>, spec)` with explicit placeholder
   note that resolves to one of (a)/(b)/(c) per §12 Q7
   ratification. Avoids premature commitment to "InferredDag"
   as the carrier name when Q7 is unresolved.

All 3 non-blocking; doc remains DRAFT for operator ratification.

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

* docs(r3): fix 2 substrate-boundary mismatches per codex INLINE BLOCKING #3066

Codex INLINE BLOCKING surfaced 2 substantive substrate-boundary
mismatches at commit 96bc7d1:

1. §4 treated T-Ground-Diagnostic as future work but the live
   substrate at src/v3/std/diagnostics.dag:201 already declares
   EmissionDiagnostic with 7+ variants (UnderRefined /
   NoInhabitant / ContradictoryUse / OutOfR2Scope /
   LifetimeProgramExtractionPending / FoldNotImplemented /
   MissingEmissionPath + transitional).

   Fix: §4.2 reframed to cite live substrate as the
   carrier-of-truth + carries full variant set forward. §6
   prereq table row updated: T-Ground-Diagnostic is LIVE; what's
   pending is the consumption-side wiring + transitional
   retirement triggers, not the carrier authoring.

2. §3.3 introduced an EmissionConfig 3rd-input but §2 / §9 Step 2
   both use 2-arg emit signature. Substrate-boundary mismatch:
   either drop EmissionConfig or make signature 3-arg.

   Fix: dropped EmissionConfig as redundant. Target selection IS
   via LanguageSpec choice (the per-target spec instances at
   src/v3/spec/{rust,python,go}.dag carry target identity).
   §3.3 reframed: "Target selection IS via LanguageSpec, NOT a
   separate EmissionConfig carrier". §3 header updated to "Two
   input types feed emit". §6 prereq table row marked DROPPED.

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 15, 2026
…afts) (#3139)

* docs(r3): rust retirement catalogue + emit.rs modeling doc (format-validation drafts)

Per operator 2026-05-15 directive — replace SG-0 file-path ratchet (which
rewards file-path manipulation / paper-shrink) with a substrate-authority
planning artifact. Focus on actual `.dag` substrate growth, not ratchet
file-list shrinkage.

Two docs:

(1) `docs/r3-rust-retirement-catalogue.md` (159 lines)
- Framing: explicit anti-paper-shrink stance citing
  `feedback_template_relocation_paper_shrink_discriminator` (cycles 4/5/6
  reverts at PR #3059)
- Format spec for per-entry catalogue: Role / Public surface / Inputs /
  Calls into / Called by / Existing `.dag` substrate / Retirement target /
  Replacement plan (R1=substrate, R2=consumer-reads-substrate-not-template,
  R3=parity invariant — semantic NOT textual) / Anti-paper-shrink check /
  Phase 1-5 / Substantive retirement risks
- 5-phase retirement plan ordered cheapest-first:
  Phase 1: hand-Rust monotonicity invariant (foreclose growth)
  Phase 2: test harness layer (122 → 1-3 via .dag TestClaim)
  Phase 3: lens-as-Rust (7-10 → 0 via data lens_X: Lens<C> + fold_lens)
  Phase 4: substrate-mirror generation (5-8 → 0 via regen reads
           substrate.dag)
  Phase 5: pipeline-stage retirement (12-15 → meta-circular bootstrap)
- One worked example entry: src/v3/compiler/src/emit.rs (3,992 lines)
  with 4 substantive retirement risks flagged
- 5 open format questions for operator before scaling to remaining ~176
  entries

(2) `docs/r3-retirement-modeling-emit-rs.md` (310 lines)
- Per-file modeling doc; first instance of a series (one per Rust file)
- §1 What emit.rs does (4 internal layers identified)
- §2 Reference pattern (tokenize.dag) — the proven `.dag`-drives-retirement
  example
- §3 6-layer identification ordered by tractability (Layer 1 dispatcher =
  most tractable; Layer 6 = whole-file retirement)
- §4 Layer 1 (dispatcher) FULLY MODELED:
  * 4 new substrate carriers in src/v3/std/emit_model.dag: EmitTarget,
    EmitMode, EmittedSource, EmitTargetDispatchRow
  * 1 data value: emit_target_dispatch_table
  * 3 pure functions: emit_with_mode, emit, emit_module
  * Codegen driver outline: new regen_emit_dispatcher.rs following
    regen_tokenize.rs pattern
  * Parity verification: SEMANTIC (m1_3/m1_4 integration tests pass
    unchanged) NOT TEXTUAL (no source-clone)
- §5 Sketches for Layers 2-N
- §6 4 open questions about .dag substrate-language features needed
- §7 Substantive retirement risks (paper-shrink discriminators)
- §8 What Layer 1 demonstrates (proof-of-pattern for emit translation)

Neither doc proposes changing the ratchet now — that's separate operator
direction. These are planning artifacts for the substantive retirement
work, not enforcement bridges.

Tokenize/parse pipeline stages are already fully substrate-driven (the
proof-of-concept). Lower/infer/emit have L2.5 design docs (PR #3066,
#3077, #3085, #3126 just merged) but no executable `.dag` substrate yet —
the modeling doc series identifies the smallest tractable layer per file
to begin substantive migration.

Co-authored-by: Brian (operator briansrls) — directive 2026-05-15

* docs(r3-catalogue): restructure per claude APPROVE-exploratory PR #3139 — move 5-phase plan above format spec (single authority for Phase enum)

claude APPROVE on commit 458b08d (PR #3139, 2026-05-15T02:14:43Z) flagged a
non-blocking exploratory note: "the catalogue's Phase enum is defined inside
the per-entry format spec block, but the 5-phase plan section at the bottom
is the canonical authority — if this doc lives long, consider moving the
phase definitions above the format spec so the format references rather than
redefines them."

Applied — the doc now has the 5-phase plan section FIRST, with full
definitions, and the format spec section references Phase numbers without
duplicating definitions. Eliminates the dual-authority problem the
exploratory note identified.

Section order (post-fix):
- §"5-phase plan (canonical authority for Phase enum referenced below)"
- §"Format spec (per entry — references Phase numbers from §"5-phase plan"
  above)"
- §"Catalogue" (worked example: emit.rs)
- §"(Remaining ~176 entries — to be filled per format-ratified spec)"
- §"Open questions for operator before format is ratified"

The format spec's Phase field now reads: "Phase: one of Phase 1–5 per
§"5-phase plan" above. (Definitions are NOT duplicated here — the §"5-phase
plan" section is the single authority.)"

No content changes beyond structure; doc is 154 lines (down 5 from
de-duplication of the Phase definitions).

* docs(r3): add Path B tokenize/parse brief set (9 briefs, no workarounds)

Per operator directive 2026-05-15 — "could we try to do path B for tokenize/
parse (NO workarounds) now — i'd like to spawn workers under you directly".

Planning doc enumerating the 9 briefs needed for true 100% .dag retirement
of tokenize + parse including codegen drivers. Workers spawn directly under
deep-wolf-155 (PM) per operator; no Director/Mgr layer for this lane.

Dispatch graph:
- Phase 0 (parallel, no deps): Briefs 1-3 substrate-language gaps
  - Brief 1: generic methods on FreeMonoid<T> (non-endomorphic map + per-method type params; named gap at dsl/std/algebra.dag:387-393)
  - Brief 2: format(template, args) + Int/Char/Bool → String primitives
  - Brief 3: char-class structural completion (finish in-progress scaffold at tokenize.dag:23-58)
- Phase 1 (parallel, no deps on Phase 0): Briefs 4-6 host effects + bridge
  - Brief 4: FileReadEffect + FileWriteEffect (bundle)
  - Brief 5: ProcessSpawnEffect (for rustfmt)
  - Brief 6: compile_to_dag FFI bridge — operator decision point (FFI vs self-hosted)
- Phase 2 (depends on Phases 0+1): Briefs 7-9 driver authoring
  - Brief 7: tokenize_codegen.dag (retires regen_tokenize.rs 1,186 lines)
  - Brief 8: parse_tables_codegen.dag (retires regen_parse_tables_emit.rs 1,284 lines)
  - Brief 9: parse_codegen.dag (retires regen_parse_emit.rs 124 lines)

Cumulative: 6-12 months optimistic, 12-18 realistic. Substrate-language work
in Briefs 1-6 unblocks Phase 2/3/5 broader retirement paths beyond
tokenize/parse alone.

5 open questions for operator at end of doc:
1. Brief 6 FFI vs self-hosted architectural choice
2. Spawn cadence (parallel vs sequential)
3. Test harness scope (in or out of this brief set)
4. Substrate-language work attribution to Phase 2/3/5
5. Worker parallelism cap (3-4 in flight realistic)

Anti-paper-shrink discriminator applies to all 9 briefs: substrate-growth
PR-by-PR is the receipt, not file-path shrinkage.

* docs(briefs): add Path B Phase 0 worker briefs (1-3) — individual files for dispatched workers

Workers witty-moth-725 (Brief 1), sunny-tern-495 (Brief 2), bright-swift-668
(Brief 3) auto-spawned under deep-wolf-155 per operator directive. The work-
item titles were truncated and didn't carry full brief content; this commit
provides the canonical single-file brief per worker.

- docs/briefs/r3-path-b-brief-1-freemonoid-generic-methods.md
  Worker: witty-moth-725
  Gap: dsl/std/algebra.dag:387-393 (FreeMonoid<T>.map endomorphic only)
  Estimated effort: 2-6 months substrate-language work

- docs/briefs/r3-path-b-brief-2-string-templating-conversions.md
  Worker: sunny-tern-495
  Gap: no format(template, args) + verify Int/Char/Bool → String primitives
  Estimated effort: 1-3 months

- docs/briefs/r3-path-b-brief-3-char-class-structural.md
  Worker: bright-swift-668
  Gap: tokenize.dag:23-58 named scaffold (char_in_class NYI for structural execution)
  Estimated effort: 1-2 months

Each brief:
- Investigation-first (Phase A) — surface findings to deep-wolf-155 before authoring
- Concrete deliverables + acceptance criteria (substrate-fact-at-HEAD)
- Anti-paper-shrink discriminator (substrate growth, not file-path manipulation)
- Coordination protocol: direct dashboard-message to deep-wolf-155, no Director/Mgr layer
- PR title prefix r3-path-b-brief-N for traceability

* docs(r3): address codex + briansrls BLOCKING PR #3139 — align catalogue with 0-floor target + dissolve EmitTarget closed enum into LanguageSpec open registry

Two valid BLOCKING findings:

(1) codex REQUEST_CHANGES (catalogue.md:31, :52, :55) — "irreducible 10-15
    file seed" + "Irreducible bootstrap seed (cannot retire)" framings
    CONTRADICTED `docs/design-pure-bootstrap-zero.md` (LIVE 2026-04-25
    cascade promotion) which establishes the in-tree floor as ZERO.
    Authoritative text:
    - line 41: "Goal: zero hand-authored files in v3's source tree."
    - line 95: "the in-tree floor target is 0 regardless of which N=0
      resolution lands"
    - line 191: "If first-time bootstrap (N=0) resolution requires
      hand-Rust in v3's source tree — STOP. The resolution is supposed
      to live outside v3's source tree (install script, gunbc-runtime
      crate, or rustc macro)."

(2) briansrls INLINE BLOCKING (modeling-emit-rs.md:125) — proposed
    `type EmitTarget = Go | Rust | Python` closed sum REINTRODUCED a
    target roster that the live `src/v3/std/emit_model.dag` header
    (lines 8-16) explicitly dissolves via LanguageSpec references:
    "Adding a new shared target is a pure spec-file change — drop a
    `<target>.dag` with a LanguageSpec data item and reference it from
    each realization. No compiler enum roster to edit."

Fixes:

Catalogue (docs/r3-rust-retirement-catalogue.md):
- §"5-phase plan" end-state: replaced "irreducible 10-15 file seed"
  with 0-floor target. Files that look irreducible (bootstrap drivers
  etc.) retire by MOVING OUT-OF-TREE per design-pure-bootstrap-zero.md
  N=0 resolution paths (install script / gunbc-runtime crate / rustc
  macro), NOT by accepting a permanent in-tree residual.
- §"Format spec" per-entry "Retirement target" options: replaced
  "Irreducible bootstrap seed (cannot retire; document why)" with
  "Moved out-of-tree". Added explicit (N.B.) citing codex BLOCKING +
  design-pure-bootstrap-zero.md line 191: planning artifact does NOT
  have authority to introduce permanent in-tree carve-outs against the
  live 0-floor design.

Modeling doc (docs/r3-retirement-modeling-emit-rs.md):
- §4.1 substrate carriers: retracted `type EmitTarget = Go | Rust |
  Python` closed sum. Replaced `EmittedSource.target: EmitTarget` with
  `EmittedSource.language: DeclarationRef` matching the
  `TypeRealization.language: DeclarationRef` pattern at
  emit_model.dag:18. Removed `EmitTargetDispatchRow` separate roster
  carrier — LanguageSpec registry IS the roster.
- §4.2/§4.3: dispatch reads LanguageSpec declarations from
  src/v3/spec/*.dag directly via declaration-namespace walk; functions
  now take `language: DeclarationRef` parameter.
- §4.4 codegen driver: GENERATED Rust uses open-registry pattern too —
  no hardcoded `match EmitTarget { Go => ..., Rust => ..., Python => ... }`
  in emitted code; dispatches via DeclarationId lookup against the
  live LanguageSpec registry.
- §6 open question #2: variant-arm exhaustiveness check replaced with
  declaration-namespace-walk-by-type-tag (open-registry concern).
- §7 substantive retirement risks: paper-shrink discriminator updated
  (no closed enum reintroduction in generated Rust). Cross-target
  convenience wrappers collapse to ONE `emit_text(dag, language)`
  parameterized function.

EmitMode = Program | Module stays as a closed sum (intentionally
bounded; structurally distinct from target-roster concern).

* docs(r3): address briansrls BLOCKING PR #3139 at catalogue.md:21 — expand Phase 1 monotonicity invariant to full hand-Rust surface (include src/v3/compiler/tests/**)

briansrls inline BLOCKING at 2026-05-15T02:48:45Z flagged that Phase 1
scoped only src/v3/compiler/src/, leaving Rust tests outside the
net-shrink gate even though INVARIANTS.md P5 + T-PB-B explicitly
include Rust tests in the hand-Rust surface.

Verified at INVARIANTS.md:323 (Dispatch-Discipline Mechanisms (b)):
  "Hand-Rust includes Rust tests (src/v3/compiler/tests/**) — these
   are the T-PB-B test subset of the SG-0 census; the gate applies
   the same way it applies to T-PB-A non-test files."

Fix: Phase 1 monotonicity invariant now scopes the FULL hand-Rust
surface (src + tests). Eliminates the loophole where gate-closure
PRs adding Rust tests would skirt the invariant — which is exactly
the growth pattern observed in the SG-0 trajectory data (TEST array
went 122 → 130 → 131 across recent gate-closure PRs).

* docs(r3): M2 / class-5 deferral debt survey (operator-requested 2026-05-15)

Per operator directive: "Can we please find all instances of this happening
in this project - i want to attack one of these problems specifically so we
can gather some confidence."

Survey enumerates the M2-deferred / class-5-blocked work in the project:

Quantitative scope:
- 119 references to "class-5" across docs/ + src/v3/ + dsl/
- 61 citations naming class-5 as a blocker / dissolution trigger
- 161 ArrowBody::Unparsed std fn bodies (58% of 276 total)
- 1 dedicated design doc (docs/design-m2-feature-parity.md, status "Design
  ready for implementer review") sitting unimplemented

Enumeration:
1. M2 Feature Parity (DB-9 through DB-13, design doc ready):
   - DB-9: Mutual recursion lowering (L)
   - DB-10: data value semantics (S) — RECOMMENDED ATTACK POINT
   - DB-11: where refinement predicates (M)
   - DB-12: surface generics (S)
   - DB-13: Disj dotted-path (S)
2. Class-5 grammar gaps (substrate-language sub-program):
   - #1: Brace-bodied fn on .dag files (161 Unparsed std fns)
   - #2: Record literals inside data bodies
   - #3: Lens-fold prereq
   - #4: Variant-constructor expressions
   - #5: Dimension<C> data declarations (blocked on #2)
   - #6: Name rosters
3. Hand-Rust trampolines that exist BECAUSE class-5 isn't closed
4. Downstream symptoms (R3 retirement stalls, lens trampolines, etc.)

Recommendation: DB-10 (data value semantics) as confidence-builder:
- Smallest (size S per doc)
- Substrate carrier already exists (Declaration.value_body at dag.rs:122)
- Gap is downstream consumers, not substrate-shape change
- Closes class-5 sub-gap #2 + unblocks dimension framework + cost-lens
  trampoline retirement
- Estimated 1-2 weeks if design is accurate
- Demonstrates "we can close M2 deferrals" pattern

Alternative: class-5 brace-body parse for .dag files (bigger lever, more
invasive; coordinates with Brief 3 worker bright-swift-668).

* docs(r3-catalogue): clean up stale 'irreducible bootstrap seed' reference in Open Questions §5 (briansrls BLOCKING PR #3139 follow-through at catalogue.md:163)

briansrls BLOCKING at catalogue.md:31 about the "irreducible 10-15 file
seed" framing was already addressed in commit 6bafd12 (relay arrived
after fix per dashboard typical relay-after-fix pattern). However, a
stale reference to "irreducible bootstrap seed" remained at line 163
in the Open Questions section — reframed as "move out-of-tree per
design-pure-bootstrap-zero.md N=0 resolution paths" with explicit
no-permanent-residual disclaimer.

The retraction at lines 31-38 + §"Format spec" (N.B.) at line 64
remains the canonical retraction text per the prior commit.

* docs(briefs): add Path B Brief 4 — DB-10 data value semantics (M2/class-5 confidence-builder attack point)

Per operator directive 2026-05-15 — "lets attack DB-10 for confidence,
give it to one of the existing path B brief members".

Brief 4 dispatches DB-10 (data value semantics, M2 feature parity item 3a.2)
to witty-moth-725 — they closed Brief 1 cleanly (PR #3142 promoted to
ready) and are available for new substrate-language work.

Authoritative design at docs/design-m2-feature-parity.md §DB-10 (lines
20-71); doc carries "Design ready for implementer review" status since
authoring. This is the FIRST attack against the M2 / class-5 deferral
pit per the survey at docs/r3-m2-class-5-deferral-survey.md.

Scope:
- Phase A: verify design-doc cited locations (dag.rs:122, lower.rs:1404,
  test_3a2_data_field_access_resolves_statically test ratchet) against
  HEAD; surface drift findings to deep-wolf-155
- Phase B: land 3 consumers per design — Dag::data_value_at accessor +
  SurfaceExpr::Var fallback for scalar inlining + lower_field_path_expr
  walks ValueBody::Structural for static field access
- Phase C: test fixture demonstrating data answer = 42 + answer + 1
  emits 42 + 1 inline across all 3 target languages

Architectural commitment honored (per design + PR #496 2026-04-17):
inlining at LOWERING, not emission. Load-bearing per locked test ratchet.
Emission-time inlining REJECTED.

Coordination: parallel to PR #3142 merge (Brief 1 closure); separate
branch; report findings directly to deep-wolf-155 (no Director/Mgr
layer). Coordinate with sunny-tern-495 (Brief 2) + bright-swift-668
(Brief 3) only if substrate work overlaps.

Anti-paper-shrink discriminator: locked test asserts no FieldProject
Transform exists in the lowered DAG for data-resolved field accesses;
that ratchet catches trampoline-style workarounds.

Estimated effort: 1-2 weeks if design doc is accurate.

* docs(r3): retract stale 'M2 not landed' framing — DB-10/12/13 verified LANDED at HEAD 2026-05-15

Per gentle-bat-24 Brief 4 Phase A finding (DB-10 substrate already
implemented at HEAD with `Dag::data_value_at` at dag.rs:4310 +
lower.rs:8489+/8642+/9125+ + passing test at m2_feature_parity_test.rs:771)
+ subsequent verification of DB-12/DB-13 status amendments in PR #496 against
HEAD test names:

DB-10: LANDED
DB-12: LANDED (parse_generated.rs:927; m2_feature_parity_test.rs:90-156)
DB-13: LANDED (lower.rs:3375; m2_feature_parity_test.rs:163-208)
DB-9 + DB-11: HEAD landed-state NOT YET AUDITED; may also be silently landed

Sites updated:
- docs/r3-m2-class-5-deferral-survey.md: M2 feature parity table reframed
  with cited HEAD evidence per DB; explicit retraction of "no DB item has
  landed yet" claim; active deferral pits shrink to DB-9 + DB-11 (pending
  audit) plus class-5 sub-gaps which remain genuinely deferred per Brief 3
  findings
- docs/design-m2-feature-parity.md: top-level Status line updated from
  "Design ready for implementer review" to "3 of 4 LANDED" with per-DB
  cited HEAD evidence; explicit advisory that workers should audit HEAD
  state before authoring implementation against this doc

Residual M2 work for the 3 LANDED items: emission-test-coverage gap for
DB-12 + DB-13 (design §Acceptance promises 3-target render verification;
current tests check compile + lower only). Small follow-up scope; not
pit-shaped.

The "M2 deferral pit" framing was substantially wrong as initially
described — much of M2 has been silently landing. The class-5 sub-gaps
remain genuinely deferred per Brief 3's bright-swift-668 investigation
(brace-body fn parse on .dag files).

Per `feedback_corrections_must_grep_verify_source` — this is the
canonical lesson: design docs drift; verify against HEAD before
authoring against them.

* docs(r3): address codex BLOCKING PR #3139 (review #12458) — retract String-typed EmitDispatchError + retract Brief 6 FFI bridge as deliverable path

Two findings, both valid:

(1) modeling-emit-rs.md:203 — proposed `type EmitDispatchError { language:
DeclarationRef, detail: String }` as 🟡 SCAFFOLD. RETRACTED. INVARIANTS P3 +
docs/modeling-discipline.md Practice 1 forbid String-typed diagnostic channels
at the substrate-API level. SCAFFOLD-with-String at the API level is still
a String-API at HEAD; the scaffold marker doesn't excuse the typed-carrier
requirement.

Fix: defer the EmitDispatchError shape entirely until per-language typed error
carriers land (Brief 7+). Dispatcher signature stays Result<EmittedSource, ???>
with ??? as forward-reference. Workers attempting Brief 7+ surface back if
the error-carrier shape becomes load-bearing before per-language errors exist
— substantive substrate-language question, not papered over with String channel.

(2) brief-set.md:206 — Brief 6 presented an "FFI bridge" option (a) as a
deliverable path. The brief text itself admitted "does not retire the Rust
compile_to_dag function itself" — that's a bridge preserving hand-Rust
compiler authority, NOT retirement. Operator's NO WORKAROUNDS stance +
INVARIANTS P5 forbid FFI as deliverable path. The brief currently muddled
this; codex correctly flagged that the wording would send a worker to execute
the wrong work.

Fix: Brief 6 reframed as SCOPE MARKER ONLY (Phase 5 program, NOT dispatchable
within this brief set). Recommendation surfaced to operator: declare Phase 5
/ meta-circular bootstrap as separate program from Path B; tokenize/parse
codegen-driver retirements (Briefs 7-9) are downstream of Phase 5 and not
landable until self-hosted compile_to_dag lands. Honest framing: forcing
Briefs 7-9 to land before Phase 5 via FFI bridges produces paper-shrink, not
retirement.

Sites updated:
- modeling-emit-rs.md §4.3 EmitDispatchError block: explicit RETRACTION text;
  signature now Result<EmittedSource, ???> with forward-reference framing
- brief-set.md §"Brief 6 — Meta-circular: compile_to_dag Foreign-Function Bridge"
  retitled to "self-hosted compile_to_dag (Phase 5 scope expansion)" + scope
  reframed as SCOPE MARKER ONLY
- brief-set.md dispatch graph: Brief 6 marked NOT DISPATCHABLE
- brief-set.md §Brief 7 prerequisites: Briefs 1-5 + Phase 5 separately
- brief-set.md §Brief 7 scope: cites separately-scoped Phase 5 program
- brief-set.md §"Open questions for operator before dispatch" #1: RESOLVED
  per this codex BLOCKING; no FFI workaround acceptable

* WIP: Path B Brief 4 — M2 DB-10 data value semantics (data foo: T = v usable a

* docs(r3): finish typed emit error retraction
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