@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
@@ -1,95 +1,111 @@
1
- import { runDoctor } from "../commands/doctor.js";
2
- import { runStatus } from "../commands/status.js";
3
- import { runValidateState } from "../commands/validate-state.js";
4
- import { runClearState } from "../commands/clear-state.js";
5
- import { inspectTarget } from "../commands/inspect.js";
6
- import { runInit } from "../commands/init.js";
7
- import { runRoute } from "../commands/route.js";
8
- import { runValidateReceipt } from "../commands/validate-receipt.js";
9
- import { runValidateProtocol } from "../commands/validate-protocol.js";
10
- import { runUpdate } from "../commands/update.js";
11
- import { runActivate } from "../commands/activate.js";
12
- import { runAdvance } from "../commands/advance.js";
13
- import { runPreflight } from "../commands/preflight.js";
14
- import { runQualityBaseline } from "../commands/quality-baseline.js";
15
- import { runQualityVerify } from "../commands/quality-verify.js";
16
- import { runQualityStatus } from "../commands/quality-status.js";
17
- import { runComplete } from "../commands/complete.js";
18
- import { runAudit } from "../commands/audit.js";
19
- import { runReport } from "../commands/report.js";
20
- import { runPolicy } from "../commands/policy.js";
21
- import { runPolicyDiscover } from "../commands/policy-discover.js";
22
- import { runPolicyStatus } from "../commands/policy-status.js";
23
- import { runPolicyDiff } from "../commands/policy-diff.js";
24
- import { runRuleVerify } from "../commands/rule-verify.js";
25
- import { runBaseline } from "../commands/baseline.js";
26
- import { runProfileInterview } from "../commands/profile-interview.js";
27
- import { runBundle } from "../commands/bundle.js";
28
- import { runPrepareCompletion } from "../commands/prepare-completion.js";
29
- import { runRecordCheck } from "../commands/record-check.js";
30
- import { runCheck } from "../commands/run-check.js";
31
- import { runAction } from "../commands/run-action.js";
32
- import { runActionPropose } from "../commands/action-propose.js";
33
- import { runActionRecord } from "../commands/action-record.js";
34
- import { runActionShow } from "../commands/action-show.js";
35
- import { runActionAuthorize } from "../commands/action-authorize.js";
36
- import { runActionVerify } from "../commands/action-verify.js";
37
- import { runActionReconcile } from "../commands/action-reconcile.js";
38
- import { runMetrics } from "../commands/metrics.js";
39
- import { runUsageRecord } from "../commands/usage-record.js";
40
- import { runEfficiency } from "../commands/efficiency.js";
41
- import { runEval } from "../commands/eval.js";
42
- import { runApprovalRequest } from "../commands/approval-request.js";
43
- import { runApprovalResolve } from "../commands/approval-resolve.js";
44
- import { reconcileClosure } from "../commands/reconcile-closure.js";
45
- import { runRecordTerminalResult } from "../commands/record-terminal-result.js";
46
- import { runRecordDiagnosis } from "../commands/record-diagnosis.js";
47
- import { runRecordIntervention } from "../commands/record-intervention.js";
48
- import { runRecordHypothesisDisposition } from "../commands/record-hypothesis-disposition.js";
49
- import { runHistory } from "../commands/history.js";
50
- import { runTrace } from "../commands/trace.js";
51
- import { runReflect } from "../commands/reflect.js";
52
- import { runProgress } from "../commands/progress.js";
53
- import { runRecordDecisionCriterion } from "../commands/record-decision-criterion.js";
54
- import { runNext } from "../commands/next.js";
55
- import { runContinuity } from "../commands/continuity.js";
56
- import { runRecordContinuity } from "../commands/record-continuity.js";
57
- import { runReconcileContinuity } from "../commands/reconcile-continuity.js";
58
- import { runClearContinuity } from "../commands/clear-continuity.js";
59
- import { runTaskCreate } from "../commands/task-create.js";
60
- import { runTaskList } from "../commands/task-list.js";
61
- import { runTaskShow } from "../commands/task-show.js";
62
- import { runTaskScope } from "../commands/task-scope.js";
63
- import { runTaskMigrate } from "../commands/task-migrate.js";
64
- import { runMigrateProtocol } from "../commands/migrate-protocol.js";
65
- import { runTaskUnlock } from "../commands/task-unlock.js";
66
- import { runTaskRecover } from "../commands/task-recover.js";
67
- import { runTaskResume } from "../commands/task-resume.js";
68
- import { runTaskRepairLegacyRecovery } from "../commands/task-repair-legacy-recovery.js";
69
- import { runTaskLockStatus } from "../commands/task-lock-status.js";
70
- import { runProtocolInfo } from "../commands/protocol-info.js";
71
- import { runWorkspaceBind } from "../commands/workspace-bind.js";
72
- import { runWorkspaceStatus } from "../commands/workspace-status.js";
73
- import { runHandoffCreate } from "../commands/handoff-create.js";
74
- import { runHandoffList } from "../commands/handoff-list.js";
75
- import { runHandoffShow } from "../commands/handoff-show.js";
76
- import { runHandoffAccept } from "../commands/handoff-accept.js";
77
- import { runResponsibilitySet } from "../commands/responsibility-set.js";
78
- import { runResponsibilityStatus } from "../commands/responsibility-status.js";
79
- import { runVerifyScope } from "../commands/verify-scope.js";
80
- import { runAttestationCreate } from "../commands/attestation-create.js";
81
- import { runAttestationVerify } from "../commands/attestation-verify.js";
82
- import { runAttestationStatus } from "../commands/attestation-status.js";
83
- import { runAttestationVerifyRange } from "../commands/attestation-verify-range.js";
1
+ const runDoctor = async (...args) => (await import("../commands/doctor.js")).runDoctor(...args);
2
+ const runStatus = async (...args) => (await import("../commands/status.js")).runStatus(...args);
3
+ const runValidateState = async (...args) => (await import("../commands/validate-state.js")).runValidateState(...args);
4
+ const runClearState = async (...args) => (await import("../commands/clear-state.js")).runClearState(...args);
5
+ const runCheckpointRevalidate = async (...args) => (await import("../commands/checkpoint-revalidate.js")).runCheckpointRevalidate(...args);
6
+ const inspectTarget = async (...args) => (await import("../commands/inspect.js")).inspectTarget(...args);
7
+ const runInit = async (...args) => (await import("../commands/init.js")).runInit(...args);
8
+ const runRoute = async (...args) => (await import("../commands/route.js")).runRoute(...args);
9
+ const runValidateReceipt = async (...args) => (await import("../commands/validate-receipt.js")).runValidateReceipt(...args);
10
+ const runValidateProtocol = async (...args) => (await import("../commands/validate-protocol.js")).runValidateProtocol(...args);
11
+ const runUpdate = async (...args) => (await import("../commands/update.js")).runUpdate(...args);
12
+ const runActivate = async (...args) => (await import("../commands/activate.js")).runActivate(...args);
13
+ const runAdvance = async (...args) => (await import("../commands/advance.js")).runAdvance(...args);
14
+ const runPreflight = async (...args) => (await import("../commands/preflight.js")).runPreflight(...args);
15
+ const runQualityBaseline = async (...args) => (await import("../commands/quality-baseline.js")).runQualityBaseline(...args);
16
+ const runQualityVerify = async (...args) => (await import("../commands/quality-verify.js")).runQualityVerify(...args);
17
+ const runQualityStatus = async (...args) => (await import("../commands/quality-status.js")).runQualityStatus(...args);
18
+ const runComplete = async (...args) => (await import("../commands/complete.js")).runComplete(...args);
19
+ const runAudit = async (...args) => (await import("../commands/audit.js")).runAudit(...args);
20
+ const runReport = async (...args) => (await import("../commands/report.js")).runReport(...args);
21
+ const runPolicy = async (...args) => (await import("../commands/policy.js")).runPolicy(...args);
22
+ const runPolicyDiscover = async (...args) => (await import("../commands/policy-discover.js")).runPolicyDiscover(...args);
23
+ const runPolicyStatus = async (...args) => (await import("../commands/policy-status.js")).runPolicyStatus(...args);
24
+ const runPolicyDiff = async (...args) => (await import("../commands/policy-diff.js")).runPolicyDiff(...args);
25
+ const runRuleVerify = async (...args) => (await import("../commands/rule-verify.js")).runRuleVerify(...args);
26
+ const runBaseline = async (...args) => (await import("../commands/baseline.js")).runBaseline(...args);
27
+ const runProfileInterview = async (...args) => (await import("../commands/profile-interview.js")).runProfileInterview(...args);
28
+ const runBundle = async (...args) => (await import("../commands/bundle.js")).runBundle(...args);
29
+ const runPrepareCompletion = async (...args) => (await import("../commands/prepare-completion.js")).runPrepareCompletion(...args);
30
+ const runRecordCheck = async (...args) => (await import("../commands/record-check.js")).runRecordCheck(...args);
31
+ const runCheck = async (...args) => (await import("../commands/run-check.js")).runCheck(...args);
32
+ const runAction = async (...args) => (await import("../commands/run-action.js")).runAction(...args);
33
+ const runActionPropose = async (...args) => (await import("../commands/action-propose.js")).runActionPropose(...args);
34
+ const runActionRecord = async (...args) => (await import("../commands/action-record.js")).runActionRecord(...args);
35
+ const runActionShow = async (...args) => (await import("../commands/action-show.js")).runActionShow(...args);
36
+ const runActionAuthorize = async (...args) => (await import("../commands/action-authorize.js")).runActionAuthorize(...args);
37
+ const runActionVerify = async (...args) => (await import("../commands/action-verify.js")).runActionVerify(...args);
38
+ const runActionReconcile = async (...args) => (await import("../commands/action-reconcile.js")).runActionReconcile(...args);
39
+ const runMetrics = async (...args) => (await import("../commands/metrics.js")).runMetrics(...args);
40
+ const runUsageRecord = async (...args) => (await import("../commands/usage-record.js")).runUsageRecord(...args);
41
+ const runEfficiency = async (...args) => (await import("../commands/efficiency.js")).runEfficiency(...args);
42
+ const runEval = async (...args) => (await import("../commands/eval.js")).runEval(...args);
43
+ const runApprovalRequest = async (...args) => (await import("../commands/approval-request.js")).runApprovalRequest(...args);
44
+ const runApprovalResolve = async (...args) => (await import("../commands/approval-resolve.js")).runApprovalResolve(...args);
45
+ const reconcileClosure = async (...args) => (await import("../commands/reconcile-closure.js")).reconcileClosure(...args);
46
+ const runRecordTerminalResult = async (...args) => (await import("../commands/record-terminal-result.js")).runRecordTerminalResult(...args);
47
+ const runRecordDiagnosis = async (...args) => (await import("../commands/record-diagnosis.js")).runRecordDiagnosis(...args);
48
+ const runRecordIntervention = async (...args) => (await import("../commands/record-intervention.js")).runRecordIntervention(...args);
49
+ const runRecordHypothesisDisposition = async (...args) => (await import("../commands/record-hypothesis-disposition.js")).runRecordHypothesisDisposition(...args);
50
+ const runHistory = async (...args) => (await import("../commands/history.js")).runHistory(...args);
51
+ const runTrace = async (...args) => (await import("../commands/trace.js")).runTrace(...args);
52
+ const runReflect = async (...args) => (await import("../commands/reflect.js")).runReflect(...args);
53
+ const runProgress = async (...args) => (await import("../commands/progress.js")).runProgress(...args);
54
+ const runRecordDecisionCriterion = async (...args) => (await import("../commands/record-decision-criterion.js")).runRecordDecisionCriterion(...args);
55
+ const runNext = async (...args) => (await import("../commands/next.js")).runNext(...args);
56
+ const runContinuity = async (...args) => (await import("../commands/continuity.js")).runContinuity(...args);
57
+ const runRecordContinuity = async (...args) => (await import("../commands/record-continuity.js")).runRecordContinuity(...args);
58
+ const runReconcileContinuity = async (...args) => (await import("../commands/reconcile-continuity.js")).runReconcileContinuity(...args);
59
+ const runClearContinuity = async (...args) => (await import("../commands/clear-continuity.js")).runClearContinuity(...args);
60
+ const runTaskCreate = async (...args) => (await import("../commands/task-create.js")).runTaskCreate(...args);
61
+ const runDiscover = async (...args) => (await import("../commands/discover.js")).runDiscover(...args);
62
+ const runContractCreate = async (...args) => (await import("../commands/contract-create.js")).runContractCreate(...args);
63
+ const runContractRevise = async (...args) => (await import("../commands/contract-revise.js")).runContractRevise(...args);
64
+ const runGateRecord = async (...args) => (await import("../commands/gate-record.js")).runGateRecord(...args);
65
+ const runGateRevalidate = async (...args) => (await import("../commands/gate-revalidate.js")).runGateRevalidate(...args);
66
+ const runTaskList = async (...args) => (await import("../commands/task-list.js")).runTaskList(...args);
67
+ const runTaskShow = async (...args) => (await import("../commands/task-show.js")).runTaskShow(...args);
68
+ const runTaskScope = async (...args) => (await import("../commands/task-scope.js")).runTaskScope(...args);
69
+ const runTaskMigrate = async (...args) => (await import("../commands/task-migrate.js")).runTaskMigrate(...args);
70
+ const runMigrateProtocol = async (...args) => (await import("../commands/migrate-protocol.js")).runMigrateProtocol(...args);
71
+ const runTaskUnlock = async (...args) => (await import("../commands/task-unlock.js")).runTaskUnlock(...args);
72
+ const runTaskRecover = async (...args) => (await import("../commands/task-recover.js")).runTaskRecover(...args);
73
+ const runTaskAbandon = async (...args) => (await import("../commands/task-abandon.js")).runTaskAbandon(...args);
74
+ const runTaskResume = async (...args) => (await import("../commands/task-resume.js")).runTaskResume(...args);
75
+ const runTaskRepairLegacyRecovery = async (...args) => (await import("../commands/task-repair-legacy-recovery.js")).runTaskRepairLegacyRecovery(...args);
76
+ const runTaskRepairContractBootstrap = async (...args) => (await import("../commands/task-repair-contract-bootstrap.js")).runTaskRepairContractBootstrap(...args);
77
+ const runTaskMigrateContractBootstrapRepair = async (...args) => (await import("../commands/task-migrate-contract-bootstrap-repair.js")).runTaskMigrateContractBootstrapRepair(...args);
78
+ const runTaskLockStatus = async (...args) => (await import("../commands/task-lock-status.js")).runTaskLockStatus(...args);
79
+ const runProtocolInfo = async (...args) => (await import("../commands/protocol-info.js")).runProtocolInfo(...args);
80
+ const runDecisionStatus = async (...args) => (await import("../commands/decision-status.js")).runDecisionStatus(...args);
81
+ const runDecisionShow = async (...args) => (await import("../commands/decision-show.js")).runDecisionShow(...args);
82
+ const runContextPlan = async (...args) => (await import("../commands/context-plan.js")).runContextPlan(...args);
83
+ const runModelRoute = async (...args) => (await import("../commands/model-route.js")).runModelRoute(...args);
84
+ const runSemanticPlan = async (...args) => (await import("../commands/semantic-plan.js")).runSemanticPlan(...args);
85
+ const runTestInventory = async (...args) => (await import("../commands/test-inventory.js")).runTestInventory(...args);
86
+ const runTestUtility = async (...args) => (await import("../commands/test-utility.js")).runTestUtility(...args);
87
+ const runTestPrunePlan = async (...args) => (await import("../commands/test-prune-plan.js")).runTestPrunePlan(...args);
88
+ const runTestPruneProbe = async (...args) => (await import("../commands/test-prune-probe.js")).runTestPruneProbe(...args);
89
+ const runWorkspaceBind = async (...args) => (await import("../commands/workspace-bind.js")).runWorkspaceBind(...args);
90
+ const runWorkspaceStatus = async (...args) => (await import("../commands/workspace-status.js")).runWorkspaceStatus(...args);
91
+ const runHandoffCreate = async (...args) => (await import("../commands/handoff-create.js")).runHandoffCreate(...args);
92
+ const runHandoffList = async (...args) => (await import("../commands/handoff-list.js")).runHandoffList(...args);
93
+ const runHandoffShow = async (...args) => (await import("../commands/handoff-show.js")).runHandoffShow(...args);
94
+ const runHandoffAccept = async (...args) => (await import("../commands/handoff-accept.js")).runHandoffAccept(...args);
95
+ const runResponsibilitySet = async (...args) => (await import("../commands/responsibility-set.js")).runResponsibilitySet(...args);
96
+ const runResponsibilityStatus = async (...args) => (await import("../commands/responsibility-status.js")).runResponsibilityStatus(...args);
97
+ const runVerifyScope = async (...args) => (await import("../commands/verify-scope.js")).runVerifyScope(...args);
98
+ const runAttestationCreate = async (...args) => (await import("../commands/attestation-create.js")).runAttestationCreate(...args);
99
+ const runAttestationVerify = async (...args) => (await import("../commands/attestation-verify.js")).runAttestationVerify(...args);
100
+ const runAttestationStatus = async (...args) => (await import("../commands/attestation-status.js")).runAttestationStatus(...args);
101
+ const runAttestationVerifyRange = async (...args) => (await import("../commands/attestation-verify-range.js")).runAttestationVerifyRange(...args);
84
102
  import { exitCodeForAttestationResult } from "./exit-codes.js";
85
- import {
86
- runRepositoryIndexRebuild,
87
- runRepositoryIndexSetup,
88
- runRepositoryIndexStart,
89
- runRepositoryIndexStatus,
90
- runRepositoryIndexStop,
91
- runSearch,
92
- } from "../commands/repository-index.js";
103
+ const runRepositoryIndexRebuild = async (...args) => (await import("../commands/repository-index.js")).runRepositoryIndexRebuild(...args);
104
+ const runRepositoryIndexSetup = async (...args) => (await import("../commands/repository-index.js")).runRepositoryIndexSetup(...args);
105
+ const runRepositoryIndexStart = async (...args) => (await import("../commands/repository-index.js")).runRepositoryIndexStart(...args);
106
+ const runRepositoryIndexStatus = async (...args) => (await import("../commands/repository-index.js")).runRepositoryIndexStatus(...args);
107
+ const runRepositoryIndexStop = async (...args) => (await import("../commands/repository-index.js")).runRepositoryIndexStop(...args);
108
+ const runSearch = async (...args) => (await import("../commands/repository-index.js")).runSearch(...args);
93
109
 
94
110
  /**
95
111
  * Canonical transport-neutral command executors.
@@ -102,11 +118,114 @@ import {
102
118
  * The CLI renders these results; MCP and other integrations consume them
103
119
  * directly. No ownership, recovery, or lifecycle logic may live here.
104
120
  */
105
- export const COMMAND_EXECUTORS = {
121
+ const RAW_COMMAND_EXECUTORS = {
122
+ "storage-restore-resume": async ({ target, packageRoot, options }) => {
123
+ const { runStorageRestoreResume } = await import("../commands/storage-restore-resume.js");
124
+ return { result: await runStorageRestoreResume({ target, packageRoot, operationId: options.operationId, expectedOwnerId: options.expectedOwnerId, writersQuiesced: options.writersQuiesced, replaceActive: options.replaceActive }), exitCode: 0 };
125
+ },
126
+ "storage-restore": async ({ target, packageRoot, options }) => {
127
+ const { runStorageRestore } = await import("../commands/storage-restore.js");
128
+ return { result: await runStorageRestore({ target, packageRoot, source: options.source, writersQuiesced: options.writersQuiesced, replaceActive: options.replaceActive }), exitCode: 0 };
129
+ },
130
+ "storage-migration-status": async ({ target }) => {
131
+ const { runStorageMigrationStatus } = await import("../commands/storage-migration-status.js");
132
+ return { result: await runStorageMigrationStatus({ target }), exitCode: 0 };
133
+ },
134
+ "storage-migration-resume": async ({ target, packageRoot, options }) => {
135
+ const { runStorageMigrationResume } = await import("../commands/storage-migration-resume.js");
136
+ return { result: await runStorageMigrationResume({ target, packageRoot, destination: options.destination, expectedOwnerId: options.expectedOwnerId, writersQuiesced: options.writersQuiesced, acknowledgeUnboundHandoff: options.acknowledgeUnboundHandoff }), exitCode: 0 };
137
+ },
138
+ "storage-rollback-resume": async ({ target, packageRoot, options }) => {
139
+ const { resumeProjectStorageRollback } = await import("../storage/migration-rollback.js");
140
+ return { result: await resumeProjectStorageRollback(target, { packageRoot, destination: options.destination, legacyRoot: options.legacyRoot, expectedOwnerId: options.expectedOwnerId, writersQuiesced: options.writersQuiesced, nativeWritesExcluded: options.nativeWritesExcluded }), exitCode: 0 };
141
+ },
142
+ "storage-rollback": async ({ target, packageRoot, options }) => {
143
+ const { rollbackProjectStorage } = await import("../storage/migration-rollback.js");
144
+ return { result: await rollbackProjectStorage(target, { packageRoot, destination: options.destination, legacyRoot: options.legacyRoot, writersQuiesced: options.writersQuiesced, nativeWritesExcluded: options.nativeWritesExcluded }), exitCode: 0 };
145
+ },
146
+ "storage-migrate": async ({ target, packageRoot, options }) => {
147
+ const { runStorageMigrate } = await import("../commands/storage-migrate.js");
148
+ return { result: await runStorageMigrate({ target, packageRoot, destination: options.destination, writersQuiesced: options.writersQuiesced }), exitCode: 0 };
149
+ },
150
+ "storage-backup": async ({ target, options }) => {
151
+ const { runStorageBackup } = await import("../commands/storage-backup.js");
152
+ return { result: await runStorageBackup({ target, destination: options.destination, includeAttachments: options.includeAttachments }), exitCode: 0 };
153
+ },
154
+ discover: async ({ target, packageRoot, options }) => ({
155
+ result: await runDiscover({ target, packageRoot, taskId: options.taskId }),
156
+ exitCode: 0,
157
+ }),
158
+ "contract-create": async ({ target, packageRoot, options }) => ({
159
+ result: await runContractCreate({ target, packageRoot, taskId: options.taskId, preset: options.preset, contractFile: options.contractFile }),
160
+ exitCode: 0,
161
+ }),
162
+ "contract-revise": async ({ target, packageRoot, options }) => ({
163
+ result: await runContractRevise({ target, packageRoot, taskId: options.taskId, preset: options.preset, contractFile: options.contractFile }),
164
+ exitCode: 0,
165
+ }),
166
+ "gate-record": async ({ target, packageRoot, options }) => ({
167
+ result: await runGateRecord({ target, packageRoot, taskId: options.taskId, gate: options.gate, status: options.gateStatus, artifacts: options.gateArtifacts, decisions: options.gateDecisions, unknowns: options.gateUnknowns, assumptions: options.gateAssumptions, evidenceFile: options.gateEvidenceFile }),
168
+ exitCode: 0,
169
+ }),
170
+ "gate-revalidate": async ({ target, packageRoot, options }) => ({
171
+ result: await runGateRevalidate({ target, packageRoot, taskId: options.taskId, gate: options.gate, acknowledgeStale: options.acknowledgeStale }),
172
+ exitCode: 0,
173
+ }),
106
174
  "protocol-info": async ({ packageVersion }) => ({
107
175
  result: await runProtocolInfo({ packageVersion }),
108
176
  exitCode: 0,
109
177
  }),
178
+ "decision-status": async ({ target, packageRoot, options }) => ({
179
+ result: await runDecisionStatus({ target, packageRoot, health: options.health }),
180
+ exitCode: 0,
181
+ }),
182
+ "decision-show": async ({ target, packageRoot, options }) => ({
183
+ result: await runDecisionShow({ target, packageRoot, taskId: options.taskId, decisionId: options.decisionId }),
184
+ exitCode: 0,
185
+ }),
186
+ "context-plan": async ({ target, packageRoot, options }) => ({
187
+ result: await runContextPlan({ target, packageRoot, taskId: options.taskId, decisionId: options.decisionId, profile: options.profile ?? "balanced" }),
188
+ exitCode: 0,
189
+ }),
190
+ "model-route": async ({ target, packageRoot, options }) => ({
191
+ result: await runModelRoute({
192
+ target, packageRoot, taskId: options.taskId, decisionId: options.decisionId,
193
+ workType: options.workType,
194
+ surfaces: options.surfaces,
195
+ risks: options.risks,
196
+ platforms: options.platforms,
197
+ behaviorChange: options.behaviorChange,
198
+ executableChange: options.executableChange,
199
+ generationRequired: options.generationRequired,
200
+ architectureChange: options.architectureChange,
201
+ ambiguity: options.ambiguity,
202
+ }),
203
+ exitCode: 0,
204
+ }),
205
+ "semantic-plan": async ({ target, packageRoot, options }) => ({
206
+ result: await runSemanticPlan({
207
+ target, packageRoot, taskId: options.taskId, decisionId: options.decisionId,
208
+ kind: options.semanticPlanKind,
209
+ input: options.semanticPlanInput ?? {},
210
+ }),
211
+ exitCode: 0,
212
+ }),
213
+ "test-inventory": async ({ target }) => ({
214
+ result: await runTestInventory({ target }),
215
+ exitCode: 0,
216
+ }),
217
+ "test-utility": async ({ target, packageRoot, options }) => ({
218
+ result: await runTestUtility({ target, packageRoot, taskId: options.taskId }),
219
+ exitCode: 0,
220
+ }),
221
+ "test-prune-plan": async ({ target, packageRoot, options }) => ({
222
+ result: await runTestPrunePlan({ target, packageRoot, taskId: options.taskId }),
223
+ exitCode: 0,
224
+ }),
225
+ "test-prune-probe": async ({ target, packageRoot, options }) => ({
226
+ result: await runTestPruneProbe({ target, packageRoot, taskId: options.taskId, testId: options.testId }),
227
+ exitCode: 0,
228
+ }),
110
229
  init: async ({ target, packageRoot, packageVersion, options }) => ({
111
230
  result: await runInit({ target, dryRun: options.dryRun, packageRoot, packageVersion, repositoryIndex: true }),
112
231
  exitCode: 0,
@@ -163,6 +282,7 @@ export const COMMAND_EXECUTORS = {
163
282
  target,
164
283
  packageRoot,
165
284
  to: options.to,
285
+ persistence: runtimeContext?.forgeloopPersistence ?? null,
166
286
  taskId: options.taskId,
167
287
  authorityContext,
168
288
  runtimeContext,
@@ -406,20 +526,24 @@ export const COMMAND_EXECUTORS = {
406
526
  }),
407
527
  exitCode: 0,
408
528
  }),
409
- "record-diagnosis": async ({ target, packageRoot, options }) => ({
410
- result: await runRecordDiagnosis({
411
- target,
412
- packageRoot,
413
- file: options.file ?? null,
414
- hypothesis: options.hypothesis,
415
- failureClass: options.failureClass,
416
- evidenceRefs: options.evidenceRefs,
417
- settledBy: options.settledBy,
418
- nextSafeAction: options.nextSafeAction,
419
- taskId: options.taskId,
420
- }),
421
- exitCode: 0,
422
- }),
529
+ "record-diagnosis": async ({ target, packageRoot, options, runtimeContext }) => {
530
+ const persistence = runtimeContext?.forgeloopPersistence ?? null;
531
+ return {
532
+ result: await runRecordDiagnosis({
533
+ target,
534
+ packageRoot,
535
+ file: options.file ?? null,
536
+ hypothesis: options.hypothesis,
537
+ failureClass: options.failureClass,
538
+ evidenceRefs: options.evidenceRefs,
539
+ settledBy: options.settledBy,
540
+ nextSafeAction: options.nextSafeAction,
541
+ taskId: options.taskId,
542
+ persistence,
543
+ }),
544
+ exitCode: 0,
545
+ };
546
+ },
423
547
  "record-intervention": async ({ target, packageRoot, options }) => ({
424
548
  result: await runRecordIntervention({
425
549
  target,
@@ -593,6 +717,10 @@ export const COMMAND_EXECUTORS = {
593
717
  result: await runClearState({ target, taskId: options.taskId }),
594
718
  exitCode: 0,
595
719
  }),
720
+ "checkpoint-revalidate": async ({ target, packageRoot, options }) => ({
721
+ result: await runCheckpointRevalidate({ target, packageRoot, taskId: options.taskId }),
722
+ exitCode: 0,
723
+ }),
596
724
  "task-create": async ({ target, packageRoot, options }) => ({
597
725
  result: await runTaskCreate({
598
726
  target,
@@ -627,11 +755,11 @@ export const COMMAND_EXECUTORS = {
627
755
  exitCode: 0,
628
756
  }),
629
757
  "task-migrate": async ({ target, packageRoot, options }) => ({
630
- result: await runTaskMigrate({ target, packageRoot, dryRun: options.dryRun }),
758
+ result: await runTaskMigrate({ target, packageRoot, dryRun: options.dryRun, destination: options.destination, writersQuiesced: options.writersQuiesced }),
631
759
  exitCode: 0,
632
760
  }),
633
761
  "migrate-protocol": async ({ target, packageRoot, options }) => ({
634
- result: await runMigrateProtocol({ target, packageRoot, to: options.to, dryRun: options.dryRun }),
762
+ result: await runMigrateProtocol({ target, packageRoot, to: options.to, dryRun: options.dryRun, destination: options.destination, writersQuiesced: options.writersQuiesced }),
635
763
  exitCode: 0,
636
764
  }),
637
765
  "task-unlock": async ({ target, packageRoot, options }) => ({
@@ -648,10 +776,27 @@ export const COMMAND_EXECUTORS = {
648
776
  }),
649
777
  exitCode: 0,
650
778
  }),
779
+ "task-abandon": async ({ target, packageRoot, options }) => ({
780
+ result: await runTaskAbandon({
781
+ target,
782
+ packageRoot,
783
+ taskId: options.taskId,
784
+ acknowledgeAbandonment: options.acknowledgeAbandonment,
785
+ }),
786
+ exitCode: 0,
787
+ }),
651
788
  "task-resume": async ({ target, packageRoot, options }) => ({
652
789
  result: await runTaskResume({ target, packageRoot, taskId: options.taskId, claims: options.claims }),
653
790
  exitCode: 0,
654
791
  }),
792
+ "task-repair-contract-bootstrap": async ({ target, packageRoot, options }) => ({
793
+ result: await runTaskRepairContractBootstrap({ target, packageRoot, taskId: options.taskId, acknowledgeRepair: options.acknowledgeRepair }),
794
+ exitCode: 0,
795
+ }),
796
+ "task-migrate-contract-bootstrap-repair": async ({ target, packageRoot, options }) => ({
797
+ result: await runTaskMigrateContractBootstrapRepair({ target, packageRoot, taskId: options.taskId, acknowledgeMigration: options.acknowledgeMigration }),
798
+ exitCode: 0,
799
+ }),
655
800
  "task-repair-legacy-recovery": async ({ target, packageRoot, options }) => ({
656
801
  result: await runTaskRepairLegacyRecovery({
657
802
  target,
@@ -707,3 +852,24 @@ export const EXECUTOR_EXCEPTIONS = Object.freeze([
707
852
  // Bootstrap/presentation-only behaviors intentionally without executors:
708
853
  // none currently. Every canonical command definition must have an executor.
709
854
  ]);
855
+
856
+ export const COMMAND_EXECUTORS = Object.fromEntries(Object.entries(RAW_COMMAND_EXECUTORS).map(([name, executor]) => [name, async context => {
857
+ // Reject unsupported migration targets before fresh-project storage admission
858
+ // can allocate a database or obscure the protocol error with a storage error.
859
+ if (name === "migrate-protocol") {
860
+ const { assertSupportedProtocolMigrationTarget } = await import("./protocol-migration.js");
861
+ assertSupportedProtocolMigrationTarget(context.options?.to);
862
+ }
863
+ if (name === "advance" || name === "record-diagnosis") {
864
+ const { assertCanonicalPersistence } = await import("../storage/operational-context.js");
865
+ assertCanonicalPersistence(context.runtimeContext?.forgeloopPersistence);
866
+ }
867
+ if (!context.target || name === "task-migrate" || name === "migrate-protocol" || name === "storage-migration-status" || name === "storage-rollback-resume" || name === "storage-rollback" || name === "storage-migrate" || name === "storage-migration-resume" || name === "storage-restore" || name === "storage-restore-resume") return executor(context);
868
+ const { withProjectStorage } = await import("../storage/project-boundary.js");
869
+ const { CLI_COMMAND_DEFINITIONS } = await import("./cli-command-definitions.js");
870
+ // Backup writes its destination, not the source store. Doctor repairs only
871
+ // when explicitly requested; inspecting either must not migrate the source.
872
+ const readOnly = CLI_COMMAND_DEFINITIONS[name]?.mutation === "READ_ONLY"
873
+ || context.options?.dryRun === true || name === "storage-backup" || (name === "doctor" && context.options?.fix !== true);
874
+ return withProjectStorage(context.target, () => executor(context), { readOnly, runtimeContext: context.runtimeContext });
875
+ }]));