Repository navigation
Add the Kani agent plugin: verify-rust skill, helper scripts, and kani-mcp - #5059
Draft
feliperodri wants to merge 16 commits into
Draft
feliperodri wants to merge 16 commits into
feliperodri wants to merge 16 commits into
Conversation
- agent-plugin/: plugin manifest, MCP registration, compatibility.json (plugin 0.1.0 supports Kani >= 0.68.0, < 1.0.0), the verify-rust skill, and references for Kani, AutoHarness, contracts, Miri, rust-analyzer, and vacuity. - Scripts: summarize-results.py (compact --export-json summary), check-vacuity.py, check-assumptions.py, inspect-harness.py, and check-kani-version.py. - tools/kani-mcp: a minimal stdio-only MCP server with kani_get_version, kani_list_harnesses, kani_verify_harness, and kani_get_counterexample. It shells out to the installed Kani. MCP is optional; the skill falls back to the CLI. - Tests: Kani-free unit tests and a metadata validator (new Agent Plugin workflow), plus an `agent-plugin exec` suite in kani-regression.sh that runs the workflow end to end against a fixture crate, with and without MCP.
feliperodri
force-pushed
the
agent-plugin-v1
branch
from
October 23, 2026 20:40
535f05d to
4a70012
Compare
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
No open issues 🎉
What changed in this PR
Adds a Kani agent plugin plus a minimal MCP server (kani-mcp) to make Kani verification workflows accessible to coding agents, with helper scripts and CI/smoke tests to validate behavior and compatibility.
Changes:
- Introduces
kani-mcp(stdio JSON-RPC/MCP server) with tools for version, harness listing, verification summaries, and counterexamples. - Adds Python helper scripts and tests for summarizing
--export-json, vacuity/assumption checks, and plugin metadata validation. - Adds CI workflow + regression suite hooks and end-to-end smoke tests for CLI fallback and MCP tool parity.
| File | Description |
|---|---|
| tools/kani-mcp/src/summary.rs | Rust implementation of compact RFC0015 export summary (mirrors Python script) + unit test fixture coverage |
| tools/kani-mcp/src/main.rs | MCP stdio server implementing kani_get_version, kani_list_harnesses, kani_verify_harness, kani_get_counterexample |
| tools/kani-mcp/Cargo.toml | New kani-mcp crate definition and dependencies |
| Cargo.toml | Adds tools/kani-mcp to workspace members |
| tests/agent-plugin/version-check/test.sh | Smoke test for version enforcement and error clarity |
| tests/agent-plugin/version-check/config.yml | Registers version-check smoke test |
| tests/agent-plugin/mcp/test.sh | End-to-end MCP tool exercise + parity check vs CLI summary |
| tests/agent-plugin/mcp/config.yml | Registers MCP smoke test |
| tests/agent-plugin/cli-fallback/test.sh | End-to-end skill workflow through CLI-only (export, summary, vacuity/assumptions, playback, autoharness) |
| tests/agent-plugin/cli-fallback/config.yml | Registers CLI-fallback smoke test |
| scripts/kani-regression.sh | Adds agent-plugin exec suite to regression |
| .github/workflows/agent-plugin.yml | New path-filtered workflow to validate plugin + run unit tests |
| agent-plugin/plugin.json | Plugin manifest (name/version/paths/metadata) |
| agent-plugin/mcp.json | Registers local stdio MCP server command (kani-mcp) |
| agent-plugin/compatibility.json | Supported Kani range + required unstable features |
| agent-plugin/README.md | Plugin documentation, installation, tools/scripts overview |
| agent-plugin/tests/validate_plugin.py | Validation for manifests, versions, skill frontmatter, and reference/script presence |
| agent-plugin/tests/test_scripts.py | Unit tests for Python scripts using JSON fixtures + Rust source fixtures |
| agent-plugin/tests/smoke-lib.sh | Shared harness for smoke tests (temp fixture crate, build kani-mcp, helpers) |
| agent-plugin/tests/mcp_client.py | Minimal MCP stdio client used by smoke tests |
| agent-plugin/tests/fixtures/rust/assumptions.rs | Rust text fixture for assumption scanner tests |
| agent-plugin/tests/fixtures/crate/Cargo.toml | Fixture crate used by end-to-end smoke tests |
| agent-plugin/tests/fixtures/crate/src/lib.rs | Fixture crate code + proof harnesses (good/failing/vacuous) |
| agent-plugin/scripts/kani_plugin_lib.py | Shared text-scanning utilities for plugin scripts |
| agent-plugin/scripts/summarize-results.py | Python compact summary implementation of RFC0015 export |
| agent-plugin/scripts/check-vacuity.py | Python vacuity checker over RFC0015 export |
| agent-plugin/scripts/check-assumptions.py | Python assumption checker over Rust source text |
| agent-plugin/scripts/check-kani-version.py | Python Kani version-range validator |
| agent-plugin/scripts/inspect-harness.py | Python harness structure inspector |
| agent-plugin/skills/verify-rust/SKILL.md | Skill orchestration workflow/policy for agents |
| agent-plugin/skills/verify-rust/references/kani.md | Reference guidance for harness writing/running Kani |
| agent-plugin/skills/verify-rust/references/vacuity.md | Reference guidance for vacuity/sanity checks |
| agent-plugin/skills/verify-rust/references/contracts.md | Reference guidance for contracts |
| agent-plugin/skills/verify-rust/references/autoharness.md | Reference guidance for autoharness usage |
| agent-plugin/skills/verify-rust/references/miri.md | Reference guidance for Miri complementing Kani |
| agent-plugin/skills/verify-rust/references/rust-analyzer.md | Reference guidance for using rust-analyzer in verification workflows |
Review effort: Lite
Copilot stopped reviewing on behalf of
feliperodri due to an error
October 23, 2026 21:17
Make it hard for an agent to get a green result by weakening the proof: - summarize-results.py and kani_verify_harness report `weakened_checks` (disabled checks, raw CBMC arguments) and, per harness, the stubs and stub_verified contracts the result relies on. - check-specs.py checks specifications with Kani itself, in a temporary copy of the crate: harness end reachable, preconditions satisfiable, clauses that constrain nothing, and whether a changed precondition is stronger or weaker than a baseline. Checks that cannot run are reported as unchecked, never as passing. - check-proof-diff.py compares harnesses, contracts, and code with a pinned baseline and flags removed assertions or covers, new assumptions, stubs, should_panic, lower unwind bounds, changed contracts, and any change to the code under verification. - check-witness.py confirms a defect (its concrete playback witness fails) or a fix (the witness fails before and passes after). - evidence.py records the run behind a reported result and re-checks it. - The verify-rust skill pins the agreed property, forbids silent code changes, requires evidence for every claim, and gains a strategy reference (one harness for small targets, contracts bottom-up along the call graph from rust-analyzer's call hierarchy for larger ones). - kani_list_harnesses accepts extra_args, so crates with contracts can be listed with -Z function-contracts. - New proof-integrity smoke test; more unit tests.
Parsing and proof diff:
- Walk back over attributes by matching brackets, so multi-line
attributes such as `kani::ensures(|r| { ... })` are seen.
- Count assumptions, inputs, and assertions in the Kani-only helpers a
harness calls (and its stub replacements); list a new harness's
assumptions; treat files included through `#[cfg(kani)] mod x;` as
Kani-only; normalize multi-line attribute arguments.
- Loose files are no longer attributed to an enclosing package.
Checks:
- check-vacuity.py: without descriptions, unreachable assertion-class
checks are warnings (they may be built-in checks the solver folded
away); `--log` classifies them from Kani's console output.
- check-specs.py: check contracts on methods and associated functions
through generated predicates in an inherent impl; accept
`--kani-arg -Z`; keep the crate copy in target/ so dependencies are
built once; report `harness-fails` for failing harnesses.
- check-witness.py: `--cargo-arg` pass-through, retry with `--lib` when
test targets do not build under cfg(kani), and report witnesses of
stubbed harnesses that pass on the real code as spurious.
- evidence.py: hash every package source and the workspace manifests,
resolve workspace-relative export paths, record a hash of `git diff`
and of untracked files.
- check-kani-version.py and kani_get_version verify a trivial harness,
so a missing CBMC or goto-cc is reported up front.
- inspect-harness.py: `--summary`, `--flagged-only`, and `--list-json`
to report harnesses the scan cannot see (macro-generated).
kani-mcp:
- `timeout_s` (default 1800 s; kills Kani's process group),
`harness_timeout_s`, `jobs`, `export_path`, `log_path`, and MCP
progress notifications; return the command line for evidence.
- kani_get_counterexample separates failure and cover witnesses, names
omitted ones, and warns that playback ignores stubs.
- kani_list_harnesses returns a summary by default, with `filter`.
Docs: re-snapshot the baseline once a harness is approved, bound every
run, --jobs requires terse output, playback ignores stubs, rustup
auto-installs pinned toolchains, and drop glue/recursion performance.
Tests: smoke tests must end with smoke_pass, so a script that stops
early fails; new unit and smoke tests for every fix.
Toolchain: - The scripts and kani-mcp run Kani with RUSTUP_TOOLCHAIN pinned to an installed toolchain (Kani's own, else rustup's default) and RUSTUP_AUTO_INSTALL=0. rustup's cargo proxy otherwise installs the toolchain a project pins in rust-toolchain.toml before Kani starts. kani_get_version and check-kani-version.py print the `cli_env` to use for direct CLI runs. Checks: - check-vacuity.py: parse property names with spaces; classify by location: assertions in the harness are errors, in callees or contracts warnings, in Kani or std library code info. - check-witness.py: a defect is reproduced only when the replay panics with the reported failure (`different-failure` otherwise); leftover concrete values mean spurious; when the crate's tests do not build under cfg(kani), replay in a copy without them; keep the doc comment of the witness. - check-proof-diff.py: flag a harness that loses #[kani::proof]; resolve helpers by path (never into kani/std, never method calls); treat any_where predicates as assumptions; describe an added ensures as added; cfg(kani) impl blocks are Kani-only. - check-specs.py and check-witness.py: mirror external path dependencies in their work copies. - evidence.py: hash untracked files correctly; warn when sources changed after the Kani run started. - inspect-harness.py: recognize any_array and Type::any() generators; flag harnesses with branches and fewer than two covers. kani-mcp: - On timeout, return the harnesses that finished, read from Kani's output. - Counterexample note handles TIMEOUT/OUT_OF_MEMORY verdicts. - kani_list_harnesses drops --target-dir, which `kani list` rejects, and checks contracts without harnesses against proof_for_contract targets in the source. Docs: toolchain pinning for CLI runs, covers in every harness branch, witness verdicts, inplace playback in workspace members.
- kani-mcp: new kani_autoharness tool. It validates patterns (Kani rejects spaces), supports timeout_s, harness_timeout_s, export_path, and log_path, returns the harnesses that finished when the run is cut off, splits results into automatic and manual harnesses, and warns that AutoHarness runs every manual harness with a default unwind bound of 20 (kani#5103). With list_only it reports the selected functions and the skipped ones grouped by reason, without leaving kani-list.json behind. - summarize-coverage.py: merge source coverage across harnesses (a region is covered if any harness covers it) and list the uncovered regions per file; it reads the raw per-harness files, so it avoids kani-cov summary (kani#5102). --compare shows what changed between two sets of runs. - references/autoharness.md: list first; manual harnesses always run; the default unwind bound; -Z stubbing; patterns cannot contain spaces; no concrete playback; a killed run writes no export; HashMap ICE. - references/coverage.md and the skill: use coverage to find dead code and gaps in the proofs, and classify each uncovered region. - Tests: unit tests for the coverage merge and the autoharness table and output parsers; smoke tests for kani_autoharness and the coverage flow.
This was referenced Nov 6, 2026
UnixListener::bind_addr truncates abstract socket names that start with a NUL byte
tokio-rs/mio#2041
Open
Open
This was referenced Nov 6, 2026
A planning aid for choosing what to verify and in which order. map-crate.py joins cargo metadata, a call graph, the plugin's source scan, and Kani results into a deterministic, versioned JSON map, and plans bottom-up. - Call graph from cargo-callgraph when installed (an optional external program, never bundled: it is AGPL-3.0), otherwise a labeled text-scan approximation. Every edge records how it was resolved; dynamic dispatch, name-matched calls, and external calls are never treated as exact. - Strongly connected components (direct and mutual recursion) and levels. - Harness index with the functions each harness targets and provably reaches, through resolved edges and not through stubs. - Per-function status: verified, conditional, failed, inconclusive, unsupported, stale, not_attempted, with the evidence, configuration, and caveats behind it. Freshness uses evidence-bundle hashes or run times. A function is never verified through an unverified callee, stub, or assumed contract. - Strategy and priority heuristic (documented, not a predictor), staged plan with goals, update (refuses when sources changed), explain, and a Mermaid report. - The five metrics of the proposed `cargo kani complexity` command are reserved in every function as `not_computed`; the map defines no complexity metric itself. - Design document (implemented vs proposed), JSON schema, reference doc and skill steps. - Tests: unit tests on a two-crate fixture workspace covering loops, recursion, generics, trait dispatch, macros, features, contracts, and failed, inconclusive, unsupported, stale, and conditional results; a smoke test that runs real Kani and builds the map with both call-graph sources.
Contract-first (the plugin's default method): - The Crate Verifiability Map steers toward function contracts, loop invariants with decreases clauses, #[kani::recursion] for recursive groups, and AutoHarness verifying the contracts bottom-up; callers rely on verified contracts (stub_verified). Strategies: write-contract-then- autoharness, verify-contract-with-autoharness, loop-contract, add-loop-decreases, contract-and-recursion. - Per function: contract_status, loop invariant/decreases signals, partial-termination uncertainty, and a caveat when a loop without an invariant is only checked within the unwind bound. - AutoHarness-generated harnesses (not in the source) are read from the results and count as evidence for their functions. - Plan stages carry the workflow steps and the AutoHarness command (include patterns, CLI, MCP call), and the plan reports contract progress. - MCP tools kani_map_crate, kani_plan_verification, kani_update_verification_map, kani_explain_function. - Skill, strategy, contracts (loop contracts, decreases, historic values), AutoHarness and map references rewritten around it. Fixes from the issue list: - list-harnesses.py, run-harnesses.py (one process per harness, timeouts, memory cap, results kept as they finish), cleanup-playback.py. - Harness filters accept module-qualified names and fail loudly; helper scans skip hidden and plugin directories; cfg(any(kani, ..)) is Kani-only. - summarize-results: inconclusive counts, always-present keys, unsupported constructs, log diagnosis of timeouts and OOM, clear missing-export error. - check-vacuity: info counted, library properties, should_panic, uniform keys. - summarize-coverage: crate-only, instances merged, corrupt files skipped, files never reached, scope stated. - check-witness: no_std imports, deny(warnings) relaxed, failure classes, aborts, --lib first, root-relative baselines, per-copy target dirs. - check-proof-diff: new-harness stubs, macro invocations, --allow-code-change, changed-files-only. evidence.py: snapshots, --log, output directory. - check-specs: --features, --harness-timeout, work dir excluded from copy. - kani-mcp: memory_limit_mb, per_harness, default export under the plugin output directory, compiler errors surfaced, list/option handling, caps.
This was referenced Nov 6, 2026
Closed
A source build puts the binary in <checkout>/target/kani/bin, so the rust-toolchain.toml is four levels up, not two. Search every ancestor and stop at the first file, in the scripts and in kani-mcp.
…--export-json Kani 0.68.0 and older source builds gate --export-json behind -Z unstable-options and reject -Z export-json; builds since the RFC 0015 export (model-checking#4941) require -Z export-json and reject -Z unstable-options alone. Probe once with `kani -Z export-json --version` (Kani validates -Z values before it acts on --version), cache the answer, and use it in every script, in kani-mcp, in the plan's AutoHarness command, and when replaying recorded commands. check-kani-version.py prints export_flags. KANI_PLUGIN_EXPORT_FLAG overrides the probe.
Kani 0.68.0 and older builds write a tree (harness_metadata, verification_results, property_details); Kani since model-checking#4941 writes a flat document (harnesses, configuration). The plugin read only the flat one, so a passing run on the older Kani summarized as 0 harnesses and all_ok false. One reader per language (scripts/kani_export.py, tools/kani-mcp/src/export.rs) converts the tree to the flat shape and is used by summarize-results, check-vacuity, check-specs, evidence, run-harnesses, the Crate Verifiability Map and every kani-mcp tool. What the tree does not record is marked: the run configuration (summaries say weakened checks cannot be detected from the export), and stubs, which are read from the harness attributes in the source (stubs_source: source-scan, autoharness-generated, or unknown). The source is accepted only if the harness fn is where the export says. check-kani-version.py and kani_get_version now read the export of a trivial run and fail when it cannot be understood. Tests hold one crate's export in both shapes and check that the answers agree; a smoke test does the same against the Kani under test.
CBMC can use all the memory of a machine, and the kill took the calling shell or agent with it. Memory limits existed only in the MCP tools (polling every two seconds), and agents run Kani from the shell. kani_run.py (scripts) and process.rs (kani-mcp) run Kani in its own systemd scope (systemd-run --user --scope -p MemoryMax=.. -p MemorySwapMax=0) where that works, so the kernel kills only that run and memory.peak and cpu.stat give its real peak and CPU time; elsewhere the process group is watched and killed above the cap (RLIMIT_AS is not used: Rust and CBMC reserve far more address space than they use). The cap is --memory-limit-mb / memory_limit_mb, else KANI_PLUGIN_MEMORY_MB, else half of the memory available to the process (the smaller of the machine's and its cgroup's limit). A stopped run writes an export (run_state KILLED or TIMEOUT, the harnesses that finished, the one that was running, elapsed time and peak); a completed run gets its peak and CPU added (plugin_run). Summaries say 'killed: memory (peak .., limit ..) after ..s'. New guarded-run.py wraps any command for agents that run Kani from the shell. run-harnesses, check-specs and evidence verify use the guard; summarize-results and kani-mcp report it.
Add -p OOMPolicy=continue to the systemd scope (scripts and kani-mcp), so the kernel kills only the largest process and the wrapper survives to read memory.peak and memory.events. Exit 137 or 143, or oom_kill > 0, now counts as 'killed: memory'. guarded-run.py no longer prints 'cpu Nones' when the CPU time is unknown.
- Add the copyright header to the export-probe fixture's Cargo.toml. - kani-mcp: name the systemd scope and kill it by name (systemctl --user kill) as well as the process group, and stop waiting for the output pipes 3 s after a kill, so a process that escaped the kill cannot hold a stopped run for its whole lifetime (kills_on_timeout took 30 s on the runner). Same in kani_run.py. - test_compat: the evidence test no longer depends on checkout mtimes (a fresh checkout is newer than the fixture's start time, which evidence.py reports with exit status 2).
…meout kani autoharness defaults to a 60 s harness timeout. On the loaded macos-15-intel runner (the smoke tests run in parallel with the memory guard test) the total_zero contract proof timed out, failed the run, and cancelled the other jobs of the matrix.
Two runs started in parallel threads could read the same counter value and name their systemd scopes alike; the second systemd-run then failed with status 1 (captures_output_and_exit_code on the CI runner).
This was referenced Nov 9, 2026
Open
wodex1nhaoIeng
pushed a commit
to wodex1nhaoIeng/kani
that referenced
this pull request
Nov 10, 2026
model-checking#5062) Resolves model-checking#4983. Part of model-checking#942 (RFC 0015, model-checking#4727). Follows model-checking#4941. ## Description RFC 0015 says an earlier `--export-json` file is replaced by an `INCOMPLETE` marker when verification begins. Without it, a run that is killed during verification leaves the earlier `COMPLETE` document in place, and that document looks current (see the [model-checking#4941 review](model-checking#4941 (comment))). - After the build and harness selection succeed, Kani builds the run context once and writes the marker with the same atomic write as the final document. After verification, the final document from the same context replaces it, so `started_at` and the other shared fields are equal in both. - The marker has the fields of the RFC presence matrix and `run_state: "INCOMPLETE"`, and no `outcome`, `wall_time_s`, `summary` or `harnesses`. - A failed marker write stops the run before any harness is verified. A build error or a rejected harness selection (a filter that matches nothing) leaves an earlier file in place. - `wall_time_s` now also covers the tool version probes and the marker write. The build is still not included. This implements the marker that the RFC proposes. The RFC's open question "marker or delete-up-front" is unchanged; the flag stays unstable. The docs and the RFC text are updated to match. Readers of the export should treat a `run_state` other than `COMPLETE` as incomplete evidence. For example, kani-mcp in model-checking#5059 deletes any earlier export before a run and reports a timeout only when no export exists. With this change, a run that stops after the marker write leaves an `INCOMPLETE` export, so the existence of the file alone does not show that verification finished. ## Testing - Unit tests: the marker's exact key set, and null metadata serialized as null; a marker and a final document from one context have equal shared fields. - `tests/json-handler/incomplete-marker` runs the real driver with a fake `cbmc` that waits for a release file. Killing the driver leaves the marker; releasing it gives a final document with the marker's `started_at`; a bad export path and a rejected `--harness` filter stop the run before CBMC verification starts. - Each of these mutations makes a test fail: the marker written after verification, the marker written before harness selection, a marker write error ignored, `summary: null` in the marker, and a recomputed `started_at`. - Full regression, `cargo clippy` and `cargo fmt --check` pass at 1b6fefa. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
This was referenced Nov 10, 2026
This branch has not been 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.
This PR adds the Kani agent plugin. The goal is to make Kani easy to try and adopt from the coding agents Rust developers already use (Kiro, Claude Code, Copilot/VS Code, Cursor, Codex). An agent can verify a property, write or improve a proof harness, run Kani, explain a counterexample, and check that a passing proof is not vacuous, without the user first learning every Kani command.
What's included
agent-plugin/skills/verify-rust/: the orchestration skill. Steps: pin down the property, check Kani is installed, write the harness, run Kani with--export-json, get a counterexample via concrete playback, check vacuity and assumptions, and report exactly what was proven, with its bounds and stubs. Detailed guidance lives inreferences/(Kani, AutoHarness, contracts, Miri, rust-analyzer, vacuity).agent-plugin/scripts/(Python 3 only, JSON output):summarize-results.py: a compact summary of an RFC 0015 export.check-vacuity.py: unreachable assertions and unsatisfiable covers.check-assumptions.py: contradictory, pinned, or success-assumingkani::assume, andrequires(false).inspect-harness.py: harness structure.check-kani-version.py: checks the installed Kani against the plugin's supported range.summarize-results.py(andkani_verify_harness) reportweakened_checks(disabled checks, raw CBMC arguments) and, per harness, the stubs andstub_verifiedcontracts the result relies on.check-specs.pychecks specs with Kani itself, in a temporary copy of the crate: is the end of each harness reachable, are contract preconditions satisfiable, does a clause constrain nothing, and is a changed precondition stronger or weaker than the baseline's. A check that cannot run is reported asunchecked, never as passing.check-proof-diff.pycompares harnesses, contracts, and code with the baseline the user approved. It flags removed assertions or covers, new assumptions, stubs,should_panic, lower unwind bounds, changed contracts, and any change to the code under verification.check-witness.pyconfirms a defect (its concrete playback witness fails) or a fix (the witness fails before the fix and passes after).evidence.pyrecords the run behind a reported result, and re-checks it later.strategy.mdreference covers when to write one harness and when to prove contracts bottom-up along the call graph, which comes from rust-analyzer's call hierarchy.tools/kani-mcp: a minimal MCP server, stdio only, with no new dependencies. It has four tools:kani_get_version,kani_list_harnesses,kani_verify_harness, andkani_get_counterexample. It shells out to the user's installed Kani. MCP is optional: the skill falls back to the CLI, which covers every feature, including AutoHarness.compatibility.jsonsays plugin 0.1.0 supports Kani >= 0.68.0, < 1.0.0; 0.68.0 is the first release with--export-json. Both the script and the MCP tool enforce this range.Testing
agent-plugin/tests/validate_plugin.pychecks manifests, skill frontmatter, and links.agent-plugin/tests/test_scripts.pyhas 65 unit tests over the existing RFC 0015 fixtures and Rust samples, and needs no Kani.cargo test -p kani-mcpruns 22 unit tests.Agent Pluginworkflow.agent-plugin execsuite inkani-regression.shruns end to end against a fixture crate with one good proof, one real overflow, and one vacuous proof. It checks:kani_verify_harnessmatchessummarize-results.py;kani-mcpover stdio by hand on sample files. The suite passes locally through compiletest on macOS.Field testing
A trial run on two real crates found one real defect in each, and a list of false results and usability problems in the scripts and MCP server. All of them are fixed in this PR:
cfg(kani), and failures caused only by stubs are reported as spurious;A second round on three crates confirmed most of those fixes and found more, now also fixed:
RUSTUP_TOOLCHAINto an installed toolchain and disables auto-install);#[kani::proof]and resolves helpers by path;A third round, on AutoHarness and coverage, added:
kani_autoharnessMCP tool (list-only mode, timeouts, partial results, automatic and manual harnesses reported separately);summarize-coverage.py, which merges source coverage across harnesses and lists the regions no harness exercises;-Z stubbing, no concrete playback) and for coverage.The latest round makes the plugin contract-first and works through a list of issues found on 87 public crates:
decreasesclauses, and AutoHarness verifying the contracts bottom-up; AutoHarness results count as evidence;kani_map_crate,kani_plan_verification,kani_update_verification_map,kani_explain_function), plusper_harnessruns and a memory limit;list-harnesses.py,run-harnesses.py(results kept as each harness finishes), andcleanup-playback.py;no_stdcrates, and evidence change detection.Not done yet
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.