Skip to content

pb-substrate-atompayload - #784

Merged
briansrls merged 4 commits into
mainfrom
session/sharp-gull-429
Apr 25, 2026
Merged

briansrls merged 4 commits into
mainfrom
session/sharp-gull-429

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Opened from session-dashboard for session sharp-gull-429.

@briansrls

Copy link
Copy Markdown
Contributor Author

Zero-Floor Manager review — direction approved; clean execution against brief.

Diff matches the brief's three deltas exactly:

Notes

  • 41/-71 net diff (-30 LOC) — retiring more than adding is the right shape for a migration slice. Generated counterpart (in dag_scalar_generated.rs via regen) replaces the dag.rs declaration.
  • render_sum placement — added BEFORE CardinalityBound in render_dag_scalar_module (after LiteralBits). Matches substrate.dag declaration order — good discipline. (Brief said "extend with one more render_sum" without specifying placement; worker chose authority-order match.)
  • Substrate.dag annotation — propagated comment block lands ABOVE the existing 🟢 TERMINAL short annotation on AtomPayload, making them stacked. Reads cleanly.

Pre-ready checklist (per brief)

  • cargo test --workspace --exclude v2-compiler-tests passes
  • cargo clippy --all-targets -- -D warnings clean
  • cargo fmt --all --check clean
  • DB-8 self_host_fixed_point converges bit-identically
  • SG-0 census: dag.rs partition unchanged (file stays); dag_scalar_generated.rs partition unchanged (REGEN_OUTPUTS member)

CI is skipping while draft. Mark ready when checklist is green; #781's tracked-debt entry gets one row's-worth of closure on this PR's merge.

Pattern generalized cleanly from #780 → #784. Cementing pattern (SG-0 producer-owned-partition) holding; doc-comment propagation gap handled by upstream-rationale-first path (a) as expected. No findings.

- Extend render_dag_scalar_module with AtomPayload (#[derive(Debug, Clone)]).
- Move dissolution-ledger rationale to substrate.dag; keep impl AtomPayload in dag.rs.
- Regenerate dag_scalar_generated, bootstrap snapshots, parse corpus manifest.

Made-with: Cursor

@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: 43f79424 · Trigger: schedule
  • Thinking: 181s wall

BLOCKING (1)

Root Cause

  • scripts/regen_runtime_mirrors.py runtime mirror generation was updated but its generated artifact was omitted → run the runtime mirror regeneration and commit the updated dag_scalar_generated.rs with this authority move

Non-blocking — Strengths

  • src/v3/std/substrate.dag Classified as mixed code plus .dag substrate; moving AtomPayload’s ledger to the .dag authority aligns with bounded-substrate-seed once the generated mirror lands.

⚠️ One generated artifact is missing, so the substrate authority move is conceptually right but not yet buildable.

output_name="LiteralBits",
variant_name_overrides={"LitInt": "Int", "LitBool": "Bool", "LitString": "String"},
),
render_sum(

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.

BLOCKING: Adding AtomPayload to the mirror generator without committing the regenerated dag_scalar_generated.rs leaves the Rust substrate without an AtomPayload definition after dag.rs deletes the hand-written enum, breaking fail-closed compiler construction.

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.

Verified: the finding matched pushed tip 43f79424b (WIP amended locally before regen/bootstrap/manifest were folded in). Current branch tip 42beb0e03 includes the regenerated src/v3/compiler/src/dag_scalar_generated.rs with pub enum AtomPayload { ... } plus bootstrap + parse manifest updates; cargo check -p v3-compiler is clean.

Force-pushed session/sharp-gull-429 so the PR no longer sits on the intermediate WIP without generated output — not stale dismissal, same fix the comment asked for (committed regen artifact).

@briansrls
briansrls marked this pull request as ready for review April 25, 2026 04:08
@briansrls
briansrls force-pushed the session/sharp-gull-429 branch from 43f7942 to 42beb0e Compare April 25, 2026 04:09
@briansrls

Copy link
Copy Markdown
Contributor Author

Re api-review @ `43f79424` (2026-04-25T04:06:18Z) — blocking item verified and resolved on current head.

Verification (HEAD `42beb0e03`, matches `origin/session/sharp-gull-429`):

  • `python3 scripts/regen_runtime_mirrors.py --check` — clean (no stale generated output).
  • `src/v3/compiler/src/dag_scalar_generated.rs` includes `pub enum AtomPayload { ... }` after `LiteralBits`.
  • `cargo check -p v3-compiler` — clean.

Why the review was right for `43f79424`: that commit updated the generator and removed the hand-written enum without landing the regenerated mirror — not buildable.

Resolution: amended commit folds in `dag_scalar_generated.rs` + bootstrap + parse manifest; branch was force-pushed so #784 no longer targets the WIP SHA. Same fix the review asked for (run regen, commit artifact); not a stale dismissal.

(Inline thread on `regen_runtime_mirrors.py:759` was also replied with the same resolution.)

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: 42beb0e0 · Trigger: schedule
  • Thinking: 86s wall

Verdict: APPROVE — clean substrate-authority migration following the regen pattern.

The diff moves AtomPayload from a hand-written Rust enum in dag.rs to a .dag-authored type in src/v3/std/substrate.dag, with the dissolution ledger comment preserved verbatim. The mechanical pieces all line up:

  • substrate.dag:35-77 — new type AtomPayload = ... with the full ledger comment.
  • dag.rs — the hand-Rust pub enum AtomPayload { ... } and its leading ledger doc are removed; the impl AtomPayload { resolved_id } helper stays (Rust-internal, no substrate concern).
  • dag_scalar_generated.rs:11-18 — generated mirror picks up the new variants.
  • regen_runtime_mirrors.py:759-764 — added render_sum("AtomPayload", ...) call.
  • bootstrap_generated.rs / bootstrap_generated_without_parse_surface.rs — declaration-ID renumbering consistent with substrate.dag now declaring AtomPayload at id 593.
  • parse_corpus_manifest.txt:37 — substrate.dag size/hash bumped (109763 → 109842, hash f69596b21c7867d2), consistent with the +79-byte content change.

Single-authority for substrate types is preserved (post-migration: only the .dag defines AtomPayload). No modeling discipline regressions; the earlier Identifier/Some-None coproduct dissolution is carried into the .dag text intact.

Exploratory observation (non-blocking): impl AtomPayload at dag.rs:415 now precedes include!("dag_scalar_generated.rs") at line 426. Legal Rust, but minor readability oddity — future cleanup could move the impl below the include so the type definition reads first. Not worth blocking on; same pattern probably exists for other regenerated scalars.

@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: 43f79424b4

ℹ️ 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".

Comment on lines +760 to +764
"AtomPayload",
sums["AtomPayload"],
"#[derive(Debug, Clone)]",
output_name="AtomPayload",
),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P0 Badge Regenerate scalar mirror before deleting AtomPayload type

This change wires AtomPayload into the generator, but the generated output file is not updated in the same commit after removing the hand-written enum from src/v3/compiler/src/dag.rs. Because src/v3/compiler/src/dag_scalar_generated.rs still has no AtomPayload definition, the crate no longer compiles (cargo check -p v3-compiler reports unresolved AtomPayload imports/types across many modules). Please regenerate and commit the scalar mirror output (or keep the manual enum until that happens).

Useful? React with 👍 / 👎.

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.

Verified on current PR head `42beb0e03` (also `origin/session/sharp-gull-429`):

  • This inline thread is anchored to `43f79424b` (see `commit_id` on the review) — the intermediate WIP that added `render_sum("AtomPayload", …)` and removed the hand enum without committing `dag_scalar_generated.rs`. On that SHA your diagnosis is correct.

  • Tip `42beb0e03` includes `src/v3/compiler/src/dag_scalar_generated.rs` with `pub enum AtomPayload { … }` (after `LiteralBits`), plus bootstrap + parse manifest. `python3 scripts/regen_runtime_mirrors.py --check` is clean; `cargo check -p v3-compiler` is clean.

So the requested fix (regenerate + commit scalar mirror) is already landed; the finding is not applicable to the current commit — not dismissed as stale without checking, see SHAs above.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: 42beb0e0 · Trigger: schedule
  • Thinking: 182s wall

Verdict: APPROVE

Diff is narrowly scoped: AtomPayload authority moves to std/substrate.dag, the Rust mirror is generated from that source, and the bootstrap/manifest updates match the regenerated spans. I found no concrete violations of the pinned rubric.

Verification: cargo check -p v3-compiler, cargo test -p v3-compiler, and git diff --check origin/main...HEAD all passed.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: e918871f · Trigger: manual
  • Conversation: View conversation

1. Story of the diff

This PR takes AtomPayload out of hand-written Rust and puts it onto the same regenerated runtime-mirror path as the other substrate scalar/sum types. The load-bearing move is scripts/regen_runtime_mirrors.py:759-764, which adds AtomPayload to the render_dag_scalar_module sum generation list; the generated Rust enum then appears in src/v3/compiler/src/dag_scalar_generated.rs:11-18, while the hand-written enum and its long ledger are removed from src/v3/compiler/src/dag.rs:415-484. The substrate declaration itself remains the authority, and the explanatory dissolution ledger is moved to src/v3/std/substrate.dag:35-68, so the Rust surface becomes a mirror instead of a second modeled source. The bootstrap fixture churn and parse corpus manifest update are the expected regeneration fallout from inserting the ledger text into substrate.dag and shifting source spans.

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation).

Compliant — this touches substrate-adjacent runtime mirrors, and the authority is moved in the right direction: src/v3/std/substrate.dag:35 explicitly marks the AtomPayload ledger as “substrate authority,” while scripts/regen_runtime_mirrors.py:759-764 makes the Rust enum generated from the substrate sum instead of maintained by hand.

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

Compliant — single-authority/progress-is-dissolution is improved: the hand Rust enum is deleted from src/v3/compiler/src/dag.rs:456-484, and the replacement is generated at src/v3/compiler/src/dag_scalar_generated.rs:11-18. The illegal-states-unrepresentable shape is also preserved: the substrate ledger calls out the split between UnresolvedIdentifier, ResolvedByStructure, and ResolvedByName at src/v3/std/substrate.dag:59-64, rather than collapsing phase state behind an Option.

  1. CODING.md.

Compliant — the new implementation follows the existing regen/data pattern rather than adding object behavior: scripts/regen_runtime_mirrors.py:759-764 is a declarative render_sum(...) entry, and the output at src/v3/compiler/src/dag_scalar_generated.rs:12-18 is a plain data enum with no new hidden state, builder API, or side-effecting library path.

  1. TESTING.md.

Compliant — no new behavior path is introduced, so a new behavior test would be artificial; the diff updates the generated artifacts and the hermetic parse corpus manifest checksum at src/v3/compiler/tests/integration/parse_corpus_manifest.txt:37, which is the relevant regression surface for this regeneration-only slice.

  1. LOCKED DESIGN DECISIONS.

N/A — I do not see the diff altering a locked thesis/design decision; the only design-directed text is the future-extension audit note at src/v3/std/substrate.dag:66-68, which preserves rather than changes the extension path.

  1. TRACKED vs UNTRACKED DEBT.

N/A — no new TODO, scaffold, compatibility bridge, or temporary representation is added. The new ledger classifies AtomPayload as terminal at src/v3/std/substrate.dag:37 and names the audit path for future extensions at src/v3/std/substrate.dag:66-68.

3. Verdict

APPROVE

The PR reduces duplicate authority by moving AtomPayload onto the generated substrate mirror path, preserves the modeled variant shape, and includes the expected regenerated fixtures/manifest updates. I found no blocking or non-blocking findings grounded in the diff.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: 10c787f7 · Trigger: schedule
  • Thinking: 27s wall

Findings: none.

Verdict: APPROVE — Clean single-authority migration. AtomPayload now has one source of truth in src/v3/std/substrate.dag (with the dissolution-ledger comment moved alongside the type), the hand-written Rust enum is deleted from dag.rs:415, and the regen script emits it into dag_scalar_generated.rs which dag.rs includes. The impl AtomPayload block stays in dag.rs and resolves against the included enum. Bootstrap fixture diffs are mechanical re-numbering from the substrate change; the parse corpus manifest hash is updated accordingly. Exactly the kind of parallel-representation dissolution the modeling discipline asks for.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 3b789e51 · Trigger: manual
  • Conversation: View conversation

According to the attached review history from 2026-04-25: this loop has converged. It found one real mechanical blocker, the implementer paid it off, and the remaining observations are not worth another review round.

Loop summary

Rounds: 2 functional rounds in the attached history. Round 1 was a Codex blocker at 2026-04-25 04:06:18Z: the generator had been updated but the generated runtime mirror artifact was missing. Round 2 contains two approval reviews at 04:10:54Z and 04:12:49Z after the artifact appeared. Total elapsed review time: about 6 minutes 31 seconds. chatgpt-review-271e71e3-bac7-47…

Commits: the exact commit count is not present in the attached review history or aggregate diff. The history proves at least one revision/update between the first blocker and the two approvals, but I will not invent an exact commit count.

Reviews: 2 Codex reviews, 1 Claude/API review, 0 browser reviews in the attached ALL_REVIEWS.txt. The prompt mentions browser history, but the attached review file only contains api-cli:codex and api-cli:claude entries. chatgpt-review-271e71e3-bac7-47…

Forward progress evidence

The loop found a concrete missing-artifact problem and resolved it. The first review correctly blocked because scripts/regen_runtime_mirrors.py had been changed without committing the corresponding dag_scalar_generated.rs. The later reviews explicitly observed that dag_scalar_generated.rs now includes the generated AtomPayload, the regen script calls render_sum("AtomPayload", ...), bootstrap outputs were regenerated, and the manifest was updated. chatgpt-review-271e71e3-bac7-47…

The PR is also moving in the right architectural direction: duplicate authority is being dissolved. AtomPayload is no longer hand-authored as a Rust enum in dag.rs; the authority is the .dag declaration, and Rust gets a generated mirror. That matches the Boundary Discipline rule: every fact should live in exactly one authoritative place, and a boundary counts as landed when the declaration, realization, and generated consumer proof exist. chatgpt-review-4aabe237-88ac-43…

The ledger accounting moved with the authority rather than disappearing. The review history says the dissolution ledger was preserved in substrate.dag; that matters because coproducts need explicit terminal/scaffold accounting, not unannotated “good enough” enums. chatgpt-review-271e71e3-bac7-47…

The modeling rubric requires a GREEN enum to carry a ledger entry and a YELLOW scaffold to carry a named trigger. chatgpt-review-47a60ea1-2ce5-4a…

The loop ended with real consumer proof, not just reviewer confidence: the final Codex review reports cargo check -p v3-compiler, cargo test -p v3-compiler, and git diff --check origin/main...HEAD all passing. chatgpt-review-271e71e3-bac7-47…

Debt accumulation evidence

No material new scaffold debt. The added AtomPayload ledger is a terminal classification, not a new unbounded scaffold. There is no new // SCAFFOLD lane, no “temporary bridge,” and no staged consumer migration left dangling in the attached history.

No recurring finding class in this loop. There was one blocker: generated artifact omitted after changing regen. It was not re-flagged across multiple rounds after repair. That does not justify a new INVARIANTS.md rule yet. If this same generator/artifact drift keeps recurring across PRs, then it should graduate into a generated-artifact freshness ratchet, but PR #784’s attached loop does not show recurrence.

One acceptable polish debt remains: the Claude/API review noted that impl AtomPayload now appears before include!("dag_scalar_generated.rs"). That is legal Rust and was classified non-blocking. It is readability/organization debt, not substrate debt. chatgpt-review-271e71e3-bac7-47…

No new semantic consumer was added, but that is acceptable here. This PR is not introducing a new language feature; it is moving authority for an existing substrate type. The consumer proof is the generated runtime mirror plus passing compiler tests. For this specific PR, asking for a new interpreter/emitter/user-facing consumer would be local perfection, not forward progress.

Cheating signal

Low cheating signal. The implementer did not hide the compromise. The shape is explicitly accounted for as a terminal coproduct ledger in the .dag authority, and the mechanical generated outputs were committed after the blocker. That is structural, not a “make the reviewer go away” patch.

The most recent fix was not a cheaper local workaround. It updated the generator output path and committed the generated mirror, bootstrap files, and manifest. That is exactly the correction the first blocker requested. chatgpt-review-271e71e3-bac7-47…

The only “cheap” thing left is the impl-order oddity, and it is honestly non-blocking: moving an impl below an include later costs about the same as doing it now.

Path to convergence

This PR is already at convergence for the review loop.

Merge criteria from here:

  1. CI remains green.
  2. The current diff keeps AtomPayload single-authority: .dag declaration as source, generated Rust mirror as realization, no reintroduced hand-written enum.
  3. The PR description or follow-up tracker records the minor impl-order cleanup.

Debt acceptable to carry: impl AtomPayload placement before the generated include. Track it as a small follow-up issue titled something like “Normalize generated scalar impl placement after dag_scalar_generated.rs include”. It does not need an INVARIANTS.md change and should not block merge.

Do not keep iterating unless a new reviewer can show one of these concrete failures: regenerated files are stale again, the hand-written Rust enum still exists as duplicate authority, or tests fail. Without that, another round is likely to produce polish churn, not more convergence.

Meta-verdict

⚖️ SHIP_WITH_DEBT — merge with the minor impl-order cleanup tracked separately.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: 10c787f7 · Trigger: schedule
  • Thinking: 182s wall

Verdict: APPROVE

This diff cleanly moves AtomPayload authority into src/v3/std/substrate.dag and generates the Rust mirror from it; I don’t see a concrete invariant, coding, or testing discipline violation. Verified with git diff --check, cargo check -q, cargo test -q -p v3-compiler substrate_coproducts_match_runtime_carriers, and python3 scripts/regen_runtime_mirrors.py --check.

@briansrls
briansrls merged commit 4f12dda into main Apr 25, 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