openplanr 2.2641.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +1 -1
  3. package/dist/cli/commands/artifact.js +1 -1
  4. package/dist/cli/commands/artifact.js.map +1 -1
  5. package/dist/cli/commands/doctor.d.ts.map +1 -1
  6. package/dist/cli/commands/doctor.js +19 -4
  7. package/dist/cli/commands/doctor.js.map +1 -1
  8. package/dist/cli/commands/github.d.ts.map +1 -1
  9. package/dist/cli/commands/github.js +7 -10
  10. package/dist/cli/commands/github.js.map +1 -1
  11. package/dist/cli/commands/linear.js +1 -1
  12. package/dist/cli/commands/linear.js.map +1 -1
  13. package/dist/cli/commands/report.d.ts.map +1 -1
  14. package/dist/cli/commands/report.js +28 -32
  15. package/dist/cli/commands/report.js.map +1 -1
  16. package/dist/cli/commands/upgrade.d.ts.map +1 -1
  17. package/dist/cli/commands/upgrade.js +12 -10
  18. package/dist/cli/commands/upgrade.js.map +1 -1
  19. package/dist/cli/error-boundary.d.ts.map +1 -1
  20. package/dist/cli/error-boundary.js +2 -1
  21. package/dist/cli/error-boundary.js.map +1 -1
  22. package/dist/dashboard/.vite/manifest.json +1 -1
  23. package/dist/dashboard/assets/{index-DGyC7RDz.js → index-Csby7_ur.js} +2 -2
  24. package/dist/dashboard/assets/{index-DGyC7RDz.js.map → index-Csby7_ur.js.map} +1 -1
  25. package/dist/dashboard/dashboard-manifest.json +8 -8
  26. package/dist/dashboard/index.html +1 -1
  27. package/dist/models/schema.d.ts +0 -4
  28. package/dist/models/schema.d.ts.map +1 -1
  29. package/dist/models/schema.js +0 -2
  30. package/dist/models/schema.js.map +1 -1
  31. package/dist/models/types.d.ts +1 -4
  32. package/dist/models/types.d.ts.map +1 -1
  33. package/dist/services/credentials-service.js +1 -1
  34. package/dist/services/credentials-service.js.map +1 -1
  35. package/dist/services/distribution-service.d.ts +1 -4
  36. package/dist/services/distribution-service.d.ts.map +1 -1
  37. package/dist/services/distribution-service.js +1 -60
  38. package/dist/services/distribution-service.js.map +1 -1
  39. package/dist/services/github-service.d.ts +7 -4
  40. package/dist/services/github-service.d.ts.map +1 -1
  41. package/dist/services/github-service.js +16 -15
  42. package/dist/services/github-service.js.map +1 -1
  43. package/dist/services/linear-push-service.d.ts +3 -4
  44. package/dist/services/linear-push-service.d.ts.map +1 -1
  45. package/dist/services/linear-push-service.js +5 -6
  46. package/dist/services/linear-push-service.js.map +1 -1
  47. package/dist/services/runtime-change-summary.d.ts +4 -0
  48. package/dist/services/runtime-change-summary.d.ts.map +1 -1
  49. package/dist/services/runtime-change-summary.js +7 -0
  50. package/dist/services/runtime-change-summary.js.map +1 -1
  51. package/dist/services/runtime-manager/doctor.js +1 -1
  52. package/dist/services/runtime-manager/doctor.js.map +1 -1
  53. package/dist/services/runtime-manager/runtime-package.d.ts +15 -0
  54. package/dist/services/runtime-manager/runtime-package.d.ts.map +1 -1
  55. package/dist/services/runtime-manager/runtime-package.js +50 -10
  56. package/dist/services/runtime-manager/runtime-package.js.map +1 -1
  57. package/dist/services/runtime-manager-service.d.ts +11 -0
  58. package/dist/services/runtime-manager-service.d.ts.map +1 -1
  59. package/dist/services/runtime-manager-service.js +88 -16
  60. package/dist/services/runtime-manager-service.js.map +1 -1
  61. package/dist/services/spec-service.d.ts.map +1 -1
  62. package/dist/services/spec-service.js +34 -69
  63. package/dist/services/spec-service.js.map +1 -1
  64. package/dist/services/upgrade-report.d.ts +2 -2
  65. package/dist/services/upgrade-report.d.ts.map +1 -1
  66. package/dist/services/upgrade-report.js +11 -2
  67. package/dist/services/upgrade-report.js.map +1 -1
  68. package/dist/services/upgrade-service.d.ts +8 -2
  69. package/dist/services/upgrade-service.d.ts.map +1 -1
  70. package/dist/services/upgrade-service.js +44 -12
  71. package/dist/services/upgrade-service.js.map +1 -1
  72. package/dist/templates/rules/shared/capability-map.md.hbs +1 -1
  73. package/docs/CLI.md +14 -15
  74. package/docs/TROUBLESHOOTING.md +9 -6
  75. package/install.ps1 +3 -3
  76. package/install.sh +3 -3
  77. package/lib/host-packages/adapter-registry.json +5 -5
  78. package/lib/host-packages/capability-map.json +8 -8
  79. package/lib/host-packages/claude/.claude-plugin/marketplace.json +2 -2
  80. package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +2 -2
  81. package/lib/host-packages/claude/openplanr/.openplanr-content.json +91 -75
  82. package/lib/host-packages/claude/openplanr/README.md +8 -12
  83. package/lib/host-packages/claude/openplanr/agents/planr-backend.md +49 -55
  84. package/lib/host-packages/claude/openplanr/agents/planr-database.md +56 -92
  85. package/lib/host-packages/claude/openplanr/agents/planr-designer.md +35 -51
  86. package/lib/host-packages/claude/openplanr/agents/planr-devops.md +37 -51
  87. package/lib/host-packages/claude/openplanr/agents/planr-documentation.md +29 -52
  88. package/lib/host-packages/claude/openplanr/agents/planr-entity-scaffold.md +24 -23
  89. package/lib/host-packages/claude/openplanr/agents/planr-frontend.md +46 -58
  90. package/lib/host-packages/claude/openplanr/agents/planr-qa.md +4 -2
  91. package/lib/host-packages/claude/openplanr/agents/planr-specification.md +54 -51
  92. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/default/backend.md +21 -65
  93. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/default/designer.md +5 -6
  94. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/default/devops.md +2 -3
  95. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/default/doc-gen.md +3 -4
  96. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/default/frontend.md +19 -64
  97. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/default/specification.md +10 -12
  98. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/spec-driven/backend.md +19 -62
  99. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/spec-driven/designer.md +3 -4
  100. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/spec-driven/devops.md +2 -3
  101. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/spec-driven/doc-gen.md +2 -3
  102. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/spec-driven/frontend.md +16 -59
  103. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/spec-driven/specification.md +9 -11
  104. package/lib/host-packages/claude/openplanr/references/pipeline/stacks/database/mongodb.md +4 -4
  105. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-review.mjs +24 -9
  106. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share.mjs +3 -3
  107. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
  108. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/package.json +4 -4
  109. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/enhancements.css +14 -4
  110. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +1 -1
  111. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +14 -5
  112. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-design-review-experience.js +28 -0
  113. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-studio-shell.js +105 -27
  114. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +6 -6
  115. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +2 -2
  116. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design.mjs +1 -1
  117. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +2 -2
  118. package/lib/host-packages/claude/openplanr/skills/artifact/SKILL.md +2 -2
  119. package/lib/host-packages/claude/openplanr/skills/artifact/references/diagram-sharing.md +1 -1
  120. package/lib/host-packages/claude/openplanr/skills/ceo-review/SKILL.md +0 -1
  121. package/lib/host-packages/claude/openplanr/skills/ceo-review/references/operate-advisor-contract.md +25 -4
  122. package/lib/host-packages/claude/openplanr/skills/chair-review/SKILL.md +6 -2
  123. package/lib/host-packages/claude/openplanr/skills/challenger-review/SKILL.md +6 -2
  124. package/lib/host-packages/claude/openplanr/skills/cmo-review/SKILL.md +0 -1
  125. package/lib/host-packages/claude/openplanr/skills/cmo-review/references/operate-advisor-contract.md +25 -4
  126. package/lib/host-packages/claude/openplanr/skills/coo-review/SKILL.md +0 -1
  127. package/lib/host-packages/claude/openplanr/skills/coo-review/references/operate-advisor-contract.md +25 -4
  128. package/lib/host-packages/claude/openplanr/skills/cpo-review/SKILL.md +0 -1
  129. package/lib/host-packages/claude/openplanr/skills/cpo-review/references/operate-advisor-contract.md +25 -4
  130. package/lib/host-packages/claude/openplanr/skills/cto-review/SKILL.md +0 -1
  131. package/lib/host-packages/claude/openplanr/skills/cto-review/references/operate-advisor-contract.md +25 -4
  132. package/lib/host-packages/claude/openplanr/skills/delegate/SKILL.md +8 -1
  133. package/lib/host-packages/claude/openplanr/skills/delegate/references/capsule-contract.md +17 -2
  134. package/lib/host-packages/claude/openplanr/skills/delegate/references/operator-guide.md +7 -5
  135. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/claude.mjs +11 -4
  136. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/native.mjs +1 -1
  137. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/backend-diagnostics.mjs +14 -48
  138. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/context.mjs +84 -22
  139. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/credentials.mjs +167 -0
  140. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/presentation.mjs +3 -2
  141. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-contract.mjs +5 -7
  142. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-preparation.mjs +5 -3
  143. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-record.mjs +2 -3
  144. package/lib/host-packages/claude/openplanr/skills/design/references/utilities.md +1 -1
  145. package/lib/host-packages/claude/openplanr/skills/design-loop/references/utilities.md +1 -1
  146. package/lib/host-packages/claude/openplanr/skills/design-review/references/utilities.md +1 -1
  147. package/lib/host-packages/claude/openplanr/skills/diagram/references/diagram-sharing.md +1 -1
  148. package/lib/host-packages/claude/openplanr/skills/doctor/SKILL.md +4 -1
  149. package/lib/host-packages/claude/openplanr/skills/doctor/references/upgrade.md +8 -0
  150. package/lib/host-packages/claude/openplanr/skills/operate/SKILL.md +5 -3
  151. package/lib/host-packages/claude/openplanr/skills/plan/SKILL.md +10 -4
  152. package/lib/host-packages/claude/openplanr/skills/sprint/SKILL.md +5 -4
  153. package/lib/host-packages/claude/openplanr/skills/sprint/references/tracker-connections.md +70 -0
  154. package/lib/host-packages/claude/openplanr/skills/status/SKILL.md +4 -3
  155. package/lib/host-packages/claude/openplanr/skills/status/references/tracker-connections.md +70 -0
  156. package/lib/host-packages/claude/openplanr/skills/sync/SKILL.md +11 -20
  157. package/lib/host-packages/claude/openplanr/skills/sync/references/tracker-connections.md +70 -0
  158. package/lib/host-packages/claude/openplanr/skills/sync/scripts/sync.mjs +2 -2
  159. package/lib/host-packages/cursor/openplanr/.openplanr-content.json +63 -47
  160. package/lib/host-packages/cursor/openplanr/manifest.json +1 -1
  161. package/lib/host-packages/cursor/openplanr/rules/planr-artifact/references/diagram-sharing.md +1 -1
  162. package/lib/host-packages/cursor/openplanr/rules/planr-artifact.mdc +2 -2
  163. package/lib/host-packages/cursor/openplanr/rules/planr-ceo-review/references/operate-advisor-contract.md +25 -4
  164. package/lib/host-packages/cursor/openplanr/rules/planr-chair-review.mdc +6 -1
  165. package/lib/host-packages/cursor/openplanr/rules/planr-challenger-review.mdc +6 -1
  166. package/lib/host-packages/cursor/openplanr/rules/planr-cmo-review/references/operate-advisor-contract.md +25 -4
  167. package/lib/host-packages/cursor/openplanr/rules/planr-coo-review/references/operate-advisor-contract.md +25 -4
  168. package/lib/host-packages/cursor/openplanr/rules/planr-cpo-review/references/operate-advisor-contract.md +25 -4
  169. package/lib/host-packages/cursor/openplanr/rules/planr-cto-review/references/operate-advisor-contract.md +25 -4
  170. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/capsule-contract.md +17 -2
  171. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/operator-guide.md +7 -5
  172. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/claude.mjs +11 -4
  173. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/native.mjs +1 -1
  174. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/backend-diagnostics.mjs +14 -48
  175. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/context.mjs +84 -22
  176. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/credentials.mjs +167 -0
  177. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/presentation.mjs +3 -2
  178. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-contract.mjs +5 -7
  179. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-preparation.mjs +5 -3
  180. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-record.mjs +2 -3
  181. package/lib/host-packages/cursor/openplanr/rules/planr-delegate.mdc +8 -1
  182. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/utilities.md +1 -1
  183. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/utilities.md +1 -1
  184. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/utilities.md +1 -1
  185. package/lib/host-packages/cursor/openplanr/rules/planr-diagram/references/diagram-sharing.md +1 -1
  186. package/lib/host-packages/cursor/openplanr/rules/planr-doctor/references/upgrade.md +8 -0
  187. package/lib/host-packages/cursor/openplanr/rules/planr-doctor.mdc +4 -1
  188. package/lib/host-packages/cursor/openplanr/rules/planr-operate.mdc +5 -3
  189. package/lib/host-packages/cursor/openplanr/rules/planr-plan.mdc +10 -4
  190. package/lib/host-packages/cursor/openplanr/rules/planr-sprint/references/tracker-connections.md +70 -0
  191. package/lib/host-packages/cursor/openplanr/rules/planr-sprint.mdc +5 -4
  192. package/lib/host-packages/cursor/openplanr/rules/planr-status/references/tracker-connections.md +70 -0
  193. package/lib/host-packages/cursor/openplanr/rules/planr-status.mdc +4 -3
  194. package/lib/host-packages/cursor/openplanr/rules/planr-sync/references/tracker-connections.md +70 -0
  195. package/lib/host-packages/cursor/openplanr/rules/planr-sync/scripts/sync.mjs +2 -2
  196. package/lib/host-packages/cursor/openplanr/rules/planr-sync.mdc +11 -20
  197. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-review.mjs +24 -9
  198. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share.mjs +3 -3
  199. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
  200. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/package.json +4 -4
  201. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/enhancements.css +14 -4
  202. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +1 -1
  203. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +14 -5
  204. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-design-review-experience.js +28 -0
  205. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-studio-shell.js +105 -27
  206. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +6 -6
  207. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +2 -2
  208. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design.mjs +1 -1
  209. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +2 -2
  210. package/lib/host-packages/openai/.claude-plugin/marketplace.json +2 -2
  211. package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +1 -1
  212. package/lib/host-packages/openai/openplanr/.openplanr-content.json +72 -56
  213. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-review.mjs +24 -9
  214. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share.mjs +3 -3
  215. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
  216. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/package.json +4 -4
  217. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/enhancements.css +14 -4
  218. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +1 -1
  219. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +14 -5
  220. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-design-review-experience.js +28 -0
  221. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-studio-shell.js +105 -27
  222. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +6 -6
  223. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +2 -2
  224. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design.mjs +1 -1
  225. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +2 -2
  226. package/lib/host-packages/openai/openplanr/skills/artifact/SKILL.md +2 -2
  227. package/lib/host-packages/openai/openplanr/skills/artifact/references/diagram-sharing.md +1 -1
  228. package/lib/host-packages/openai/openplanr/skills/ceo-review/SKILL.md +0 -1
  229. package/lib/host-packages/openai/openplanr/skills/ceo-review/references/operate-advisor-contract.md +25 -4
  230. package/lib/host-packages/openai/openplanr/skills/chair-review/SKILL.md +6 -2
  231. package/lib/host-packages/openai/openplanr/skills/challenger-review/SKILL.md +6 -2
  232. package/lib/host-packages/openai/openplanr/skills/cmo-review/SKILL.md +0 -1
  233. package/lib/host-packages/openai/openplanr/skills/cmo-review/references/operate-advisor-contract.md +25 -4
  234. package/lib/host-packages/openai/openplanr/skills/coo-review/SKILL.md +0 -1
  235. package/lib/host-packages/openai/openplanr/skills/coo-review/references/operate-advisor-contract.md +25 -4
  236. package/lib/host-packages/openai/openplanr/skills/cpo-review/SKILL.md +0 -1
  237. package/lib/host-packages/openai/openplanr/skills/cpo-review/references/operate-advisor-contract.md +25 -4
  238. package/lib/host-packages/openai/openplanr/skills/cto-review/SKILL.md +0 -1
  239. package/lib/host-packages/openai/openplanr/skills/cto-review/references/operate-advisor-contract.md +25 -4
  240. package/lib/host-packages/openai/openplanr/skills/delegate/SKILL.md +8 -1
  241. package/lib/host-packages/openai/openplanr/skills/delegate/openplanr.skill.json +11 -0
  242. package/lib/host-packages/openai/openplanr/skills/delegate/references/capsule-contract.md +17 -2
  243. package/lib/host-packages/openai/openplanr/skills/delegate/references/operator-guide.md +7 -5
  244. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/claude.mjs +11 -4
  245. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/native.mjs +1 -1
  246. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/backend-diagnostics.mjs +14 -48
  247. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/context.mjs +84 -22
  248. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/credentials.mjs +167 -0
  249. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/presentation.mjs +3 -2
  250. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-contract.mjs +5 -7
  251. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-preparation.mjs +5 -3
  252. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-record.mjs +2 -3
  253. package/lib/host-packages/openai/openplanr/skills/design/references/utilities.md +1 -1
  254. package/lib/host-packages/openai/openplanr/skills/design-loop/references/utilities.md +1 -1
  255. package/lib/host-packages/openai/openplanr/skills/design-review/references/utilities.md +1 -1
  256. package/lib/host-packages/openai/openplanr/skills/diagram/references/diagram-sharing.md +1 -1
  257. package/lib/host-packages/openai/openplanr/skills/doctor/SKILL.md +4 -1
  258. package/lib/host-packages/openai/openplanr/skills/doctor/references/upgrade.md +8 -0
  259. package/lib/host-packages/openai/openplanr/skills/operate/SKILL.md +5 -3
  260. package/lib/host-packages/openai/openplanr/skills/plan/SKILL.md +10 -4
  261. package/lib/host-packages/openai/openplanr/skills/sprint/SKILL.md +5 -4
  262. package/lib/host-packages/openai/openplanr/skills/sprint/openplanr.skill.json +11 -0
  263. package/lib/host-packages/openai/openplanr/skills/sprint/references/tracker-connections.md +70 -0
  264. package/lib/host-packages/openai/openplanr/skills/status/SKILL.md +4 -3
  265. package/lib/host-packages/openai/openplanr/skills/status/openplanr.skill.json +11 -0
  266. package/lib/host-packages/openai/openplanr/skills/status/references/tracker-connections.md +70 -0
  267. package/lib/host-packages/openai/openplanr/skills/sync/SKILL.md +11 -20
  268. package/lib/host-packages/openai/openplanr/skills/sync/openplanr.skill.json +11 -0
  269. package/lib/host-packages/openai/openplanr/skills/sync/references/tracker-connections.md +70 -0
  270. package/lib/host-packages/openai/openplanr/skills/sync/scripts/sync.mjs +2 -2
  271. package/lib/integrations.mjs +2 -2
  272. package/lib/node-runtime.d.mts +1 -1
  273. package/lib/node-runtime.mjs +2 -7
  274. package/package.json +4 -5
  275. package/bin/planr.js +0 -7
  276. package/dist/services/connectors/adapters/business-metrics.d.ts +0 -5
  277. package/dist/services/connectors/adapters/business-metrics.d.ts.map +0 -1
  278. package/dist/services/connectors/adapters/business-metrics.js +0 -41
  279. package/dist/services/connectors/adapters/business-metrics.js.map +0 -1
  280. package/dist/services/connectors/adapters/deployment-health.d.ts +0 -18
  281. package/dist/services/connectors/adapters/deployment-health.d.ts.map +0 -1
  282. package/dist/services/connectors/adapters/deployment-health.js +0 -67
  283. package/dist/services/connectors/adapters/deployment-health.js.map +0 -1
  284. package/dist/services/connectors/adapters/github.d.ts +0 -5
  285. package/dist/services/connectors/adapters/github.d.ts.map +0 -1
  286. package/dist/services/connectors/adapters/github.js +0 -31
  287. package/dist/services/connectors/adapters/github.js.map +0 -1
  288. package/dist/services/connectors/adapters/linear-jira.d.ts +0 -5
  289. package/dist/services/connectors/adapters/linear-jira.d.ts.map +0 -1
  290. package/dist/services/connectors/adapters/linear-jira.js +0 -26
  291. package/dist/services/connectors/adapters/linear-jira.js.map +0 -1
  292. package/dist/services/connectors/adapters/posthog.d.ts +0 -5
  293. package/dist/services/connectors/adapters/posthog.d.ts.map +0 -1
  294. package/dist/services/connectors/adapters/posthog.js +0 -31
  295. package/dist/services/connectors/adapters/posthog.js.map +0 -1
  296. package/dist/services/connectors/adapters/sentry.d.ts +0 -5
  297. package/dist/services/connectors/adapters/sentry.d.ts.map +0 -1
  298. package/dist/services/connectors/adapters/sentry.js +0 -31
  299. package/dist/services/connectors/adapters/sentry.js.map +0 -1
  300. package/dist/services/connectors/checkpoint-custody.d.ts +0 -45
  301. package/dist/services/connectors/checkpoint-custody.d.ts.map +0 -1
  302. package/dist/services/connectors/checkpoint-custody.js +0 -499
  303. package/dist/services/connectors/checkpoint-custody.js.map +0 -1
  304. package/dist/services/connectors/connector-registry.d.ts +0 -144
  305. package/dist/services/connectors/connector-registry.d.ts.map +0 -1
  306. package/dist/services/connectors/connector-registry.js +0 -423
  307. package/dist/services/connectors/connector-registry.js.map +0 -1
  308. package/dist/services/connectors/connector-runtime.d.ts +0 -208
  309. package/dist/services/connectors/connector-runtime.d.ts.map +0 -1
  310. package/dist/services/connectors/connector-runtime.js +0 -1305
  311. package/dist/services/connectors/connector-runtime.js.map +0 -1
  312. package/dist/services/connectors/credential-custody.d.ts +0 -96
  313. package/dist/services/connectors/credential-custody.d.ts.map +0 -1
  314. package/dist/services/connectors/credential-custody.js +0 -390
  315. package/dist/services/connectors/credential-custody.js.map +0 -1
@@ -1,6 +1,7 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import { lstat, mkdir, readdir, readFile, realpath, stat, writeFile } from 'node:fs/promises';
3
3
  import { basename, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
4
+ import { classifyCredentials, credentialSyntax, resolveFindings } from './credentials.mjs';
4
5
 
5
6
  export const CAPSULE_SCHEMA_VERSION = '1.0.0';
6
7
 
@@ -12,19 +13,14 @@ const DEFAULT_LIMITS = Object.freeze({
12
13
  const SECRET_NAME =
13
14
  /^(?:\.env(?:\..*)?|\.envrc|\.netrc|\.git-credentials|\.npmrc|\.pypirc|id_(?:rsa|dsa|ecdsa|ed25519)(?:\.pub)?|credentials(?:\.[^.]+)?|service[-_]?account(?:\.[^.]+)?|.*\.(?:pem|p12|pfx|key|tfvars)(?:\.json)?)$/iu;
14
15
  const SECRET_SEGMENT = /^(?:\.ssh|\.aws|\.gnupg|\.kube)$/iu;
15
- const SECRET_VALUE =
16
- /-----BEGIN (?:[A-Z ]* )?PRIVATE KEY-----|\bAKIA[0-9A-Z]{16}\b|\bgh[pousr]_[A-Za-z0-9_]{20,}\b|\bgithub_pat_[A-Za-z0-9_]{20,}\b|\bsk-(?:proj-)?[A-Za-z0-9_-]{24,}\b|\bxox[baprs]-[A-Za-z0-9-]{20,}\b|"private_key"\s*:\s*"-----BEGIN/iu;
17
- const SECRET_ASSIGNMENT =
18
- /(?:^|[^A-Za-z0-9_])(?:[A-Za-z_][A-Za-z0-9_-]*?)?(?:API[_-]?KEY|ACCESS[_-]?TOKEN|AUTH[_-]?TOKEN|CLIENT[_-]?SECRET|PRIVATE[_-]?KEY|PASSWORD|TOKEN|SECRET(?:[_-]?KEY)?)["']?\s*[:=]\s*(["'`])((?:(?!\1|\$\{)[^\r\n\\]|\\.){16,})\1/giu;
19
- const SECRET_CONFIG_ASSIGNMENT =
20
- /^[ \t]*(?:export[ \t]+)?(?:[A-Za-z_][A-Za-z0-9_-]*?)?(?:API[_-]?KEY|ACCESS[_-]?TOKEN|AUTH[_-]?TOKEN|CLIENT[_-]?SECRET|PRIVATE[_-]?KEY|PASSWORD|TOKEN|SECRET(?:[_-]?KEY)?)[ \t]*[:=][ \t]*(?!process\.env(?:\.|\[)|import\.meta\.env(?:\.|\[)|Deno\.env\.|os\.environ|env\.)([^\s"'`#()\[\]{}$]{16,})[ \t]*(?:#[^\r\n]*)?\r?$/gimu;
21
- const CREDENTIAL_PLACEHOLDER =
22
- /^(?:example(?:[-_].*)?|placeholder(?:[-_].*)?|your[-_].*|(?:change|replace)[-_]me(?:[-_].*)?|(?:dummy|fake|mock|test|never[-_]return)[-_](?:api[-_]?key|access[-_]?token|auth[-_]?token|client[-_]?secret|password|token|secret(?:[-_]?key)?))$/iu;
23
16
  const TASK_ID = /^(?:T|TASK|QT)-\d{3,}$/u;
24
17
  const STORY_ID = /^US-\d{3,}$/u;
25
18
  const SPEC_ID = /^SPEC-\d{3,}$/u;
26
19
  const FEATURE_ID = /^FEAT-\d{3,}$/u;
27
20
  const EPIC_ID = /^EPIC-\d{3,}$/u;
21
+ // Credential findings of an optional omission, keyed by the omission entry. The delegate reads
22
+ // the written capsule, so they reach only the parent's preview.
23
+ const OMISSION_FINDINGS = new WeakMap();
28
24
 
29
25
  export class CapsuleError extends Error {
30
26
  constructor(code, message, details = {}) {
@@ -68,14 +64,9 @@ function isSecretPath(path) {
68
64
  return parts.some((part) => SECRET_SEGMENT.test(part)) || SECRET_NAME.test(parts.at(-1));
69
65
  }
70
66
 
67
+ /** True when free text holds credential material; source files are classified by their syntax. */
71
68
  export function containsSecret(bytes) {
72
- const content = bytes.toString('utf8');
73
- if (SECRET_VALUE.test(content)) return true;
74
- for (const match of content.matchAll(SECRET_ASSIGNMENT))
75
- if (!CREDENTIAL_PLACEHOLDER.test(match[2])) return true;
76
- for (const match of content.matchAll(SECRET_CONFIG_ASSIGNMENT))
77
- if (!CREDENTIAL_PLACEHOLDER.test(match[1])) return true;
78
- return false;
69
+ return classifyCredentials(bytes).findings.length > 0;
79
70
  }
80
71
 
81
72
  export function assertCredentialFreeText(
@@ -84,10 +75,34 @@ export function assertCredentialFreeText(
84
75
  ) {
85
76
  if (typeof value !== 'string')
86
77
  throw new CapsuleError('E_CAPSULE_INPUT', `${label} must be text.`);
87
- if (containsSecret(Buffer.from(value, 'utf8')))
78
+ const { contentDigest, findings } = classifyCredentials(Buffer.from(value, 'utf8'), {
79
+ label,
80
+ resolvable: false,
81
+ });
82
+ if (findings.length)
88
83
  throw new CapsuleError(
89
84
  code,
90
85
  `${label} contains credential material; use native configuration or credential environment references instead.`,
86
+ { findings, contentDigest },
87
+ );
88
+ return value;
89
+ }
90
+
91
+ function credentialResolutionList(value) {
92
+ if (
93
+ !Array.isArray(value) ||
94
+ value.length > 64 ||
95
+ value.some(
96
+ (resolution) =>
97
+ !resolution ||
98
+ typeof resolution !== 'object' ||
99
+ !/^cred_[a-f0-9]{16}$/u.test(resolution.id ?? '') ||
100
+ !/^sha256:[a-f0-9]{64}$/u.test(resolution.contentDigest ?? ''),
101
+ )
102
+ )
103
+ throw new CapsuleError(
104
+ 'E_CAPSULE_INPUT',
105
+ 'Credential resolutions must list at most 64 { id, contentDigest } entries from reported findings.',
91
106
  );
92
107
  return value;
93
108
  }
@@ -312,8 +327,22 @@ export async function buildContextCapsule({
312
327
  optionalFiles = [],
313
328
  readOnlyRepositories = [],
314
329
  limits,
330
+ credentialResolutions = [],
315
331
  } = {}) {
316
332
  if (!repositoryRoot) throw new CapsuleError('E_CAPSULE_SOURCE', 'repositoryRoot is required.');
333
+ const resolutions = credentialResolutionList(credentialResolutions);
334
+ const appliedResolutions = [];
335
+ const credentialCheck = (bytes, origin) => {
336
+ const classification = classifyCredentials(bytes, origin);
337
+ return {
338
+ ...resolveFindings(classification, resolutions),
339
+ contentDigest: classification.contentDigest,
340
+ };
341
+ };
342
+ const recordResolutions = ({ applied, contentDigest }, source) => {
343
+ for (const { id, rule, location } of applied)
344
+ appliedResolutions.push({ id, contentDigest, ...source, rule, location });
345
+ };
317
346
  if (request !== undefined && typeof request !== 'string')
318
347
  throw new CapsuleError('E_CAPSULE_INPUT', 'A direct request must be text.');
319
348
  if (Boolean(taskSelector) === Boolean(request?.trim())) {
@@ -354,8 +383,18 @@ export async function buildContextCapsule({
354
383
  if (request && Buffer.byteLength(request, 'utf8') > bounds.maxFileBytes) {
355
384
  throw new CapsuleError('E_CAPSULE_LIMIT', 'The direct request exceeds the capsule text limit.');
356
385
  }
357
- if (request && containsSecret(Buffer.from(request, 'utf8'))) {
358
- throw new CapsuleError('E_CAPSULE_SECRET', 'The direct request contains credential material.');
386
+ if (request) {
387
+ const credentials = credentialCheck(Buffer.from(request, 'utf8'), { label: 'request' });
388
+ if (credentials.remaining.length)
389
+ throw new CapsuleError(
390
+ 'E_CAPSULE_SECRET',
391
+ 'The direct request contains credential material.',
392
+ {
393
+ findings: credentials.remaining,
394
+ contentDigest: credentials.contentDigest,
395
+ },
396
+ );
397
+ recordResolutions(credentials, { source: 'request' });
359
398
  }
360
399
  const roots = await sourceRoots(repositoryRoot, readOnlyRepositories);
361
400
  const project = roots.get('project').physical;
@@ -381,9 +420,16 @@ export async function buildContextCapsule({
381
420
  return prior;
382
421
  }
383
422
  const optionalOmission = (reason) => {
384
- if (required) throw new CapsuleError(reason.code, reason.message, { repositoryKey, path });
423
+ if (required)
424
+ throw new CapsuleError(reason.code, reason.message, {
425
+ repositoryKey,
426
+ path,
427
+ ...reason.details,
428
+ });
385
429
  if (!omitted.has(key)) {
386
- omissions.push({ repositoryKey, path, role, reason: reason.code });
430
+ const omission = { repositoryKey, path, role, reason: reason.code };
431
+ if (reason.details) OMISSION_FINDINGS.set(omission, reason.details);
432
+ omissions.push(omission);
387
433
  omitted.add(key);
388
434
  }
389
435
  return null;
@@ -467,11 +513,20 @@ export async function buildContextCapsule({
467
513
  message: `Required source exceeds capsule limits: ${path}`,
468
514
  });
469
515
  }
470
- if (containsSecret(bytes))
516
+ // A link reads as its target's syntax, or as configuration when either path is configuration.
517
+ const syntaxes = [path, relative(allowed, physical).split(sep).join('/')].map(credentialSyntax);
518
+ const credentials = credentialCheck(bytes, {
519
+ path,
520
+ label: `${repositoryKey}/${path}`,
521
+ syntax: syntaxes.includes('config') ? 'config' : syntaxes[1],
522
+ });
523
+ if (credentials.remaining.length)
471
524
  return optionalOmission({
472
525
  code: 'E_CAPSULE_SECRET',
473
526
  message: `Credential material detected in source: ${path}`,
527
+ details: { findings: credentials.remaining, contentDigest: credentials.contentDigest },
474
528
  });
529
+ recordResolutions(credentials, { repositoryKey, path });
475
530
  const copy = {
476
531
  repositoryKey,
477
532
  path,
@@ -686,6 +741,7 @@ export async function buildContextCapsule({
686
741
  inventory,
687
742
  files,
688
743
  omissions,
744
+ ...(appliedResolutions.length ? { credentialResolutions: appliedResolutions } : {}),
689
745
  planning: {
690
746
  logicalPath: join(project, '.planr'),
691
747
  physicalPath: roots.get('project').planning,
@@ -731,7 +787,13 @@ export function previewContextCapsule(capsule) {
731
787
  mode: capsule.mode,
732
788
  selector: capsule.selector,
733
789
  inventory: capsule.inventory,
734
- omissions: capsule.omissions,
790
+ omissions: capsule.omissions.map((omission) => ({
791
+ ...omission,
792
+ ...OMISSION_FINDINGS.get(omission),
793
+ })),
794
+ ...(capsule.credentialResolutions
795
+ ? { credentialResolutions: capsule.credentialResolutions }
796
+ : {}),
735
797
  blockers: [],
736
798
  planning: capsule.planning ?? null,
737
799
  sourceKeys: capsule.sourceKeys,
@@ -0,0 +1,167 @@
1
+ // Credential classification for delegated context. Findings never carry the matched value.
2
+ import { createHash } from 'node:crypto';
3
+
4
+ /**
5
+ * Recognizable credential formats; rejected everywhere, including tests and placeholders.
6
+ * Case-sensitive: each prefix has a fixed case, and `github_pat_` and `sk-` bodies need an
7
+ * uppercase letter or digit.
8
+ */
9
+ export const CREDENTIAL_FORMAT =
10
+ /-----BEGIN (?:[A-Z ]* )?PRIVATE KEY(?: BLOCK)?-----|"private_key"\s*:\s*"-----BEGIN|(?<![A-Za-z0-9])AKIA[0-9A-Z]{16}\b|(?<![A-Za-z0-9])gh[pousr]_[A-Za-z0-9]{20,}(?![A-Za-z0-9])|(?<![A-Za-z0-9])github_pat_(?=[A-Za-z0-9_]*[A-Z0-9])[A-Za-z0-9_]{20,}\b|(?<![A-Za-z0-9])sk-(?:proj-)?(?=[A-Za-z0-9_-]*[A-Z0-9])[A-Za-z0-9_-]{24,}\b|(?<![A-Za-z0-9])xox[baprs]-[A-Za-z0-9-]{20,}/u;
11
+
12
+ // `word` is the credential word findings report as `key`; the rest of a name may hold a value.
13
+ const CREDENTIAL_NAME =
14
+ '(?<name>(?:[A-Za-z_][A-Za-z0-9_-]*?)?(?<word>API[_-]?KEY|ACCESS[_-]?TOKEN|AUTH[_-]?TOKEN|CLIENT[_-]?SECRET|PRIVATE[_-]?KEY|PASSWORD|TOKEN|SECRET(?:[_-]?KEY)?))';
15
+ const QUOTED_ASSIGNMENT = new RegExp(
16
+ `(?:^|[^A-Za-z0-9_])${CREDENTIAL_NAME}["']?\\s*[:=]\\s*(?<quote>["'\`])(?<value>(?:(?!\\k<quote>|\\$\\{)[^\\r\\n\\\\]|\\\\.){16,})\\k<quote>`,
17
+ 'giu',
18
+ );
19
+ const UNQUOTED_ASSIGNMENT = new RegExp(
20
+ `^[ \\t]*(?<exported>export[ \\t]+)?${CREDENTIAL_NAME}(?<before>[ \\t]*)(?<operator>[:=])(?<after>[ \\t]*)(?!process\\.env(?:\\.|\\[)|import\\.meta\\.env(?:\\.|\\[)|Deno\\.env\\.|os\\.environ|env\\.)(?<value>[^\\s"'\`#()\\[\\]{}$]{16,})[ \\t]*(?:#[^\\r\\n]*)?\\r?$`,
21
+ 'gimu',
22
+ );
23
+ const PLACEHOLDER =
24
+ /^(?:example(?:[-_].*)?|placeholder(?:[-_].*)?|your[-_].*|(?:change|replace)[-_]me(?:[-_].*)?|(?:dummy|fake|mock|test|never[-_]return)[-_](?:api[-_]?key|access[-_]?token|auth[-_]?token|client[-_]?secret|password|token|secret(?:[-_]?key)?))$/iu;
25
+ // A lowercase marker followed only by words and short numbers, one of them a credential noun.
26
+ const DESCRIBED_PLACEHOLDER =
27
+ /^(?:dummy|fake|mock|test|fixture|synthetic|never[-_]return)(?:[-_. ](?:[a-z]+|\d{1,4}))+[-_.]?$/u;
28
+ const CREDENTIAL_NOUN = /[-_. ](?:secret|key|token|password|credential)s?(?=[-_. ]|$)/u;
29
+ const SHELL_NAME = /^[A-Z][A-Z0-9_]*$/u;
30
+ const IDENTIFIER_WORD = /[A-Z]{2,}(?![a-z])\d{0,2}|[A-Z]?[a-z]+\d{0,2}|[A-Z]\d{0,2}|\d{1,2}/gu;
31
+
32
+ const CODE_EXTENSIONS = new Set(
33
+ 'c cc cjs cpp cs cts dart go groovy h hpp java js jsx kt kts lua m mjs mm mts php py rb rs scala svelte swift ts tsx vue'.split(
34
+ ' ',
35
+ ),
36
+ );
37
+ const CONFIG_EXTENSIONS = new Set(
38
+ 'bash cfg conf env fish hcl ini json json5 jsonc properties ps1 sh tf toml xml yaml yml zsh'.split(
39
+ ' ',
40
+ ),
41
+ );
42
+ const CONFIG_NAMES = new Set(['dockerfile', 'makefile', 'procfile']);
43
+
44
+ /** The syntax that decides whether an unquoted value is a literal: code, config, or free text. */
45
+ export function credentialSyntax(path) {
46
+ if (typeof path !== 'string' || !path) return 'text';
47
+ const name = path.split('/').at(-1).toLowerCase();
48
+ if (CONFIG_NAMES.has(name) || name.startsWith('.env')) return 'config';
49
+ const extension = name.includes('.') ? name.split('.').at(-1) : '';
50
+ if (CODE_EXTENSIONS.has(extension)) return 'code';
51
+ if (CONFIG_EXTENSIONS.has(extension)) return 'config';
52
+ return 'text';
53
+ }
54
+
55
+ function sha256(value) {
56
+ return createHash('sha256').update(value).digest('hex');
57
+ }
58
+
59
+ function position(content, index) {
60
+ const before = content.slice(0, index);
61
+ return { line: before.split('\n').length, column: index - before.lastIndexOf('\n') };
62
+ }
63
+
64
+ // Reads like a code identifier: whole words, digits only at word ends, at most one one-letter word.
65
+ function codeIdentifier(value) {
66
+ if (!/^[A-Za-z_$][\w$]*$/u.test(value) || value.length > 64) return false;
67
+ let singleLetters = 0;
68
+ for (const part of value.split(/[_$]+/u).filter(Boolean)) {
69
+ const words = part.match(IDENTIFIER_WORD) ?? [];
70
+ if (words.join('') !== part) return false;
71
+ singleLetters += words.filter((word) => word.replace(/\d+$/u, '').length <= 1).length;
72
+ }
73
+ return singleLetters <= 1;
74
+ }
75
+
76
+ function memberPath(value) {
77
+ const segments = value.replace(/!$/u, '').split(/[!?]?\./u);
78
+ return segments.length > 1 && segments.every(codeIdentifier);
79
+ }
80
+
81
+ // An unquoted value is a literal unless its syntax makes it a reference, type or expression.
82
+ // Multi-line strings in code read like text, so an unterminated identifier stays a literal.
83
+ function unquotedLiteral(raw, operator, syntax) {
84
+ if (syntax === 'config' || (syntax === 'text' && operator === '=')) return true;
85
+ const terminated = /[;,]$/u.test(raw);
86
+ const value = terminated ? raw.slice(0, -1) : raw;
87
+ if (memberPath(value)) return !(terminated || syntax === 'code');
88
+ return !(terminated && codeIdentifier(value));
89
+ }
90
+
91
+ // `export NAME=` is a shell line in any file, and so is an uppercase `NAME=value` without spaces
92
+ // unless it ends in `,` like a keyword argument.
93
+ function shellAssignment({ exported, name, before, operator, after, value }) {
94
+ if (exported) return true;
95
+ return operator === '=' && !before && !after && SHELL_NAME.test(name) && !value.endsWith(',');
96
+ }
97
+
98
+ function placeholder(value) {
99
+ return (
100
+ PLACEHOLDER.test(value) || (DESCRIBED_PLACEHOLDER.test(value) && CREDENTIAL_NOUN.test(value))
101
+ );
102
+ }
103
+
104
+ /**
105
+ * Classifies credential material in `bytes` from `origin` ({ path?, label?, syntax?, resolvable? }).
106
+ * Findings report location, rule, classification, confidence and explanation, never values.
107
+ * `resolvable: false` marks text that no resolution can admit, such as a correction.
108
+ */
109
+ export function classifyCredentials(bytes, origin = {}) {
110
+ const buffer = Buffer.isBuffer(bytes) ? bytes : Buffer.from(String(bytes), 'utf8');
111
+ const content = buffer.toString('utf8');
112
+ const label = origin.label ?? origin.path ?? 'text';
113
+ const syntax = origin.syntax ?? credentialSyntax(origin.path);
114
+ const resolvable = origin.resolvable !== false;
115
+ const findings = [];
116
+ const add = (rule, index, key, details) => {
117
+ const { line, column } = position(content, index);
118
+ findings.push({
119
+ id: `cred_${sha256(`${label}\n${rule}\n${line}:${column}\n${key ?? ''}`).slice(0, 16)}`,
120
+ rule,
121
+ ...details,
122
+ location: { ...(origin.path ? { path: origin.path } : {}), line, column },
123
+ ...(key ? { key } : {}),
124
+ });
125
+ };
126
+ for (const match of content.matchAll(new RegExp(CREDENTIAL_FORMAT.source, 'gu')))
127
+ add('credential-format', match.index, null, {
128
+ classification: 'credential',
129
+ confidence: 'high',
130
+ resolvable: false,
131
+ explanation:
132
+ 'A recognizable credential or private key format cannot be delegated; remove it from the source.',
133
+ });
134
+ const literal = ({ index, 0: text, groups: { name, word } }) =>
135
+ add('credential-assignment', index + text.indexOf(name), word, {
136
+ classification: 'possible-credential',
137
+ confidence: 'medium',
138
+ resolvable,
139
+ explanation: `${word} is assigned a literal that is neither a reference nor a recognized placeholder; ${resolvable ? 'resolve this finding only if the value is not a credential' : 'remove the value or replace it with a reference'}.`,
140
+ });
141
+ for (const match of content.matchAll(QUOTED_ASSIGNMENT))
142
+ if (!placeholder(match.groups.value)) literal(match);
143
+ for (const match of content.matchAll(UNQUOTED_ASSIGNMENT)) {
144
+ const { operator, value } = match.groups;
145
+ const lineSyntax = shellAssignment(match.groups) ? 'config' : syntax;
146
+ if (unquotedLiteral(value, operator, lineSyntax) && !placeholder(value.replace(/[;,]$/u, '')))
147
+ literal(match);
148
+ }
149
+ return { contentDigest: `sha256:${sha256(buffer)}`, syntax, findings };
150
+ }
151
+
152
+ /**
153
+ * Splits findings into those an explicit resolution covers and the rest. A resolution names one
154
+ * resolvable finding and the exact content digest it was recorded for; changed bytes invalidate it.
155
+ */
156
+ export function resolveFindings(classification, resolutions = []) {
157
+ const accepted = new Set(
158
+ resolutions
159
+ .filter((resolution) => resolution?.contentDigest === classification.contentDigest)
160
+ .map((resolution) => resolution.id),
161
+ );
162
+ const applied = [];
163
+ const remaining = [];
164
+ for (const finding of classification.findings)
165
+ (finding.resolvable && accepted.has(finding.id) ? applied : remaining).push(finding);
166
+ return { applied, remaining };
167
+ }
@@ -39,7 +39,7 @@ export function preparationPresentation(preview) {
39
39
  return {
40
40
  phase: 'preview',
41
41
  headline: `${taskLabel(preview.selector)} is ready for review before dispatch.`,
42
- context: `${preview.inventory.length} copied file(s); ${preview.omissions.length} omission(s).`,
42
+ context: `${preview.inventory.length} copied file(s); ${preview.omissions.length} omission(s); ${preview.credentialResolutions?.length ?? 0} accepted credential resolution(s).`,
43
43
  writableRepository: preview.writableRepository,
44
44
  worktreePath: preview.worktreePath,
45
45
  selectedPaths: preview.selectedPaths,
@@ -49,6 +49,7 @@ export function preparationPresentation(preview) {
49
49
  : 'Legacy run has no recorded integration scope; supply explicit paths at review. The worktree is not a filesystem sandbox.',
50
50
  inventory: preview.inventory,
51
51
  omissions: preview.omissions,
52
+ credentialResolutions: preview.credentialResolutions ?? [],
52
53
  blockers: preview.blockers ?? [],
53
54
  planning: preview.planning ?? null,
54
55
  helper: preview.helper ?? null,
@@ -61,7 +62,7 @@ export function preparationPresentation(preview) {
61
62
  destination: preview.destination,
62
63
  ...(preview.executionPolicy ? { executionPolicy: preview.executionPolicy } : {}),
63
64
  nextAction:
64
- 'Review required sources, optional omissions, planning location, integration scope, and destination before dispatch.',
65
+ 'Review required sources, optional omissions, accepted credential resolutions, planning location, integration scope, and destination before dispatch.',
65
66
  };
66
67
  }
67
68
 
@@ -2,6 +2,7 @@
2
2
  import { createHash } from 'node:crypto';
3
3
  import { isAbsolute, sep } from 'node:path';
4
4
  import { assertCredentialFreeText } from './context.mjs';
5
+ import { CREDENTIAL_FORMAT } from './credentials.mjs';
5
6
  import { updateRunRecord } from './run-record.mjs';
6
7
 
7
8
  const MAX_HANDOFF_TEXT = 4096;
@@ -16,9 +17,6 @@ export const SHA256 = /^[a-f0-9]{64}$/u;
16
17
 
17
18
  const RESULT_STATES = new Set(['completed', 'blocked', 'question']);
18
19
 
19
- const CREDENTIAL =
20
- /-----BEGIN (?:[A-Z ]* )?PRIVATE KEY-----|\bAKIA[0-9A-Z]{16}\b|\bgh[pousr]_[A-Za-z0-9_]{20,}\b|\bgithub_pat_[A-Za-z0-9_]{20,}\b|\bsk-(?:proj-)?[A-Za-z0-9_-]{24,}\b|\bxox[baprs]-[A-Za-z0-9-]{20,}/iu;
21
-
22
20
  export class DelegateRunError extends Error {
23
21
  constructor(code, message, runId = null, details = null) {
24
22
  super(message);
@@ -68,7 +66,7 @@ export function boundedText(value, label) {
68
66
  typeof value !== 'string' ||
69
67
  !value.trim() ||
70
68
  Buffer.byteLength(value, 'utf8') > MAX_HANDOFF_TEXT ||
71
- CREDENTIAL.test(value)
69
+ CREDENTIAL_FORMAT.test(value)
72
70
  ) {
73
71
  throw new DelegateRunError(
74
72
  'E_DELEGATE_INPUT',
@@ -152,7 +150,7 @@ function validQuestion(question) {
152
150
  typeof question.text !== 'string' ||
153
151
  !question.text.trim() ||
154
152
  Buffer.byteLength(question.text, 'utf8') > MAX_HANDOFF_TEXT ||
155
- CREDENTIAL.test(question.text) ||
153
+ CREDENTIAL_FORMAT.test(question.text) ||
156
154
  (question.options !== undefined &&
157
155
  (!Array.isArray(question.options) ||
158
156
  question.options.length > 12 ||
@@ -160,7 +158,7 @@ function validQuestion(question) {
160
158
  (option) =>
161
159
  typeof option !== 'string' ||
162
160
  Buffer.byteLength(option, 'utf8') > 256 ||
163
- CREDENTIAL.test(option),
161
+ CREDENTIAL_FORMAT.test(option),
164
162
  )))
165
163
  )
166
164
  return false;
@@ -181,7 +179,7 @@ export function resultShape(result, expectedSessionId = null) {
181
179
  ) {
182
180
  return null;
183
181
  }
184
- if (CREDENTIAL.test(result.summary)) return null;
182
+ if (CREDENTIAL_FORMAT.test(result.summary)) return null;
185
183
  if (result.status === 'blocked' && !result.summary.trim()) return null;
186
184
  if (result.status === 'question' && !validQuestion(result.question)) return null;
187
185
  if (
@@ -58,7 +58,7 @@ async function inspectWorktreeDependencies(worktreePath) {
58
58
  }
59
59
 
60
60
  export async function probeDelegateHost({ repositoryRoot, env = process.env } = {}) {
61
- const nodeReady = Number(process.versions.node.split('.')[0]) >= 20;
61
+ const nodeReady = Number(process.versions.node.split('.')[0]) >= 22;
62
62
  const options = {
63
63
  env: { PATH: env.PATH, HOME: env.HOME, USER: env.USER, TMPDIR: env.TMPDIR },
64
64
  cwd: repositoryRoot,
@@ -128,7 +128,7 @@ export async function probeDelegateHost({ repositoryRoot, env = process.env } =
128
128
  }
129
129
  return {
130
130
  ready: nodeReady && gitReady,
131
- node: { ready: nodeReady, minimumMajor: 20 },
131
+ node: { ready: nodeReady, minimumMajor: 22 },
132
132
  git: { ready: gitReady, ...(gitDiagnostic ? { diagnostic: gitDiagnostic } : {}) },
133
133
  repository,
134
134
  engines,
@@ -143,6 +143,7 @@ export async function prepareDelegateRun({
143
143
  selectedFiles = [],
144
144
  optionalFiles = [],
145
145
  readOnlyRepositories = [],
146
+ credentialResolutions = [],
146
147
  selectedPaths,
147
148
  scopePaths,
148
149
  preservePaths = [],
@@ -166,7 +167,7 @@ export async function prepareDelegateRun({
166
167
  if (!host.ready || !host.repository?.ready)
167
168
  throw new DelegateRunError(
168
169
  'E_DELEGATE_PREREQUISITE',
169
- 'Node 20+, Git, and a repository with a commit are required before task collection.',
170
+ 'Node 22+, Git, and a repository with a commit are required before task collection.',
170
171
  null,
171
172
  host,
172
173
  );
@@ -199,6 +200,7 @@ export async function prepareDelegateRun({
199
200
  selectedFiles,
200
201
  optionalFiles,
201
202
  readOnlyRepositories,
203
+ credentialResolutions,
202
204
  });
203
205
  const integrationScopePaths = scopePaths === undefined ? null : integrationPaths(scopePaths);
204
206
  let identity = profileIdentity(prepared);
@@ -14,6 +14,7 @@ import {
14
14
  import { homedir } from 'node:os';
15
15
  import { join, resolve, sep } from 'node:path';
16
16
  import { promisify } from 'node:util';
17
+ import { CREDENTIAL_FORMAT } from './credentials.mjs';
17
18
  import { captureFileState } from './custody.mjs';
18
19
 
19
20
  export const RUN_RECORD_SCHEMA_VERSION = '2.0.0';
@@ -21,8 +22,6 @@ export const MAX_RUN_RECORD_BYTES = 64 * 1024;
21
22
  export const CLOSED_RETENTION_MS = 30 * 24 * 60 * 60 * 1000;
22
23
 
23
24
  const RUN_ID = /^[a-zA-Z0-9][a-zA-Z0-9-]{0,99}$/u;
24
- const CREDENTIAL =
25
- /-----BEGIN (?:[A-Z ]* )?PRIVATE KEY-----|\bAKIA[0-9A-Z]{16}\b|\bgh[pousr]_[A-Za-z0-9_]{20,}\b|\bgithub_pat_[A-Za-z0-9_]{20,}\b|\bsk-(?:proj-)?[A-Za-z0-9_-]{24,}\b|\bxox[baprs]-[A-Za-z0-9-]{20,}/iu;
26
25
 
27
26
  const execute = promisify(execFile);
28
27
 
@@ -74,7 +73,7 @@ function encoded(record) {
74
73
  if (bytes.length > MAX_RUN_RECORD_BYTES) {
75
74
  throw new RunRecordError('E_RUN_LIMIT', 'Delegated run record exceeds its private size limit.');
76
75
  }
77
- if (CREDENTIAL.test(bytes.toString('utf8'))) {
76
+ if (CREDENTIAL_FORMAT.test(bytes.toString('utf8'))) {
78
77
  throw new RunRecordError('E_RUN_CREDENTIAL', 'Credential material cannot enter a run record.');
79
78
  }
80
79
  return bytes;
@@ -2,7 +2,7 @@
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 20 or later, with no global CLI, provider credentials or runtime downloads.
5
+ Node.js 22.13 or later, with no global CLI, provider credentials or runtime downloads.
6
6
  Use `--help` to inspect the installed command interface before writing documents
7
7
  or invoking operations; the installed contract is authoritative.
8
8
 
@@ -2,7 +2,7 @@
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 20 or later, with no global CLI, provider credentials or runtime downloads.
5
+ Node.js 22.13 or later, with no global CLI, provider credentials or runtime downloads.
6
6
  Use `--help` to inspect the installed command interface before writing documents
7
7
  or invoking operations; the installed contract is authoritative.
8
8
 
@@ -2,7 +2,7 @@
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 20 or later, with no global CLI, provider credentials or runtime downloads.
5
+ Node.js 22.13 or later, with no global CLI, provider credentials or runtime downloads.
6
6
  Use `--help` to inspect the installed command interface before writing documents
7
7
  or invoking operations; the installed contract is authoritative.
8
8
 
@@ -13,7 +13,7 @@ review. Preview the exact diagram title, source revision, elements, connections,
13
13
  destination and retention before creating it. Use `--yes` only when the user has
14
14
  already authorized that publication. The stable URL and generated access token
15
15
  are separate; copy the token through the local studio's **Share diagram** dialog,
16
- never into a URL, prompt, ordinary output or repository file. Owner credentials
16
+ never into a URL, prompt, ordinary output or repository file. Owner keys
17
17
  are saved privately outside the project. The review remains available until the
18
18
  owner revokes or deletes it and works while the local studio is stopped.
19
19
 
@@ -37,7 +37,10 @@ skill's job, then reporting what actually changed — never what was merely
37
37
  attempted.
38
38
 
39
39
  1. **Decide.** Run `openplanr upgrade status --json` and read `status`. If it is
40
- `aligned` or `unknown`, there is nothing to drive — report it and stop.
40
+ `aligned` or `unknown` with empty `nextSteps`, there is nothing to drive —
41
+ report it and stop. If it is `agents-behind`, or `aligned` with `nextSteps`,
42
+ the CLI is already current: run its `nextSteps` commands in order, as step 3
43
+ describes, without upgrading the CLI.
41
44
  Record the reported `installed` versions; that is the before state.
42
45
  2. **Own half, prescribe half.** If `status` is `upgrade-available` or
43
46
  `incompatible`, confirm with the user (this upgrades the npm CLI), then run
@@ -52,6 +52,10 @@ Shape (the fields this skill reads):
52
52
  - `upgrade-available` or `incompatible` → act. First **record the `installed`
53
53
  block as the before state** — the honest diff at the end depends on it. When
54
54
  only `nextSteps` is non-empty, skip to step 3.
55
+ - `agents-behind` → the CLI is current and a coding agent's OpenPlanr install
56
+ needs updating. Record the `installed` block, then skip to step 3.
57
+ - `aligned` with non-empty `nextSteps` → the versions match, but an install needs
58
+ the `openplanr doctor` commands listed. Skip to step 3.
55
59
 
56
60
  ## 2. Upgrade the CLI and obtain the next steps
57
61
 
@@ -90,6 +94,10 @@ this file.** Other shapes:
90
94
  `openplanr upgrade status --json` and use its `nextSteps`.
91
95
  - An `openplanr doctor` command: planning that agent's update failed, and `detail`
92
96
  says why. Relay it and run `openplanr doctor --json`.
97
+ - An `openplanr doctor --fix` command: a file in that agent's runtime package was
98
+ changed outside OpenPlanr, and `detail` names it. Run it, show the user the
99
+ repair preview, and rerun it with `--yes` only after they confirm. The changed
100
+ files are backed up before they are replaced.
93
101
 
94
102
  `pluginHalfCommands` repeats the commands for older readers; read `nextSteps`.
95
103
 
@@ -47,9 +47,11 @@ matches. Never overwrite a prior cycle implicitly.
47
47
  ```
48
48
 
49
49
  `cycle.md` records the effective scope, roster, repository revision when relevant, and the outcome
50
- of each lens. If the directory is ignored by Git, continue locally and mention that in the report;
51
- do not ask the user to change ignore rules. Report an exact filesystem error only when the cycle
52
- workspace cannot be created or written.
50
+ of each lens. An advisor lens run on its own creates the same layout with a one-lens roster and an
51
+ unsynthesized `board-report.md`, so every review the dashboard lists has one shape.
52
+ If the directory is ignored by Git, continue locally and mention that in the report; do not ask the
53
+ user to change ignore rules. Report an exact filesystem error only when the cycle workspace cannot be
54
+ created or written.
53
55
 
54
56
  ## Build shared context once
55
57
 
@@ -79,8 +79,14 @@ Write stories and tasks directly in the repository's active planning mode.
79
79
  deleted ID. The packaged [planning ID helper](scripts/planning-ids.mjs) may
80
80
  inspect or reserve IDs; it never generates content.
81
81
  - Give each story stable acceptance IDs starting at `AC-001`.
82
- - Create one Tech task when no design surface applies; create one UI and one
83
- Tech task when it does. Never exceed two tasks for one story.
82
+ - Split each story into tasks that are coherent and independently verifiable.
83
+ Separate by ownership first: UI work is a `UI` task for the frontend role and
84
+ server, data, or integration work is a `Tech` task for the backend role.
85
+ Within one owner, split further only for a real output dependency, a distinct
86
+ verification surface, or reviewable size. Most stories need one Tech task,
87
+ plus one UI task when a design surface applies; never fragment one coherent
88
+ change into tasks that cannot be verified alone, and never fold unrelated work
89
+ into one task.
84
90
  - Map every acceptance ID through `acceptanceRefs` and name it with a concrete
85
91
  verification statement under `## Test Requirements`.
86
92
  - Set `reviewRisks` and `browserSurfaces` from repository evidence; use empty
@@ -112,8 +118,8 @@ instead of repeating every path in chat.
112
118
  - **Checks:** frontmatter, ID and acceptance coverage checks actually performed.
113
119
  - **Issues:** unresolved inputs or material assumptions, with their impact and recovery step; omit when empty.
114
120
  - **Next:** the exact ready task selector and a copy-ready host-native
115
- invocation such as `$planr:ship T-NNN` (Codex/ChatGPT) or
116
- `/planr:ship T-NNN` (Claude Code).
121
+ invocation such as `/planr:ship T-NNN` (Claude Code), `$planr:ship T-NNN`
122
+ (Codex/ChatGPT) or the `planr-ship` rule (Cursor).
117
123
 
118
124
  Mention the planning layout or consulted lenses only when they explain a material
119
125
  choice. Different summary wording never requires another planning run.
@@ -36,7 +36,7 @@ capability; it never blocks the run. Name every degraded input in `Issues`.
36
36
  | Capacity (engineers × working days) | Fit the list and name the overflow | Ask once; default 1 engineer × 10 days, stated in the return |
37
37
  | Previous sprint or refinement note (`.planr/sprints/SPRINT-NNN/refinement.json`) | Carry `leftovers`; `openplanr sprint diff` is possible | First run, no diff |
38
38
  | Last Operate cycle | Rank its unfinished actions alongside | Skipped silently |
39
- | Linear or GitHub connector | Push statuses on approval, read PR state | Local files only; report the external step as not run |
39
+ | Linear or GitHub connection ([tracker connections](references/tracker-connections.md)) | Update linked issues on approval, read PR state | Local files only; report the external step as not run and name the connection to add |
40
40
 
41
41
  ## Step 0: Frame the run
42
42
 
@@ -135,9 +135,10 @@ openplanr sprint apply SPRINT-NNN --dry-run # show the status and prior
135
135
  openplanr sprint apply SPRINT-NNN --yes --commit # one commit: chore(planr): refine backlog for SPRINT-NNN
136
136
  ```
137
137
 
138
- Where a connector is configured, push each changed item afterwards
139
- (`openplanr linear push <id>`, `openplanr github push <id>`) and report the ones that
140
- were not pushed. When the CLI is unavailable, apply the same status changes with
138
+ Then update the issue linked to each changed item through the host's Linear or
139
+ GitHub connection, with the status mapping in
140
+ [tracker connections](references/tracker-connections.md), and report the items that
141
+ were not updated. When the CLI is unavailable, apply the same status changes with
141
142
  the repository's own vocabulary and commit them with the same message.
142
143
 
143
144
  Close a finished sprint with `openplanr sprint close SPRINT-NNN`; it records the