Prove registry key unambiguity in Lean; evidence five more core laws - #391
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…production replay Finish the interrupted model and replay: each distinct runner script runs once per runtime, the replay compares 1,000 traces, and the claim moves to evidenced. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tateful models A fast-check command model drives the real bound state helper with current and stale snapshot writers and removers, an unconditional recreate, and a swap for a symbolic link. A second model drives the plugin lifecycle quiescence kernel over generated live, settled, and malformed work for two bundles. Both catch seeded defects; their shrinks are named examples. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…model Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The cache-read example now removes only a dead owner's admission claim and leaves every other file's bytes unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tent Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Route keys and exact-contract keys read back to their parts and are injective over the four transports and the surface and operation grammars, with a seeded unseparated-key defect refuted. The differential tests check routeKey, operationKey, and the two identifier grammars against the Lean model.
…-laws # Conflicts: # docs/assurance.md # verification/quint/models.json
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The checker test borrowed the register's last planned Lean claim to exercise the proof-plus-differential rule; with every Lean claim now evidenced, that fixture no longer exists and the check itself failed. Borrow an evidenced claim instead, which exercises the same rule.
…-laws # Conflicts: # docs/assurance.md
2 tasks
0thernet
added a commit
that referenced
this pull request
Sep 25, 2026
… reading (#393) ## Summary Fixes a wrong-field assertion in the browser-admission `fc.commands` model that intermittently fails `test 6/8` on `main` and on every lane merged past #392. `run()` asserted that a refusal while a slot was available must have consumed a **clock reading** at or past the bound (`lastRead >= bound`). But simulated time advances without a reading: `sleep` adds its delay and the test commit hook adds `commitDelayMs` directly to `clock.now`. A 1 ms budget can expire on the deadline's field check before any subsequent reading — `lastRead` still 0 while `now` is already past the bound. Observed on #391's `test 6/8`, seed `797548962`, counterexample `acquire({"timeoutMs":1,"captureRemainingMs":1,"increments":[],"commitDelayMs":1})`: the commit hook advanced `now` to 1, the capture deadline's field check fired before the next `now()` read, production refused legitimately — and the assertion rejected it at `lastRead=0`. The fix compares `real.clock.now`, which is what the deadline itself observes. A refusal while a slot was free still must be justified by simulated time reaching the bound — the check is not weakened. Same correction at the capture-launch assertion (line 469). #### Test plan - [x] Mechanism traced: `lastRead` only updates in `readClock`; `sleep`/`afterCreateCommitForTest` advance `now` field-only; `deadline.throwIfUnavailable` checks the field before `throwIfUnavailable` reads `now()` - [ ] CI `test 6/8` passes (local replay blocked by host load; the failing schedule runs the real bound state helper) Generated with [Devin](https://devin.ai)
…-laws # Conflicts: # docs/assurance.md # verification/quint/models.json
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The provider-plugin registry's route key (
<transport>:<surfaceId>) and exact-contract key (<transport>:<surfaceId>/<operation>@<contractVersion>) are now proven unambiguous in Lean — each key parses back to its parts and no two valid coordinate tuples share a key — with a seeded unseparated-key defect refuted and differential tests binding the Lean model to the TypeScript grammars. The lane also evidences five more core laws: injected clocks in the approval broker, serialized plugin lifecycle, CAS no-rollback, no-writes-on-read-paths, and local-CLI post-spawn indeterminate.Claims moved (6)
identifier-roundtripRouteKey.lean:parse_routeKey,routeKey_injective,parse_operationKey,operationKey_injective, plus theoperationKeyUnseparateddefect refutation; differentialrsurf/rop/rkey/okeyagainstisProviderPluginSurfaceId,isProviderPluginOperationName,routeKey,operationKeylifecycle-injected-clockssrc/control/approval-broker-clock.model.test.ts)plugin-lifecycle-serializedsrc/provider-plugin-lifecycle-kernel.test.ts(+310)state-cas-no-rollbacksrc/storage-cas.model.test.ts(+242)no-writes-on-read-pathslocal-cli-post-spawn-indeterminatelocal-cli.qnt(Apalache length 8, 2,000 × 8-step samples) + 628-line production replayEvidence and how the evidence fails when broken
lake build --wfailcompiles the new module with warnings as errors; the axiom audit counts all 66 required theorems with their recorded statement digests;proofs.jsonregisters the RouteKey theorems and theoperationKeyUnseparatedseeded defect, which the audit proves refutesoperationKey_injective.scripts/verification-lean-encodings.test.tsgenerates identifier candidates heavy in key separators and near the length bounds and asserts the LeanvalidSurface/validOperation/routeKey/operationKeyagree with the TypeScript; the seeded defect's counterexample is rejected by production.local-cli.qntcheckspostSpawnIndeterminate/noRespawn;stepRetryTimeoutandstepTrustNotStartedmutants must violate them;scripts/verification-local-cli-replay.test.tsreplays 1,000 seeded traces through production.identifier-roundtrip'snotVerifiedrecords that the grammars are modelled by hand from their regular expressions, that the differential test samples generated inputs, and that the registry's positive-safe-integer check on contract versions is not modelled.Defects found
notVerifiedgaps to their measured extent (smuggled-key, read-path writes) so the claims describe exactly what the examples fingerprint.Package budget
Only
src/provider-plugin-registry.tsships (+6 lines:routeKey/operationKeyexported with doc references to the proofs). Lean files, proofs.json, models, and tests stay out of the package.CI cost
Lean build time grows by one 277-line module plus differential property runs;
local-cli.qntadds an Apalache length-8 check and a 1,000-trace replay to the Required verification job.Not covered
bun run verify:leanpassed fully (build --wfail, axiom audit, all seeded defects, differential tests); typecheck and claims render/check pass post-merge. Helper-heavy stateful suites are delegated to the Required CI run on this head.🤖 Generated with Claude Code