Skip to content

docs(briefs): 4 XXL dispatch briefs for next-wave compiler work - #603

Merged
briansrls merged 2 commits into
mainfrom
session/zesty-bear-812
Apr 20, 2026
Merged

briansrls merged 2 commits into
mainfrom
session/zesty-bear-812

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Summary

Four XXL dispatch briefs for the next wave of high-impact compiler work. Each is sized for a dedicated worker over multi-week scope. All 4 are parallel-safe.

Lane Brief Impact Sub-lanes
Lane 1e Single-walker emit collapse Dissolves ~10K LOC across emit/rust_target.rs, emit/python_target.rs. Adding a new target = one .dag spec file. Phase 1 audit → Phase 2 spec extension → Phase 3 walker → Phase 4 cutover → Phase 5 regression
SG-3f Surface reflection Reflects 12+ Surface* types into substrate. Prerequisite for real parse.rs and lower.rs dissolution. SG-3f-a carriers → SG-3f-b expr/type trees → SG-3f-c patterns/literals → SG-3f-d consumption proof
SG-4 Infer dissolution Authors infer.dag + regen_infer; retires ~2-3K LOC inference logic. Completes "compiler pipeline = fully .dag-authored." SG-4-a categorize → SG-4-b infer.dag → SG-4-c imperative state → SG-4-d cutover → SG-4-e regression
PB-1 Data-driven bootstrap loader Replaces runtime tokenize/parse/lower at Dag::new() with generated constructors for all 4 bootstrap authorities. PB-1-a std_fixtures → PB-1-b STAGED → PB-1-c V3_SPECS → PB-1-d COMPILER → PB-1-e runtime retirement

Expected combined impact

  • SG-0 census: ~81 → ~55 (-26 files, ~15K LOC hand-Rust dissolved)
  • Compiler pipeline fully .dag-authored: parse (post-SG-3f followup), lower (post-SG-3f followup), infer (SG-4), emit (Lane 1e)
  • Bootstrap data-driven (PB-1)
  • Thesis gate "zero handwritten Rust in src/v3" visible on approach

Parallel-safety

  • Lane 1e: own area — emit/, spec/
  • SG-3f: own area — adds src/v3/std/surface.dag; doesn't conflict with emit/infer/bootstrap
  • SG-4: own area — infer.rs/infer.dag/infer_helpers
  • PB-1: touches bootstrap.rs, build.rs, adds bootstrap_generated.rs, minor lib.rs overlap with SG-4

Sequencing note: SG-3f should start slightly ahead of PB-1 if PB-1 will consume reflected Surface types. Lanes 1, 3 have no cross-deps.

Test plan

  • Docs-only PR; no compiler behavior changes.
  • CI: fmt should pass (markdown).
  • Briefs render correctly on GitHub.

🤖 Generated with Claude Code

Dispatches for the four highest-impact XXL lanes:

- Lane 1e — Single-walker emit collapse: dissolve emit/rust_target,
  emit/python_target into one spec-driven walker. ~10K LOC target
  removal. Enables "new target = one spec file" omni-emission claim.

- SG-3f — Surface reflection: reflect SurfaceModule/Item/Expr/Type/
  Pattern/Literal (12+ types) into substrate. Prerequisite for real
  parse.rs and lower.rs dissolution (currently blocked as scaffolds).

- SG-4 — Infer dissolution: author infer.dag + regen_infer, retire
  2-3K LOC of hand-authored inference logic. Closes the last
  pipeline stage still in hand-Rust.

- PB-1 — Data-driven bootstrap loader: replace runtime tokenize/parse/
  lower at Dag::new() with generated Rust constructors for all four
  bootstrap authorities. Dissolves the thesis-level bootstrap-runtime-
  parse dependency.

Each brief is in the SG worker format: context, read first, work
(staged sub-lanes), acceptance, STOP-AND-ESCALATE, non-goals, size.
All 4 parallel-safe; expected combined impact: ~15K LOC hand-Rust
dissolved, compiler pipeline fully .dag-authored, bootstrap data-
driven. Takes the thesis gate "zero handwritten Rust in src/v3"
from 81 → ~55 after these converge.

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 22ca654b48

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- `docs/substrate-reflection-design.md` — the reflection design canon. Notes this as the last untested load-bearing thesis claim. Read §1 Motivation, §3 File locations, §4 Schema-diff consumers.
- `src/v3/std/substrate.dag` — how reflection works for the existing substrate types (`Dag`, `Behavior`, etc.). Template for how the surface types should be declared.
- `src/v3/std/substrate_minimal.dag` — `NonEmptyList` / `NonSingletonList` precedent; how to bootstrap-split a reflection load.
- `src/v3/compiler/parse_parser_body.txt` — the 1350-LOC hand-authored parser; its `SurfaceModule`, `SurfaceItem`, etc. are the types that need reflection. Don't edit, but understand the shape.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fix SG-3f parser source path in prerequisites

The SG-3f "Read first" checklist points to src/v3/compiler/parse_parser_body.txt, but that file path is not present in this repository while the parser authority is under src/v3/compiler/src/parse.rs. This makes the brief’s first-step workflow non-actionable for anyone dispatched to the lane and can lead to planning against a nonexistent artifact; the prerequisite path should be corrected (or introduced) in the same change.

Useful? React with 👍 / 👎.

- `src/v3/compiler/build.rs` — where `STAGED_FILES` / `V3_SPECS` / `COMPILER_FILES` / `extdeps_generated` / `gunbc_generated` are built at compile time. The build script is the natural home for PB-1's generator.
- `src/v3/compiler/src/dag/builder.rs` — the Dag builder API that TM-1 landed. `push_value`, `push_transform`, `push_bind`, `push_branch`, `push_loop`, `push_atom`, `push_conj`, `alloc_port_with_shape`. These are what the generated bootstrap loader calls.
- `src/v2/stage0/src/std_*.rs` — v2's reference implementation. These are hand-shaped generated Rust that build v2's primed DAG at bootstrap. Study the shape to understand the output contract.
- `src/v3/compiler/src/serialize.rs` / `serialize_generated.rs` — current serialization (used for fixed-point snapshots, not bootstrap). Useful for understanding the Dag's serializable shape.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Correct PB-1 serialization prerequisite reference

The PB-1 "Read first" section instructs workers to read src/v3/compiler/src/serialize.rs, but this path does not exist in-tree (only src/v3/compiler/src/serialize_generated.rs is present). Because this lane depends on understanding current serialization shape, the dead reference can misdirect implementation work and should be updated to the actual source(s).

Useful? React with 👍 / 👎.

@briansrls

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Verified on origin/main — two claims are stale, one is correct:

Stale claim #1 — parse_parser_body.txt doesn't exist / parse.rs is the parser authority.

Actually reversed:

$ git ls-tree origin/main -- src/v3/compiler/src/parse.rs
(empty — not in tree)

$ git ls-tree origin/main -- src/v3/compiler/parse_parser_body.txt
100644 blob 76bcd1c5d... src/v3/compiler/parse_parser_body.txt

PR #589 deleted parse.rs and migrated the 1350-LOC recursive-descent algorithm into parse_parser_body.txt (included into regen_parse output). This is exactly the census-gaming debt SG-3f is prerequisite to resolving — the brief is citing the correct, current-state file.

Stale claim #2 — serialize.rs doesn't exist.

Correct — only serialize_generated.rs is on main. Will fix the PB-1 brief's "Read first" citation.

Correct change being made:

  • Update docs/briefs/pb-1-data-driven-bootstrap.md to cite serialize_generated.rs only (drop the serialize.rs reference)

Pushing fix momentarily.

Two corrections to #603:

1. PB-1 brief: remove reference to `serialize.rs` (doesn't exist on
   main — only `serialize_generated.rs` is present, confirmed via
   git ls-tree). Brief now cites the generated file only.

2. Replace SG-4 "full infer dissolution" brief with SG-4a "infer
   dissolution foundation" per SG-manager correction. Full cutover
   was premature — substrate expressivity pressure is
   uncharacterized. SG-4a becomes a preflight lane:
   - Deliverable A: authority map classifying every infer.rs
     function (structural reader / helper / imperative / glue)
   - Deliverable B: regen_infer prototype on the Category-1/2 subset
   - Deliverable C: ROADMAP debt rows for any substrate gaps
     surfaced
   Sized L (not XXL). Post-SG-4a: director + SG-manager decide
   whether SG-4b dispatches as XXL full cutover, N sequential lanes,
   or holds on substrate extensions.

Codex also claimed `parse_parser_body.txt` doesn't exist and
`parse.rs` does — verified the opposite (parse.rs was deleted by
#589, parse_parser_body.txt contains the 1350-LOC algorithm).
Response posted on the PR.

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

Copy link
Copy Markdown
Contributor Author

Verdict: APPROVE — pure docs addition. Four new dispatch briefs under docs/briefs/; no code, no substrate changes, no reference files altered. Nothing in this diff touches the modeling substrate, invariants, coding style, or test discipline. The briefs themselves explicitly frame their work as subject to the invariants (DB-8 fixed-point as acid test in PB-1, STOP-AND-ESCALATE on scaffold growth in all four, named dissolution triggers, bounded scope) — which is the right posture for planning artifacts.

No findings.

@briansrls
briansrls merged commit 5ba1862 into main Apr 20, 2026
4 checks passed
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