openplanr 3.3.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/cli/commands/artifact-design-share.d.ts +9 -0
  3. package/dist/cli/commands/artifact-design-share.d.ts.map +1 -0
  4. package/dist/cli/commands/artifact-design-share.js +200 -0
  5. package/dist/cli/commands/artifact-design-share.js.map +1 -0
  6. package/dist/cli/commands/artifact.d.ts.map +1 -1
  7. package/dist/cli/commands/artifact.js +5 -18
  8. package/dist/cli/commands/artifact.js.map +1 -1
  9. package/dist/cli/commands/ship.d.ts.map +1 -1
  10. package/dist/cli/commands/ship.js +2 -0
  11. package/dist/cli/commands/ship.js.map +1 -1
  12. package/dist/dashboard/.vite/manifest.json +2 -2
  13. package/dist/dashboard/assets/index-Cv4Vwhuw.css +2 -0
  14. package/dist/dashboard/assets/index-CvQAlBy3.js +75 -0
  15. package/dist/dashboard/assets/index-CvQAlBy3.js.map +1 -0
  16. package/dist/dashboard/dashboard-manifest.json +14 -14
  17. package/dist/dashboard/index.html +2 -2
  18. package/dist/services/design-artifact-service.d.ts +20 -1
  19. package/dist/services/design-artifact-service.d.ts.map +1 -1
  20. package/dist/services/design-artifact-service.js +137 -18
  21. package/dist/services/design-artifact-service.js.map +1 -1
  22. package/dist/services/ship-checks/contract.d.ts +3 -1
  23. package/dist/services/ship-checks/contract.d.ts.map +1 -1
  24. package/dist/services/ship-checks/contract.js +1 -1
  25. package/dist/services/ship-checks/contract.js.map +1 -1
  26. package/dist/services/ship-checks/discover.d.ts.map +1 -1
  27. package/dist/services/ship-checks/discover.js +2 -1
  28. package/dist/services/ship-checks/discover.js.map +1 -1
  29. package/dist/services/ship-checks/package-contents.d.ts +4 -0
  30. package/dist/services/ship-checks/package-contents.d.ts.map +1 -0
  31. package/dist/services/ship-checks/package-contents.js +91 -0
  32. package/dist/services/ship-checks/package-contents.js.map +1 -0
  33. package/dist/services/ship-checks/packages.d.ts +2 -0
  34. package/dist/services/ship-checks/packages.d.ts.map +1 -1
  35. package/dist/services/ship-checks/packages.js +4 -0
  36. package/dist/services/ship-checks/packages.js.map +1 -1
  37. package/dist/services/ship-checks/scope.js +2 -1
  38. package/dist/services/ship-checks/scope.js.map +1 -1
  39. package/dist/utils/splice-managed-block.js +1 -1
  40. package/dist/utils/splice-managed-block.js.map +1 -1
  41. package/docs/CLI.md +38 -1
  42. package/lib/host-packages/adapter-registry.json +5 -5
  43. package/lib/host-packages/capability-map.json +1 -1
  44. package/lib/host-packages/claude/.claude-plugin/marketplace.json +3 -3
  45. package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +6 -6
  46. package/lib/host-packages/claude/openplanr/.openplanr-content.json +67 -123
  47. package/lib/host-packages/claude/openplanr/README.md +12 -12
  48. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/shared/task-context-resolution.md +4 -4
  49. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-artifact-shell.mjs +2 -4
  50. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-document.mjs +26 -26
  51. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-handoff.mjs +850 -56
  52. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-review-state-store.mjs +45 -0
  53. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-review.mjs +65 -74
  54. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -1
  55. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +321 -0
  56. package/lib/host-packages/{openai/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs → claude/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs} +762 -223
  57. package/lib/host-packages/{openai/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs → claude/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-9f6918b0.mjs} +537 -5
  58. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +137 -0
  59. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design.mjs +107 -37
  60. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -27
  61. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +138 -133
  62. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +1 -5684
  63. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +2568 -0
  64. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +10 -74
  65. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
  66. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +8 -2
  67. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +5 -1
  68. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +545 -4781
  69. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design.mjs +219 -452
  70. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +5 -1
  71. package/lib/host-packages/claude/openplanr/skills/delegate/SKILL.md +2 -1
  72. package/lib/host-packages/claude/openplanr/skills/delegate/references/integration-review.md +26 -20
  73. package/lib/host-packages/claude/openplanr/skills/delegate/references/operator-guide.md +25 -1
  74. package/lib/host-packages/claude/openplanr/skills/delegate/references/run-handoff.md +2 -2
  75. package/lib/host-packages/claude/openplanr/skills/delegate/references/worktree-custody.md +17 -9
  76. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/claude.mjs +15 -3
  77. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/codex.mjs +38 -2
  78. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/native.mjs +5 -0
  79. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/custody.mjs +217 -10
  80. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/handoff.mjs +1080 -0
  81. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integrate.mjs +96 -201
  82. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integration-files.mjs +3 -382
  83. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/presentation.mjs +29 -12
  84. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-contract.mjs +11 -0
  85. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-execution.mjs +1 -1
  86. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-lifecycle.mjs +14 -10
  87. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-preparation.mjs +4 -0
  88. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-record.mjs +2 -2
  89. package/lib/host-packages/claude/openplanr/skills/design/references/utilities.md +14 -8
  90. package/lib/host-packages/claude/openplanr/skills/design-loop/references/utilities.md +14 -8
  91. package/lib/host-packages/claude/openplanr/skills/design-review/references/utilities.md +14 -8
  92. package/lib/host-packages/claude/openplanr/skills/investigate/SKILL.md +1 -0
  93. package/lib/host-packages/claude/openplanr/skills/investigate/references/fail-first.md +40 -0
  94. package/lib/host-packages/claude/openplanr/skills/ship/SKILL.md +22 -10
  95. package/lib/host-packages/claude/openplanr/skills/ship/references/fail-first.md +40 -0
  96. package/lib/host-packages/claude/openplanr/skills/ship/references/result-contract.md +7 -3
  97. package/lib/host-packages/cursor/openplanr/.openplanr-content.json +65 -121
  98. package/lib/host-packages/cursor/openplanr/manifest.json +1 -1
  99. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/integration-review.md +26 -20
  100. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/operator-guide.md +25 -1
  101. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/run-handoff.md +2 -2
  102. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/worktree-custody.md +17 -9
  103. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/claude.mjs +15 -3
  104. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/codex.mjs +38 -2
  105. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/native.mjs +5 -0
  106. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/custody.mjs +217 -10
  107. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/handoff.mjs +1080 -0
  108. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integrate.mjs +96 -201
  109. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integration-files.mjs +3 -382
  110. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/presentation.mjs +29 -12
  111. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-contract.mjs +11 -0
  112. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-execution.mjs +1 -1
  113. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-lifecycle.mjs +14 -10
  114. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-preparation.mjs +4 -0
  115. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-record.mjs +2 -2
  116. package/lib/host-packages/cursor/openplanr/rules/planr-delegate.mdc +2 -1
  117. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/utilities.md +14 -8
  118. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/utilities.md +14 -8
  119. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/utilities.md +14 -8
  120. package/lib/host-packages/cursor/openplanr/rules/planr-investigate/references/fail-first.md +40 -0
  121. package/lib/host-packages/cursor/openplanr/rules/planr-investigate.mdc +1 -0
  122. package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/fail-first.md +40 -0
  123. package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/result-contract.md +7 -3
  124. package/lib/host-packages/cursor/openplanr/rules/planr-ship.mdc +22 -10
  125. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-artifact-shell.mjs +2 -4
  126. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-document.mjs +26 -26
  127. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-handoff.mjs +850 -56
  128. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-review-state-store.mjs +45 -0
  129. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-review.mjs +65 -74
  130. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -1
  131. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +321 -0
  132. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/{design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs → design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs} +762 -223
  133. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/{design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs → design-shared-artifact-support-protocol-contracts-9f6918b0.mjs} +537 -5
  134. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +137 -0
  135. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design.mjs +107 -37
  136. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -27
  137. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +138 -133
  138. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +1 -5684
  139. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +2568 -0
  140. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +10 -74
  141. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
  142. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +8 -2
  143. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +5 -1
  144. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +545 -4781
  145. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design.mjs +219 -452
  146. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +5 -1
  147. package/lib/host-packages/openai/.claude-plugin/marketplace.json +3 -3
  148. package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +2 -2
  149. package/lib/host-packages/openai/openplanr/.openplanr-content.json +68 -124
  150. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-artifact-shell.mjs +2 -4
  151. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-document.mjs +26 -26
  152. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-handoff.mjs +850 -56
  153. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-review-state-store.mjs +45 -0
  154. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-review.mjs +65 -74
  155. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -1
  156. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share-cli-bridge.mjs +321 -0
  157. package/lib/host-packages/{claude/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs → openai/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-d707e49b.mjs} +762 -223
  158. package/lib/host-packages/{claude/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs → openai/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-9f6918b0.mjs} +537 -5
  159. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-design-support-0bac378d.mjs +137 -0
  160. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design.mjs +107 -37
  161. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -27
  162. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +138 -133
  163. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +1 -5684
  164. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-artifact-review-ui.js +2568 -0
  165. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +10 -74
  166. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
  167. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +8 -2
  168. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +5 -1
  169. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +545 -4781
  170. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design.mjs +219 -452
  171. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +5 -1
  172. package/lib/host-packages/openai/openplanr/skills/delegate/SKILL.md +2 -1
  173. package/lib/host-packages/openai/openplanr/skills/delegate/openplanr.skill.json +1 -1
  174. package/lib/host-packages/openai/openplanr/skills/delegate/references/integration-review.md +26 -20
  175. package/lib/host-packages/openai/openplanr/skills/delegate/references/operator-guide.md +25 -1
  176. package/lib/host-packages/openai/openplanr/skills/delegate/references/run-handoff.md +2 -2
  177. package/lib/host-packages/openai/openplanr/skills/delegate/references/worktree-custody.md +17 -9
  178. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/claude.mjs +15 -3
  179. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/codex.mjs +38 -2
  180. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/native.mjs +5 -0
  181. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/custody.mjs +217 -10
  182. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/handoff.mjs +1080 -0
  183. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integrate.mjs +96 -201
  184. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integration-files.mjs +3 -382
  185. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/presentation.mjs +29 -12
  186. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-contract.mjs +11 -0
  187. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-execution.mjs +1 -1
  188. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-lifecycle.mjs +14 -10
  189. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-preparation.mjs +4 -0
  190. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-record.mjs +2 -2
  191. package/lib/host-packages/openai/openplanr/skills/design/references/utilities.md +14 -8
  192. package/lib/host-packages/openai/openplanr/skills/design-loop/references/utilities.md +14 -8
  193. package/lib/host-packages/openai/openplanr/skills/design-review/references/utilities.md +14 -8
  194. package/lib/host-packages/openai/openplanr/skills/investigate/SKILL.md +1 -0
  195. package/lib/host-packages/openai/openplanr/skills/investigate/openplanr.skill.json +12 -1
  196. package/lib/host-packages/openai/openplanr/skills/investigate/references/fail-first.md +40 -0
  197. package/lib/host-packages/openai/openplanr/skills/ship/SKILL.md +22 -10
  198. package/lib/host-packages/openai/openplanr/skills/ship/openplanr.skill.json +12 -1
  199. package/lib/host-packages/openai/openplanr/skills/ship/references/fail-first.md +40 -0
  200. package/lib/host-packages/openai/openplanr/skills/ship/references/result-contract.md +7 -3
  201. package/package.json +8 -8
  202. package/dist/dashboard/assets/index-BU5fzjyz.css +0 -1
  203. package/dist/dashboard/assets/index-B_96uzCl.js +0 -572
  204. package/dist/dashboard/assets/index-B_96uzCl.js.map +0 -1
  205. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
  206. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
  207. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
  208. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
  209. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
  210. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-runtime-support-25485dbf1cb2.mjs +0 -24
  211. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
  212. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
  213. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5907
  214. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
  215. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
  216. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
  217. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +0 -1755
  218. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
  219. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +0 -2633
  220. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
  221. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
  222. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
  223. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
  224. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
  225. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integration-transaction.mjs +0 -958
  226. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integration-transaction.mjs +0 -958
  227. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
  228. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
  229. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
  230. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
  231. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
  232. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-runtime-support-25485dbf1cb2.mjs +0 -24
  233. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
  234. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
  235. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5907
  236. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
  237. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
  238. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
  239. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +0 -1755
  240. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
  241. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +0 -2633
  242. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
  243. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
  244. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
  245. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
  246. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
  247. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
  248. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
  249. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
  250. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
  251. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
  252. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-runtime-support-25485dbf1cb2.mjs +0 -24
  253. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
  254. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
  255. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5907
  256. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
  257. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
  258. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
  259. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +0 -1755
  260. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
  261. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +0 -2633
  262. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
  263. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
  264. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
  265. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
  266. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
  267. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integration-transaction.mjs +0 -958
@@ -1,18 +1,8 @@
1
1
  import { execFile as execFileCallback } from 'node:child_process';
2
- import { createHash, randomUUID } from 'node:crypto';
3
- import {
4
- linkSync,
5
- lstatSync,
6
- readFileSync,
7
- readlinkSync,
8
- renameSync,
9
- symlinkSync,
10
- unlinkSync,
11
- } from 'node:fs';
12
- import { chmod, lstat, mkdir, readFile, rename, rm, symlink, writeFile } from 'node:fs/promises';
13
- import { basename, dirname, isAbsolute, relative, resolve, sep } from 'node:path';
2
+ import { lstat } from 'node:fs/promises';
3
+ import { dirname, isAbsolute, resolve, sep } from 'node:path';
14
4
  import { promisify } from 'node:util';
15
- import { captureFileState, gitFileState, headFileState } from './custody.mjs';
5
+ import { captureFileState, headFileState } from './custody.mjs';
16
6
 
17
7
  const execFile = promisify(execFileCallback);
18
8
  const gitOptions = { encoding: 'buffer', maxBuffer: 32 * 1024 * 1024 };
@@ -81,303 +71,6 @@ export async function safeDestination(root, path) {
81
71
  return full;
82
72
  }
83
73
 
84
- export async function putState(root, path, state, suffix, createdDirectories = []) {
85
- const target = await safeDestination(root, path);
86
- if (state.kind === 'absent') {
87
- await rm(target, { force: true });
88
- return;
89
- }
90
- const missing = [];
91
- let directory = dirname(target);
92
- while (directory !== resolve(root)) {
93
- try {
94
- await lstat(directory);
95
- break;
96
- } catch (error) {
97
- if (error.code !== 'ENOENT') throw error;
98
- missing.push(directory);
99
- directory = dirname(directory);
100
- }
101
- }
102
- for (const created of missing.reverse()) {
103
- await mkdir(created);
104
- createdDirectories.push(created);
105
- }
106
- const temporary = `${target}.planr-delegate-${suffix}`;
107
- try {
108
- if (state.kind === 'file') {
109
- await writeFile(temporary, Buffer.from(state.contentBase64, 'base64'), {
110
- mode: 0o600,
111
- flag: 'wx',
112
- });
113
- await chmod(temporary, state.mode);
114
- } else if (state.kind === 'symlink') {
115
- if (
116
- isAbsolute(state.target) ||
117
- !resolve(dirname(target), state.target).startsWith(`${resolve(root)}${sep}`)
118
- )
119
- throw new IntegrationError('E_INTEGRATION_LINK', 'Delegate symlink target is unsafe.', {
120
- path,
121
- });
122
- await symlink(state.target, temporary);
123
- } else throw new IntegrationError('E_INTEGRATION_STATE', 'Unsupported file state.', { path });
124
- await rename(temporary, target);
125
- } finally {
126
- await rm(temporary, { force: true });
127
- }
128
- }
129
-
130
- export function retainedEntryState(file) {
131
- try {
132
- const info = lstatSync(file);
133
- if (info.isSymbolicLink())
134
- return { kind: 'symlink', mode: info.mode & 0o777, target: readlinkSync(file) };
135
- if (!info.isFile())
136
- throw new IntegrationError('E_INTEGRATION_STATE', 'Destination is not a file.', {
137
- path: file,
138
- });
139
- return {
140
- kind: 'file',
141
- mode: info.mode & 0o777,
142
- contentBase64: readFileSync(file).toString('base64'),
143
- };
144
- } catch (error) {
145
- if (error.code === 'ENOENT') return { kind: 'absent' };
146
- throw error;
147
- }
148
- }
149
-
150
- const LOCAL_CUSTODY = '.planr-delegate-write-custody';
151
-
152
- async function privateDirectory(path, create = true) {
153
- if (create)
154
- await mkdir(path, { mode: 0o700 }).catch((error) => {
155
- if (error.code !== 'EEXIST') throw error;
156
- });
157
- const info = await lstat(path);
158
- if (
159
- !info.isDirectory() ||
160
- info.isSymbolicLink() ||
161
- (info.mode & 0o077) !== 0 ||
162
- (process.getuid && info.uid !== process.getuid())
163
- )
164
- throw new IntegrationError(
165
- 'E_INTEGRATION_CUSTODY',
166
- 'Write custody is not a private directory.',
167
- );
168
- }
169
-
170
- // Git metadata can be on another volume. Keep claims and staging beside the
171
- // destination in that case, and save the location before the first source write.
172
- async function writeCustody(root, target, suffix, create = true) {
173
- if (basename(safePath(suffix)) !== suffix)
174
- throw new IntegrationError('E_INTEGRATION_CUSTODY', 'Invalid write custody identifier.');
175
- const gitDirectory = (await git(root, 'rev-parse', '--absolute-git-dir')).toString('utf8').trim();
176
- const base = resolve(gitDirectory, 'planr-delegate-write-custody');
177
- const metadata = resolve(base, suffix);
178
- for (const directory of [base, metadata]) {
179
- try {
180
- await privateDirectory(directory, false);
181
- } catch (error) {
182
- if (error.code !== 'ENOENT') throw error;
183
- }
184
- }
185
- const reference = resolve(metadata, 'location.json');
186
- let location;
187
- try {
188
- location = JSON.parse(await readFile(reference, 'utf8'));
189
- } catch (error) {
190
- if (error.code !== 'ENOENT') throw error;
191
- }
192
- if (location) {
193
- const directory = await safeDestination(root, location.path);
194
- const anchor = dirname(dirname(directory));
195
- if (
196
- basename(directory) !== suffix ||
197
- basename(dirname(directory)) !== LOCAL_CUSTODY ||
198
- !target.startsWith(`${anchor}${sep}`)
199
- )
200
- throw new IntegrationError('E_INTEGRATION_CUSTODY', 'Write custody location changed.');
201
- await privateDirectory(dirname(directory), false);
202
- await privateDirectory(directory, false);
203
- return directory;
204
- }
205
- if (!create) return metadata;
206
- await privateDirectory(base);
207
- await privateDirectory(metadata);
208
- let anchor = dirname(target);
209
- let info;
210
- for (;;) {
211
- try {
212
- info = await lstat(anchor);
213
- break;
214
- } catch (error) {
215
- if (error.code !== 'ENOENT') throw error;
216
- anchor = dirname(anchor);
217
- }
218
- }
219
- if (info.dev === (await lstat(gitDirectory)).dev) return metadata;
220
- const local = resolve(anchor, LOCAL_CUSTODY);
221
- await privateDirectory(local);
222
- const ignore = resolve(local, '.gitignore');
223
- try {
224
- await writeFile(ignore, '*\n', { flag: 'wx', mode: 0o600 });
225
- } catch (error) {
226
- if (error.code !== 'EEXIST' || (await readFile(ignore, 'utf8')) !== '*\n') throw error;
227
- }
228
- const directory = resolve(local, suffix);
229
- await privateDirectory(directory);
230
- await writeFile(reference, JSON.stringify({ path: relative(root, directory) }), {
231
- flag: 'wx',
232
- mode: 0o600,
233
- });
234
- return directory;
235
- }
236
-
237
- function parentEntries(root, target) {
238
- const entries = [];
239
- for (let path = dirname(target); ; path = dirname(path)) {
240
- const info = lstatSync(path);
241
- if (!info.isDirectory() || info.isSymbolicLink())
242
- throw new IntegrationError(
243
- 'E_INTEGRATION_PATH',
244
- 'Destination parent is not a real directory.',
245
- );
246
- entries.push({ path, dev: info.dev, ino: info.ino });
247
- if (path === resolve(root)) return entries;
248
- }
249
- }
250
-
251
- function assertParentEntries(entries) {
252
- for (const entry of entries) {
253
- const info = lstatSync(entry.path);
254
- if (
255
- !info.isDirectory() ||
256
- info.isSymbolicLink() ||
257
- info.dev !== entry.dev ||
258
- info.ino !== entry.ino
259
- )
260
- throw new IntegrationError(
261
- 'E_INTEGRATION_SOURCE_DRIFT',
262
- 'Destination parent changed during integration.',
263
- { path: entry.path },
264
- );
265
- }
266
- }
267
-
268
- // Claim the current directory entry, inspect the claimed bytes, then publish with
269
- // exclusive link creation. A concurrent replacement is never overwritten. Claimed
270
- // entries remain private for crash recovery and for writers holding the old inode.
271
- export async function putStateGuarded(
272
- root,
273
- path,
274
- state,
275
- expected,
276
- suffix,
277
- createdDirectories = [],
278
- ) {
279
- const target = await safeDestination(root, path);
280
- const custody = await writeCustody(root, target, suffix);
281
- const key = createHash('sha256').update(path).digest('hex');
282
- const claimed = resolve(custody, `${key}.before`);
283
- const staged = `${key}.after-${randomUUID()}`;
284
- await assertSafeChanges(root, [{ path, after: state }]);
285
- if (state.kind === 'file') {
286
- await writeFile(resolve(custody, staged), Buffer.from(state.contentBase64, 'base64'), {
287
- flag: 'wx',
288
- mode: 0o600,
289
- });
290
- await chmod(resolve(custody, staged), state.mode);
291
- } else if (state.kind === 'symlink') await symlink(state.target, resolve(custody, staged));
292
- const missing = [];
293
- let directory = dirname(target);
294
- while (directory !== resolve(root)) {
295
- try {
296
- await lstat(directory);
297
- break;
298
- } catch (error) {
299
- if (error.code !== 'ENOENT') throw error;
300
- missing.push(directory);
301
- directory = dirname(directory);
302
- }
303
- }
304
- for (const created of missing.reverse()) {
305
- await mkdir(created);
306
- createdDirectories.push(created);
307
- }
308
- const parents = parentEntries(root, target);
309
- let moved = false;
310
- let published = false;
311
- try {
312
- if (expected.kind !== 'absent') {
313
- try {
314
- if (retainedEntryState(claimed).kind === 'absent') renameSync(target, claimed);
315
- moved = true;
316
- } catch (error) {
317
- if (error.code !== 'ENOENT') throw error;
318
- }
319
- if (!moved || !sameState(retainedEntryState(claimed), expected))
320
- throw new IntegrationError(
321
- 'E_INTEGRATION_SOURCE_DRIFT',
322
- 'Destination changed before its write was claimed.',
323
- { path, retainedPath: moved ? claimed : null },
324
- );
325
- }
326
- assertParentEntries(parents);
327
- // link is atomic and fails if an editor created a replacement during the claim.
328
- if (state.kind !== 'absent') {
329
- if (state.kind === 'symlink') symlinkSync(state.target, target);
330
- else linkSync(resolve(custody, staged), target);
331
- published = true;
332
- } else if (retainedEntryState(target).kind !== 'absent')
333
- throw new IntegrationError(
334
- 'E_INTEGRATION_SOURCE_DRIFT',
335
- 'A concurrent replacement blocks deletion.',
336
- { path, retainedPath: claimed },
337
- );
338
- assertParentEntries(parents);
339
- if (moved && !sameState(retainedEntryState(claimed), expected))
340
- throw new IntegrationError(
341
- 'E_INTEGRATION_SOURCE_DRIFT',
342
- 'A writer changed the claimed original; retained for recovery.',
343
- { path, retainedPath: claimed },
344
- );
345
- return moved ? claimed : null;
346
- } catch (error) {
347
- if (published)
348
- error.details = { ...error.details, published: true, path, retainedPath: claimed };
349
- if (moved) {
350
- // Restore exclusively: an owner's replacement always takes precedence.
351
- try {
352
- assertParentEntries(parents);
353
- const original = retainedEntryState(claimed);
354
- if (original.kind === 'symlink') symlinkSync(original.target, target);
355
- else linkSync(claimed, target);
356
- } catch (restoreError) {
357
- if (restoreError.code !== 'EEXIST')
358
- error.details = { ...error.details, restoreCode: restoreError.code };
359
- }
360
- }
361
- if (error.code === 'EEXIST')
362
- throw new IntegrationError(
363
- 'E_INTEGRATION_SOURCE_DRIFT',
364
- 'A concurrent destination was preserved.',
365
- { path, retainedPath: moved ? claimed : null },
366
- );
367
- throw error;
368
- } finally {
369
- if (state.kind !== 'absent') {
370
- try {
371
- unlinkSync(resolve(custody, staged));
372
- } catch (error) {
373
- // Staging is private and recoverable; cleanup failure must not replace a write conflict.
374
- if (error.code !== 'ENOENT')
375
- process.emitWarning(`Private write staging cleanup failed: ${error.code}`);
376
- }
377
- }
378
- }
379
- }
380
-
381
74
  export async function workingPaths(root) {
382
75
  const [tracked, untracked] = await Promise.all([
383
76
  git(root, 'diff', '--name-only', '-z', 'HEAD'),
@@ -426,75 +119,3 @@ export async function assertSafeChanges(root, changes) {
426
119
  });
427
120
  }
428
121
  }
429
-
430
- export async function rollbackWritten(root, changes, suffix) {
431
- const errors = [];
432
- for (const change of [...changes].reverse()) {
433
- try {
434
- const current = await captureFileState(root, change.path);
435
- if (sameState(current, change.sourceBefore)) continue;
436
- let claimed;
437
- if (change.writeId) {
438
- const target = await safeDestination(root, change.path);
439
- const directory = await writeCustody(root, target, change.writeId, false);
440
- const file = `${createHash('sha256').update(change.path).digest('hex')}.before`;
441
- claimed = retainedEntryState(resolve(directory, file));
442
- if (claimed.kind !== 'absent' && !sameState(claimed, change.sourceBefore)) {
443
- errors.push({
444
- path: change.path,
445
- retainedPath: resolve(directory, file),
446
- code: 'E_INTEGRATION_ROLLBACK_CONFLICT',
447
- });
448
- continue;
449
- }
450
- }
451
- if (
452
- current.kind === 'absent' &&
453
- claimed?.kind !== 'absent' &&
454
- claimed &&
455
- sameState(claimed, change.sourceBefore)
456
- ) {
457
- await putStateGuarded(
458
- root,
459
- change.path,
460
- change.sourceBefore,
461
- current,
462
- `${suffix}-interrupted`,
463
- );
464
- continue;
465
- }
466
- if (!sameState(current, change.after)) {
467
- errors.push({ path: change.path, code: 'E_INTEGRATION_ROLLBACK_CONFLICT' });
468
- continue;
469
- }
470
- await putStateGuarded(
471
- root,
472
- change.path,
473
- change.sourceBefore,
474
- change.after,
475
- change.writeId ? `${change.writeId}-rollback` : `${suffix}-rollback`,
476
- );
477
- } catch (error) {
478
- errors.push({ path: change.path, code: error.code ?? 'E_INTEGRATION_ROLLBACK' });
479
- }
480
- }
481
- return errors;
482
- }
483
-
484
- export async function treeIdentity(root, overrides = new Map()) {
485
- const paths = new Set(
486
- (await git(root, 'ls-files', '-z', '--cached', '--others', '--exclude-standard'))
487
- .toString('utf8')
488
- .split('\0')
489
- .filter(Boolean),
490
- );
491
- for (const path of overrides.keys()) paths.add(path);
492
- const hash = createHash('sha256');
493
- for (const path of [...paths].sort()) {
494
- const state = overrides.get(path) ?? (await captureFileState(root, safePath(path)));
495
- const logical = await gitFileState(root, path, state);
496
- if (logical.kind !== 'absent')
497
- hash.update(path).update('\0').update(JSON.stringify(logical)).update('\0');
498
- }
499
- return hash.digest('hex');
500
- }
@@ -94,6 +94,16 @@ export function handoffPresentation(outcome) {
94
94
  };
95
95
  }
96
96
 
97
+ function warningText({ refs, omitted }) {
98
+ return `Refs changed outside this run (not blocking): ${refs.join(', ')}${omitted ? ` and ${omitted} more` : ''}`;
99
+ }
100
+
101
+ function violationText({ code, path, ref, change, omitted }) {
102
+ if (omitted) return `${code}: ${omitted} more path(s)`;
103
+ if (!path) return ref ? `${code}: ${ref}` : code;
104
+ return change ? `${code}: ${path} (${change})` : `${code}: ${path}`;
105
+ }
106
+
97
107
  export function reviewPresentation(review) {
98
108
  return {
99
109
  phase: 'review',
@@ -102,7 +112,8 @@ export function reviewPresentation(review) {
102
112
  ? `${review.changedPaths.length} observed file change(s) ready for human review; nothing has been integrated.`
103
113
  : 'Observed changes require attention before integration.',
104
114
  changed: visiblePaths(review.changedPaths),
105
- violations: review.violations.map(({ code, path }) => (path ? `${code}: ${path}` : code)),
115
+ violations: review.violations.map(violationText),
116
+ warnings: (review.warnings ?? []).map(warningText),
106
117
  nextAction: review.ready
107
118
  ? 'Inspect the retained worktree patch and then call apply with the same scope.'
108
119
  : 'Resolve the violations in the retained worktree or source before retrying.',
@@ -121,7 +132,8 @@ export function implementationReport(result, selector) {
121
132
  ...(result.cleanup?.status === 'failed'
122
133
  ? ['Owned worktree cleanup failed; integration remains accepted']
123
134
  : []),
124
- ...(result.violations ?? []).map(({ code, path }) => (path ? `${code}: ${path}` : code)),
135
+ ...(result.violations ?? []).map(violationText),
136
+ ...(result.warnings ?? []).map(warningText),
125
137
  ...(result.code ? [result.code] : []),
126
138
  ...failed.map(({ command, status, exitCode, timeoutMs, classification }) =>
127
139
  status === 'timed-out'
@@ -136,6 +148,10 @@ export function implementationReport(result, selector) {
136
148
  ]
137
149
  : []),
138
150
  ];
151
+ const unselected = result.unselectedDirtyPaths ?? [];
152
+ const unselectedNote = unselected.length
153
+ ? ` Checks did not include ${result.unselectedDirtyCount ?? unselected.length} unselected local change(s): ${visiblePaths(unselected)}.`
154
+ : '';
139
155
  return {
140
156
  Outcome: accepted
141
157
  ? paths.length
@@ -146,16 +162,17 @@ export function implementationReport(result, selector) {
146
162
  Changed: paths.length
147
163
  ? `${paths.length} observed file(s) ${accepted ? 'integrated' : 'not accepted'}: ${visiblePaths(paths)}`
148
164
  : 'No observed file changes.',
149
- Checks: checks.length
150
- ? `${checks.filter(({ status }) => status === 'passed').length}/${checks.length} independent check(s) passed: ${checks
151
- .map(
152
- ({ command, status, durationMs }) =>
153
- `${command} (${status}${
154
- durationMs === undefined ? '' : `, ${(durationMs / 1000).toFixed(1)}s`
155
- })`,
156
- )
157
- .join(', ')}`
158
- : 'No independent checks ran; verification remains unconfirmed.',
165
+ Checks:
166
+ (checks.length
167
+ ? `${checks.filter(({ status }) => status === 'passed').length}/${checks.length} independent check(s) passed: ${checks
168
+ .map(
169
+ ({ command, status, durationMs }) =>
170
+ `${command} (${status}${
171
+ durationMs === undefined ? '' : `, ${(durationMs / 1000).toFixed(1)}s`
172
+ })`,
173
+ )
174
+ .join(', ')}${unselectedNote ? '.' : ''}`
175
+ : 'No independent checks ran; verification remains unconfirmed.') + unselectedNote,
159
176
  Issues: issues.length
160
177
  ? `${issues.join('; ')}.${accepted ? '' : ` ${result.nextAction ?? ''}`}`.trim()
161
178
  : 'None found in this review.',
@@ -55,6 +55,17 @@ export function integrationPaths(paths) {
55
55
  'E_DELEGATE_SCOPE',
56
56
  'Integration paths must be safe repository-relative paths.',
57
57
  );
58
+ // Scope entries are literal prefixes; a glob would only fail later at review.
59
+ const parts = path.split('/');
60
+ const glob = parts.findIndex((part) => /[*?]/u.test(part));
61
+ if (glob !== -1) {
62
+ throw new DelegateRunError(
63
+ 'E_DELEGATE_SCOPE',
64
+ glob > 0
65
+ ? `Integration paths are literal path prefixes, not globs; use "${parts.slice(0, glob).join('/')}" instead of "${path}".`
66
+ : `Integration paths are literal path prefixes, not globs; list the files or directories "${path}" should cover.`,
67
+ );
68
+ }
58
69
  return path;
59
70
  }),
60
71
  ),
@@ -42,7 +42,7 @@ const SAFE_ADAPTER_DIAGNOSTICS = Object.freeze({
42
42
  E_ADAPTER_PROCESS_IDENTITY:
43
43
  'Process identity inspection is unavailable. Restore normal host process inspection before retrying; native permissions were not changed.',
44
44
  E_ADAPTER_PERMISSION:
45
- 'Native permission needs attention. Resolve it in the native configuration, then continue this exact session; permissions are never weakened automatically.',
45
+ 'Native permission needs attention. Resolve it in the native configuration, then continue this exact session; permissions are never bypassed automatically.',
46
46
  E_ADAPTER_RESULT:
47
47
  'Native execution ended without terminal evidence; inspect the exact session and retained worktree.',
48
48
  E_ADAPTER_MODEL_TEMPLATE:
@@ -5,7 +5,7 @@ import { basename, dirname, join } from 'node:path';
5
5
  import { setTimeout as delay } from 'node:timers/promises';
6
6
  import { terminateProcessGroup } from './adapters/generic.mjs';
7
7
  import { captureFileState, cleanupWorktreeCustody, validateWorktreeCustody } from './custody.mjs';
8
- import { git, treeIdentity } from './integration-files.mjs';
8
+ import { git } from './integration-files.mjs';
9
9
  import {
10
10
  implementationReport,
11
11
  liveExecutionTiming,
@@ -118,8 +118,13 @@ async function initialAbandonmentInventory(record, custody) {
118
118
  (record.initialIndex && record.initialIndex !== custody.initialIndex)
119
119
  )
120
120
  throw abandonError(record, 'The initial worktree HEAD, index or protected contents changed.');
121
+ if (
122
+ custody.base &&
123
+ (await git(target, 'rev-parse', 'HEAD')).toString('utf8').trim() !== custody.base
124
+ )
125
+ throw abandonError(record, 'The run branch advanced past its base commit.');
121
126
  const entries = new Map(
122
- (await git(target, 'ls-tree', '-r', '-z', custody.initialHead))
127
+ (await git(target, 'ls-tree', '-r', '-z', custody.base ?? custody.initialHead))
123
128
  .toString('utf8')
124
129
  .split('\0')
125
130
  .filter(Boolean)
@@ -338,6 +343,12 @@ export async function recoverDelegateRun({ runId, runDirectory = defaultRunDirec
338
343
  });
339
344
  }
340
345
 
346
+ async function worktreeAtTip(target, tip) {
347
+ const head = (await git(target, 'rev-parse', 'HEAD')).toString('utf8').trim();
348
+ const status = await git(target, 'status', '--porcelain=v1', '-z', '--untracked-files=all');
349
+ return head === tip && status.length === 0;
350
+ }
351
+
341
352
  export async function cleanupAcceptedWorktree(record, runDirectory) {
342
353
  if (record.cleanup?.status === 'removed') return record.cleanup;
343
354
  const disposition = record.disposition === 'integrated' ? 'accepted' : 'abandoned';
@@ -357,11 +368,7 @@ export async function cleanupAcceptedWorktree(record, runDirectory) {
357
368
  beforeRemove: async (target) => {
358
369
  if (unstarted)
359
370
  await assertUnchangedAbandonment(record, await custodyAt(record, runDirectory));
360
- if (
361
- record.nativeSelection &&
362
- record.integration?.worktreeIdentity &&
363
- (await treeIdentity(target)) !== record.integration.worktreeIdentity
364
- )
371
+ if (record.integration?.tip && !(await worktreeAtTip(target, record.integration.tip)))
365
372
  throw new DelegateRunError(
366
373
  'E_DELEGATE_CLEANUP_DRIFT',
367
374
  'Owned worktree changed after acceptance; retain it for inspection.',
@@ -450,9 +457,6 @@ export async function delegateRunStatus({ runId, runDirectory = defaultRunDirect
450
457
  ? {
451
458
  status: record.integration.status,
452
459
  phase: record.integration.phase,
453
- journalPath: record.integration.journalPath,
454
- cursor: record.integration.cursor,
455
- pendingPath: record.integration.pendingPath,
456
460
  nextAction: `Run node ${record.helper?.integrationPath ?? 'integrate.mjs'} recover with this run ID and resolution rollback (default) or accept after verifying every written path.`,
457
461
  }
458
462
  : null,
@@ -273,6 +273,8 @@ export async function prepareDelegateRun({
273
273
  worktreeParent: custodyParent,
274
274
  runId,
275
275
  native: prepared.profile.kind !== 'generic',
276
+ branch: true,
277
+ runDirectory: privateDirectory,
276
278
  });
277
279
  const custodyPath = join(runPath, 'custody.json');
278
280
  await updateRunRecord(
@@ -282,6 +284,8 @@ export async function prepareDelegateRun({
282
284
  worktreePath: custody.worktreePath,
283
285
  initialHead: custody.initialHead,
284
286
  initialIndex: custody.initialIndex,
287
+ branch: custody.branch,
288
+ base: custody.base,
285
289
  },
286
290
  { directory: privateDirectory },
287
291
  );
@@ -17,7 +17,7 @@ import { promisify } from 'node:util';
17
17
  import { CREDENTIAL_FORMAT } from './credentials.mjs';
18
18
  import { captureFileState } from './custody.mjs';
19
19
 
20
- export const RUN_RECORD_SCHEMA_VERSION = '2.0.0';
20
+ export const RUN_RECORD_SCHEMA_VERSION = '3.0.0';
21
21
  export const MAX_RUN_RECORD_BYTES = 64 * 1024;
22
22
  export const CLOSED_RETENTION_MS = 30 * 24 * 60 * 60 * 1000;
23
23
 
@@ -64,7 +64,7 @@ function encoded(record) {
64
64
  if (
65
65
  !record ||
66
66
  record.kind !== 'openplanr-delegation-run' ||
67
- !['1.0.0', RUN_RECORD_SCHEMA_VERSION].includes(record.schemaVersion) ||
67
+ !['1.0.0', '2.0.0', RUN_RECORD_SCHEMA_VERSION].includes(record.schemaVersion) ||
68
68
  !RUN_ID.test(record.runId ?? '')
69
69
  ) {
70
70
  throw new RunRecordError('E_RUN_FORMAT', 'Invalid delegated run record.');
@@ -67,7 +67,8 @@ digest-acceptance step or permanently frozen setup baseline. See
67
67
 
68
68
  Use the returned pinned helper for subsequent actions. `dispatch`, bounded `wait`
69
69
  and `status` expose the exact session, native progress, inactivity and phase timings.
70
- Native tools, permissions, configuration and implementation loops remain native.
70
+ Native tools, permissions, configuration and implementation loops remain native, except
71
+ that Claude Code or Codex with no configured permission mode starts in its edit mode.
71
72
  Do not add bypass/force/yolo flags, blanket tool exclusions or silent model fallbacks.
72
73
  Local backend probes are compatibility diagnostics, not a separate execution policy.
73
74
  They read model metadata without submitting inference, loading models or sending
@@ -2,8 +2,10 @@
2
2
 
3
3
  Run the linked design helper from the skill entrypoint relative to the skill's
4
4
  directory. It contains deterministic operations and all required assets. It needs
5
- Node.js 22.13 or later, with no global CLI or provider credentials. Only `fonts fetch`
6
- downloads anything, and only when run; nothing is fetched when a design opens.
5
+ Node.js 22.13 or later, with no provider credentials. Local design work needs no global
6
+ CLI. Sharing a design for company review runs in the `openplanr` CLI, which holds the
7
+ owner keys. Only `fonts fetch` downloads anything, and only when run; nothing is
8
+ fetched when a design opens.
7
9
  Use `--help` to inspect the installed command interface before writing documents
8
10
  or invoking operations; the installed contract is authoritative.
9
11
 
@@ -108,12 +110,16 @@ The design remains accessible when the local machine is offline. Owner authority
108
110
  saves automatically in a protected user-level file outside the project; recovery
109
111
  export is optional. Only copy the reviewer token through the explicit Share controls.
110
112
 
111
- The bundled utility supports `share`, `publish`, and `sync` with the same design
112
- document argument. `share` creates or retries a review, `publish` sends an explicitly
113
- requested new revision to the existing URL, and `sync` retrieves authenticated
114
- feedback. Run `--help` for access-management and recovery options. The public CLI
115
- equivalents are `openplanr artifact share`, `openplanr artifact publish`, and
116
- `openplanr artifact sync`. No global CLI is required for the bundled helper.
113
+ Sharing needs the OpenPlanr CLI (`npm install -g openplanr`). The bundled utility's
114
+ `share`, `publish`, `sync` and `manage` commands, the studio's Share dialog, and handoff
115
+ decisions on a shared design all run `openplanr artifact` for the network step, so the
116
+ helper itself reads no owner keys. `share` creates or retries a review, `publish` sends
117
+ an explicitly requested new revision to the existing URL, and `sync` retrieves
118
+ authenticated feedback. You can also run the CLI directly: `openplanr artifact share`,
119
+ `publish`, `sync`, `status`, `manage`, `feedback` and `handoff`. Without the CLI,
120
+ sharing commands stop with `E_DESIGN_SHARE_CLI_REQUIRED`, and feedback inspection
121
+ still works but reports that sync was skipped. A helper and CLI with different sharing
122
+ formats refuse with `E_DESIGN_SHARE_RUNTIME_MISMATCH`; update whichever is older.
117
123
 
118
124
  Retention is until the owner revokes or deletes the review, while the service is
119
125
  maintained. The owner can pause comments and rotate access tokens. Rotation blocks