Skip to content

Add the formal verification from formalver (v1.1.0) - #7

Open
gabehamilton wants to merge 3 commits into
mainfrom
gabehamilton/formal-verification
Open

gabehamilton wants to merge 3 commits into
mainfrom
gabehamilton/formal-verification

Conversation

@gabehamilton

@gabehamilton gabehamilton commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Copies the shared-pool-controls formal verification from difflabai/formalver into verification/. The copy is verbatim from formalver da343e2: PR difflabai/formalver#32, which is stacked on difflabai/formalver#31. It verifies contract v1.1.0 (57b3f02), and no file under crates/ has changed since, so it covers the contract on main.

  • Layers: TLA+ (with the executor model), Lean, Prolog, Kani (98 harnesses; the 48 large ones are a fingerprinted local record), 216 conformance traces, NEAR unit tests and sandbox tests. status.toml and strategy.md record the claims and findings.
  • Results: no new findings at v1.1.0. Every v1.0.0 finding fixed in v1.1: formal-verification findings and fixes #4 is closed, with regression evidence (fails on v1.0.0, passes on v1.1.0). 27 large Kani mutants have no result at v1.1.0 and are listed in verification/kani/local/not-run.tsv.
  • CI in formalver: green on da343e2 (run 43642798201).

Not wired up yet

This PR only copies the files; nothing runs in this repository's CI yet. verification/README.md maps formalver's paths to this repository's and lists the follow-ups:

  • path rewrites (90 of the copied files refer to the source-mirror submodule, which is this repository's root here);
  • replacing the submodule pin check;
  • keeping the Kani record valid: its fingerprint covers paths under projects/shared-pool/, so it does not match at verification/. Either restore formalver's layout with a self-submodule at 57b3f02, or re-run the 48 large harnesses (about 7 hours on a 64 GB Mac);
  • checking the verification crates' toolchains against rust-toolchain.toml (each crate already declares its own [workspace]);
  • activating verification/ci/shared-pool.yml with paths: filters (a full run takes about 48 minutes).

The root README.md and docs/verification-handoff.md now also point to verification/. The commit history, review threads and CI runs stay in formalver.

Test plan

  • cargo metadata at the root still loads the workspace (the new crates are not members)
  • All 393 files copied from formalver da343e2 are in the commit, none dropped by .gitignore
  • This repository's check workflow passes

🤖 Generated with Claude Code

Verbatim copy of formalver's shared-pool verification at da343e2 (PR #32,
stacked on PR #31), which verifies contract v1.1.0 (57b3f02): TLA+, Lean,
Prolog, Kani (with the local record of the 48 large harnesses),
conformance traces, NEAR unit and sandbox tests, status.toml and
strategy.md, plus the formalver scripts and CI workflow they use.

Paths still follow formalver's layout and nothing runs in this
repository's CI yet; verification/README.md maps the paths and lists the
follow-ups. The CI workflow is kept inactive at verification/ci/.

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

Copy link
Copy Markdown
Contributor Author

Summary of Changes

Hello @gabehamilton, I'm the pr-review agent. I've reviewed this pull request, and here's a summary to help you and other reviewers get up to speed, with the full code review to follow.

This PR copies the shared-pool-controls formal verification verbatim from difflabai/formalver (da343e2) into verification/. The only authored file is verification/README.md, which maps formalver's layout to this repository's and lists the follow-ups needed before the suite can run here. This review covers that README, the PR body, and whether the copy affects existing CI and tooling. The copied files were reviewed in formalver PRs #31 and #32.

Highlights

  • CI isolation: The existing check/pages workflows and scripts do not reference verification/, and verification/ci/shared-pool.yml remains outside .github/workflows/.
  • Workspace isolation: The root workspace has an explicit members list; conformance, kani, near-tests, and sandbox already declare standalone workspaces, with sandbox including relay.
  • Verification inventory: The local evidence supports the stated 98 Kani harnesses, 48-record local harness set, 27 not-run mutants, and 216 conformance traces; the source-mirror reference count is understated.
Changelog
  • verification/README.md
    • Documents the imported suite, its provenance, its inactive status, and the integration follow-ups.
  • verification/** (copied files)
    • Adds the upstream models, harnesses, traces, records, scripts and an inactive CI workflow (ci/shared-pool.yml).

Automated review by the pr-review agent (Codex CLI + GPT-5.6 Terra). Reply on any review thread to discuss a finding.

@gabehamilton gabehamilton left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This PR copies the formal verification from formalver into verification/ with an authored README. I found no way the copy breaks the existing check or pages workflows, the scripts, or the root Cargo workspace: the root members list is explicit, the four verification crates each declare their own [workspace], and ci/shared-pool.yml sits outside .github/workflows/. I also checked the README figures against the tree and the formalver CI run (98 Kani harnesses, 27 not-run mutants, 18 passed and 4 skipped jobs, a file set that matches da343e2). The findings are documentation fixes: the source-mirror file count is understated (91, not about 85), the workspace follow-up is already satisfied, and the root README and docs/verification-handoff.md still say the proofs live only in formalver.

Comment thread verification/README.md Outdated
Nothing here runs in this repository's CI yet, and the root Cargo workspace does not include these
crates. Follow-ups to make it run here:

1. Rewrite the paths above (about 85 files refer to `source-mirror`).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Correct the source-mirror reference count. This says about 85 files refer to source-mirror, but a recursive file-level search of verification/ finds 91 files containing that path (89 even when README files are excluded). The PR body repeats the same count, so the stated scope of the required path rewrite is understated.

Suggested change
1. Rewrite the paths above (about 85 files refer to `source-mirror`).
1. Rewrite the paths above (91 files refer to `source-mirror`).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 03b57d7. A grep finds 91 files, one of which is the new README itself, so the README now says "90 of the copied files". The PR body is updated too.

Comment thread verification/README.md Outdated
Comment on lines +45 to +46
3. Exclude `verification/` from the root workspace (or give each crate its own `[workspace]`), and
check the crates' toolchains against `rust-toolchain.toml`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Remove the already-completed workspace follow-up. There is no pending workspace exclusion to perform: the root Cargo.toml has an explicit members list, and verification/conformance, kani, near-tests, and sandbox already each define a standalone [workspace]; sandbox's workspace includes relay. Leaving this as a required follow-up makes the integration checklist misleading.

Suggested change
3. Exclude `verification/` from the root workspace (or give each crate its own `[workspace]`), and
check the crates' toolchains against `rust-toolchain.toml`.
3. Check the crates' toolchains against `rust-toolchain.toml`. Each of `kani`, `conformance`, `sandbox` (which also holds `relay`) and `near-tests` already declares its own `[workspace]`, so none of them joins the root workspace.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 03b57d7. Confirmed: kani, conformance, near-tests and sandbox (members "." and "relay") each declare [workspace]. Follow-up 3 is now only the toolchain check against the root rust-toolchain.toml.

Comment thread verification/README.md
| `tools/` | `verification/tools/` |
| `.github/workflows/shared-pool.yml` | `verification/ci/shared-pool.yml` |

Nothing here runs in this repository's CI yet, and the root Cargo workspace does not include these

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Update repository-facing verification links for the local copy. Adding the local verification tree without updating the repository-facing documentation leaves readers directed only to formalver PR #32. In particular, docs/verification-handoff.md still states that this repository holds no proofs itself, which is now false. Add the root README/docs link updates to the PR or explicitly list them as a follow-up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 03b57d7. The root README.md (both formalver links) and docs/verification-handoff.md now also point to verification/. The handoff no longer says this repository holds no proofs; it says the copy is not yet wired into CI.

gabehamilton and others added 2 commits November 14, 2026 16:31
…(review fixes)

- 90 of the copied files refer to source-mirror, not about 85.
- The verification crates already declare their own [workspace], so the
  follow-up is only a toolchain check.
- The root README and docs/verification-handoff.md now point to
  verification/; the handoff no longer says the repository holds no proofs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
check-kani-record.py fingerprints paths under projects/shared-pool/,
including the source-mirror gitlink, so the copied record does not match
at verification/ and a path rewrite would not fix that. The README now
gives the two ways to keep it: restore formalver's layout with a
self-submodule at 57b3f02, or re-run the 48 large harnesses.

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

This branch has not been deployed

No deployments
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.

1 participant