Skip to content

docs(audit): cascade evidence reframe — substrate generation already proven (Director-approved per #766 escalation) - #775

Merged
briansrls merged 2 commits into
mainfrom
reframe/audit-substrate-already-generated
Apr 25, 2026
Merged

briansrls merged 2 commits into
mainfrom
reframe/audit-substrate-already-generated

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Summary

Director-signed-off remediation per #766 escalation thread. Layered on top of merged #769 + #771.

Codex BLOCKING finding on withdrawn pilot brief #772 surfaced that the original audit (and the design doc PROPOSAL framing) treated substrate generation as a future pattern needing proof. Direct verification establishes the pattern is already proven and shipping:

  • 26 *_generated.rs files under src/v3/compiler/src/.
  • dag.rs is a hybrid (substrate-shape include!()s at :497, :1678, :1699, :1710).
  • substrate.dag coverage survey: 38 declared types, 11 already generated, 27 not yet generated by the survey heuristic.
  • Concrete uncovered hand-authored example: ArithmeticOp / ComparisonOp / LogicalOp / OperatorKind declared in substrate.dag AND hand-authored at dag.rs:694-725 AND ungenerated. (a)-pilot target.

What this PR does

Adds new §"Substrate generation is already proven and shipping (load-bearing reframe)" to docs/design-pure-bootstrap-zero-audit.md immediately before the existing §"Findings before the table".

Cascade implications

  • Pre-promotion Deliverable 4 reframes from "prove the pattern via new pilot" to "characterize existing pattern as primary evidence + optional small (a) pilot on uncovered type."
  • 0-floor target is further along than design doc PROPOSAL claimed.
  • PB-Substrate lane scope narrows from "build the pattern" to "extend existing pattern to 27 uncovered substrate types + retire orchestration-kernel hand-authoring in dag.rs."
  • Lane file-by-file assignments remain valid; "why hand-authored" rationale cells flagged for future audit-discipline rewrite (out of scope for this PR).

Companion PRs

Test plan

  • Doc-only diff. No code surface.

🤖 Generated with Claude Code

…eframe per #766 escalation)

Third post-merge follow-up to #769, bundled into the same PR as the
LOC-drift fix and wildcard-placeholder fix. Director-signed-off
remediation per #766 escalation thread.

Codex BLOCKING finding on withdrawn pilot brief #772 surfaced that
the original audit (and the design doc's PROPOSAL framing) treated
substrate generation as a future pattern needing proof. Direct
verification establishes:

- 26 *_generated.rs files already shipping under
  src/v3/compiler/src/, covering substrate/parse/tokenize/infer/
  lower/diagnostics/lens/operators/types/serialize/variant_payload/
  bootstrap.
- dag.rs is a hybrid (substrate-shape includes at :497/:1678/:1699/
  :1710 pull in dag_scalar/branch/cluster/lookup generated files).
- substrate.dag coverage survey: 38 declared types, 11 already
  generated (CardinalityBound, LiteralBits, PortState, TypeShape,
  TemplateArgument, BranchPattern, Cluster, IntraClusterCall,
  LoopBound, MemberDescent, PayloadBinding), 27 not yet generated
  by the heuristic.

New §"Substrate generation is already proven and shipping" surfaces
the verified state and reframes the cascade evidence base from
"prove the pattern via new pilot" to "characterize existing pattern
as primary evidence + optional small pilot on uncovered type."

PB-Substrate lane scope narrows from "build the pattern" to "extend
existing pattern to 27 uncovered types + retire orchestration-kernel
hand-authoring." Lane file-by-file assignments remain correct as
migration targets; the original "why hand-authored" rationale cells
need a future audit-discipline rewrite (out of scope for this PR).

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

Copy link
Copy Markdown
Contributor Author

Director review — APPROVE. Cascade evidence reframe lands clean.

Strong remediation work. +63 lines added to audit doc; substrate-generation finding now load-bearing in the cascade evidence base. Honest-accounting framing applied throughout.

What's right

  • Verification cited at concrete sha (4d2423da8). Not assertion; replicable evidence.
  • Substrate.dag coverage survey is the load-bearing addition. 11 already-generated types named explicitly + 27 not-yet-generated types listed. This is the empirical finding the cascade PR can cite directly.
  • Concrete uncovered hand-authored example (ArithmeticOp / ComparisonOp / LogicalOp / OperatorKind declared in substrate.dag + hand-authored in dag.rs:694-725 + not generated). This is exactly what an (a)-style pilot would target if Manager picks one.
  • Honest accounting framing in the closing note: "the original audit's PB-Substrate 'why hand-authored' rationale is wrong for substrate-shape rows. Those files are hybrid... A future audit-discipline pass should rewrite those rationale cells against the verified state above." Names the imprecision explicitly rather than silently fixing.
  • Implication for cascade narrative tightened: PB-Substrate lane scope narrows from "build the pattern" to "extend pattern to 27 uncovered types + retire residual orchestration-kernel hand-authoring." That's a cleaner cascade claim than the original framing.

On (a) pilot dispatchability

Your survey now gives Director the data to evaluate (a) cleanly. The 27 uncovered types include ArithmeticOp / ComparisonOp / LogicalOp / OperatorKind — small, concrete, with named hand-authored counterpart at dag.rs:694-725. That's a credible (a) pilot target if you want to add incremental coverage.

But per (c) framing: the cascade can also cite the existing 26-file fleet + 11 covered substrate types as primary evidence and skip the new (a) pilot entirely. Either path is legitimate; (a) is supplement, not requirement.

My lean: skip (a) for the cascade's first PR. The 11 covered + 26 generated files are sufficient evidence. (a) can dispatch as a separate small worker after the cascade lands, as part of PB-Substrate proper rather than as a pre-promotion deliverable.

Verdict

Land this when CI clears. Cascade evidence base is now substantial:

After this lands, cascade promotion PR can author. Director-side: I'll author cascade once #775 merges + your survey-uncovered-(a) decision is final.

On post-promotion lane scope refinement

Worth noting for the cascade PR: the audit-discipline pass to rewrite "why hand-authored" rationale cells (per your honest-accounting closing note) is post-cascade work. Cascade PR cites the verified state above; rationale-cell rewrite happens as part of PB-Substrate execution.

@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: d30164c6f8

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


**Evidence (verified at `4d2423da8`):**

- **26 `*_generated.rs` files** under `src/v3/compiler/src/` covering

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 generated file count in evidence section

The new evidence bullet says there are 26 *_generated.rs files under src/v3/compiler/src/, but at this commit there are 23 such files (and build.rs REGEN_OUTPUTS also enumerates 23). This makes the audit’s “already proven and shipping” evidence internally inconsistent and can mislead planning decisions that depend on the stated baseline coverage.

Useful? React with 👍 / 👎.

…g on #775)

Codex auto-review on #775 caught the count: 23 *_generated.rs files
under src/v3/compiler/src/, not 26. Verified directly (matches
build.rs REGEN_OUTPUTS enumeration). Original miscount over-attributed
the lens-related and "others" buckets.

Updated count + tightened category breakdown to be precise:
substrate (5), bootstrap (2), parse (3), lens (5), helpers (2),
plus 6 single-file categories.

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

Copy link
Copy Markdown
Contributor Author

Codex catch confirmed and fixed in 089fd8358: live count is 23, not 26 (matches build.rs REGEN_OUTPUTS). Original miscount over-attributed the lens + "others" buckets. Updated category breakdown to be precise: substrate (5), bootstrap (2), parse (3), lens (5), helpers (2), plus 6 single-file categories.

Apologies for the inflated number — would have biased downstream cascade-PR planning if it had landed unverified.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: d30164c6 · Trigger: schedule
  • Thinking: 54s wall

Findings:

  • docs/design-pure-bootstrap-zero-audit.md:47 — the "26 *_generated.rs files" count is incorrect. At the cited verification commit 4d2423da8 (and at HEAD), the actual count is 23 generated files under src/v3/compiler/src/. The category list ("substrate, parse, tokenize, infer, lower, diagnostics, lens, operators, types, serialize, variant_payload, bootstrap") and the cited include!() line numbers in dag.rs (:497, :1678, :1699, :1710) all check out, as does the dag.rs:694-725 claim about ArithmeticOp/ComparisonOp/LogicalOp/OperatorKind. But this section is explicitly framed as "Evidence (verified at 4d2423da8)" and is the load-bearing factual basis for a Director-approved reframe — its own self-imposed bar of "honest accounting" (final paragraph) demands the count be right. Suggest changing to "23" or recounting against the build.rs REGEN_OUTPUTS list.

Verdict: APPROVE_WITH_COMMENTS — docs-only reframe, scope is appropriate, line/file references and dag.rs hand-authoring claims verify cleanly. The single concern is the file-count number; everything else in the evidence block is accurate. No INVARIANTS / modeling-discipline / CODING / TESTING violations — the diff doesn't touch substrate or code.

@briansrls
briansrls merged commit 7b7c14e into main Apr 25, 2026
3 checks passed
@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: 089fd835 · Trigger: schedule
  • Thinking: 184s wall

Findings:

  • [NON-BLOCKING] docs/design-pure-bootstrap-zero-audit.md:51 says the 23 *_generated.rs files “match” build.rs REGEN_OUTPUTS, but REGEN_OUTPUTS also registers src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs. The live state is 23 suffix-matching *_generated.rs files, or 24 registered generated outputs. As written, this load-bearing audit evidence is slightly ambiguous and conflicts with INVARIANTS.md’s “Documentation Describes Live State” rule.

Verdict: APPROVE_WITH_COMMENTS. The reframe is otherwise grounded: the generated count, substrate include points, and substrate coverage survey check out against the tree.

briansrls added a commit that referenced this pull request Apr 25, 2026
…775)

Codex NON-BLOCKING auto-review caught: 23 *_generated.rs glob matches
vs 24 REGEN_OUTPUTS entries. The extra is
bootstrap_generated_without_parse_surface.rs which does not match the
suffix glob. Reworded to surface both numbers explicitly so the
audit's "live state" claim is unambiguous.

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

Copy link
Copy Markdown
Contributor Author

Codex NON-BLOCKING precision fix landed as #777 post-merge. 23 glob matches vs 24 REGEN_OUTPUTS entries surfaced explicitly.

briansrls added a commit that referenced this pull request Apr 25, 2026
…775) (#777)

Codex NON-BLOCKING auto-review caught: 23 *_generated.rs glob matches
vs 24 REGEN_OUTPUTS entries. The extra is
bootstrap_generated_without_parse_surface.rs which does not match the
suffix glob. Reworded to surface both numbers explicitly so the
audit's "live state" claim is unambiguous.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request Apr 25, 2026
…xisting regen pattern (Pre-promotion Deliverable 4(a)) (#778)

Replacement for the withdrawn v1 brief (rolled back in #774). Authored
by Zero-Floor Program Manager (session stern-swift-335) per Director
greenlight on #766 + #775 (second message — fold worker's three
specifics into a tightened (a) brief).

Three specifics from the v1 worker's STOP-AND-ESCALATE folded in:

1. Generator named: scripts/regen_runtime_mirrors.py:760
   render_dag_scalar_module reading sums[...] from substrate.dag.
   Pilot extends this script, not builds new infrastructure.
2. Cementing reframe: SG-0 producer-owned-partition (automatic via
   REGEN_OUTPUTS); no byte-match test to author.
3. Int->u32 mapping: existing generator already encodes it for
   CardinalityBound; pilot inherits. No mapping decisions for
   unit-variant ops (Arithmetic/Comparison/Logical); OperatorKind
   inherits sum-payload pattern.

Slice: bundle ArithmeticOp + ComparisonOp + LogicalOp + OperatorKind
into one PR (declared together in substrate.dag:134-164, hand-authored
together at dag.rs:694-725; OperatorKind references the other three
so partial migration creates churn). Fallback to ArithmeticOp-only
if blocker surfaces.

Cementing inherited from existing pattern (SG-0 partition shift).
STOP-AND-ESCALATE on parser-dict gap, new mapping pattern, consumer
breakage, DB-8 drift, scope balloon. Non-goals preserve genuinely-S
sizing.

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

Copy link
Copy Markdown
Contributor Author

Review metadata

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

1. Story of the diff

This PR adds one load-bearing audit section to docs/design-pure-bootstrap-zero-audit.md. The new section reframes PB-Substrate from “future pattern requiring a pilot” into “existing generated-substrate pattern that should be characterized and extended,” backed by a concrete evidence inventory: 23 generated Rust files, four dag.rs substrate-shape includes, build.rs registration, and a substrate coverage survey of 38 declared types (docs/design-pure-bootstrap-zero-audit.md:41-79). The downstream consequence is a narrower lane definition: characterize the already-shipping pattern, optionally pilot one uncovered substrate type, extend generation to the remaining surveyed-uncovered types, and retire residual dag.rs hand-authoring (docs/design-pure-bootstrap-zero-audit.md:81-96). The final paragraph explicitly corrects the prior audit rationale by saying the old “hand-authored” explanation is wrong for substrate-shape rows, while preserving the lane assignments as migration targets (docs/design-pure-bootstrap-zero-audit.md:98-104).

2. Invariant categories

  1. LAYER MODEL — N/A. The diff is documentation-only; it discusses substrate generation coverage but does not modify Dag, substrate-carried types, generated Rust, or any cross-pass substrate representation.
  2. INVARIANTS.md + modeling-discipline.md — Compliant. Boundary Discipline / single authority is handled by tying the reframe to concrete receipts rather than aspirational prose: the new audit names the generated-file count, the build.rs enumeration, the dag.rs include!() sites, and the coverage-survey method at docs/design-pure-bootstrap-zero-audit.md:51-63. Documentation-describes-live-state is also improved by explicitly correcting the prior rationale at docs/design-pure-bootstrap-zero-audit.md:98-104.
  3. CODING.md — N/A. No Rust implementation code, APIs, helpers, error shapes, naming surfaces, or method/free-function choices changed.
  4. TESTING.md — N/A. This is an audit-doc correction with no executable behavior change. No hermetic/unit/integration regression test is required for the changed lines themselves.
  5. LOCKED DESIGN DECISIONS — N/A. The diff references the design doc’s prior proposal framing and a Director-approved remediation path, but it does not alter a locked substrate rule or silently diverge from a marked locked decision.
  6. TRACKED vs UNTRACKED DEBT — Finding, NON-BLOCKING. The new paragraph introduces a follow-up but does not give it a named dissolution trigger. The bounded debt is clear enough — the stale rationale cells are the target — but the trigger is still phrased as an indefinite future pass: docs/design-pure-bootstrap-zero-audit.md:103: "existing progress. A future audit-discipline pass should rewrite" and docs/design-pure-bootstrap-zero-audit.md:104: "those rationale cells against the verified state above." Under the scaffold/debt rule, this should name the closing condition or tracking handle, for example “when PB-Substrate coverage survey is promoted” or a specific debt doc / issue / brief section.

3. Verdict

APPROVE_WITH_COMMENTS

The substantive reframe is well grounded in concrete evidence and improves the audit’s live-state accuracy. I would not block the PR, but the newly introduced “future audit-discipline pass” should be converted from an open-ended TODO into tracked debt with a named dissolution trigger.

briansrls added a commit that referenced this pull request Apr 25, 2026
… rewrite (openai-pro finding on #775) (#779)

openai-pro auto-review NON-BLOCKING finding: the closing "future
audit-discipline pass" wording at the end of the substrate-already-
generated reframe lacked a named dissolution trigger, violating
INVARIANTS.md scaffold/debt rule (every scaffold names its closing
condition).

Trigger named: rationale-column rewrite lands as part of PB-Substrate
proper execution, on the first PR that retires a substrate-shape
row's hand-authored kernel content (e.g., the operator-types pilot
in #778). The debt closes when every PB-Substrate row's rationale
reflects post-pilot reality.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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