@planu/cli 6.1.0 → 7.0.0

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 (1248) hide show
  1. package/dist/index.d.ts +1 -2
  2. package/dist/index.js +1 -112
  3. package/dist/sdd-engine/contracts.d.ts +76 -0
  4. package/dist/sdd-engine/contracts.js +60 -0
  5. package/dist/sdd-engine/index.d.ts +5 -0
  6. package/dist/sdd-engine/index.js +5 -0
  7. package/dist/sdd-engine/patch-sandbox.d.ts +14 -0
  8. package/dist/sdd-engine/patch-sandbox.js +173 -0
  9. package/dist/sdd-engine/server.d.ts +5 -0
  10. package/dist/sdd-engine/server.js +30 -0
  11. package/dist/sdd-engine/task-window.d.ts +9 -0
  12. package/dist/sdd-engine/task-window.js +153 -0
  13. package/dist/sdd-engine/tools/execution-tools.d.ts +5 -0
  14. package/dist/sdd-engine/tools/execution-tools.js +138 -0
  15. package/dist/sdd-engine/tools/format-result.d.ts +4 -0
  16. package/dist/sdd-engine/tools/format-result.js +22 -0
  17. package/dist/sdd-engine/tools/workspace-tools.d.ts +3 -0
  18. package/dist/sdd-engine/tools/workspace-tools.js +193 -0
  19. package/dist/sdd-engine/tools.d.ts +3 -0
  20. package/dist/sdd-engine/tools.js +13 -0
  21. package/dist/types/sdd-engine.d.ts +91 -0
  22. package/dist/types/sdd-engine.js +2 -0
  23. package/package.json +43 -46
  24. package/dist/.planu-build.json +0 -1
  25. package/dist/cli/colors.d.ts +0 -14
  26. package/dist/cli/colors.js +0 -26
  27. package/dist/cli/commands/doctor.d.ts +0 -12
  28. package/dist/cli/commands/doctor.js +0 -91
  29. package/dist/cli/commands/init.d.ts +0 -3
  30. package/dist/cli/commands/init.js +0 -37
  31. package/dist/cli/commands/job.d.ts +0 -3
  32. package/dist/cli/commands/job.js +0 -112
  33. package/dist/cli/commands/list.d.ts +0 -3
  34. package/dist/cli/commands/list.js +0 -39
  35. package/dist/cli/commands/package-handoff.d.ts +0 -3
  36. package/dist/cli/commands/package-handoff.js +0 -75
  37. package/dist/cli/commands/spec.d.ts +0 -3
  38. package/dist/cli/commands/spec.js +0 -156
  39. package/dist/cli/commands/status.d.ts +0 -3
  40. package/dist/cli/commands/status.js +0 -113
  41. package/dist/cli/commands/validate.d.ts +0 -3
  42. package/dist/cli/commands/validate.js +0 -39
  43. package/dist/cli/formatter.d.ts +0 -26
  44. package/dist/cli/formatter.js +0 -126
  45. package/dist/cli/index.d.ts +0 -3
  46. package/dist/cli/index.js +0 -29
  47. package/dist/cli/project-detector.d.ts +0 -6
  48. package/dist/cli/project-detector.js +0 -12
  49. package/dist/cli/router.d.ts +0 -6
  50. package/dist/cli/router.js +0 -142
  51. package/dist/config/architecture-patterns.json +0 -324
  52. package/dist/config/detection-signals.json +0 -256
  53. package/dist/config/docs-registry.json +0 -94
  54. package/dist/config/dor-dod-items.json +0 -194
  55. package/dist/config/drift-severity.json +0 -22
  56. package/dist/config/event-brokers.json +0 -63
  57. package/dist/config/framework-registry/csharp-aspnet.json +0 -67
  58. package/dist/config/framework-registry/dart-flutter.json +0 -61
  59. package/dist/config/framework-registry/go-gin.json +0 -62
  60. package/dist/config/framework-registry/index.json +0 -164
  61. package/dist/config/framework-registry/java-springboot.json +0 -67
  62. package/dist/config/framework-registry/php-laravel.json +0 -67
  63. package/dist/config/framework-registry/python-django.json +0 -72
  64. package/dist/config/framework-registry/python-fastapi.json +0 -72
  65. package/dist/config/framework-registry/ruby-rails.json +0 -67
  66. package/dist/config/framework-registry/rust-actix.json +0 -61
  67. package/dist/config/framework-registry/swift-swiftui.json +0 -67
  68. package/dist/config/framework-registry/typescript-angular.json +0 -67
  69. package/dist/config/framework-registry/typescript-astro.json +0 -61
  70. package/dist/config/framework-registry/typescript-express.json +0 -67
  71. package/dist/config/framework-registry/typescript-nestjs.json +0 -62
  72. package/dist/config/framework-registry/typescript-nextjs.json +0 -82
  73. package/dist/config/framework-registry/typescript-nuxt.json +0 -67
  74. package/dist/config/framework-registry/typescript-react.json +0 -77
  75. package/dist/config/framework-registry/typescript-remix.json +0 -61
  76. package/dist/config/framework-registry/typescript-sveltekit.json +0 -67
  77. package/dist/config/framework-registry/typescript-vue.json +0 -72
  78. package/dist/config/hook-templates/planu-force-ask-user-question.sh +0 -14
  79. package/dist/config/hook-templates/planu-spec-sanctity.sh +0 -128
  80. package/dist/config/legacy-artifacts.json +0 -26
  81. package/dist/config/minimal-implementation-gate.json +0 -149
  82. package/dist/config/negative-predicate-phrases.json +0 -33
  83. package/dist/config/official-sdd-tools.d.ts +0 -7
  84. package/dist/config/official-sdd-tools.js +0 -44
  85. package/dist/config/out-of-scope-suggestions.json +0 -190
  86. package/dist/config/paradigm-registry.json +0 -380
  87. package/dist/config/project-knowledge-graph.json +0 -170
  88. package/dist/config/readiness-config.json +0 -22
  89. package/dist/config/registries/error-recovery.json +0 -114
  90. package/dist/config/registries/legacy-guidance.json +0 -118
  91. package/dist/config/registries/spec-folder-sanctity.json +0 -4
  92. package/dist/config/runtime-policy.json +0 -66
  93. package/dist/config/server-instructions.d.ts +0 -2
  94. package/dist/config/server-instructions.js +0 -18
  95. package/dist/config/skill-templates/planu-dogfood-bug.md +0 -43
  96. package/dist/config/skill-templates/planu-implement.md +0 -42
  97. package/dist/config/skill-templates/planu-native.md +0 -30
  98. package/dist/config/skill-templates/planu-new-spec.md +0 -56
  99. package/dist/config/skill-templates/planu-resume-work.md +0 -51
  100. package/dist/config/skill-templates/planu-review.md +0 -47
  101. package/dist/config/skill-templates/planu-validate.md +0 -59
  102. package/dist/config/stack-signatures.json +0 -793
  103. package/dist/config/subagent-templates/planu-challenger.md +0 -49
  104. package/dist/config/subagent-templates/planu-readiness-auditor.md +0 -51
  105. package/dist/config/subagent-templates/planu-spec-implementer.md +0 -50
  106. package/dist/config/subagent-templates/planu-validator.md +0 -56
  107. package/dist/config/technology-registry.json +0 -120
  108. package/dist/config/version.d.ts +0 -2
  109. package/dist/config/version.js +0 -20
  110. package/dist/core/shared/fs.d.ts +0 -10
  111. package/dist/core/shared/fs.js +0 -89
  112. package/dist/core/shared/object.d.ts +0 -3
  113. package/dist/core/shared/object.js +0 -12
  114. package/dist/core/shared/strings.d.ts +0 -3
  115. package/dist/core/shared/strings.js +0 -13
  116. package/dist/core/spec-validator.d.ts +0 -12
  117. package/dist/core/spec-validator.js +0 -250
  118. package/dist/engine/abortable-process-runner.d.ts +0 -26
  119. package/dist/engine/abortable-process-runner.js +0 -308
  120. package/dist/engine/ai-assurance/index.d.ts +0 -4
  121. package/dist/engine/ai-assurance/index.js +0 -3
  122. package/dist/engine/ai-assurance/new-code-gate.d.ts +0 -3
  123. package/dist/engine/ai-assurance/new-code-gate.js +0 -39
  124. package/dist/engine/ai-assurance/spec-assurance.d.ts +0 -3
  125. package/dist/engine/ai-assurance/spec-assurance.js +0 -138
  126. package/dist/engine/ai-integration/codex/agent-roles-generator.d.ts +0 -12
  127. package/dist/engine/ai-integration/codex/agent-roles-generator.js +0 -62
  128. package/dist/engine/ambiguity-scorer.d.ts +0 -13
  129. package/dist/engine/ambiguity-scorer.js +0 -155
  130. package/dist/engine/approval-workflow.d.ts +0 -21
  131. package/dist/engine/approval-workflow.js +0 -82
  132. package/dist/engine/audit-trail/hasher.d.ts +0 -18
  133. package/dist/engine/audit-trail/hasher.js +0 -46
  134. package/dist/engine/auditor-scoring.d.ts +0 -7
  135. package/dist/engine/auditor-scoring.js +0 -76
  136. package/dist/engine/build-freshness.d.ts +0 -4
  137. package/dist/engine/build-freshness.js +0 -170
  138. package/dist/engine/challenge-prioritizer.d.ts +0 -17
  139. package/dist/engine/challenge-prioritizer.js +0 -78
  140. package/dist/engine/clarification-gate/error-builder.d.ts +0 -12
  141. package/dist/engine/clarification-gate/error-builder.js +0 -33
  142. package/dist/engine/clarification-gate/gate.d.ts +0 -15
  143. package/dist/engine/clarification-gate/gate.js +0 -41
  144. package/dist/engine/clarification-gate/token-store.d.ts +0 -28
  145. package/dist/engine/clarification-gate/token-store.js +0 -67
  146. package/dist/engine/coach/i18n.d.ts +0 -11
  147. package/dist/engine/coach/i18n.js +0 -78
  148. package/dist/engine/code-scanner/gap-scorer.d.ts +0 -9
  149. package/dist/engine/code-scanner/gap-scorer.js +0 -89
  150. package/dist/engine/code-scanner/index.d.ts +0 -9
  151. package/dist/engine/code-scanner/index.js +0 -15
  152. package/dist/engine/code-scanner/keyword-extractor.d.ts +0 -11
  153. package/dist/engine/code-scanner/keyword-extractor.js +0 -88
  154. package/dist/engine/code-scanner/layer-scanner.d.ts +0 -24
  155. package/dist/engine/code-scanner/layer-scanner.js +0 -135
  156. package/dist/engine/compact/tool-list-compactor.d.ts +0 -7
  157. package/dist/engine/compact/tool-list-compactor.js +0 -87
  158. package/dist/engine/compact-obj.d.ts +0 -7
  159. package/dist/engine/compact-obj.js +0 -28
  160. package/dist/engine/complexity-budget/index.d.ts +0 -2
  161. package/dist/engine/complexity-budget/index.js +0 -3
  162. package/dist/engine/complexity-budget/trivial-detector.d.ts +0 -7
  163. package/dist/engine/complexity-budget/trivial-detector.js +0 -69
  164. package/dist/engine/config-loader.d.ts +0 -73
  165. package/dist/engine/config-loader.js +0 -239
  166. package/dist/engine/constitution/sdd-rules-registry.d.ts +0 -11
  167. package/dist/engine/constitution/sdd-rules-registry.js +0 -109
  168. package/dist/engine/context-merger.d.ts +0 -23
  169. package/dist/engine/context-merger.js +0 -197
  170. package/dist/engine/contradiction-detector.d.ts +0 -16
  171. package/dist/engine/contradiction-detector.js +0 -406
  172. package/dist/engine/convention-scanner/codebase-scanner.d.ts +0 -7
  173. package/dist/engine/convention-scanner/codebase-scanner.js +0 -390
  174. package/dist/engine/convention-scanner/convention-parser.d.ts +0 -7
  175. package/dist/engine/convention-scanner/convention-parser.js +0 -189
  176. package/dist/engine/convention-scanner/index.d.ts +0 -3
  177. package/dist/engine/convention-scanner/index.js +0 -5
  178. package/dist/engine/conventions-ttl.d.ts +0 -8
  179. package/dist/engine/conventions-ttl.js +0 -75
  180. package/dist/engine/core-bridge-duplicate-blocks.d.ts +0 -3
  181. package/dist/engine/core-bridge-duplicate-blocks.js +0 -56
  182. package/dist/engine/core-bridge-gaps.d.ts +0 -4
  183. package/dist/engine/core-bridge-gaps.js +0 -75
  184. package/dist/engine/core-bridge-project-graph.d.ts +0 -9
  185. package/dist/engine/core-bridge-project-graph.js +0 -499
  186. package/dist/engine/core-bridge.d.ts +0 -34
  187. package/dist/engine/core-bridge.js +0 -392
  188. package/dist/engine/criteria-quality-checker.d.ts +0 -8
  189. package/dist/engine/criteria-quality-checker.js +0 -55
  190. package/dist/engine/criterion-identity.d.ts +0 -7
  191. package/dist/engine/criterion-identity.js +0 -70
  192. package/dist/engine/data-projects-gc/pattern-matcher.d.ts +0 -21
  193. package/dist/engine/data-projects-gc/pattern-matcher.js +0 -68
  194. package/dist/engine/dep-guard/cycle-detector.d.ts +0 -29
  195. package/dist/engine/dep-guard/cycle-detector.js +0 -83
  196. package/dist/engine/dep-guard/index.d.ts +0 -3
  197. package/dist/engine/dep-guard/index.js +0 -3
  198. package/dist/engine/dependency-evaluator.d.ts +0 -15
  199. package/dist/engine/dependency-evaluator.js +0 -81
  200. package/dist/engine/detection-utils.d.ts +0 -13
  201. package/dist/engine/detection-utils.js +0 -255
  202. package/dist/engine/dor-dod/dod.d.ts +0 -17
  203. package/dist/engine/dor-dod/dod.js +0 -98
  204. package/dist/engine/dor-dod/dor.d.ts +0 -21
  205. package/dist/engine/dor-dod/dor.js +0 -149
  206. package/dist/engine/dor-dod/index.d.ts +0 -4
  207. package/dist/engine/dor-dod/index.js +0 -5
  208. package/dist/engine/dor-dod/items-loader.d.ts +0 -18
  209. package/dist/engine/dor-dod/items-loader.js +0 -55
  210. package/dist/engine/dor-dod/plan.d.ts +0 -8
  211. package/dist/engine/dor-dod/plan.js +0 -50
  212. package/dist/engine/dor-dod.d.ts +0 -2
  213. package/dist/engine/dor-dod.js +0 -4
  214. package/dist/engine/ears-gate.d.ts +0 -19
  215. package/dist/engine/ears-gate.js +0 -120
  216. package/dist/engine/elicitation/answer-extractor.d.ts +0 -4
  217. package/dist/engine/elicitation/answer-extractor.js +0 -225
  218. package/dist/engine/elicitation/capability.d.ts +0 -9
  219. package/dist/engine/elicitation/capability.js +0 -48
  220. package/dist/engine/elicitation/decision-gap-detector.d.ts +0 -3
  221. package/dist/engine/elicitation/decision-gap-detector.js +0 -142
  222. package/dist/engine/elicitation/elicit-helper.d.ts +0 -36
  223. package/dist/engine/elicitation/elicit-helper.js +0 -113
  224. package/dist/engine/elicitation/question-grounding-gate.d.ts +0 -3
  225. package/dist/engine/elicitation/question-grounding-gate.js +0 -103
  226. package/dist/engine/errors/error-result.d.ts +0 -4
  227. package/dist/engine/errors/error-result.js +0 -16
  228. package/dist/engine/errors/error-wrapper.d.ts +0 -4
  229. package/dist/engine/errors/error-wrapper.js +0 -82
  230. package/dist/engine/errors/recovery-registry.d.ts +0 -13
  231. package/dist/engine/errors/recovery-registry.js +0 -96
  232. package/dist/engine/errors/registry-loader.d.ts +0 -3
  233. package/dist/engine/errors/registry-loader.js +0 -22
  234. package/dist/engine/event-detector.d.ts +0 -33
  235. package/dist/engine/event-detector.js +0 -97
  236. package/dist/engine/evidence-gates/artifact-reader.d.ts +0 -133
  237. package/dist/engine/evidence-gates/artifact-reader.js +0 -387
  238. package/dist/engine/evidence-gates/evidence-autofill.d.ts +0 -15
  239. package/dist/engine/evidence-gates/evidence-autofill.js +0 -255
  240. package/dist/engine/evidence-gates/evidence-skeletons.d.ts +0 -19
  241. package/dist/engine/evidence-gates/evidence-skeletons.js +0 -78
  242. package/dist/engine/evidence-gates/lifecycle-gate.d.ts +0 -12
  243. package/dist/engine/evidence-gates/lifecycle-gate.js +0 -293
  244. package/dist/engine/evidence-gates/reconciliation-freshness.d.ts +0 -11
  245. package/dist/engine/evidence-gates/reconciliation-freshness.js +0 -73
  246. package/dist/engine/evidence-index/done-drift.d.ts +0 -7
  247. package/dist/engine/evidence-index/done-drift.js +0 -91
  248. package/dist/engine/evidence-index/index-builder.d.ts +0 -10
  249. package/dist/engine/evidence-index/index-builder.js +0 -202
  250. package/dist/engine/execution/context.d.ts +0 -19
  251. package/dist/engine/execution/context.js +0 -130
  252. package/dist/engine/execution/deadline-io.d.ts +0 -20
  253. package/dist/engine/execution/deadline-io.js +0 -30
  254. package/dist/engine/execution/durable-job-heartbeat-runtime.d.ts +0 -4
  255. package/dist/engine/execution/durable-job-heartbeat-runtime.js +0 -401
  256. package/dist/engine/execution/job-runtime.d.ts +0 -101
  257. package/dist/engine/execution/job-runtime.js +0 -319
  258. package/dist/engine/execution/operation-journal.d.ts +0 -67
  259. package/dist/engine/execution/operation-journal.js +0 -266
  260. package/dist/engine/execution/package-handoff-job-executor.d.ts +0 -22
  261. package/dist/engine/execution/package-handoff-job-executor.js +0 -510
  262. package/dist/engine/execution/public-job-sanitizer.d.ts +0 -4
  263. package/dist/engine/execution/public-job-sanitizer.js +0 -31
  264. package/dist/engine/execution/startup-recovery.d.ts +0 -3
  265. package/dist/engine/execution/startup-recovery.js +0 -15
  266. package/dist/engine/execution/validate-job-executor.d.ts +0 -37
  267. package/dist/engine/execution/validate-job-executor.js +0 -900
  268. package/dist/engine/execution/validate-job-payload.d.ts +0 -5
  269. package/dist/engine/execution/validate-job-payload.js +0 -145
  270. package/dist/engine/execution/validate-job-recovery.d.ts +0 -4
  271. package/dist/engine/execution/validate-job-recovery.js +0 -47
  272. package/dist/engine/execution/validate-worker-runtime.d.ts +0 -10
  273. package/dist/engine/execution/validate-worker-runtime.js +0 -188
  274. package/dist/engine/execution/validate-worker-thread.d.ts +0 -2
  275. package/dist/engine/execution/validate-worker-thread.js +0 -65
  276. package/dist/engine/framework-detector.d.ts +0 -35
  277. package/dist/engine/framework-detector.js +0 -268
  278. package/dist/engine/freeze/freeze-checker.d.ts +0 -14
  279. package/dist/engine/freeze/freeze-checker.js +0 -28
  280. package/dist/engine/freeze/unlock-token.d.ts +0 -17
  281. package/dist/engine/freeze/unlock-token.js +0 -30
  282. package/dist/engine/frontmatter-parser.d.ts +0 -32
  283. package/dist/engine/frontmatter-parser.js +0 -157
  284. package/dist/engine/frontmatter-sha/canonicalize.d.ts +0 -9
  285. package/dist/engine/frontmatter-sha/canonicalize.js +0 -20
  286. package/dist/engine/frontmatter-sha/compute-sha.d.ts +0 -8
  287. package/dist/engine/frontmatter-sha/compute-sha.js +0 -14
  288. package/dist/engine/frontmatter-sha/frozen-fields.d.ts +0 -6
  289. package/dist/engine/frontmatter-sha/frozen-fields.js +0 -14
  290. package/dist/engine/frontmatter-sha/index.d.ts +0 -2
  291. package/dist/engine/frontmatter-sha/index.js +0 -3
  292. package/dist/engine/git/branch-detector.d.ts +0 -7
  293. package/dist/engine/git/branch-detector.js +0 -45
  294. package/dist/engine/git/exec-git.d.ts +0 -2
  295. package/dist/engine/git/exec-git.js +0 -14
  296. package/dist/engine/git/git-command-guard.d.ts +0 -2
  297. package/dist/engine/git/git-command-guard.js +0 -43
  298. package/dist/engine/git/repository-probe.d.ts +0 -3
  299. package/dist/engine/git/repository-probe.js +0 -13
  300. package/dist/engine/handoff-artifacts/implementation-review-reader.d.ts +0 -4
  301. package/dist/engine/handoff-artifacts/implementation-review-reader.js +0 -86
  302. package/dist/engine/handoff-artifacts/io.d.ts +0 -51
  303. package/dist/engine/handoff-artifacts/io.js +0 -200
  304. package/dist/engine/handoff-artifacts/schema-skeleton.d.ts +0 -5
  305. package/dist/engine/handoff-artifacts/schema-skeleton.js +0 -108
  306. package/dist/engine/handoff-artifacts/schemas.d.ts +0 -164
  307. package/dist/engine/handoff-artifacts/schemas.js +0 -242
  308. package/dist/engine/handoff-artifacts/validation-result.d.ts +0 -18
  309. package/dist/engine/handoff-artifacts/validation-result.js +0 -3
  310. package/dist/engine/handoff-artifacts/version-policy.d.ts +0 -18
  311. package/dist/engine/handoff-artifacts/version-policy.js +0 -35
  312. package/dist/engine/handoff-format.d.ts +0 -26
  313. package/dist/engine/handoff-format.js +0 -253
  314. package/dist/engine/handoff-packager.d.ts +0 -30
  315. package/dist/engine/handoff-packager.js +0 -864
  316. package/dist/engine/host-detection/detect-host.d.ts +0 -10
  317. package/dist/engine/host-detection/detect-host.js +0 -34
  318. package/dist/engine/host-rules-templates/index.d.ts +0 -3
  319. package/dist/engine/host-rules-templates/index.js +0 -4
  320. package/dist/engine/host-rules-templates/inject-rules-block.d.ts +0 -3
  321. package/dist/engine/host-rules-templates/inject-rules-block.js +0 -29
  322. package/dist/engine/host-rules-templates/templates.d.ts +0 -12
  323. package/dist/engine/host-rules-templates/templates.js +0 -111
  324. package/dist/engine/host-tool-filter.d.ts +0 -28
  325. package/dist/engine/host-tool-filter.js +0 -162
  326. package/dist/engine/human-summary.d.ts +0 -18
  327. package/dist/engine/human-summary.js +0 -114
  328. package/dist/engine/implementation-contract/common.d.ts +0 -22
  329. package/dist/engine/implementation-contract/common.js +0 -47
  330. package/dist/engine/implementation-contract/evaluator.d.ts +0 -3
  331. package/dist/engine/implementation-contract/evaluator.js +0 -192
  332. package/dist/engine/implementation-contract/index.d.ts +0 -4
  333. package/dist/engine/implementation-contract/index.js +0 -4
  334. package/dist/engine/implementation-contract/renderer.d.ts +0 -4
  335. package/dist/engine/implementation-contract/renderer.js +0 -114
  336. package/dist/engine/keyword-matcher/boundary.d.ts +0 -18
  337. package/dist/engine/keyword-matcher/boundary.js +0 -30
  338. package/dist/engine/keyword-matcher/extractor.d.ts +0 -14
  339. package/dist/engine/keyword-matcher/extractor.js +0 -85
  340. package/dist/engine/keyword-matcher/index.d.ts +0 -5
  341. package/dist/engine/keyword-matcher/index.js +0 -11
  342. package/dist/engine/keyword-matcher/matcher.d.ts +0 -28
  343. package/dist/engine/keyword-matcher/matcher.js +0 -79
  344. package/dist/engine/keyword-matcher/stopwords.d.ts +0 -26
  345. package/dist/engine/keyword-matcher/stopwords.js +0 -100
  346. package/dist/engine/lifecycle-hints.d.ts +0 -12
  347. package/dist/engine/lifecycle-hints.js +0 -61
  348. package/dist/engine/lifecycle-reconciliation-io.d.ts +0 -11
  349. package/dist/engine/lifecycle-reconciliation-io.js +0 -181
  350. package/dist/engine/lifecycle-reconciliation.d.ts +0 -16
  351. package/dist/engine/lifecycle-reconciliation.js +0 -460
  352. package/dist/engine/living-spec-analyzer.d.ts +0 -10
  353. package/dist/engine/living-spec-analyzer.js +0 -397
  354. package/dist/engine/minimality/analyzer.d.ts +0 -3
  355. package/dist/engine/minimality/analyzer.js +0 -182
  356. package/dist/engine/minimality/formatter.d.ts +0 -3
  357. package/dist/engine/minimality/formatter.js +0 -25
  358. package/dist/engine/minimality/index.d.ts +0 -3
  359. package/dist/engine/minimality/index.js +0 -3
  360. package/dist/engine/minimality/policy-loader.d.ts +0 -3
  361. package/dist/engine/minimality/policy-loader.js +0 -364
  362. package/dist/engine/model-tier-resolver.d.ts +0 -4
  363. package/dist/engine/model-tier-resolver.js +0 -15
  364. package/dist/engine/network-policy.d.ts +0 -4
  365. package/dist/engine/network-policy.js +0 -96
  366. package/dist/engine/onboarding/new-project-resolver.d.ts +0 -6
  367. package/dist/engine/onboarding/new-project-resolver.js +0 -265
  368. package/dist/engine/opencode/config-scaffold.d.ts +0 -3
  369. package/dist/engine/opencode/config-scaffold.js +0 -99
  370. package/dist/engine/paradigm-detector.d.ts +0 -12
  371. package/dist/engine/paradigm-detector.js +0 -236
  372. package/dist/engine/paradigm-registry.d.ts +0 -20
  373. package/dist/engine/paradigm-registry.js +0 -44
  374. package/dist/engine/phase-tracker.d.ts +0 -41
  375. package/dist/engine/phase-tracker.js +0 -89
  376. package/dist/engine/planu-config-writer.d.ts +0 -33
  377. package/dist/engine/planu-config-writer.js +0 -68
  378. package/dist/engine/project-command-runtime.d.ts +0 -5
  379. package/dist/engine/project-command-runtime.js +0 -87
  380. package/dist/engine/project-graph/builder.d.ts +0 -7
  381. package/dist/engine/project-graph/builder.js +0 -320
  382. package/dist/engine/project-graph/cache.d.ts +0 -47
  383. package/dist/engine/project-graph/cache.js +0 -739
  384. package/dist/engine/project-graph/extractors/decision-store-extractor.d.ts +0 -3
  385. package/dist/engine/project-graph/extractors/decision-store-extractor.js +0 -58
  386. package/dist/engine/project-graph/extractors/git-extractor.d.ts +0 -7
  387. package/dist/engine/project-graph/extractors/git-extractor.js +0 -89
  388. package/dist/engine/project-graph/extractors/handoff-extractor.d.ts +0 -3
  389. package/dist/engine/project-graph/extractors/handoff-extractor.js +0 -55
  390. package/dist/engine/project-graph/extractors/spec-extractor.d.ts +0 -3
  391. package/dist/engine/project-graph/extractors/spec-extractor.js +0 -189
  392. package/dist/engine/project-graph/extractors/validation-extractor.d.ts +0 -3
  393. package/dist/engine/project-graph/extractors/validation-extractor.js +0 -36
  394. package/dist/engine/project-graph/freshness-projection.d.ts +0 -16
  395. package/dist/engine/project-graph/freshness-projection.js +0 -98
  396. package/dist/engine/project-graph/index.d.ts +0 -2
  397. package/dist/engine/project-graph/index.js +0 -2
  398. package/dist/engine/project-graph/native.d.ts +0 -3
  399. package/dist/engine/project-graph/native.js +0 -36
  400. package/dist/engine/project-graph/query.d.ts +0 -8
  401. package/dist/engine/project-graph/query.js +0 -193
  402. package/dist/engine/project-graph/redaction.d.ts +0 -4
  403. package/dist/engine/project-graph/redaction.js +0 -11
  404. package/dist/engine/project-scanner/convention-detector.d.ts +0 -3
  405. package/dist/engine/project-scanner/convention-detector.js +0 -149
  406. package/dist/engine/project-scanner/index.d.ts +0 -4
  407. package/dist/engine/project-scanner/index.js +0 -18
  408. package/dist/engine/project-scanner/quality-baseline.d.ts +0 -3
  409. package/dist/engine/project-scanner/quality-baseline.js +0 -72
  410. package/dist/engine/project-scanner/stack-detector.d.ts +0 -3
  411. package/dist/engine/project-scanner/stack-detector.js +0 -128
  412. package/dist/engine/readiness-checker.d.ts +0 -56
  413. package/dist/engine/readiness-checker.js +0 -566
  414. package/dist/engine/readiness-config-loader.d.ts +0 -23
  415. package/dist/engine/readiness-config-loader.js +0 -63
  416. package/dist/engine/reconcile/apply-changes.d.ts +0 -4
  417. package/dist/engine/reconcile/apply-changes.js +0 -117
  418. package/dist/engine/reconcile/propagate-mirrors.d.ts +0 -3
  419. package/dist/engine/reconcile/propagate-mirrors.js +0 -376
  420. package/dist/engine/reconcile/verify-write.d.ts +0 -10
  421. package/dist/engine/reconcile/verify-write.js +0 -49
  422. package/dist/engine/registry-extender.d.ts +0 -25
  423. package/dist/engine/registry-extender.js +0 -60
  424. package/dist/engine/reviewer-tokens/issuer.d.ts +0 -29
  425. package/dist/engine/reviewer-tokens/issuer.js +0 -88
  426. package/dist/engine/reviewer-tokens/signer.d.ts +0 -17
  427. package/dist/engine/reviewer-tokens/signer.js +0 -51
  428. package/dist/engine/reviewer-tokens/types.d.ts +0 -2
  429. package/dist/engine/reviewer-tokens/types.js +0 -2
  430. package/dist/engine/runtime-policy.d.ts +0 -9
  431. package/dist/engine/runtime-policy.js +0 -163
  432. package/dist/engine/safety/atomic-write-file.d.ts +0 -47
  433. package/dist/engine/safety/atomic-write-file.js +0 -232
  434. package/dist/engine/safety/atomic-writer.d.ts +0 -22
  435. package/dist/engine/safety/atomic-writer.js +0 -97
  436. package/dist/engine/safety/contained-project-file.d.ts +0 -3
  437. package/dist/engine/safety/contained-project-file.js +0 -23
  438. package/dist/engine/safety/cross-process-lock.d.ts +0 -13
  439. package/dist/engine/safety/cross-process-lock.js +0 -318
  440. package/dist/engine/safety/file-mutex.d.ts +0 -6
  441. package/dist/engine/safety/file-mutex.js +0 -182
  442. package/dist/engine/safety/lock-lease-store.d.ts +0 -84
  443. package/dist/engine/safety/lock-lease-store.js +0 -383
  444. package/dist/engine/safety/lock-scavenger.d.ts +0 -8
  445. package/dist/engine/safety/lock-scavenger.js +0 -198
  446. package/dist/engine/safety/lock-staleness.d.ts +0 -33
  447. package/dist/engine/safety/lock-staleness.js +0 -76
  448. package/dist/engine/safety/obsolete-lock-guard.d.ts +0 -8
  449. package/dist/engine/safety/obsolete-lock-guard.js +0 -31
  450. package/dist/engine/scope-boundaries/contradiction-checker.d.ts +0 -7
  451. package/dist/engine/scope-boundaries/contradiction-checker.js +0 -276
  452. package/dist/engine/scope-boundaries/index.d.ts +0 -4
  453. package/dist/engine/scope-boundaries/index.js +0 -5
  454. package/dist/engine/scope-boundaries/scope-validator.d.ts +0 -7
  455. package/dist/engine/scope-boundaries/scope-validator.js +0 -114
  456. package/dist/engine/scope-boundaries/suggester.d.ts +0 -8
  457. package/dist/engine/scope-boundaries/suggester.js +0 -27
  458. package/dist/engine/score-to-grade.d.ts +0 -2
  459. package/dist/engine/score-to-grade.js +0 -16
  460. package/dist/engine/sdd-model-routing.d.ts +0 -15
  461. package/dist/engine/sdd-model-routing.js +0 -200
  462. package/dist/engine/spec-dependency-graph.d.ts +0 -33
  463. package/dist/engine/spec-dependency-graph.js +0 -243
  464. package/dist/engine/spec-difficulty.d.ts +0 -3
  465. package/dist/engine/spec-difficulty.js +0 -17
  466. package/dist/engine/spec-folder-sanctity.d.ts +0 -5
  467. package/dist/engine/spec-folder-sanctity.js +0 -32
  468. package/dist/engine/spec-format/acceptance-criteria.d.ts +0 -10
  469. package/dist/engine/spec-format/acceptance-criteria.js +0 -157
  470. package/dist/engine/spec-format/bdd-parser.d.ts +0 -19
  471. package/dist/engine/spec-format/bdd-parser.js +0 -224
  472. package/dist/engine/spec-format/copula-blacklist.d.ts +0 -15
  473. package/dist/engine/spec-format/copula-blacklist.js +0 -31
  474. package/dist/engine/spec-format/criteria-drift.d.ts +0 -3
  475. package/dist/engine/spec-format/criteria-drift.js +0 -36
  476. package/dist/engine/spec-format/executable-test-path.d.ts +0 -2
  477. package/dist/engine/spec-format/executable-test-path.js +0 -5
  478. package/dist/engine/spec-format/lean-spec-generator.d.ts +0 -8
  479. package/dist/engine/spec-format/lean-spec-generator.js +0 -236
  480. package/dist/engine/spec-format/lean-technical-generator.d.ts +0 -5
  481. package/dist/engine/spec-format/lean-technical-generator.js +0 -45
  482. package/dist/engine/spec-format/markdown-sections.d.ts +0 -14
  483. package/dist/engine/spec-format/markdown-sections.js +0 -105
  484. package/dist/engine/spec-format/metadata-value-policy.d.ts +0 -156
  485. package/dist/engine/spec-format/metadata-value-policy.js +0 -86
  486. package/dist/engine/spec-format/read-technical-section.d.ts +0 -25
  487. package/dist/engine/spec-format/read-technical-section.js +0 -99
  488. package/dist/engine/spec-format/replace-section.d.ts +0 -17
  489. package/dist/engine/spec-format/replace-section.js +0 -79
  490. package/dist/engine/spec-format/retired-scaffold.d.ts +0 -3
  491. package/dist/engine/spec-format/retired-scaffold.js +0 -5
  492. package/dist/engine/spec-format/spec-id.d.ts +0 -8
  493. package/dist/engine/spec-format/spec-id.js +0 -25
  494. package/dist/engine/spec-format/technical-md-populator.d.ts +0 -17
  495. package/dist/engine/spec-format/technical-md-populator.js +0 -321
  496. package/dist/engine/spec-format/text-fences.d.ts +0 -6
  497. package/dist/engine/spec-format/text-fences.js +0 -28
  498. package/dist/engine/spec-format/unified-spec-builder.d.ts +0 -25
  499. package/dist/engine/spec-format/unified-spec-builder.js +0 -400
  500. package/dist/engine/spec-generator/fallback-generator.d.ts +0 -5
  501. package/dist/engine/spec-generator/fallback-generator.js +0 -41
  502. package/dist/engine/spec-generator/index.d.ts +0 -2
  503. package/dist/engine/spec-generator/index.js +0 -2
  504. package/dist/engine/spec-grounding/contract.d.ts +0 -24
  505. package/dist/engine/spec-grounding/contract.js +0 -278
  506. package/dist/engine/spec-grounding/grounding-entry-parser.d.ts +0 -4
  507. package/dist/engine/spec-grounding/grounding-entry-parser.js +0 -184
  508. package/dist/engine/spec-health-scorer.d.ts +0 -7
  509. package/dist/engine/spec-health-scorer.js +0 -134
  510. package/dist/engine/spec-language/english-only.d.ts +0 -30
  511. package/dist/engine/spec-language/english-only.js +0 -224
  512. package/dist/engine/spec-migrator/criteria-scanner.d.ts +0 -7
  513. package/dist/engine/spec-migrator/criteria-scanner.js +0 -113
  514. package/dist/engine/spec-migrator/drift-detector.d.ts +0 -10
  515. package/dist/engine/spec-migrator/drift-detector.js +0 -142
  516. package/dist/engine/spec-migrator/filesystem-import.d.ts +0 -10
  517. package/dist/engine/spec-migrator/filesystem-import.js +0 -205
  518. package/dist/engine/spec-migrator/flatten-specs.d.ts +0 -12
  519. package/dist/engine/spec-migrator/flatten-specs.js +0 -111
  520. package/dist/engine/spec-migrator/folder-operations.d.ts +0 -7
  521. package/dist/engine/spec-migrator/folder-operations.js +0 -109
  522. package/dist/engine/spec-migrator/frontmatter-parser.d.ts +0 -11
  523. package/dist/engine/spec-migrator/frontmatter-parser.js +0 -111
  524. package/dist/engine/spec-migrator/git-aware-fs.d.ts +0 -9
  525. package/dist/engine/spec-migrator/git-aware-fs.js +0 -20
  526. package/dist/engine/spec-migrator/index.d.ts +0 -10
  527. package/dist/engine/spec-migrator/index.js +0 -23
  528. package/dist/engine/spec-migrator/lean-migration.d.ts +0 -8
  529. package/dist/engine/spec-migrator/lean-migration.js +0 -405
  530. package/dist/engine/spec-migrator/legacy-classifier.d.ts +0 -4
  531. package/dist/engine/spec-migrator/legacy-classifier.js +0 -70
  532. package/dist/engine/spec-migrator/legacy-migration.d.ts +0 -13
  533. package/dist/engine/spec-migrator/legacy-migration.js +0 -88
  534. package/dist/engine/spec-migrator/path-utils.d.ts +0 -13
  535. package/dist/engine/spec-migrator/path-utils.js +0 -40
  536. package/dist/engine/spec-migrator/planu-canonical-policy.d.ts +0 -18
  537. package/dist/engine/spec-migrator/planu-canonical-policy.js +0 -105
  538. package/dist/engine/spec-migrator/prefix-migration.d.ts +0 -11
  539. package/dist/engine/spec-migrator/prefix-migration.js +0 -85
  540. package/dist/engine/spec-migrator/reconcile-paths.d.ts +0 -12
  541. package/dist/engine/spec-migrator/reconcile-paths.js +0 -77
  542. package/dist/engine/spec-migrator/strict-planu-cleanup.d.ts +0 -7
  543. package/dist/engine/spec-migrator/strict-planu-cleanup.js +0 -308
  544. package/dist/engine/spec-migrator/version-detection.d.ts +0 -5
  545. package/dist/engine/spec-migrator/version-detection.js +0 -19
  546. package/dist/engine/spec-migrator.d.ts +0 -2
  547. package/dist/engine/spec-migrator.js +0 -3
  548. package/dist/engine/spec-quality/generic-output-gate.d.ts +0 -9
  549. package/dist/engine/spec-quality/generic-output-gate.js +0 -350
  550. package/dist/engine/spec-quality-scorer.d.ts +0 -4
  551. package/dist/engine/spec-quality-scorer.js +0 -423
  552. package/dist/engine/spec-reader.d.ts +0 -7
  553. package/dist/engine/spec-reader.js +0 -23
  554. package/dist/engine/spec-state-machine/transition-spec.d.ts +0 -56
  555. package/dist/engine/spec-state-machine/transition-spec.js +0 -59
  556. package/dist/engine/spec-versioner.d.ts +0 -28
  557. package/dist/engine/spec-versioner.js +0 -92
  558. package/dist/engine/spec-versioning/bump-version.d.ts +0 -17
  559. package/dist/engine/spec-versioning/bump-version.js +0 -199
  560. package/dist/engine/spec-versioning/migrate-format.d.ts +0 -23
  561. package/dist/engine/spec-versioning/migrate-format.js +0 -96
  562. package/dist/engine/spec-versioning/render-history.d.ts +0 -14
  563. package/dist/engine/spec-versioning/render-history.js +0 -31
  564. package/dist/engine/technology-registry.d.ts +0 -11
  565. package/dist/engine/technology-registry.js +0 -142
  566. package/dist/engine/test-selection/policy.d.ts +0 -9
  567. package/dist/engine/test-selection/policy.js +0 -192
  568. package/dist/engine/text-signal-boundaries.d.ts +0 -8
  569. package/dist/engine/text-signal-boundaries.js +0 -122
  570. package/dist/engine/time/relative-date.d.ts +0 -3
  571. package/dist/engine/time/relative-date.js +0 -16
  572. package/dist/engine/timing/budget.d.ts +0 -29
  573. package/dist/engine/timing/budget.js +0 -129
  574. package/dist/engine/universal-rules/catalog.d.ts +0 -7
  575. package/dist/engine/universal-rules/catalog.js +0 -25
  576. package/dist/engine/universal-rules/host-writer.d.ts +0 -7
  577. package/dist/engine/universal-rules/host-writer.js +0 -113
  578. package/dist/engine/universal-rules/installer.d.ts +0 -5
  579. package/dist/engine/universal-rules/installer.js +0 -236
  580. package/dist/engine/universal-rules/rules/planu-approval-gates.d.ts +0 -3
  581. package/dist/engine/universal-rules/rules/planu-approval-gates.js +0 -48
  582. package/dist/engine/universal-rules/rules/planu-bdd-criteria.d.ts +0 -3
  583. package/dist/engine/universal-rules/rules/planu-bdd-criteria.js +0 -44
  584. package/dist/engine/universal-rules/rules/planu-dogfood-bugs.d.ts +0 -3
  585. package/dist/engine/universal-rules/rules/planu-dogfood-bugs.js +0 -70
  586. package/dist/engine/universal-rules/rules/planu-english-specs.d.ts +0 -3
  587. package/dist/engine/universal-rules/rules/planu-english-specs.js +0 -41
  588. package/dist/engine/universal-rules/rules/planu-minimal-change.d.ts +0 -3
  589. package/dist/engine/universal-rules/rules/planu-minimal-change.js +0 -42
  590. package/dist/engine/universal-rules/rules/planu-modes.d.ts +0 -3
  591. package/dist/engine/universal-rules/rules/planu-modes.js +0 -57
  592. package/dist/engine/universal-rules/rules/planu-sdd-model-routing.d.ts +0 -3
  593. package/dist/engine/universal-rules/rules/planu-sdd-model-routing.js +0 -50
  594. package/dist/engine/universal-rules/rules/planu-workflow.d.ts +0 -3
  595. package/dist/engine/universal-rules/rules/planu-workflow.js +0 -92
  596. package/dist/engine/universal-rules/user-edit-detector.d.ts +0 -21
  597. package/dist/engine/universal-rules/user-edit-detector.js +0 -46
  598. package/dist/engine/validation/durable-validation.d.ts +0 -44
  599. package/dist/engine/validation/durable-validation.js +0 -344
  600. package/dist/engine/validation/validation-freshness.d.ts +0 -73
  601. package/dist/engine/validation/validation-freshness.js +0 -777
  602. package/dist/engine/validation/validation-receipt-codec.d.ts +0 -13
  603. package/dist/engine/validation/validation-receipt-codec.js +0 -184
  604. package/dist/engine/validation/validation-receipt.d.ts +0 -67
  605. package/dist/engine/validation/validation-receipt.js +0 -342
  606. package/dist/engine/validation/validation-source-digest.d.ts +0 -2
  607. package/dist/engine/validation/validation-source-digest.js +0 -86
  608. package/dist/engine/validation/validation-source-policy.d.ts +0 -4
  609. package/dist/engine/validation/validation-source-policy.js +0 -17
  610. package/dist/engine/validation/validation-submission.d.ts +0 -35
  611. package/dist/engine/validation/validation-submission.js +0 -142
  612. package/dist/engine/validation/validation-worktree.d.ts +0 -21
  613. package/dist/engine/validation/validation-worktree.js +0 -294
  614. package/dist/engine/validation-evidence-digest.d.ts +0 -4
  615. package/dist/engine/validation-evidence-digest.js +0 -83
  616. package/dist/engine/validation-evidence-ledger.d.ts +0 -30
  617. package/dist/engine/validation-evidence-ledger.js +0 -328
  618. package/dist/engine/validation-impact-planner.d.ts +0 -14
  619. package/dist/engine/validation-impact-planner.js +0 -74
  620. package/dist/engine/validation-loop.d.ts +0 -12
  621. package/dist/engine/validation-loop.js +0 -216
  622. package/dist/engine/validator/analyzer.d.ts +0 -23
  623. package/dist/engine/validator/analyzer.js +0 -495
  624. package/dist/engine/validator/blast-radius-gate.d.ts +0 -3
  625. package/dist/engine/validator/blast-radius-gate.js +0 -305
  626. package/dist/engine/validator/checklist.d.ts +0 -6
  627. package/dist/engine/validator/checklist.js +0 -147
  628. package/dist/engine/validator/deep-code-checker.d.ts +0 -49
  629. package/dist/engine/validator/deep-code-checker.js +0 -410
  630. package/dist/engine/validator/dor-dod.d.ts +0 -11
  631. package/dist/engine/validator/dor-dod.js +0 -338
  632. package/dist/engine/validator/executable-evidence.d.ts +0 -18
  633. package/dist/engine/validator/executable-evidence.js +0 -104
  634. package/dist/engine/validator/extractors.d.ts +0 -16
  635. package/dist/engine/validator/extractors.js +0 -105
  636. package/dist/engine/validator/gates/code-gates.d.ts +0 -14
  637. package/dist/engine/validator/gates/code-gates.js +0 -87
  638. package/dist/engine/validator/gates/convention-gates.d.ts +0 -13
  639. package/dist/engine/validator/gates/convention-gates.js +0 -84
  640. package/dist/engine/validator/gates/index.d.ts +0 -8
  641. package/dist/engine/validator/gates/index.js +0 -63
  642. package/dist/engine/validator/gates/test-gates.d.ts +0 -12
  643. package/dist/engine/validator/gates/test-gates.js +0 -105
  644. package/dist/engine/validator/holistic-report.d.ts +0 -11
  645. package/dist/engine/validator/holistic-report.js +0 -34
  646. package/dist/engine/validator/negative-predicate.d.ts +0 -17
  647. package/dist/engine/validator/negative-predicate.js +0 -240
  648. package/dist/engine/validator/package-json-evidence.d.ts +0 -3
  649. package/dist/engine/validator/package-json-evidence.js +0 -97
  650. package/dist/engine/validator/reliability-gate.d.ts +0 -4
  651. package/dist/engine/validator/reliability-gate.js +0 -81
  652. package/dist/engine/validator/scope-resolver.d.ts +0 -30
  653. package/dist/engine/validator/scope-resolver.js +0 -67
  654. package/dist/engine/validator/spec-compliance-runner.d.ts +0 -9
  655. package/dist/engine/validator/spec-compliance-runner.js +0 -849
  656. package/dist/engine/validator/test-evidence-grounding.d.ts +0 -64
  657. package/dist/engine/validator/test-evidence-grounding.js +0 -221
  658. package/dist/engine/validator/validation-report-writer.d.ts +0 -27
  659. package/dist/engine/validator/validation-report-writer.js +0 -208
  660. package/dist/engine/validator.d.ts +0 -19
  661. package/dist/engine/validator.js +0 -244
  662. package/dist/engine/verifier/bdd-entity-extractor.d.ts +0 -23
  663. package/dist/engine/verifier/bdd-entity-extractor.js +0 -227
  664. package/dist/engine/verifier/compliance-scorer.d.ts +0 -17
  665. package/dist/engine/verifier/compliance-scorer.js +0 -131
  666. package/dist/engine/verifier/criterion-matcher.d.ts +0 -22
  667. package/dist/engine/verifier/criterion-matcher.js +0 -309
  668. package/dist/engine/web-fetcher/registry-loader.d.ts +0 -7
  669. package/dist/engine/web-fetcher/registry-loader.js +0 -44
  670. package/dist/engine/whats-new.d.ts +0 -2
  671. package/dist/engine/whats-new.js +0 -42
  672. package/dist/errors/classified-degradation.d.ts +0 -3
  673. package/dist/errors/classified-degradation.js +0 -10
  674. package/dist/errors/degradation-sink.d.ts +0 -3
  675. package/dist/errors/degradation-sink.js +0 -5
  676. package/dist/errors/error-taxonomy.d.ts +0 -11
  677. package/dist/errors/error-taxonomy.js +0 -59
  678. package/dist/hosts/claude-code/coach.d.ts +0 -6
  679. package/dist/hosts/claude-code/coach.js +0 -10
  680. package/dist/hosts/claude-code/ux/subagent-publisher.d.ts +0 -20
  681. package/dist/hosts/claude-code/ux/subagent-publisher.js +0 -117
  682. package/dist/hosts/codex/config-scaffold.d.ts +0 -10
  683. package/dist/hosts/codex/config-scaffold.js +0 -102
  684. package/dist/hosts/codex/workspace-scope.d.ts +0 -43
  685. package/dist/hosts/codex/workspace-scope.js +0 -89
  686. package/dist/hosts/gemini/config-scaffold.d.ts +0 -14
  687. package/dist/hosts/gemini/config-scaffold.js +0 -165
  688. package/dist/i18n/index.d.ts +0 -61
  689. package/dist/i18n/index.js +0 -288
  690. package/dist/prompts/index.d.ts +0 -6
  691. package/dist/prompts/index.js +0 -121
  692. package/dist/resources/process.d.ts +0 -11
  693. package/dist/resources/process.js +0 -80
  694. package/dist/resources/registry.d.ts +0 -6
  695. package/dist/resources/registry.js +0 -16
  696. package/dist/resources/specs.d.ts +0 -11
  697. package/dist/resources/specs.js +0 -58
  698. package/dist/security/adapters/environment.d.ts +0 -12
  699. package/dist/security/adapters/environment.js +0 -25
  700. package/dist/security/adapters/local-file.d.ts +0 -12
  701. package/dist/security/adapters/local-file.js +0 -56
  702. package/dist/security/adapters/macos-keychain.d.ts +0 -20
  703. package/dist/security/adapters/macos-keychain.js +0 -151
  704. package/dist/security/redactor.d.ts +0 -5
  705. package/dist/security/redactor.js +0 -58
  706. package/dist/security/secret-provider.d.ts +0 -22
  707. package/dist/security/secret-provider.js +0 -107
  708. package/dist/storage/approval-operation-lock.d.ts +0 -7
  709. package/dist/storage/approval-operation-lock.js +0 -47
  710. package/dist/storage/approval-store.d.ts +0 -14
  711. package/dist/storage/approval-store.js +0 -117
  712. package/dist/storage/audit-trail-store.d.ts +0 -20
  713. package/dist/storage/audit-trail-store.js +0 -83
  714. package/dist/storage/base-store.d.ts +0 -69
  715. package/dist/storage/base-store.js +0 -195
  716. package/dist/storage/compliance-gate-config-store.d.ts +0 -4
  717. package/dist/storage/compliance-gate-config-store.js +0 -20
  718. package/dist/storage/convention-baseline.d.ts +0 -20
  719. package/dist/storage/convention-baseline.js +0 -62
  720. package/dist/storage/current-project.d.ts +0 -3
  721. package/dist/storage/current-project.js +0 -21
  722. package/dist/storage/file-mutex.d.ts +0 -14
  723. package/dist/storage/file-mutex.js +0 -47
  724. package/dist/storage/global-projects-store.d.ts +0 -53
  725. package/dist/storage/global-projects-store.js +0 -181
  726. package/dist/storage/global-store.d.ts +0 -82
  727. package/dist/storage/global-store.js +0 -246
  728. package/dist/storage/index.d.ts +0 -15
  729. package/dist/storage/index.js +0 -16
  730. package/dist/storage/knowledge-store/knowledge.d.ts +0 -25
  731. package/dist/storage/knowledge-store/knowledge.js +0 -112
  732. package/dist/storage/knowledge-store/sessions.d.ts +0 -16
  733. package/dist/storage/knowledge-store/sessions.js +0 -155
  734. package/dist/storage/knowledge-store.d.ts +0 -3
  735. package/dist/storage/knowledge-store.js +0 -8
  736. package/dist/storage/migrations/canonical-storage.d.ts +0 -15
  737. package/dist/storage/migrations/canonical-storage.js +0 -754
  738. package/dist/storage/migrations/sdd-core-v6.d.ts +0 -11
  739. package/dist/storage/migrations/sdd-core-v6.js +0 -873
  740. package/dist/storage/pattern-store.d.ts +0 -38
  741. package/dist/storage/pattern-store.js +0 -136
  742. package/dist/storage/project-identity.d.ts +0 -60
  743. package/dist/storage/project-identity.js +0 -454
  744. package/dist/storage/project-resolver.d.ts +0 -17
  745. package/dist/storage/project-resolver.js +0 -134
  746. package/dist/storage/retention.d.ts +0 -13
  747. package/dist/storage/retention.js +0 -383
  748. package/dist/storage/runtime-db.d.ts +0 -207
  749. package/dist/storage/runtime-db.js +0 -1313
  750. package/dist/storage/schema-registry.d.ts +0 -5
  751. package/dist/storage/schema-registry.js +0 -74
  752. package/dist/storage/spec-index.d.ts +0 -23
  753. package/dist/storage/spec-index.js +0 -117
  754. package/dist/storage/spec-lock-store.d.ts +0 -22
  755. package/dist/storage/spec-lock-store.js +0 -99
  756. package/dist/storage/spec-store.d.ts +0 -170
  757. package/dist/storage/spec-store.js +0 -968
  758. package/dist/storage/storage-bundle.d.ts +0 -16
  759. package/dist/storage/storage-bundle.js +0 -117
  760. package/dist/storage/storage-catalog-validation.d.ts +0 -3
  761. package/dist/storage/storage-catalog-validation.js +0 -20
  762. package/dist/storage/storage-catalog.d.ts +0 -25
  763. package/dist/storage/storage-catalog.js +0 -421
  764. package/dist/storage/storage-layout.d.ts +0 -40
  765. package/dist/storage/storage-layout.js +0 -117
  766. package/dist/storage/technology-selection-store.d.ts +0 -5
  767. package/dist/storage/technology-selection-store.js +0 -46
  768. package/dist/storage/transition-log.d.ts +0 -11
  769. package/dist/storage/transition-log.js +0 -234
  770. package/dist/tools/bump-spec-version.d.ts +0 -31
  771. package/dist/tools/bump-spec-version.js +0 -132
  772. package/dist/tools/challenge-spec/agent-challenge-scenarios.d.ts +0 -12
  773. package/dist/tools/challenge-spec/agent-challenge-scenarios.js +0 -129
  774. package/dist/tools/challenge-spec/architecture-challenge-scenarios.d.ts +0 -12
  775. package/dist/tools/challenge-spec/architecture-challenge-scenarios.js +0 -113
  776. package/dist/tools/challenge-spec/challenge-report.d.ts +0 -26
  777. package/dist/tools/challenge-spec/challenge-report.js +0 -221
  778. package/dist/tools/challenge-spec/event-challenge-scenarios.d.ts +0 -14
  779. package/dist/tools/challenge-spec/event-challenge-scenarios.js +0 -68
  780. package/dist/tools/challenge-spec/implementation-contract-challenge-scenarios.d.ts +0 -3
  781. package/dist/tools/challenge-spec/implementation-contract-challenge-scenarios.js +0 -51
  782. package/dist/tools/challenge-spec/platform-challenge-scenarios-b.d.ts +0 -7
  783. package/dist/tools/challenge-spec/platform-challenge-scenarios-b.js +0 -48
  784. package/dist/tools/challenge-spec/platform-challenge-scenarios-b1.d.ts +0 -4
  785. package/dist/tools/challenge-spec/platform-challenge-scenarios-b1.js +0 -109
  786. package/dist/tools/challenge-spec/platform-challenge-scenarios-b2.d.ts +0 -5
  787. package/dist/tools/challenge-spec/platform-challenge-scenarios-b2.js +0 -191
  788. package/dist/tools/challenge-spec/platform-challenge-scenarios.d.ts +0 -7
  789. package/dist/tools/challenge-spec/platform-challenge-scenarios.js +0 -224
  790. package/dist/tools/challenge-spec/resilience-challenge-scenarios-a.d.ts +0 -28
  791. package/dist/tools/challenge-spec/resilience-challenge-scenarios-a.js +0 -183
  792. package/dist/tools/challenge-spec/resilience-challenge-scenarios-b.d.ts +0 -14
  793. package/dist/tools/challenge-spec/resilience-challenge-scenarios-b.js +0 -144
  794. package/dist/tools/challenge-spec/resilience-challenge-scenarios.d.ts +0 -8
  795. package/dist/tools/challenge-spec/resilience-challenge-scenarios.js +0 -37
  796. package/dist/tools/challenge-spec/scenario-collector.d.ts +0 -13
  797. package/dist/tools/challenge-spec/scenario-collector.js +0 -84
  798. package/dist/tools/challenge-spec/scenarios-data.d.ts +0 -3
  799. package/dist/tools/challenge-spec/scenarios-data.js +0 -73
  800. package/dist/tools/challenge-spec/scenarios-desktop.d.ts +0 -7
  801. package/dist/tools/challenge-spec/scenarios-desktop.js +0 -91
  802. package/dist/tools/challenge-spec/scenarios-failure.d.ts +0 -3
  803. package/dist/tools/challenge-spec/scenarios-failure.js +0 -136
  804. package/dist/tools/challenge-spec/scenarios-game.d.ts +0 -6
  805. package/dist/tools/challenge-spec/scenarios-game.js +0 -71
  806. package/dist/tools/challenge-spec/scenarios-scale.d.ts +0 -3
  807. package/dist/tools/challenge-spec/scenarios-scale.js +0 -37
  808. package/dist/tools/challenge-spec/scenarios-security.d.ts +0 -3
  809. package/dist/tools/challenge-spec/scenarios-security.js +0 -85
  810. package/dist/tools/challenge-spec/scenarios-utils.d.ts +0 -42
  811. package/dist/tools/challenge-spec/scenarios-utils.js +0 -250
  812. package/dist/tools/challenge-spec-helpers.d.ts +0 -16
  813. package/dist/tools/challenge-spec-helpers.js +0 -152
  814. package/dist/tools/challenge-spec-scenarios.d.ts +0 -7
  815. package/dist/tools/challenge-spec-scenarios.js +0 -9
  816. package/dist/tools/challenge-spec.d.ts +0 -4
  817. package/dist/tools/challenge-spec.js +0 -448
  818. package/dist/tools/check-readiness.d.ts +0 -5
  819. package/dist/tools/check-readiness.js +0 -343
  820. package/dist/tools/claude-settings-file.d.ts +0 -3
  821. package/dist/tools/claude-settings-file.js +0 -19
  822. package/dist/tools/create-skill.d.ts +0 -4
  823. package/dist/tools/create-skill.js +0 -151
  824. package/dist/tools/create-spec/autopilot-analyzer.d.ts +0 -33
  825. package/dist/tools/create-spec/autopilot-analyzer.js +0 -171
  826. package/dist/tools/create-spec/constitution-validator.d.ts +0 -4
  827. package/dist/tools/create-spec/constitution-validator.js +0 -31
  828. package/dist/tools/create-spec/question-generator.d.ts +0 -4
  829. package/dist/tools/create-spec/question-generator.js +0 -25
  830. package/dist/tools/create-spec/relevance-scorer.d.ts +0 -18
  831. package/dist/tools/create-spec/relevance-scorer.js +0 -156
  832. package/dist/tools/create-spec/spec-builder.d.ts +0 -20
  833. package/dist/tools/create-spec/spec-builder.js +0 -274
  834. package/dist/tools/create-spec-helpers.d.ts +0 -4
  835. package/dist/tools/create-spec-helpers.js +0 -24
  836. package/dist/tools/create-spec-tech/constitution.d.ts +0 -7
  837. package/dist/tools/create-spec-tech/constitution.js +0 -79
  838. package/dist/tools/create-spec-tech.d.ts +0 -2
  839. package/dist/tools/create-spec-tech.js +0 -3
  840. package/dist/tools/create-spec.d.ts +0 -25
  841. package/dist/tools/create-spec.js +0 -1698
  842. package/dist/tools/git/git-helpers.d.ts +0 -20
  843. package/dist/tools/git/git-helpers.js +0 -33
  844. package/dist/tools/init-project/agents-md-writer.d.ts +0 -18
  845. package/dist/tools/init-project/agents-md-writer.js +0 -123
  846. package/dist/tools/init-project/config-builder.d.ts +0 -14
  847. package/dist/tools/init-project/config-builder.js +0 -19
  848. package/dist/tools/init-project/conventions-writer.d.ts +0 -11
  849. package/dist/tools/init-project/conventions-writer.js +0 -61
  850. package/dist/tools/init-project/handler.d.ts +0 -4
  851. package/dist/tools/init-project/handler.js +0 -463
  852. package/dist/tools/init-project/helpers.d.ts +0 -31
  853. package/dist/tools/init-project/helpers.js +0 -223
  854. package/dist/tools/init-project/host-assets-writer.d.ts +0 -28
  855. package/dist/tools/init-project/host-assets-writer.js +0 -240
  856. package/dist/tools/init-project/legacy-guidance-scanner.d.ts +0 -9
  857. package/dist/tools/init-project/legacy-guidance-scanner.js +0 -218
  858. package/dist/tools/init-project/legacy-root-migration.d.ts +0 -16
  859. package/dist/tools/init-project/legacy-root-migration.js +0 -213
  860. package/dist/tools/init-project/lifecycle-helpers.d.ts +0 -12
  861. package/dist/tools/init-project/lifecycle-helpers.js +0 -37
  862. package/dist/tools/init-project/managed-guidance-refresher.d.ts +0 -9
  863. package/dist/tools/init-project/managed-guidance-refresher.js +0 -65
  864. package/dist/tools/init-project/migration-runner.d.ts +0 -43
  865. package/dist/tools/init-project/migration-runner.js +0 -227
  866. package/dist/tools/init-project/portable-index-reconciler.d.ts +0 -32
  867. package/dist/tools/init-project/portable-index-reconciler.js +0 -278
  868. package/dist/tools/init-project/result-builder.d.ts +0 -4
  869. package/dist/tools/init-project/result-builder.js +0 -272
  870. package/dist/tools/init-project/scaffold-verifier.d.ts +0 -6
  871. package/dist/tools/init-project/scaffold-verifier.js +0 -97
  872. package/dist/tools/init-project/scaffold-writer.d.ts +0 -49
  873. package/dist/tools/init-project/scaffold-writer.js +0 -50
  874. package/dist/tools/init-project.d.ts +0 -2
  875. package/dist/tools/init-project.js +0 -4
  876. package/dist/tools/jobs/handlers.d.ts +0 -11
  877. package/dist/tools/jobs/handlers.js +0 -152
  878. package/dist/tools/list-specs.d.ts +0 -3
  879. package/dist/tools/list-specs.js +0 -323
  880. package/dist/tools/output-formatter.d.ts +0 -34
  881. package/dist/tools/output-formatter.js +0 -171
  882. package/dist/tools/output-integrity-guard.d.ts +0 -3
  883. package/dist/tools/output-integrity-guard.js +0 -53
  884. package/dist/tools/package-handoff.d.ts +0 -4
  885. package/dist/tools/package-handoff.js +0 -215
  886. package/dist/tools/reconcile-spec-sanctity-hook.d.ts +0 -3
  887. package/dist/tools/reconcile-spec-sanctity-hook.js +0 -55
  888. package/dist/tools/reconcile-spec.d.ts +0 -4
  889. package/dist/tools/reconcile-spec.js +0 -572
  890. package/dist/tools/register-sdd-tools.d.ts +0 -4
  891. package/dist/tools/register-sdd-tools.js +0 -13
  892. package/dist/tools/resolve-project-id.d.ts +0 -58
  893. package/dist/tools/resolve-project-id.js +0 -103
  894. package/dist/tools/resolve-project-path.d.ts +0 -27
  895. package/dist/tools/resolve-project-path.js +0 -172
  896. package/dist/tools/response-helpers.d.ts +0 -70
  897. package/dist/tools/response-helpers.js +0 -139
  898. package/dist/tools/safe-handler.d.ts +0 -36
  899. package/dist/tools/safe-handler.js +0 -283
  900. package/dist/tools/sanitize-path.d.ts +0 -13
  901. package/dist/tools/sanitize-path.js +0 -60
  902. package/dist/tools/schemas/agents.d.ts +0 -21
  903. package/dist/tools/schemas/agents.js +0 -9
  904. package/dist/tools/schemas/analysis.d.ts +0 -28
  905. package/dist/tools/schemas/analysis.js +0 -22
  906. package/dist/tools/schemas/index.d.ts +0 -8
  907. package/dist/tools/schemas/index.js +0 -9
  908. package/dist/tools/schemas/infra.d.ts +0 -19
  909. package/dist/tools/schemas/infra.js +0 -18
  910. package/dist/tools/schemas/lifecycle.d.ts +0 -88
  911. package/dist/tools/schemas/lifecycle.js +0 -85
  912. package/dist/tools/schemas/output-schemas.d.ts +0 -115
  913. package/dist/tools/schemas/output-schemas.js +0 -136
  914. package/dist/tools/schemas/package-handoff-output-schema.d.ts +0 -41
  915. package/dist/tools/schemas/package-handoff-output-schema.js +0 -70
  916. package/dist/tools/schemas/spec-id.d.ts +0 -2
  917. package/dist/tools/schemas/spec-id.js +0 -2
  918. package/dist/tools/schemas/spec.d.ts +0 -51
  919. package/dist/tools/schemas/spec.js +0 -41
  920. package/dist/tools/schemas/validate-output-schema.d.ts +0 -276
  921. package/dist/tools/schemas/validate-output-schema.js +0 -225
  922. package/dist/tools/status-handler.d.ts +0 -3
  923. package/dist/tools/status-handler.js +0 -242
  924. package/dist/tools/tool-entry.d.ts +0 -52
  925. package/dist/tools/tool-entry.js +0 -46
  926. package/dist/tools/tool-registry/core-tools.d.ts +0 -4
  927. package/dist/tools/tool-registry/core-tools.js +0 -581
  928. package/dist/tools/tool-registry/inventory.d.ts +0 -2
  929. package/dist/tools/tool-registry/inventory.js +0 -2
  930. package/dist/tools/tool-registry-helpers.d.ts +0 -34
  931. package/dist/tools/tool-registry-helpers.js +0 -45
  932. package/dist/tools/update-status/approval-gates.d.ts +0 -13
  933. package/dist/tools/update-status/approval-gates.js +0 -108
  934. package/dist/tools/update-status/batch.d.ts +0 -7
  935. package/dist/tools/update-status/batch.js +0 -176
  936. package/dist/tools/update-status/dod-gates.d.ts +0 -117
  937. package/dist/tools/update-status/dod-gates.js +0 -847
  938. package/dist/tools/update-status/done-receipt-verifier.d.ts +0 -38
  939. package/dist/tools/update-status/done-receipt-verifier.js +0 -208
  940. package/dist/tools/update-status/evidence-gate.d.ts +0 -16
  941. package/dist/tools/update-status/evidence-gate.js +0 -361
  942. package/dist/tools/update-status/evidence-payload.d.ts +0 -180
  943. package/dist/tools/update-status/evidence-payload.js +0 -79
  944. package/dist/tools/update-status/file-sync.d.ts +0 -37
  945. package/dist/tools/update-status/file-sync.js +0 -223
  946. package/dist/tools/update-status/gate-harness.d.ts +0 -8
  947. package/dist/tools/update-status/gate-harness.js +0 -8
  948. package/dist/tools/update-status/index.d.ts +0 -25
  949. package/dist/tools/update-status/index.js +0 -1487
  950. package/dist/tools/update-status/response-builder.d.ts +0 -17
  951. package/dist/tools/update-status/response-builder.js +0 -297
  952. package/dist/tools/update-status/side-effects.d.ts +0 -16
  953. package/dist/tools/update-status/side-effects.js +0 -117
  954. package/dist/tools/update-status/transition-guard.d.ts +0 -85
  955. package/dist/tools/update-status/transition-guard.js +0 -752
  956. package/dist/tools/update-status-actions.d.ts +0 -6
  957. package/dist/tools/update-status-actions.js +0 -19
  958. package/dist/tools/update-status-convention-gate.d.ts +0 -9
  959. package/dist/tools/update-status-convention-gate.js +0 -330
  960. package/dist/tools/update-status.d.ts +0 -2
  961. package/dist/tools/update-status.js +0 -3
  962. package/dist/tools/validate-assurance.d.ts +0 -6
  963. package/dist/tools/validate-assurance.js +0 -55
  964. package/dist/tools/validate-graph-coverage.d.ts +0 -8
  965. package/dist/tools/validate-graph-coverage.js +0 -54
  966. package/dist/tools/validate-helpers.d.ts +0 -10
  967. package/dist/tools/validate-helpers.js +0 -65
  968. package/dist/tools/validate-lint.d.ts +0 -9
  969. package/dist/tools/validate-lint.js +0 -170
  970. package/dist/tools/validate-minimality.d.ts +0 -16
  971. package/dist/tools/validate-minimality.js +0 -22
  972. package/dist/tools/validate-structured-compat.d.ts +0 -19
  973. package/dist/tools/validate-structured-compat.js +0 -14
  974. package/dist/tools/validate.d.ts +0 -8
  975. package/dist/tools/validate.js +0 -1039
  976. package/dist/transports/transport-factory.d.ts +0 -5
  977. package/dist/transports/transport-factory.js +0 -182
  978. package/dist/types/abortable-process.d.ts +0 -29
  979. package/dist/types/abortable-process.js +0 -2
  980. package/dist/types/agent-team.d.ts +0 -17
  981. package/dist/types/agent-team.js +0 -3
  982. package/dist/types/ai-assurance.d.ts +0 -32
  983. package/dist/types/ai-assurance.js +0 -2
  984. package/dist/types/ai-native.d.ts +0 -16
  985. package/dist/types/ai-native.js +0 -3
  986. package/dist/types/analysis.d.ts +0 -238
  987. package/dist/types/analysis.js +0 -3
  988. package/dist/types/approval.d.ts +0 -66
  989. package/dist/types/approval.js +0 -6
  990. package/dist/types/architecture.d.ts +0 -101
  991. package/dist/types/architecture.js +0 -4
  992. package/dist/types/audit.d.ts +0 -38
  993. package/dist/types/audit.js +0 -4
  994. package/dist/types/build-freshness.d.ts +0 -11
  995. package/dist/types/build-freshness.js +0 -2
  996. package/dist/types/clarification-token.d.ts +0 -46
  997. package/dist/types/clarification-token.js +0 -2
  998. package/dist/types/clarification.d.ts +0 -23
  999. package/dist/types/clarification.js +0 -5
  1000. package/dist/types/claude-code-runtime.d.ts +0 -91
  1001. package/dist/types/claude-code-runtime.js +0 -5
  1002. package/dist/types/claude-code-ux.d.ts +0 -62
  1003. package/dist/types/claude-code-ux.js +0 -5
  1004. package/dist/types/cli.d.ts +0 -40
  1005. package/dist/types/cli.js +0 -3
  1006. package/dist/types/codex.d.ts +0 -108
  1007. package/dist/types/codex.js +0 -3
  1008. package/dist/types/common/index.d.ts +0 -4
  1009. package/dist/types/common/index.js +0 -6
  1010. package/dist/types/common/learning.d.ts +0 -43
  1011. package/dist/types/common/learning.js +0 -3
  1012. package/dist/types/common/tech-enums.d.ts +0 -8
  1013. package/dist/types/common/tech-enums.js +0 -2
  1014. package/dist/types/complexity-budget.d.ts +0 -17
  1015. package/dist/types/complexity-budget.js +0 -5
  1016. package/dist/types/compliance-gate.d.ts +0 -5
  1017. package/dist/types/compliance-gate.js +0 -3
  1018. package/dist/types/context.d.ts +0 -52
  1019. package/dist/types/context.js +0 -4
  1020. package/dist/types/conventions.d.ts +0 -135
  1021. package/dist/types/conventions.js +0 -5
  1022. package/dist/types/core-bridge.d.ts +0 -130
  1023. package/dist/types/core-bridge.js +0 -3
  1024. package/dist/types/criterion-identity.d.ts +0 -12
  1025. package/dist/types/criterion-identity.js +0 -2
  1026. package/dist/types/cross-repo-search.d.ts +0 -81
  1027. package/dist/types/cross-repo-search.js +0 -9
  1028. package/dist/types/decisions.d.ts +0 -19
  1029. package/dist/types/decisions.js +0 -4
  1030. package/dist/types/durable-job.d.ts +0 -119
  1031. package/dist/types/durable-job.js +0 -10
  1032. package/dist/types/durable-validation.d.ts +0 -158
  1033. package/dist/types/durable-validation.js +0 -166
  1034. package/dist/types/edge-db.d.ts +0 -21
  1035. package/dist/types/edge-db.js +0 -9
  1036. package/dist/types/elicitation.d.ts +0 -115
  1037. package/dist/types/elicitation.js +0 -13
  1038. package/dist/types/env.d.ts +0 -94
  1039. package/dist/types/env.js +0 -3
  1040. package/dist/types/errors/structured-error.d.ts +0 -37
  1041. package/dist/types/errors/structured-error.js +0 -3
  1042. package/dist/types/estimation.d.ts +0 -29
  1043. package/dist/types/estimation.js +0 -5
  1044. package/dist/types/events.d.ts +0 -18
  1045. package/dist/types/events.js +0 -4
  1046. package/dist/types/evidence-autofill.d.ts +0 -40
  1047. package/dist/types/evidence-autofill.js +0 -3
  1048. package/dist/types/evidence-gates.d.ts +0 -103
  1049. package/dist/types/evidence-gates.js +0 -2
  1050. package/dist/types/evidence-index.d.ts +0 -26
  1051. package/dist/types/evidence-index.js +0 -2
  1052. package/dist/types/execution.d.ts +0 -103
  1053. package/dist/types/execution.js +0 -2
  1054. package/dist/types/frontmatter.d.ts +0 -5
  1055. package/dist/types/frontmatter.js +0 -2
  1056. package/dist/types/gemini.d.ts +0 -124
  1057. package/dist/types/gemini.js +0 -3
  1058. package/dist/types/handoff-artifacts.d.ts +0 -182
  1059. package/dist/types/handoff-artifacts.js +0 -3
  1060. package/dist/types/host-rules.d.ts +0 -10
  1061. package/dist/types/host-rules.js +0 -3
  1062. package/dist/types/host-tool-filter.d.ts +0 -31
  1063. package/dist/types/host-tool-filter.js +0 -3
  1064. package/dist/types/housekeeping.d.ts +0 -8
  1065. package/dist/types/housekeeping.js +0 -22
  1066. package/dist/types/index.d.ts +0 -81
  1067. package/dist/types/index.js +0 -94
  1068. package/dist/types/interactive-question.d.ts +0 -19
  1069. package/dist/types/interactive-question.js +0 -3
  1070. package/dist/types/keyword-matcher.d.ts +0 -38
  1071. package/dist/types/keyword-matcher.js +0 -3
  1072. package/dist/types/legacy-guidance.d.ts +0 -24
  1073. package/dist/types/legacy-guidance.js +0 -3
  1074. package/dist/types/legal.d.ts +0 -44
  1075. package/dist/types/legal.js +0 -5
  1076. package/dist/types/living-spec/annotations.d.ts +0 -36
  1077. package/dist/types/living-spec/annotations.js +0 -23
  1078. package/dist/types/living-spec.d.ts +0 -2
  1079. package/dist/types/living-spec.js +0 -6
  1080. package/dist/types/llm-security.d.ts +0 -19
  1081. package/dist/types/llm-security.js +0 -4
  1082. package/dist/types/local-first.d.ts +0 -25
  1083. package/dist/types/local-first.js +0 -10
  1084. package/dist/types/mcp.d.ts +0 -34
  1085. package/dist/types/mcp.js +0 -4
  1086. package/dist/types/migration/canonical-storage.d.ts +0 -38
  1087. package/dist/types/migration/canonical-storage.js +0 -2
  1088. package/dist/types/minimal-implementation-gate.d.ts +0 -98
  1089. package/dist/types/minimal-implementation-gate.js +0 -2
  1090. package/dist/types/model-routing.d.ts +0 -25
  1091. package/dist/types/model-routing.js +0 -26
  1092. package/dist/types/multi-agent.d.ts +0 -18
  1093. package/dist/types/multi-agent.js +0 -18
  1094. package/dist/types/nli-context.d.ts +0 -25
  1095. package/dist/types/nli-context.js +0 -2
  1096. package/dist/types/opencode.d.ts +0 -4
  1097. package/dist/types/opencode.js +0 -3
  1098. package/dist/types/paradigm.d.ts +0 -99
  1099. package/dist/types/paradigm.js +0 -11
  1100. package/dist/types/privacy.d.ts +0 -81
  1101. package/dist/types/privacy.js +0 -25
  1102. package/dist/types/project/agent.d.ts +0 -13
  1103. package/dist/types/project/agent.js +0 -3
  1104. package/dist/types/project/architecture-detection.d.ts +0 -24
  1105. package/dist/types/project/architecture-detection.js +0 -2
  1106. package/dist/types/project/config-metrics.d.ts +0 -10
  1107. package/dist/types/project/config-metrics.js +0 -2
  1108. package/dist/types/project/constitution.d.ts +0 -26
  1109. package/dist/types/project/constitution.js +0 -3
  1110. package/dist/types/project/core.d.ts +0 -137
  1111. package/dist/types/project/core.js +0 -7
  1112. package/dist/types/project/health-checker.d.ts +0 -13
  1113. package/dist/types/project/health-checker.js +0 -3
  1114. package/dist/types/project/inputs.d.ts +0 -39
  1115. package/dist/types/project/inputs.js +0 -5
  1116. package/dist/types/project/legacy-artifacts.d.ts +0 -7
  1117. package/dist/types/project/legacy-artifacts.js +0 -2
  1118. package/dist/types/project/library-groups.d.ts +0 -112
  1119. package/dist/types/project/library-groups.js +0 -4
  1120. package/dist/types/project/mfe-detection.d.ts +0 -19
  1121. package/dist/types/project/mfe-detection.js +0 -3
  1122. package/dist/types/project/planu-config.d.ts +0 -142
  1123. package/dist/types/project/planu-config.js +0 -2
  1124. package/dist/types/project/platform-exotic.d.ts +0 -108
  1125. package/dist/types/project/platform-exotic.js +0 -3
  1126. package/dist/types/project/platform-mobile.d.ts +0 -7
  1127. package/dist/types/project/platform-mobile.js +0 -3
  1128. package/dist/types/project/platform-specialty.d.ts +0 -17
  1129. package/dist/types/project/platform-specialty.js +0 -3
  1130. package/dist/types/project/scaffold-verification.d.ts +0 -15
  1131. package/dist/types/project/scaffold-verification.js +0 -2
  1132. package/dist/types/project-knowledge-graph.d.ts +0 -227
  1133. package/dist/types/project-knowledge-graph.js +0 -2
  1134. package/dist/types/project.d.ts +0 -11
  1135. package/dist/types/project.js +0 -13
  1136. package/dist/types/readiness.d.ts +0 -82
  1137. package/dist/types/readiness.js +0 -7
  1138. package/dist/types/reconcile.d.ts +0 -41
  1139. package/dist/types/reconcile.js +0 -9
  1140. package/dist/types/retention.d.ts +0 -12
  1141. package/dist/types/retention.js +0 -3
  1142. package/dist/types/reviewer-tokens.d.ts +0 -58
  1143. package/dist/types/reviewer-tokens.js +0 -4
  1144. package/dist/types/runtime-database.d.ts +0 -10
  1145. package/dist/types/runtime-database.js +0 -2
  1146. package/dist/types/runtime-policy.d.ts +0 -62
  1147. package/dist/types/runtime-policy.js +0 -2
  1148. package/dist/types/safe-schemas.d.ts +0 -12
  1149. package/dist/types/safe-schemas.js +0 -27
  1150. package/dist/types/safety.d.ts +0 -42
  1151. package/dist/types/safety.js +0 -3
  1152. package/dist/types/scan-project.d.ts +0 -20
  1153. package/dist/types/scan-project.js +0 -4
  1154. package/dist/types/schema-registry.d.ts +0 -12
  1155. package/dist/types/schema-registry.js +0 -2
  1156. package/dist/types/scope-boundaries.d.ts +0 -62
  1157. package/dist/types/scope-boundaries.js +0 -3
  1158. package/dist/types/scope.d.ts +0 -89
  1159. package/dist/types/scope.js +0 -3
  1160. package/dist/types/sdd-constitution.d.ts +0 -27
  1161. package/dist/types/sdd-constitution.js +0 -2
  1162. package/dist/types/sdd-core-v6.d.ts +0 -62
  1163. package/dist/types/sdd-core-v6.js +0 -2
  1164. package/dist/types/sdd-flow.d.ts +0 -3
  1165. package/dist/types/sdd-flow.js +0 -3
  1166. package/dist/types/sdd-model-routing.d.ts +0 -22
  1167. package/dist/types/sdd-model-routing.js +0 -2
  1168. package/dist/types/security.d.ts +0 -20
  1169. package/dist/types/security.js +0 -4
  1170. package/dist/types/skill-bootstrap.d.ts +0 -7
  1171. package/dist/types/skill-bootstrap.js +0 -3
  1172. package/dist/types/spec/clarification.d.ts +0 -86
  1173. package/dist/types/spec/clarification.js +0 -2
  1174. package/dist/types/spec/core.d.ts +0 -414
  1175. package/dist/types/spec/core.js +0 -3
  1176. package/dist/types/spec/health-score.d.ts +0 -25
  1177. package/dist/types/spec/health-score.js +0 -2
  1178. package/dist/types/spec/index-cache.d.ts +0 -25
  1179. package/dist/types/spec/index-cache.js +0 -3
  1180. package/dist/types/spec/index.d.ts +0 -7
  1181. package/dist/types/spec/index.js +0 -9
  1182. package/dist/types/spec/inputs.d.ts +0 -250
  1183. package/dist/types/spec/inputs.js +0 -7
  1184. package/dist/types/spec/versioning.d.ts +0 -39
  1185. package/dist/types/spec/versioning.js +0 -3
  1186. package/dist/types/spec-format.d.ts +0 -211
  1187. package/dist/types/spec-format.js +0 -3
  1188. package/dist/types/spec-generator.d.ts +0 -32
  1189. package/dist/types/spec-generator.js +0 -2
  1190. package/dist/types/spec-grounding.d.ts +0 -48
  1191. package/dist/types/spec-grounding.js +0 -2
  1192. package/dist/types/spec-language-translation.d.ts +0 -19
  1193. package/dist/types/spec-language-translation.js +0 -5
  1194. package/dist/types/spec-language.d.ts +0 -8
  1195. package/dist/types/spec-language.js +0 -2
  1196. package/dist/types/spec-lock-v2.d.ts +0 -66
  1197. package/dist/types/spec-lock-v2.js +0 -4
  1198. package/dist/types/spec-lock.d.ts +0 -14
  1199. package/dist/types/spec-lock.js +0 -8
  1200. package/dist/types/spec-quality.d.ts +0 -82
  1201. package/dist/types/spec-quality.js +0 -6
  1202. package/dist/types/stack/build-tool.d.ts +0 -13
  1203. package/dist/types/stack/build-tool.js +0 -5
  1204. package/dist/types/stack/hypermedia.d.ts +0 -4
  1205. package/dist/types/stack/hypermedia.js +0 -3
  1206. package/dist/types/stack/index.d.ts +0 -4
  1207. package/dist/types/stack/index.js +0 -4
  1208. package/dist/types/stack/recommend.d.ts +0 -38
  1209. package/dist/types/stack/recommend.js +0 -3
  1210. package/dist/types/status.d.ts +0 -27
  1211. package/dist/types/status.js +0 -6
  1212. package/dist/types/storage-catalog.d.ts +0 -21
  1213. package/dist/types/storage-catalog.js +0 -2
  1214. package/dist/types/supply-chain.d.ts +0 -49
  1215. package/dist/types/supply-chain.js +0 -25
  1216. package/dist/types/technology-registry.d.ts +0 -36
  1217. package/dist/types/technology-registry.js +0 -2
  1218. package/dist/types/technology-selection.d.ts +0 -78
  1219. package/dist/types/technology-selection.js +0 -3
  1220. package/dist/types/technology-symbols.generated.d.ts +0 -117
  1221. package/dist/types/technology-symbols.generated.js +0 -2
  1222. package/dist/types/testing.d.ts +0 -17
  1223. package/dist/types/testing.js +0 -10
  1224. package/dist/types/timing.d.ts +0 -18
  1225. package/dist/types/timing.js +0 -3
  1226. package/dist/types/transition-log.d.ts +0 -78
  1227. package/dist/types/transition-log.js +0 -4
  1228. package/dist/types/transport.d.ts +0 -6
  1229. package/dist/types/transport.js +0 -4
  1230. package/dist/types/universal-rules/index.d.ts +0 -69
  1231. package/dist/types/universal-rules/index.js +0 -4
  1232. package/dist/types/validate-worker.d.ts +0 -50
  1233. package/dist/types/validate-worker.js +0 -2
  1234. package/dist/types/validation-config.d.ts +0 -36
  1235. package/dist/types/validation-config.js +0 -2
  1236. package/dist/types/validation-evidence.d.ts +0 -177
  1237. package/dist/types/validation-evidence.js +0 -2
  1238. package/dist/types/validation-loop.d.ts +0 -26
  1239. package/dist/types/validation-loop.js +0 -3
  1240. package/dist/types/validation-receipt.d.ts +0 -126
  1241. package/dist/types/validation-receipt.js +0 -2
  1242. package/dist/types/validation.d.ts +0 -67
  1243. package/dist/types/validation.js +0 -3
  1244. package/dist/types/verifiable-criteria.d.ts +0 -31
  1245. package/dist/types/verifiable-criteria.js +0 -10
  1246. package/src/i18n/messages/en.json +0 -184
  1247. package/src/i18n/messages/es.json +0 -184
  1248. package/src/i18n/messages/pt.json +0 -184
@@ -1,873 +0,0 @@
1
- var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
2
- if (value !== null && value !== void 0) {
3
- if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
4
- var dispose, inner;
5
- if (async) {
6
- if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
7
- dispose = value[Symbol.asyncDispose];
8
- }
9
- if (dispose === void 0) {
10
- if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
11
- dispose = value[Symbol.dispose];
12
- if (async) inner = dispose;
13
- }
14
- if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
15
- if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
16
- env.stack.push({ value: value, dispose: dispose, async: async });
17
- }
18
- else if (async) {
19
- env.stack.push({ async: true });
20
- }
21
- return value;
22
- };
23
- var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
24
- return function (env) {
25
- function fail(e) {
26
- env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
27
- env.hasError = true;
28
- }
29
- var r, s = 0;
30
- function next() {
31
- while (r = env.stack.pop()) {
32
- try {
33
- if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
34
- if (r.dispose) {
35
- var result = r.dispose.call(r.value);
36
- if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
37
- }
38
- else s |= 1;
39
- }
40
- catch (e) {
41
- fail(e);
42
- }
43
- }
44
- if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
45
- if (env.hasError) throw env.error;
46
- }
47
- return next();
48
- };
49
- })(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
50
- var e = new Error(message);
51
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
52
- });
53
- /* eslint-disable max-lines -- the offline migration keeps its auditable phases and recovery contract together */
54
- import { createHash, randomUUID } from 'node:crypto';
55
- import { execFile } from 'node:child_process';
56
- import { chmod, copyFile, lstat, mkdir, open, readFile, readdir, rename, rm, writeFile, } from 'node:fs/promises';
57
- import { hostname } from 'node:os';
58
- import { promisify } from 'node:util';
59
- import { basename, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
60
- import { DatabaseSync } from 'node:sqlite';
61
- import { RuntimeDatabase } from '../runtime-db.js';
62
- import { createStorageCatalog } from '../storage-catalog.js';
63
- import { resolveSddCoreV6StorageLayout } from '../storage-layout.js';
64
- import { reportClassifiedDegradation } from '../../errors/classified-degradation.js';
65
- const execFileAsync = promisify(execFile);
66
- const MIGRATION_VERSION = 6;
67
- const RETIRED_REASON = 'retired-by-sdd-core-v6';
68
- const TOMBSTONE = 'PLANU_SDD_CORE_V6\nLegacy runtime database retired. Upgrade Planu before retrying.\n';
69
- const RETIRED_ACTIONS = new Set([
70
- 'cascade',
71
- 'implementing-side-effects',
72
- 'done-side-effects',
73
- 'reconcile',
74
- 'record-done-metrics',
75
- 'autopush',
76
- 'git-autostage',
77
- ]);
78
- const MIGRATION_LOCK_STALE_MS = 5 * 60_000;
79
- export class SddCoreV6MigrationError extends Error {
80
- code;
81
- constructor(code, message, options) {
82
- super(`[Planu] SDD-core v6 migration ${code}: ${message}`, options);
83
- this.code = code;
84
- this.name = 'SddCoreV6MigrationError';
85
- }
86
- }
87
- function sha256(value) {
88
- return createHash('sha256').update(value).digest('hex');
89
- }
90
- async function exists(path) {
91
- try {
92
- await lstat(path);
93
- return true;
94
- }
95
- catch (error) {
96
- if (error.code === 'ENOENT') {
97
- return false;
98
- }
99
- throw error;
100
- }
101
- }
102
- async function writeAtomic(path, bytes, mode = 0o600) {
103
- await mkdir(dirname(path), { recursive: true, mode: 0o700 });
104
- const temporary = `${path}.${process.pid.toString()}.${randomUUID()}.tmp`;
105
- try {
106
- const handle = await open(temporary, 'wx', mode);
107
- try {
108
- await handle.writeFile(bytes);
109
- await handle.sync();
110
- }
111
- finally {
112
- await handle.close();
113
- }
114
- await rename(temporary, path);
115
- const directory = await open(dirname(path), 'r');
116
- try {
117
- await directory.sync();
118
- }
119
- finally {
120
- await directory.close();
121
- }
122
- }
123
- catch (error) {
124
- await rm(temporary, { force: true });
125
- throw error;
126
- }
127
- }
128
- async function readJsonObject(path) {
129
- let raw;
130
- try {
131
- raw = await readFile(path, 'utf8');
132
- }
133
- catch (error) {
134
- throw new SddCoreV6MigrationError('CORRUPT_STATE', `cannot read ${path}`, { cause: error });
135
- }
136
- try {
137
- const parsed = JSON.parse(raw);
138
- if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
139
- throw new Error();
140
- }
141
- return parsed;
142
- }
143
- catch (error) {
144
- throw new SddCoreV6MigrationError('CORRUPT_STATE', `invalid critical JSON at ${path}`, {
145
- cause: error,
146
- });
147
- }
148
- }
149
- async function inventoryPath(path) {
150
- let info;
151
- try {
152
- info = await lstat(path);
153
- }
154
- catch (error) {
155
- if (error.code === 'ENOENT') {
156
- return [];
157
- }
158
- throw error;
159
- }
160
- if (info.isSymbolicLink()) {
161
- throw new SddCoreV6MigrationError('CORRUPT_STATE', `refusing symbolic link ${path}`);
162
- }
163
- if (info.isFile()) {
164
- const bytes = await readFile(path);
165
- return [{ path: resolve(path), bytes: bytes.byteLength, sha256: sha256(bytes) }];
166
- }
167
- if (!info.isDirectory()) {
168
- throw new SddCoreV6MigrationError('CORRUPT_STATE', `refusing non-regular path ${path}`);
169
- }
170
- const output = [];
171
- for (const entry of (await readdir(path)).sort()) {
172
- output.push(...(await inventoryPath(join(path, entry))));
173
- }
174
- return output;
175
- }
176
- function resolvedFamilyPaths(entry, layout, projectPaths) {
177
- if (entry.id === 'runtime-database') {
178
- return [layout.legacyRuntimeDatabase];
179
- }
180
- if (entry.id === 'validation-receipts') {
181
- return [layout.legacyRuntimeDatabase];
182
- }
183
- if (entry.id === 'workspace-state') {
184
- return [join(layout.state, 'workspaces')];
185
- }
186
- if (entry.id.startsWith('portable-')) {
187
- return projectPaths.flatMap((projectPath) => {
188
- const match = createStorageCatalog({ layout, projectPath }).find(({ id }) => id === entry.id);
189
- return match?.resolvedPath ? [match.resolvedPath] : [];
190
- });
191
- }
192
- return entry.resolvedPath ? [entry.resolvedPath] : [];
193
- }
194
- async function inventoryFamilies(layout, projectPaths) {
195
- const catalog = createStorageCatalog({ layout });
196
- if (catalog.length !== 25) {
197
- throw new SddCoreV6MigrationError('CORRUPT_STATE', 'storage matrix is not exactly 25 families');
198
- }
199
- return Promise.all(catalog.map(async (entry) => {
200
- const paths = [...new Set(resolvedFamilyPaths(entry, layout, projectPaths))];
201
- const files = (await Promise.all(paths.map(inventoryPath))).flat();
202
- if (!entry.sddCoreV6Disposition) {
203
- throw new SddCoreV6MigrationError('CORRUPT_STATE', `family ${entry.id} lacks disposition`);
204
- }
205
- return { id: entry.id, disposition: entry.sddCoreV6Disposition, files };
206
- }));
207
- }
208
- async function projectPathsFromCriticalRegistry(layout) {
209
- const path = join(layout.data, 'global', 'registered-projects.json');
210
- if (!(await exists(path))) {
211
- return [];
212
- }
213
- const registry = await readJsonObject(path);
214
- if (!Array.isArray(registry.projects)) {
215
- throw new SddCoreV6MigrationError('CORRUPT_STATE', `invalid project registry ${path}`);
216
- }
217
- const paths = registry.projects.map((entry) => {
218
- if (!isObject(entry) || typeof entry.path !== 'string' || !isAbsolute(entry.path)) {
219
- throw new SddCoreV6MigrationError('CORRUPT_STATE', `invalid project registry ${path}`);
220
- }
221
- return entry.path;
222
- });
223
- return [...new Set(paths)].sort();
224
- }
225
- async function listSpecFiles(layout) {
226
- if (!(await exists(layout.projects))) {
227
- return [];
228
- }
229
- const paths = [];
230
- for (const entry of await readdir(layout.projects, { withFileTypes: true })) {
231
- if (!entry.isDirectory()) {
232
- continue;
233
- }
234
- const path = join(layout.projects, entry.name, 'specs.json');
235
- if (await exists(path)) {
236
- await readJsonObject(path);
237
- paths.push(path);
238
- }
239
- }
240
- return paths.sort();
241
- }
242
- async function defaultOpenHandleInspector(paths) {
243
- if (process.platform === 'win32') {
244
- throw new SddCoreV6MigrationError('INSPECTOR_UNAVAILABLE', 'Windows requires an installed open-handle provider');
245
- }
246
- try {
247
- const result = await execFileAsync('lsof', ['-F', 'p', '--', ...paths], {
248
- encoding: 'utf8',
249
- maxBuffer: 1024 * 1024,
250
- });
251
- return result.stdout
252
- .split('\n')
253
- .filter((line) => /^p\d+$/u.test(line))
254
- .map((line) => Number(line.slice(1)));
255
- }
256
- catch (error) {
257
- const code = error.code;
258
- if (code === 1 || code === '1') {
259
- return [];
260
- }
261
- throw new SddCoreV6MigrationError('INSPECTOR_UNAVAILABLE', 'open-handle inspection failed', {
262
- cause: error,
263
- });
264
- }
265
- }
266
- async function assertNoOpenHandles(paths, inspector) {
267
- const present = [];
268
- for (const path of paths) {
269
- if (await exists(path)) {
270
- present.push(path);
271
- }
272
- }
273
- if (present.length === 0) {
274
- return;
275
- }
276
- const pids = await inspector(present);
277
- if (!Array.isArray(pids) || pids.some((pid) => !Number.isSafeInteger(pid) || pid < 1)) {
278
- throw new SddCoreV6MigrationError('INSPECTOR_UNAVAILABLE', 'inspector result was inconclusive');
279
- }
280
- if (pids.length > 0) {
281
- throw new SddCoreV6MigrationError('OPEN_HANDLES', `legacy database is open by pid ${pids.join(',')}`);
282
- }
283
- }
284
- function legacyBundle(layout) {
285
- return [
286
- layout.legacyRuntimeDatabase,
287
- `${layout.legacyRuntimeDatabase}-wal`,
288
- `${layout.legacyRuntimeDatabase}-shm`,
289
- ];
290
- }
291
- async function writeJournal(layout, journal) {
292
- // eslint-disable-next-line no-param-reassign -- the durable journal is the migration state machine
293
- journal.updatedAt = new Date().toISOString();
294
- await writeAtomic(layout.sddCoreV6Journal, `${JSON.stringify(journal, null, 2)}\n`);
295
- }
296
- async function readInterruptedJournal(layout) {
297
- if (!(await exists(layout.sddCoreV6Journal))) {
298
- return undefined;
299
- }
300
- const value = await readJsonObject(layout.sddCoreV6Journal);
301
- if (value.schemaVersion !== 1 ||
302
- value.migrationVersion !== MIGRATION_VERSION ||
303
- typeof value.migrationId !== 'string' ||
304
- typeof value.phase !== 'string' ||
305
- !Array.isArray(value.families) ||
306
- !Array.isArray(value.specFiles) ||
307
- !Array.isArray(value.createdSnapshots)) {
308
- throw new SddCoreV6MigrationError('MIGRATION_INCOMPLETE', 'interrupted journal is invalid');
309
- }
310
- return value;
311
- }
312
- function maybeFault(options, phase) {
313
- if (options.faultAfterPhase === phase) {
314
- throw new Error(`fault-after-${phase}`);
315
- }
316
- }
317
- function backupPath(layout, path) {
318
- const root = dirname(layout.data);
319
- const rel = relative(root, path).split(sep).join('/');
320
- if (rel.startsWith('../') || rel === '..') {
321
- return join(layout.trash, 'sdd-core-v6', 'backup', sha256(path));
322
- }
323
- return join(layout.trash, 'sdd-core-v6', 'backup', rel);
324
- }
325
- async function backupInputs(layout, journal) {
326
- const paths = new Set(journal.specFiles);
327
- for (const path of legacyBundle(layout)) {
328
- if (await exists(path)) {
329
- paths.add(path);
330
- }
331
- }
332
- for (const family of journal.families) {
333
- if (family.disposition === 'remove-rebuildable') {
334
- for (const file of family.files) {
335
- paths.add(file.path);
336
- }
337
- }
338
- }
339
- for (const path of paths) {
340
- const destination = backupPath(layout, path);
341
- await mkdir(dirname(destination), { recursive: true, mode: 0o700 });
342
- if (!(await exists(destination))) {
343
- await copyFile(path, destination);
344
- }
345
- }
346
- }
347
- async function restoreInputs(layout, journal) {
348
- await rm(layout.runtimeDatabaseTombstone, { force: true });
349
- await rm(layout.runtimeDatabase, { force: true });
350
- await rm(layout.sddCoreV6Marker, { force: true });
351
- await rm(layout.sddCoreV6Quarantine, { recursive: true, force: true });
352
- for (const family of journal.families) {
353
- if (family.disposition !== 'remove-rebuildable') {
354
- continue;
355
- }
356
- for (const file of family.files) {
357
- const source = backupPath(layout, file.path);
358
- if (await exists(source)) {
359
- await mkdir(dirname(file.path), { recursive: true, mode: 0o700 });
360
- await copyFile(source, file.path);
361
- }
362
- }
363
- }
364
- for (const path of [...journal.specFiles, ...legacyBundle(layout)]) {
365
- const source = backupPath(layout, path);
366
- if (await exists(source)) {
367
- await mkdir(dirname(path), { recursive: true, mode: 0o700 });
368
- await copyFile(source, path);
369
- }
370
- }
371
- for (const path of journal.createdSnapshots) {
372
- await rm(path, { force: true });
373
- }
374
- }
375
- function inspectSqlite(path) {
376
- const database = new DatabaseSync(path, { readOnly: true, allowExtension: false });
377
- try {
378
- const check = database.prepare('PRAGMA quick_check').all();
379
- if (check.some(({ quick_check: value }) => value !== 'ok')) {
380
- throw new Error(check.map(({ quick_check: value }) => value).join(';'));
381
- }
382
- return database.prepare('PRAGMA user_version').get().user_version;
383
- }
384
- finally {
385
- database.close();
386
- }
387
- }
388
- async function publishDatabase(layout) {
389
- const env_1 = { stack: [], error: void 0, hasError: false };
390
- try {
391
- await mkdir(dirname(layout.runtimeDatabase), { recursive: true, mode: 0o700 });
392
- if (!(await exists(layout.legacyRuntimeDatabase))) {
393
- const env_2 = { stack: [], error: void 0, hasError: false };
394
- try {
395
- const database = __addDisposableResource(env_2, new RuntimeDatabase({ path: layout.runtimeDatabase }), false);
396
- database.applySddCoreV6Disposition();
397
- return 'created';
398
- }
399
- catch (e_1) {
400
- env_2.error = e_1;
401
- env_2.hasError = true;
402
- }
403
- finally {
404
- __disposeResources(env_2);
405
- }
406
- }
407
- if ((await readTextIfPresent(layout.legacyRuntimeDatabase))?.startsWith(TOMBSTONE) === true) {
408
- if (!(await exists(layout.runtimeDatabase))) {
409
- throw new SddCoreV6MigrationError('MIGRATION_INCOMPLETE', 'tombstone exists without v6 database');
410
- }
411
- return 'migrated';
412
- }
413
- const version = inspectSqlite(layout.legacyRuntimeDatabase);
414
- if (version !== 4 && version !== 5) {
415
- throw new SddCoreV6MigrationError('CORRUPT_STATE', `unsupported runtime schema ${String(version)}`);
416
- }
417
- const checkpoint = new DatabaseSync(layout.legacyRuntimeDatabase, { allowExtension: false });
418
- try {
419
- checkpoint.exec('PRAGMA busy_timeout = 5000; PRAGMA locking_mode = EXCLUSIVE; BEGIN EXCLUSIVE; COMMIT; PRAGMA wal_checkpoint(TRUNCATE);');
420
- }
421
- finally {
422
- checkpoint.close();
423
- }
424
- const temporary = `${layout.runtimeDatabase}.migrating`;
425
- await rm(temporary, { force: true });
426
- await copyFile(layout.legacyRuntimeDatabase, temporary);
427
- const database = __addDisposableResource(env_1, new RuntimeDatabase({ path: temporary }), false);
428
- database.applySddCoreV6Disposition();
429
- database.assertIntegrity();
430
- database.close();
431
- await rename(temporary, layout.runtimeDatabase);
432
- return 'migrated';
433
- }
434
- catch (e_2) {
435
- env_1.error = e_2;
436
- env_1.hasError = true;
437
- }
438
- finally {
439
- __disposeResources(env_1);
440
- }
441
- }
442
- function bindDatabaseMigration(path, migrationId) {
443
- const database = new DatabaseSync(path, { allowExtension: false });
444
- try {
445
- const now = new Date().toISOString();
446
- database
447
- .prepare(`INSERT INTO runtime_records
448
- (project_id, workspace_id, kind, record_key, value_json, updated_at)
449
- VALUES ('__planu__', 'global', 'audit-state', 'sdd-core-v6-binding', ?, ?)
450
- ON CONFLICT(project_id, workspace_id, kind, record_key)
451
- DO UPDATE SET value_json = excluded.value_json, updated_at = excluded.updated_at`)
452
- .run(JSON.stringify({ schemaVersion: 1, migrationId }), now);
453
- }
454
- finally {
455
- database.close();
456
- }
457
- }
458
- function readDatabaseBinding(path) {
459
- const database = new DatabaseSync(path, { readOnly: true, allowExtension: false });
460
- try {
461
- const row = database
462
- .prepare(`SELECT value_json FROM runtime_records
463
- WHERE project_id = '__planu__' AND workspace_id = 'global'
464
- AND kind = 'audit-state' AND record_key = 'sdd-core-v6-binding'`)
465
- .get();
466
- const value = row ? JSON.parse(row.value_json) : undefined;
467
- if (!isObject(value) || typeof value.migrationId !== 'string') {
468
- throw new Error('missing binding');
469
- }
470
- return value.migrationId;
471
- }
472
- finally {
473
- database.close();
474
- }
475
- }
476
- async function quarantineLegacyBundle(layout) {
477
- await mkdir(layout.sddCoreV6Quarantine, { recursive: true, mode: 0o700 });
478
- for (const path of legacyBundle(layout)) {
479
- if (!(await exists(path))) {
480
- continue;
481
- }
482
- if (path === layout.runtimeDatabaseTombstone &&
483
- (await readTextIfPresent(path))?.startsWith(TOMBSTONE) === true) {
484
- continue;
485
- }
486
- const target = join(layout.sddCoreV6Quarantine, basename(path));
487
- if (await exists(target)) {
488
- await rm(path, { force: true });
489
- }
490
- else {
491
- await rename(path, target);
492
- }
493
- }
494
- }
495
- async function quarantineIncidentalSidecars(layout, inspector) {
496
- const sidecars = [`${layout.legacyRuntimeDatabase}-wal`, `${layout.legacyRuntimeDatabase}-shm`];
497
- const present = [];
498
- for (const path of sidecars) {
499
- if (await exists(path)) {
500
- present.push(path);
501
- }
502
- }
503
- if (present.length === 0) {
504
- return;
505
- }
506
- await assertNoOpenHandles(present, inspector);
507
- await mkdir(layout.sddCoreV6Quarantine, { recursive: true, mode: 0o700 });
508
- for (const path of present) {
509
- const bytes = await readFile(path);
510
- await rename(path, join(layout.sddCoreV6Quarantine, `incidental-${sha256(bytes).slice(0, 16)}-${basename(path)}`));
511
- }
512
- }
513
- function isObject(value) {
514
- return value !== null && typeof value === 'object' && !Array.isArray(value);
515
- }
516
- // eslint-disable-next-line max-lines-per-function, complexity -- receipt conversion is one audited phase
517
- async function retireSpecTasks(layout, journal, now) {
518
- for (const path of journal.specFiles) {
519
- const document = await readJsonObject(path);
520
- const rows = Array.isArray(document.data)
521
- ? document.data
522
- : Array.isArray(document.specs)
523
- ? document.specs
524
- : null;
525
- if (!rows) {
526
- throw new SddCoreV6MigrationError('CORRUPT_STATE', `invalid spec store ${path}`);
527
- }
528
- const projectId = basename(dirname(path));
529
- for (const row of rows) {
530
- if (!isObject(row) || !Array.isArray(row.statusHistory)) {
531
- continue;
532
- }
533
- const histories = row.statusHistory;
534
- const migratedHistories = histories.map((rawHistory) => {
535
- if (!isObject(rawHistory)) {
536
- return rawHistory;
537
- }
538
- const pending = Array.isArray(rawHistory.pendingBackgroundActions)
539
- ? rawHistory.pendingBackgroundActions.filter((name) => typeof name === 'string')
540
- : [];
541
- const materialized = Array.isArray(rawHistory.postCommitTasks)
542
- ? rawHistory.postCommitTasks.filter(isObject)
543
- : pending.map((name) => ({
544
- name,
545
- status: 'pending',
546
- attempts: 0,
547
- updatedAt: rawHistory.changedAt,
548
- }));
549
- const retirements = Array.isArray(rawHistory.sddCoreV6Retirements)
550
- ? rawHistory.sddCoreV6Retirements.filter(isObject)
551
- : [];
552
- const tasks = materialized.map((task) => {
553
- const name = typeof task.name === 'string' ? task.name : '';
554
- if (name === 'version-snapshot' && task.status !== 'done') {
555
- const transitionId = typeof rawHistory.transitionId === 'string' ? rawHistory.transitionId : '';
556
- if (!transitionId) {
557
- throw new SddCoreV6MigrationError('CORRUPT_STATE', 'version-snapshot lacks transition identity');
558
- }
559
- const snapshotPath = join(layout.projects, projectId, 'version-snapshots', `${transitionId}.json`);
560
- journal.createdSnapshots.push(snapshotPath);
561
- return { ...task, status: 'done', updatedAt: now, snapshotPath };
562
- }
563
- if (!RETIRED_ACTIONS.has(name)) {
564
- return task;
565
- }
566
- if (!retirements.some((entry) => entry.name === name)) {
567
- retirements.push({ name, reason: RETIRED_REASON, retiredAt: now, previous: task });
568
- }
569
- return { ...task, status: 'dead-letter', updatedAt: now, lastError: RETIRED_REASON };
570
- });
571
- const nextPending = tasks
572
- .filter((task) => task.status !== 'done' && task.status !== 'dead-letter')
573
- .map((task) => task.name);
574
- return {
575
- ...rawHistory,
576
- pendingBackgroundActions: nextPending,
577
- postCommitTasks: tasks,
578
- ...(retirements.length > 0 ? { sddCoreV6Retirements: retirements } : {}),
579
- };
580
- });
581
- row.statusHistory = migratedHistories;
582
- for (const history of migratedHistories) {
583
- if (!isObject(history) || !Array.isArray(history.postCommitTasks)) {
584
- continue;
585
- }
586
- for (const task of history.postCommitTasks) {
587
- if (!isObject(task) || task.status !== 'done' || typeof task.snapshotPath !== 'string') {
588
- continue;
589
- }
590
- if (!(await exists(task.snapshotPath))) {
591
- await writeAtomic(task.snapshotPath, `${JSON.stringify(row, null, 2)}\n`);
592
- }
593
- }
594
- }
595
- }
596
- await writeAtomic(path, `${JSON.stringify(document, null, 2)}\n`);
597
- }
598
- }
599
- async function quarantineRebuildableCaches(layout, families) {
600
- for (const family of families) {
601
- if (family.disposition !== 'remove-rebuildable') {
602
- continue;
603
- }
604
- for (const file of family.files) {
605
- if (!(await exists(file.path))) {
606
- continue;
607
- }
608
- const target = join(layout.trash, 'sdd-core-v6', 'rebuildable', family.id, sha256(file.path));
609
- await mkdir(dirname(target), { recursive: true, mode: 0o700 });
610
- await rename(file.path, target);
611
- }
612
- }
613
- }
614
- async function installTombstone(layout) {
615
- await writeAtomic(layout.runtimeDatabaseTombstone, TOMBSTONE, 0o444);
616
- await chmod(layout.runtimeDatabaseTombstone, 0o444);
617
- }
618
- async function readCompletionMarker(layout) {
619
- if (!(await exists(layout.sddCoreV6Marker))) {
620
- return undefined;
621
- }
622
- const marker = await readJsonObject(layout.sddCoreV6Marker);
623
- if (marker.schemaVersion !== 1 ||
624
- marker.migrationVersion !== MIGRATION_VERSION ||
625
- typeof marker.journalSha256 !== 'string' ||
626
- typeof marker.databaseBinding !== 'string' ||
627
- typeof marker.tombstoneSha256 !== 'string' ||
628
- typeof marker.completedAt !== 'string') {
629
- throw new SddCoreV6MigrationError('MIGRATION_INCOMPLETE', 'completion marker is invalid');
630
- }
631
- return marker;
632
- }
633
- async function verifyCompleted(layout, marker) {
634
- const [journal, tombstone] = await Promise.all([
635
- readFile(layout.sddCoreV6Journal),
636
- readFile(layout.runtimeDatabaseTombstone),
637
- ]).catch((error) => {
638
- throw new SddCoreV6MigrationError('MIGRATION_INCOMPLETE', 'completed migration files are missing', {
639
- cause: error,
640
- });
641
- });
642
- if (sha256(journal) !== marker.journalSha256 ||
643
- readDatabaseBinding(layout.runtimeDatabase) !== marker.databaseBinding ||
644
- sha256(tombstone) !== marker.tombstoneSha256 ||
645
- tombstone.toString('utf8') !== TOMBSTONE ||
646
- inspectSqlite(layout.runtimeDatabase) !== MIGRATION_VERSION) {
647
- throw new SddCoreV6MigrationError('MIGRATION_INCOMPLETE', 'completion checksums do not match');
648
- }
649
- if (((await lstat(layout.runtimeDatabaseTombstone)).mode & 0o222) !== 0) {
650
- throw new SddCoreV6MigrationError('MIGRATION_INCOMPLETE', 'legacy tombstone is writable');
651
- }
652
- }
653
- async function readTextIfPresent(path) {
654
- try {
655
- return await readFile(path, 'utf8');
656
- }
657
- catch (error) {
658
- if (error.code === 'ENOENT') {
659
- return null;
660
- }
661
- throw error;
662
- }
663
- }
664
- async function removeStaleMigrationLock(path) {
665
- let parsed;
666
- let original;
667
- try {
668
- original = await readFile(path, 'utf8');
669
- parsed = JSON.parse(original);
670
- }
671
- catch (error) {
672
- reportClassifiedDegradation('MIGRATION_LOCK_PARSE_FAILURE', error);
673
- return false;
674
- }
675
- if (!isObject(parsed) ||
676
- typeof parsed.hostname !== 'string' ||
677
- !Number.isSafeInteger(parsed.pid) ||
678
- typeof parsed.createdAt !== 'string') {
679
- return false;
680
- }
681
- const createdAt = Date.parse(parsed.createdAt);
682
- if (!Number.isFinite(createdAt)) {
683
- return false;
684
- }
685
- if (parsed.hostname === hostname()) {
686
- try {
687
- process.kill(parsed.pid, 0);
688
- return false;
689
- }
690
- catch (error) {
691
- if (error.code !== 'ESRCH') {
692
- return false;
693
- }
694
- }
695
- }
696
- else if (Date.now() - createdAt <= MIGRATION_LOCK_STALE_MS) {
697
- return false;
698
- }
699
- if ((await readTextIfPresent(path)) !== original) {
700
- return false;
701
- }
702
- await rm(path, { force: true });
703
- return true;
704
- }
705
- async function withMigrationLockGuard(path, action) {
706
- const guardPath = `${path}.guard.sqlite`;
707
- let guard;
708
- try {
709
- guard = new DatabaseSync(guardPath);
710
- guard.exec('PRAGMA busy_timeout = 0; PRAGMA journal_mode = DELETE;');
711
- guard.exec('CREATE TABLE IF NOT EXISTS migration_guard (singleton INTEGER PRIMARY KEY CHECK (singleton = 1))');
712
- guard.exec('BEGIN EXCLUSIVE');
713
- }
714
- catch (error) {
715
- guard?.close();
716
- throw new SddCoreV6MigrationError('MIGRATION_BUSY', 'migration lock is being reconciled', {
717
- cause: error,
718
- });
719
- }
720
- try {
721
- return await action();
722
- }
723
- finally {
724
- guard.exec('ROLLBACK');
725
- guard.close();
726
- }
727
- }
728
- async function acquireMigrationLock(layout) {
729
- const path = `${layout.sddCoreV6Journal}.lock`;
730
- await mkdir(dirname(path), { recursive: true, mode: 0o700 });
731
- return withMigrationLockGuard(path, async () => {
732
- const token = JSON.stringify({
733
- token: randomUUID(),
734
- pid: process.pid,
735
- hostname: hostname(),
736
- createdAt: new Date().toISOString(),
737
- });
738
- const writeOwnedLock = async () => {
739
- await writeFile(path, token, {
740
- flag: 'wx',
741
- mode: 0o600,
742
- });
743
- };
744
- try {
745
- await writeOwnedLock();
746
- }
747
- catch (error) {
748
- if (!(await removeStaleMigrationLock(path))) {
749
- throw new SddCoreV6MigrationError('MIGRATION_BUSY', 'another migration owns the lock', {
750
- cause: error,
751
- });
752
- }
753
- await writeOwnedLock();
754
- }
755
- return () => withMigrationLockGuard(path, async () => {
756
- if ((await readTextIfPresent(path)) === token) {
757
- await rm(path, { force: true });
758
- }
759
- });
760
- });
761
- }
762
- /** Offline, fail-closed migration of every catalog family into the SDD-core v6 boundary. */
763
- // eslint-disable-next-line max-lines-per-function, complexity -- top-level saga keeps phase order explicit
764
- export async function ensureSddCoreV6Storage(options = {}) {
765
- const layout = options.layout ?? resolveSddCoreV6StorageLayout();
766
- const completedBeforeLock = await readCompletionMarker(layout);
767
- if (completedBeforeLock) {
768
- await quarantineIncidentalSidecars(layout, options.inspectOpenHandles ?? defaultOpenHandleInspector);
769
- await verifyCompleted(layout, completedBeforeLock);
770
- const journal = (await readJsonObject(layout.sddCoreV6Journal));
771
- return {
772
- status: 'verified',
773
- markerPath: layout.sddCoreV6Marker,
774
- journalPath: layout.sddCoreV6Journal,
775
- families: journal.families,
776
- };
777
- }
778
- const release = await acquireMigrationLock(layout);
779
- try {
780
- const marker = await readCompletionMarker(layout);
781
- if (marker) {
782
- await quarantineIncidentalSidecars(layout, options.inspectOpenHandles ?? defaultOpenHandleInspector);
783
- await verifyCompleted(layout, marker);
784
- const journal = (await readJsonObject(layout.sddCoreV6Journal));
785
- return {
786
- status: 'verified',
787
- markerPath: layout.sddCoreV6Marker,
788
- journalPath: layout.sddCoreV6Journal,
789
- families: journal.families,
790
- };
791
- }
792
- const interrupted = await readInterruptedJournal(layout);
793
- if (interrupted) {
794
- await restoreInputs(layout, interrupted);
795
- interrupted.phase = 'inventoried';
796
- interrupted.createdSnapshots.splice(0);
797
- await writeJournal(layout, interrupted);
798
- }
799
- const projectPaths = await projectPathsFromCriticalRegistry(layout);
800
- const families = interrupted?.families ?? (await inventoryFamilies(layout, projectPaths));
801
- const specFiles = interrupted?.specFiles ?? (await listSpecFiles(layout));
802
- const journal = interrupted ?? {
803
- schemaVersion: 1,
804
- migrationVersion: 6,
805
- migrationId: randomUUID(),
806
- phase: 'inventoried',
807
- createdAt: new Date().toISOString(),
808
- updatedAt: new Date().toISOString(),
809
- families,
810
- specFiles,
811
- createdSnapshots: [],
812
- };
813
- const inspector = options.inspectOpenHandles ?? defaultOpenHandleInspector;
814
- await assertNoOpenHandles(legacyBundle(layout), inspector);
815
- await writeJournal(layout, journal);
816
- maybeFault(options, 'inventoried');
817
- await backupInputs(layout, journal);
818
- journal.phase = 'backed-up';
819
- await writeJournal(layout, journal);
820
- maybeFault(options, 'backed-up');
821
- let status;
822
- try {
823
- status = await publishDatabase(layout);
824
- bindDatabaseMigration(layout.runtimeDatabase, journal.migrationId);
825
- await assertNoOpenHandles(legacyBundle(layout), inspector);
826
- await quarantineLegacyBundle(layout);
827
- journal.phase = 'database-published';
828
- await writeJournal(layout, journal);
829
- maybeFault(options, 'database-published');
830
- await retireSpecTasks(layout, journal, new Date().toISOString());
831
- journal.phase = 'specs-retired';
832
- await writeJournal(layout, journal);
833
- maybeFault(options, 'specs-retired');
834
- await quarantineRebuildableCaches(layout, families);
835
- journal.phase = 'caches-quarantined';
836
- await writeJournal(layout, journal);
837
- maybeFault(options, 'caches-quarantined');
838
- await installTombstone(layout);
839
- journal.phase = 'ready';
840
- await writeJournal(layout, journal);
841
- maybeFault(options, 'ready');
842
- const [journalBytes, tombstoneBytes] = await Promise.all([
843
- readFile(layout.sddCoreV6Journal),
844
- readFile(layout.runtimeDatabaseTombstone),
845
- ]);
846
- const complete = {
847
- schemaVersion: 1,
848
- migrationVersion: 6,
849
- journalSha256: sha256(journalBytes),
850
- databaseBinding: journal.migrationId,
851
- tombstoneSha256: sha256(tombstoneBytes),
852
- completedAt: new Date().toISOString(),
853
- };
854
- await writeAtomic(layout.sddCoreV6Marker, `${JSON.stringify(complete, null, 2)}\n`, 0o444);
855
- return {
856
- status,
857
- markerPath: layout.sddCoreV6Marker,
858
- journalPath: layout.sddCoreV6Journal,
859
- families,
860
- };
861
- }
862
- catch (error) {
863
- if (!String(error).includes('fault-after-')) {
864
- await restoreInputs(layout, journal);
865
- }
866
- throw error;
867
- }
868
- }
869
- finally {
870
- await release();
871
- }
872
- }
873
- //# sourceMappingURL=sdd-core-v6.js.map