Skip to content

BS-31: the canonical text of the lock file as source (LockText) - #458

Closed
humuhumu33 wants to merge 3 commits into
release/v0.4from
claude/issue-274-lock-text
Closed

humuhumu33 wants to merge 3 commits into
release/v0.4from
claude/issue-274-lock-text

Conversation

@humuhumu33

Copy link
Copy Markdown
Contributor

Part of #274: the canonical text of the lock file (BS-31, Lock::canonical_bytes and config::toml_string) as language-1.2 source, with roots tomlString and canonicalLock of LockText. It is the first slice of the project manager.

Draft, on release/v0.4. It imports only the standard library, so it stacks on no other slice.

Design

canonicalLock writes a lock exactly as lexlean lock does:

  • the five header keys, with lexlean/lock/2 for language 1.2 and /1 otherwise, and the pinned Lean toolchain;
  • the workspace pins sorted by path;
  • the packages sorted by identifier and version;
  • the source packages sorted by identifier;
  • the PDF record, with its resources sorted by path.

Digests are lower-case hex. The rows are sorted with the stable merge sort of the standard library's Order. A package's key is its identifier and its version, each with its NUL bytes escaped and a two-byte end, so the byte order of the key is the order of the pair.

tomlString escapes the quote and the backslash with a backslash. It writes each control below 0x20, and 0x7F, as \u with four upper-case hex digits. Each root admits exactly allocation and overflow, and neither admits recursion. Reading a lock, resolving its packages, and hashing its files stay in the host.

The oracle is the existing public code of lock.rs and config.rs. No Rust outside the case changes.

Evidence

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

Leg Runs Agreed
named vectors 28 (14 texts, 14 locks), reaching every table, both lock specs, prefix paths and identifiers, a NUL in an identifier, and every class of escape all
the 328 committed locks that parse, the 93 texts in them, and 200 seeded runs of each root, evaluator 307 texts, 542 locks all
the same with 1,000 seeded runs of each root, pinned rustc 2,449 all
planted defects, each on its own named vector 18 all detected

Lean verifies the module. The eligibility report gives each root exactly allocation and overflow. Each of the 328 committed locks that parse is already its own canonical text.

Gates at the head

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

CI is expected red until the regeneration

The two packages are not committed yet, so conformance_bs_31 stops at the stack-bound step after the differentials above have agreed. The landing regeneration will commit them.

🤖 Generated with Claude Code

humuhumu33 and others added 3 commits November 10, 2026 01:49
The first slice of the project manager as source (#274), on release/v0.4:
the row (register 478 -> 479, 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 the case, conformance_bs_31, which holds LockText.tomlString
and canonicalLock to config::toml_string and Lock::canonical_bytes on
hand-built texts and locks, on every committed lexlean.lock that parses and
the texts in them, and on seeded ones, with 18 planted defects each named by
its vector. VERIFICATION.md records the first run: the evaluator agrees on
307 and 542 runs, rustc on 2,449, and every plant is detected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bootstrap/src/LockText.lex.tex: tomlString writes the TOML basic string of
a text; canonicalLock writes a lock as lexlean lock does, with its rows
sorted by the standard library's stable merge sort. Lean verifies the
module and each root is eligible with exactly allocation and overflow. The
entrypoint, the lock, the two export roots, and the project README follow.

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

#450 maps every BDD part to one Intel lane; bootstrap-lock-text joins the
print lane with the other light bootstrap parts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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.

1 participant