Skip to content

Gate-A flip prep: 04_infer curated seed-linked behavioral-receipt scaffold (SeedRetained) - #6802

Closed
gunbai-bot[bot] wants to merge 11 commits into
mainfrom
session/bright-badger-591
Closed

gunbai-bot[bot] wants to merge 11 commits into
mainfrom
session/bright-badger-591

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Worker attestation

  • Title describes the change (not the session id or branch).
  • PR body summarises what and why (replace the TODO below).
  • Tests run: name the command (e.g. npm test, cargo test) and the result.
  • If this closes a work item, the body contains a Closes #N directive.
  • No commits on this branch are surprises (no fork/cherry-pick I did not make).
  • No secrets / credentials / large binaries staged.

Summary

Curated seed-linked behavioral-receipt scaffold for 04_infer (v2.compiler.infer), the next Gate-A self-emit flip in the Wave 2 sequence after 03_body_producer/03_resolve. Frontier stays SeedRetained — this PR does not flip frontier.dag; it lands the wet-witness machinery now so the flip is a small diff once the emit surface actually goes rustc-green (tracked via #6775 and beyond).

Modeled shim-free after tools.self_host_target_carriers_behavioral_transport (the proven-working pattern — self-contained host-effect fn, not the newer cssl_seed_linked_behavioral_receipt helper that 03_resolve/03_body_producer reference, which does not exist yet in tools.self_host_curated_seed_linked_harness.dag and currently makes those two modules' behavioral-transport files hard compile errors, invisible only because their witness tests are excluded from CI discovery). Kept this PR shim-free/self-contained to avoid depending on that missing piece.

  • dag/tools/self_host_04_infer_behavioral_transport.dag: i4_behavioral_receipt_holds — emits ONLY v2.compiler.infer via gunbc compile --entry, drops a hand main.rs driver into the emitted crate ([[bin]] witness), builds it against the real v1-compiler seed as a path dependency, and compares emitted vs. seed on infer_arrow_domain_binding_heuristic_note (a 04_infer.dag module-authority data ...: String constant) plus --inject-fault as the RED control. Also runs a supplementary claim-run on pipeline_infer_add_fixture_relationship_green.
  • dag/tools/self_host_04_infer_shims/witness_main.rs: the comparison driver.
  • src/v1/stage0/src/v2_compiler_infer.rs (+ lib.rs/crate-layout wiring): the hand-retained seed oracle, mirroring v2_compiler_resolve.rs.
  • dag/test/claim/self_host_04_infer_behavioral_witness_test.dag + ci_layer_roots.dag exclusion entry: wet witness, excluded from per-PR discovery until the frontier flip (same as its 03_resolve/body_producer siblings).

Measured now: gunbc compile --entry src/v2/compiler/04_infer.dag is clean (49 files, 0 diagnostics) — an emit-surface rustc refusal probe, not the gate. Running the receipt end-to-end with sccache bypassed surfaces real rustc errors on the emitted crate (missing generic type params — T/K/V/Char/FreeMonoid — plus a few duplicate-definition/missing-import cases), a materially bigger gap than the Rc/Optional class #6775 targets alone. Migration trigger stays ^migrate_when_closure_self_emits_cargo_green (compiler_frontier_row_04_infer, src/v2/compiler/self_host/frontier.dag) — unchanged by this PR.

Test plan

  • cargo fmt --all --check — clean
  • gunbc compile --entry dag/tools/self_host_04_infer_behavioral_transport.dag --target dag — 0 hard diagnostics from this file (2 pre-existing unrelated diagnostics in dag/extdeps/os/exec_arg_limit.dag reproduce identically against the already-merged stc sibling, confirmed baseline noise)
  • gunbc compile --entry src/v2/compiler/04_infer.dag --target rust — 49 files, 0 diagnostics (emit-surface refusal probe)
  • Ran the full wet receipt locally (gunbc run --claim-run --entry dag/test/claim/self_host_04_infer_behavioral_witness_test.dag --function self_host_04_infer_behavioral_receipt_holds) end-to-end: harness mechanics work (compile → write driver → cargo build → run pass/inject-fault → supplementary claim-run all execute correctly); the receipt itself is RED right now because the emitted crate doesn't yet compile — expected, matches SeedRetained status

@gunbai-bot gunbai-bot Bot changed the title Gate-A flip: self-emit 04_infer — curated scaffold now (SeedRetained), flip on #6775 land; own through to landing (flip+regen), no orphaned tail Gate-A flip prep: 04_infer curated seed-linked behavioral-receipt scaffold (SeedRetained) Jul 17, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 17, 2026 11:42
@gunbai-bot

gunbai-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

CI red on ci (compile-clean gate) is confirmed NOT a bug in this PR. Root cause: PR #6791 vendored a 46-line probe-only slice over dag/tools/self_host_curated_seed_linked_harness.dag, silently deleting the CuratedSeedLinkedShimWrite type and cssl_seed_linked_behavioral_receipt fn that the already-merged 03_resolve (#6784) and body_producer (#6782) behavioral-transport files import. That breakage was invisible because those wet witnesses are excluded from CI discovery — it only surfaces when something (like this PR's new non-.dag shim file under dag/tools/) forces the compile-clean gate to widen from an affected-set scope to a whole-tree baseline, which then walks into the two broken imports.

This PR did not introduce or fork around that bug. #6801 (still-pike-676) already carries a complete fix restoring the harness authority (verified independently: I diffed it against the original ferret commit a201cad and confirmed all three dependent .dag consumers compile cleanly against it). Per sharp-bee-290 (managing this wave), I'm holding this PR until #6801 merges, then will additionally converge 04_infer's transport onto the restored shared cssl_seed_linked_behavioral_receipt harness (dropping the self-contained workaround currently in this diff) and re-run a faithful entry-only curated cargo probe, since the whole-closure emit I used to confirm Gate-A surfaced a broader (168-error) gap than the harness's entry-only pattern would. Will push the update once #6801 is on main.

— sent from bright-badger-591

Review 39240 (PR #6802) correctly flagged that adding v2_compiler_infer
to the generated crate-layout artifacts without a matching
SeedRetainedScaffoldRegistration row breaks the single-authority
crate_layout_witness_test (frontier.dag is the sole crate-layout
authority per compiler_frontier_crate_layout_note). Registered it
alongside v2_compiler_resolve (the same SeedRetained-scaffold pattern
from #6784) and reordered the generated pub_mod block/basenames/
filenames to match hand_maintained_pub_mod_basenames' derivation
order (scaffold rows before self-emitted rows), which the exact-match
witness_generated_pub_mod_block_matches_frontier_holds requires.
Verified crate_layout_witnesses() green by execution via
gunbc run --claim-run.
@gunbai-bot

gunbai-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in 81dd5a2 — review 39240 was correct.

Root cause confirmed by reading frontier.dag: v2_compiler_resolve (the sibling SeedRetained-scaffold pattern from #6784) is registered in seed_retained_scaffold_registrations, while v2_compiler_body_producer/v2_compiler_target_carriers don't need that registration because they're already flipped to SelfEmitted frontier rows (they come through compiler_frontier_self_emitted_stage0_mod_basenames() instead). My v2_compiler_infer addition is SeedRetained like 03_resolve, so it needed the same scaffold registration row, which I'd omitted.

Added SeedRetainedScaffoldRegistration { basename: "v2_compiler_infer" } right after the v2_compiler_resolve row, and also had to reorder the generated pub_mod block/basenames/filenames lists to match hand_maintained_pub_mod_basenames()'s derivation order (scaffold rows before self-emitted rows) — the exact-string-match witness witness_generated_pub_mod_block_matches_frontier_holds is order-sensitive even though the basenames/filenames list-membership witnesses are not, so that second issue wasn't visible from the review's basename-only framing.

Verified green by execution: gunbc run --claim-run --entry src/v2/test/claim/self_host/crate_layout_witness_test.dag --function crate_layout_witnesses now returns true (was false before the fix, confirmed by isolating the individual sub-witnesses).

— sent from bright-badger-591

@gunbai-bot

gunbai-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

CI on `81dd5a2` fails for the same pre-existing reason as the earlier `b8f5973` failure — not a new issue and not something to fix in this PR.

Confirmed by log: `dag/tools/self_host_curated_seed_linked_harness.dag` on this branch (and on main, until #6801 lands) is still missing `cssl_seed_linked_behavioral_receipt`/`CuratedSeedLinkedShimWrite` (regressed by #6791). This branch's new `self_host_04_infer_behavioral_transport.dag` import of that fn hits the same missing-symbol error already breaking the merged `self_host_03_resolve_behavioral_transport.dag` (#6784) and `self_host_body_producer_behavioral_transport.dag` (#6782) on main.

Fix is landing in #6801 (harness restore), owned by another session in this Gate-A wave — not duplicating that work here (see review 39240 fix + manager coordination). Once #6801 merges, I'll merge main into this branch and re-push; CI should go green then. Holding until that lands.

— sent from bright-badger-591

@gunbai-bot

gunbai-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Same known pre-existing issue as the `81dd5a2` failure explained above — the auto-committer merged latest main (`d40ededd66`, #6793) into this branch, producing `8b93e9d`, but #6801 (the cssl harness restore) still hasn't merged, so `dag/tools/self_host_curated_seed_linked_harness.dag` is still the broken 46-line version missing `cssl_seed_linked_behavioral_receipt`. No new fix needed here — waiting on #6801.

— sent from bright-badger-591

briansrls and others added 4 commits July 17, 2026 16:06
… fix)

Unblocks this branch's self_host_04_infer_behavioral_transport.dag
import of cssl_seed_linked_behavioral_receipt, per sharp-bee-290.
…e scratch test

bootstrap_stage0_crate_layout_generated.rs is the actual artifact the
drift gate checks (Stage0CrateLayoutGeneratedRsArtifact), separate from
gunbc_stage0_crate_layout_generated.rs which I'd edited earlier. Its
HAND_MAINTAINED_STAGE0_FILES list had v2_compiler_infer.rs appended at
the end instead of directly after v2_compiler_resolve.rs, matching
frontier.dag's scaffold-registration order — drifting from
expected_stage0_crate_layout_generated_rs()'s byte-order-sensitive
output. Also removes an accidental scratch witness
(scratch_expected_rs_test.dag) left in src/v2/test/claim during local
diagnosis — a *_test.dag file with an unsatisfiable assertion that the
witness layer-root walk would enroll and fail.

Addresses review 39310.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Both findings in review 39310 are valid and fixed in 9691b2a:

  • Removed src/v2/test/claim/self_host/scratch_expected_rs_test.dag — leftover scratch witness from local diagnosis, unsatisfiable assertion as noted.
  • Fixed bootstrap_stage0_crate_layout_generated.rs's HAND_MAINTAINED_STAGE0_FILES: moved v2_compiler_infer.rs from the end of the list to directly after v2_compiler_resolve.rs, matching frontier.dag's scaffold-registration order and generated_stage0_filenames in dag/gunbc/stage0_crate_layout_generated.dag.

Note there are two separate generated Rust artifacts in this family — bootstrap_stage0_crate_layout_generated.rs (the one generated_artifact_drift_gate actually checks, per Stage0CrateLayoutGeneratedRsArtifact in generated_artifact.dag) and gunbc_stage0_crate_layout_generated.rs (wired into lib.rs, mirrors the .dag data file). I'd already corrected the latter's ordering earlier; this commit corrects the former, which is the one the drift gate was actually failing on.

— sent from bright-badger-591

…-591

# Conflicts:
#	dag/gunbc/ci_layer_roots.dag
#	dag/gunbc/stage0_crate_layout_generated.dag
#	src/v1/stage0/src/bootstrap_stage0_crate_layout_generated.rs
#	src/v1/stage0/src/gunbc_stage0_crate_layout_generated.rs
#	src/v2/compiler/self_host/frontier.dag
@gunbai-bot

gunbai-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

This PR is being superseded by a Gate-A scaffolds integration PR (collapsing #6798-#6803 into one branch to kill the shared crate-layout conflict-magnet, per sharp-bee-290's direction). The 21d07e7 CI failure is expected/moot — that commit is a merge-in-progress with placeholder (unregenerated) conflict resolution on the shared generated files, superseded by the integration branch's single real regen. No further fixes needed here; work continues on the integration PR.

— sent from bright-badger-591

@briansrls briansrls closed this Jul 17, 2026
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