Skip to content

Wire stage0_crate_plan to the R3 crate-partition: ground interface from frontier + cutover + prove BUILD/regen_verify (crate-partition make-it-real) - #6747

Merged
briansrls merged 22 commits into
mainfrom
session/zesty-koi-365
Jul 16, 2026
Merged

briansrls merged 22 commits into
mainfrom
session/zesty-koi-365

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Auto-opened by session-dashboard for session zesty-koi-365.
Pushing to session/zesty-koi-365 advances this PR.

Worker attestation

Before flipping this PR to ready for review, confirm each item:

  • 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

TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.

Test plan

  • TODO: list the commands that ran (or "no tests changed; relied on CI") and the outcome.

@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 16, 2026 13:59
@gunbai-bot

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Addressed both findings from review 38953 in a06f6ea:

1. Interface grounding false-green (valid) — Reverted stage0_module_dag_interface_grounding() to Stage0ModuleDagInterfaceUngrounded with dissolve_target: stage0_frontier_grounding_target() on both maps. Empty per-module keys remain as structural scaffold for partition_fold only; R3 emission still uses Stage0PartitionCrateRow.modules + reexport_packages. Witness witness_stage0_module_dag_interface_grounding_debt_declared_holds now asserts stage0_module_dag_interface_grounding_is_debt() is true (debt present, not silently cleared). Dissolve-on note no longer claims "LANDED."

2. Orphan crates (valid) — Deleted superseded intermediate dirs not in workspace members or partition rows: stage0_std_primitives/ (folded into std-core), stage0_extdeps/ (split into extdeps-base + extdeps-languages), stage0_v1_languages/ (languages re-merged with artifact after mutual-dep discovery).

— sent from zesty-koi-365

@cursor

cursor Bot commented Jul 16, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Brian Searls and others added 13 commits July 16, 2026 14:30
… orphan crates.

Revert stage0_module_dag_interface_grounding to Ungrounded (empty per-module maps are structural scaffold only, not FrontierGrounded); witness now asserts debt is present. Delete superseded stage0_std_primitives, stage0_extdeps, and stage0_v1_languages dirs left from intermediate partition iterations.

Co-authored-by: Cursor <cursoragent@cursor.com>
Runtime unit now holds only v1_rt after v1_std_core moved to std-core; witness count 2→1. Drift/registry fixes landed in prior commit (Stage0CratePartitionGeneratedDagArtifact registry count 14, main_wet regen).

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot
gunbai-bot Bot force-pushed the session/zesty-koi-365 branch from 06553c7 to cad7d19 Compare July 16, 2026 14:32
Replace hardcoded if/else chains in rust_crate_partition.dag with
stage0_module_bearing_crate_rows() lookup; drop unused duplicate
package/dir helpers (stage0_crates.dag retains the derived copies).

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

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Addressed review 38963 (§2/§3 parallel representation finding):

  • stage0_module_owner_package_name in rust_crate_partition.dag now derives from stage0_module_bearing_crate_rows() (filter/map over row.modules) — same shape as stage0_crates.dag uses over generated_partition_crate_rows.
  • Deleted the unused hardcoded stage0_package_name_to_rust_ident and stage0_crate_dir_to_sibling_dep_path copies from rust_crate_partition.dag (only stage0_crates.dag needs them for render; it already uses replace(crate_dir, "src/v1/", "../")).

Adding a 9th crate now requires editing the row list once in stage0_module_bearing_crate_rows(); both v2 emit-shell reexport resolution and v1 render consume the generated rows from that authority.

Verified: rust_crate_partition_witnesses PASS, regen_stage0 --verify divergence=0.

— sent from zesty-koi-365

@gunbai-bot

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review 38973 (cursor/composer-2.5 APPROVE): verified — no action required. The approval matches current HEAD (d699bdfe3f): partition bridge via stage0_crate_partition_generated, ~8-crate derived layout, honest interface-grounding debt with dissolve trigger, policy partition fail-closed, drift artifact enrolled.

Since review 38963 (REQUEST_CHANGES on duplicated crate-mapping helpers), commit d699bdfe3f dissolved the hardcoded if/else chains in rust_crate_partition.dag to row-derived stage0_module_bearing_crate_rows() lookup.

Merge readiness: 1/2 approvals (this review). CI ci job in progress on d699bdfe3f (build green; awaiting regen_verify_gate_passes + generated_artifact_drift_gate_passes). Not at bar yet.

— sent from zesty-koi-365

Brian Searls and others added 2 commits July 16, 2026 14:54
Replace fold-first-match owner/package-dir lookups with typed
Stage0ModuleOwnerMissing / Stage0PackageCrateDirMissing refusals in
stage0_crates.dag; delete dead v2 duplicate helpers; add
stage0_partition_row_lookups_resolved witness.

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

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Addressed review 38976 (§5 absorbing fallback + §3 duplication):

Blocking — §5 absorbing fallback: Replaced the three fold(init: "", first-match) sites with typed refusals:

  • stage0_lookup_module_owner_package_name → Stage0ModuleOwnerFound | Stage0ModuleOwnerRefused { Stage0ModuleOwnerMissing { module_basename } }
  • stage0_lookup_package_crate_dir → Stage0PackageCrateDirFound | Stage0PackageCrateDirRefused { Stage0PackageCrateDirMissing { package_name } }
  • Render paths (stage0_reexport_path_dependencies_outcome, stage0_emit_shell_module_reexports_outcome) short-circuit on first refusal instead of fabricating ../ / pub use ::*
  • stage0_partition_lookups_valid() + witness witness_stage0_partition_row_lookups_resolved_holds gate the row authority

Advisory — §3 duplication: Deleted dead stage0_module_owner_package_name + stage0_emit_shell_reexport_source_packages from rust_crate_partition.dag (the latter was filtering "" back out — the exact ⊤-as-ignorance tell). v1 stage0_crates.dag is now the sole live owner/dir lookup authority over generated_partition_crate_rows.

Verified: rust_crate_partition_witnesses PASS, regen_stage0 --verify divergence=0.

— sent from zesty-koi-365

Brian Searls and others added 5 commits July 16, 2026 15:05
Propagate typed refusals through stage0_crate_boundary_emit_outcome
(regen_stage0 refuses on Refused); remove absorbing stage0_crate_boundary_files
wrapper; fix nested list indentation in stage0_crate_partition_emit.

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

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Addressed review 38985 (§5 spec-without-execution + indent advisory):

Blocking — absorbing fallback on emit path: Typed refusals now propagate end-to-end:

  • stage0_partition_row_dependencies_outcome → stage0_partition_row_to_spec_outcome → stage0_crate_plan_outcome → emit_stage0_crate_boundary_files_outcome → stage0_crate_boundary_emit_outcome
  • render_stage0_emit_core_lib_outcome refuses on Stage0EmitShellReexportsRefused (no blank reexport block)
  • Removed stage0_crate_boundary_files wrapper that swallowed Refused to []
  • regen_stage0 consumes stage0_crate_boundary_emit_outcome() and returns Err(stage0_crate_boundary_emit_refusal_message(...)) on refuse
  • stage0_partition_lookups_valid() is now defined as stage0_crate_boundary_emit_outcome is Ok (live enforcement on emit authority)

Advisory — generated list indent: render_partition_nested_string_list in stage0_crate_partition_emit.dag now emits 8-space-indented list items inside partition rows; main_wet regen'd stage0_crate_partition_generated.dag.

Verified: rust_crate_partition_witnesses PASS, run_generated_artifact_drift_gate PASS, regen_stage0 --verify divergence=0.

— sent from zesty-koi-365

@gunbai-bot

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review 38989 — addressed in 2fa1e27595

Finding 1 (stage0_crate_plan() empty-on-refusal wrapper) — Valid. Deleted stage0_crate_plan() from stage0_crates.dag (no live callers; workspace_members and regen_stage0 already consume stage0_crate_plan_outcome / stage0_crate_boundary_emit_outcome). Added stage0_crate_plan_list_wrapper_dissolve_on data marker documenting the removal. Re-ran regen_stage0 2× + --verify (regen_divergence_count=0); emitted stage0_crate_plan() wrapper removed from v1_compiler_stage0_crates.rs.

Finding 2 (stage0_crate_boundary_files() dag/rs drift) — Already fixed in ba6b1af8a2 (prior to this review): wrapper removed from .dag authority and regen synced emitted Rust. Grep confirms no stage0_crate_boundary_files in src/v1/; boundary emit flows through emit_stage0_crate_boundary_files_outcome → stage0_crate_boundary_emit_outcome with typed refusals propagated to regen_stage0.

— sent from zesty-koi-365

@gunbai-bot

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review 38990 (cursor/composer-2.5 APPROVE): verified — no action required on 2fa1e27595.

Spot-check against the approval claims:

  • Authority chain: rust_crate_partition → stage0_crate_partition_emit / stage0_crate_partition_generated → stage0_crates.dag → regen_stage0 / workspace_members (outcome surfaces only).
  • §5 wrappers removed: no stage0_crate_plan() or stage0_crate_boundary_files() in .dag or emitted src/v1/; stage0_crate_plan_list_wrapper_dissolve_on documents the deletion.
  • Fail-closed regen: regen_stage0 gates on stage0_partition_lookups_valid() and returns Err on stage0_crate_boundary_emit_outcome refuse.
  • Declared debt + witnesses: interim hand-explicit membership dissolve-on + stage0_module_dag_interface_grounding_is_debt with live witnesses (stage0_partition_row_lookups_resolved, grounding debt dissolve-on present).

Prior RC reviews (38963/38976/38985/38989) addressed in commits through 2fa1e27595.

Merge readiness: 2/2 api-review APPROVE artifacts (reviews 38973 + 38990); no new blocking findings. CI ci job still in progress on 2fa1e27595 (build green). Not at bar until CI green.

— sent from zesty-koi-365

@gunbai-bot

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review 38992 (claude/claude-opus-4-7 APPROVE): verified — no action required on 2fa1e27595.

Spot-check confirms the approval: partition grounded on rust_crate_partition via generated .dag authority, row-derived emission, typed Refused outcomes propagated through regen_stage0 (regen_stage0.rs:899-921), honest map_insert(..., Empty) scaffold debt with dissolve-on (rust_crate_partition.dag:121), no new hand-Rust.

Non-blocking observations — accepted as-is:

  1. stage0_workspace_member_region defensive # REFUSED: string on plan refuse — unreachable in normal path because regen_stage0 gates on stage0_partition_lookups_valid() before writing workspace members; fine as defensive layer.
  2. stage0_partition_lookups_valid re-invokes stage0_crate_boundary_emit_outcome() — cheap redundancy for a validation probe; not incorrect.

Merge readiness: 3 api-review APPROVE artifacts (reviews 38973, 38990, 38992) from 2 distinct reviewers; no blocking findings in latest reviews. CI ci job still in progress on 2fa1e27595 (build green). Not at bar until CI green.

— sent from zesty-koi-365

@briansrls
briansrls merged commit c9edb61 into main Jul 16, 2026
3 checks passed
@briansrls
briansrls deleted the session/zesty-koi-365 branch July 16, 2026 16:33
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