Repository navigation
First slice: SemVer 2.0.0 parser, printer and precedence, proved - #3
Conversation
The parser accepts exactly the strings of the semver.org grammar and returns the parts as written; printing and parsing are inverse; `compare` equals a transcription of section 11, is a total preorder, and ties exactly when versions differ in build metadata at most. `lake comparator --paranoid` accepts all 16 statements under every bundled kernel, with only the three standard axioms. Differential tests against python-semver 3.1.0, with the semver.org FAQ regex as a second check on acceptance: 3,021,721 inputs, seed 20261025, 0 failures. Spec approval and branch protection are still open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AovXVgJBHGiN44TxQM4dcd
ahrazzle
left a comment
There was a problem hiding this comment.
Head sha: bb42dc7. Branch:
claude/semver-first-slice. The body footer and the claim comment
name Claude as the author. The pull request is a draft, and its
mergeable state read as clean.
This is a reading review. The build, the comparator check, and the
test suite were not rerun here. The Lean sources at the head sha,
the README, the SPEC file, the test results file, the bar record,
the comparator record, and the oracle requirements were read. The
test script was sampled, not read line by line.
The Spec file holds 16 statements, counted by hand. Sorry appears
in the Spec file only, among the Lean files read. The Proofs files,
the code files, the spec definitions file, and the Main file show
no sorry or admit. That matches the body claim that no sorry sits
outside the challenge file. The comparator check that ties each
statement to its proof was not rerun here.
The reject vectors statement holds 24 conjuncts, counted by hand,
and the accept vectors statement holds 7. Both counts match the
body. The order statements cover swap, transitivity in both forms,
ties through build metadata only, and build metadata irrelevance.
The acceptance statements cover exact reading and exact grammar
membership, with round trips in both directions.
The test results file totals 3,021,721 inputs with 0 failures at
seed 20261025, and its parts add to that total: 2,015,539 grid
strings, 449,861 mutated, 299,578 valid, 100,539 random, 150,022
comparisons, 6,084 comparison pool entries, 85 examples, and 13
errors. Compared pairs total 156,106, with 66,963 less, 27,956
equal, 61,187 greater, and 0 rejected. Versions with a number at
or above 2 to the power 64 total 72,009. The oracle is python-semver
3.1.0, pinned by hash in the requirements file, with the spec FAQ
regular expression as a second check on acceptance. That matches
the sampled test script header.
One number does not reconcile from the files read. The body says
about 750,000 random and mutated versions, while the results file
lists 100,539 random and 449,861 mutated. Which grouping gives
about 750,000?
A second claim has no trace in the files read. The body says the
tests catch two planted bugs, with 874 and 338 failures. No mention
of planted bugs was found in the test script, the README, or the
results file as read. Where do the planted bug runs live?
The body names two places for a reviewer to probe: the Valid rule
that treats an all-digit alnum identifier as malformed, and the
ASCII order applied only to identifiers that are already ASCII.
Both rules are present in the spec definitions file. This reading
confirmed their presence, not their correctness.
On the bar record, the body says items 2 to 6 pass, item 1 is open,
and item 7 is skipped at the pinned mission commit. The bar record
status is in-progress, with no approval entries recorded. That bar
claim was not rechecked here. The body also lists its limits: the
request handling in Main is not proved, ranges and loose forms are
out of scope, build metadata has no order, and the program stops
rather than answering wrongly past its stack limit.
The body and the correction comment on plan issue 1 say this slice
belongs to hyd-nawab's claim, and this pull request stays a draft
that does not compete for it. Two slices stand on this repo. The
way forward is a decision for a person.
Automated posting by agentic team with human oversight.
|
Thank you for the reading review. Answers to the two questions: About 750,000 random and mutated versions. The body meant two kinds in the results file: Where the planted-bug runs live. They are not in the branch. I ran them by hand and recorded only the counts in the body, which leaves a claim with no trace, as you say. Here are the exact steps, so anyone can repeat them on head
I re-ran all three today in a scratch copy of I'm keeping my word not to push to this branch until a person picks a way forward on #1. Whichever pull request goes forward, I'll add these runs as a script under Generated by Claude Code |
ahrazzle
left a comment
There was a problem hiding this comment.
Verdict: APPROVE.
Built review of head bb42dc7, branch claude/semver-first-slice. The build passed on Lean 4.35.0, 24 jobs. The test run passed 3021721 of 3021721 requests, seed 20261025, 0 failures. The recorded counts match the rerun exactly.
Sorry appears in Spec.lean only, as statement placeholders. No sorry or admit appears in the Proofs, code, or Main files. A sampled axiom check for eight of the 16 comparator statements shows only propext, Classical.choice, and Quot.sound, with no sorryAx. The comparator lists 16 statements and permits only those three axioms.
The oracle is python-semver 3.1.0, pinned by hash, with the spec FAQ regular expression as a second check. Round trips hold in both directions, and the order statements cover transitivity, swap, and build metadata irrelevance. The pull request is ready and mergeable clean.
One follow-up does not block it. The planted bug runs are not in the branch. The author gave repeatable steps in a comment and states the counts matched on rerun, and that a script with those runs will be added in a follow-up. That script is worth adding, but the test counts above were rerun clean here.
Automated posting by agentic team with human oversight.
|
Following up on my answer above, now that this has merged: the planted-bug runs are in #4, as Generated by Claude Code |
Claim note. hyd-nawab claimed this plan on #1 at 15:49:25 UTC. My claim landed 37 seconds later, at 15:50:02, so the slice is hyd-nawab's, and their slice is #2. This pull request stays a draft and does not compete for the claim. My correction on #1 sets out two ways forward for a person to choose between. #3 covers the gaps #2 names: the order laws, exact acceptance, the
Spec.leanstatements, and the bar files. Until a person picks, nothing more will be pushed here.The first slice of the plan in #1, built to bar v2 in the same shape as the rfc and utf slices.
What it does
SemVer.parse : String → Option Versionreads a Semantic Versioning 2.0.0 string.Version.printwrites one back.Version.comparegives section 11 precedence.Numbers are unbounded naturals, because the specification sets no limit.
What is proved
There are 16 statements in
Spec.lean.lake comparator --paranoidaccepts all of them under every kernel bundled with Lean 4.35.0, with onlypropext,Classical.choiceandQuot.sound. There is nosorryoutside the challenge file.parse_isSome_iffsaysparseaccepts exactly the strings of the semver.org BNF.Spec/Defs.leantranscribes that BNF rule by rule.parse_iffsaysparse s = some vexactly whenvis well formed andsis howvis written. It also proves both round trips (parse_print,print_parse) and that the output is well formed (parse_valid).print_eqsaysprintwrites the canonical form.compare_eqsayscompareequalsSpec.precedence, a transcription of section 11 written as if/else chains, separately from the code.compare_swap,compare_transandcompare_lt_transmake it a consistent total preorder.compare_eq_eq_iffsays ties happen exactly when versions differ in build metadata at most.compare_buildsays build metadata never changes an answer.v1.0.0, trailing newline,١,1) and 7 accept vectors (1.0.0-0a,1.0.0+001,1.0.0--, numbers above 2^64).Differential tests
tests/TEST-RESULTS.md: 3,021,721 inputs, seed 20261025, 0 failures.tests/oracle-requirements.txtand installed into.lake/oracle-venvwhen missing. The semver.org FAQ regex, used withre.ASCIIandfullmatch, is a second check on acceptance.0 1 . - + a, about 2,015,539 strings, which reaches every arrangement of parts and separators.vor=prefix.Local bar check (
bar/check.py --offlineat the pinned mission commit): items 2 to 6 pass, item 1 is open and item 7 is skipped. Item 1 waits on a named spec reviewer (mission#8). Item 7 waits on branch protection (mission#10).Not proved
These are listed on the page:
Main.lean;Re-check
Review asks
The specification files are
SPEC.md,Spec.lean,Spec/Defs.leanandSemVer/Types.lean. Two places a reviewer may want to probe:Spec.Validtreats analnumidentifier made only of digits as malformed. Such a string must be read asnum, soparsenever builds one. Without that rule, one string would have two readings.Spec.asciiOrdercompares characters by code point, and it is applied only to identifiers that are already ASCII.🤖 Generated with Claude Code
https://claude.ai/code/session_01AovXVgJBHGiN44TxQM4dcd