formal: add local prefix-cache contract registry - #564
Draft
dusterbloom wants to merge 2 commits into
Draft
Conversation
dusterbloom
force-pushed
the
agent/formal-contract-registry
branch
from
July 31, 2026 13:56
748eb8e to
6d1c428
Compare
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.
Dependency and review order
Depends on #563. Do not merge this draft before #563.
This is PR 2 of the staged replacement for #561. GitHub currently compares
this fork branch with upstream
main, so its Files Changed tab temporarilyincludes PR 1 as well. The PR 2 commit itself is
6d1c428:17 files and 1,444 added lines.
After #563 merges, this branch will be rebased onto the updated upstream
mainand force-pushed. The Files Changed tab will then shrink to this PR'sformal-registry work only.
Why
The original #561 mixed a production cache fix, a reusable formal-verification
platform, five targets, hosted workflows, image policy, and later rollout
decisions into one large review. This draft keeps the second unit local and
deliberately narrow: establish the registry and prove it works against the two
prefix-cache properties introduced by #563 before asking maintainers to trust
or activate it in CI.
What changed
validate,plan, andemitcommands;prefix-cache-inline;prefix-cache-abort-hole;five candidate areas that remain outside this first wave;
Scope boundary
This draft is local tooling plus two contracts. It does not:
CODEOWNERS;policy = "required"metadata enforce anything.The repair-image digest is compatibility metadata only in this draft. No
repair or AI path is invoked. Hosted CI integration, image trust/provenance,
permissions, and any required-check policy need a separate maintainer/security
review and a later PR.
Validation
python3 scripts/formal_plan.py validate;bash -n scripts/formal.sh scripts/formal_mutation_test.sh;uv run --frozen --extra dev ruff check .;git diff --check;./scripts/formal.sh --all: both contracts verified with thepinned verifier image;
produces the expected counterexample.
Proposed release sequence
mainand confirm its reduced diff.maintainer/security approval and evidence from the local phase.
This sequence gives maintainers a useful production fix first, then a
revertible local verification layer, while keeping CI trust and enforcement as
an explicit later decision.