Skip to content

Retire cssl parse_closure_mods onto the emitted_population manifest: the last live Rust text-parse on the seed-linked path recovers CLOSURE MEMBERSHIP by scraping the emitted lib.rs pub-mod lines, and the manifest in the same out_dir already declares that population with no Rust grammar involved - #9424

Merged
briansrls merged 1 commit into
mainfrom
session/sleek-ram-363
Aug 27, 2026

Conversation

@briansrls

@briansrls briansrls commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

The last live Rust text-parse on the seed-linked path recovered CLOSURE MEMBERSHIP by scraping pub mod <name>; lines out of the emitted lib.rs. The emitter already declares that population in the same out_dir: v1.compiler.emit_rust emit_emitted_population_manifest renders one line per produced path into src/emitted_population.rs, under a grammar both ends resolve from one authority (gunbc.stage0_emitted_population_manifest). Reading it is a split and a strip — no Rust grammar on either side, which is the property that made the artifact a file of // lines in the first place.

The swap is a strengthening, not a rename

lib.rs's mod list is rendered FROM the same module file list the writer then writes out (emit_lib_rs_from_files(all_mod_files) → write_output_files), so the retired check compared one emit artifact against another and could only ever agree with itself on the real path. Its only reachable red came from a hand-authored lib.rs.

The manifest declares Cargo.toml, lib.rs, main.rs, every module, every test file and itself, so assembly now asks the question that matters: is every path the emitter DECLARED it produced materialized in out_dir. Wider coverage obtained by deleting a parser, not by adding a check.

What goes with it

BOOTSTRAP_INLINE_MODS (NonEmptyVec, NonEmptyBTreeSet) is deleted. It existed because a hand-authored shim lib.rs can carry pub mod lines for wrappers the emitter inlines as bare structs. The manifest never declares them — they are not files — so the state that skip tolerated is not representable in the population assembly now reads (DESIGN §4b top rung, not the one below).

Typed refusals, each with a discriminating RED enrolled

  • RefusedDeclaredMember — a declared path is not materialized. The fixture deliberately keeps the missing member OUT of lib.rs, so it went green under the retired parse: the refusal is evidence the manifest is the authority now, not merely that some refusal survived the change.
  • MissingPopulationManifest — no fall back to reading lib.rs. The fixture is an out_dir with a perfectly good lib.rs and no manifest, exactly the state the retired parse accepted.
  • EmptyPopulationManifest — a file at the manifest path carrying no line under the grammar is ignorance, not an empty population; answering "nothing declared, so nothing missing" would be the absorbing fallback read in the narrowing direction (DESIGN §5).

Fixtures build the manifest through the same grammar authority (write_population_manifest) rather than hand-spelling // and \n, so a change to the grammar moves both ends at once.

Incidental, and a real hazard

temp_fixture_root keyed the fixture root on the pid alone while cargo ran the cases concurrently, so every case's remove_dir_all raced every sibling's writes at the same <root>/out. It passed by timing rather than by construction; keyed on the case name now.

Authority note tools.self_host_curated_seed_linked_harness cssl_closure_assembly_note updated to state the manifest rule (it read "dep manifest = gunbc-emitted src/lib.rs pub mod list").

Measurement

cargo test -p v1-compiler --bin cssl_assemble (remote): 10 passed, 1 failed. The failure is the pre-existing environment one — normalize_stale_narrow_lib_without_namespace_graft_refuses_cargo panics with release bins or shim dir missing (gunbc=false, assemble=false, shims=true) because the remote runner has no target/release bins. Same outcome before and after this change.

The last live Rust text-parse on the seed-linked path recovered CLOSURE
MEMBERSHIP by scraping `pub mod <name>;` lines out of the emitted `lib.rs`
-- a hand-rolled reader of Rust surface syntax standing in for a fact the
emitter already knows and already writes down. `emit_emitted_population_manifest`
renders one line per produced path into `src/emitted_population.rs`, in the
same `out_dir`, under a grammar both ends resolve from one authority
(`gunbc.stage0_emitted_population_manifest`). Reading it is a split and a
strip; no Rust grammar is involved on either side.

The swap is a strengthening, not a rename. `lib.rs`'s mod list is rendered
FROM the same module file list the writer then writes out, so the retired
check compared one emit artifact against another and could only ever agree
with itself on the real path -- its only reachable red came from a
hand-authored `lib.rs`. The manifest declares `Cargo.toml`, `lib.rs`,
`main.rs`, every module, every test file and itself, so assembly now asks
the question that matters: is every path the emitter DECLARED it produced
materialized in `out_dir`.

`BOOTSTRAP_INLINE_MODS` is deleted with it. It named `NonEmptyVec` /
`NonEmptyBTreeSet`, which exist only as inlined structs -- the manifest
never declares them because they are not files, so the state that skip
tolerated is not representable in the population assembly reads.

Typed refusals, each with a discriminating RED enrolled:
`RefusedDeclaredMember` (declared path not materialized -- the fixture
deliberately keeps it out of `lib.rs`, so it went green under the retired
parse), `MissingPopulationManifest` (no fall back to reading `lib.rs`),
`EmptyPopulationManifest` (a file carrying no line under the grammar is
ignorance, not an empty population).

Also: the fixture root was keyed on the pid alone while cargo ran the cases
concurrently, so every case wiped every sibling's tree. Keyed on the case
name now.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review August 27, 2026 09:53
@briansrls
briansrls merged commit aea5e0d into main Aug 27, 2026
3 checks passed
@briansrls
briansrls deleted the session/sleek-ram-363 branch August 27, 2026 19:34
@briansrls
briansrls restored the session/sleek-ram-363 branch August 27, 2026 19:39
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