fv-skills-baif 2.3.6 → 2.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +132 -364
  3. package/agents/fvs-crypto-executor.md +13 -9
  4. package/agents/fvs-executor.md +11 -1
  5. package/agents/fvs-external-modeler.md +15 -3
  6. package/agents/fvs-lean-refactorer.md +13 -4
  7. package/assets/terminal.svg +68 -0
  8. package/bin/install.js +16 -6
  9. package/commands/fvs/configure.md +8 -1
  10. package/commands/fvs/crypto-eval.md +42 -19
  11. package/commands/fvs/crypto-execute.md +38 -1
  12. package/commands/fvs/crypto-followup.md +46 -22
  13. package/commands/fvs/crypto-plan.md +46 -23
  14. package/commands/fvs/crypto-review.md +25 -3
  15. package/commands/fvs/lean-formalise.md +16 -0
  16. package/commands/fvs/lean-refactor.md +16 -1
  17. package/commands/fvs/lean-spec-review.md +8 -1
  18. package/commands/fvs/lean-specify.md +16 -0
  19. package/commands/fvs/lean-verify.md +16 -0
  20. package/commands/fvs/model-external.md +9 -1
  21. package/fv-skills/VERSION +1 -1
  22. package/fv-skills/references/aeneas-patterns.md +3 -0
  23. package/fv-skills/references/lake-build.md +186 -0
  24. package/fv-skills/references/lean-refactoring.md +2 -0
  25. package/fv-skills/references/model-profiles.md +66 -0
  26. package/fv-skills/references/review-diagnostics.md +3 -0
  27. package/fv-skills/workflows/crypto-eval.md +27 -0
  28. package/fv-skills/workflows/crypto-execute.md +37 -1
  29. package/fv-skills/workflows/crypto-followup.md +30 -2
  30. package/fv-skills/workflows/crypto-plan.md +27 -0
  31. package/fv-skills/workflows/crypto-review.md +23 -1
  32. package/fv-skills/workflows/lean-formalise.md +13 -0
  33. package/fv-skills/workflows/lean-refactor.md +15 -1
  34. package/fv-skills/workflows/lean-spec-review.md +11 -2
  35. package/fv-skills/workflows/lean-specify.md +13 -0
  36. package/fv-skills/workflows/lean-verify.md +13 -0
  37. package/fv-skills/workflows/model-external.md +39 -0
  38. package/package.json +11 -2
  39. package/pi/skills/fvs-configure/SKILL.md +8 -1
  40. package/pi/skills/fvs-crypto-eval/SKILL.md +42 -19
  41. package/pi/skills/fvs-crypto-execute/SKILL.md +38 -1
  42. package/pi/skills/fvs-crypto-followup/SKILL.md +46 -22
  43. package/pi/skills/fvs-crypto-plan/SKILL.md +46 -23
  44. package/pi/skills/fvs-crypto-review/SKILL.md +24 -2
  45. package/pi/skills/fvs-lean-formalise/SKILL.md +16 -0
  46. package/pi/skills/fvs-lean-refactor/SKILL.md +16 -1
  47. package/pi/skills/fvs-lean-spec-review/SKILL.md +7 -0
  48. package/pi/skills/fvs-lean-specify/SKILL.md +16 -0
  49. package/pi/skills/fvs-lean-verify/SKILL.md +16 -0
  50. package/pi/skills/fvs-model-external/SKILL.md +9 -1
  51. package/scripts/build-plugin.cjs +229 -3
  52. package/scripts/fvs-codex-think.mjs +182 -102
  53. package/scripts/fvs-model-review.mjs +13 -5
  54. package/scripts/fvs-spec-review.mjs +87 -18
package/CHANGELOG.md CHANGED
@@ -6,6 +6,38 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.3.7] - 2026-10-15
10
+
11
+ ### Added
12
+
13
+ - The GitHub repository has a self-contained `skills/fvs-setup` entry, so the skills CLI can
14
+ discover FVS. It explains the native installation for Pi, Claude Code, Codex, OpenCode and Gemini
15
+ and asks before running an installer. Copying it alone does not install the FVS workflows (#81).
16
+ - A practical Lake builds reference covers targeted checks, import artifacts and caches without
17
+ changing your project's toolchain or dependency pins, and credits its source talk. The Lean
18
+ writing commands load it (#79).
19
+
20
+ ### Changed
21
+
22
+ - The README is shorter and organised around installation for each runtime, the two workflows,
23
+ commands, and updates and removal (#70).
24
+ - Codex thinking stages for `/fvs:crypto-plan`, `/fvs:crypto-eval` and `/fvs:crypto-followup`
25
+ receive the full crypto-thinker role and a complete context file, run read-only, and return their
26
+ response. The parent command checks the response and writes the stage files (#63).
27
+ - Crypto stages record requested, resolved and observed model settings separately and report a real
28
+ settings mismatch instead of completing the stage. Choosing OpenCode or Gemini as a statement
29
+ reviewer now says that route is unavailable and offers Codex, Claude, a fresh Pi session or an
30
+ acknowledged other reviewer, rather than substituting one (#63).
31
+
32
+ ### Fixed
33
+
34
+ - Every Lean-writing specialist (executor, crypto executor, external modeler and Lean refactorer)
35
+ is granted lean-lsp-mcp diagnostics and goal states, and the Gemini and OpenCode conversions keep
36
+ those grants. Effective access inside each host has not been verified yet (#74).
37
+ - The README lists OpenCode's help command as `/fvs-help`, the name the installer creates.
38
+ - `npm run check:plugin`, which `npm publish` runs, no longer fails on macOS, where the default
39
+ temporary directory is reached through a symlink.
40
+
9
41
  ## [2.3.6] - 2026-09-29
10
42
 
11
43
  ### Added
package/README.md CHANGED
@@ -1,427 +1,195 @@
1
- <div align="center">
1
+ # Formal Verification Skills
2
2
 
3
- # FORMAL VERIFICATION SKILLS
4
-
5
- **Formal verification in Lean 4 with AI-assisted specification and proof — for Rust code (via Aeneas) and for maths/crypto papers. Multi-runtime.**
3
+ FVS helps AI coding assistants write Lean 4 specifications and proofs. The functional-correctness
4
+ track verifies Rust translated by Aeneas. The paper track formalises mathematics and cryptography
5
+ directly from papers. You choose the targets, review the statements and decide when proof work begins.
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/fv-skills-baif?style=for-the-badge&logo=npm&logoColor=white&color=CB3837)](https://www.npmjs.com/package/fv-skills-baif)
8
- [![License](https://img.shields.io/badge/license-MIT-blue?style=for-the-badge)](LICENSE)
9
-
10
- <br>
11
-
12
- ```bash
13
- npx fv-skills-baif
14
- ```
15
-
16
- **Works on Mac, Windows, and Linux. Supports Pi, Claude Code, Codex, OpenCode, and Gemini CLI.**
17
-
18
- <br>
8
+ [Pi package](https://pi.dev/packages/fv-skills-baif) · [MIT license](LICENSE)
19
9
 
20
10
  ![FVS Install](assets/terminal.svg)
21
11
 
22
- <br>
23
-
24
- </div>
25
-
26
- ---
27
-
28
- ## What This Is
29
-
30
- FVS encodes the expert formal verification workflow into skills for AI coding assistants. It takes Rust code through a structured pipeline — dependency analysis, deep code understanding, specification generation, and proof — using the AI to handle the tedious parts while you stay in control of the verification strategy.
31
-
32
- **FVS targets Lean 4** across two tracks. The **functional-correctness track** verifies Rust code via Aeneas (Rust → Charon → LLBC → Aeneas → Lean 4). The **paper track** formalises mathematics and crypto papers directly into Lean — no Rust source or Aeneas extraction required.
12
+ ## Getting started
33
13
 
34
- Some capabilities are framework-agnostic and work regardless of your verification target:
35
- - **Dependency mapping** builds function call graphs from any extracted code
36
- - **Verification planning** picks optimal targets using greedy graph traversal
37
- - **Natural language explanation** produces human-readable summaries of Rust functions with pre/post conditions
14
+ Run `npx fv-skills-baif` for an interactive installation, or select your runtime explicitly:
38
15
 
39
- Framework-specific commands (currently Lean) handle the actual specification and proof generation.
16
+ | Runtime | User/global install | Help after restarting the session |
17
+ |---|---|---|
18
+ | Pi | `npx fv-skills-baif --pi --global` | `/skill:fvs-help` |
19
+ | Claude Code | `npx fv-skills-baif --claude --global` | `/fvs:help` |
20
+ | Codex | `npx fv-skills-baif --codex --global` | `$fvs-help` |
21
+ | Gemini CLI | `npx fv-skills-baif --gemini --global` | `/fvs:help` |
22
+ | OpenCode | `npx fv-skills-baif --opencode --global` | `/fvs-help` |
40
23
 
41
- ---
24
+ Replace `--global` with `--local` to install for the current project. Non-Pi installs copy the
25
+ commands and support files into the runtime's configuration directory. Use
26
+ `npx fv-skills-baif --help` for custom directory options. Keep one FVS installation per runtime.
42
27
 
43
- ## Getting Started
28
+ ### Pi
44
29
 
45
- ### Pi package
46
-
47
- Use the unified installer for an updateable user install or an exact project pin:
48
-
49
- ```bash
50
- npx fv-skills-baif --pi --global
51
- npx fv-skills-baif --pi --local --pi-version 2.3.4
52
- ```
53
-
54
- Pi's default scope is user/global. The default `latest` source stays unpinned and follows Pi
55
- package updates. An exact `--pi-version X.Y.Z` source is pinned and is skipped by `pi update`. If
56
- FVS exists in the opposite scope, interactive installs offer keep, move, or cancel; scripts must pass
57
- `--pi-conflict keep|move`. When both remain, Pi's project/local package takes precedence over the
58
- user/global package.
59
-
60
- Direct Pi commands remain available:
30
+ The installer delegates to Pi's native package manager. You can also use it directly:
61
31
 
62
32
  ```bash
63
33
  pi install npm:fv-skills-baif
64
- pi install npm:fv-skills-baif@2.3.4 --local
34
+ pi install npm:fv-skills-baif --local
65
35
  pi update npm:fv-skills-baif
66
- pi remove npm:fv-skills-baif
67
- pi remove npm:fv-skills-baif --local
68
36
  ```
69
37
 
70
- To roll back, reinstall the required exact version, for example
71
- `npx fv-skills-baif --pi --global --pi-version 2.3.4`. To remove FVS through the unified installer,
72
- run `npx fv-skills-baif --pi --global --uninstall` or replace `--global` with `--local`.
38
+ Project packages require project trust and take precedence over the user installation.
39
+ The default `latest` source stays updateable. `--pi-version X.Y.Z` selects a chosen published version;
40
+ X.Y.Z is a metavariable. Exact pins are skipped by `pi update`; rollback means reinstalling a chosen
41
+ published pin. If FVS exists in the opposite scope, choose keep, move or cancel. Scripts must pass
42
+ `--pi-conflict keep` or `--pi-conflict move`. Pi owns its settings paths, so `--config-dir` does not
43
+ redirect them. See [Pi package documentation](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/packages.md).
73
44
 
74
- Start a new session, then run `/skill:fvs-help`. Bundle routers such as `/skill:fvs-fc` and
75
- `/skill:fvs-formalise`, plus member skills such as `/skill:fvs-crypto-plan`, are available directly.
45
+ ### Claude Code and Codex marketplace
76
46
 
77
- ### Plugin marketplace (Claude Code and Codex)
78
-
79
- The Beneficial AI Foundation maintains one catalog for FVS and future BAIF plugins. Add the catalog
80
- once, then install FVS from its `beneficial-ai-foundation` marketplace identity:
47
+ Install from the [BAIF catalog](https://github.com/Beneficial-AI-Foundation/plugins):
81
48
 
82
49
  ```bash
83
- # Claude Code
84
50
  claude plugin marketplace add Beneficial-AI-Foundation/plugins
85
51
  claude plugin install fvs@beneficial-ai-foundation
86
-
87
- # Codex
88
52
  codex plugin marketplace add Beneficial-AI-Foundation/plugins
89
53
  codex plugin add fvs@beneficial-ai-foundation
90
54
  ```
91
55
 
92
- Start a new session after installation. Run `/fvs:help` in Claude Code or mention `$fvs:help` in
93
- Codex.
94
-
95
- On Codex, the marketplace plugin ships the FVS agent prompts as Markdown but does not register them
96
- as Codex agent roles. When a workflow asks for an FVS specialist that Codex has not registered, FVS
97
- warns you. If the step does not depend on that specialist's settings, FVS runs a generic Codex agent
98
- with the specialist's prompt and labels its output, but Codex then does not guarantee the
99
- specialist's identity, sandbox, model, or reasoning effort. If the step does depend on them, FVS
100
- stops before starting the agent or writing files. A role registered some other way still has its
101
- settings checked at run time.
56
+ Claude's default is user scope; `--scope project` and `--scope local` select plugin scopes.
57
+ Codex has its own plugin interface; do not reuse Claude's scope flags. After restarting, use
58
+ `/fvs:help` in Claude or `$fvs:help` in Codex.
102
59
 
103
- #### Codex specialist roles
60
+ The Codex marketplace ships specialist prompts as Markdown without registering Codex agent roles.
61
+ FVS warns when a requested role is missing. A settings-independent step may use a labelled generic
62
+ agent with the full specialist prompt; its identity, sandbox, model and reasoning effort are not
63
+ guaranteed. A settings-dependent step stops before dispatch or file writes. Registered roles also
64
+ need their settings checked.
104
65
 
105
- Use one FVS installation per runtime. The npm installer installs a complete, separately managed FVS
106
- for Codex: skills as `$fvs-<name>`, scripts, hooks, a `config.toml` block, and the `fvs-*` agent
107
- roles. To get registered roles today, switch installations rather than adding a second copy:
66
+ The npm installer supplies a complete, separately managed Codex installation with roles, hooks and
67
+ configuration. To switch channels, remove the plugin first:
108
68
 
109
69
  ```bash
110
70
  codex plugin remove fvs@beneficial-ai-foundation
111
71
  npx fv-skills-baif --codex --global
112
72
  ```
113
73
 
114
- Adding or updating the marketplace plugin, including with `$fvs:update`, never registers roles or
115
- runs the npm installer.
116
-
117
- To refresh an existing install, update the catalog and then update or reinstall FVS:
118
-
119
- ```bash
120
- # Claude Code
121
- claude plugin marketplace update beneficial-ai-foundation
122
- claude plugin update fvs@beneficial-ai-foundation
123
-
124
- # Codex
125
- codex plugin marketplace upgrade beneficial-ai-foundation
126
- codex plugin add fvs@beneficial-ai-foundation
127
- ```
128
-
129
- The BAIF Git catalog is a versioned distribution source that can list multiple independently
130
- released plugins. It is separate from OpenAI's universal public Plugins Directory, which has its
131
- own per-plugin submission process.
132
-
133
- ### Unified npm installer
134
-
135
- ```bash
136
- npx fv-skills-baif
137
- ```
138
-
139
- The installer prompts you to choose:
140
- 1. **Runtime** — Pi, Claude Code, Codex, OpenCode, Gemini, or all
141
- 2. **Location** — Global (all projects) or local (current project only)
142
- 3. **Pi version** — updateable latest or an exact pinned version
143
-
144
- Pi installation delegates to Pi's native package manager; it never copies files into Pi's managed
145
- cache. `--config-dir` continues to apply to supported non-Pi runtimes and is ignored for Pi.
146
- Verify with `/skill:fvs-help` in Pi or `/fvs:help` in the other runtimes.
147
-
148
- ### Prerequisites (Lean 4 / Aeneas)
149
-
150
- - A working Lean 4 toolchain, and a Lean project with `lakefile.toml` and `lean-toolchain`
151
- - **Functional-correctness track:** Aeneas-generated Lean (`Types.lean`, `Funs.lean`). Produce it from a Rust crate with `/fvs:aeneas-extract`, or supply the output of an existing Aeneas run.
152
- - **Paper track:** no Rust or Aeneas needed — bring your paper/source material (PDF, LaTeX, images).
153
- - **Optional:** the Codex CLI, to run the crypto loop's thinking stages dual-runtime (`--codex`).
154
-
155
- ### Recommended: Lean LSP MCP Server
156
-
157
- For enhanced Lean 4 proof development with LLMs, install the [lean-lsp-mcp](https://github.com/oOo0oOo/lean-lsp-mcp) server. It provides instant goal state checking, local lemma search, and proof diagnostics without rebuilding.
158
-
159
- **Note:** Avoid using the `lean_multi_attempt` tool for formal verification tasks - FV proof states often explode in size, making multi-attempt testing prohibitively slow.
160
-
161
- ### Staying Updated
162
-
163
- For a marketplace install, invoke `/fvs:update` in Claude Code or `$fvs:update` in Codex. For an npm
164
- install, run:
165
-
166
- ```bash
167
- npx fv-skills-baif@latest
168
- ```
169
-
170
- <details>
171
- <summary><strong>Non-interactive Install (Docker, CI, Scripts)</strong></summary>
172
-
173
- ```bash
174
- # Claude Code
175
- npx fv-skills-baif --claude --global # Install to ~/.claude/
176
- npx fv-skills-baif --claude --local # Install to ./.claude/
177
-
178
- # Codex
179
- npx fv-skills-baif --codex --global # Install to ~/.codex/
180
-
181
- # OpenCode
182
- npx fv-skills-baif --opencode --global # Install to ~/.config/opencode/
74
+ Plugin updates, including `$fvs:update`, do not register roles or run the npm installer.
183
75
 
184
- # Gemini CLI
185
- npx fv-skills-baif --gemini --global # Install to ~/.gemini/
76
+ ### Before your first Lean task
186
77
 
187
- # Pi (latest is updateable; an exact version is pinned)
188
- npx fv-skills-baif --pi --global
189
- npx fv-skills-baif --pi --local --pi-version 2.3.4
78
+ Use a Lean project with `lakefile.lean` or `lakefile.toml` and its existing `lean-toolchain` pin.
79
+ For Rust verification, supply Aeneas-generated `Types.lean` and `Funs.lean`, or start with
80
+ `/fvs:aeneas-extract`. Papers need no Rust or Aeneas. NotebookLM integration via `/fvs:kb-setup` is optional.
190
81
 
191
- # All runtimes (noninteractive use fails before mutation if Pi is unavailable)
192
- npx fv-skills-baif --all --global
193
- ```
82
+ We recommend [lean-lsp-mcp](https://github.com/oOo0oOo/lean-lsp-mcp) for goal states and diagnostics.
83
+ Configure it in your chosen runtime and check that the writing agent can access it; IDE diagnostics
84
+ alone do not provide goal states. If live feedback is required but unavailable, the task stops.
85
+ Compiler-only work needs your explicit acceptance of that fallback. Project build, style and trust
86
+ checks still apply. [Practical Lake builds](fv-skills/references/lake-build.md) explains targeted
87
+ checks, import artifacts and caches without changing your project's toolchain or dependency pins.
194
88
 
195
- Use `--global` (`-g`) or `--local` (`-l`) to skip the location prompt.
196
- Use `--pi`, `--claude`, `--codex`, `--opencode`, `--gemini`, or `--all` to skip the runtime prompt.
197
- For an opposite-scope Pi install, scripts must choose `--pi-conflict keep` or
198
- `--pi-conflict move`.
89
+ FC dependency graphs use [probe-aeneas](https://github.com/Beneficial-AI-Foundation/probe-aeneas).
90
+ `/fvs:map-code` and `/fvs:fc-plan` first check your project's probe/toolchain combination and print
91
+ readable setup diagnostics, so you never need to read the compatibility data yourself. If the
92
+ combination is not verified, they offer probe setup, continuing without a graph, or cancelling.
93
+ Verified mapping writes the function inventory and progress to `.formalising/CODEMAP.md`.
94
+ Unsupported platforms or unverified probe/toolchain combinations cannot produce a verified graph.
95
+ SPQR compatibility is not supported. Tools are not installed automatically, and runtime installation
96
+ alone does not establish tool access.
199
97
 
200
- </details>
98
+ FVS asks for runtime, model and effort choices at each relevant stage. Requested settings,
99
+ resolved settings and observed settings are recorded separately; unavailable observations are stated
100
+ explicitly. Use `/fvs:configure` to save defaults. See [model profiles](fv-skills/references/model-profiles.md)
101
+ for selection rules and runtime limitations.
201
102
 
202
- ---
103
+ ## Workflows
203
104
 
204
- ## Commands
105
+ ### Functional correctness
205
106
 
206
- Commands are grouped into five bundles. Each bundle has a **router** command that lists its members and forwards to the matched skill (invoke it bare to print the routing table). All member commands are also directly typeable.
207
-
208
- ### Aeneas — `/fvs:aeneas`
209
-
210
- | Command | Description |
211
- |---------|-------------|
212
- | `/fvs:aeneas-extract` | Drive a Rust crate/folder/file through the bounded Aeneas extraction repair loop (pin audit, classify, auto-apply/bisect/gate/escalate, reversible records) |
213
- | `/fvs:model-external` | Model one lockfile/sysroot-grounded external Rust stub and its bounded dependency closure, with reversible writes and separate model/spec reviews |
214
- | `/fvs:sync-aeneas-verif` | Sync Aeneas/Charon upstream docs and reconcile the extraction blocker catalog via two specialised agents |
215
-
216
- ### Context — `/fvs:context`
217
-
218
- | Command | Description |
219
- |---------|-------------|
220
- | `/fvs:map-code` | Build function dependency graph from extracted code and Rust source |
221
-
222
- ### Formal-Core — `/fvs:fc`
223
-
224
- | Command | Description |
225
- |---------|-------------|
226
- | `/fvs:fc-plan` | Pick next verification targets via greedy dependency graph traversal |
227
- | `/fvs:model-external` | Resolve, model, review, prove, build, and trust-audit one external Rust stub plus its bounded external-stub closure |
228
- | `/fvs:lean-specify` | Generate a style-checked Lean spec skeleton with `@[step]` theorem pattern |
229
- | `/fvs:lean-spec-review` | Adversarially review an FC specification with a chosen runtime, model, and effort |
230
- | `/fvs:lean-verify` | Attempt proof with domain tactics while blocking new target-style violations |
231
- | `/fvs:natural-language` | Generate natural language explanation of module or function with pre/post conditions |
232
- | `/fvs:lean-refactor` | Refactor, simplify, and decompose verified proofs (dead code removal, simp sharpening, tactic golf) — *also in Formalise* |
233
- | `/fvs:trust-audit` | Build-backed audit of every sorry/axiom affecting a target layer; `#print axioms` classification, fail-if-unjustified gate, dependency-ordered table |
234
-
235
- `lean-specify` and `lean-verify` load a target style guide from
236
- `.formalising/fvs-config.json` (`project.style_guide_path`) or discover standard files such as
237
- `doc/STYLE_GUIDE`. With no guide they enforce a 100-column fallback. Their post-write gate also
238
- rejects ordinary Lean identifiers with three or more namespace dots, steering generated code
239
- toward scoped namespaces, `open`, and local names.
240
-
241
- After `lean-specify`, an interactive review menu resolves reviewer, exact catalog model, and
242
- model-supported effort; it never auto-selects a choice. It offers the other runtime first, a fresh
243
- reviewer in the current runtime, or another provider. Other providers use an exported source packet
244
- and imported response. One-run `Skip review` records `Unreviewed (user skipped)` and does not begin
245
- proof work. Reviews and source hashes live under `.formalising/spec-reviews/`.
246
-
247
- The reviewer stays read-only and `review.md` stays immutable. The `lean-specify` authoring seat
248
- writes separate `triage.md`. PASS proceeds; APPROVE-WITH-EDITS also proceeds after accepted bounded
249
- edits pass the structure/style/build gates, with no redundant second review. Only REVISE/BLOCKED
250
- starts another fresh review, carrying prior records as untrusted history, with a three-round cap.
251
-
252
- Automatic review works even without a config file. To disable the automatic menu, merge this
253
- setting into `.formalising/fvs-config.json` (or create that file with just this object):
254
-
255
- ```json
256
- {"spec_review": {"automatic": false}}
107
+ ```text
108
+ /fvs:natural-language → /fvs:lean-specify → automatic fresh /fvs:lean-spec-review
109
+ ↓ when you request proof work
110
+ /fvs:lean-verify → repeat
257
111
  ```
258
112
 
259
- `/fvs:lean-spec-review <spec.lean>` remains available when automation is disabled. No migration or
260
- health command is needed. Missing/authentication failures offer setup and an explicit fallback;
261
- reviewer changes are never silent. A PASS approves the statement for proof work, not the proof.
113
+ Use `/fvs:map-code` to map dependencies and `/fvs:fc-plan` to choose targets in dependency order.
114
+ The FC prover works interactively, one-sorry at a time, with reviewable Write diffs and compilation
115
+ feedback. Finish with `/fvs:lean-refactor` and `/fvs:trust-audit`.
116
+ `/fvs:model-external` handles external Rust stubs with separate model and specification reviews,
117
+ reversible writes, proof completion and a trust audit.
262
118
 
263
- `lean-specify`, `lean-verify`, and `lean-formalise` share an indexed proof-engineering store at
264
- `.formalising/proof-engineering/`. Commands read `index.md` first, load at most eight relevant
265
- lessons as delimited untrusted reference data, and reconcile at most three evidence-backed
266
- candidates after the run. Every lesson has its own Markdown file under `fc/`, `crypto/`, or
267
- `shared/`, capped at 800 words, so the memory stays searchable and reviewable instead of growing
268
- into one long note.
269
- Legacy `.formalising/PROOF-NOTES.md` content is retained as migration input. The store never keeps
270
- secrets, raw transcripts, ephemeral error dumps, unsupported guesses, or inferred preferences.
119
+ ### Papers and crypto
271
120
 
272
121
  ```text
273
- .formalising/ # Per-project FVS state
274
- ├── CODEMAP.md # Function inventory and verification status
275
- ├── proof-engineering/ # Indexed, durable proof/modeling knowledge
276
- │ ├── index.md # Read first; links and metadata only
277
- │ └── lessons/
278
- │ ├── fc/ # Functional-correctness lessons
279
- │ ├── crypto/ # Crypto proof and modeling lessons
280
- │ └── shared/ # Lessons validated across tracks
281
- └── fv-plans/ # Formalisation plans and reviews
122
+ /fvs:crypto-plan → automatic fresh /fvs:crypto-review → /fvs:crypto-execute
123
+ ↑ (when you request it)
124
+ /fvs:crypto-followup ← /fvs:crypto-eval ←────────────────────┘
125
+ └──────────── automatic fresh review before execution
282
126
  ```
283
127
 
284
- ### Formalise (Paper Track) — `/fvs:formalise`
285
-
286
- | Command | Description |
287
- |---------|-------------|
288
- | `/fvs:lean-formalise` | Formalise paper/math content into Lean 4 specs and definitions (one-shot) |
289
- | `/fvs:lean-refactor` | Refactor, simplify, and decompose verified proofs — *also in Formal-Core* |
290
- | `/fvs:crypto-plan` | Author the next bounded, runtime-neutral plan for a topic-based crypto formalisation iteration (KB-grounded, cached under `sources/`) |
291
- | `/fvs:crypto-review` | Review a crypto plan with selected Codex, Claude, or Other runtime/model/effort |
292
- | `/fvs:crypto-execute` | Run the current iteration's bounded plan under the green-build guard |
293
- | `/fvs:crypto-eval` | Adversarially evaluate the iteration; ends in one of ACCEPT / FOLLOWUP / HUMAN_RULING / BLOCKED |
294
- | `/fvs:crypto-followup` | Convert eval findings into the next follow-up plan; HALTs on HUMAN_RULING |
295
-
296
- ### Manage — `/fvs:manage`
297
-
298
- | Command | Description |
299
- |---------|-------------|
300
- | `/fvs:help` | Show available FVS commands and usage guide |
301
- | `/fvs:configure` | Configure runtime-aware subagent models, effort levels, and review defaults |
302
- | `/fvs:update` | Update FVS through the current installation channel |
303
- | `/fvs:reapply-patches` | Preserve customizations across FVS updates (patches for npm installs; fork guidance for plugin installs) |
304
- | `/fvs:kb-setup` | Set up NotebookLM knowledge base integration (venv, auth, config) |
305
-
306
- `/fvs:configure` stores concrete model IDs under the runtime and exact stage that reported them.
307
- The quality profile is role-aware: authority artifacts use the strongest detected model with max
308
- reasoning, execution/proof filling uses the executor model with xhigh, and research/eval/audit work
309
- uses a smaller model with high. Claude and Codex family preferences never cross runtimes; Pi uses
310
- provider-qualified IDs and keeps its active provider for ordinary work. Each interactive command
311
- shows one model/effort selection manifest with one-run, save, notes, and cancel paths. Missing models
312
- or unsupported efforts require a user choice; unresolved noninteractive runs fail before dispatch.
313
-
314
- ---
315
-
316
- ## How It Works
317
-
318
- ### Functional-correctness track (Rust → Lean 4)
319
-
320
- This track verifies Rust that Aeneas has lowered to Lean 4. Starting from a Rust crate, `/fvs:aeneas-extract <path>` drives it through the bounded **extraction repair loop** — pin audit → classify → auto-apply / bisect / gate / escalate → reversible records — until you reach a clean build or a documented escalation. It writes reversible source records (`src-modifications.diff` plus a derived `.json`/`.md` and `src-assumptions.md`) at the crate root and never edits generated Lean. If extraction leaves a required external stub, `/fvs:model-external <stub>` resolves its exact Cargo/vendor/rustc source, journals a reversible hand-written Lean candidate, runs separate model-fidelity and specification reviews, completes proofs, builds, and requires a CLEAN trust audit. Unsafe Rust stops; observable effects require `HUMAN_RULING`. Once required external models are complete, the verification workflow begins:
321
-
322
- ### 1. Map
323
-
324
- `/fvs:map-code` — Run probe-aeneas >= 0.19.0 to build an exact, reproducible function inventory and dependency graph. Models annotate and prioritize the canonical list but never determine its membership or count. Produces `CODEMAP.md` with every in-scope Rust function, its dependencies, and verification status.
325
-
326
- ### 2. Plan
327
-
328
- `/fvs:fc-plan` — Walk the dependency graph bottom-up to find optimal verification targets. Prioritizes leaf functions (no unverified dependencies) using greedy traversal. Performs deep Rust source analysis to reason about pre/post conditions and bounds.
329
-
330
- ### 3. Specify
331
-
332
- `/fvs:lean-specify <function>` — Generate a specification skeleton for the target function. For Lean 4: uses the `@[step] theorem fn_spec` pattern with preconditions from Rust source analysis and postconditions matching function behavior.
333
-
334
- The command reads the bounded proof-engineering index and may reviewably add one-file-per-lesson
335
- functional-correctness insights for later sessions.
336
-
337
- ### 4. Verify
128
+ `/fvs:lean-formalise` creates definitions and specification skeletons in one pass. For larger work,
129
+ the crypto loop uses a dedicated whole-unit executor. Evaluation returns ACCEPT, FOLLOWUP,
130
+ HUMAN_RULING or BLOCKED; unresolved human rulings and blockers stop the loop.
131
+ Thinking stages can explicitly use `--codex`; execution has no such flag. An unavailable requested
132
+ runtime requires a new choice rather than a silent fallback.
133
+
134
+ Both tracks use a fresh read-only reviewer and immutable review evidence. The author owns triage
135
+ and accepted edits. Approval after edits requires the prescribed checks; revision rounds are bounded.
136
+ Skipped, disabled, failed or pending review does not approve a statement or start proof/execution.
137
+ You can opt out of automatic review and explicitly request trusted-path work while retaining its
138
+ unreviewed status. See [review policy](fv-skills/references/review-policy.md),
139
+ [FC statement review](fv-skills/references/fc-spec-review.md) and
140
+ [crypto plan review](fv-skills/references/crypto-plan-review.md).
141
+
142
+ The learning store lives in `.formalising/proof-engineering/`. Commands read `index.md` first,
143
+ load at most eight relevant lessons from `lessons/` (`fc/`, `crypto/`, `shared/`) as untrusted data,
144
+ and propose at most three evidence-backed updates. Fresh crypto review remains memory-blind.
145
+ [Learning-store details](fv-skills/references/proof-engineering-loop.md).
338
146
 
339
- `/fvs:lean-verify <function>` — Attempt to prove the specification. For Lean 4: uses domain-specific tactics (`step`, `simp`, `ring`, `field_simp`, `omega`). Reports proof status and remaining goals if incomplete.
340
-
341
- The proof loop loads a bounded selection from `.formalising/proof-engineering/` before research and
342
- can reviewably retain green-build patterns or lessons evidenced by actual Lean diagnostics.
343
-
344
- ### 5. Simplify
345
-
346
- `/fvs:lean-refactor <spec_path>` — Refactor, simplify, and decompose verified proofs. Applies tiered heuristics (dead code removal, simp sharpening, tactic golf, smart automation) while verifying compilation after every change. Three modes: safe, balanced (default), and aggressive.
347
-
348
- ### 6. Audit
349
-
350
- `/fvs:trust-audit <target>` — Build-backed audit of the trust surface. It target-filters the same canonical probe-aeneas inventory, then uses `#print axioms` to classify every supplied function as verified / `sorry` / axiom / uninspectable. The classical trio (`propext`, `Classical.choice`, `Quot.sound`) is auto-noted as Lean/Mathlib-standard; any project-custom axiom, sorry, or uninspectable entry keeps the gate NOT-CLEAN. Produces a re-runnable, dependency-ordered table under `.formalising/audits/`.
351
-
352
- ### The paper track (maths / crypto)
353
-
354
- The paper track formalises papers directly into Lean 4 — no Rust, no Aeneas. Two entry points:
355
-
356
- - **One-shot:** `/fvs:lean-formalise` reads your PDFs / images / LaTeX (optionally grounded in a NotebookLM knowledge base via `/fvs:kb-setup`) and produces Lean definition and spec files in a single pass.
357
- - **Iterative crypto loop:** for larger crypto formalisations, a topic-based, restartable loop with
358
- a fresh pre-execution review gate:
359
-
360
- `/fvs:crypto-plan` → `/fvs:crypto-review` → `/fvs:crypto-execute` → `/fvs:crypto-eval` → `/fvs:crypto-followup` → `/fvs:crypto-review` → repeat
361
-
362
- A high-effort thinker authors each bounded plan. Before execution, a selected Codex, Claude, or
363
- Other fresh reviewer attacks the plan or follow-up under read-only controls and returns an
364
- evidence-backed APPROVE / APPROVE-WITH-EDITS / REJECT verdict. The executor runs an approved plan
365
- under a green-build guard; the post-execution adversarial eval tries to refute the spec, proof,
366
- and assumptions and ends in exactly one of ACCEPT / FOLLOWUP / HUMAN_RULING / BLOCKED. Follow-up
367
- turns findings into the next plan (halting for a human modeling ruling) and is reviewed again
368
- before execution.
147
+ ## Commands
369
148
 
370
- The authoring, execution, eval, and follow-up stages use the lightweight proof-engineering overlay:
371
- they load at most eight relevant `crypto`/`shared` lessons and propose at most three reviewed
372
- updates. Modeling lessons require paper or standard citations and remain provisional until an
373
- accepted adversarial eval or explicit human ruling. The `crypto-review` gate is deliberately
374
- memory-blind. It labels cross-runtime, same-runtime fresh reviewer, and unverified provenance;
375
- Other uses packet export/import. APPROVE-WITH-EDITS becomes terminal after the authoring seat
376
- applies accepted edits and reruns gates, with no second review. REJECT starts a fresh reviewed
377
- revision with prior history, capped at three reviewer rounds per invocation. Automatic plan and
378
- follow-up handoff asks reviewer -> model -> effort and never auto-selects. One-run `Skip review`
379
- records `Unreviewed (user skipped)` and never starts execution. To opt out persistently, merge
380
- `"crypto_review": {"automatic": false}` into `.formalising/fvs-config.json`; standalone review
381
- and explicit trusted-path execution remain available without fabricating approval.
149
+ The table uses Claude command notation. Use the help entry for your channel to find its spelling
150
+ and arguments. Bundle routers list their members when invoked without arguments.
151
+ [Full command help](commands/fvs/help.md).
382
152
 
383
- **Single- vs dual-runtime (`--codex`).** By default the loop is single-runtime — the thinking stages (`crypto-plan`, `crypto-eval`, `crypto-followup`) run the in-runtime `fvs-crypto-thinker`. Pass `--codex` to hand a stage's thinking to an independent **Codex CLI** thinker instead, so the adversarial planner/evaluator runs on a *different engine* than the executor and blind spots don't correlate. `crypto-execute` is the runtime-neutral executor and takes no `--codex`. Without the Codex CLI installed, a `--codex` stage stops with an install hint rather than silently falling back.
153
+ | Bundle | Members |
154
+ |---|---|
155
+ | `/fvs:aeneas` | `/fvs:aeneas-extract`, `/fvs:model-external`, `/fvs:sync-aeneas-verif` |
156
+ | `/fvs:context` | `/fvs:map-code` |
157
+ | `/fvs:fc` | `/fvs:fc-plan`, `/fvs:natural-language`, `/fvs:lean-specify`, `/fvs:lean-spec-review`, `/fvs:lean-verify`, `/fvs:lean-refactor`, `/fvs:model-external`, `/fvs:trust-audit` |
158
+ | `/fvs:formalise` | `/fvs:lean-formalise`, `/fvs:lean-refactor`, `/fvs:crypto-plan`, `/fvs:crypto-review`, `/fvs:crypto-execute`, `/fvs:crypto-eval`, `/fvs:crypto-followup` |
159
+ | `/fvs:manage` | `/fvs:help`, `/fvs:configure`, `/fvs:update`, `/fvs:reapply-patches`, `/fvs:kb-setup` |
384
160
 
385
- ---
161
+ ## Updates and removal
386
162
 
387
- ## Uninstalling
163
+ Use your channel's FVS update command, or rerun the npm installer with `fv-skills-baif@latest` and
164
+ the same runtime/scope flags. `/fvs:reapply-patches` helps retain local customizations.
165
+ For marketplace updates:
388
166
 
389
167
  ```bash
390
- # Global
391
- npx fv-skills-baif --claude --global --uninstall
392
- npx fv-skills-baif --opencode --global --uninstall
393
-
394
- # Local (current project)
395
- npx fv-skills-baif --claude --local --uninstall
168
+ claude plugin marketplace update beneficial-ai-foundation
169
+ claude plugin update fvs@beneficial-ai-foundation
170
+ codex plugin marketplace upgrade beneficial-ai-foundation
171
+ codex plugin add fvs@beneficial-ai-foundation
396
172
  ```
397
173
 
398
- Removes all FVS commands, agents, hooks, and settings entries. Does not affect other installed tools.
399
-
400
- ---
401
-
402
- ## Acknowledgements
403
-
404
- FVS builds on the work of several open-source projects:
405
-
406
- - **[Aeneas](https://github.com/AeneasVerif/aeneas)** -- FVS incorporates and adapts
407
- documentation and proof skills from the Aeneas verification framework (Apache 2.0).
408
- The upstream Aeneas documentation is stored in `fv-skills/upstream/aeneas/` and can
409
- be synced with `/fvs:sync-aeneas-verif`.
410
-
411
- - **[GSD (Get Shit Done)](https://github.com/gsd-build/get-shit-done)** -- FVS follows
412
- the GSD plugin architecture for Claude Code skill distribution (MIT).
413
-
414
- - **[lean-lsp-mcp](https://github.com/oOo0oOo/lean-lsp-mcp)** -- MCP server for Lean
415
- LSP integration, referenced in proof workflows (MIT).
416
-
417
- Individual contributions:
174
+ Remove an npm installation with the same runtime/scope and `--uninstall`, for example
175
+ `npx fv-skills-baif --claude --local --uninstall`. For Pi, use `pi remove npm:fv-skills-baif`
176
+ for the user installation or `pi remove npm:fv-skills-baif --local` for the project. Unified Pi removal
177
+ also supports `npx fv-skills-baif --pi --global --uninstall` (or `--local`). Remove a marketplace
178
+ installation with its host's `plugin remove fvs@beneficial-ai-foundation` command.
418
179
 
419
- - **[Jin Xing Lim](https://github.com/jinxinglim)** -- proposed gating a crypto formalisation
420
- plan on an independent second-runtime adversarial review before execution, and wrote the
421
- reviewer prompt that `/fvs:crypto-review` (v2.1.0) is modelled on.
180
+ If you use the skills CLI, set both `DISABLE_TELEMETRY=1` and `DO_NOT_TRACK=1` before invoking it.
181
+ Later setup consent cannot cover earlier analytics. The opt-out also disables the CLI's external
182
+ audit lookup, so retain independent source and integrity checks. See the [skills CLI FAQ](https://www.skills.sh/docs/faq)
183
+ and [privacy policy](https://vercel.com/legal/privacy-policy). The `fvs-setup` entry provides native
184
+ installation guidance; copying it alone does not install the full FVS workflows.
422
185
 
423
- ---
186
+ ## Credits and license
424
187
 
425
- ## License
188
+ FVS adapts documentation and proof skills from [Aeneas](https://github.com/AeneasVerif/aeneas)
189
+ (Apache 2.0; [retained upstream documentation](fv-skills/upstream/aeneas/)). Its distribution
190
+ architecture follows [GSD Core](https://github.com/open-gsd/gsd-core). We also use
191
+ [probe-aeneas](https://github.com/Beneficial-AI-Foundation/probe-aeneas) and recommend
192
+ [lean-lsp-mcp](https://github.com/oOo0oOo/lean-lsp-mcp). The Lake reference credits its source talk.
193
+ [Jin Xing Lim](https://github.com/jinxinglim) proposed independent crypto-plan review and its reviewer prompt.
426
194
 
427
- MIT License. See [LICENSE](LICENSE) for details.
195
+ MIT. See [LICENSE](LICENSE).