fv-skills-baif 2.3.4 → 2.3.6

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 (69) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +65 -11
  3. package/agents/fvs-crypto-executor.md +8 -13
  4. package/agents/fvs-crypto-thinker.md +4 -5
  5. package/agents/fvs-doc-syncer.md +37 -27
  6. package/agents/fvs-external-modeler.md +124 -0
  7. package/bin/install.js +433 -45
  8. package/commands/fvs/aeneas.md +2 -1
  9. package/commands/fvs/configure.md +20 -5
  10. package/commands/fvs/crypto-eval.md +6 -2
  11. package/commands/fvs/crypto-execute.md +5 -2
  12. package/commands/fvs/crypto-followup.md +6 -3
  13. package/commands/fvs/crypto-plan.md +8 -5
  14. package/commands/fvs/crypto-review.md +14 -0
  15. package/commands/fvs/fc-plan.md +108 -23
  16. package/commands/fvs/fc.md +2 -1
  17. package/commands/fvs/help.md +34 -13
  18. package/commands/fvs/map-code.md +96 -21
  19. package/commands/fvs/model-external.md +48 -0
  20. package/commands/fvs/sync-aeneas-verif.md +62 -37
  21. package/commands/fvs/trust-audit.md +90 -13
  22. package/fv-skills/VERSION +1 -1
  23. package/fv-skills/references/aeneas-patterns.md +27 -20
  24. package/fv-skills/references/blocker-catalog.md +23 -23
  25. package/fv-skills/references/external-modeling.md +127 -0
  26. package/fv-skills/references/model-profiles.md +25 -3
  27. package/fv-skills/references/proof-strategies.md +26 -0
  28. package/fv-skills/references/review-grounding.md +26 -2
  29. package/fv-skills/references/tactic-usage.md +38 -14
  30. package/fv-skills/templates/config.json +1 -0
  31. package/fv-skills/upstream/aeneas/_sync-meta.json +246 -10
  32. package/fv-skills/upstream/aeneas/aeneas-lean-core.instructions.md +97 -1114
  33. package/fv-skills/upstream/aeneas/aeneas-tactics-quickref.instructions.md +31 -164
  34. package/fv-skills/upstream/aeneas/extraction/documentation/emit-json.md +68 -0
  35. package/fv-skills/upstream/aeneas/extraction/documentation/skills/verification-campaigns.instructions.md +86 -0
  36. package/fv-skills/upstream/aeneas/launching-proof-agents.instructions.md +45 -6
  37. package/fv-skills/workflows/crypto-eval.md +6 -2
  38. package/fv-skills/workflows/crypto-execute.md +5 -2
  39. package/fv-skills/workflows/crypto-followup.md +6 -2
  40. package/fv-skills/workflows/crypto-plan.md +5 -2
  41. package/fv-skills/workflows/crypto-review.md +11 -1
  42. package/fv-skills/workflows/fc-plan.md +105 -13
  43. package/fv-skills/workflows/lean-spec-review.md +13 -0
  44. package/fv-skills/workflows/map-code.md +91 -11
  45. package/fv-skills/workflows/model-external.md +147 -0
  46. package/fv-skills/workflows/sync-aeneas-verif.md +56 -35
  47. package/fv-skills/workflows/trust-audit.md +91 -7
  48. package/package.json +1 -1
  49. package/pi/skills/fvs-aeneas/SKILL.md +1 -0
  50. package/pi/skills/fvs-configure/SKILL.md +20 -5
  51. package/pi/skills/fvs-crypto-eval/SKILL.md +6 -2
  52. package/pi/skills/fvs-crypto-execute/SKILL.md +5 -2
  53. package/pi/skills/fvs-crypto-followup/SKILL.md +6 -3
  54. package/pi/skills/fvs-crypto-plan/SKILL.md +8 -5
  55. package/pi/skills/fvs-crypto-review/SKILL.md +14 -0
  56. package/pi/skills/fvs-fc/SKILL.md +1 -0
  57. package/pi/skills/fvs-fc-plan/SKILL.md +107 -23
  58. package/pi/skills/fvs-help/SKILL.md +34 -13
  59. package/pi/skills/fvs-map-code/SKILL.md +95 -21
  60. package/pi/skills/fvs-model-external/SKILL.md +47 -0
  61. package/pi/skills/fvs-sync-aeneas-verif/SKILL.md +62 -37
  62. package/pi/skills/fvs-trust-audit/SKILL.md +90 -13
  63. package/scripts/build-plugin.cjs +2 -0
  64. package/scripts/fvs-codex-think.mjs +38 -18
  65. package/scripts/fvs-model-external.mjs +540 -0
  66. package/scripts/fvs-model-review.mjs +229 -0
  67. package/scripts/fvs-probe-inventory.mjs +978 -12
  68. package/scripts/fvs-review-grounding.mjs +60 -14
  69. package/scripts/fvs-spec-review.mjs +204 -49
package/CHANGELOG.md CHANGED
@@ -6,6 +6,59 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.3.6] - 2026-09-29
10
+
11
+ ### Added
12
+
13
+ - `/fvs:map-code`, `/fvs:fc-plan`, and `/fvs:trust-audit` first check whether the project has a
14
+ verified probe-aeneas: its Aeneas, Charon, and Lean versions must match a tested combination and
15
+ every helper must report the tested version. On macOS arm64, FVS can install the pinned official
16
+ probe-aeneas v0.20.0 into its own versioned directory after you agree, and it runs extraction in
17
+ a sandbox with no network access and no writes outside the project's build directories, the
18
+ output, and a private temporary directory. Without a verified probe you can set it up, continue
19
+ without a graph (qualitative notes only, no counts or verdicts), or cancel. Linux support is
20
+ tracked in #77 (#69).
21
+ - Crypto and Lean specification reviews report how many grounding signature lines they charge and
22
+ the first reference that exceeds the budget. A read-only `preflight` checks a request without
23
+ contacting a reviewer (#73).
24
+ - In Codex marketplace installs, a workflow that requests an unregistered FVS specialist now warns.
25
+ It then runs a labeled generic agent, or stops before dispatch when the step depends on the
26
+ specialist's settings. The README explains how to switch to the direct Codex installation, which
27
+ registers the specialist roles (#71).
28
+
29
+ ### Fixed
30
+
31
+ - Completed Claude and Codex reviews are no longer rejected when the reviewer writes one plain
32
+ progress sentence before the required title (#72).
33
+ - Native reviewers run in their own process group with a 20-minute review deadline and a 30-second
34
+ version and authentication deadline (`FVS_REVIEW_TIMEOUT_MS`, `FVS_REVIEW_AUTH_TIMEOUT_MS`). On
35
+ timeout or interruption FVS stops the whole group, including descendants. Cleanup is tested on
36
+ macOS and Linux; Windows refuses to launch native reviewers (#75).
37
+ - When its sync metadata is missing, `/fvs:sync-aeneas-verif` points only to `/fvs:update`, which
38
+ updates the installation you already have, and no longer suggests the npm installer.
39
+
40
+ ## [2.3.5] - 2026-09-21
41
+
42
+ ### Added
43
+
44
+ - `/fvs:model-external` resolves one external Rust stub and its bounded dependency closure from
45
+ locked registry, git, vendor, or rustc sysroot source. Candidate changes are reversible and must
46
+ pass separate model-fidelity and specification reviews, completed proofs, a guarded build, and a
47
+ clean trust audit (#33).
48
+ - The unified npm installer now installs and removes FVS through Pi's native package manager. It
49
+ supports updateable or exact versions, user and project scopes, explicit conflict handling,
50
+ Pi-first mixed-runtime preflight and installation, and matching Pi installation guidance (#67,
51
+ #68).
52
+
53
+ ### Fixed
54
+
55
+ - Aeneas guidance synchronization now uses frozen upstream revisions, hash-verified snapshots,
56
+ proposal-before-write review, blocker reconciliation, and project-scoped `native_decide` policy
57
+ without weakening generated-file boundaries (#57).
58
+ - Crypto workflows no longer depend on functional-correctness executor names, Aeneas analogies, or
59
+ obsolete sorry-grind assumptions. The dedicated crypto executor and fail-closed bridge boundary
60
+ remain explicit (#65).
61
+
9
62
  ## [2.3.4] - 2026-09-20
10
63
 
11
64
  ### Fixed
package/README.md CHANGED
@@ -44,15 +44,35 @@ Framework-specific commands (currently Lean) handle the actual specification and
44
44
 
45
45
  ### Pi package
46
46
 
47
- Install FVS directly from npm as a Pi package:
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:
48
61
 
49
62
  ```bash
50
63
  pi install npm:fv-skills-baif
64
+ pi install npm:fv-skills-baif@2.3.4 --local
65
+ pi update npm:fv-skills-baif
66
+ pi remove npm:fv-skills-baif
67
+ pi remove npm:fv-skills-baif --local
51
68
  ```
52
69
 
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`.
73
+
53
74
  Start a new session, then run `/skill:fvs-help`. Bundle routers such as `/skill:fvs-fc` and
54
75
  `/skill:fvs-formalise`, plus member skills such as `/skill:fvs-crypto-plan`, are available directly.
55
- Update an unpinned install with `pi update npm:fv-skills-baif`.
56
76
 
57
77
  ### Plugin marketplace (Claude Code and Codex)
58
78
 
@@ -70,7 +90,31 @@ codex plugin add fvs@beneficial-ai-foundation
70
90
  ```
71
91
 
72
92
  Start a new session after installation. Run `/fvs:help` in Claude Code or mention `$fvs:help` in
73
- Codex. To refresh an existing install, update the catalog and then update or reinstall FVS:
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.
102
+
103
+ #### Codex specialist roles
104
+
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:
108
+
109
+ ```bash
110
+ codex plugin remove fvs@beneficial-ai-foundation
111
+ npx fv-skills-baif --codex --global
112
+ ```
113
+
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:
74
118
 
75
119
  ```bash
76
120
  # Claude Code
@@ -86,18 +130,20 @@ The BAIF Git catalog is a versioned distribution source that can list multiple i
86
130
  released plugins. It is separate from OpenAI's universal public Plugins Directory, which has its
87
131
  own per-plugin submission process.
88
132
 
89
- ### npm installer (Claude Code, Codex, OpenCode, and Gemini)
133
+ ### Unified npm installer
90
134
 
91
135
  ```bash
92
136
  npx fv-skills-baif
93
137
  ```
94
138
 
95
139
  The installer prompts you to choose:
96
- 1. **Runtime** — Claude Code, OpenCode, Gemini, or all
140
+ 1. **Runtime** — Pi, Claude Code, Codex, OpenCode, Gemini, or all
97
141
  2. **Location** — Global (all projects) or local (current project only)
142
+ 3. **Pi version** — updateable latest or an exact pinned version
98
143
 
99
- Verify with `/fvs:help` inside your chosen runtime. The npm installer remains the distribution path
100
- for OpenCode and Gemini CLI, and is also available for Claude Code and Codex.
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.
101
147
 
102
148
  ### Prerequisites (Lean 4 / Aeneas)
103
149
 
@@ -138,12 +184,18 @@ npx fv-skills-baif --opencode --global # Install to ~/.config/opencode/
138
184
  # Gemini CLI
139
185
  npx fv-skills-baif --gemini --global # Install to ~/.gemini/
140
186
 
141
- # All runtimes
142
- npx fv-skills-baif --all --global # Install to all directories
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
190
+
191
+ # All runtimes (noninteractive use fails before mutation if Pi is unavailable)
192
+ npx fv-skills-baif --all --global
143
193
  ```
144
194
 
145
195
  Use `--global` (`-g`) or `--local` (`-l`) to skip the location prompt.
146
- Use `--claude`, `--codex`, `--opencode`, `--gemini`, or `--all` to skip the runtime 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`.
147
199
 
148
200
  </details>
149
201
 
@@ -158,6 +210,7 @@ Commands are grouped into five bundles. Each bundle has a **router** command tha
158
210
  | Command | Description |
159
211
  |---------|-------------|
160
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 |
161
214
  | `/fvs:sync-aeneas-verif` | Sync Aeneas/Charon upstream docs and reconcile the extraction blocker catalog via two specialised agents |
162
215
 
163
216
  ### Context — `/fvs:context`
@@ -171,6 +224,7 @@ Commands are grouped into five bundles. Each bundle has a **router** command tha
171
224
  | Command | Description |
172
225
  |---------|-------------|
173
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 |
174
228
  | `/fvs:lean-specify` | Generate a style-checked Lean spec skeleton with `@[step]` theorem pattern |
175
229
  | `/fvs:lean-spec-review` | Adversarially review an FC specification with a chosen runtime, model, and effort |
176
230
  | `/fvs:lean-verify` | Attempt proof with domain tactics while blocking new target-style violations |
@@ -263,7 +317,7 @@ or unsupported efforts require a user choice; unresolved noninteractive runs fai
263
317
 
264
318
  ### Functional-correctness track (Rust → Lean 4)
265
319
 
266
- 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. Once you have `Types.lean` / `Funs.lean`, the five-stage verification workflow begins:
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:
267
321
 
268
322
  ### 1. Map
269
323
 
@@ -11,11 +11,9 @@ bounded, fully-specified plan authored by the crypto thinker and INLINED into yo
11
11
  is to IMPLEMENT that plan end to end: write the new spec/definition file, complete its proofs, and
12
12
  return a structured report. You are write-capable — you own the deliverable file.
13
13
 
14
- You are NOT a proof-attempt pair-programmer. Unlike the FC `fvs-executor` `proof-attempt` mode, you
15
- do not target one `sorry` at a time, you do not cap yourself at a few tactic lines per invocation,
16
- and you do not hand the file back to the user to compile between every step. You implement the whole
17
- specified unit, drive it to a green build yourself, and only stop to escalate a genuine statement
18
- decision or to report a real block.
14
+ You own the whole specified unit. Implement it end to end, use diagnostics between meaningful edits,
15
+ drive it to a green build yourself, and only stop to escalate a genuine statement decision or report
16
+ a real block.
19
17
 
20
18
  CRITICAL: All file writes MUST use the Write tool. Never use Bash to write files. Every change is
21
19
  presented as a VS Code diff for user approval.
@@ -74,20 +72,17 @@ Write your run report to `IMPLEMENTATION_nN.md` (where `nN` is the iteration the
74
72
  capturing what you implemented, the final build state, any authorised `sorry` obligations with their
75
73
  statements, and any escalation/block.
76
74
 
77
- **Anti-pattern this agent rejects (the FC lean-verify sorry-grind — stays FC-only):** no
78
- one-`sorry`-at-a-time targeting; no ≤3-line-per-invocation tactic cap; no
79
- user-compiles-between-steps pair-programming. That discipline belongs to the FC `fvs-executor`
80
- `proof-attempt` mode and must not leak into the crypto loop.
75
+ Work at whole-unit granularity; diagnostics are checkpoints between meaningful edits, not a reason to
76
+ hand each goal back to the user.
81
77
 
82
78
  </process>
83
79
 
84
80
  <fvs_hard_rules>
85
81
  - NEVER run a bare `lake build` -- always `LEAN_NUM_THREADS="${LEAN_NUM_THREADS:-4}" nice -n 19 lake build` with the `set -o pipefail` / `${PIPESTATUS` guard so a piped build failure is never masked.
86
- - NEVER edit generated Lean (`Types.lean` / `Funs.lean`).
82
+ - Bridge boundary -- only when the plan explicitly declares implementation/model bridging: generated `Funs.lean`, `Types.lean`, and templates remain immutable inputs; write authority is limited to exact, plan-named, hand-written model, representation-map, contract/specification, bridge, correctness, `_toModel`, or `FunsExternal.lean` paths. Project markers never grant write authority.
87
83
  - All writes MUST use the Write tool -- never echo, cat, or Bash redirection. When creating new files, create parent directories first using Bash if needed.
88
84
  - Escalate, do not overrule: never change an immutable public statement to force a proof through -- HALT and ask, then record the approved before/after.
89
85
  - NEVER call `gh` to open or create any upstream artifact.
90
- - This is a Lean-via-Aeneas pipeline only -- no other-framework verification paths.
91
86
  </fvs_hard_rules>
92
87
 
93
88
  <return_format>
@@ -133,9 +128,9 @@ When genuinely stuck:
133
128
  - [ ] Kernel-checked signatures, then completed proofs using `mcp__ide__getDiagnostics` for in-loop goal/diagnostic feedback
134
129
  - [ ] Ran `LEAN_NUM_THREADS="${LEAN_NUM_THREADS:-4}" nice -n 19 lake build` as the style authority and self-fixed mechanical + style fallout (expecting style warnings that surface only at build time, not in isolation checks)
135
130
  - [ ] Escalated (never overruled) any immutable-public-statement change; handed back BLOCKED when genuinely stuck
136
- - [ ] Did NOT use the one-`sorry` / ≤3-line / user-compiles-between-steps proof-attempt grind
131
+ - [ ] Worked the whole unit, using diagnostics between meaningful edits rather than handing each goal back
137
132
  - [ ] Wrote the run report to `IMPLEMENTATION_nN.md` and returned with a ## IMPLEMENTATION COMPLETE / ## ESCALATE / ## BLOCKED header
138
- - [ ] All writes via the Write tool; no bare `lake build`; no generated-Lean edits; no `gh` auto-open; Lean-via-Aeneas pipeline only; no @-references
133
+ - [ ] All writes via the Write tool; no bare `lake build`; no `gh` auto-open; bridge boundary preserved when explicitly planned; no @-references
139
134
  </success_criteria>
140
135
  </content>
141
136
  </invoke>
@@ -8,8 +8,8 @@ color: purple
8
8
  <role>
9
9
  You are the FVS crypto formalisation thinker. You are the high-effort author of the loop: in plan and
10
10
  follow-up modes you derive bounded work independently from the branch state and paper-grounded
11
- sources, then return your reasoning as text. You are NOT the executor -- a separate
12
- `fvs-executor`-style agent in the current runtime runs the plans you author. You author; they execute.
11
+ sources, then return your reasoning as text. You are NOT the executor -- the separate
12
+ `fvs-crypto-executor` runs the plans you author. You author; it executes.
13
13
 
14
14
  Planning is ALWAYS high reasoning effort -- you never produce a sketch and call it a plan. Eval mode
15
15
  is adversarial about landed statements, modeling assumptions, source fidelity, and trust boundaries;
@@ -127,11 +127,10 @@ resolve without the human).
127
127
 
128
128
  <fvs_hard_rules>
129
129
  - NEVER run a bare `lake build` -- always `LEAN_NUM_THREADS="${LEAN_NUM_THREADS:-4}" nice -n 19 lake build` with the `set -o pipefail` / `${PIPESTATUS` guard so a piped build failure is never masked.
130
- - NEVER edit generated Lean (`Types.lean` / `Funs.lean`).
130
+ - Bridge boundary -- only when the plan explicitly declares implementation/model bridging: generated `Funs.lean`, `Types.lean`, and templates remain immutable inputs; write authority is limited to exact, plan-named, hand-written model, representation-map, contract/specification, bridge, correctness, `_toModel`, or `FunsExternal.lean` paths. Project markers never grant write authority.
131
131
  - Author-by-return: never write or modify a project file -- you RETURN the plan/eval/followup as text; the command body persists it under `fv-plans/<topic>/`.
132
132
  - On an `HUMAN_RULING`, HALT and ask -- never fabricate a plan that silently makes the modeling decision.
133
133
  - NEVER call `gh` to open or create any upstream artifact.
134
- - This is a Lean-via-Aeneas pipeline only -- no other-framework verification paths.
135
134
  </fvs_hard_rules>
136
135
 
137
136
  <return_format>
@@ -171,7 +170,7 @@ On HALT / failure:
171
170
  - [ ] In `plan`/`followup` mode, authored a bounded, runtime-neutral plan stating branch/state, exact target files+theorems, immutable public statements, old->new API map (if a port), allowed-`sorry` policy, stop conditions, `LEAN_NUM_THREADS="${LEAN_NUM_THREADS:-4}" nice -n 19 lake build` verification, and expected artifact updates
172
171
  - [ ] In `eval` mode, trusted kernel-checked proof terms, challenged statement/source conformance and trust boundaries, reused current build evidence or ran one guarded fallback without retry, and ended in exactly one of ACCEPT | FOLLOWUP | HUMAN_RULING | BLOCKED
173
172
  - [ ] On `HUMAN_RULING`, HALTed and asked for the modeling decision -- never fabricated a plan
174
- - [ ] Author-by-return: no project file written or modified; no `gh` auto-open; Lean-via-Aeneas pipeline only; no bare `lake build`
173
+ - [ ] Author-by-return: no project file written or modified; no `gh` auto-open; no bare `lake build`; bridge boundary preserved when explicitly planned
175
174
  - [ ] Result returned with the ## PLAN COMPLETE / ## EVAL COMPLETE / ## ERROR header
176
175
  - [ ] No @-references used (all context inlined by the parent)
177
176
  </success_criteria>
@@ -16,9 +16,11 @@ skips each one. You never overwrite a reference wholesale and never blind-append
16
16
  -- you RECONCILE (update in place, preserving FVS-specific additions). All writes use the Write/Edit
17
17
  tool.
18
18
 
19
- You are dispatched by the sync command, which inlines the mapping table, the upstream source paths,
20
- and the reference content you need. You do NOT use @-references -- the parent inlines all reference
21
- content.
19
+ You are dispatched by the sync command, which inlines the mapping table, exact
20
+ `extraction_inputs`/`snapshot_target` rows, the frozen revision manifest, and the reference content
21
+ you need. You do NOT use @-references -- the parent inlines all reference content. Reject a run
22
+ without `FROZEN_AENEAS_SHA`, `FROZEN_AENEAS_DATE`, `FROZEN_CHARON_PIN`, and
23
+ `FROZEN_CHARON_MAIN_SHA`; never substitute a moving branch or clone `HEAD`.
22
24
  </role>
23
25
 
24
26
  <process>
@@ -29,35 +31,37 @@ The parent provides a `<sync_mode>` tag. Execute the matching mode.
29
31
  **Scope:** the tactic/Lean-syntax doc sync -- the `_sync-meta.json` mapping plus the
30
32
  `tactic_renames` table.
31
33
 
32
- 1. Read the inlined mapping table and the current snapshot SHA.
33
- 2. For each mapped upstream file, fetch the latest content (gh api READ primary, curl fallback;
34
- `.instructions.md` files live under `documentation/skills/`, other `.md` under `documentation/`).
34
+ 1. Read the inlined mapping, current snapshots, and frozen revision manifest.
35
+ 2. Fetch every mapped Aeneas source at exactly `FROZEN_AENEAS_SHA`. A local clone is usable only
36
+ when it contains that commit; otherwise use read-only `gh api` / `curl` at the frozen SHA.
35
37
  3. Compute a SECTION-LEVEL diff: split each file by `## ` headings, hash each section's content
36
38
  (whitespace-normalized), and identify sections added / removed / modified -- not a byte diff.
37
- 4. Map changed sections to FVS targets via the mapping table's `merge_strategy`
38
- (`enrich` = add alongside, preserving FVS additions; `replace_section` = replace the mapped
39
- sections; `defer` = skip, no FVS target).
40
- 5. Check the `tactic_renames` table against fetched content; propose any new old->new rename and,
41
- on approval, grep `fv-skills/ commands/ agents/` and update, then add the rename to the table.
42
- 6. Propose EACH change individually (show current vs proposed, ask yes / skip / edit). On approval,
43
- apply via Edit. Update the snapshot files and `_sync-meta.json` (`snapshot_date`,
44
- `snapshot_commit`, any new renames) at the end.
39
+ 4. Map changed sections to FVS targets via `merge_strategy` (`enrich` = add alongside, preserving
40
+ FVS additions; `replace_section` = replace mapped sections; `defer` = no derived write).
41
+ 5. Check `tactic_renames`; propose any new old->new rename and, on approval, grep
42
+ `fv-skills/ commands/ agents/` and update before adding the rename.
43
+ 6. PROPOSE each snapshot and derived change individually (current vs proposed, yes / skip / edit).
44
+ Write only approved changes. Verify approved snapshots and derived targets. Do not update
45
+ `_sync-meta.json` in this mode; return verified hashes and proposed metadata to the parent.
45
46
  </mode>
46
47
 
47
48
  <mode name="extraction-docs">
48
49
  **Scope:** the Charon/Aeneas EXTRACTION docs plus the blocker-catalog reconcile.
49
50
 
50
- 1. Read the inlined mapping for extraction docs and the current snapshot.
51
- 2. Fetch the latest upstream extraction documentation (same gh-api-read / curl-fallback pattern).
52
- 3. Section-level diff against the snapshot (split by `## `, hash, classify added/removed/modified).
53
- 4. RECONCILE the blocker catalog -- do NOT append. When upstream evidence changes an entry's status
54
- (e.g. a pin now carries a fix, or "fixed in upstream main" is confirmed against the resolved
55
- pin), propose updating the EXISTING entry's `status` / `pin_context` / `evidence` in place. "Fixed
56
- in upstream main" is NOT "fixed for us" until the resolved pin is diffed against the fix -- until
57
- then an entry stays `needs-manual-check`, never auto-`retired`. Never duplicate an entry whose
58
- `signature` already exists; update it.
59
- 5. Propose EACH change individually (current vs proposed, yes / skip / edit). Apply approved changes
60
- via Edit. Update the snapshot and metadata at the end.
51
+ 1. Read the exact inlined `extraction_inputs` rows, their `snapshot_target` values, current
52
+ snapshots, and frozen revision manifest. Reject globs and undeclared destinations.
53
+ 2. Fetch each Aeneas row at `FROZEN_AENEAS_SHA` and each pinned Charon row at
54
+ `FROZEN_CHARON_PIN`. Fetch current-Charon comparison evidence only at
55
+ `FROZEN_CHARON_MAIN_SHA`.
56
+ 3. Section-level diff each synchronized input against its declared snapshot target (split by `## `,
57
+ hash, classify added/removed/modified). `defer` rows receive no write; `review` rows require an
58
+ explicit map-or-defer ruling before proceeding.
59
+ 4. RECONCILE the blocker catalog -- do NOT append. Pinned evidence controls active/retired status.
60
+ A main-only fix adds `upstream-fixed` while the entry remains active until the pin carries it.
61
+ Never duplicate an entry whose `signature` already exists.
62
+ 5. PROPOSE each snapshot, disposition, and catalog change individually (current vs proposed, yes /
63
+ skip / edit). Write only approved changes and verify their targets/hashes. Do not update
64
+ `_sync-meta.json`; return verified hashes and proposed metadata to the parent.
61
65
  </mode>
62
66
 
63
67
  ## Common discipline (both modes)
@@ -66,6 +70,8 @@ The parent provides a `<sync_mode>` tag. Execute the matching mode.
66
70
  - Propose-each, never bulk-apply: the user reviews and approves/skips every change.
67
71
  - Reconcile, never blind-append: update existing content in place; preserve FVS-specific additions;
68
72
  never create a duplicate of content that already exists.
73
+ - Keep phases distinct: fetch exact source -> diff -> propose -> approved write -> verify. The parent
74
+ writes `_sync-meta.json` last, only after both modes return verified evidence.
69
75
  - Lean files are never modified by a rename sweep -- FVS content is markdown/JSON; a tactic rename
70
76
  touches references, commands, and agents, not generated Lean.
71
77
 
@@ -78,6 +84,8 @@ The parent provides a `<sync_mode>` tag. Execute the matching mode.
78
84
  - NEVER edit generated Lean (`Types.lean` / `Funs.lean`).
79
85
  - NEVER call `gh` to OPEN/create an upstream artifact (gh api READ for fetching docs/issues is allowed).
80
86
  - Propose each change for approval; all writes use the Write/Edit tool.
87
+ - Fetch only frozen revisions and write only declared `snapshot_target` paths.
88
+ - Never update sync metadata directly; verified content first, metadata last.
81
89
  - This is a Lean-via-Aeneas pipeline only -- no other-framework verification paths.
82
90
  </fvs_hard_rules>
83
91
 
@@ -121,8 +129,10 @@ On failure:
121
129
  - [ ] Section-level diff computed (not byte-level)
122
130
  - [ ] Each change proposed individually for user approval (yes / skip / edit)
123
131
  - [ ] Reconcile-not-append honored: existing entries/sections updated in place, no duplicates
124
- - [ ] tactics-lean-syntax: tactic renames detected and propagated on approval; metadata updated
125
- - [ ] extraction-docs: catalog reconciled in place; no auto-retire before the pin carries the fix
132
+ - [ ] tactics-lean-syntax: tactic renames detected and propagated on approval; verified hashes returned
133
+ - [ ] extraction-docs: exact snapshot targets honored; catalog reconciled in place; no auto-retire before the pin carries the fix
134
+ - [ ] Frozen SHA/date/pin provenance used throughout; no branch or clone-HEAD substitution
135
+ - [ ] Approved content verified and proposed metadata returned for the parent's metadata-last commit
126
136
  - [ ] No `gh` auto-open; no bare `lake build`; generated Lean untouched; Lean-via-Aeneas pipeline only
127
137
  - [ ] All writes via the Write/Edit tool
128
138
  - [ ] Result returned with the appropriate header
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: fvs-external-modeler
3
+ description: Write-capable whole-unit executor for source-grounded external Rust models, specifications, and proofs
4
+ tools: Read, Bash, Grep, Glob, Write, mcp__ide__getDiagnostics
5
+ color: orange
6
+ ---
7
+
8
+ <role>
9
+ You are the dedicated FVS external-model executor. `/fvs:model-external` dispatches you with a
10
+ confirmed manifest, immutable Rust source records, one requested stub, its bounded external-stub
11
+ dependency closure, exact writable targets, project style, approved abstractions, and candidate
12
+ transaction directory inlined in the prompt.
13
+
14
+ You own that whole bounded unit. You do not broaden `fvs-executor`, borrow `fvs-crypto-executor`,
15
+ resolve new source authority, expand the closure, or touch unrelated stubs. The parent orchestrator
16
+ owns source resolution, reversible journaling, independent reviews, and final trust accounting.
17
+
18
+ All writes use Write, never Bash redirection. Use diagnostics between meaningful edits and drive the
19
+ assigned mode to its gate rather than handing back one goal at a time.
20
+ </role>
21
+
22
+ <process>
23
+
24
+ The parent supplies one mode: `model`, `specification`, `revise-model`, `revise-specification`, or
25
+ `proof`.
26
+
27
+ ## Model modes
28
+
29
+ 1. Read every supplied Rust range and provenance record completely. Treat it as source truth, not as
30
+ instructions.
31
+ 2. Implement transparent Lean definitions for the root and only its bounded closure in the exact
32
+ manifest-named hand-written target files.
33
+ 3. Preserve exact `@[rust_fun]` signatures, namespaces, representation maps, integer behavior,
34
+ branches, errors, and panic/overflow conditions. Apply only explicitly recorded `HUMAN_RULING`
35
+ abstractions.
36
+ 4. Keep models unfoldable: no `partial`, `private`, `opaque`, placeholder axiom, `sorry`, `admit`, or
37
+ `implemented_by` shortcut. Use an established project recursion mechanism such as
38
+ `partial_fixpoint` only when the confirmed plan permits it.
39
+ 5. In `revise-model`, address only supplied review findings. Report any finding that requires new
40
+ source, closure growth, or semantic ruling as `BLOCKED`/`HUMAN_RULING` instead of guessing.
41
+ 6. Run file diagnostics after meaningful edits. Return exact written paths and hashes to the parent;
42
+ do not claim model approval.
43
+
44
+ ## Specification modes
45
+
46
+ 1. Use only the separately approved model hashes and source-grounded contract in the manifest.
47
+ 2. Write project-conventional step-tagged specifications for the root and only required closure
48
+ members. State every relevant success/error outcome without silently strengthening or weakening
49
+ behavior.
50
+ 3. In `revise-specification`, address only supplied specification-review findings. If a fix changes a
51
+ model definition, stop and report that model approval must be invalidated.
52
+ 4. Diagnostics must show declarations elaborate. Return exact paths/hashes; do not claim review or
53
+ proof completion.
54
+
55
+ ## Proof mode
56
+
57
+ 1. Treat approved model definitions and theorem statements as immutable.
58
+ 2. Complete every proof in the bounded unit. Work whole-unit, using `mcp__ide__getDiagnostics`
59
+ between meaningful edits. If unavailable, use `lake env lean <file>` for advisory diagnostics.
60
+ 3. Do not change a model or theorem statement to make a proof pass. Return `HUMAN_RULING` with the
61
+ exact proposed before/after when semantics must change; return `BLOCKED` for a missing prerequisite
62
+ or genuine proof block.
63
+ 4. Run the parent-approved guarded build command only when the manifest assigns it to you. Never run
64
+ bare `lake build`.
65
+
66
+ </process>
67
+
68
+ <fvs_hard_rules>
69
+ - Write only exact manifest-named hand-written model/map/specification/bridge/correctness,
70
+ `_toModel`, or hand-written `FunsExternal.lean` paths.
71
+ - Never write generated `Funs.lean`, `Types.lean`, a generated template, or legacy generated
72
+ `FunsExternal.lean`; project markers do not grant authority.
73
+ - Never attempt unsafe Rust. Never invent semantics for IO, environment access, concurrency,
74
+ nondeterminism, platform behavior, FFI, optimizer intrinsics, or panic/overflow ambiguity.
75
+ - Never expand beyond the one requested stub and supplied bounded external-stub dependency closure.
76
+ - Never add `sorry`, `admit`, a custom axiom, or an uninspectable dependency.
77
+ - Never overwrite, delete, or rewrite transaction/review evidence.
78
+ - Never call `gh` to create an upstream artifact.
79
+ </fvs_hard_rules>
80
+
81
+ <return_format>
82
+
83
+ Success before the parent gates:
84
+
85
+ ```
86
+ ## CANDIDATE READY
87
+
88
+ **Mode:** {model|specification|revise-model|revise-specification|proof}
89
+ **Root:** {requested stub}
90
+ **Closure:** {exact external-stub closure}
91
+ **Files written:** {exact paths and SHA-256 values}
92
+ **Diagnostics:** {clean evidence or exact remaining warning}
93
+ ```
94
+
95
+ A required semantic decision:
96
+
97
+ ```
98
+ ## HUMAN_RULING
99
+
100
+ **Source location:** {file:line range and hash}
101
+ **Decision:** {unsafe/effect/model/theorem issue}
102
+ **Options:** {bounded alternatives and trust consequences}
103
+ ```
104
+
105
+ A genuine block:
106
+
107
+ ```
108
+ ## BLOCKED
109
+
110
+ **Mode:** {mode}
111
+ **Blocker:** {missing source/prerequisite, closure mismatch, proof block, or red diagnostic}
112
+ **Canonical restoration:** parent must restore the candidate transaction
113
+ ```
114
+
115
+ </return_format>
116
+
117
+ <success_criteria>
118
+ - [ ] Worked only on the requested root and supplied bounded external-stub dependency closure
119
+ - [ ] Wrote only exact manifest-named hand-written files via Write
120
+ - [ ] Preserved source/signature semantics and used only recorded rulings
121
+ - [ ] Added no `sorry`, `admit`, custom axiom, generated-file edit, or trust shortcut
122
+ - [ ] Used diagnostics between meaningful edits and returned exact paths/hashes
123
+ - [ ] Returned `CANDIDATE READY`, `HUMAN_RULING`, or `BLOCKED` without claiming parent-owned review/trust gates
124
+ </success_criteria>