Repository navigation
#276 member 3 (SL-11): canonical JSON writing in the standard library (LexLeanStd.Json) — draft - #363
Conversation
…the count mirrors (460 -> 461) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…he locks of its consumers One recursive Json value (the spine shape of bootstrap Expr) and a mutual structural writer: writeJson and writeJsonFile for the whole value, escapeString for a string. An object is written with its members sorted by Order.sortEntries and the last of a repeated key kept, as the oracle BTreeMap keeps it; integers are a sign and a magnitude through Numeral.decimal. Held to canonical_json::Json::to_canonical_string and to_file_bytes. The plant keeps the first of a repeated key: only trees that repeat a key catch it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…iter Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The sentence said a mutual group of types has no structural recursion. The mutual-group rule admits a recursive family over one inductive group; the module takes the shape of Expr because it is proven on this line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The conflicts were the counts, two README rows, the CHANGELOG, VERIFICATION.md, and the lock. The register is the release's 469 plus SL-11, 470, in SPEC.md, README.md, xtask/src/spec_links.rs and the repository case. The lock takes the release's header: stdlib's entrypoint moved, so the locks, exports and build oracles are regenerated once, on top of #390, in the next commit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The merge of #364 took the release header into stdlib/lexlean.lock, which still describes a stdlib without LexLeanStd.Json: `repro` and six stdlib cases of `bdd` refuse it with LLC0102. `lexlean lock` in stdlib, bootstrap, and examples/helpdesk moves their digests. The exports, build oracles and counts are the regeneration that follows. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…72 IDs The line gained DF-19 and PD-10 since the last merge (#364), so the §31 total, README, the two row-count checks and the CHANGELOG move from 471 to 472 with SL-11. stdlib/lexlean.toml lists both the line's Host and this member's Json among its entrypoints. The locks of stdlib, bootstrap and examples/helpdesk are taken from the line here and rewritten in the next commit. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`lexlean lock` in stdlib, bootstrap and examples/helpdesk, with the binary built from this tree: stdlib's project_config_sha256 moves for the Json entrypoint, and the two consumers' pins of it follow. The exports, build oracles, verify records and counts are the regeneration that follows. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
afflom
left a comment
There was a problem hiding this comment.
Bounded refresh confirms this branch now descends from accepted Host c613290. The Json implementation and stdlib_json case are byte-identical to previously reviewed9525f0e6; the latest commit changes only the stdlib lock and the bootstrap/helpdesk stdlib pins. The complete current-base delta isolates19 SL11 source/contract/test/documentation/lock paths. No new JSON implementation or test weakening is established by this head.
The body still describes an older base and historical461-row evidence. Please distinguish those records from the current c613-based preparation. Its disclosed throwaway bypass measured only the later rustc differential/plant portion; it remains neither a committed weakening nor full SL11 acceptance. The committed certified escape_string/write_json/write_json_file packages, recursive stack-bound observations, actual Lean certificate/export comparison and full final gate are still owed.
Please report the current writer state and preserve any active atomic writer's logs/output before further coordination. #393's reviewed repaired carrier is now in its final changed-head CI; reconcile the settled release source before another product/count wave, without guessing combined corpus totals or rerunning unchanged-head CI. This draft remains the existing delivery owner, with #414/#415 source-stack coordination preserved. #276 remains open for its broader compiler/library scope.
…on release/v0.4 SL-11 (#276, #363) on the merged line: `check-production-export --write` adds the certificates of stdlib/escape_string, write_json and write_json_file (25 stdlib packages) and moves the rest with the runtime; `LEXLEAN_MEASURE_STACK=all` on conformance_sl_11 adds the debug bounds of write_json and write_json_file; `check-golden --write` moves the build oracles of stdlib, bootstrap and examples/helpdesk. Run on the normative host (WSL Ubuntu, Rust 1.97.1, Lean 4.32.1). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`cargo xtask verify-examples --write` over every example but uor-atlas (whose whole verify is OOM-killed in a 16 GB WSL; CI holds it), compiler, stdlib, std-models, std-reasoning and bootstrap. Only stdlib's records changed: the R* of the Json roots, and the audit names that move with the package set. Every project verified on the normative host. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…BS-15 The numbers are what each part's count assert reported on the normative host over the regenerated tree (manifests and packages 283 to 286, programs 200 to 203, crates 259 to 262, and the vectors each case draws from them). BS-11 and BS-12 passed whole, so the new records moved no mutant draw. The counts asserted after these first ones are being rerun; any that move follow in another commit. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The line took #393 (SM-37, SP-32, SP-33, BS-16) with a compiler-semantics move, so every lock, record, golden, fixture and package was regenerated there. This merge takes the line's oracles, records, export and bootstrap counts as they are, keeps the SL-11 row, module, scenario and changelog bullet, and sets the register to 476. The Json packages' export, stack bounds, build oracles, verify records and count mirrors regenerate on this tree in the commits that follow. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The merge took the line's tests/production-export wholesale, which is right for the packages (regenerated here) but dropped the three roots SL-11 registers in stdlib/roots.json, so the export wrote no escape_string, write_json or write_json_file package and the SL-11 case found none. Restored from b7ff581. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…se/v0.4 at 55be551 SL-11 (#276, #363) on the merged line: `lexlean lock` moves stdlib's lock (the consumers' locks stand); `check-production-export --write` adds the certificates of stdlib/escape_string, write_json and write_json_file (25 stdlib packages) and moves the rest with the runtime; `LEXLEAN_MEASURE_STACK=all` on conformance_sl_11 confirms the committed debug bounds of write_json and write_json_file; `check-golden --write` moves the build oracles of stdlib, bootstrap and examples/helpdesk. Run on the normative host (WSL Ubuntu, Rust 1.97.1, Lean 4.32.1). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`cargo xtask verify-examples --write` over every example but uor-atlas (whose whole verify is OOM-killed in a 16 GB WSL; CI holds it), compiler, stdlib, std-models, std-reasoning and bootstrap. Only stdlib's records changed: the R* of the Json roots, and the audit names that move with the package set. Every project verified on the normative host. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…BS-15 The numbers are what each part's count assert reported on the normative host over the regenerated tree at 55be551 (manifests and packages 284 to 287, programs 201 to 204, crates 260 to 263, and the vectors each case draws from them). BS-11 and BS-12 passed whole, so the new records moved no mutant draw. The counts asserted after these first ones are CI's to report; any that move follow in another commit. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The asserts after the corpus counts, as the parts reported them on the normative host once the first counts were mirrored: BS-05 runs validateCrate 499 times (211 refused) and correspondCrate 364 (100 refused); BS-06 runs 2,838 vectors, 693 of printCrate over 526 committed distinct crates (65 refused), 2,145 of printExpr. BS-07 and BS-08 passed whole on the mirrored counts. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Of the 693 printCrate vectors on the Json packages, 584 are of at most 6,000 nodes (583 before), as the part reported once its totals were mirrored. BS-05 passed whole on its mirrored totals. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member 3 of #276, the third standard-library member the self-hosted compiler needs (SPEC.md §17.22, row
SL-11). Stacks on #328 (member 2,SL-10), which stacks on #326 (member 1,SL-09): the diff below is theJsonmember only. It is the writer half of the canonical JSON of §21.7; the reader is member 4 (SL-13). Claim: #276 (comment)What it adds
stdlib/src/Json.lex.tex,LexLeanStd.Json: one recursive valueJsonand three production roots forrust-std.writeJson (value : Json) : Bytescanonical_json::Json::to_canonical_stringwriteJsonFile (value : Json) : BytesJson::to_file_bytes, the payload and one final LFescapeString (text : Bytes) : Byteswrite_escaped, quotes includedJBool,JInt(a sign and a magnitude, so ani64is in range),JStr(bytes),JArr,JObj, with the elements of an array and the members of an object as spines (JNil,JItem,JMember) of the same type. This differs from the claim comment, which said a mutual group of three types. I used the shape ofbootstrap'sExprbecause it is proven on this line, as a structural mutual definition group (writeValue,renderItems,renderMembers). The mutual-type form was not tried.Order.sortEntries(SL-10), and of a run of equal keys the last is kept, which is what the oracle'sBTreeMapinsertion keeps. The stable sort keeps their input order, so the last of a run is the last one given.Numeral.decimal;-only before a nonzero magnitude, so a negative zero writes0.",\,\b,\f,\n,\r,\t, and\u00plus two lowercase hex digits for every other byte below 0x20; every other byte is raw.recursion, so each needs a stack bound (PD-08).What landed here
8463c8091).b6a3bf400).stdlib,bootstrapandexamples/helpdesk(85a3ad620).a91e5083a).VERIFICATION.md(ac6792679).f4b18d0cb).Evidence measured on this host (WSL Ubuntu, pinned Rust 1.97.1 and Lean 4.32.1)
1 failed … 460 filtered out, the panic naming the missing work.check,build,fmt --checkclean; the eligibility report has all three roots eligible forrust-stdwith exactly their declared effects (escapeString[allocation, overflow];writeJsonandwriteJsonFile[allocation, overflow, recursion]).i64::MINtoi64::MAX.{"j":3,"k":1}against{"j":3,"k":4}. On trees with no repeated key the planted writer agrees, so only a repeated key catches it.cargo clippy -p repo-conformance -p xtask --all-targets --all-features -D warnings,validate-model(461 ids),validate-spec-links(461 rows),check-test-inventory, and the fivebddmeta-gate tests pass.Not confirmed, stated plainly
stack_bounds::observe:stdlib/escape_string is no package of the committed exports. The certified packages forescape_string,write_jsonandwrite_json_file, and the stack-bound rows for the two recursive ones, are not in this draft. The passing run quoted above was made with that check and the Lean export temporarily bypassed in a throwaway local edit (reverted, not committed), to reach the rustc comparison and the plant. The Lean export leg (certificates A, B, E, and the comparison with committed packages) did not run here.just vvwas not run; the individual recipes listed above were. It stays red until the packages and records are regenerated.65859dda3, with its packages regenerated, and is not yet green:BS-05andBS-06hold stale package counts andstdlib/expected/verifyis not regenerated. This branch needs moving onto the settled stack, then its own package and count regeneration (3 more packages).String; the module does not validate UTF-8. Integers outsidei64are outside the oracle.Refs #276 (member 3; member 4, the reader, takes
SL-13).🤖 Generated with Claude Code