@planu/cli 5.3.67 → 5.3.69

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 (389) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/dist/.planu-build.json +1 -1
  3. package/dist/cli/commands/install.d.ts +2 -15
  4. package/dist/config/release-policy.json +2 -2
  5. package/dist/core/shared/fs.d.ts +11 -0
  6. package/dist/core/shared/fs.js +90 -0
  7. package/dist/core/shared/strings.d.ts +3 -0
  8. package/dist/core/shared/strings.js +13 -0
  9. package/dist/engine/actuals/git-analyzer.js +1 -1
  10. package/dist/engine/actuals/progress-parser.js +1 -3
  11. package/dist/engine/agent-handoff-store.js +1 -0
  12. package/dist/engine/agent-squad/dispatcher.js +1 -0
  13. package/dist/engine/agent-telemetry.js +1 -0
  14. package/dist/engine/auth/config.js +1 -0
  15. package/dist/engine/auto-updater/atomic-upgrade.js +1 -0
  16. package/dist/engine/auto-updater/index.js +1 -0
  17. package/dist/engine/autopilot/action-registry.js +20 -0
  18. package/dist/engine/autopilot/audit-logger.js +1 -0
  19. package/dist/engine/autopilot/bootstrap.js +9 -2
  20. package/dist/engine/autopilot/complete-loop.js +4 -0
  21. package/dist/engine/autopilot/crash-shield-rate-limiter.js +1 -0
  22. package/dist/engine/autopilot/event-bus.js +1 -0
  23. package/dist/engine/autopilot/state-updater.js +6 -0
  24. package/dist/engine/browser-validator.js +1 -3
  25. package/dist/engine/build-tool-detector.js +1 -8
  26. package/dist/engine/bundle-installer.js +2 -10
  27. package/dist/engine/cascade-hooks/core/append-releases.js +1 -0
  28. package/dist/engine/cascade-hooks/core/write-session-json.js +2 -2
  29. package/dist/engine/cascade-hooks/hooks/dispatch-hook-event.hook.d.ts +3 -1
  30. package/dist/engine/cascade-hooks/hooks/dispatch-hook-event.hook.js +12 -3
  31. package/dist/engine/cascade-hooks/hooks/estimate-calibration.hook.js +1 -0
  32. package/dist/engine/cascade-hooks/hooks/housekeeping-on-done.hook.js +2 -0
  33. package/dist/engine/cascade-hooks/hooks/implementing-kickoff.hook.js +5 -1
  34. package/dist/engine/cascade-hooks/hooks/lesson-drift.hook.js +1 -0
  35. package/dist/engine/cascade-hooks/hooks/orchestration-plan.hook.js +1 -0
  36. package/dist/engine/cascade-hooks/hooks/session-context.hook.js +4 -2
  37. package/dist/engine/cascade-hooks/hooks/slack-notify.hook.js +1 -0
  38. package/dist/engine/cascade-hooks/hooks/status-json.hook.js +2 -0
  39. package/dist/engine/cascade-hooks/hooks/velocity-profile.hook.js +2 -0
  40. package/dist/engine/cascade-hooks/runner.js +2 -0
  41. package/dist/engine/cascade-hooks/state-drift-detector.js +2 -0
  42. package/dist/engine/checkpoint/checkpoint-manager.js +2 -0
  43. package/dist/engine/checkpoint/policy-engine.js +1 -0
  44. package/dist/engine/ci-generator/stack-detector.js +2 -10
  45. package/dist/engine/clarification-gate/token-store.js +1 -0
  46. package/dist/engine/claude-config-auditor/claudemd-auditor.js +2 -10
  47. package/dist/engine/claude-config-auditor/settings-auditor.js +2 -10
  48. package/dist/engine/client-detection.js +2 -10
  49. package/dist/engine/compliance/auto-remediator.js +1 -0
  50. package/dist/engine/compliance/evidence-builder.d.ts +2 -2
  51. package/dist/engine/compliance/framework-catalog.d.ts +6 -6
  52. package/dist/engine/compliance/gap-analyzer.d.ts +2 -2
  53. package/dist/engine/config-health/build-tool-checker.js +1 -9
  54. package/dist/engine/config-health/ci-commands-collector.d.ts +2 -1
  55. package/dist/engine/config-health/ci-commands-collector.js +2 -9
  56. package/dist/engine/config-health/go-checker.js +1 -9
  57. package/dist/engine/config-health/mcp-config-checker.js +2 -10
  58. package/dist/engine/config-health/python-checker.js +1 -9
  59. package/dist/engine/config-health/rust-checker.js +1 -9
  60. package/dist/engine/config-health/ts-checker-scripts.js +1 -9
  61. package/dist/engine/config-health/ts-checker.js +1 -9
  62. package/dist/engine/context-artifacts/store.js +1 -0
  63. package/dist/engine/context-md-generator.js +1 -0
  64. package/dist/engine/context-orchestrator/index.js +2 -0
  65. package/dist/engine/convention-scanner/convention-parser.js +2 -9
  66. package/dist/engine/cost-guardrails.js +1 -0
  67. package/dist/engine/cost-tracking/ledger.js +1 -0
  68. package/dist/engine/criterion-identity.js +1 -1
  69. package/dist/engine/dashboard/data-loader.js +1 -0
  70. package/dist/engine/dashboard/drift-score.js +2 -0
  71. package/dist/engine/dashboard/spec-updater.d.ts +3 -1
  72. package/dist/engine/dashboard/spec-updater.js +9 -2
  73. package/dist/engine/dashboard/templates-layout.d.ts +2 -2
  74. package/dist/engine/dashboard/templates-layout.js +2 -9
  75. package/dist/engine/data-projects-gc/gc-runner.js +2 -4
  76. package/dist/engine/deleter/audit-logger.js +1 -0
  77. package/dist/engine/deleter/core.js +6 -0
  78. package/dist/engine/deleter/trash-manager.js +1 -0
  79. package/dist/engine/desktop-detector.js +1 -9
  80. package/dist/engine/detection-utils.d.ts +2 -1
  81. package/dist/engine/detection-utils.js +3 -10
  82. package/dist/engine/detectors/advanced-framework-detector/helpers.d.ts +3 -2
  83. package/dist/engine/detectors/advanced-framework-detector/helpers.js +3 -17
  84. package/dist/engine/detectors/cicd-detector.js +2 -10
  85. package/dist/engine/detectors/css-framework-detector.js +2 -10
  86. package/dist/engine/detectors/deployment-detector.js +3 -12
  87. package/dist/engine/detectors/frontend-perf-detector.js +2 -10
  88. package/dist/engine/detectors/gitops-detector.js +3 -11
  89. package/dist/engine/detectors/idp-detector.js +1 -3
  90. package/dist/engine/detectors/k3s-detector.js +3 -11
  91. package/dist/engine/detectors/llm-detector/file-readers.d.ts +2 -1
  92. package/dist/engine/detectors/llm-detector/file-readers.js +2 -9
  93. package/dist/engine/detectors/mfe-detector.js +5 -13
  94. package/dist/engine/detectors/monitoring-detector.js +2 -11
  95. package/dist/engine/detectors/monorepo-detector.d.ts +1 -0
  96. package/dist/engine/detectors/monorepo-detector.js +1 -10
  97. package/dist/engine/detectors/nomad-detector.js +3 -11
  98. package/dist/engine/detectors/otel-ecosystem-detectors.d.ts +2 -1
  99. package/dist/engine/detectors/otel-ecosystem-detectors.js +2 -10
  100. package/dist/engine/doc-generator/executive-summary/html-template.js +1 -7
  101. package/dist/engine/doc-generator/executive-summary/section-builders.js +1 -7
  102. package/dist/engine/doc-generator/per-spec-report/mermaid-renderer.js +1 -7
  103. package/dist/engine/doc-generator/per-spec-report/spec-section-builders.js +1 -7
  104. package/dist/engine/doc-generator/per-spec-report/technical-report.js +1 -7
  105. package/dist/engine/doc-generator/portal/analytics-page.js +1 -7
  106. package/dist/engine/doc-generator/portal/architecture-page.js +1 -7
  107. package/dist/engine/doc-generator/portal/changelog-page.js +1 -7
  108. package/dist/engine/doc-generator/portal/decision-page.js +1 -7
  109. package/dist/engine/doc-generator/portal/decision-timeline-builder.js +1 -7
  110. package/dist/engine/doc-generator/portal/kanban-view-builder.js +1 -7
  111. package/dist/engine/doc-generator/portal/portal-breadcrumbs.js +1 -7
  112. package/dist/engine/doc-generator/portal/portal-landing-cards.js +1 -7
  113. package/dist/engine/doc-generator/portal/portal-navbar.js +1 -7
  114. package/dist/engine/doc-generator/portal/portal-page-detector.d.ts +3 -0
  115. package/dist/engine/doc-generator/portal/portal-page-detector.js +1 -10
  116. package/dist/engine/doc-generator/portal/portal-regenerator.js +2 -0
  117. package/dist/engine/doc-generator/portal/risk-matrix-svg.js +1 -7
  118. package/dist/engine/doc-generator/portal/risk-page.js +1 -7
  119. package/dist/engine/doc-generator/portal/roadmap-page.js +1 -7
  120. package/dist/engine/doc-generator/proposal/proposal-gantt-builder.js +1 -7
  121. package/dist/engine/doc-generator/proposal/proposal-kpi-builder.js +1 -7
  122. package/dist/engine/doc-generator/proposal/proposal-section-builders-advanced.js +2 -8
  123. package/dist/engine/doc-generator/proposal/proposal-section-builders.js +1 -7
  124. package/dist/engine/docs-site-generator/html-templates.js +1 -7
  125. package/dist/engine/docs-site-generator/markdown-renderer.js +1 -7
  126. package/dist/engine/drift/violation-resolver.js +2 -0
  127. package/dist/engine/dynamic-knowledge/knowledge-cache.js +1 -0
  128. package/dist/engine/ecosystem-absorber/knowledge-cache.js +1 -0
  129. package/dist/engine/edge-db-detector.js +1 -10
  130. package/dist/engine/escalator/retry-counter.js +1 -0
  131. package/dist/engine/evidence-gates/artifact-reader.js +1 -0
  132. package/dist/engine/evidence-gates/evidence-autofill.js +1 -0
  133. package/dist/engine/evidence-gates/evidence-skeletons.js +1 -0
  134. package/dist/engine/evidence-gates/reconciliation-freshness.js +1 -0
  135. package/dist/engine/execution/durable-job-heartbeat-runtime.js +1 -0
  136. package/dist/engine/execution/job-runtime.js +2 -0
  137. package/dist/engine/execution/validate-job-executor.d.ts +1 -1
  138. package/dist/engine/execution/validate-job-executor.js +3 -0
  139. package/dist/engine/execution/validate-job-payload.js +1 -0
  140. package/dist/engine/execution/validate-worker-thread.js +1 -0
  141. package/dist/engine/facilitate/context-loader.js +1 -0
  142. package/dist/engine/figma/change-detector.d.ts +1 -8
  143. package/dist/engine/figma/code-connect-fetcher.d.ts +1 -7
  144. package/dist/engine/figma/design-enricher.d.ts +1 -17
  145. package/dist/engine/figma/design-enricher.js +0 -1
  146. package/dist/engine/figma/e2e-generator.d.ts +1 -23
  147. package/dist/engine/figma/flow-analyzer.d.ts +1 -11
  148. package/dist/engine/figma/frame-extractor.d.ts +1 -11
  149. package/dist/engine/figma/frame-extractor.js +3 -0
  150. package/dist/engine/figma/multi-file-manager.d.ts +1 -6
  151. package/dist/engine/figma/spec-generator.js +2 -0
  152. package/dist/engine/figma/thumbnail-fetcher.d.ts +1 -1
  153. package/dist/engine/figma/token-extractor.d.ts +1 -6
  154. package/dist/engine/figma/token-extractor.js +0 -1
  155. package/dist/engine/figma/version-tracker.d.ts +1 -7
  156. package/dist/engine/figma/version-tracker.js +0 -1
  157. package/dist/engine/figma/visual-qa.d.ts +5 -19
  158. package/dist/engine/figma/visual-qa.js +1 -2
  159. package/dist/engine/figma/webhook-manager.d.ts +1 -7
  160. package/dist/engine/frontmatter-sha/reseal.js +1 -0
  161. package/dist/engine/frontmatter-sha/verify-terminal.js +1 -0
  162. package/dist/engine/git-hook-injector.js +2 -10
  163. package/dist/engine/github/quality-dimensions.js +1 -3
  164. package/dist/engine/global-rules-manager.js +2 -3
  165. package/dist/engine/handoff-artifacts/implementation-review-reader.js +1 -0
  166. package/dist/engine/handoff-artifacts/io.js +2 -0
  167. package/dist/engine/handoff-packager.js +2 -1
  168. package/dist/engine/health/auto-fixer.js +1 -0
  169. package/dist/engine/hooks/context-injector.js +1 -0
  170. package/dist/engine/hooks-reconciler.js +1 -8
  171. package/dist/engine/impact-detector/index.js +2 -9
  172. package/dist/engine/implementation-contract/common.js +1 -3
  173. package/dist/engine/implementation-contract/evaluator.js +1 -3
  174. package/dist/engine/keyword-matcher/boundary.d.ts +2 -7
  175. package/dist/engine/keyword-matcher/boundary.js +2 -14
  176. package/dist/engine/lifecycle-reconciliation-io.js +1 -0
  177. package/dist/engine/lifecycle-reconciliation.js +3 -0
  178. package/dist/engine/local-first/detector.js +1 -9
  179. package/dist/engine/marketplace-fetcher/cache.js +2 -0
  180. package/dist/engine/marketplace-fetcher/index.js +1 -0
  181. package/dist/engine/mcp-config/mcp-config-writer.js +2 -10
  182. package/dist/engine/migrations/remove-commercial-state.js +2 -0
  183. package/dist/engine/mobile-detector-shared.d.ts +1 -1
  184. package/dist/engine/mobile-detector-shared.js +2 -9
  185. package/dist/engine/multi-channel-notifier.js +1 -0
  186. package/dist/engine/multi-teammate-review/disagreement-counter.js +1 -0
  187. package/dist/engine/multi-teammate-review/panel-orchestrator.js +1 -0
  188. package/dist/engine/onboarding-engine.js +1 -9
  189. package/dist/engine/permissions-merger/stack-detectors.js +2 -10
  190. package/dist/engine/pii-detector/core.js +1 -3
  191. package/dist/engine/platform-engineering/dx-analyzer.js +1 -10
  192. package/dist/engine/platform-engineering/idp-detector.js +2 -10
  193. package/dist/engine/project-dna/ai-tool-detector.js +2 -10
  194. package/dist/engine/project-dna/stack-detector.js +2 -10
  195. package/dist/engine/project-graph/builder.js +11 -2
  196. package/dist/engine/project-graph/cache.d.ts +5 -2
  197. package/dist/engine/project-graph/cache.js +174 -34
  198. package/dist/engine/project-graph/extractors/decision-store-extractor.js +1 -0
  199. package/dist/engine/project-graph/freshness-projection.js +3 -0
  200. package/dist/engine/project-graph/query.js +14 -11
  201. package/dist/engine/project-health-checker.js +2 -6
  202. package/dist/engine/provider-adapters/shared/spec-loader.js +1 -0
  203. package/dist/engine/quality-gates/gate-evaluator.js +1 -3
  204. package/dist/engine/react-detector.js +6 -14
  205. package/dist/engine/reconcile/apply-changes.js +1 -3
  206. package/dist/engine/registry/core.js +1 -0
  207. package/dist/engine/registry/loader.js +2 -0
  208. package/dist/engine/release/postmortem-generator.js +1 -0
  209. package/dist/engine/release/rollback-runner.d.ts +2 -2
  210. package/dist/engine/release/stuck-spec-detector.js +7 -0
  211. package/dist/engine/release-pipeline/release-spec-closer.js +3 -0
  212. package/dist/engine/rules-reconciler.d.ts +1 -1
  213. package/dist/engine/rules-reconciler.js +2 -9
  214. package/dist/engine/safety/atomic-writer.js +1 -0
  215. package/dist/engine/safety/cross-process-lock.js +2 -0
  216. package/dist/engine/safety/file-mutex.js +1 -0
  217. package/dist/engine/safety/lock-lease-store.js +1 -0
  218. package/dist/engine/safety/lock-scavenger.js +2 -0
  219. package/dist/engine/saga/transition-cascade.js +3 -0
  220. package/dist/engine/scan-project/index.js +1 -0
  221. package/dist/engine/scan-project/module-discoverer.js +1 -9
  222. package/dist/engine/schema-parity-auditor/handler-checker.js +1 -3
  223. package/dist/engine/schema-parity-auditor/index.js +1 -3
  224. package/dist/engine/schema-parity-auditor/type-checker.js +1 -3
  225. package/dist/engine/self-healing/strategies/coverage-fix.js +2 -10
  226. package/dist/engine/session-context-generator.d.ts +8 -0
  227. package/dist/engine/session-context-generator.js +33 -23
  228. package/dist/engine/session-state/session-artifact-refresher.d.ts +7 -0
  229. package/dist/engine/session-state/session-artifact-refresher.js +140 -0
  230. package/dist/engine/session-state/writer.d.ts +3 -0
  231. package/dist/engine/session-state/writer.js +35 -17
  232. package/dist/engine/shared-agent-memory.js +1 -0
  233. package/dist/engine/skill-adapter/index.js +3 -0
  234. package/dist/engine/skill-bootstrap/registry-fetcher.js +1 -0
  235. package/dist/engine/skill-bootstrap/skill-writer.js +2 -9
  236. package/dist/engine/skill-bootstrap/stack-matcher.js +1 -9
  237. package/dist/engine/skill-discovery/multi-agent-writer.d.ts +1 -0
  238. package/dist/engine/skill-discovery/multi-agent-writer.js +1 -9
  239. package/dist/engine/skill-generator/workflow-skill-generator.js +1 -0
  240. package/dist/engine/skill-registry/ttl-refresh.js +2 -0
  241. package/dist/engine/spec-audit/index.js +2 -0
  242. package/dist/engine/spec-audit/report-writer.js +1 -0
  243. package/dist/engine/spec-coverage/core.js +1 -0
  244. package/dist/engine/spec-decomposer/analyzer.js +1 -11
  245. package/dist/engine/spec-dependency-graph/dot-exporter.d.ts +1 -1
  246. package/dist/engine/spec-dependency-graph/graph-builder.d.ts +1 -20
  247. package/dist/engine/spec-dependency-graph/superseded-set.d.ts +1 -1
  248. package/dist/engine/spec-diff-engine.js +1 -7
  249. package/dist/engine/spec-format/read-technical-section.js +1 -3
  250. package/dist/engine/spec-format/replace-section.js +1 -3
  251. package/dist/engine/spec-format/spec-id.d.ts +9 -1
  252. package/dist/engine/spec-format/spec-id.js +24 -3
  253. package/dist/engine/spec-format/unified-spec-builder.js +1 -3
  254. package/dist/engine/spec-migrator/canonical-deduplicator.js +2 -0
  255. package/dist/engine/spec-observability/tracker.js +1 -0
  256. package/dist/engine/spec-registry/adapter.js +2 -10
  257. package/dist/engine/spec-registry/validator.d.ts +1 -0
  258. package/dist/engine/spec-registry/validator.js +1 -9
  259. package/dist/engine/spec-state-machine/transition-spec.js +1 -0
  260. package/dist/engine/spec-templates/custom-loader.js +1 -0
  261. package/dist/engine/stack-auditor/build-tool-auditor.js +1 -9
  262. package/dist/engine/staleness/stale-implementing.js +5 -14
  263. package/dist/engine/status-reconciler/index.js +4 -1
  264. package/dist/engine/structural-memory/helpers.js +1 -0
  265. package/dist/engine/supply-chain/slsa-checker.js +1 -9
  266. package/dist/engine/tdd-enforcer/stub-artifact-path.js +1 -0
  267. package/dist/engine/telemetry/health-checker.js +1 -0
  268. package/dist/engine/telemetry/telemetry-store.js +1 -0
  269. package/dist/engine/token-optimizer/response-cache.js +1 -3
  270. package/dist/engine/tool-groups/group-manager.js +2 -0
  271. package/dist/engine/update-notifier.js +1 -0
  272. package/dist/engine/validation/approved-spec-portability.js +1 -0
  273. package/dist/engine/validation/durable-validation.js +1 -0
  274. package/dist/engine/validation/validation-freshness.js +2 -0
  275. package/dist/engine/validation/validation-receipt.js +1 -0
  276. package/dist/engine/validation/validation-submission.d.ts +1 -1
  277. package/dist/engine/validation-evidence-ledger.js +1 -0
  278. package/dist/engine/validator/deep-code-checker.js +1 -3
  279. package/dist/engine/validator/executable-evidence.d.ts +1 -14
  280. package/dist/engine/validator/scope-resolver.d.ts +2 -2
  281. package/dist/engine/validator/spec-compliance-runner.d.ts +1 -31
  282. package/dist/engine/validator/validation-report-writer.js +1 -1
  283. package/dist/engine/validator.d.ts +1 -1
  284. package/dist/engine/validator.js +1 -0
  285. package/dist/engine/velocity/measure-velocity.js +2 -0
  286. package/dist/engine/version-resolver.js +1 -0
  287. package/dist/engine/workers/handlers/auto-drift.js +3 -0
  288. package/dist/engine/workspace-manager.js +4 -0
  289. package/dist/hosts/gemini/config-scaffold.js +2 -10
  290. package/dist/storage/approval-operation-lock.js +1 -0
  291. package/dist/storage/auto-promoter-config-store.js +1 -0
  292. package/dist/storage/autopilot-log-store.js +1 -0
  293. package/dist/storage/base-store.js +1 -0
  294. package/dist/storage/checkpoint-store.js +1 -0
  295. package/dist/storage/feedback-remote.js +1 -0
  296. package/dist/storage/gaps-log.js +1 -0
  297. package/dist/storage/global-projects-store.d.ts +17 -0
  298. package/dist/storage/global-projects-store.js +47 -0
  299. package/dist/storage/global-store.js +1 -0
  300. package/dist/storage/knowledge-store/sessions.js +2 -0
  301. package/dist/storage/migrations/canonical-storage.js +42 -18
  302. package/dist/storage/project-drift-store.js +1 -0
  303. package/dist/storage/project-identity.d.ts +27 -0
  304. package/dist/storage/project-identity.js +132 -2
  305. package/dist/storage/project-resolver.js +1 -17
  306. package/dist/storage/runtime-db.d.ts +2 -20
  307. package/dist/storage/runtime-db.js +2 -9
  308. package/dist/storage/semantic-index-store.js +1 -0
  309. package/dist/storage/sentry-store.js +1 -0
  310. package/dist/storage/session-state-store.js +1 -0
  311. package/dist/storage/spec-store.d.ts +31 -3
  312. package/dist/storage/spec-store.js +146 -5
  313. package/dist/storage/status-store/atomic-status-write.js +1 -0
  314. package/dist/storage/status-store/file-lock.js +1 -0
  315. package/dist/storage/status-store/self-healing.js +1 -0
  316. package/dist/storage/storage-bundle.d.ts +12 -2
  317. package/dist/storage/supabase-store.js +1 -0
  318. package/dist/storage/technology-selection-store.js +1 -0
  319. package/dist/storage/trash-store.d.ts +2 -4
  320. package/dist/storage/trash-store.js +2 -15
  321. package/dist/storage/vector-store/json-fallback.js +1 -0
  322. package/dist/storage/vector-store/migrator.js +1 -0
  323. package/dist/storage/vector-store/sqlite-adapter.js +1 -0
  324. package/dist/tools/audit-claude-config.js +1 -10
  325. package/dist/tools/challenge-spec-helpers.d.ts +1 -1
  326. package/dist/tools/challenge-spec-helpers.js +7 -2
  327. package/dist/tools/challenge-spec.js +11 -6
  328. package/dist/tools/check-readiness.js +121 -24
  329. package/dist/tools/clarify-requirements/multiple-choice.d.ts +3 -3
  330. package/dist/tools/configure-oauth-handler.js +1 -0
  331. package/dist/tools/create-spec-helpers.d.ts +1 -3
  332. package/dist/tools/create-spec-helpers.js +1 -8
  333. package/dist/tools/create-spec.js +1 -13
  334. package/dist/tools/dashboard.js +5 -0
  335. package/dist/tools/generate-execution-plan.js +10 -6
  336. package/dist/tools/github-pr-handler.js +1 -0
  337. package/dist/tools/github-release-handler.d.ts +1 -0
  338. package/dist/tools/github-release-handler.js +4 -3
  339. package/dist/tools/graph-specs.d.ts +1 -1
  340. package/dist/tools/heal-spec-docs.js +1 -3
  341. package/dist/tools/init-project/git-setup.d.ts +2 -2
  342. package/dist/tools/init-project/host-assets-writer.js +2 -10
  343. package/dist/tools/init-project/lifecycle-helpers.d.ts +2 -2
  344. package/dist/tools/init-project/lint-scaffolder.js +2 -10
  345. package/dist/tools/init-project/stack-detector.d.ts +2 -2
  346. package/dist/tools/reconcile-interactive-question-hooks.d.ts +2 -2
  347. package/dist/tools/register-sdd-tools.js +1 -0
  348. package/dist/tools/safe-handler.js +1 -0
  349. package/dist/tools/schemas/spec-id.d.ts +1 -6
  350. package/dist/tools/schemas/spec-id.js +1 -16
  351. package/dist/tools/tool-entry.d.ts +2 -2
  352. package/dist/tools/tool-entry.js +1 -1
  353. package/dist/tools/tool-registry/core-tools.d.ts +2 -2
  354. package/dist/tools/tool-registry/deprecated-stubs.d.ts +3 -3
  355. package/dist/tools/tool-registry/deprecated-stubs.js +1 -1
  356. package/dist/tools/triage-request.d.ts +2 -2
  357. package/dist/tools/update-status/approval-gates.d.ts +2 -2
  358. package/dist/tools/update-status/approval-gates.js +1 -0
  359. package/dist/tools/update-status/dod-gates.d.ts +1 -1
  360. package/dist/tools/update-status/done-receipt-verifier.d.ts +1 -1
  361. package/dist/tools/update-status/evidence-gate.js +5 -5
  362. package/dist/tools/update-status/file-sync.js +11 -39
  363. package/dist/tools/update-status/index.js +1 -1
  364. package/dist/tools/update-status/side-effects.js +5 -0
  365. package/dist/tools/update-status/transition-guard.d.ts +1 -1
  366. package/dist/tools/update-status/transition-guard.js +40 -8
  367. package/dist/tools/update-status-actions.js +28 -40
  368. package/dist/tools/validate-graph-coverage.js +14 -2
  369. package/dist/tools/validate.js +2 -0
  370. package/dist/transports/middleware/types.d.ts +3 -3
  371. package/dist/types/atomic-upgrade.d.ts +1 -1
  372. package/dist/types/cascade-hooks.d.ts +3 -0
  373. package/dist/types/cross-repo-search.d.ts +2 -0
  374. package/dist/types/dashboard.d.ts +4 -1
  375. package/dist/types/durable-job.d.ts +20 -0
  376. package/dist/types/durable-job.js +9 -1
  377. package/dist/types/index.d.ts +2 -0
  378. package/dist/types/index.js +2 -0
  379. package/dist/types/installation.d.ts +16 -0
  380. package/dist/types/installation.js +2 -0
  381. package/dist/types/project-knowledge-graph.d.ts +11 -0
  382. package/dist/types/session-checkpoint.d.ts +16 -0
  383. package/dist/types/spec-dependency-graph.d.ts +21 -0
  384. package/dist/types/spec-dependency-graph.js +2 -0
  385. package/dist/types/validation-evidence.d.ts +45 -0
  386. package/package.json +2 -2
  387. package/planu-plugin.json +1 -1
  388. package/dist/types/storage-bundle.d.ts +0 -13
  389. package/dist/types/storage-bundle.js +0 -2
@@ -4,6 +4,7 @@ import { lstatSync, realpathSync } from 'node:fs';
4
4
  import { createHash } from 'node:crypto';
5
5
  import { isAbsolute, join, relative, resolve } from 'node:path';
6
6
  import { z } from 'zod';
7
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
7
8
  import { projectDataDir } from '../../storage/base-store.js';
8
9
  import { computeValidationEvidenceIdentity, computeValidationEvidenceKey, normalizeValidationCommand, readMatchingValidationEvidence, } from '../validation-evidence-ledger.js';
9
10
  import { VALIDATION_COMMANDS } from '../validation-impact-planner.js';
@@ -27,6 +27,7 @@ import { extractCanonicalFileOwnership } from '../handoff-packager.js';
27
27
  import { handoffEvidencePath } from './artifact-reader.js';
28
28
  import { atomicWriteFile } from '../safety/atomic-write-file.js';
29
29
  import { ValidationReportV1Schema } from '../handoff-artifacts/schemas.js';
30
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
30
31
  import { projectDataDir } from '../../storage/base-store.js';
31
32
  import { readFile } from 'node:fs/promises';
32
33
  import { reportClassifiedDegradation } from '../../errors/classified-degradation.js';
@@ -10,6 +10,7 @@
10
10
  import { join } from 'node:path';
11
11
  import { extractListItems, extractSection } from '../spec-format/markdown-sections.js';
12
12
  import { parseCriterionGroundingRecords } from '../spec-grounding/contract.js';
13
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
13
14
  import { projectDataDir } from '../../storage/base-store.js';
14
15
  import { atomicWriteFile } from '../safety/atomic-write-file.js';
15
16
  const FRONTMATTER_RE = /^---\n([\s\S]*?)\n---/;
@@ -1,6 +1,7 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import { lstat, readFile, readdir } from 'node:fs/promises';
3
3
  import { join } from 'node:path';
4
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
4
5
  import { projectDataDir } from '../../storage/base-store.js';
5
6
  import { readCommittedReconciliations } from '../lifecycle-reconciliation.js';
6
7
  const BASE_ARTIFACTS = [
@@ -2,6 +2,7 @@ import { existsSync } from 'node:fs';
2
2
  import { isAbsolute, resolve as resolvePath } from 'node:path';
3
3
  import { pathToFileURL } from 'node:url';
4
4
  import { isMainThread, parentPort, Worker, workerData } from 'node:worker_threads';
5
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
5
6
  import { RuntimeDatabase } from '../../storage/runtime-db.js';
6
7
  import { reportClassifiedDegradation } from '../../errors/classified-degradation.js';
7
8
  function heartbeatWorkerUrl() {
@@ -1,5 +1,7 @@
1
1
  import { createHash, randomUUID } from 'node:crypto';
2
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
2
3
  import { RuntimeDatabase, } from '../../storage/runtime-db.js';
4
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
3
5
  import { resolveStorageLayout } from '../../storage/storage-layout.js';
4
6
  import { getRuntimePolicy } from '../runtime-policy.js';
5
7
  import { getExecutionContext } from './context.js';
@@ -1,5 +1,5 @@
1
1
  import { DurableJobRuntime } from './job-runtime.js';
2
- import { type DurableJobRecord } from '../../storage/runtime-db.js';
2
+ import type { DurableJobRecord } from '../../types/durable-job.js';
3
3
  import { type ValidateJobExecutorOptions, type ValidateJobRecoveryOptions } from '../../types/durable-validation.js';
4
4
  /** Executes accepted validate jobs directly against the validation core, never through MCP. */
5
5
  export declare class ValidateJobExecutor {
@@ -2,11 +2,13 @@
2
2
  import { randomUUID } from 'node:crypto';
3
3
  import { join } from 'node:path';
4
4
  import { DurableJobRuntime } from './job-runtime.js';
5
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
5
6
  import { RuntimeDatabase } from '../../storage/runtime-db.js';
6
7
  import { createExecutionScope } from './context.js';
7
8
  import { runValidateWorker } from './validate-worker-runtime.js';
8
9
  import { redactValidationProgress, computeDurableValidationBindings, toValidationReceiptBindings, writeValidationArtifactProvenance, } from '../validation/durable-validation.js';
9
10
  import { parseValidationReceiptPendingCheckpoint, isValidationReceiptPendingIntent, } from '../../types/durable-validation.js';
11
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
10
12
  import { resolveStorageLayout } from '../../storage/storage-layout.js';
11
13
  import { reportClassifiedDegradation } from '../../errors/classified-degradation.js';
12
14
  import { createValidationReceiptAuthority, ensureValidationIssuerKey, issueValidationReceipt, LOCAL_VALIDATION_RECEIPT_ISSUER, preflightValidationReceiptSigner, } from '../validation/validation-receipt.js';
@@ -16,6 +18,7 @@ import { recoverValidateJobs } from './validate-job-recovery.js';
16
18
  import { getRuntimePolicy } from '../runtime-policy.js';
17
19
  import { isValidateJob, parseValidatePayload, rehydrateValidationPayload, } from './validate-job-payload.js';
18
20
  import { revalidateValidationWorktree } from '../validation/validation-worktree.js';
21
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
19
22
  import { projectDataDir } from '../../storage/base-store.js';
20
23
  import { redactSensitiveValue, redactText } from '../../security/redactor.js';
21
24
  import { MacOSKeychainOperationError } from '../../security/adapters/macos-keychain.js';
@@ -1,5 +1,6 @@
1
1
  import { mkdir } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
3
4
  import { projectDataDir } from '../../storage/base-store.js';
4
5
  import { reportClassifiedDegradation } from '../../errors/classified-degradation.js';
5
6
  import { computeDurableValidationBindings, toValidationReceiptBindings, } from '../validation/durable-validation.js';
@@ -26,6 +26,7 @@ async function execute(value) {
26
26
  Date.now() >= request.deadlineAt) {
27
27
  throw new Error('[Planu] Validate worker rejected malformed or expired work');
28
28
  }
29
+ // eslint-disable-next-line no-restricted-syntax -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
29
30
  const { executeValidate } = await import('../../tools/validate.js');
30
31
  const input = request.input;
31
32
  const scope = createExecutionScope({ requestId, deadlineAt: request.deadlineAt });
@@ -2,6 +2,7 @@
2
2
  // engine/facilitate/context-loader.ts — SPEC-264 Loads project context from disk
3
3
  import { readdir, readFile } from 'node:fs/promises';
4
4
  import { join } from 'node:path';
5
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
5
6
  import { hashProjectPath, projectDataDir } from '../../storage/base-store.js';
6
7
  // ---------------------------------------------------------------------------
7
8
  // Internal helpers
@@ -1,11 +1,4 @@
1
- import type { FigmaFrame } from '../../types/index.js';
2
- export interface FigmaFrameSnapshot {
3
- nodeId: string;
4
- name: string;
5
- pageId: string;
6
- pageName: string;
7
- section: string;
8
- }
1
+ import type { FigmaFrame, FigmaFrameSnapshot } from '../../types/index.js';
9
2
  export interface FigmaRenamedFrame {
10
3
  nodeId: string;
11
4
  oldName: string;
@@ -1,10 +1,4 @@
1
- export interface FigmaCodeConnectEntry {
2
- figmaNodeId: string;
3
- componentName: string;
4
- codeUrl: string;
5
- framework: string;
6
- syncedAt: string;
7
- }
1
+ import type { FigmaCodeConnectEntry } from '../../types/figma.js';
8
2
  export declare function fetchCodeConnectMappings(fileKey: string, accessToken: string): Promise<FigmaCodeConnectEntry[]>;
9
3
  export declare function buildCodeConnectMap(entries: FigmaCodeConnectEntry[]): Map<string, FigmaCodeConnectEntry>;
10
4
  export declare function formatCodeConnectAsMarkdown(entries: FigmaCodeConnectEntry[]): string;
@@ -1,3 +1,4 @@
1
+ import type { DesignContext, EnrichmentResult } from '../../types/figma.js';
1
2
  interface FigmaNode {
2
3
  id: string;
3
4
  name: string;
@@ -24,23 +25,6 @@ interface FigmaFrame {
24
25
  pageName: string;
25
26
  section: string;
26
27
  }
27
- export interface DesignContext {
28
- nodeId: string;
29
- frameName: string;
30
- section: string;
31
- description: string;
32
- componentHints: string[];
33
- layoutNotes: string[];
34
- colorTokens: string[];
35
- generatedAt: string;
36
- }
37
- export interface EnrichmentResult {
38
- specId: string;
39
- enriched: boolean;
40
- nodeIds: string[];
41
- contexts: DesignContext[];
42
- skippedReason?: string;
43
- }
44
28
  export declare function buildDesignContext(nodeId: string, frameName: string, section: string, figmaDocument: FigmaNode): DesignContext;
45
29
  export declare function enrichSpecsWithDesignContext(specs: {
46
30
  specId: string;
@@ -1,4 +1,3 @@
1
- // engine/figma/design-enricher.ts — Design enrichment for specs from Figma context (SPEC-420)
2
1
  // ---------------------------------------------------------------------------
3
2
  // Private helpers
4
3
  // ---------------------------------------------------------------------------
@@ -1,26 +1,4 @@
1
- import type { FigmaFlow } from './flow-analyzer.js';
2
- export interface E2ETestCase {
3
- id: string;
4
- description: string;
5
- fromFrame: string;
6
- toFrame: string;
7
- trigger: string;
8
- section: string;
9
- playwrightCode: string;
10
- }
11
- export interface E2ETestFile {
12
- filename: string;
13
- section: string;
14
- testCases: E2ETestCase[];
15
- fullContent: string;
16
- }
17
- export interface E2EGenerationResult {
18
- totalFlows: number;
19
- totalTestCases: number;
20
- files: E2ETestFile[];
21
- skippedFlows: number;
22
- outputDir: string;
23
- }
1
+ import type { FigmaFlow, E2ETestCase, E2EGenerationResult } from '../../types/figma.js';
24
2
  export declare function flowToTestCase(flow: FigmaFlow, index: number): E2ETestCase | null;
25
3
  export declare function groupFlowsBySection(flows: FigmaFlow[]): Map<string, FigmaFlow[]>;
26
4
  export declare function generateTestFileContent(section: string, testCases: E2ETestCase[]): string;
@@ -1,15 +1,5 @@
1
1
  import type { FigmaFileResponse } from './api-client.js';
2
- export interface FigmaFlow {
3
- fromNodeId: string;
4
- fromFrameName: string;
5
- toNodeId: string;
6
- toFrameName: string;
7
- trigger: string;
8
- transitionType: string;
9
- pageId: string;
10
- pageName: string;
11
- section: string;
12
- }
2
+ import type { FigmaFlow } from '../../types/figma.js';
13
3
  export declare function extractFlows(file: FigmaFileResponse): FigmaFlow[];
14
4
  export declare function groupFlowsBySection(flows: FigmaFlow[]): Map<string, FigmaFlow[]>;
15
5
  export declare function formatFlowsAsMarkdown(sections: Map<string, FigmaFlow[]>): string;
@@ -1,16 +1,6 @@
1
- import type { FigmaFrame } from '../../types/index.js';
1
+ import type { FigmaFrame, BreakpointGroup } from '../../types/index.js';
2
2
  import type { FigmaFileResponse } from './api-client.js';
3
3
  export declare function extractFrames(file: FigmaFileResponse): FigmaFrame[];
4
4
  export declare function groupFramesBySection(frames: FigmaFrame[], groupBy: 'prefix' | 'page'): Map<string, FigmaFrame[]>;
5
- export interface BreakpointGroup {
6
- section: string;
7
- frames: {
8
- mobile: FigmaFrame[];
9
- tablet: FigmaFrame[];
10
- desktop: FigmaFrame[];
11
- unknown: FigmaFrame[];
12
- };
13
- allNodeIds: string[];
14
- }
15
5
  export declare function groupFramesByBreakpoint(frames: FigmaFrame[]): Map<string, BreakpointGroup>;
16
6
  //# sourceMappingURL=frame-extractor.d.ts.map
@@ -83,6 +83,9 @@ function collectNestedFrames(parent, pageId, pageName, frames) {
83
83
  }
84
84
  }
85
85
  }
86
+ // ---------------------------------------------------------------------------
87
+ // Responsive frame pairing — groupFramesByBreakpoint (SPEC-423)
88
+ // ---------------------------------------------------------------------------
86
89
  const BREAKPOINT_PAGE_KEYWORDS = {
87
90
  mobile: ['mobile', 'sm', 'phone', 'iphone', 'android'],
88
91
  tablet: ['tablet', 'md', 'ipad'],
@@ -1,9 +1,4 @@
1
- export interface FigmaFileEntry {
2
- fileKey: string;
3
- label: string;
4
- figmaUrl: string;
5
- addedAt: string;
6
- }
1
+ import type { FigmaFileEntry } from '../../types/figma.js';
7
2
  export declare function parseAndValidateFileEntry(figmaUrl: string, label: string): FigmaFileEntry;
8
3
  export declare function addFileEntry(existing: FigmaFileEntry[], entry: FigmaFileEntry): FigmaFileEntry[];
9
4
  export declare function removeFileEntry(existing: FigmaFileEntry[], fileKey: string): FigmaFileEntry[];
@@ -1,4 +1,6 @@
1
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
1
2
  import { listSpecs } from '../../storage/spec-store.js';
3
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
2
4
  import { hashProjectPath } from '../../storage/base-store.js';
3
5
  import { generateSpecId } from '../spec-format/spec-id.js';
4
6
  // ---------------------------------------------------------------------------
@@ -1,4 +1,4 @@
1
- export interface FigmaThumbnailResult {
1
+ export interface FigmaThumbnailFetchResult {
2
2
  nodeId: string;
3
3
  url: string | null;
4
4
  }
@@ -1,9 +1,4 @@
1
- export interface FigmaToken {
2
- category: 'color' | 'typography' | 'spacing' | 'radius' | 'shadow' | 'other';
3
- name: string;
4
- value: string;
5
- rawValue: unknown;
6
- }
1
+ import type { FigmaToken } from '../../types/figma.js';
7
2
  export declare function fetchFigmaTokens(fileKey: string, accessToken: string): Promise<FigmaToken[]>;
8
3
  export declare function groupTokensByCategory(tokens: FigmaToken[]): Map<FigmaToken['category'], FigmaToken[]>;
9
4
  export declare function formatTokensAsMarkdown(groups: Map<FigmaToken['category'], FigmaToken[]>): string;
@@ -1,4 +1,3 @@
1
- // engine/figma/token-extractor.ts — Figma Design Tokens extractor (SPEC-421)
2
1
  // ---------------------------------------------------------------------------
3
2
  // Helpers
4
3
  // ---------------------------------------------------------------------------
@@ -1,10 +1,4 @@
1
- export interface FigmaDriftEntry {
2
- specId: string;
3
- section: string;
4
- storedVersion: string | null;
5
- currentVersion: string;
6
- driftDetected: boolean;
7
- }
1
+ import type { FigmaDriftEntry } from '../../types/figma.js';
8
2
  export declare function fetchLatestFigmaVersion(fileKey: string, accessToken: string): Promise<string>;
9
3
  export declare function detectDrift(specs: {
10
4
  specId: string;
@@ -1,4 +1,3 @@
1
- // engine/figma/version-tracker.ts — Figma version fetching and drift detection (SPEC-428)
2
1
  export async function fetchLatestFigmaVersion(fileKey, accessToken) {
3
2
  const response = await fetch(`https://api.figma.com/v1/files/${fileKey}/versions`, {
4
3
  headers: { 'X-Figma-Token': accessToken },
@@ -1,12 +1,5 @@
1
- export type DiffSeverity = 'critical' | 'warning' | 'info';
2
- export interface VisualDiffEntry {
3
- element: string;
4
- figmaValue: string;
5
- implementedValue: string;
6
- delta: string;
7
- severity: DiffSeverity;
8
- }
9
- export interface VisualQAResult {
1
+ import type { VisualDiffEntry, VisualQASummary } from '../../types/figma.js';
2
+ export interface VisualQaRunResult {
10
3
  specId: string;
11
4
  nodeId: string;
12
5
  figmaImageUrl: string;
@@ -19,16 +12,9 @@ export interface VisualQAResult {
19
12
  infoCount: number;
20
13
  passed: boolean;
21
14
  }
22
- export interface VisualQASummary {
23
- totalSpecs: number;
24
- specsValidated: number;
25
- specsWithCritical: number;
26
- specsNeverValidated: number;
27
- validatedAt: string;
28
- }
29
15
  export declare function exportFigmaFrameImage(fileKey: string, nodeId: string, accessToken: string): Promise<string>;
30
- export declare function createVisualQAResult(specId: string, nodeId: string, figmaImageUrl: string, screenshotUrl: string, diffs: VisualDiffEntry[], comparisonMode?: 'pixel-diff' | 'evidence-only'): VisualQAResult;
16
+ export declare function createVisualQAResult(specId: string, nodeId: string, figmaImageUrl: string, screenshotUrl: string, diffs: VisualDiffEntry[], comparisonMode?: 'pixel-diff' | 'evidence-only'): VisualQaRunResult;
31
17
  export declare function buildPlaceholderDiff(_screenshotUrl: string, _figmaImageUrl: string): VisualDiffEntry[];
32
- export declare function formatVisualQAReport(results: VisualQAResult[]): string;
33
- export declare function buildSummary(results: VisualQAResult[], totalSpecs: number): VisualQASummary;
18
+ export declare function formatVisualQAReport(results: VisualQaRunResult[]): string;
19
+ export declare function buildSummary(results: VisualQaRunResult[], totalSpecs: number): VisualQASummary;
34
20
  //# sourceMappingURL=visual-qa.d.ts.map
@@ -1,4 +1,3 @@
1
- // engine/figma/visual-qa.ts — Visual QA comparison engine (SPEC-429)
2
1
  const FIGMA_API_BASE = 'https://api.figma.com/v1';
3
2
  // ---------------------------------------------------------------------------
4
3
  // exportFigmaFrameImage — export a Figma frame as a PNG CDN URL
@@ -19,7 +18,7 @@ export async function exportFigmaFrameImage(fileKey, nodeId, accessToken) {
19
18
  return imageUrl;
20
19
  }
21
20
  // ---------------------------------------------------------------------------
22
- // createVisualQAResult — build a VisualQAResult from diffs
21
+ // createVisualQAResult — build a VisualQaRunResult from diffs
23
22
  // ---------------------------------------------------------------------------
24
23
  export function createVisualQAResult(specId, nodeId, figmaImageUrl, screenshotUrl, diffs, comparisonMode = 'pixel-diff') {
25
24
  const criticalCount = diffs.filter((d) => d.severity === 'critical').length;
@@ -1,10 +1,4 @@
1
- export interface FigmaWebhookRegistration {
2
- webhookId: string;
3
- passcode: string;
4
- endpoint: string;
5
- registeredAt: string;
6
- lastTriggeredAt?: string;
7
- }
1
+ import type { FigmaWebhookRegistration } from '../../types/figma.js';
8
2
  export declare function registerFigmaWebhook(teamId: string, callbackUrl: string, accessToken: string): Promise<FigmaWebhookRegistration>;
9
3
  export declare function deregisterFigmaWebhook(webhookId: string, accessToken: string): Promise<void>;
10
4
  export declare function validateWebhookSignature(body: string, signature: string, passcode: string): boolean;
@@ -3,6 +3,7 @@
3
3
  // When SPEC-717 implements bump_spec_version, it should call resealFrontmatter()
4
4
  // at the end of the version bump to update the SHA freeze for the modified spec.
5
5
  import { computeFrontmatterSha } from './compute-sha.js';
6
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
6
7
  import { appendTransitionEvent } from '../../storage/transition-log.js';
7
8
  /**
8
9
  * Reseal the frontmatter SHA after an authorized mutation of a terminal spec.
@@ -1,6 +1,7 @@
1
1
  // engine/frontmatter-sha/verify-terminal.ts — SPEC-723: Tamper detection for terminal specs
2
2
  import { computeFrontmatterSha } from './compute-sha.js';
3
3
  import { FROZEN_FIELDS } from './frozen-fields.js';
4
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
4
5
  import { readTransitionLog } from '../../storage/transition-log.js';
5
6
  /**
6
7
  * Verify that the frontmatter of a terminal spec has not been tampered with
@@ -1,19 +1,11 @@
1
1
  // @crash-shield-ignore-file — config/cache reader for Planu-controlled JSON; writer is this codebase, shape guaranteed by build/seed.
2
2
  // engine/git-hook-injector.ts — Inject planu auto-stage snippet into project git pre-commit hook
3
3
  // SPEC-347: auto-stage planu HTML files so they are never left out of commits
4
- import { readFile, writeFile, access, constants } from 'node:fs/promises';
4
+ import { readFile, writeFile } from 'node:fs/promises';
5
5
  import { join, resolve } from 'node:path';
6
+ import { fileExists } from '../core/shared/fs.js';
6
7
  const PLANU_SNIPPET = `\n# Planu: optional auto-stage specs (SPEC-466 — only source-of-truth files)\nif [ "$PLANU_ENABLE_AUTOCOMMIT" = "true" ]; then\n git add planu/specs/ planu/conventions.json 2>/dev/null || true\nfi\n`;
7
8
  const PLANU_MARKER = 'git add planu/';
8
- async function fileExists(filePath) {
9
- try {
10
- await access(filePath, constants.F_OK);
11
- return true;
12
- }
13
- catch {
14
- return false;
15
- }
16
- }
17
9
  async function packageJsonHasDep(projectPath, depName) {
18
10
  try {
19
11
  const pkgPath = join(projectPath, 'package.json');
@@ -1,9 +1,7 @@
1
1
  // engine/github/quality-dimensions.ts — Quality analysis dimensions (SPEC-309)
2
2
  // Duplication, complexity, and dead-code checks extracted from review-dimensions.ts
3
3
  import { parseDiffFiles } from './review-helpers.js';
4
- function escapeRegex(input) {
5
- return input.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
6
- }
4
+ import { escapeRegex } from '../../core/shared/strings.js';
7
5
  // ---------------------------------------------------------------------------
8
6
  // Duplication dimension
9
7
  // ---------------------------------------------------------------------------
@@ -1,7 +1,9 @@
1
1
  // engine/global-rules-manager.ts — Global Steering Rules manager (SPEC-351)
2
2
  import { readFile, writeFile, readdir, unlink, mkdir } from 'node:fs/promises';
3
3
  import { join, dirname } from 'node:path';
4
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
4
5
  import { resolveStorageLayout } from '../storage/storage-layout.js';
6
+ import { escapeRegex } from '../core/shared/strings.js';
5
7
  // ---------------------------------------------------------------------------
6
8
  // Paths
7
9
  // ---------------------------------------------------------------------------
@@ -208,7 +210,4 @@ export async function exportRule(slug) {
208
210
  // ---------------------------------------------------------------------------
209
211
  // Helpers
210
212
  // ---------------------------------------------------------------------------
211
- function escapeRegex(str) {
212
- return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
213
- }
214
213
  //# sourceMappingURL=global-rules-manager.js.map
@@ -1,4 +1,5 @@
1
1
  import { reportClassifiedDegradation } from '../../errors/classified-degradation.js';
2
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
2
3
  import { readTransitionLog } from '../../storage/transition-log.js';
3
4
  import { readArtifact } from './io.js';
4
5
  export function isLifecycleStubBody(specId, body) {
@@ -4,9 +4,11 @@ import { readFile } from 'node:fs/promises';
4
4
  import { join } from 'node:path';
5
5
  import { atomicWriteFile } from '../safety/atomic-write-file.js';
6
6
  import { acquireLock, releaseLock } from '../safety/cross-process-lock.js';
7
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
7
8
  import { appendTransitionEvent } from '../../storage/transition-log.js';
8
9
  import { validateArtifact } from './schemas.js';
9
10
  import { resolveCompat } from './version-policy.js';
11
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
10
12
  import { projectDataDir } from '../../storage/base-store.js';
11
13
  // Current schema version for version-policy checks
12
14
  const CURRENT_SCHEMA_VERSION = '1.0.0';
@@ -3,6 +3,7 @@ import { createHash } from 'node:crypto';
3
3
  import { mkdir, readFile, writeFile } from 'node:fs/promises';
4
4
  import { join } from 'node:path';
5
5
  import { stripFrontmatter } from './frontmatter-parser.js';
6
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
6
7
  import { hashProjectPath, projectDataDir } from '../storage/base-store.js';
7
8
  import { extractAcceptanceCriteriaTexts } from './spec-format/acceptance-criteria.js';
8
9
  import { extractListItems, findMarkdownSectionRange } from './spec-format/markdown-sections.js';
@@ -324,7 +325,7 @@ function normalizeStrictOwnedPath(rawValue) {
324
325
  if (normalized.status !== 'valid') {
325
326
  return null;
326
327
  }
327
- return /^[A-Za-z0-9._/-]+$/u.test(normalized.path) ? normalized.path : null;
328
+ return /^[A-Za-z0-9._/()[\]@-]+$/u.test(normalized.path) ? normalized.path : null;
328
329
  }
329
330
  function collectStrictOwnershipEntry(rawValue, classification, state) {
330
331
  const rawPath = rawValue.trim();
@@ -1,4 +1,5 @@
1
1
  // engine/health/auto-fixer.ts — Auto-fix for health check issues (SPEC-408)
2
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
2
3
  import { specStore } from '../../storage/index.js';
3
4
  import { computeSpecHealth } from '../validation-loop.js';
4
5
  async function collectHealthIssues(projectPath, projectId) {
@@ -2,6 +2,7 @@
2
2
  // engine/hooks/context-injector.ts — Reads project data and writes .planu/plan-context.md (SPEC-262)
3
3
  import { readFile, writeFile, mkdir } from 'node:fs/promises';
4
4
  import { join } from 'node:path';
5
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
5
6
  import { hashProjectPath, projectDataDir } from '../../storage/base-store.js';
6
7
  // ---------------------------------------------------------------------------
7
8
  // Constants
@@ -3,17 +3,10 @@ import { technologyValue } from './technology-registry.js';
3
3
  // Read-only analysis by default; patchHooks() writes fixes when autoFix is enabled.
4
4
  import { readFileSync, existsSync, readdirSync, writeFileSync } from 'node:fs';
5
5
  import { join } from 'node:path';
6
+ import { readFileSafeSync as readFileSafe } from '../core/shared/fs.js';
6
7
  // ---------------------------------------------------------------------------
7
8
  // Helpers
8
9
  // ---------------------------------------------------------------------------
9
- function readFileSafe(path) {
10
- try {
11
- return readFileSync(path, 'utf-8');
12
- }
13
- catch {
14
- return '';
15
- }
16
- }
17
10
  function readPackageJson(projectPath) {
18
11
  try {
19
12
  return JSON.parse(readFileSync(join(projectPath, 'package.json'), 'utf-8'));
@@ -1,15 +1,8 @@
1
1
  // engine/impact-detector/index.ts — SPEC-586: Orchestrate impact detection on spec:approved
2
- import { readFile, writeFile } from 'node:fs/promises';
2
+ import { writeFile } from 'node:fs/promises';
3
3
  import { detectsNewToolRegistration, buildToolRegistrationCriteria } from './tool-registration.js';
4
4
  import { predictTestBreaks } from './test-break-predictor.js';
5
- async function readFileSafe(p) {
6
- try {
7
- return await readFile(p, 'utf-8');
8
- }
9
- catch {
10
- return '';
11
- }
12
- }
5
+ import { readFileSafe } from '../../core/shared/fs.js';
13
6
  async function injectCriteriaIntoSpec(specPath, criteria) {
14
7
  let content = await readFileSafe(specPath);
15
8
  if (!content) {
@@ -1,3 +1,4 @@
1
+ import { escapeRegex } from '../../core/shared/strings.js';
1
2
  export const IMPLEMENTATION_CONTRACT_SECTION = 'Implementation Contract';
2
3
  /** Subsections every rendered contract must include — omitting one is a defect. */
3
4
  export const IMPLEMENTATION_CONTRACT_REQUIRED_SUBSECTIONS = [
@@ -40,7 +41,4 @@ export function extractTopLevelSection(body, sectionName) {
40
41
  const next = nextRe.exec(normalized);
41
42
  return normalized.slice(start, next ? next.index : normalized.length).trim();
42
43
  }
43
- function escapeRegex(input) {
44
- return input.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
45
- }
46
44
  //# sourceMappingURL=common.js.map
@@ -1,4 +1,5 @@
1
1
  import { extractTopLevelSection, IMPLEMENTATION_CONTRACT_OPTIONAL_SUBSECTIONS, IMPLEMENTATION_CONTRACT_REQUIRED_SUBSECTIONS, IMPLEMENTATION_CONTRACT_SECTION, } from './common.js';
2
+ import { escapeRegex } from '../../core/shared/strings.js';
2
3
  const FILLER_PATTERNS = [
3
4
  /\bTBD\b/i,
4
5
  /\bN\/A\b/i,
@@ -183,7 +184,4 @@ function normalize(value) {
183
184
  .trim()
184
185
  .toLowerCase();
185
186
  }
186
- function escapeRegex(input) {
187
- return input.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
188
- }
189
187
  //# sourceMappingURL=evaluator.js.map
@@ -1,10 +1,5 @@
1
- /**
2
- * Escape all regex metacharacters in a string so it can be safely used
3
- * as a literal fragment inside a `new RegExp(...)` pattern.
4
- *
5
- * `escapeRegex("foo.bar")` returns `"foo\\.bar"`.
6
- */
7
- export declare function escapeRegex(str: string): string;
1
+ import { escapeRegex } from '../../core/shared/strings.js';
2
+ export { escapeRegex };
8
3
  /**
9
4
  * Build a word-boundary-aware regex that matches `keyword` surrounded by
10
5
  * non-word characters (or string edges). Returns `null` when the keyword
@@ -1,18 +1,6 @@
1
1
  // src/engine/keyword-matcher/boundary.ts — Word-boundary regex builder (SPEC-577 Phase 1)
2
- /**
3
- * Characters that have special meaning inside a JS regex and must be escaped
4
- * before being embedded in a dynamic pattern. Source: MDN RegExp § Escaping.
5
- */
6
- const REGEX_METACHARACTERS = /[.*+?^${}()|[\]\\]/g;
7
- /**
8
- * Escape all regex metacharacters in a string so it can be safely used
9
- * as a literal fragment inside a `new RegExp(...)` pattern.
10
- *
11
- * `escapeRegex("foo.bar")` returns `"foo\\.bar"`.
12
- */
13
- export function escapeRegex(str) {
14
- return str.replace(REGEX_METACHARACTERS, '\\$&');
15
- }
2
+ import { escapeRegex } from '../../core/shared/strings.js';
3
+ export { escapeRegex };
16
4
  /**
17
5
  * Build a word-boundary-aware regex that matches `keyword` surrounded by
18
6
  * non-word characters (or string edges). Returns `null` when the keyword
@@ -1,6 +1,7 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import { lstat, mkdir, readFile, readdir, realpath } from 'node:fs/promises';
3
3
  import { basename, join, relative, resolve, sep } from 'node:path';
4
+ // eslint-disable-next-line no-restricted-imports -- grandfathered layer violation, remediation SPEC-1661 SPEC-1662 SPEC-1663
4
5
  import { projectDataDir, readJson, writeJson } from '../storage/base-store.js';
5
6
  import { ReconciliationReceiptV1Schema } from './handoff-artifacts/schemas.js';
6
7
  const REQUEST_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u;