@cassiomc1/forgeloop 1.13.0 → 2.0.0-rc.2

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 (395) hide show
  1. package/AGENT_COMPATIBILITY.md +8 -0
  2. package/CONTRIBUTING.md +11 -7
  3. package/DOCS_INDEX.md +37 -4
  4. package/ENG/c-development-eng.md +2 -2
  5. package/ENG/cpp-development-eng.md +2 -2
  6. package/ENG/dotnet-aspnetcore-development-eng.md +7 -1
  7. package/ENG/flutter-development-eng.md +4 -2
  8. package/ENG/go-development-eng.md +2 -2
  9. package/ENG/java-development-eng.md +3 -3
  10. package/ENG/nodejs-backend-development-eng.md +10 -6
  11. package/ENG/php-development-eng.md +3 -3
  12. package/ENG/python-development-eng.md +205 -0
  13. package/ENG/rust-development-eng.md +42 -1
  14. package/ENG/sec-code-eng.md +7 -7
  15. package/ENG/sql-development-eng.md +4 -4
  16. package/ENG/swift-development-eng.md +5 -4
  17. package/ENG/test-code-eng.md +1 -1
  18. package/ENG/typescript-development-eng.md +4 -4
  19. package/EXECUTION_STATE.md +12 -0
  20. package/GUIDE_ROUTER.md +6 -0
  21. package/LICENSE +133 -21
  22. package/LOOP_ENGINEERING.md +28 -2
  23. package/LOOP_SYSTEM_DESIGN.md +10 -10
  24. package/ORCHESTRATOR_INTEGRATION.md +9 -5
  25. package/PROTOCOL_INTEGRATION.md +55 -2
  26. package/README.md +63 -59
  27. package/TERMINOLOGY.md +2 -0
  28. package/THIRD_PARTY_NOTICES.md +3 -4
  29. package/THREAT_MODEL.md +140 -1
  30. package/completions/_forgeloop +29 -3
  31. package/completions/forgeloop.bash +55 -3
  32. package/completions/forgeloop.fish +183 -1
  33. package/docs/ADVISORY_CONTEXT.md +25 -0
  34. package/docs/AGENT_BROWSER_ADAPTER.md +81 -0
  35. package/docs/AGENT_BROWSER_VERIFICATION.md +6 -0
  36. package/docs/AGENT_PROTOCOL_SUMMARY.md +74 -39
  37. package/docs/AGENT_SKILL.md +66 -0
  38. package/docs/ARTIFACT_REFERENCE.md +171 -35
  39. package/docs/AUDIT_UX.md +46 -0
  40. package/docs/BROWSER_VERIFICATION.md +136 -0
  41. package/docs/CLI_REFERENCE.md +512 -8
  42. package/docs/CODE_ATTESTATION.md +2 -2
  43. package/docs/DOCUMENTATION_GUIDE.md +34 -11
  44. package/docs/GETTING_STARTED.md +3 -3
  45. package/docs/JEV_BENCHMARKS.md +31 -0
  46. package/docs/MODEL_ROUTING.md +37 -0
  47. package/docs/OPENSRC_ADAPTER.md +241 -0
  48. package/docs/PACKAGE_CONTENTS.md +46 -18
  49. package/docs/PROVIDERS.md +126 -0
  50. package/docs/PROVIDER_ARCHITECTURE.md +199 -0
  51. package/docs/RECIPES.md +9 -0
  52. package/docs/RELEASE_CHECKLIST.md +116 -12
  53. package/docs/SECURITY_REVIEW.md +71 -0
  54. package/docs/SELF_HOSTED_TESTS.md +121 -0
  55. package/docs/SEMANTIC_DECISION_PLANE.md +71 -0
  56. package/docs/TEST_INTELLIGENCE.md +29 -0
  57. package/docs/TEST_PRUNING.md +14 -0
  58. package/docs/TROUBLESHOOTING.md +198 -1
  59. package/docs/UNIVERSAL_INTEGRATION.md +31 -0
  60. package/docs/assets/diagrams/forgeloop-code-attestation-flow.html +2 -2
  61. package/docs/assets/diagrams/forgeloop-code-attestation-flow.receipt.json +5 -5
  62. package/docs/assets/diagrams/forgeloop-code-attestation-flow.svg +1 -1
  63. package/docs/assets/diagrams/forgeloop-engineering-flow.html +39 -26
  64. package/docs/assets/diagrams/forgeloop-engineering-flow.receipt.json +6 -6
  65. package/docs/assets/diagrams/forgeloop-engineering-flow.svg +26 -26
  66. package/docs/assets/diagrams/forgeloop-verification-trust-flow.html +2 -1
  67. package/docs/assets/diagrams/forgeloop-verification-trust-flow.receipt.json +5 -5
  68. package/docs/assets/diagrams/forgeloop-verification-trust-flow.svg +1 -1
  69. package/docs/diagrams/README.md +13 -9
  70. package/docs/diagrams/forgeloop-code-attestation-flow.workflow.json +1 -1
  71. package/docs/diagrams/forgeloop-engineering-flow.workflow.json +24 -19
  72. package/docs/diagrams/forgeloop-verification-trust-flow.workflow.json +1 -0
  73. package/docs/diagrams/reviews/forgeloop-code-attestation-flow.review.json +4 -4
  74. package/docs/diagrams/reviews/forgeloop-engineering-flow.review.json +4 -4
  75. package/docs/diagrams/reviews/forgeloop-verification-trust-flow.review.json +4 -4
  76. package/docs/documentation-manifest.json +774 -16
  77. package/docs/protocol-requirements.json +24 -0
  78. package/package.json +43 -11
  79. package/schemas/config.schema.json +14 -0
  80. package/schemas/context-plan.schema.json +18 -0
  81. package/schemas/semantic-decision.schema.json +46 -0
  82. package/schemas/task-bundle.schema.json +7 -2
  83. package/schemas/test-utility.schema.json +44 -0
  84. package/scripts/CI_VALIDATORS.md +6 -6
  85. package/scripts/benchmark-jev.mjs +5 -0
  86. package/scripts/benchmark-test-intelligence.mjs +4 -0
  87. package/scripts/generate-agent-protocol-summary.mjs +6 -3
  88. package/scripts/generate-forgeloop-skill.mjs +133 -0
  89. package/scripts/jev-smoke.mjs +19 -0
  90. package/scripts/run-mcp-clean-tests.mjs +30 -0
  91. package/skills/forgeloop/README.md +9 -0
  92. package/skills/forgeloop/SKILL.md +77 -0
  93. package/skills/forgeloop/references/lifecycle.md +9 -0
  94. package/skills/forgeloop/references/recovery.md +7 -0
  95. package/skills/forgeloop/references/verification.md +7 -0
  96. package/src/adapters/agent-browser/assertions.js +47 -0
  97. package/src/adapters/agent-browser/commands.js +54 -0
  98. package/src/adapters/agent-browser/index.js +3 -0
  99. package/src/adapters/agent-browser/locator.js +40 -0
  100. package/src/adapters/agent-browser/process.js +215 -0
  101. package/src/adapters/agent-browser/provider.js +316 -0
  102. package/src/adapters/emulated-services/constants.js +24 -0
  103. package/src/adapters/emulated-services/index.js +7 -0
  104. package/src/adapters/emulated-services/process.js +162 -0
  105. package/src/adapters/emulated-services/provider.js +289 -0
  106. package/src/adapters/opensrc/normalize.js +90 -0
  107. package/src/adapters/opensrc/process.js +248 -0
  108. package/src/adapters/opensrc/provider.js +338 -0
  109. package/src/adapters/opensrc/search.js +264 -0
  110. package/src/adapters/temporary-paths.js +18 -0
  111. package/src/adapters/typesafe/client.js +28 -0
  112. package/src/adapters/typesafe/engine.js +63 -0
  113. package/src/adapters/typesafe/normalize.js +41 -0
  114. package/src/cli.js +218 -174
  115. package/src/commands/action-show.js +5 -2
  116. package/src/commands/advance.js +5 -1
  117. package/src/commands/baseline.js +13 -11
  118. package/src/commands/checkpoint-revalidate.js +192 -0
  119. package/src/commands/complete.js +19 -3
  120. package/src/commands/context-plan.js +38 -0
  121. package/src/commands/contract-create.js +266 -0
  122. package/src/commands/contract-revise.js +236 -0
  123. package/src/commands/decision-show.js +14 -0
  124. package/src/commands/decision-status.js +22 -0
  125. package/src/commands/discover.js +41 -0
  126. package/src/commands/doctor.js +51 -13
  127. package/src/commands/gate-record.js +194 -0
  128. package/src/commands/gate-revalidate.js +135 -0
  129. package/src/commands/handoff-list.js +6 -1
  130. package/src/commands/handoff-show.js +6 -1
  131. package/src/commands/migrate-protocol.js +2 -2
  132. package/src/commands/model-route.js +40 -0
  133. package/src/commands/next.js +7 -1
  134. package/src/commands/policy-diff.js +25 -4
  135. package/src/commands/progress.js +17 -11
  136. package/src/commands/record-diagnosis.js +3 -0
  137. package/src/commands/route.js +146 -18
  138. package/src/commands/semantic-plan.js +41 -0
  139. package/src/commands/status.js +6 -1
  140. package/src/commands/storage-backup.js +15 -0
  141. package/src/commands/storage-migrate.js +5 -0
  142. package/src/commands/storage-migration-resume.js +5 -0
  143. package/src/commands/storage-migration-status.js +44 -0
  144. package/src/commands/storage-restore-resume.js +7 -0
  145. package/src/commands/storage-restore.js +8 -0
  146. package/src/commands/task-abandon.js +224 -0
  147. package/src/commands/task-list.js +8 -43
  148. package/src/commands/task-migrate-contract-bootstrap-repair.js +288 -0
  149. package/src/commands/task-migrate.js +3 -3
  150. package/src/commands/task-recover.js +10 -2
  151. package/src/commands/task-repair-contract-bootstrap.js +263 -0
  152. package/src/commands/task-scope.js +18 -2
  153. package/src/commands/task-show.js +16 -2
  154. package/src/commands/test-inventory.js +5 -0
  155. package/src/commands/test-prune-plan.js +5 -0
  156. package/src/commands/test-prune-probe.js +5 -0
  157. package/src/commands/test-utility.js +5 -0
  158. package/src/commands/validate-protocol.js +39 -15
  159. package/src/commands/validate-receipt.js +8 -1
  160. package/src/config/guides.json +4 -0
  161. package/src/core/action-ledger-projection.js +10 -3
  162. package/src/core/actions.js +38 -75
  163. package/src/core/activation.js +11 -3
  164. package/src/core/approvals.js +17 -51
  165. package/src/core/artifact-registry.js +83 -2
  166. package/src/core/artifacts.js +81 -27
  167. package/src/core/attachment-paths.js +45 -0
  168. package/src/core/attestation-coverage.js +6 -1
  169. package/src/core/attestation-verifier.js +21 -2
  170. package/src/core/attestation.js +17 -6
  171. package/src/core/audit-ux.js +514 -0
  172. package/src/core/audit.js +6 -1
  173. package/src/core/browser-verification/constants.js +149 -0
  174. package/src/core/browser-verification/normalize.js +254 -0
  175. package/src/core/browser-verification/provider.js +519 -0
  176. package/src/core/browser-verification/service.js +115 -0
  177. package/src/core/bundles.js +160 -66
  178. package/src/core/checkpoint-revalidation.js +321 -0
  179. package/src/core/cli-command-definitions.js +350 -7
  180. package/src/core/code-manifest.js +9 -3
  181. package/src/core/command-executors.js +274 -108
  182. package/src/core/command-input.js +136 -44
  183. package/src/core/completion-artifacts.js +85 -34
  184. package/src/core/completion-ownership.js +19 -8
  185. package/src/core/completion-recovery-rebind.js +11 -1
  186. package/src/core/completion.js +64 -15
  187. package/src/core/config.js +3 -0
  188. package/src/core/conformance.js +2 -1
  189. package/src/core/context-compiler/budget.js +9 -0
  190. package/src/core/context-compiler/candidates.js +39 -0
  191. package/src/core/context-compiler/compiler.js +63 -0
  192. package/src/core/context-compiler/fingerprint.js +11 -0
  193. package/src/core/context-compiler/policy.js +13 -0
  194. package/src/core/context-compiler/result.js +23 -0
  195. package/src/core/continuity-lint.js +13 -2
  196. package/src/core/continuity-reconciliation.js +16 -3
  197. package/src/core/continuity.js +16 -8
  198. package/src/core/contract-bootstrap-recovery.js +656 -0
  199. package/src/core/contract-revision.js +209 -0
  200. package/src/core/decision/artifact.js +70 -0
  201. package/src/core/decision/benchmarks.js +103 -0
  202. package/src/core/decision/cache.js +27 -0
  203. package/src/core/decision/constants.js +58 -0
  204. package/src/core/decision/cutover.js +34 -0
  205. package/src/core/decision/engine.js +22 -0
  206. package/src/core/decision/errors.js +68 -0
  207. package/src/core/decision/events.js +104 -0
  208. package/src/core/decision/freshness.js +19 -0
  209. package/src/core/decision/normalizers/index.js +115 -0
  210. package/src/core/decision/policy.js +18 -0
  211. package/src/core/decision/projection.js +16 -0
  212. package/src/core/decision/question-registry.js +201 -0
  213. package/src/core/decision/request.js +26 -0
  214. package/src/core/decision/resolver.js +138 -0
  215. package/src/core/decision/result.js +58 -0
  216. package/src/core/decision/service.js +181 -0
  217. package/src/core/decision/state-builder.js +65 -0
  218. package/src/core/decision/task-bindings.js +35 -0
  219. package/src/core/decision/test-provider.js +32 -0
  220. package/src/core/decision/thresholds.js +15 -0
  221. package/src/core/diagnosis-model.js +11 -0
  222. package/src/core/diagnosis.js +10 -1
  223. package/src/core/diagnostic-projection.js +29 -12
  224. package/src/core/diagnostic-record.js +28 -3
  225. package/src/core/efficiency.js +6 -1
  226. package/src/core/error-codes.js +278 -0
  227. package/src/core/events.js +535 -147
  228. package/src/core/evidence-readiness.js +9 -0
  229. package/src/core/execution-prerequisites.js +36 -13
  230. package/src/core/execution-profile.js +63 -38
  231. package/src/core/execution.js +26 -40
  232. package/src/core/filesystem.js +11 -0
  233. package/src/core/gate-artifact.js +105 -19
  234. package/src/core/gate-provenance.js +125 -0
  235. package/src/core/handoff.js +26 -14
  236. package/src/core/history.js +39 -35
  237. package/src/core/hypothesis-projection.js +32 -0
  238. package/src/core/information-gain-projection.js +104 -100
  239. package/src/core/inspect.js +12 -3
  240. package/src/core/integration-invocation-policy.js +37 -4
  241. package/src/core/integration-resources.js +119 -87
  242. package/src/core/ledger-event-collection.js +189 -0
  243. package/src/core/ledger-relations.js +23 -0
  244. package/src/core/model-router/constants.js +10 -0
  245. package/src/core/model-router/policy.js +103 -0
  246. package/src/core/model-router/router.js +37 -0
  247. package/src/core/native-storage.js +12 -0
  248. package/src/core/next-action-continuity.js +31 -9
  249. package/src/core/next-action-model.js +58 -0
  250. package/src/core/next-action-phases.js +131 -43
  251. package/src/core/next-action-refresh.js +43 -9
  252. package/src/core/next-action-review-phase.js +9 -4
  253. package/src/core/next-action-verification-phase.js +2 -1
  254. package/src/core/next-action.js +56 -9
  255. package/src/core/phase.js +266 -103
  256. package/src/core/policy-engine.js +12 -13
  257. package/src/core/preflight-consistency.js +89 -62
  258. package/src/core/preflight-loaders.js +48 -9
  259. package/src/core/preflight-model.js +6 -1
  260. package/src/core/preflight.js +29 -12
  261. package/src/core/progress.js +21 -10
  262. package/src/core/protocol-info.js +68 -0
  263. package/src/core/protocol-migration.js +7 -6
  264. package/src/core/protocol.js +20 -0
  265. package/src/core/reconcile-closure.js +281 -67
  266. package/src/core/recovery-history.js +67 -47
  267. package/src/core/reflection.js +72 -77
  268. package/src/core/responsibility.js +25 -13
  269. package/src/core/resumability.js +154 -44
  270. package/src/core/route-artifact.js +28 -4
  271. package/src/core/router.js +67 -1
  272. package/src/core/runtime-context.js +123 -61
  273. package/src/core/schema-validation.js +11 -3
  274. package/src/core/security-review/constants.js +64 -0
  275. package/src/core/security-review/normalize.js +245 -0
  276. package/src/core/security-review/provider.js +204 -0
  277. package/src/core/security-review/service.js +134 -0
  278. package/src/core/semantic-planning/constants.js +19 -0
  279. package/src/core/semantic-planning/projection.js +94 -0
  280. package/src/core/semantic-planning/service.js +15 -0
  281. package/src/core/settlement.js +12 -1
  282. package/src/core/signing/bundle-file.js +53 -0
  283. package/src/core/signing/bundle-reference.js +15 -0
  284. package/src/core/signing/sigstore.js +60 -33
  285. package/src/core/signing/statement-file.js +27 -0
  286. package/src/core/sources.js +37 -0
  287. package/src/core/storage-runtime-registry.js +41 -0
  288. package/src/core/structural-quality/artifacts.js +20 -14
  289. package/src/core/structural-quality/service.js +81 -56
  290. package/src/core/target-layout.js +1 -1
  291. package/src/core/task-claim-state.js +249 -15
  292. package/src/core/task-command.js +21 -1
  293. package/src/core/task-conflict-inspection.js +133 -102
  294. package/src/core/task-descriptor.js +29 -22
  295. package/src/core/task-discovery.js +288 -90
  296. package/src/core/task-lock.js +66 -306
  297. package/src/core/task-migration-validation.js +5 -5
  298. package/src/core/task-migration.js +17 -287
  299. package/src/core/task-paths.js +13 -0
  300. package/src/core/task-recovery.js +1 -0
  301. package/src/core/task-snapshot.js +51 -8
  302. package/src/core/task-storage-migration.js +18 -0
  303. package/src/core/templates.js +23 -8
  304. package/src/core/test-intelligence/benchmarks.js +68 -0
  305. package/src/core/test-intelligence/inventory.js +73 -0
  306. package/src/core/test-intelligence/prune.js +94 -0
  307. package/src/core/test-intelligence/semantic-state.js +15 -0
  308. package/src/core/test-intelligence/service.js +40 -0
  309. package/src/core/test-intelligence/utility.js +50 -0
  310. package/src/core/trace.js +164 -105
  311. package/src/core/trajectory-evaluation.js +15 -3
  312. package/src/core/trajectory-metrics.js +47 -32
  313. package/src/core/transaction.js +16 -287
  314. package/src/core/verification-scope.js +20 -12
  315. package/src/core/work-state.js +100 -59
  316. package/src/integration.d.ts +492 -0
  317. package/src/integration.js +54 -0
  318. package/src/providers/README.md +47 -0
  319. package/src/providers/capabilities.js +46 -0
  320. package/src/providers/errors.js +15 -0
  321. package/src/providers/index.js +29 -0
  322. package/src/providers/json-snapshot.js +105 -0
  323. package/src/providers/registry.js +152 -0
  324. package/src/repository-index/binary-manager.js +7 -5
  325. package/src/storage/artifact-bytes.js +22 -0
  326. package/src/storage/attachment-binding.js +11 -0
  327. package/src/storage/attachment-files.js +82 -0
  328. package/src/storage/attachment-references.js +36 -0
  329. package/src/storage/backup.js +53 -0
  330. package/src/storage/capabilities.js +31 -0
  331. package/src/storage/connection-owner.js +119 -0
  332. package/src/storage/connection.js +376 -0
  333. package/src/storage/existing-project-scope.js +45 -0
  334. package/src/storage/export-destination.js +44 -0
  335. package/src/storage/exporter.js +284 -0
  336. package/src/storage/file-durability.js +46 -0
  337. package/src/storage/importer.js +461 -0
  338. package/src/storage/index.js +74 -0
  339. package/src/storage/leases.js +63 -0
  340. package/src/storage/ledger-event-snapshot.js +150 -0
  341. package/src/storage/ledger-relations.js +220 -0
  342. package/src/storage/legacy-maintenance-boundary.js +18 -0
  343. package/src/storage/legacy-signature.js +115 -0
  344. package/src/storage/maintenance-handoff.js +129 -0
  345. package/src/storage/maintenance-owner.js +42 -0
  346. package/src/storage/maintenance.js +310 -0
  347. package/src/storage/metadata-json.js +35 -0
  348. package/src/storage/migration-activate.js +59 -0
  349. package/src/storage/migration-archive.js +57 -0
  350. package/src/storage/migration-attachment-root.js +61 -0
  351. package/src/storage/migration-candidate.js +398 -0
  352. package/src/storage/migration-publication.js +143 -0
  353. package/src/storage/migration-rollback-admission.js +54 -0
  354. package/src/storage/migration-rollback-preparation.js +132 -0
  355. package/src/storage/migration-rollback-publication.js +183 -0
  356. package/src/storage/migration-rollback-release.js +66 -0
  357. package/src/storage/migration-rollback-source-stage.js +103 -0
  358. package/src/storage/migration-rollback.js +43 -0
  359. package/src/storage/migration-source-partition.js +56 -0
  360. package/src/storage/migration-source.js +255 -0
  361. package/src/storage/migration-terminal.js +39 -0
  362. package/src/storage/migration-validation.js +75 -0
  363. package/src/storage/migration.js +43 -0
  364. package/src/storage/operational-attachments.js +49 -0
  365. package/src/storage/operational-context.js +50 -0
  366. package/src/storage/project-backup.js +98 -0
  367. package/src/storage/project-bootstrap.js +24 -0
  368. package/src/storage/project-boundary.js +79 -0
  369. package/src/storage/project-read-snapshot.js +18 -0
  370. package/src/storage/project-replacement.js +137 -0
  371. package/src/storage/project-restore.js +203 -0
  372. package/src/storage/record-definitions.js +45 -0
  373. package/src/storage/repository.js +507 -0
  374. package/src/storage/restore-journal.js +62 -0
  375. package/src/storage/restore-layout.js +30 -0
  376. package/src/storage/restore-preparation.js +84 -0
  377. package/src/storage/restore-replacement-archive.js +162 -0
  378. package/src/storage/restore-replacement-owner.js +31 -0
  379. package/src/storage/restore-replacement-preparation.js +128 -0
  380. package/src/storage/restore-replacement.js +142 -0
  381. package/src/storage/restore-terminal.js +32 -0
  382. package/src/storage/runtime.js +31 -0
  383. package/src/storage/schema.js +214 -0
  384. package/src/storage/singleton-import.js +84 -0
  385. package/src/storage/snapshot-continuity.js +16 -0
  386. package/src/storage/snapshot.js +36 -0
  387. package/src/storage/storage-marker.js +79 -0
  388. package/src/storage/task-guards.js +107 -0
  389. package/src/storage/topology.js +42 -0
  390. package/src/storage/transaction.js +179 -0
  391. package/src/storage/unit-of-work.js +663 -0
  392. package/src/storage/windows-process-incarnation.js +206 -0
  393. package/.forgeloop/forgeloop.gitignore +0 -4
  394. package/LICENSE-DOCS.md +0 -13
  395. package/src/core/transaction-maintenance.js +0 -70
@@ -18,6 +18,275 @@ Commands that support structured machine-readable output document `--json` in th
18
18
 
19
19
  <!-- END FORGELOOP GENERATED: cli-common-options -->
20
20
 
21
+ ## Storage maintenance
22
+
23
+ ### `storage-migration-status`
24
+
25
+ Inspects the bootstrap storage layout and retained maintenance ownership even
26
+ when ordinary commands are excluded. It neither opens nor validates the
27
+ database, removes an exclusion, nor proves that its owner is alive or dead.
28
+
29
+ <!-- BEGIN FORGELOOP GENERATED: cli:storage-migration-status:options -->
30
+
31
+ - `--path <directory>`: target project directory (default: current directory)
32
+ - `--json`: emit bootstrap storage layout and retained maintenance ownership
33
+
34
+ <!-- END FORGELOOP GENERATED: cli:storage-migration-status:options -->
35
+
36
+ ### `storage-migration-resume`
37
+
38
+ Requires externally excluded writers and the exact retained dead local owner UUID reported by `storage-migration-status`. Continues verified STAGED, ARCHIVING or ARCHIVED publication, or verifies PUBLISHED current state without restoration. Verified unpublished staging can be retained and rebuilt. Unrecorded capture, unbound candidate files and interrupted owner handoffs remain refused.
39
+
40
+ <!-- BEGIN FORGELOOP GENERATED: cli:storage-migration-resume:options -->
41
+
42
+ - `--path <directory>`: target project directory (default: current directory)
43
+ - `--destination <path>`: retained migration directory relative to the project
44
+ - `--expected-owner <uuid>`: exact retained maintenance owner reported by storage-migration-status
45
+ - `--writers-quiesced`: assert that all writers, including older clients, have been externally stopped
46
+ - `--reconcile-unbound-handoff`: preserve an unbound legacy handoff by atomic archival before resuming the exact dead owner
47
+ - `--json`: emit recovery verification metadata
48
+
49
+ <!-- END FORGELOOP GENERATED: cli:storage-migration-resume:options -->
50
+
51
+ ### `storage-rollback-resume`
52
+
53
+ Resume a recorded source rollback publication under an exact dead local maintenance owner. Stop and exclude all writers; keep native writes excluded. The clean supported legacy target is validated before owner adoption. Actual source/native locations, captured bytes, independent backup and owner history are revalidated before operation journals change. Target validation must pass for every task before maintenance release.
54
+
55
+ ```bash
56
+ forgeloop storage-rollback-resume --path <project> --destination <retained-migration> --expected-owner <uuid> --legacy-root <clean-supported-checkout> --writers-quiesced --native-writes-excluded --json
57
+ ```
58
+
59
+ Recorded `PREPARING`/`READY` preparation and staging journals, and `SWITCHING`, `NATIVE_RETAINED` and `RESTORED` publication journals are supported. Incomplete staging copies are retained before rebuilding from verified captured source. Unrecorded directories, remote/live owners and ambiguous bytes are refused and retained for reconciliation. No deletion or replacement of retained source/native backups is authorized by failure.
60
+
61
+ <!-- BEGIN FORGELOOP GENERATED: cli:storage-rollback-resume:options -->
62
+
63
+ - `--path <directory>`: target project directory (default: current directory)
64
+ - `--expected-owner <uuid>`: exact retained dead local owner reported by storage-migration-status
65
+ - `--destination <path>`: retained migration with recorded rollback preparation, staging or publication
66
+ - `--legacy-root <path>`: clean supported pinned legacy checkout used for actual target validation
67
+ - `--writers-quiesced`: assert that all writers, including older clients, have been externally stopped and excluded
68
+ - `--native-writes-excluded`: assert that native writes have been excluded since migration; snapshot equality alone does not prove this
69
+ - `--json`: emit restoration and target-validation metadata
70
+
71
+ <!-- END FORGELOOP GENERATED: cli:storage-rollback-resume:options -->
72
+
73
+ ### `storage-rollback`
74
+
75
+ Conditionally restore the preserved legacy source before any native writes have been accepted. Stop and exclude every writer, including old clients and background integrations. Inventory the clients and retain their exclusion throughout validation. Snapshot equality does not prove that no native writes occurred: `--native-writes-excluded` is an explicit operator assertion about the entire interval since migration. If native writes occurred, use a verified reverse export for the exact target version or forward repair instead.
76
+
77
+ ```bash
78
+ forgeloop storage-rollback --path <project> --destination <retained-migration> --legacy-root <clean-supported-checkout> --writers-quiesced --native-writes-excluded --json
79
+ ```
80
+
81
+ The supported validator checkout is the clean tracked Git commit `ee9ce11123d4e728d3dbc92f5d62d4bf41bb79c5`. Other target commits are refused. The command validates that target before acquiring maintenance, revalidates retained source and unchanged native authority, backs up native database and referenced attachment bytes, stages captured source, retains original native files by rename, and publishes exact source roots. It runs the pinned legacy CLI against every retained task and checks the task catalog before allowing maintenance release. The command executes Git and the explicitly supplied target CLI locally.
82
+
83
+ Original native files, independent backups, captured source, inventories and validation receipts are retained. No automatic disposal occurs. On failure, keep all writers excluded and inspect maintenance owner and retained operation state. A failed attempt is not authorization to delete exclusion or retry over retained paths. Use `storage-rollback-resume` only for recorded preparation, staging or publication states. Unbound attempts remain refused; the original migration resume command must not be used to recover rollback operations.
84
+
85
+ <!-- BEGIN FORGELOOP GENERATED: cli:storage-rollback:options -->
86
+
87
+ - `--path <directory>`: target project directory (default: current directory)
88
+ - `--destination <path>`: retained published migration directory relative to the project
89
+ - `--legacy-root <path>`: clean supported pinned legacy checkout used for actual target validation
90
+ - `--writers-quiesced`: assert that all writers, including older clients, have been externally stopped and excluded
91
+ - `--native-writes-excluded`: assert that native writes have been excluded since migration; snapshot equality alone does not prove this
92
+ - `--json`: emit restoration and target-validation metadata
93
+
94
+ <!-- END FORGELOOP GENERATED: cli:storage-rollback:options -->
95
+
96
+ ### `storage-migrate`
97
+
98
+ Initial migration requires a new retained destination and externally stopped writers, including older clients. It validates and retains legacy sources, archives operational files, activates SQLite, and verifies current state. Failed attempts retain maintenance exclusion and evidence. Resume supports verified publication stages and identified unpublished staging; unrecorded capture and unbound candidate files remain refused.
99
+
100
+ <!-- BEGIN FORGELOOP GENERATED: cli:storage-migrate:options -->
101
+
102
+ - `--path <directory>`: target project directory (default: current directory)
103
+ - `--destination <path>`: new retained migration directory relative to the project; missing parent directories are created
104
+ - `--writers-quiesced`: assert that all writers, including older clients, have been externally stopped
105
+ - `--json`: emit migration publication and verification metadata
106
+
107
+ <!-- END FORGELOOP GENERATED: cli:storage-migrate:options -->
108
+
109
+ ### `storage-restore-resume`
110
+
111
+ Resumes restore after confirming that its exact retained local owner is dead. Requires externally excluded writers. Partial snapshots and prior rebuild intents are retained before rebuilding from verified source; completed preparation must pass source parity and domain validation. Conflicting intent records, unbound objects and changed preterminal databases remain refused. Terminal verification preserves accepted later work.
112
+
113
+ ```bash
114
+ forgeloop storage-restore-resume --path /path/to/project --operation <restore-uuid> --expected-owner <owner-uuid> --writers-quiesced --json
115
+ ```
116
+
117
+ <!-- BEGIN FORGELOOP GENERATED: cli:storage-restore-resume:options -->
118
+
119
+ - `--path <directory>`: target project directory (default: current directory)
120
+ - `--operation <uuid>`: exact retained restore journal operation UUID
121
+ - `--expected-owner <uuid>`: exact retained maintenance owner UUID
122
+ - `--replace-active`: explicitly select active replacement with retained outgoing authority
123
+ - `--writers-quiesced`: assert that all writers have been externally stopped
124
+ - `--json`: emit restore recovery metadata
125
+
126
+ <!-- END FORGELOOP GENERATED: cli:storage-restore-resume:options -->
127
+
128
+ ### `storage-restore`
129
+
130
+ Restores an attachment-inclusive backup into a project with no existing operational state. Requires explicit exclusion of all writers. Retains an independent snapshot and restore journal; failed operations keep maintenance exclusion. Active-project replacement is not supported yet.
131
+
132
+ ```bash
133
+ forgeloop storage-restore --path /path/to/fresh-project --source /path/to/verified-backup --writers-quiesced --json
134
+ ```
135
+
136
+ <!-- BEGIN FORGELOOP GENERATED: cli:storage-restore:options -->
137
+
138
+ - `--path <directory>`: target project directory (default: current directory)
139
+ - `--source <path>`: verified attachment-inclusive backup directory; absolute or relative to the target project
140
+ - `--replace-active`: explicitly select active replacement with retained outgoing authority
141
+ - `--writers-quiesced`: assert that all writers have been externally stopped
142
+ - `--json`: emit restore activation metadata
143
+
144
+ <!-- END FORGELOOP GENERATED: cli:storage-restore:options -->
145
+
146
+ ### `storage-backup`
147
+
148
+ Creates a database-only backup of an existing canonical SQLite project. The
149
+ destination is relative to the project, its parent must exist, and an existing
150
+ destination is never replaced. External attachments are not included.
151
+
152
+ <!-- BEGIN FORGELOOP GENERATED: cli:storage-backup:options -->
153
+
154
+ - `--path <directory>`: target project directory (default: current directory)
155
+ - `--destination <path>`: new backup file or attachment-inclusive directory relative to the project; parent directory must exist
156
+ - `--include-attachments`: create a new backup directory including all canonically referenced attachment bytes
157
+ - `--json`: emit backup metadata
158
+
159
+ <!-- END FORGELOOP GENERATED: cli:storage-backup:options -->
160
+
161
+ ## Semantic decision projections
162
+
163
+ ### `decision-status`
164
+
165
+ Reports the pinned Jev configuration and, only when explicitly requested,
166
+ performs a bounded provider health check.
167
+
168
+ <!-- BEGIN FORGELOOP GENERATED: cli:decision-status:options -->
169
+
170
+ - `--path <directory>`: target project directory (default: current directory)
171
+ - `--health`: perform a bounded live Jev health check when credentials are configured
172
+ - `--json`: emit decision-plane status as JSON
173
+
174
+ <!-- END FORGELOOP GENERATED: cli:decision-status:options -->
175
+
176
+ ### `decision-show`
177
+
178
+ Shows a persisted semantic decision without performing a live request.
179
+
180
+ <!-- BEGIN FORGELOOP GENERATED: cli:decision-show:options -->
181
+
182
+ - `--path <directory>`: target project directory (default: current directory)
183
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
184
+ - `--decision <id>`: decision artifact ID
185
+ - `--json`: emit the decision artifact as JSON
186
+
187
+ <!-- END FORGELOOP GENERATED: cli:decision-show:options -->
188
+
189
+ ### `context-plan`
190
+
191
+ Compiles a bounded, non-authoritative context plan.
192
+
193
+ <!-- BEGIN FORGELOOP GENERATED: cli:context-plan:options -->
194
+
195
+ - `--path <directory>`: target project directory (default: current directory)
196
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
197
+ - `--decision <id>`: persisted Jev decision artifact ID
198
+ - `--profile <profile>`: bounded context budget profile
199
+ - `--json`: emit the bounded context plan as JSON
200
+
201
+ <!-- END FORGELOOP GENERATED: cli:context-plan:options -->
202
+
203
+ ### `model-route`
204
+
205
+ Projects the deterministic model-routing floor. Jev may escalate but cannot
206
+ lower the floor or select vendor-specific models.
207
+
208
+ <!-- BEGIN FORGELOOP GENERATED: cli:model-route:options -->
209
+
210
+ - `--path <directory>`: target project directory (default: current directory)
211
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
212
+ - `--decision <id>`: persisted Jev decision artifact ID
213
+ - `--work <type>`: declared work type
214
+ - `--surface <value>`: affected surface (repeatable)
215
+ - `--risk <value>`: task risk (repeatable)
216
+ - `--platform <value>`: affected platform (repeatable)
217
+ - `--behavior-change`: declare behavior change
218
+ - `--executable-change`: declare executable/configuration change
219
+ - `--generation-required`: declare that generation is required
220
+ - `--architecture-change`: declare an architectural change
221
+ - `--ambiguous`: declare unresolved ambiguity
222
+ - `--json`: emit model-route projection as JSON
223
+
224
+ <!-- END FORGELOOP GENERATED: cli:model-route:options -->
225
+
226
+ ### `semantic-plan`
227
+
228
+ Projects bounded failure, diagnosis, or review planning from ForgeLoop-owned
229
+ question-set categories.
230
+
231
+ <!-- BEGIN FORGELOOP GENERATED: cli:semantic-plan:options -->
232
+
233
+ - `--path <directory>`: target project directory (default: current directory)
234
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
235
+ - `--decision <id>`: persisted Jev decision artifact ID
236
+ - `--kind <failure|diagnosis|review>`: bounded semantic planning projection
237
+ - `--input <json>`: bounded failure, diagnosis, or review context
238
+ - `--json`: emit semantic plan projection as JSON
239
+
240
+ <!-- END FORGELOOP GENERATED: cli:semantic-plan:options -->
241
+
242
+ ### `test-inventory`
243
+
244
+ Discovers deterministic test units and stable test IDs.
245
+
246
+ <!-- BEGIN FORGELOOP GENERATED: cli:test-inventory:options -->
247
+
248
+ - `--path <directory>`: target project directory (default: current directory)
249
+ - `--json`: emit deterministic test inventory as JSON
250
+
251
+ <!-- END FORGELOOP GENERATED: cli:test-inventory:options -->
252
+
253
+ ### `test-utility`
254
+
255
+ Persists non-evidence test utility analysis. It never removes tests.
256
+
257
+ <!-- BEGIN FORGELOOP GENERATED: cli:test-utility:options -->
258
+
259
+ - `--path <directory>`: target project directory (default: current directory)
260
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
261
+ - `--json`: emit test utility analysis as JSON
262
+
263
+ <!-- END FORGELOOP GENERATED: cli:test-utility:options -->
264
+
265
+ ### `test-prune-plan`
266
+
267
+ Projects a safe non-destructive test pruning plan.
268
+
269
+ <!-- BEGIN FORGELOOP GENERATED: cli:test-prune-plan:options -->
270
+
271
+ - `--path <directory>`: target project directory (default: current directory)
272
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
273
+ - `--json`: emit test prune plan as JSON
274
+
275
+ <!-- END FORGELOOP GENERATED: cli:test-prune-plan:options -->
276
+
277
+ ### `test-prune-probe`
278
+
279
+ Probes only eligible candidates in isolation and never modifies the live tree.
280
+
281
+ <!-- BEGIN FORGELOOP GENERATED: cli:test-prune-probe:options -->
282
+
283
+ - `--path <directory>`: target project directory (default: current directory)
284
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
285
+ - `--test <id>`: stable test ID to probe in isolation
286
+ - `--json`: emit test prune probe as JSON
287
+
288
+ <!-- END FORGELOOP GENERATED: cli:test-prune-probe:options -->
289
+
21
290
  ---
22
291
 
23
292
  ## CLI Syntax Contract
@@ -58,10 +327,10 @@ error codes. Default output and default JSON remain unchanged.
58
327
 
59
328
  | Category | Commands |
60
329
  | --- | --- |
61
- | **Inspection & Diagnostics** | [`protocol-info`](#protocol-info), [`doctor`](#doctor), [`index-status`](#index-status), [`search`](#search), [`metrics`](#metrics), [`usage-record`](#usage-record), [`efficiency`](#efficiency), [`eval`](#eval), [`history`](#history), [`trace`](#trace), [`reflect`](#reflect), [`progress`](#progress), [`profile-interview`](#profile-interview), [`inspect`](#inspect), [`status`](#status), [`validate-state`](#validate-state), [`validate-protocol`](#validate-protocol) |
62
- | **Setup & Maintenance** | [`init`](#init), [`index-setup`](#index-setup), [`index-start`](#index-start), [`index-stop`](#index-stop), [`index-rebuild`](#index-rebuild), [`update`](#update), [`task-migrate`](#task-migrate), [`migrate-protocol`](#migrate-protocol), [`task-unlock`](#task-unlock), [`task-recover`](#task-recover), [`task-repair-legacy-recovery`](#task-repair-legacy-recovery), [`task-resume`](#task-resume) |
63
- | **Lifecycle & State** | [`activate`](#activate), [`route`](#route), [`preflight`](#preflight), [`advance`](#advance), [`next`](#next), [`record-diagnosis`](#record-diagnosis), [`record-intervention`](#record-intervention), [`record-hypothesis-disposition`](#record-hypothesis-disposition), [`record-decision-criterion`](#record-decision-criterion), [`complete`](#complete), [`clear-state`](#clear-state), [`reconcile-closure`](#reconcile-closure), [`task-create`](#task-create), [`task-list`](#task-list), [`task-show`](#task-show), [`task-lock-status`](#task-lock-status), [`task-scope`](#task-scope) |
64
- | **Verification & Completion** | [`quality-baseline`](#quality-baseline), [`quality-verify`](#quality-verify), [`quality-status`](#quality-status), [`prepare-completion`](#prepare-completion), [`run-check`](#run-check), [`record-check`](#record-check), [`record-terminal-result`](#record-terminal-result), [`audit`](#audit), [`report`](#report), [`validate-receipt`](#validate-receipt), [`verify-scope`](#verify-scope) |
330
+ | **Setup & Maintenance** | [`storage-restore-resume`](#storage-restore-resume), [`storage-restore`](#storage-restore), [`storage-migration-status`](#storage-migration-status), [`storage-migration-resume`](#storage-migration-resume), [`storage-rollback`](#storage-rollback), [`storage-rollback-resume`](#storage-rollback-resume), [`storage-migrate`](#storage-migrate), [`storage-backup`](#storage-backup), [`contract-revise`](#contract-revise), [`init`](#init), [`index-setup`](#index-setup), [`index-start`](#index-start), [`index-stop`](#index-stop), [`index-rebuild`](#index-rebuild), [`update`](#update), [`checkpoint-revalidate`](#checkpoint-revalidate), [`task-migrate`](#task-migrate), [`migrate-protocol`](#migrate-protocol), [`task-unlock`](#task-unlock), [`task-recover`](#task-recover), [`task-abandon`](#task-abandon), [`task-repair-contract-bootstrap`](#task-repair-contract-bootstrap), [`task-migrate-contract-bootstrap-repair`](#task-migrate-contract-bootstrap-repair), [`task-repair-legacy-recovery`](#task-repair-legacy-recovery), [`task-resume`](#task-resume) |
331
+ | **Inspection & Diagnostics** | [`protocol-info`](#protocol-info), [`decision-status`](#decision-status), [`decision-show`](#decision-show), [`context-plan`](#context-plan), [`model-route`](#model-route), [`semantic-plan`](#semantic-plan), [`test-inventory`](#test-inventory), [`test-utility`](#test-utility), [`test-prune-plan`](#test-prune-plan), [`doctor`](#doctor), [`index-status`](#index-status), [`search`](#search), [`metrics`](#metrics), [`usage-record`](#usage-record), [`efficiency`](#efficiency), [`eval`](#eval), [`history`](#history), [`trace`](#trace), [`reflect`](#reflect), [`progress`](#progress), [`profile-interview`](#profile-interview), [`inspect`](#inspect), [`status`](#status), [`validate-state`](#validate-state), [`validate-protocol`](#validate-protocol) |
332
+ | **Verification & Completion** | [`test-prune-probe`](#test-prune-probe), [`quality-baseline`](#quality-baseline), [`quality-verify`](#quality-verify), [`quality-status`](#quality-status), [`prepare-completion`](#prepare-completion), [`run-check`](#run-check), [`record-check`](#record-check), [`record-terminal-result`](#record-terminal-result), [`audit`](#audit), [`report`](#report), [`validate-receipt`](#validate-receipt), [`verify-scope`](#verify-scope) |
333
+ | **Lifecycle & State** | [`discover`](#discover), [`contract-create`](#contract-create), [`gate-record`](#gate-record), [`gate-revalidate`](#gate-revalidate), [`activate`](#activate), [`route`](#route), [`preflight`](#preflight), [`advance`](#advance), [`next`](#next), [`record-diagnosis`](#record-diagnosis), [`record-intervention`](#record-intervention), [`record-hypothesis-disposition`](#record-hypothesis-disposition), [`record-decision-criterion`](#record-decision-criterion), [`complete`](#complete), [`clear-state`](#clear-state), [`reconcile-closure`](#reconcile-closure), [`task-create`](#task-create), [`task-list`](#task-list), [`task-show`](#task-show), [`task-lock-status`](#task-lock-status), [`task-scope`](#task-scope) |
65
334
  | **Cross-Harness Continuity** | [`continuity`](#continuity), [`record-continuity`](#record-continuity), [`reconcile-continuity`](#reconcile-continuity), [`clear-continuity`](#clear-continuity), [`handoff-create`](#handoff-create), [`handoff-list`](#handoff-list), [`handoff-show`](#handoff-show) |
66
335
  | **Durable Actions & Approvals** | [`run-action`](#run-action), [`action-propose`](#action-propose), [`action-record`](#action-record), [`action-show`](#action-show), [`action-reconcile`](#action-reconcile), [`action-verify`](#action-verify), [`action-authorize`](#action-authorize), [`approval-request`](#approval-request), [`approval-resolve`](#approval-resolve) |
67
336
  | **Policy & Auditing** | [`policy`](#policy), [`policy-discover`](#policy-discover), [`policy-status`](#policy-status), [`policy-diff`](#policy-diff), [`rule-verify`](#rule-verify), [`baseline`](#baseline), [`bundle`](#bundle) |
@@ -755,7 +1024,7 @@ Reports the public compatibility handshake required by external ForgeLoop harnes
755
1024
 
756
1025
  - **Example**:
757
1026
 
758
- <!-- FORGELOOP EXAMPLE: cli-reference:protocol-info | exit=0 | json.commands.0.name=protocol-info -->
1027
+ <!-- FORGELOOP EXAMPLE: cli-reference:protocol-info | exit=0 | json.protocolVersion=1 | json.features.operationalStorage.sqlite.format=sqlite -->
759
1028
  ```bash
760
1029
  forgeloop protocol-info --json
761
1030
  ```
@@ -767,7 +1036,7 @@ Initializes ForgeLoop in a target repository.
767
1036
 
768
1037
  - **Purpose**: Installs canonical instruction templates under `.forgeloop/kit/`, creates discovery shims at root, and prepares `.forgeloop/`.
769
1038
  - **When to use**: Once when onboarding a new repository to ForgeLoop.
770
- - **Mutation**: Writes `.forgeloop/kit/`, `.forgeloop/forgeloop.gitignore`, `AGENTS.md`, `CLAUDE.md`, `.cursor/rules/project-loop.mdc`, `.github/copilot-instructions.md`.
1039
+ - **Mutation**: Writes `.forgeloop/kit/`, `.forgeloop/.gitignore`, `AGENTS.md`, `CLAUDE.md`, `.cursor/rules/project-loop.mdc`, `.github/copilot-instructions.md`.
771
1040
  - **Options**:
772
1041
 
773
1042
  <!-- BEGIN FORGELOOP GENERATED: cli:init:options -->
@@ -834,6 +1103,107 @@ Updates the managed instruction kit to match the current ForgeLoop package versi
834
1103
 
835
1104
  ## 2. Activation & Planning
836
1105
 
1106
+ ### `discover`
1107
+
1108
+ Records the canonical initial discovery milestone for a newly created task.
1109
+
1110
+ - **Purpose**: Transitions a valid post-`task-create` task from `RECEIVED` to the derived `DISCOVERING` phase without creating synthetic work state.
1111
+ - **When to use**: When `next` returns `DISCOVER` for a task with no work-state checkpoint.
1112
+ - **Mutation**: Appends the task-scoped discovery milestone to the event ledger.
1113
+ - **Options**:
1114
+
1115
+ <!-- BEGIN FORGELOOP GENERATED: cli:discover:options -->
1116
+
1117
+ - `--path <directory>`: target project directory (default: current directory)
1118
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
1119
+ - `--json`: emit structured discovery output as JSON
1120
+
1121
+ <!-- END FORGELOOP GENERATED: cli:discover:options -->
1122
+
1123
+ ### `contract-create`
1124
+
1125
+ Persists a validated contract and materializes the first real lifecycle checkpoint.
1126
+
1127
+ - **Purpose**: Creates a real contract after discovery and writes `work-state.json` with its actual contract fingerprint.
1128
+ - **When to use**: When `next` returns `CREATE_CONTRACT` after discovery.
1129
+ - **Mutation**: Writes the task contract, task work state, and append-only lifecycle events transactionally.
1130
+ - **Options**:
1131
+
1132
+ <!-- BEGIN FORGELOOP GENERATED: cli:contract-create:options -->
1133
+
1134
+ - `--path <directory>`: target project directory (default: current directory)
1135
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
1136
+ - `--contract-file <path>`: validated JSON contract relative to the target
1137
+ - `--preset <name>`: bounded contract preset: documentation, bug, feature, or release
1138
+ - `--json`: emit structured contract output as JSON
1139
+
1140
+ <!-- END FORGELOOP GENERATED: cli:contract-create:options -->
1141
+
1142
+ ### `contract-revise`
1143
+
1144
+ Replaces a validated pre-execution contract through an append-only, transaction-witnessed revision.
1145
+
1146
+ - **Purpose**: Canonically revise a contract in `CONTRACT_READY`, `ROUTED`, or `PLANNED` before execution starts.
1147
+ - **When to use**: When the task objective or scope changes and the existing derived route, preflight, gates, or plan must no longer authorize the work.
1148
+ - **Mutation**: Writes the replacement contract, resets derived authorization, appends `CONTRACT_REVISED`, and appends an adjacent `TRANSACTION_COMMITTED(operation=contract-revise)` witness.
1149
+ - **Restrictions**: Requires exactly one of `--preset` or `--contract-file`; a `PLANNED` task rewinds to `ROUTED`, and old route/preflight/plan evidence must be regenerated.
1150
+ - **Options**:
1151
+
1152
+ <!-- BEGIN FORGELOOP GENERATED: cli:contract-revise:options -->
1153
+
1154
+ - `--path <directory>`: target project directory (default: current directory)
1155
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
1156
+ - `--contract-file <path>`: validated replacement JSON contract relative to the target
1157
+ - `--preset <name>`: bounded replacement contract preset: documentation, bug, feature, or release
1158
+ - `--json`: emit structured contract revision output as JSON
1159
+
1160
+ <!-- END FORGELOOP GENERATED: cli:contract-revise:options -->
1161
+
1162
+ ### `gate-record`
1163
+
1164
+ Records a gate satisfaction or rejection decision for a task's preflight gate lifecycle.
1165
+
1166
+ - **Purpose**: Records structured evidence that a named gate has been satisfied, rejected, or deferred, with optional artifact and decision evidence.
1167
+ - **When to use**: During the preflight gate lifecycle to progress gate status from pending to resolved.
1168
+ - **Mutation**: Writes a gate artifact under the task namespace and appends a `GATE_SATISFIED` or `GATE_REJECTED` protocol event. A `GATE_SATISFIED` event after `CONTRACT_REVISED` must be immediately followed by the canonical `TRANSACTION_COMMITTED(operation=gate-record)` witness; pre-revision historical gate events remain backward compatible. Repeated satisfied recording is event-idempotent within the current contract epoch, even if the gate artifact is refreshed.
1169
+ - **Options**:
1170
+
1171
+ <!-- BEGIN FORGELOOP GENERATED: cli:gate-record:options -->
1172
+
1173
+ - `--path <directory>`: target project directory (default: current directory)
1174
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
1175
+ - `--gate <name>`: required gate name
1176
+ - `--status <status>`: satisfied, unverified, or blocked
1177
+ - `--artifact <path>`: project-relative evidence artifact (repeatable)
1178
+ - `--decision <text>`: caller-recorded gate decision (repeatable)
1179
+ - `--unknown <text>`: known unresolved item (repeatable)
1180
+ - `--assumption <text>`: approved local assumption (repeatable)
1181
+ - `--evidence-file <path>`: bounded local descriptive evidence JSON
1182
+ - `--json`: emit structured gate output as JSON
1183
+
1184
+ <!-- END FORGELOOP GENERATED: cli:gate-record:options -->
1185
+
1186
+ ### `gate-revalidate`
1187
+
1188
+ Refreshes a satisfied gate whose evidence artifacts changed after execution
1189
+ started, while preserving the original approval and append-only history.
1190
+
1191
+ - **Purpose**: Revalidate stale gate artifacts only through current task identity and active write claims.
1192
+ - **When to use**: When `next` returns `REVALIDATE_GATES` for a post-execution task.
1193
+ - **Mutation**: Refreshes the task-scoped gate artifact and appends `GATE_REVALIDATED` with an adjacent `TRANSACTION_COMMITTED(operation=gate-revalidate)` witness.
1194
+ - **Restrictions**: Does not bypass `gate-record`'s `E_PHASE_FREEZE`; requires `--acknowledge-stale`, a coherent current route, and changed artifacts covered by active claims.
1195
+ - **Options**:
1196
+
1197
+ <!-- BEGIN FORGELOOP GENERATED: cli:gate-revalidate:options -->
1198
+
1199
+ - `--path <directory>`: target project directory (default: current directory)
1200
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
1201
+ - `--gate <name>`: satisfied gate to refresh after safe artifact drift
1202
+ - `--acknowledge-stale`: explicitly acknowledge refresh of stale gate artifacts inside active task claims
1203
+ - `--json`: emit structured gate revalidation output as JSON
1204
+
1205
+ <!-- END FORGELOOP GENERATED: cli:gate-revalidate:options -->
1206
+
837
1207
  ### `route`
838
1208
 
839
1209
  Calculates and persists deterministic engineering guide routing.
@@ -1967,6 +2337,31 @@ Clears canonical work-state checkpoint for the current task.
1967
2337
  forgeloop clear-state
1968
2338
  ```
1969
2339
 
2340
+ ### `checkpoint-revalidate`
2341
+
2342
+ Revalidates a safe pre-execution `ROUTED` checkpoint after repository-only
2343
+ drift.
2344
+
2345
+ - **Purpose**: Rebinds the checkpoint to ForgeLoop's current repository fingerprint while preserving lifecycle, contract, route, guide, gate, check, and evidence identity.
2346
+ - **When to use**: When `next` returns `REVALIDATE_CHECKPOINT` with only `E_REPOSITORY_CHANGED` / `E_STATE_REVALIDATION_REQUIRED`.
2347
+ - **Mutation**: Advances the state revision and appends a transaction-bound `CHECKPOINT_REVALIDATED` event.
2348
+ - **Safety Note**: It does not accept caller-supplied repository identity, revise contracts, reroute, fabricate evidence, or operate after execution starts. Unsupported drift fails closed with `E_CHECKPOINT_REVALIDATION_UNSAFE`.
2349
+ - **Options**:
2350
+
2351
+ <!-- BEGIN FORGELOOP GENERATED: cli:checkpoint-revalidate:options -->
2352
+
2353
+ - `--path <directory>`: target project directory (default: current directory)
2354
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
2355
+ - `--json`: emit structured revalidation output as JSON
2356
+
2357
+ <!-- END FORGELOOP GENERATED: cli:checkpoint-revalidate:options -->
2358
+
2359
+ - **Example**:
2360
+
2361
+ ```bash
2362
+ forgeloop checkpoint-revalidate --task <id> --json
2363
+ ```
2364
+
1970
2365
  ---
1971
2366
 
1972
2367
  ### `reconcile-closure`
@@ -1974,9 +2369,9 @@ Clears canonical work-state checkpoint for the current task.
1974
2369
  Reconciles the checkpoint of an EXECUTING, VERIFYING, or REVIEWING task whose objective is already satisfied in the current repository.
1975
2370
 
1976
2371
  - **Purpose**: Refresh the work-state repository fingerprint of a stale EXECUTING, VERIFYING, or REVIEWING task after repository movement, using executed contract-bound evidence that the objective is present, so the canonical completion pipeline can close it.
1977
- - **When to use**: When a task is stuck in EXECUTING, VERIFYING, or REVIEWING with `E_REPOSITORY_CHANGED` / `E_STATE_REVALIDATION_REQUIRED` and its objective was already satisfied by other changes in the current repository. A REVIEWING task also needs authorized completion recovery.
2372
+ - **When to use**: When a task is stuck in EXECUTING, VERIFYING, or REVIEWING with `E_REPOSITORY_CHANGED` / `E_STATE_REVALIDATION_REQUIRED` and its objective was already satisfied by other changes in the current repository. A REVIEWING task may use an existing authorized completion-recovery snapshot, or the narrow bootstrap path when the only drift is repository movement and no completion rejection has been persisted.
1978
2373
  - **Mutation**: Appends a `CHECKPOINT_RECONCILED` ledger event (previous/current repository fingerprints plus evidence) and refreshes the work-state repository fingerprint. The phase stays unchanged until the canonical pipeline advances it; claims release only through canonical `COMPLETE`.
1979
- - **Safety Note**: Refuses other phases, fresh checkpoints, contract or artifact drift, invalid ledgers, unknown requirements, and failing evidence.
2374
+ - **Safety Note**: Refuses other phases, fresh checkpoints, contract or required-artifact drift, invalid ledgers, invalid claim ownership, unauthorized persisted completion rejection, unknown requirements, and failing evidence. It never appends completion events or releases claims.
1980
2375
  - **Options**:
1981
2376
 
1982
2377
  <!-- BEGIN FORGELOOP GENERATED: cli:reconcile-closure:options -->
@@ -2155,6 +2550,8 @@ Migrates a legacy 1.0 single-task `.forgeloop/` layout into a namespaced task di
2155
2550
  <!-- BEGIN FORGELOOP GENERATED: cli:task-migrate:options -->
2156
2551
 
2157
2552
  - `--path <directory>`: target project directory (default: current directory)
2553
+ - `--destination <path>`: retained source and publication evidence destination
2554
+ - `--writers-quiesced`: confirm all legacy writers are stopped and excluded
2158
2555
  - `--dry-run`: show planned migration actions without moving files
2159
2556
  - `--json`: emit structured output as JSON
2160
2557
 
@@ -2185,6 +2582,8 @@ protocol version.
2185
2582
  <!-- BEGIN FORGELOOP GENERATED: cli:migrate-protocol:options -->
2186
2583
 
2187
2584
  - `--path <directory>`: target project directory (default: current directory)
2585
+ - `--destination <path>`: retained source and publication evidence destination
2586
+ - `--writers-quiesced`: confirm all legacy writers are stopped and excluded
2188
2587
  - `--to <protocolVersion>`: target supported protocol version
2189
2588
  - `--dry-run`: show migration actions without writing or deleting artifacts
2190
2589
  - `--json`: emit structured migration result as JSON
@@ -2251,6 +2650,111 @@ Fake, missing, corrupt, or mismatched recovery state is
2251
2650
  `E_TASK_CLAIM_OWNERSHIP_INCONSISTENT`/`E_TASK_RECOVERY_INCONSISTENT`; historical
2252
2651
  claims remain reserved.
2253
2652
 
2653
+ ### `task-abandon`
2654
+
2655
+ Explicitly abandons an active non-terminal task without fabricating completion.
2656
+
2657
+ - **Purpose**: Releases validated write claims for a deliberately abandoned task while preserving its current lifecycle phase, append-only history, and durable recovery boundary. This is the canonical escape from an active-task claim deadlock; it is not a completion or publication operation.
2658
+ - **When to use**: Only when the exact task ID is known and the caller has deliberately acknowledged abandonment. Use `task-recover` only for tasks already classified `STALE` or `ABANDONED`.
2659
+ - **Mutation**: Appends `TASK_ABANDONED` and its `TRANSACTION_COMMITTED(operation=task-abandon)` witness, then writes `recovery.json` with classification `ABANDONED` and authority `CALLER_ACKNOWLEDGED`. Work state remains unchanged and claims resolve to `RELEASED_BY_RECOVERY`.
2660
+ - **Options**:
2661
+
2662
+ <!-- BEGIN FORGELOOP GENERATED: cli:task-abandon:options -->
2663
+
2664
+ - `--path <directory>`: target project directory (default: current directory)
2665
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
2666
+ - `--acknowledge-abandonment`: explicitly acknowledge abandonment of an active task (required; not completion authority)
2667
+ - `--json`: emit structured abandonment output as JSON
2668
+
2669
+ <!-- END FORGELOOP GENERATED: cli:task-abandon:options -->
2670
+
2671
+ - **Example**:
2672
+
2673
+ ```bash
2674
+ forgeloop task-abandon --task task-001 --acknowledge-abandonment --json
2675
+ ```
2676
+
2677
+ The command requires an explicit task ID and acknowledgement. It refuses
2678
+ `COMPLETE`, already recovered, inconsistent, or non-active ownership states
2679
+ and never writes `COMPLETION_VALIDATED`. Use `task-resume` to reacquire claims
2680
+ through the normal lifecycle when work should continue.
2681
+
2682
+ ### `task-repair-contract-bootstrap`
2683
+
2684
+ Repairs only the exact historical duplicate contract bootstrap defect.
2685
+
2686
+ - **Purpose**: Recognizes the narrow append-only signature of a duplicate `CONTRACT_VALIDATED` followed by a duplicate `contract-create` commit, verifies the current contract and route/state bindings, and reconstructs the earliest proven checkpoint without rewriting existing events.
2687
+ - **Mutation**: Under project/task serialization, writes the reconciled work-state and appends `CONTRACT_BOOTSTRAP_REPAIR_RECORDED` plus `TRANSACTION_COMMITTED` in one transaction.
2688
+ - **Options**:
2689
+
2690
+ <!-- BEGIN FORGELOOP GENERATED: cli:task-repair-contract-bootstrap:options -->
2691
+
2692
+ - `--path <directory>`: target project directory (default: current directory)
2693
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
2694
+ - `--acknowledge-repair`: explicit caller acknowledgement of the exact append-only repair (required)
2695
+ - `--json`: emit structured repair output as JSON
2696
+
2697
+ <!-- END FORGELOOP GENERATED: cli:task-repair-contract-bootstrap:options -->
2698
+
2699
+ - **Example**:
2700
+
2701
+ ```bash
2702
+ forgeloop task-repair-contract-bootstrap --task task-001 --acknowledge-repair --json
2703
+ ```
2704
+
2705
+ The command requires fresh caller acknowledgement. The marker records the
2706
+ repair-time checkpoint as an immutable anchor, including `reconstructedPhase`,
2707
+ `reconstructedStateFingerprint`, `reconstructedStateRevision`, and the
2708
+ repair-time `routeFingerprint`; it does not freeze the task at that checkpoint.
2709
+ The marker must be immediately followed by its
2710
+ `TRANSACTION_COMMITTED(operation=task-repair-contract-bootstrap)` witness.
2711
+ After the anchor revision, normal canonical lifecycle evolution is allowed, but
2712
+ state rollback, missing state, invalid current contract/route identity, or
2713
+ ledger/state incoherence fails closed with `E_CONTRACT_BOOTSTRAP_REPAIR_INVALID`.
2714
+ If a later route fingerprint differs from the marker, the current route and
2715
+ state must be canonically coherent and the ledger must contain a ForgeLoop-
2716
+ generated `ROUTE_REBOUND` witness immediately followed by the matching
2717
+ `TRANSACTION_COMMITTED(operation=route)`. The witness binds the current route
2718
+ fingerprint, the repair-time contract fingerprint, and the previous route
2719
+ fingerprint; a historical route transaction, or route and state fields changed
2720
+ together without this identity witness, is not authorization. A contract-only
2721
+ repair may establish its first route through canonical `runRoute`, recording a
2722
+ null previous route fingerprint. A proven `ROUTE_VALIDATED` milestone also
2723
+ requires a present, valid route artifact bound to the current contract, while a
2724
+ history without `ROUTE_VALIDATED` may repair to `CONTRACT_READY` without a
2725
+ route artifact. After repair, entering `DESIGNING` additionally requires the
2726
+ canonical `DESIGN_GATE_STARTED` event.
2727
+
2728
+ ### `task-migrate-contract-bootstrap-repair`
2729
+
2730
+ Migrates the exact legacy contract bootstrap repair marker produced before
2731
+ `reconstructedStateRevision` was required.
2732
+
2733
+ - **Purpose**: Proves the legacy marker, its immediate repair transaction, the current contract, the reconstructed work-state, and (for `ROUTED`) the persisted route. Strict validation remains fail-closed until the migration witness is appended.
2734
+ - **Mutation**: Appends `CONTRACT_BOOTSTRAP_REPAIR_MIGRATION_RECORDED` plus `TRANSACTION_COMMITTED(operation=task-migrate-contract-bootstrap-repair)`; it never rewrites the legacy marker or state/contract/route artifacts.
2735
+ - **Options**:
2736
+
2737
+ <!-- BEGIN FORGELOOP GENERATED: cli:task-migrate-contract-bootstrap-repair:options -->
2738
+
2739
+ - `--path <directory>`: target project directory (default: current directory)
2740
+ - `--task <id>`: task ID to operate on (when omitted, resolved from context or single active task)
2741
+ - `--acknowledge-migration`: fresh explicit caller acknowledgement of the exact legacy marker migration (required)
2742
+ - `--json`: emit structured migration output as JSON
2743
+
2744
+ <!-- END FORGELOOP GENERATED: cli:task-migrate-contract-bootstrap-repair:options -->
2745
+
2746
+ - **Example**:
2747
+
2748
+ ```bash
2749
+ forgeloop task-migrate-contract-bootstrap-repair --task task-001 --acknowledge-migration --json
2750
+ ```
2751
+
2752
+ Only the exact legacy schema and immediate repair boundary are eligible. Any
2753
+ near-miss, later lifecycle activity, state/route drift, live lock, unknown lock,
2754
+ or corrupt lock fails closed with
2755
+ `E_CONTRACT_BOOTSTRAP_REPAIR_MIGRATION_INVALID`/`E_TASK_LOCKED`. The operation
2756
+ is idempotent only when the complete migrated relationship remains valid.
2757
+
2254
2758
  ### `task-resume`
2255
2759
 
2256
2760
  Reacquires a recovered task's write claims and restores ordinary mutation authority.
@@ -9,11 +9,11 @@ bug-free or secure.
9
9
 
10
10
  | Level | Meaning |
11
11
  | --- | --- |
12
- | `PROCESSED` | Protocol artifacts exist but verification is not complete. |
12
+ | `PROCESSED` | Minimum reported level; verification is not complete. `MISSING`, `DISABLED`, and `INVALID` remain separate status results. |
13
13
  | `VERIFIED` | Completion, evidence bindings, manifest, and current content validate. |
14
14
  | `ATTESTED` | `VERIFIED` plus a cryptographically valid signature and trusted signer policy. |
15
15
 
16
- `PROCESSED` is an existence/parsing result, not a trust claim. A manifest or
16
+ `PROCESSED` is a lower-bound reported level, not a trust claim. A manifest or
17
17
  statement that merely exists never becomes `ATTESTED`; the signature must be
18
18
  verified against the configured signer identity, issuer, and trust policy.
19
19
  Attestation binds bounded source/evidence relationships. It does not prove