openplanr 3.0.1 → 3.1.1

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 (232) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +1 -1
  3. package/dist/cli/commands/doctor.d.ts.map +1 -1
  4. package/dist/cli/commands/doctor.js +24 -1
  5. package/dist/cli/commands/doctor.js.map +1 -1
  6. package/dist/cli/commands/init-deterministic.d.ts.map +1 -1
  7. package/dist/cli/commands/init-deterministic.js +49 -6
  8. package/dist/cli/commands/init-deterministic.js.map +1 -1
  9. package/dist/dashboard/.vite/manifest.json +2 -2
  10. package/dist/dashboard/assets/{index-Bk8DyO_2.css → index-BU5fzjyz.css} +1 -1
  11. package/dist/dashboard/assets/index-G7ygVDGg.js +572 -0
  12. package/dist/dashboard/assets/index-G7ygVDGg.js.map +1 -0
  13. package/dist/dashboard/dashboard-manifest.json +14 -14
  14. package/dist/dashboard/index.html +2 -2
  15. package/dist/models/types.d.ts +0 -46
  16. package/dist/models/types.d.ts.map +1 -1
  17. package/dist/services/capability-map-service.d.ts +4 -0
  18. package/dist/services/capability-map-service.d.ts.map +1 -1
  19. package/dist/services/capability-map-service.js +7 -1
  20. package/dist/services/capability-map-service.js.map +1 -1
  21. package/dist/services/claude-plugin-service.d.ts +6 -1
  22. package/dist/services/claude-plugin-service.d.ts.map +1 -1
  23. package/dist/services/claude-plugin-service.js +54 -15
  24. package/dist/services/claude-plugin-service.js.map +1 -1
  25. package/dist/services/config-service.d.ts +24 -1
  26. package/dist/services/config-service.d.ts.map +1 -1
  27. package/dist/services/config-service.js +69 -2
  28. package/dist/services/config-service.js.map +1 -1
  29. package/dist/services/git-service.d.ts +5 -0
  30. package/dist/services/git-service.d.ts.map +1 -1
  31. package/dist/services/git-service.js +27 -0
  32. package/dist/services/git-service.js.map +1 -1
  33. package/dist/services/global-install-service.d.ts +24 -0
  34. package/dist/services/global-install-service.d.ts.map +1 -0
  35. package/dist/services/global-install-service.js +68 -0
  36. package/dist/services/global-install-service.js.map +1 -0
  37. package/dist/services/linear-pull-service.d.ts.map +1 -1
  38. package/dist/services/linear-pull-service.js +1 -2
  39. package/dist/services/linear-pull-service.js.map +1 -1
  40. package/dist/services/pipeline-package-service.d.ts +2 -0
  41. package/dist/services/pipeline-package-service.d.ts.map +1 -1
  42. package/dist/services/pipeline-package-service.js +2 -1
  43. package/dist/services/pipeline-package-service.js.map +1 -1
  44. package/dist/services/runtime-change-summary.d.ts.map +1 -1
  45. package/dist/services/runtime-change-summary.js +4 -0
  46. package/dist/services/runtime-change-summary.js.map +1 -1
  47. package/dist/services/runtime-manager-service.d.ts.map +1 -1
  48. package/dist/services/runtime-manager-service.js +14 -3
  49. package/dist/services/runtime-manager-service.js.map +1 -1
  50. package/dist/services/spec-service.d.ts.map +1 -1
  51. package/dist/services/spec-service.js +11 -22
  52. package/dist/services/spec-service.js.map +1 -1
  53. package/dist/services/upgrade-service.d.ts +15 -1
  54. package/dist/services/upgrade-service.d.ts.map +1 -1
  55. package/dist/services/upgrade-service.js +105 -14
  56. package/dist/services/upgrade-service.js.map +1 -1
  57. package/dist/templates/rules/shared/capability-map.md.hbs +2 -2
  58. package/lib/host-packages/adapter-registry.json +5 -5
  59. package/lib/host-packages/capability-map.json +89 -29
  60. package/lib/host-packages/claude/.claude-plugin/marketplace.json +2 -2
  61. package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +1 -1
  62. package/lib/host-packages/claude/openplanr/.openplanr-content.json +69 -37
  63. package/lib/host-packages/claude/openplanr/CONNECTORS.md +62 -0
  64. package/lib/host-packages/claude/openplanr/README.md +1 -1
  65. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share.mjs +1 -1
  66. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-31a760fc.mjs +259 -36
  67. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +54 -54
  68. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
  69. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +259 -36
  70. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +4 -4
  71. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
  72. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +43 -24
  73. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +279 -58
  74. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +50 -42
  75. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +282 -146
  76. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +949 -316
  77. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +143 -87
  78. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +930 -183
  79. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +17 -15
  80. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-interface-primitives.js +375 -191
  81. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-interface-primitives.js +140 -105
  82. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +23 -23
  83. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +4 -4
  84. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +259 -36
  85. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +4 -4
  86. package/lib/host-packages/claude/openplanr/skills/connect/SKILL.md +60 -0
  87. package/lib/host-packages/claude/openplanr/skills/connect/references/connectors.md +62 -0
  88. package/lib/host-packages/claude/openplanr/skills/openplanr/SKILL.md +4 -0
  89. package/lib/host-packages/claude/openplanr/skills/plan/SKILL.md +4 -1
  90. package/lib/host-packages/claude/openplanr/skills/plan/scripts/planning-ids.mjs +49 -3
  91. package/lib/host-packages/claude/openplanr/skills/share/SKILL.md +87 -0
  92. package/lib/host-packages/claude/openplanr/skills/share/references/connectors.md +62 -0
  93. package/lib/host-packages/claude/openplanr/skills/ship/SKILL.md +6 -3
  94. package/lib/host-packages/claude/openplanr/skills/ship/scripts/discover-verification.mjs +2 -1
  95. package/lib/host-packages/claude/openplanr/skills/sprint/SKILL.md +15 -6
  96. package/lib/host-packages/claude/openplanr/skills/sprint/references/connectors.md +62 -0
  97. package/lib/host-packages/claude/openplanr/skills/sprint/references/tracker-connections.md +9 -13
  98. package/lib/host-packages/claude/openplanr/skills/status/SKILL.md +14 -3
  99. package/lib/host-packages/claude/openplanr/skills/status/references/connectors.md +62 -0
  100. package/lib/host-packages/claude/openplanr/skills/status/references/tracker-connections.md +9 -13
  101. package/lib/host-packages/claude/openplanr/skills/sync/SKILL.md +25 -10
  102. package/lib/host-packages/claude/openplanr/skills/sync/references/connectors.md +62 -0
  103. package/lib/host-packages/claude/openplanr/skills/sync/references/tracker-connections.md +9 -13
  104. package/lib/host-packages/cursor/openplanr/.openplanr-content.json +68 -36
  105. package/lib/host-packages/cursor/openplanr/CONNECTORS.md +62 -0
  106. package/lib/host-packages/cursor/openplanr/manifest.json +4 -2
  107. package/lib/host-packages/cursor/openplanr/rules/planr-connect/references/connectors.md +62 -0
  108. package/lib/host-packages/cursor/openplanr/rules/planr-connect.mdc +58 -0
  109. package/lib/host-packages/cursor/openplanr/rules/planr-openplanr.mdc +4 -0
  110. package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/planning-ids.mjs +49 -3
  111. package/lib/host-packages/cursor/openplanr/rules/planr-plan.mdc +4 -1
  112. package/lib/host-packages/cursor/openplanr/rules/planr-share/references/connectors.md +62 -0
  113. package/lib/host-packages/cursor/openplanr/rules/planr-share.mdc +85 -0
  114. package/lib/host-packages/cursor/openplanr/rules/planr-ship/scripts/discover-verification.mjs +2 -1
  115. package/lib/host-packages/cursor/openplanr/rules/planr-ship.mdc +6 -3
  116. package/lib/host-packages/cursor/openplanr/rules/planr-sprint/references/connectors.md +62 -0
  117. package/lib/host-packages/cursor/openplanr/rules/planr-sprint/references/tracker-connections.md +9 -13
  118. package/lib/host-packages/cursor/openplanr/rules/planr-sprint.mdc +15 -6
  119. package/lib/host-packages/cursor/openplanr/rules/planr-status/references/connectors.md +62 -0
  120. package/lib/host-packages/cursor/openplanr/rules/planr-status/references/tracker-connections.md +9 -13
  121. package/lib/host-packages/cursor/openplanr/rules/planr-status.mdc +14 -3
  122. package/lib/host-packages/cursor/openplanr/rules/planr-sync/references/connectors.md +62 -0
  123. package/lib/host-packages/cursor/openplanr/rules/planr-sync/references/tracker-connections.md +9 -13
  124. package/lib/host-packages/cursor/openplanr/rules/planr-sync.mdc +25 -10
  125. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share.mjs +1 -1
  126. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-31a760fc.mjs +259 -36
  127. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +54 -54
  128. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
  129. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +259 -36
  130. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +4 -4
  131. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
  132. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +43 -24
  133. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +279 -58
  134. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +50 -42
  135. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +282 -146
  136. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +949 -316
  137. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +143 -87
  138. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +930 -183
  139. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +17 -15
  140. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-interface-primitives.js +375 -191
  141. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-interface-primitives.js +140 -105
  142. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +23 -23
  143. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +4 -4
  144. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +259 -36
  145. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +4 -4
  146. package/lib/host-packages/openai/.claude-plugin/marketplace.json +2 -2
  147. package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +1 -1
  148. package/lib/host-packages/openai/openplanr/.openplanr-content.json +87 -39
  149. package/lib/host-packages/openai/openplanr/CONNECTORS.md +62 -0
  150. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share.mjs +1 -1
  151. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-31a760fc.mjs +259 -36
  152. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +54 -54
  153. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
  154. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +259 -36
  155. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +4 -4
  156. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
  157. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +43 -24
  158. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +279 -58
  159. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +50 -42
  160. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +282 -146
  161. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +949 -316
  162. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +143 -87
  163. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +930 -183
  164. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +17 -15
  165. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-interface-primitives.js +375 -191
  166. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-interface-primitives.js +140 -105
  167. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +23 -23
  168. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +4 -4
  169. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +259 -36
  170. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +4 -4
  171. package/lib/host-packages/openai/openplanr/skills/connect/SKILL.md +59 -0
  172. package/lib/host-packages/openai/openplanr/skills/connect/agents/openai.yaml +6 -0
  173. package/lib/host-packages/openai/openplanr/skills/connect/openplanr.skill.json +37 -0
  174. package/lib/host-packages/openai/openplanr/skills/connect/references/connectors.md +62 -0
  175. package/lib/host-packages/openai/openplanr/skills/openplanr/SKILL.md +4 -0
  176. package/lib/host-packages/openai/openplanr/skills/plan/SKILL.md +4 -1
  177. package/lib/host-packages/openai/openplanr/skills/plan/scripts/planning-ids.mjs +49 -3
  178. package/lib/host-packages/openai/openplanr/skills/share/SKILL.md +86 -0
  179. package/lib/host-packages/openai/openplanr/skills/share/agents/openai.yaml +6 -0
  180. package/lib/host-packages/openai/openplanr/skills/share/openplanr.skill.json +37 -0
  181. package/lib/host-packages/openai/openplanr/skills/share/references/connectors.md +62 -0
  182. package/lib/host-packages/openai/openplanr/skills/ship/SKILL.md +6 -3
  183. package/lib/host-packages/openai/openplanr/skills/ship/scripts/discover-verification.mjs +2 -1
  184. package/lib/host-packages/openai/openplanr/skills/sprint/SKILL.md +15 -6
  185. package/lib/host-packages/openai/openplanr/skills/sprint/openplanr.skill.json +11 -0
  186. package/lib/host-packages/openai/openplanr/skills/sprint/references/connectors.md +62 -0
  187. package/lib/host-packages/openai/openplanr/skills/sprint/references/tracker-connections.md +9 -13
  188. package/lib/host-packages/openai/openplanr/skills/status/SKILL.md +14 -3
  189. package/lib/host-packages/openai/openplanr/skills/status/openplanr.skill.json +11 -0
  190. package/lib/host-packages/openai/openplanr/skills/status/references/connectors.md +62 -0
  191. package/lib/host-packages/openai/openplanr/skills/status/references/tracker-connections.md +9 -13
  192. package/lib/host-packages/openai/openplanr/skills/sync/SKILL.md +25 -10
  193. package/lib/host-packages/openai/openplanr/skills/sync/openplanr.skill.json +11 -0
  194. package/lib/host-packages/openai/openplanr/skills/sync/references/connectors.md +62 -0
  195. package/lib/host-packages/openai/openplanr/skills/sync/references/tracker-connections.md +9 -13
  196. package/lib/json-schema.mjs +313 -36
  197. package/lib/schemas/v1.0.0/spec.schema.json +120 -0
  198. package/lib/schemas/v1.0.0/story.schema.json +95 -0
  199. package/lib/schemas/v1.0.0/task.schema.json +171 -0
  200. package/lib/schemas/v1.7.0/spec.schema.json +117 -0
  201. package/lib/schemas/v1.7.0/story.schema.json +107 -0
  202. package/lib/schemas/v1.7.0/task.schema.json +217 -0
  203. package/package.json +31 -31
  204. package/dist/dashboard/assets/index-n08LJ6bK.js +0 -557
  205. package/dist/dashboard/assets/index-n08LJ6bK.js.map +0 -1
  206. package/dist/services/audit-log-service.d.ts +0 -47
  207. package/dist/services/audit-log-service.d.ts.map +0 -1
  208. package/dist/services/audit-log-service.js +0 -211
  209. package/dist/services/audit-log-service.js.map +0 -1
  210. package/dist/services/delta-apply-service.d.ts +0 -16
  211. package/dist/services/delta-apply-service.d.ts.map +0 -1
  212. package/dist/services/delta-apply-service.js +0 -74
  213. package/dist/services/delta-apply-service.js.map +0 -1
  214. package/dist/services/evidence-verifier.d.ts +0 -71
  215. package/dist/services/evidence-verifier.d.ts.map +0 -1
  216. package/dist/services/evidence-verifier.js +0 -174
  217. package/dist/services/evidence-verifier.js.map +0 -1
  218. package/dist/services/revise-apply-service.d.ts +0 -55
  219. package/dist/services/revise-apply-service.d.ts.map +0 -1
  220. package/dist/services/revise-apply-service.js +0 -265
  221. package/dist/services/revise-apply-service.js.map +0 -1
  222. package/dist/services/revise-cache-service.d.ts +0 -46
  223. package/dist/services/revise-cache-service.d.ts.map +0 -1
  224. package/dist/services/revise-cache-service.js +0 -89
  225. package/dist/services/revise-cache-service.js.map +0 -1
  226. package/dist/services/revise-plan-service.d.ts +0 -38
  227. package/dist/services/revise-plan-service.d.ts.map +0 -1
  228. package/dist/services/revise-plan-service.js +0 -153
  229. package/dist/services/revise-plan-service.js.map +0 -1
  230. /package/lib/host-packages/claude/openplanr/runtime/design/scripts/{design-runtime-support-336900df0d39.mjs → design-runtime-support-e34c388a8e59.mjs} +0 -0
  231. /package/lib/host-packages/cursor/openplanr/runtime/design/scripts/{design-runtime-support-336900df0d39.mjs → design-runtime-support-e34c388a8e59.mjs} +0 -0
  232. /package/lib/host-packages/openai/openplanr/runtime/design/scripts/{design-runtime-support-336900df0d39.mjs → design-runtime-support-e34c388a8e59.mjs} +0 -0
@@ -1,55 +0,0 @@
1
- /**
2
- * Replay a previously-written revise audit to disk without any model calls.
3
- *
4
- * Implements after `planr revise --dry-run` produces an audit log
5
- * with the proposed diffs, `planr revise --apply-from <audit>` reads those
6
- * diffs and writes them to the corresponding artifacts. Zero tokens spent
7
- * in this mode.
8
- *
9
- * Pipeline:
10
- * 1. Clean-tree gate (same as normal revise)
11
- * 2. Parse the audit (via `revise-plan-service`) → list of replayable entries
12
- * 3. Filter to `would-apply` entries that have a diff + artifact path
13
- * 4. Per entry:
14
- * a. Read current artifact content
15
- * b. Apply the stored diff; if the diff doesn't land cleanly (the
16
- * source has drifted since the dry-run), skip the entry and
17
- * record the skip reason in the new audit
18
- * c. Atomic write with sidecar backup
19
- * d. Append an `applied-from-plan` entry to the new audit log
20
- * 5. Post-flight graph-integrity check + git rollback on break
21
- *
22
- * Safety gates preserved vs. normal apply:
23
- * - Clean-tree gate ✓
24
- * - Atomic writes (temp file + rename) ✓
25
- * - Post-flight graph integrity + git rollback ✓
26
- * - Per-artifact confirmation (prompt unless `--yes`) ✓
27
- *
28
- * Note: sidecar `.bak` files are deliberately NOT written on this path.
29
- * Rollback already flows through git (clean-tree gate guarantees HEAD is a
30
- * valid restore point), so per-file backups would be redundant noise in
31
- * `.planr/reports/`. The atomic-write guarantee covers partial-write
32
- * crashes; git covers "I wish I hadn't applied that."
33
- *
34
- * Deliberately NOT run on replay:
35
- * - AI model calls (the point of this feature)
36
- * - Evidence verification (the dry-run already verified; nothing changes
37
- * between dry-run and apply that evidence verification would catch that
38
- * the diff-apply staleness check doesn't already catch)
39
- * - `--cascade` / `--all` orchestration (the audit already encodes the
40
- * cascade order as entry order)
41
- */
42
- import type { OpenPlanrConfig } from '../models/types.js';
43
- export interface ApplyFromAuditOptions {
44
- projectDir: string;
45
- config: OpenPlanrConfig;
46
- auditPath: string;
47
- allowDirty: boolean;
48
- /** Print the plan without writing — useful to confirm what would replay. */
49
- dryRun: boolean;
50
- /** Skip per-artifact confirmation; still requires typed-YES in an interactive TTY. */
51
- yes: boolean;
52
- }
53
- /** Returns the process exit code. 0 on success, 1 on fatal error, non-zero on partial/rollback. */
54
- export declare function runApplyFromAudit(opts: ApplyFromAuditOptions): Promise<number>;
55
- //# sourceMappingURL=revise-apply-service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"revise-apply-service.d.ts","sourceRoot":"","sources":["../../src/services/revise-apply-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,oBAAoB,CAAC;AAY5E,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,4EAA4E;IAC5E,MAAM,EAAE,OAAO,CAAC;IAChB,sFAAsF;IACtF,GAAG,EAAE,OAAO,CAAC;CACd;AAED,mGAAmG;AACnG,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmNpF"}
@@ -1,265 +0,0 @@
1
- /**
2
- * Replay a previously-written revise audit to disk without any model calls.
3
- *
4
- * Implements after `planr revise --dry-run` produces an audit log
5
- * with the proposed diffs, `planr revise --apply-from <audit>` reads those
6
- * diffs and writes them to the corresponding artifacts. Zero tokens spent
7
- * in this mode.
8
- *
9
- * Pipeline:
10
- * 1. Clean-tree gate (same as normal revise)
11
- * 2. Parse the audit (via `revise-plan-service`) → list of replayable entries
12
- * 3. Filter to `would-apply` entries that have a diff + artifact path
13
- * 4. Per entry:
14
- * a. Read current artifact content
15
- * b. Apply the stored diff; if the diff doesn't land cleanly (the
16
- * source has drifted since the dry-run), skip the entry and
17
- * record the skip reason in the new audit
18
- * c. Atomic write with sidecar backup
19
- * d. Append an `applied-from-plan` entry to the new audit log
20
- * 5. Post-flight graph-integrity check + git rollback on break
21
- *
22
- * Safety gates preserved vs. normal apply:
23
- * - Clean-tree gate ✓
24
- * - Atomic writes (temp file + rename) ✓
25
- * - Post-flight graph integrity + git rollback ✓
26
- * - Per-artifact confirmation (prompt unless `--yes`) ✓
27
- *
28
- * Note: sidecar `.bak` files are deliberately NOT written on this path.
29
- * Rollback already flows through git (clean-tree gate guarantees HEAD is a
30
- * valid restore point), so per-file backups would be redundant noise in
31
- * `.planr/reports/`. The atomic-write guarantee covers partial-write
32
- * crashes; git covers "I wish I hadn't applied that."
33
- *
34
- * Deliberately NOT run on replay:
35
- * - AI model calls (the point of this feature)
36
- * - Evidence verification (the dry-run already verified; nothing changes
37
- * between dry-run and apply that evidence verification would catch that
38
- * the diff-apply staleness check doesn't already catch)
39
- * - `--cascade` / `--all` orchestration (the audit already encodes the
40
- * cascade order as entry order)
41
- */
42
- import path from 'node:path';
43
- import chalk from 'chalk';
44
- import { applyUnifiedDiff } from '../utils/diff.js';
45
- import { readFile } from '../utils/fs.js';
46
- import { display, logger } from '../utils/logger.js';
47
- import { validateArtifactBytes } from './artifact-validation.js';
48
- import { atomicWriteFile } from './atomic-write-service.js';
49
- import { createAuditLogWriter } from './audit-log-service.js';
50
- import { checkCleanTree, checkoutPaths } from './git-service.js';
51
- import { checkGraphIntegrity } from './graph-integrity.js';
52
- import { confirmBulkRevise, promptReviseConfirm } from './prompt-service.js';
53
- import { filterReplayable, readPlanFromAudit } from './revise-plan-service.js';
54
- /** Returns the process exit code. 0 on success, 1 on fatal error, non-zero on partial/rollback. */
55
- export async function runApplyFromAudit(opts) {
56
- const { projectDir, config, auditPath, allowDirty, dryRun, yes } = opts;
57
- logger.heading(`Apply revise plan from ${path.basename(auditPath)}${dryRun ? ' (dry-run)' : ''}`);
58
- logger.dim('Mode: replay — zero AI tokens will be spent.');
59
- // --- Layer 1: clean-tree gate -------------------------------------------
60
- const treeCheck = await checkCleanTree(projectDir, { allowDirty });
61
- if (!treeCheck.ok) {
62
- logger.error(treeCheck.message);
63
- return 1;
64
- }
65
- if (treeCheck.status.kind !== 'clean') {
66
- logger.warn(treeCheck.message);
67
- }
68
- // --- Layer 2: parse the audit -------------------------------------------
69
- let plan;
70
- try {
71
- plan = readPlanFromAudit(auditPath);
72
- }
73
- catch (err) {
74
- logger.error(err instanceof Error ? err.message : String(err));
75
- return 1;
76
- }
77
- const replayable = filterReplayable(plan);
78
- logger.info(`Parsed ${plan.entries.length} audit entries (${replayable.length} replayable, ${plan.entries.length - replayable.length} skipped/flagged without diff).`);
79
- if (replayable.length === 0) {
80
- logger.warn('No replayable entries (would-apply + diff + artifact path). Nothing to do.');
81
- return 0;
82
- }
83
- // --- Bulk confirmation: typed-YES for TTY, flag-only for CI -------------
84
- if (yes && !dryRun) {
85
- const summary = buildReplaySummary(auditPath, replayable);
86
- const confirmed = await confirmBulkRevise(summary);
87
- if (!confirmed) {
88
- logger.dim('Confirmation declined — exiting without changes.');
89
- return 0;
90
- }
91
- }
92
- // --- New audit log for the apply-from-plan run --------------------------
93
- const writer = createAuditLogWriter({
94
- projectDir,
95
- scope: `${plan.scope}-applied`,
96
- cascade: false,
97
- dryRun,
98
- format: 'md',
99
- });
100
- logger.dim(`Apply audit log: ${writer.path}`);
101
- // --- Per-entry replay ---------------------------------------------------
102
- const affectedPaths = [];
103
- let applied = 0;
104
- let stale = 0;
105
- let conflicts = 0;
106
- let skipped = 0;
107
- let userQuit = false;
108
- for (let i = 0; i < replayable.length; i++) {
109
- if (userQuit)
110
- break;
111
- const entry = replayable[i];
112
- const progress = `[${i + 1}/${replayable.length}] ${entry.artifactId}`;
113
- if (!entry.artifactPath) {
114
- skipped++;
115
- recordSkip(writer, entry, 'stale-skipped', 'no artifact path recorded in plan');
116
- continue;
117
- }
118
- let currentContent;
119
- try {
120
- currentContent = await readFile(entry.artifactPath);
121
- }
122
- catch (err) {
123
- stale++;
124
- recordSkip(writer, entry, 'stale-skipped', `cannot read artifact: ${err instanceof Error ? err.message : String(err)}`);
125
- logger.warn(`${progress}: stale — artifact not readable.`);
126
- continue;
127
- }
128
- const patch = applyUnifiedDiff(currentContent, entry.diff ?? '');
129
- if (!patch.ok) {
130
- conflicts++;
131
- recordSkip(writer, entry, 'conflict-skipped', patch.error ?? 'diff did not apply cleanly');
132
- logger.warn(`${progress}: conflict — ${patch.error}`);
133
- continue;
134
- }
135
- const artifactType = (entry.artifactType ??
136
- 'task');
137
- const validation = validateArtifactBytes(artifactType, currentContent, patch.result ?? '');
138
- if (!validation.ok) {
139
- conflicts++;
140
- recordSkip(writer, entry, 'conflict-skipped', `invariant violation: ${validation.reason}`);
141
- logger.warn(`${progress}: revise skipped — ${validation.reason}`);
142
- continue;
143
- }
144
- // Per-artifact confirmation (skipped when --yes or --dry-run).
145
- if (!dryRun && !yes) {
146
- display.separator(60);
147
- display.heading(` ${progress}: ${chalk.yellow('REPLAY REVISE')}`);
148
- display.line(` Artifact: ${entry.artifactId}`);
149
- display.line(` Rationale: ${entry.rationale}`);
150
- display.line('');
151
- display.line(' Diff:');
152
- const diffPreview = (entry.diff ?? '')
153
- .split('\n')
154
- .map((l) => ` ${colorizeDiffLine(l)}`)
155
- .join('\n');
156
- display.line(diffPreview);
157
- display.separator(60);
158
- const action = await promptReviseConfirm(entry.artifactId);
159
- if (action === 'skip') {
160
- skipped++;
161
- recordSkip(writer, entry, 'skipped-by-user', 'user declined at replay prompt');
162
- logger.dim(`${progress}: skipped by user.`);
163
- continue;
164
- }
165
- if (action === 'quit') {
166
- recordSkip(writer, entry, 'skipped-by-user', 'user quit replay at this entry');
167
- userQuit = true;
168
- break;
169
- }
170
- // For 'diff-again' we just continue; the diff was already shown. For
171
- // 'edit-rationale' we accept as-is (replay doesn't let you edit).
172
- }
173
- if (dryRun) {
174
- writer.appendEntry({
175
- ...entry,
176
- outcome: 'would-apply',
177
- timestamp: new Date().toISOString(),
178
- });
179
- applied++;
180
- logger.info(`${progress}: would apply (dry-run).`);
181
- continue;
182
- }
183
- // Atomic write (temp file + rename). No sidecar backup — git covers
184
- // rollback via the clean-tree gate + post-flight checkout.
185
- try {
186
- await atomicWriteFile(entry.artifactPath, patch.result ?? '');
187
- affectedPaths.push(path.relative(projectDir, entry.artifactPath) || entry.artifactPath);
188
- applied++;
189
- writer.appendEntry({
190
- ...entry,
191
- outcome: 'applied-from-plan',
192
- timestamp: new Date().toISOString(),
193
- });
194
- logger.info(`${progress}: ${chalk.green('applied')}.`);
195
- }
196
- catch (err) {
197
- conflicts++;
198
- recordSkip(writer, entry, 'conflict-skipped', `write failed: ${err instanceof Error ? err.message : String(err)}`);
199
- logger.error(`${progress}: write failed — ${err}`);
200
- }
201
- }
202
- // --- Post-flight graph integrity + rollback -----------------------------
203
- let exitCode = 0;
204
- if (!dryRun && affectedPaths.length > 0) {
205
- const integrity = await checkGraphIntegrity(projectDir, config);
206
- if (!integrity.ok) {
207
- logger.error(`Post-flight graph integrity broken: ${integrity.issues.length} issue(s). Rolling back…`);
208
- if (treeCheck.status.kind === 'clean') {
209
- await checkoutPaths(projectDir, affectedPaths);
210
- logger.info(`Rolled back ${affectedPaths.length} artifact path(s) to HEAD.`);
211
- }
212
- else {
213
- logger.warn('Cannot rollback — pre-run tree was dirty. Inspect changes manually.');
214
- }
215
- exitCode = 1;
216
- }
217
- else {
218
- logger.dim('Post-flight graph integrity: ok.');
219
- }
220
- }
221
- writer.close();
222
- // --- Summary ------------------------------------------------------------
223
- display.separator(60);
224
- display.heading(' Replay summary');
225
- display.line(` Applied: ${chalk.green(String(applied))}`);
226
- display.line(` Stale-skipped: ${stale} (artifact missing or unreadable)`);
227
- display.line(` Conflict-skipped: ${conflicts} (diff did not apply cleanly)`);
228
- display.line(` User-skipped: ${skipped}`);
229
- display.line(` ${chalk.bold('AI tokens spent: 0')} (replay mode — zero model calls)`);
230
- if (!dryRun && applied > 0 && exitCode === 0) {
231
- display.line('');
232
- display.line(` Suggested commit: ${chalk.cyan(`git commit -am "chore(plan): apply revise plan ${plan.scope}"`)}`);
233
- }
234
- display.separator(60);
235
- return exitCode;
236
- }
237
- function recordSkip(writer, entry, outcome, reason) {
238
- writer.appendEntry({
239
- ...entry,
240
- outcome,
241
- error: reason,
242
- timestamp: new Date().toISOString(),
243
- });
244
- }
245
- function buildReplaySummary(auditPath, entries) {
246
- const head = `About to replay ${entries.length} revise entries from ${path.basename(auditPath)}.`;
247
- const sample = entries
248
- .slice(0, 8)
249
- .map((e) => ` - ${e.artifactId} (${e.outcome} → applied-from-plan)`)
250
- .join('\n');
251
- const tail = entries.length > 8 ? `\n … and ${entries.length - 8} more` : '';
252
- return `${head}\nZero model calls will be made.\n${sample}${tail}`;
253
- }
254
- function colorizeDiffLine(line) {
255
- if (line.startsWith('+++') || line.startsWith('---'))
256
- return chalk.bold(line);
257
- if (line.startsWith('@@'))
258
- return chalk.cyan(line);
259
- if (line.startsWith('+'))
260
- return chalk.green(line);
261
- if (line.startsWith('-'))
262
- return chalk.red(line);
263
- return chalk.dim(line);
264
- }
265
- //# sourceMappingURL=revise-apply-service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"revise-apply-service.js","sourceRoot":"","sources":["../../src/services/revise-apply-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAuB,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAapG,mGAAmG;AACnG,MAAM,CAAC,KAAK,UAAU,iBAAiB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KAAK,CAAC,CAAC,OAAO,uBAAuB,CAAC;SACpE,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,OAAO,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9E,OAAO,GAAG,IAAI,qCAAqC,MAAM,GAAG,IAAI,EAAE,CAAC;AACrE,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAY;IACpC,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9E,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjD,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC"}
@@ -1,46 +0,0 @@
1
- /**
2
- * Content-hash run cache for `planr revise`.
3
- *
4
- * Between runs, we hash each artifact's raw content (+ the codebase-digest
5
- * input, when present) and skip artifacts whose hash matches the last
6
- * successful revise of that artifact with the same codebase state. Keeps
7
- * `--all` cheap to re-run on an untouched repo (a common check-before-PR
8
- * workflow) without sacrificing correctness: any edit to the artifact or
9
- * the codebase invalidates the cache entry automatically.
10
- *
11
- * Persisted at `.planr/reports/.revise-cache.json`. JSON was chosen over
12
- * a line-oriented format because the cache is small (one entry per
13
- * artifact) and atomic updates via atomicWriteFile are simpler with JSON.
14
- *
15
- * Cache semantics are best-effort: if the cache file is missing or
16
- * malformed, reads return empty (never throw). Writes are fire-and-forget.
17
- */
18
- export interface ReviseCacheEntry {
19
- artifactHash: string;
20
- /** Digest over codebase-context-relevant state (folder tree, architecture files) — optional. */
21
- codebaseHash?: string;
22
- lastOutcome: 'skipped-by-agent' | 'applied' | 'would-apply' | 'flagged';
23
- lastRunAt: string;
24
- }
25
- export interface ReviseCache {
26
- entries: Record<string, ReviseCacheEntry>;
27
- }
28
- export declare function defaultCachePath(projectDir: string): string;
29
- export declare function loadCache(projectDir: string): ReviseCache;
30
- export declare function saveCache(projectDir: string, cache: ReviseCache): Promise<void>;
31
- /** SHA-256 of the artifact raw content (body + frontmatter) used as cache key. */
32
- export declare function hashArtifactContent(raw: string): string;
33
- /** Optional SHA-256 over the codebase context string, so code changes invalidate cache. */
34
- export declare function hashCodebaseContext(formatted?: string): string | undefined;
35
- /**
36
- * Returns true when the given artifact + codebase hash matches the cache
37
- * entry from a prior successful revise — caller may skip the AI call.
38
- * A mismatch on either dimension invalidates the entry.
39
- */
40
- export declare function shouldSkipArtifact(cache: ReviseCache, artifactId: string, artifactHash: string, codebaseHash: string | undefined): boolean;
41
- /**
42
- * Record an outcome in the cache. Returns a new cache object (pure) so
43
- * callers can decide when to flush.
44
- */
45
- export declare function recordOutcome(cache: ReviseCache, artifactId: string, artifactHash: string, codebaseHash: string | undefined, outcome: ReviseCacheEntry['lastOutcome']): ReviseCache;
46
- //# sourceMappingURL=revise-cache-service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"revise-cache-service.d.ts","sourceRoot":"","sources":["../../src/services/revise-cache-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,gGAAgG;IAChG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,kBAAkB,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAC;IACxE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC3C;AAID,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAazD;AAED,wBAAsB,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAErF;AAED,kFAAkF;AAClF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,2FAA2F;AAC3F,wBAAgB,mBAAmB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG1E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,WAAW,EAClB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,GAAG,SAAS,GAC/B,OAAO,CAOT;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,WAAW,EAClB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,OAAO,EAAE,gBAAgB,CAAC,aAAa,CAAC,GACvC,WAAW,CAYb"}
@@ -1,89 +0,0 @@
1
- /**
2
- * Content-hash run cache for `planr revise`.
3
- *
4
- * Between runs, we hash each artifact's raw content (+ the codebase-digest
5
- * input, when present) and skip artifacts whose hash matches the last
6
- * successful revise of that artifact with the same codebase state. Keeps
7
- * `--all` cheap to re-run on an untouched repo (a common check-before-PR
8
- * workflow) without sacrificing correctness: any edit to the artifact or
9
- * the codebase invalidates the cache entry automatically.
10
- *
11
- * Persisted at `.planr/reports/.revise-cache.json`. JSON was chosen over
12
- * a line-oriented format because the cache is small (one entry per
13
- * artifact) and atomic updates via atomicWriteFile are simpler with JSON.
14
- *
15
- * Cache semantics are best-effort: if the cache file is missing or
16
- * malformed, reads return empty (never throw). Writes are fire-and-forget.
17
- */
18
- import { createHash } from 'node:crypto';
19
- import { existsSync, readFileSync } from 'node:fs';
20
- import path from 'node:path';
21
- import { PLANNING_FOLDER } from '../utils/constants.js';
22
- import { atomicWriteFile } from './atomic-write-service.js';
23
- const EMPTY = { entries: {} };
24
- export function defaultCachePath(projectDir) {
25
- return path.join(projectDir, PLANNING_FOLDER, 'reports', '.revise-cache.json');
26
- }
27
- export function loadCache(projectDir) {
28
- const p = defaultCachePath(projectDir);
29
- if (!existsSync(p))
30
- return { entries: {} };
31
- try {
32
- const raw = readFileSync(p, 'utf-8');
33
- const parsed = JSON.parse(raw);
34
- if (parsed && typeof parsed === 'object' && parsed.entries) {
35
- return { entries: parsed.entries };
36
- }
37
- return EMPTY;
38
- }
39
- catch {
40
- return EMPTY;
41
- }
42
- }
43
- export async function saveCache(projectDir, cache) {
44
- await atomicWriteFile(defaultCachePath(projectDir), JSON.stringify(cache, null, 2));
45
- }
46
- /** SHA-256 of the artifact raw content (body + frontmatter) used as cache key. */
47
- export function hashArtifactContent(raw) {
48
- return createHash('sha256').update(raw).digest('hex');
49
- }
50
- /** Optional SHA-256 over the codebase context string, so code changes invalidate cache. */
51
- export function hashCodebaseContext(formatted) {
52
- if (!formatted)
53
- return undefined;
54
- return createHash('sha256').update(formatted).digest('hex');
55
- }
56
- /**
57
- * Returns true when the given artifact + codebase hash matches the cache
58
- * entry from a prior successful revise — caller may skip the AI call.
59
- * A mismatch on either dimension invalidates the entry.
60
- */
61
- export function shouldSkipArtifact(cache, artifactId, artifactHash, codebaseHash) {
62
- const entry = cache.entries[artifactId];
63
- if (!entry)
64
- return false;
65
- if (entry.artifactHash !== artifactHash)
66
- return false;
67
- if (entry.codebaseHash !== codebaseHash)
68
- return false;
69
- // Only cache-skip when the prior outcome indicated "nothing to do".
70
- return entry.lastOutcome === 'skipped-by-agent';
71
- }
72
- /**
73
- * Record an outcome in the cache. Returns a new cache object (pure) so
74
- * callers can decide when to flush.
75
- */
76
- export function recordOutcome(cache, artifactId, artifactHash, codebaseHash, outcome) {
77
- return {
78
- entries: {
79
- ...cache.entries,
80
- [artifactId]: {
81
- artifactHash,
82
- codebaseHash,
83
- lastOutcome: outcome,
84
- lastRunAt: new Date().toISOString(),
85
- },
86
- },
87
- };
88
- }
89
- //# sourceMappingURL=revise-cache-service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"revise-cache-service.js","sourceRoot":"","sources":["../../src/services/revise-cache-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAc5D,MAAM,KAAK,GAAgB,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAE3C,MAAM,UAAU,gBAAgB,CAAC,UAAkB;IACjD,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,oBAAoB,CAAC,CAAC;AACjF,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,UAAkB;IAC1C,MAAM,CAAC,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACvC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC3C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QACrC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAyB,CAAC;QAC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,kBAAkB,CAAC;AAClD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAkB,EAClB,UAAkB,EAClB,YAAoB,EACpB,YAAgC,EAChC,OAAwC;IAExC,OAAO;QACL,OAAO,EAAE;YACP,GAAG,KAAK,CAAC,OAAO;YAChB,CAAC,UAAU,CAAC,EAAE;gBACZ,YAAY;gBACZ,YAAY;gBACZ,WAAW,EAAE,OAAO;gBACpB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACpC;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -1,38 +0,0 @@
1
- /**
2
- * Revise plan parser.
3
- *
4
- * A "plan" is a previously-written revise audit log that we replay to disk
5
- * without any model calls. This service parses a Markdown audit file
6
- * emitted by `audit-log-service.ts` back into structured `ReviseAuditEntry`
7
- * records that the CLI's apply-from-audit path can replay.
8
- *
9
- * Parsing is deliberately strict about structure but tolerant of
10
- * whitespace — audit files are written by us and edited by no-one, so we
11
- * can rely on the heading hierarchy and section markers. If a user has
12
- * hand-edited the audit, the parser surfaces specific errors so the user
13
- * can fix or discard the file rather than silently getting bad replays.
14
- *
15
- * Future extension: we may emit a sidecar `.plan.json` next to the
16
- * Markdown audit to carry content hashes and `revisedMarkdown` without
17
- * parsing overhead. The Markdown path remains supported indefinitely —
18
- * older audits predate any sidecar format and still need replay support.
19
- */
20
- import type { ReviseAuditEntry } from '../models/types.js';
21
- export interface ReplayablePlan {
22
- /** Absolute path of the audit file this plan was parsed from. */
23
- sourcePath: string;
24
- /** Scope recorded in the audit header (e.g., "EPIC-001"). */
25
- scope: string;
26
- /** When the dry-run was started, from the audit header. */
27
- startedAt?: string;
28
- /** All entries, preserving original order. Includes skipped/flagged for the summary. */
29
- entries: ReviseAuditEntry[];
30
- }
31
- /**
32
- * Parse a revise Markdown audit log into its constituent entries.
33
- * Throws if the file cannot be read, is empty, or has no entries.
34
- */
35
- export declare function readPlanFromAudit(auditPath: string): ReplayablePlan;
36
- /** Entries that can actually be written on replay (have a diff and target path). */
37
- export declare function filterReplayable(plan: ReplayablePlan): ReviseAuditEntry[];
38
- //# sourceMappingURL=revise-plan-service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"revise-plan-service.d.ts","sourceRoot":"","sources":["../../src/services/revise-plan-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EACV,gBAAgB,EAIjB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wFAAwF;IACxF,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CAuBnE;AAED,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,gBAAgB,EAAE,CAIzE"}