plan-auditor 2.3.0__tar.gz → 2.4.0__tar.gz

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.

Potentially problematic release.


This version of plan-auditor might be problematic. Click here for more details.

Files changed (85) hide show
  1. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/CHANGELOG.md +10 -3
  2. plan_auditor-2.4.0/PKG-INFO +354 -0
  3. plan_auditor-2.4.0/README.md +332 -0
  4. plan_auditor-2.4.0/SKILL.md +197 -0
  5. plan_auditor-2.4.0/docs/formal-planning.md +219 -0
  6. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/pyproject.toml +2 -1
  7. plan_auditor-2.4.0/supervisor/formal_compiler.py +673 -0
  8. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/formal_semantics.py +106 -19
  9. plan_auditor-2.4.0/tests/test_console_scripts.py +16 -0
  10. plan_auditor-2.4.0/tests/test_formal_compiler.py +244 -0
  11. plan_auditor-2.3.0/PKG-INFO +0 -401
  12. plan_auditor-2.3.0/README.md +0 -379
  13. plan_auditor-2.3.0/SKILL.md +0 -281
  14. plan_auditor-2.3.0/docs/formal-planning.md +0 -257
  15. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/.gitignore +0 -0
  16. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/CONTRIBUTING.md +0 -0
  17. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/LICENSE +0 -0
  18. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/docs/architecture.md +0 -0
  19. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/docs/dependency-graph.md +0 -0
  20. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/docs/deployment-isolation.md +0 -0
  21. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/docs/integrations.md +0 -0
  22. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/docs/threat-model.md +0 -0
  23. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/examples/fib/.plan-auditor/plan.json +0 -0
  24. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/examples/fib/fib.py +0 -0
  25. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/examples/fib/test_fib.py +0 -0
  26. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/hooks/README.md +0 -0
  27. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/references/plan-format.md +0 -0
  28. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/scripts/__init__.py +0 -0
  29. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/scripts/audit_check.py +0 -0
  30. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/scripts/integrity.py +0 -0
  31. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/scripts/plan_graph.py +0 -0
  32. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/scripts/stop_gate.py +0 -0
  33. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/__init__.py +0 -0
  34. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/adversarial.py +0 -0
  35. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/agents.py +0 -0
  36. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/agents_hardening.py +0 -0
  37. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/audit_session.py +0 -0
  38. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/cli.py +0 -0
  39. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/config.py +0 -0
  40. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/contracts.py +0 -0
  41. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/control_plane.py +0 -0
  42. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/coverage.py +0 -0
  43. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/daemon.py +0 -0
  44. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/events.py +0 -0
  45. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/evidence.py +0 -0
  46. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/formal_planning.py +0 -0
  47. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/gate.py +0 -0
  48. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/goals.py +0 -0
  49. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/integrity.py +0 -0
  50. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/lifecycle.py +0 -0
  51. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/lock_hardening.py +0 -0
  52. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/orchestrator.py +0 -0
  53. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/plan_verifier.py +0 -0
  54. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/plans.py +0 -0
  55. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/policies.py +0 -0
  56. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/priority.py +0 -0
  57. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/request_contract.py +0 -0
  58. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/requirements.py +0 -0
  59. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/seal_migration.py +0 -0
  60. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/sealing.py +0 -0
  61. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/watchdog.py +0 -0
  62. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/supervisor/workspace.py +0 -0
  63. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/request_fixture.py +0 -0
  64. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_adversarial.py +0 -0
  65. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_agent_registry_chain.py +0 -0
  66. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_agents_gate.py +0 -0
  67. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_audit_check.py +0 -0
  68. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_authenticated_integrity.py +0 -0
  69. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_cli.py +0 -0
  70. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_core_layers.py +0 -0
  71. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_daemon.py +0 -0
  72. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_dependency_graph.py +0 -0
  73. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_events.py +0 -0
  74. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_extra_layers.py +0 -0
  75. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_failure_injection.py +0 -0
  76. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_formal_planning.py +0 -0
  77. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_formal_semantics.py +0 -0
  78. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_full_contract_hardening.py +0 -0
  79. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_hooks.py +0 -0
  80. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_integration_hardening.py +0 -0
  81. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_registry_lock_partial.py +0 -0
  82. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_request_contract_hardening.py +0 -0
  83. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_root_cause_fixes_v220.py +0 -0
  84. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/test_runtime_root_hardening.py +0 -0
  85. {plan_auditor-2.3.0 → plan_auditor-2.4.0}/tests/wheel_cli_smoke.py +0 -0
@@ -1,9 +1,16 @@
1
1
  ## Unreleased
2
2
 
3
- - None yet.
4
-
5
3
  # Changelog
6
4
 
5
+ ## v2.4.0 — 2026-09-06
6
+
7
+ - **Deterministic automatic formalization:** `plan-auditor-formalize compile` converts structured Plan Auditor requirements, coverage, dependencies, named outputs, `requires_outputs`, and deterministic checks into a conservative grounded STRIPS contract without asking an LLM to invent authoritative symbolic semantics.
8
+ - **Independent formalization proof:** generated contracts carry a `formalization-source:<SHA256>` marker and are independently recompiled from the current plan; stale, weakened, omitted, or manually edited generated contracts are rejected even if their embedded contract SHA is recomputed.
9
+ - **Dataflow-bound symbolic state:** generated actions prove step completion, named-output availability, and canonical `requirement-satisfied:<REQ-ID>` goals; downstream `requires_outputs` become symbolic preconditions while the existing dependency DAG remains independently enforced.
10
+ - **Safe generated/manual split:** automatic formalization refuses to overwrite reviewed manual formal contracts and refuses to mutate already sealed plans. Domain semantics that cannot be derived mechanically remain explicit/manual rather than guessed.
11
+ - **New installed CLI:** adds `plan-auditor-formalize compile|verify`; package and skill identity advance to stable `2.4.0`.
12
+ - **Regression coverage:** tests exercise exact recompilation, source-staleness detection, goal weakening, dropped output preconditions, fake initial requirement goals, idempotence, sealed-plan mutation refusal, and manual-contract preservation.
13
+
7
14
  ## v2.3.0 — 2026-09-06
8
15
 
9
16
  - **Sealed classical planning:** non-trivial multi-step plans can embed one sealed `formal_planning` contract with explicit initial facts, final goals, one grounded STRIPS-style action per Plan Auditor step, symbolic preconditions, add effects and delete effects.
@@ -76,4 +83,4 @@
76
83
 
77
84
  - Initial strict plan + independent auditor Agent Skill.
78
85
  - Machine-checkable `verify` checks (`run`, `exec`, `file_exists`, `regex`, `pytest`).
79
- - Deterministic fresh execution, append-only SHA-256 evidence, tamper detection, and full-audit final gate.
86
+ - Deterministic fresh execution, append-only SHA-256 evidence, tamper detection, and full-audit final gate.
@@ -0,0 +1,354 @@
1
+ Metadata-Version: 2.5
2
+ Name: plan-auditor
3
+ Version: 2.4.0
4
+ Summary: Independent multi-layer verification supervisor for AI coding agents
5
+ Project-URL: Homepage, https://github.com/Furox-Art/plan-auditor
6
+ Project-URL: Repository, https://github.com/Furox-Art/plan-auditor
7
+ Project-URL: Issues, https://github.com/Furox-Art/plan-auditor/issues
8
+ Author: Furox-Art
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: ai-agents,auditing,cli,supervisor,verification
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+
23
+ # plan-auditor
24
+
25
+ [![plan-audit gate](https://github.com/Furox-Art/plan-auditor/actions/workflows/plan-audit.yml/badge.svg)](https://github.com/Furox-Art/plan-auditor/actions/workflows/plan-audit.yml)
26
+
27
+ **Independent deterministic verification for AI coding-agent work.**
28
+
29
+ `plan-auditor` answers one question:
30
+
31
+ > Did the AI actually complete the user's requirements and approved plan, or did it only say that it did?
32
+
33
+ PASS is not based on the agent's narration. It requires explicit requirements, real behavioral checks, dependency/output proof, formal plan validation when enabled, an intact seal, fresh execution evidence, and an aggregate gate across every active plan.
34
+
35
+ ## Use it directly by skill name
36
+
37
+ In a skill-capable coding environment, call:
38
+
39
+ ```text
40
+ plan-auditor
41
+ ```
42
+
43
+ or:
44
+
45
+ ```text
46
+ plan-auditor: implement this change and prove it is complete
47
+ ```
48
+
49
+ The normal skill workflow handles the internal plan, automatic formalization, sealing, evidence, and final audit. The user does not need to hand-write STRIPS/PDDL or auditor metadata.
50
+
51
+ ## Automatic formalization
52
+
53
+ For non-trivial multi-step work, Plan Auditor can now compile the structured plan into a conservative STRIPS contract automatically:
54
+
55
+ ```bash
56
+ plan-auditor-formalize compile .
57
+ ```
58
+
59
+ The compiler does **not** ask an LLM to invent symbolic semantics. It derives only from explicit Plan Auditor structure:
60
+
61
+ - `must` / `should` requirement IDs,
62
+ - step `covers` bindings,
63
+ - `depends_on`,
64
+ - named `outputs`,
65
+ - `requires_outputs`,
66
+ - deterministic verification checks.
67
+
68
+ Generated facts are limited to:
69
+
70
+ ```text
71
+ formalization-source:<SHA256>
72
+ step-completed:<STEP-ID>
73
+ output-available:<STEP-ID>:...
74
+ requirement-satisfied:<REQ-ID>
75
+ ```
76
+
77
+ A generated contract is checked twice:
78
+
79
+ 1. **STRIPS reachability** — `plan-auditor-formal verify` proves the symbolic plan can reach all goals while respecting dependencies and dataflow.
80
+ 2. **Independent deterministic recompilation** — `plan-auditor-formalize verify` rebuilds the expected contract from the current structured plan and requires exact equality.
81
+
82
+ This blocks a generated formal model from silently omitting a requirement, dropping an output precondition, weakening a goal, or becoming stale after the plan changes—even if someone recomputes the contract SHA.
83
+
84
+ Manual domain-specific STRIPS contracts remain supported and are never overwritten by the automatic compiler.
85
+
86
+ ## Completion model
87
+
88
+ ```text
89
+ Host-owned request + acceptance checks
90
+ |
91
+ v
92
+ Explicit requirements + covers
93
+ |
94
+ v
95
+ Dependency / output dataflow DAG
96
+ |
97
+ v
98
+ Deterministic auto-formalizer
99
+ |
100
+ +--> source SHA-256
101
+ +--> requirement goals
102
+ +--> output facts / preconditions
103
+ +--> one action per step
104
+ |
105
+ v
106
+ Independent deterministic recompilation
107
+ |
108
+ v
109
+ Grounded STRIPS reachability
110
+ |
111
+ +--> PDDL / Fast Downward (optional)
112
+ |
113
+ v
114
+ Format-v4 sealed verification contract
115
+ |
116
+ v
117
+ Real subprocess/filesystem checks
118
+ |
119
+ v
120
+ Hash-chained fresh evidence
121
+ |
122
+ v
123
+ Aggregate supervisor gate
124
+ |
125
+ v
126
+ PASS / FAIL / UNKNOWN
127
+ ```
128
+
129
+ ## What PASS requires
130
+
131
+ In Supervisor Mode, every active plan must satisfy the full contract, including:
132
+
133
+ - valid plan schema,
134
+ - explicit non-empty requirements,
135
+ - complete `must`/`should` coverage,
136
+ - real behavioral verification for every step,
137
+ - valid dependency DAG,
138
+ - concrete `requires_outputs` backing for explicit dependency edges,
139
+ - successful formal reachability when a formal anchor is present,
140
+ - canonical requirement-to-formal-goal binding,
141
+ - exact deterministic recompilation for auto-generated formal contracts,
142
+ - intact format-v4 seal,
143
+ - unchanged sealed supervisor environment/policies,
144
+ - fresh full-audit plan/workspace fingerprints,
145
+ - valid active and archived evidence chains,
146
+ - valid agent registry,
147
+ - required tools present,
148
+ - no blocking policy result.
149
+
150
+ A passing default plan cannot hide an unfinished named plan.
151
+
152
+ ## Example structured plan
153
+
154
+ ```json
155
+ {
156
+ "task": "build and consume a verified artifact",
157
+ "created": "2026-09-06T00:00:00Z",
158
+ "requirements": [
159
+ {"id": "REQ-001", "description": "produce the artifact", "priority": "must"},
160
+ {"id": "REQ-002", "description": "consume the artifact", "priority": "must"}
161
+ ],
162
+ "steps": [
163
+ {
164
+ "id": 1,
165
+ "title": "produce",
166
+ "depends_on": [],
167
+ "covers": ["REQ-001"],
168
+ "verify": [{"type": "run", "argv": ["python", "tests/build.py"]}],
169
+ "outputs": [
170
+ {
171
+ "name": "artifact",
172
+ "verify": [{"type": "file_exists", "path": "result.json"}]
173
+ }
174
+ ]
175
+ },
176
+ {
177
+ "id": 2,
178
+ "title": "consume",
179
+ "depends_on": [1],
180
+ "requires_outputs": [{"step": 1, "name": "artifact"}],
181
+ "covers": ["REQ-002"],
182
+ "verify": [{"type": "run", "argv": ["python", "tests/use.py"]}]
183
+ }
184
+ ]
185
+ }
186
+ ```
187
+
188
+ Then:
189
+
190
+ ```bash
191
+ plan-auditor validate .
192
+ plan-auditor-formalize compile .
193
+ plan-auditor plan verify .
194
+ plan-auditor audit .
195
+ ```
196
+
197
+ The auto-formalizer runs **before** sealing and refuses to mutate an already sealed plan.
198
+
199
+ ## Classical STRIPS / PDDL
200
+
201
+ The built-in grounded STRIPS-style planner is local and CPU-only.
202
+
203
+ - no-delete contracts use deterministic forward reasoning,
204
+ - delete-effect contracts use bounded state-space search,
205
+ - state-limit exhaustion returns UNKNOWN/REVISE rather than PASS,
206
+ - every Plan Auditor step must execute exactly once in the formal solution.
207
+
208
+ PDDL export:
209
+
210
+ ```bash
211
+ plan-auditor-formal export-pddl . \
212
+ --contract-sha <sha256> \
213
+ --output ./pddl-proof
214
+ ```
215
+
216
+ Optional Fast Downward cross-check can be embedded during automatic compilation:
217
+
218
+ ```bash
219
+ plan-auditor-formalize compile . \
220
+ --fast-downward auto \
221
+ --require-fast-downward
222
+ ```
223
+
224
+ For reviewed domain-specific models, manual contracts can still be wrapped with:
225
+
226
+ ```bash
227
+ plan-auditor-formal make-check formal-contract.json
228
+ ```
229
+
230
+ See `docs/formal-planning.md`.
231
+
232
+ ## Deterministic checks
233
+
234
+ Prefer structured argv:
235
+
236
+ ```json
237
+ {
238
+ "type": "run",
239
+ "argv": ["python", "-m", "pytest", "tests/", "-q"],
240
+ "expect_exit": 0
241
+ }
242
+ ```
243
+
244
+ Shell interpretation is disabled by default. `"shell": true` is an explicit trust-boundary opt-in. Verifier output is bounded.
245
+
246
+ ## Sealing and evidence
247
+
248
+ Seal the complete verification contract with:
249
+
250
+ ```bash
251
+ plan-auditor plan verify .
252
+ ```
253
+
254
+ The v4 seal binds requirements, coverage, tools, step identity, checks, dependencies, outputs, generated/manual formal-planning data, and supervisor environment/policy fingerprints.
255
+
256
+ Evidence is append-only JSONL with SHA-256 chain continuity across rotations. Optional external-key HMAC authenticates evidence, checkpoints, registry state, seals, and integrity metadata.
257
+
258
+ ```bash
259
+ # set PLAN_AUDITOR_HMAC_KEY or PLAN_AUDITOR_HMAC_KEY_FILE first
260
+ plan-auditor integrity init .
261
+ plan-auditor audit .
262
+ ```
263
+
264
+ The key file must resolve outside the workspace.
265
+
266
+ ## Multi-plan and multi-agent state
267
+
268
+ Default plan:
269
+
270
+ ```text
271
+ .plan-auditor/plan.json
272
+ ```
273
+
274
+ Named plans:
275
+
276
+ ```text
277
+ .plan-auditor/plans/<name>.json
278
+ ```
279
+
280
+ The aggregate gate includes every active plan.
281
+
282
+ Agent registry modes:
283
+
284
+ - `serial`
285
+ - `parallel-warn`
286
+ - `parallel-strict`
287
+
288
+ Ownership paths are canonicalized to prevent alternate-path conflict bypasses.
289
+
290
+ ## Snapshot / rollback
291
+
292
+ Default snapshots capture product state while excluding `.git`, `.plan-auditor`, and cache metadata. Manifests include file type, mode, and hash. Full-scope rollback restores the snapshot and removes files introduced afterwards.
293
+
294
+ ## CLI
295
+
296
+ ```text
297
+ plan-auditor validate <dir> [--plan NAME]
298
+ plan-auditor plan verify <dir> [--plan NAME] [--reseal]
299
+ plan-auditor plan inspect <dir> [--plan NAME]
300
+ plan-auditor run <dir> [step ids ...] [--plan NAME]
301
+ plan-auditor audit <dir> [--plan NAME]
302
+ plan-auditor evidence verify <dir>
303
+ plan-auditor integrity init|status <dir>
304
+ plan-auditor doctor <dir>
305
+ plan-auditor task list <dir>
306
+ plan-auditor agents list|register|heartbeat|claim|release ...
307
+ plan-auditor supervisor start|stop|status ...
308
+
309
+ plan-auditor-formalize compile <dir> [--plan NAME]
310
+ plan-auditor-formalize verify <dir> --contract-sha <sha256>
311
+
312
+ plan-auditor-formal make-check <formal-contract.json>
313
+ plan-auditor-formal verify <dir> --contract-sha <sha256>
314
+ plan-auditor-formal export-pddl <dir> --contract-sha <sha256> --output <dir>
315
+ ```
316
+
317
+ ## Cross-platform packaging
318
+
319
+ CI builds and installs real wheels in clean environments on:
320
+
321
+ - Ubuntu,
322
+ - Windows,
323
+ - macOS.
324
+
325
+ Python compatibility is tested on 3.10, 3.11, 3.12, and 3.13.
326
+
327
+ ## Architecture
328
+
329
+ The project combines deterministic requirement alignment, workspace observation, rule/policy evaluation, explicit plan DAGs, BDI-inspired goal state, grounded STRIPS planning, Soar-like lifecycle control, subsumption-inspired authority, cryptographic sealing, evidence integrity, watchdog supervision, and multi-agent coordination.
330
+
331
+ See:
332
+
333
+ - `docs/architecture.md`
334
+ - `docs/dependency-graph.md`
335
+ - `docs/formal-planning.md`
336
+ - `docs/threat-model.md`
337
+ - `references/plan-format.md`
338
+
339
+ ## Trust boundary
340
+
341
+ Plan Auditor verifies completion; it is not an OS sandbox.
342
+
343
+ Automatic formalization removes the need to trust an LLM-generated symbolic model for the structural layer, but it does not claim perfect arbitrary natural-language theorem formalization. The host-owned request and deterministic acceptance checks remain authoritative. Domain semantics that cannot be derived mechanically should be reviewed explicitly rather than guessed.
344
+
345
+ A malicious same-OS-user process that can read external integrity key material remains outside the local integrity guarantee; use a separate OS account, container, or VM when that attacker is in scope.
346
+
347
+ ## Version
348
+
349
+ Latest stable release: **2.4.0**
350
+ Current source version: **2.4.0**
351
+
352
+ ## License
353
+
354
+ MIT
@@ -0,0 +1,332 @@
1
+ # plan-auditor
2
+
3
+ [![plan-audit gate](https://github.com/Furox-Art/plan-auditor/actions/workflows/plan-audit.yml/badge.svg)](https://github.com/Furox-Art/plan-auditor/actions/workflows/plan-audit.yml)
4
+
5
+ **Independent deterministic verification for AI coding-agent work.**
6
+
7
+ `plan-auditor` answers one question:
8
+
9
+ > Did the AI actually complete the user's requirements and approved plan, or did it only say that it did?
10
+
11
+ PASS is not based on the agent's narration. It requires explicit requirements, real behavioral checks, dependency/output proof, formal plan validation when enabled, an intact seal, fresh execution evidence, and an aggregate gate across every active plan.
12
+
13
+ ## Use it directly by skill name
14
+
15
+ In a skill-capable coding environment, call:
16
+
17
+ ```text
18
+ plan-auditor
19
+ ```
20
+
21
+ or:
22
+
23
+ ```text
24
+ plan-auditor: implement this change and prove it is complete
25
+ ```
26
+
27
+ The normal skill workflow handles the internal plan, automatic formalization, sealing, evidence, and final audit. The user does not need to hand-write STRIPS/PDDL or auditor metadata.
28
+
29
+ ## Automatic formalization
30
+
31
+ For non-trivial multi-step work, Plan Auditor can now compile the structured plan into a conservative STRIPS contract automatically:
32
+
33
+ ```bash
34
+ plan-auditor-formalize compile .
35
+ ```
36
+
37
+ The compiler does **not** ask an LLM to invent symbolic semantics. It derives only from explicit Plan Auditor structure:
38
+
39
+ - `must` / `should` requirement IDs,
40
+ - step `covers` bindings,
41
+ - `depends_on`,
42
+ - named `outputs`,
43
+ - `requires_outputs`,
44
+ - deterministic verification checks.
45
+
46
+ Generated facts are limited to:
47
+
48
+ ```text
49
+ formalization-source:<SHA256>
50
+ step-completed:<STEP-ID>
51
+ output-available:<STEP-ID>:...
52
+ requirement-satisfied:<REQ-ID>
53
+ ```
54
+
55
+ A generated contract is checked twice:
56
+
57
+ 1. **STRIPS reachability** — `plan-auditor-formal verify` proves the symbolic plan can reach all goals while respecting dependencies and dataflow.
58
+ 2. **Independent deterministic recompilation** — `plan-auditor-formalize verify` rebuilds the expected contract from the current structured plan and requires exact equality.
59
+
60
+ This blocks a generated formal model from silently omitting a requirement, dropping an output precondition, weakening a goal, or becoming stale after the plan changes—even if someone recomputes the contract SHA.
61
+
62
+ Manual domain-specific STRIPS contracts remain supported and are never overwritten by the automatic compiler.
63
+
64
+ ## Completion model
65
+
66
+ ```text
67
+ Host-owned request + acceptance checks
68
+ |
69
+ v
70
+ Explicit requirements + covers
71
+ |
72
+ v
73
+ Dependency / output dataflow DAG
74
+ |
75
+ v
76
+ Deterministic auto-formalizer
77
+ |
78
+ +--> source SHA-256
79
+ +--> requirement goals
80
+ +--> output facts / preconditions
81
+ +--> one action per step
82
+ |
83
+ v
84
+ Independent deterministic recompilation
85
+ |
86
+ v
87
+ Grounded STRIPS reachability
88
+ |
89
+ +--> PDDL / Fast Downward (optional)
90
+ |
91
+ v
92
+ Format-v4 sealed verification contract
93
+ |
94
+ v
95
+ Real subprocess/filesystem checks
96
+ |
97
+ v
98
+ Hash-chained fresh evidence
99
+ |
100
+ v
101
+ Aggregate supervisor gate
102
+ |
103
+ v
104
+ PASS / FAIL / UNKNOWN
105
+ ```
106
+
107
+ ## What PASS requires
108
+
109
+ In Supervisor Mode, every active plan must satisfy the full contract, including:
110
+
111
+ - valid plan schema,
112
+ - explicit non-empty requirements,
113
+ - complete `must`/`should` coverage,
114
+ - real behavioral verification for every step,
115
+ - valid dependency DAG,
116
+ - concrete `requires_outputs` backing for explicit dependency edges,
117
+ - successful formal reachability when a formal anchor is present,
118
+ - canonical requirement-to-formal-goal binding,
119
+ - exact deterministic recompilation for auto-generated formal contracts,
120
+ - intact format-v4 seal,
121
+ - unchanged sealed supervisor environment/policies,
122
+ - fresh full-audit plan/workspace fingerprints,
123
+ - valid active and archived evidence chains,
124
+ - valid agent registry,
125
+ - required tools present,
126
+ - no blocking policy result.
127
+
128
+ A passing default plan cannot hide an unfinished named plan.
129
+
130
+ ## Example structured plan
131
+
132
+ ```json
133
+ {
134
+ "task": "build and consume a verified artifact",
135
+ "created": "2026-09-06T00:00:00Z",
136
+ "requirements": [
137
+ {"id": "REQ-001", "description": "produce the artifact", "priority": "must"},
138
+ {"id": "REQ-002", "description": "consume the artifact", "priority": "must"}
139
+ ],
140
+ "steps": [
141
+ {
142
+ "id": 1,
143
+ "title": "produce",
144
+ "depends_on": [],
145
+ "covers": ["REQ-001"],
146
+ "verify": [{"type": "run", "argv": ["python", "tests/build.py"]}],
147
+ "outputs": [
148
+ {
149
+ "name": "artifact",
150
+ "verify": [{"type": "file_exists", "path": "result.json"}]
151
+ }
152
+ ]
153
+ },
154
+ {
155
+ "id": 2,
156
+ "title": "consume",
157
+ "depends_on": [1],
158
+ "requires_outputs": [{"step": 1, "name": "artifact"}],
159
+ "covers": ["REQ-002"],
160
+ "verify": [{"type": "run", "argv": ["python", "tests/use.py"]}]
161
+ }
162
+ ]
163
+ }
164
+ ```
165
+
166
+ Then:
167
+
168
+ ```bash
169
+ plan-auditor validate .
170
+ plan-auditor-formalize compile .
171
+ plan-auditor plan verify .
172
+ plan-auditor audit .
173
+ ```
174
+
175
+ The auto-formalizer runs **before** sealing and refuses to mutate an already sealed plan.
176
+
177
+ ## Classical STRIPS / PDDL
178
+
179
+ The built-in grounded STRIPS-style planner is local and CPU-only.
180
+
181
+ - no-delete contracts use deterministic forward reasoning,
182
+ - delete-effect contracts use bounded state-space search,
183
+ - state-limit exhaustion returns UNKNOWN/REVISE rather than PASS,
184
+ - every Plan Auditor step must execute exactly once in the formal solution.
185
+
186
+ PDDL export:
187
+
188
+ ```bash
189
+ plan-auditor-formal export-pddl . \
190
+ --contract-sha <sha256> \
191
+ --output ./pddl-proof
192
+ ```
193
+
194
+ Optional Fast Downward cross-check can be embedded during automatic compilation:
195
+
196
+ ```bash
197
+ plan-auditor-formalize compile . \
198
+ --fast-downward auto \
199
+ --require-fast-downward
200
+ ```
201
+
202
+ For reviewed domain-specific models, manual contracts can still be wrapped with:
203
+
204
+ ```bash
205
+ plan-auditor-formal make-check formal-contract.json
206
+ ```
207
+
208
+ See `docs/formal-planning.md`.
209
+
210
+ ## Deterministic checks
211
+
212
+ Prefer structured argv:
213
+
214
+ ```json
215
+ {
216
+ "type": "run",
217
+ "argv": ["python", "-m", "pytest", "tests/", "-q"],
218
+ "expect_exit": 0
219
+ }
220
+ ```
221
+
222
+ Shell interpretation is disabled by default. `"shell": true` is an explicit trust-boundary opt-in. Verifier output is bounded.
223
+
224
+ ## Sealing and evidence
225
+
226
+ Seal the complete verification contract with:
227
+
228
+ ```bash
229
+ plan-auditor plan verify .
230
+ ```
231
+
232
+ The v4 seal binds requirements, coverage, tools, step identity, checks, dependencies, outputs, generated/manual formal-planning data, and supervisor environment/policy fingerprints.
233
+
234
+ Evidence is append-only JSONL with SHA-256 chain continuity across rotations. Optional external-key HMAC authenticates evidence, checkpoints, registry state, seals, and integrity metadata.
235
+
236
+ ```bash
237
+ # set PLAN_AUDITOR_HMAC_KEY or PLAN_AUDITOR_HMAC_KEY_FILE first
238
+ plan-auditor integrity init .
239
+ plan-auditor audit .
240
+ ```
241
+
242
+ The key file must resolve outside the workspace.
243
+
244
+ ## Multi-plan and multi-agent state
245
+
246
+ Default plan:
247
+
248
+ ```text
249
+ .plan-auditor/plan.json
250
+ ```
251
+
252
+ Named plans:
253
+
254
+ ```text
255
+ .plan-auditor/plans/<name>.json
256
+ ```
257
+
258
+ The aggregate gate includes every active plan.
259
+
260
+ Agent registry modes:
261
+
262
+ - `serial`
263
+ - `parallel-warn`
264
+ - `parallel-strict`
265
+
266
+ Ownership paths are canonicalized to prevent alternate-path conflict bypasses.
267
+
268
+ ## Snapshot / rollback
269
+
270
+ Default snapshots capture product state while excluding `.git`, `.plan-auditor`, and cache metadata. Manifests include file type, mode, and hash. Full-scope rollback restores the snapshot and removes files introduced afterwards.
271
+
272
+ ## CLI
273
+
274
+ ```text
275
+ plan-auditor validate <dir> [--plan NAME]
276
+ plan-auditor plan verify <dir> [--plan NAME] [--reseal]
277
+ plan-auditor plan inspect <dir> [--plan NAME]
278
+ plan-auditor run <dir> [step ids ...] [--plan NAME]
279
+ plan-auditor audit <dir> [--plan NAME]
280
+ plan-auditor evidence verify <dir>
281
+ plan-auditor integrity init|status <dir>
282
+ plan-auditor doctor <dir>
283
+ plan-auditor task list <dir>
284
+ plan-auditor agents list|register|heartbeat|claim|release ...
285
+ plan-auditor supervisor start|stop|status ...
286
+
287
+ plan-auditor-formalize compile <dir> [--plan NAME]
288
+ plan-auditor-formalize verify <dir> --contract-sha <sha256>
289
+
290
+ plan-auditor-formal make-check <formal-contract.json>
291
+ plan-auditor-formal verify <dir> --contract-sha <sha256>
292
+ plan-auditor-formal export-pddl <dir> --contract-sha <sha256> --output <dir>
293
+ ```
294
+
295
+ ## Cross-platform packaging
296
+
297
+ CI builds and installs real wheels in clean environments on:
298
+
299
+ - Ubuntu,
300
+ - Windows,
301
+ - macOS.
302
+
303
+ Python compatibility is tested on 3.10, 3.11, 3.12, and 3.13.
304
+
305
+ ## Architecture
306
+
307
+ The project combines deterministic requirement alignment, workspace observation, rule/policy evaluation, explicit plan DAGs, BDI-inspired goal state, grounded STRIPS planning, Soar-like lifecycle control, subsumption-inspired authority, cryptographic sealing, evidence integrity, watchdog supervision, and multi-agent coordination.
308
+
309
+ See:
310
+
311
+ - `docs/architecture.md`
312
+ - `docs/dependency-graph.md`
313
+ - `docs/formal-planning.md`
314
+ - `docs/threat-model.md`
315
+ - `references/plan-format.md`
316
+
317
+ ## Trust boundary
318
+
319
+ Plan Auditor verifies completion; it is not an OS sandbox.
320
+
321
+ Automatic formalization removes the need to trust an LLM-generated symbolic model for the structural layer, but it does not claim perfect arbitrary natural-language theorem formalization. The host-owned request and deterministic acceptance checks remain authoritative. Domain semantics that cannot be derived mechanically should be reviewed explicitly rather than guessed.
322
+
323
+ A malicious same-OS-user process that can read external integrity key material remains outside the local integrity guarantee; use a separate OS account, container, or VM when that attacker is in scope.
324
+
325
+ ## Version
326
+
327
+ Latest stable release: **2.4.0**
328
+ Current source version: **2.4.0**
329
+
330
+ ## License
331
+
332
+ MIT