Skip to content

SL-13: reading canonical JSON in the standard library (#276) - #415

Merged
humuhumu33 merged 14 commits into
release/v0.4from
member5-jsonread
Nov 9, 2026
Merged

humuhumu33 merged 14 commits into
release/v0.4from
member5-jsonread

Conversation

@humuhumu33

@humuhumu33 humuhumu33 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Part of #276: reading canonical JSON in the standard library (SL-13).

Draft, stacked on member4-maps. Written as source; it has not been compiled or run, and its regeneration has not run, so CI is expected red until then. It lands after the PR below it.

Three definitions (byteOf, digitStep, digitsEnd) declare [Quot.sound, propext], inferred from their callees, not yet checked by Lean. Not run: the case, clippy, the Lean axiom check and the regeneration.

🤖 Generated with Claude Code

Closes #422 (SL-13 delivery slice). #276 remains open.

Namespace integration pending: current contributor head e7adf7c still uses SL-12 in source. Reviewed follow-up 72ba54de consistently moves JsonRead to reserved SL-13; include it and run the official model writer before final acceptance. Host retains SL-12. This source preparation does not establish certification or a passing gate.

…ource only)

The reader of the canonical JSON of section 21.7, the fourth member the
self-hosted compiler needs: readJson and readJsonFile read a text into the Json
value of LexLeanStd.Json and refuse any text the writer would not write. The
oracle is Json::parse with the text required to be what to_canonical_string
writes of it. The reader is one machine over an explicit stack, under the
text's length as its fuel, so no member recurses. Texts are taken to be valid
UTF-8, as the writer takes them; serde_json's limit of 128 levels is not
modelled. The register is 472 IDs.

The case runs both members' corpora under the evaluator and under rustc, and
plants one defect for each rule of the canonical form (twelve), each caught on a
fixed vector of its own that the committed module and the oracle agree on.

Nothing was built or run beyond the prebuilt CLI: the module checks, both roots
are eligible with exactly their declared effects, and every planted variant
still checks. Not run: the case, so the reader's behaviour is unmeasured; the
Lean axioms of the definitions (copied from Numeral's and Json's pattern); the
locks, exports and build oracles; and every count that follows the committed
packages, which wait for the regeneration.

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

The declared axioms of every definition of Map and JsonRead were compared with
what the committed definitions declare for the features they use and the
definitions they call (to_nat carries Quot.sound and propext, compare_bytes
propext, the rest none): byteOf, digitStep and digitsEnd now declare
[Quot.sound, propext]. The other definitions agree.
humuhumu33 and others added 2 commits November 3, 2026 13:54
stdlib/lexlean.toml gained src/JsonRead.lex.tex. `lexlean lock` in stdlib,
bootstrap, and examples/helpdesk moves their digests; helpdesk pins the stdlib
package it imports, so without this its check refuses with LLC0105 (found by
#269 on this branch).

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

afflom commented Nov 3, 2026

Copy link
Copy Markdown
Member

Namespace correction before any writer run: Host already has the maintainer reservation SL-12 (coordinated on #396/#405), while this PR uses SL-12 for a distinct JSON-reader claim. Reserve SL-13 for JsonRead; SL-11 remains JSON writing and SL-14 remains maps/sets.

Please update the actual register, scenario, conformance test, stdlib dispatcher, case labels/assertions and normative prose together, then generate projections through the official model writer. The collision is present in source, not just the title. #418 inherits this JsonRead source and needs the same source update when the stack advances. Keep Host's SL-12 reservation intact.

The draft accurately discloses that the real case, Lean axiom checks and generated exports remain unrun. Please retain that status until the integrated source, coordinated regeneration and final gate are complete. Parent #276 remains open; I am recording scoped child deliveries so each eventual merge has an accurate issue closure.

humuhumu33 and others added 3 commits November 3, 2026 15:08
… into member 5 (SL-12)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…he decimal reader

CI run on 541ecd8: the evaluator and the oracle disagreed on 2 of 300 runs of
readJson, both with the outcome overflow where the oracle refuses. The texts
were 18446744073709551616 and -82095567141444985264: Numeral.parseDecimal
overflows past the target width, so the reader must not hand it a run of digits
longer than any i64 has. readInteger now refuses past nineteen digits, a plant
removes the guard, and the case reads the stack bounds last, as SL-14's does.
The other 298 runs agreed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
readInteger changed stdlib/src/JsonRead.lex.tex, so the tree digest of the stdlib
package moved, and the locks of bootstrap and examples/helpdesk that pin it with
it.

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

afflom commented Nov 3, 2026

Copy link
Copy Markdown
Member

The latest e7adf7c source still uses SL-12 for JsonRead. I will prepare a narrow maintainer follow-up on a separate review branch to move this claim consistently to reserved SL-13, leaving this contributor branch and its implementation intact. No identity regeneration or full CI will be started for that preparation. Include the reviewed rename in this existing PR and forward it into #418 before the eventual writer wave. The >19-digit guard is retained; new execution/certification evidence remains required.

afflom commented Nov 3, 2026

Copy link
Copy Markdown
Member

Reviewed source-only namespace follow-up is published at 72ba54d on fix/jsonread-sl13-source, directly atop your current e7adf7c. It consistently renames JsonRead to SL-13 across register/SPEC/scenario/test/dispatch/assertions and prose, preserving the reader implementation, 13 plants and digit guard. Static register/SPEC/scenario/test correspondence remains472 unique claims; no Host row was imported.

Please include this commit in the existing PR and propagate it to #418 before writers. CONFORMANCE.md intentionally remains pending the official model writer; this preparation does not claim a complete generated tree, execution or final acceptance. No new PR, contributor-branch update, regeneration or full CI was started. #422 remains the scoped closure; #276 stays open.

@afflom afflom changed the title SL-12: reading canonical JSON in the standard library (#276) SL-13: reading canonical JSON in the standard library (#276) Nov 3, 2026
humuhumu33 and others added 5 commits November 8, 2026 09:13
The conflicts are taken from release/v0.4 with this member's own edits
put back on them: the ninth-module prose and the SL-13 row of SPEC.md
after the landed Map module, the register at 478 IDs in SPEC.md, the
README, the RP-07 check and its case, the JsonRead entrypoint in
stdlib/lexlean.toml, and the maintainer's SL-13 section at the end of
VERIFICATION.md. The three locks are release/v0.4's and are rewritten
by lexlean lock next, with the export and records after them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JsonRead.lex.tex is formatted canonical under the line's formatter
(LLL1003; one constructor list rewrapped, no other change); the three
locks are rewritten by lexlean lock; validate-model --write moves the
JsonRead row of CONFORMANCE.md to SL-13; check-production-export --write
adds the packages of readJson and readJsonFile to the stdlib export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The differential named its rust-std crates json_read_<member>, and
stack_bounds::subject drops only the first word of a crate name, so the
case looked up stdlib/read_read_json_file, no package of the export, and
failed before its stack-bound check. The crates are now named
jsonread_<member>, which the lookup reads as the exported read_json and
read_json_file. With that the case passes under LEXLEAN_MEASURE_STACK=all
(779 s); the two roots do not recurse, so no stack-bound row is written.

check-golden --write rewrites the build manifests and maps of stdlib,
bootstrap and helpdesk for the JsonRead entrypoint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
verify-examples --write on the normative host for every example but
uor-atlas (its whole verify exceeds the host's memory; CI verifies it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…08 and BS-12 to BS-15

The packages read_json and read_json_file join the committed corpus the
bootstrap count cases read: 299 manifests and packages, 216 distinct
programs, 275 distinct lowered crates. BS-05 runs 511 and 376 vectors,
BS-06 719 printCrate vectors (550 committed distinct, 67 refused, 604
under its evaluator's bound), BS-07 350 vectors, BS-08 409 crates, BS-13
119 vectors, BS-14 354, BS-15 318 manifests (299 accepted, 299 render
mutants); the new verify records move the mutant draws of BS-12 to 150,
BS-13 to 132 and BS-14 to 539. Neither crate is within any evaluator's
bound. The constants, SPEC.md §31 and §17.23, the register, the
scenarios and VERIFICATION.md state the same numbers, read from one run
of each case's count checks; CONFORMANCE.md is regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@humuhumu33
humuhumu33 changed the base branch from member4-maps to release/v0.4 November 8, 2026 23:59
@humuhumu33
humuhumu33 marked this pull request as ready for review November 9, 2026 07:39
humuhumu33 and others added 2 commits November 9, 2026 09:02
The honesty gate's R4 audit refuses "not yet" outside a code span; the
comment above the case's stack-bound check now says a bound missing from
the record hides none of the results above.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RP-11 holds every registered ID to a README row; the row of the
standard library lists SL-13 between SL-11 and SL-14.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@humuhumu33
humuhumu33 merged commit 4dc5b80 into release/v0.4 Nov 9, 2026
46 checks passed
humuhumu33 added a commit that referenced this pull request Nov 9, 2026
BS-21 stacks on SL-13 (#415), whose stdlib digest every bootstrap export
records, so its regeneration runs once on the tree both will land in.
The conflicts are taken from that tree with this member's own edits put
back on them: the StructuralGrammar prose of SPEC.md §17.23 and the BS-21
row after BS-20, the register at 479 IDs (SPEC.md, the README, the RP-07
check and its case), the README's bootstrap row through BS-21, the
StructuralGrammar entrypoint of bootstrap/lexlean.toml and its note in
bootstrap/README.md, the case's wiring and named test, the scenario, the
CHANGELOG entry, and the BS-21 subsection of VERIFICATION.md. The lock
and CONFORMANCE.md are the tree's and are rewritten next.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
humuhumu33 added a commit that referenced this pull request Nov 9, 2026
The merge kept the standard-library row from before #415 claimed its
row; RP-11 reads the row from release/v0.4 again.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
maurathat pushed a commit to maurathat/LexLean that referenced this pull request Nov 11, 2026
… the merge

The bootstrap lock follows the SurfaceGeneric entrypoint, CONFORMANCE.md is
written from the model with the BS-24 row, and the three places that named
the standard library's Json reader `SL-12` name it `SL-13`, as UOR-Foundation#415 renamed
it (`SL-12` stays Host's reservation).

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