Skip to content

BS-34: the build manifest as source (ManifestText) - #464

Closed
humuhumu33 wants to merge 2 commits into
release/v0.4from
claude/issue-274-build-manifest
Closed

humuhumu33 wants to merge 2 commits into
release/v0.4from
claude/issue-274-build-manifest

Conversation

@humuhumu33

Copy link
Copy Markdown
Contributor

Part of #274: the build manifest (BS-34, BuildManifest::to_json written as a file) as language-1.2 source, with root buildManifest of ManifestText. It is a slice of the build driver.

Draft, on release/v0.4 (which now includes BS-21). It imports only the standard library (Json, Numeral, Order, Text), so it stacks on no other slice.

Design

buildManifest builds the manifest's JSON value and writes it with the standard library's writeJsonFile, which orders the keys. The value holds:

  • the specification, the compiler version and semantics ID, the language, and the project;
  • the source, semantic, and build IDs, and the pinned Lean toolchain;
  • the selection and the module rows in their order, with a module's origin only when it has one;
  • the input and output rows, sorted with Order's stable merge sort.

The row sort key is the kind and the path, each NUL-escaped with a two-byte end, then the big-endian length, then the digest. The root admits exactly allocation, overflow, and recursion, the last through the JSON writer. Gathering the rows of a build and hashing its files stay in the host.

The oracle is the existing public code of manifest.rs. No Rust outside the case changes.

Evidence

Measured on the normative host over release/v0.4 at c66f83d05:

Leg Runs Agreed
named vectors 10, reaching every key of the row order, lengths across a byte, a kind that is a prefix, a module's origin, and escapes all
the 26 committed build manifests and 200 seeded manifests, evaluator 236 all
the same with 1,000 seeded manifests, pinned rustc 1,036 all
planted defects, each on its own named vector 10 all detected

Each of the 26 committed expected/build/manifest.json files is the oracle's text of its own fields, and the case asserts it. Lean verifies the module, and the eligibility report gives the root exactly its three declared effects.

Gates at the head

cargo fmt --check, validate-model (480 IDs), validate-spec-links (480 rows), clippy on the workspace with -D warnings, the Intel lane plan test, and the 17 RP cases pass.

CI is expected red until the regeneration

The package is not committed yet, so conformance_bs_34 stops at the stack-bound step after the differentials above have agreed. The regeneration will commit it and measure the root's stack bound.

🤖 Generated with Claude Code

humuhumu33 and others added 2 commits November 10, 2026 14:49
A slice of the build driver as source (#274), on release/v0.4 with BS-21:
the row (register 479 -> 480, the §31 table, the RP-07 check and its case),
the scenario, the §17.23 prose, the CHANGELOG entry, the README's claim, the
CI part and its Intel lane, and the case, conformance_bs_34, which holds
ManifestText.buildManifest to the file bytes of BuildManifest::to_json on
hand-built manifests, on the 26 committed build manifests, each the oracle's
text of its own fields, and on seeded ones, with 10 planted defects each
named by its vector. VERIFICATION.md records the first run: the evaluator
agrees on 236 runs, rustc on 1,036, and every plant is detected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bootstrap/src/ManifestText.lex.tex over the standard library's Json writer:
buildManifest writes a build manifest's canonical JSON file, its rows
sorted by kind, path, length, and digest. Lean verifies the module and the
root is eligible with exactly allocation, overflow, and recursion. The
entrypoint, the lock, the export root, and the project README follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@afflom afflom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Bounded source review of exact 3747eea on c66f: row ordering, field mapping, optional origin, module/selection order and canonical JSON composition agree with the public manifest oracle on inspection within the demonstrated corpus. The NUL escape plus terminator preserves byte/prefix ordering; the eight-byte length and raw digest follow the host row comparison. Oracle expectations call the existing public serializer, and plants require a named-vector mismatch rather than treating check/evaluation errors as success. No runtime was repeated.

One concrete boundary limits the equivalence claim: host Json::from_usize (canonical_json.rs:34–39, used by manifest.rs:31) saturates above i64::MAX, whereas ManifestText.rowJson emits the full Nat. For byte_length = 9223372036854775808 on a 64-bit host, those source paths yield different numbers. The host documents these sizes as impossible under its resource limits, and the named/seeded corpus stays below this boundary. This is not evidence of a failing real build, but do not infer arbitrary-input serializer equivalence from the bounded corpus; preserve the input-domain limitation or reconcile the behavior before broader use.

The missing committed package, measured stack bound, exact export/product closure and full final-head gate remain outstanding. Current draft CI42838107876 has required host/Atlas groups skipped; repro42838107822 passing is not release acceptance. Existing contributor ownership is preserved, and #274 remains open.

@humuhumu33

Copy link
Copy Markdown
Contributor Author

Landed in #480 (merge aaf845507 on release/v0.4), which carries this change with the BS-25..34 batch, regenerated together and verified by full gate run 43135541484. The branch is kept.

@humuhumu33 humuhumu33 closed this Nov 12, 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.

2 participants