agentplane 0.3.2 → 0.3.3

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 (190) hide show
  1. package/assets/AGENTS.md +1 -1
  2. package/assets/agents/CODER.json +4 -3
  3. package/assets/agents/DOCS.json +1 -1
  4. package/assets/agents/INTEGRATOR.json +1 -1
  5. package/assets/agents/ORCHESTRATOR.json +1 -0
  6. package/assets/agents/PLANNER.json +1 -0
  7. package/assets/agents/TESTER.json +3 -1
  8. package/assets/policy/dod.code.md +2 -2
  9. package/assets/policy/dod.core.md +16 -2
  10. package/assets/policy/dod.docs.md +2 -2
  11. package/assets/policy/incidents.md +44 -1
  12. package/assets/policy/workflow.direct.md +8 -4
  13. package/bin/agentplane.js +59 -9
  14. package/bin/dist-guard.js +78 -10
  15. package/bin/runtime-context.d.ts +3 -0
  16. package/bin/runtime-context.js +13 -0
  17. package/bin/runtime-watch.d.ts +26 -0
  18. package/bin/runtime-watch.js +116 -0
  19. package/bin/stale-dist-policy.d.ts +6 -0
  20. package/bin/stale-dist-policy.js +44 -0
  21. package/dist/.build-manifest.json +2480 -5
  22. package/dist/backends/task-backend/local-backend.d.ts.map +1 -1
  23. package/dist/backends/task-backend/local-backend.js +9 -12
  24. package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
  25. package/dist/backends/task-backend/redmine-backend.js +23 -18
  26. package/dist/backends/task-backend/shared/constants.d.ts +1 -0
  27. package/dist/backends/task-backend/shared/constants.d.ts.map +1 -1
  28. package/dist/backends/task-backend/shared/constants.js +1 -0
  29. package/dist/backends/task-backend/shared/doc.d.ts +1 -0
  30. package/dist/backends/task-backend/shared/doc.d.ts.map +1 -1
  31. package/dist/backends/task-backend/shared/doc.js +4 -1
  32. package/dist/backends/task-backend/shared/export.js +3 -3
  33. package/dist/cli/bootstrap-guide.d.ts +1 -3
  34. package/dist/cli/bootstrap-guide.d.ts.map +1 -1
  35. package/dist/cli/bootstrap-guide.js +13 -33
  36. package/dist/cli/command-guide.d.ts.map +1 -1
  37. package/dist/cli/command-guide.js +27 -34
  38. package/dist/cli/run-cli/catalog.d.ts +7 -0
  39. package/dist/cli/run-cli/catalog.d.ts.map +1 -0
  40. package/dist/cli/run-cli/catalog.js +22 -0
  41. package/dist/cli/run-cli/command-catalog.d.ts +1 -1
  42. package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
  43. package/dist/cli/run-cli/command-catalog.js +11 -0
  44. package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -1
  45. package/dist/cli/run-cli/commands/init/write-config.js +2 -0
  46. package/dist/cli/run-cli/commands/init.js +5 -14
  47. package/dist/cli/run-cli/error-guidance.d.ts +9 -0
  48. package/dist/cli/run-cli/error-guidance.d.ts.map +1 -0
  49. package/dist/cli/run-cli/error-guidance.js +180 -0
  50. package/dist/cli/run-cli/globals.d.ts +22 -0
  51. package/dist/cli/run-cli/globals.d.ts.map +1 -0
  52. package/dist/cli/run-cli/globals.js +197 -0
  53. package/dist/cli/run-cli/update-warning.d.ts +6 -0
  54. package/dist/cli/run-cli/update-warning.d.ts.map +1 -0
  55. package/dist/cli/run-cli/update-warning.js +64 -0
  56. package/dist/cli/run-cli.d.ts.map +1 -1
  57. package/dist/cli/run-cli.js +5 -476
  58. package/dist/cli/spec/docs-render.d.ts.map +1 -1
  59. package/dist/cli/spec/docs-render.js +14 -1
  60. package/dist/commands/doctor/archive.d.ts +4 -0
  61. package/dist/commands/doctor/archive.d.ts.map +1 -0
  62. package/dist/commands/doctor/archive.js +211 -0
  63. package/dist/commands/doctor/fixes.d.ts +9 -0
  64. package/dist/commands/doctor/fixes.d.ts.map +1 -0
  65. package/dist/commands/doctor/fixes.js +40 -0
  66. package/dist/commands/doctor/layering.d.ts +2 -0
  67. package/dist/commands/doctor/layering.d.ts.map +1 -0
  68. package/dist/commands/doctor/layering.js +87 -0
  69. package/dist/commands/doctor/runtime.d.ts +4 -0
  70. package/dist/commands/doctor/runtime.d.ts.map +1 -0
  71. package/dist/commands/doctor/runtime.js +56 -0
  72. package/dist/commands/doctor/workflow.d.ts +6 -0
  73. package/dist/commands/doctor/workflow.d.ts.map +1 -0
  74. package/dist/commands/doctor/workflow.js +62 -0
  75. package/dist/commands/doctor/workspace.d.ts +2 -0
  76. package/dist/commands/doctor/workspace.d.ts.map +1 -0
  77. package/dist/commands/doctor/workspace.js +165 -0
  78. package/dist/commands/doctor.run.d.ts.map +1 -1
  79. package/dist/commands/doctor.run.js +16 -342
  80. package/dist/commands/doctor.spec.d.ts +1 -0
  81. package/dist/commands/doctor.spec.d.ts.map +1 -1
  82. package/dist/commands/doctor.spec.js +15 -1
  83. package/dist/commands/guard/impl/commands.d.ts.map +1 -1
  84. package/dist/commands/guard/impl/commands.js +19 -0
  85. package/dist/commands/release/apply.command.d.ts +2 -8
  86. package/dist/commands/release/apply.command.d.ts.map +1 -1
  87. package/dist/commands/release/apply.command.js +158 -387
  88. package/dist/commands/release/apply.mutation.d.ts +7 -0
  89. package/dist/commands/release/apply.mutation.d.ts.map +1 -0
  90. package/dist/commands/release/apply.mutation.js +107 -0
  91. package/dist/commands/release/apply.preflight.d.ts +25 -0
  92. package/dist/commands/release/apply.preflight.d.ts.map +1 -0
  93. package/dist/commands/release/apply.preflight.js +338 -0
  94. package/dist/commands/release/apply.reporting.d.ts +4 -0
  95. package/dist/commands/release/apply.reporting.d.ts.map +1 -0
  96. package/dist/commands/release/apply.reporting.js +24 -0
  97. package/dist/commands/release/apply.types.d.ts +46 -0
  98. package/dist/commands/release/apply.types.d.ts.map +1 -0
  99. package/dist/commands/release/apply.types.js +1 -0
  100. package/dist/commands/runtime.command.d.ts +28 -0
  101. package/dist/commands/runtime.command.d.ts.map +1 -0
  102. package/dist/commands/runtime.command.js +169 -0
  103. package/dist/commands/shared/task-store.d.ts.map +1 -1
  104. package/dist/commands/shared/task-store.js +7 -3
  105. package/dist/commands/task/add.d.ts.map +1 -1
  106. package/dist/commands/task/add.js +3 -33
  107. package/dist/commands/task/block.d.ts.map +1 -1
  108. package/dist/commands/task/block.js +2 -2
  109. package/dist/commands/task/close-duplicate.d.ts.map +1 -1
  110. package/dist/commands/task/close-duplicate.js +2 -2
  111. package/dist/commands/task/close-noop.d.ts.map +1 -1
  112. package/dist/commands/task/close-noop.js +2 -2
  113. package/dist/commands/task/comment.js +2 -2
  114. package/dist/commands/task/derive.d.ts.map +1 -1
  115. package/dist/commands/task/derive.js +3 -3
  116. package/dist/commands/task/doc-template.d.ts +10 -0
  117. package/dist/commands/task/doc-template.d.ts.map +1 -0
  118. package/dist/commands/task/doc-template.js +104 -0
  119. package/dist/commands/task/doc.d.ts.map +1 -1
  120. package/dist/commands/task/doc.js +36 -1
  121. package/dist/commands/task/finish.d.ts.map +1 -1
  122. package/dist/commands/task/finish.js +7 -4
  123. package/dist/commands/task/migrate-doc.command.d.ts.map +1 -1
  124. package/dist/commands/task/migrate-doc.command.js +5 -1
  125. package/dist/commands/task/migrate-doc.d.ts.map +1 -1
  126. package/dist/commands/task/migrate-doc.js +136 -2
  127. package/dist/commands/task/new.d.ts.map +1 -1
  128. package/dist/commands/task/new.js +4 -110
  129. package/dist/commands/task/new.spec.js +3 -3
  130. package/dist/commands/task/plan.d.ts.map +1 -1
  131. package/dist/commands/task/plan.js +5 -4
  132. package/dist/commands/task/scaffold.d.ts.map +1 -1
  133. package/dist/commands/task/scaffold.js +7 -52
  134. package/dist/commands/task/set-status.d.ts.map +1 -1
  135. package/dist/commands/task/set-status.js +2 -2
  136. package/dist/commands/task/shared/dependencies.d.ts +15 -0
  137. package/dist/commands/task/shared/dependencies.d.ts.map +1 -0
  138. package/dist/commands/task/shared/dependencies.js +143 -0
  139. package/dist/commands/task/shared/docs.d.ts +21 -0
  140. package/dist/commands/task/shared/docs.d.ts.map +1 -0
  141. package/dist/commands/task/shared/docs.js +121 -0
  142. package/dist/commands/task/shared/listing.d.ts +20 -0
  143. package/dist/commands/task/shared/listing.d.ts.map +1 -0
  144. package/dist/commands/task/shared/listing.js +127 -0
  145. package/dist/commands/task/shared/tags.d.ts +24 -0
  146. package/dist/commands/task/shared/tags.d.ts.map +1 -0
  147. package/dist/commands/task/shared/tags.js +177 -0
  148. package/dist/commands/task/shared/transitions.d.ts +42 -0
  149. package/dist/commands/task/shared/transitions.d.ts.map +1 -0
  150. package/dist/commands/task/shared/transitions.js +175 -0
  151. package/dist/commands/task/shared.d.ts +5 -106
  152. package/dist/commands/task/shared.d.ts.map +1 -1
  153. package/dist/commands/task/shared.js +5 -681
  154. package/dist/commands/task/start.d.ts.map +1 -1
  155. package/dist/commands/task/start.js +7 -5
  156. package/dist/commands/task/verify-record.d.ts.map +1 -1
  157. package/dist/commands/task/verify-record.js +9 -25
  158. package/dist/commands/task/verify-show.command.d.ts.map +1 -1
  159. package/dist/commands/task/verify-show.command.js +5 -1
  160. package/dist/commands/upgrade/apply.d.ts +44 -0
  161. package/dist/commands/upgrade/apply.d.ts.map +1 -0
  162. package/dist/commands/upgrade/apply.js +180 -0
  163. package/dist/commands/upgrade/report.d.ts +21 -0
  164. package/dist/commands/upgrade/report.d.ts.map +1 -0
  165. package/dist/commands/upgrade/report.js +81 -0
  166. package/dist/commands/upgrade/source.d.ts +35 -0
  167. package/dist/commands/upgrade/source.d.ts.map +1 -0
  168. package/dist/commands/upgrade/source.js +109 -0
  169. package/dist/commands/upgrade/types.d.ts +31 -0
  170. package/dist/commands/upgrade/types.d.ts.map +1 -0
  171. package/dist/commands/upgrade/types.js +1 -0
  172. package/dist/commands/upgrade.d.ts +1 -35
  173. package/dist/commands/upgrade.d.ts.map +1 -1
  174. package/dist/commands/upgrade.js +46 -331
  175. package/dist/shared/diagnostics.d.ts +23 -0
  176. package/dist/shared/diagnostics.d.ts.map +1 -0
  177. package/dist/shared/diagnostics.js +57 -0
  178. package/dist/shared/errors.d.ts +2 -0
  179. package/dist/shared/errors.d.ts.map +1 -1
  180. package/dist/shared/errors.js +2 -0
  181. package/dist/shared/repo-cli-version.d.ts +13 -0
  182. package/dist/shared/repo-cli-version.d.ts.map +1 -0
  183. package/dist/shared/repo-cli-version.js +63 -0
  184. package/dist/shared/runtime-source.d.ts +33 -0
  185. package/dist/shared/runtime-source.d.ts.map +1 -0
  186. package/dist/shared/runtime-source.js +156 -0
  187. package/dist/shared/version-compare.d.ts +7 -0
  188. package/dist/shared/version-compare.d.ts.map +1 -0
  189. package/dist/shared/version-compare.js +30 -0
  190. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"local-backend.d.ts","sourceRoot":"","sources":["../../../src/backends/task-backend/local-backend.ts"],"names":[],"mappings":"AAqBA,OAAO,EAiBL,KAAK,WAAW,EAChB,KAAK,QAAQ,EACd,MAAM,aAAa,CAAC;AAErB,qBAAa,YAAa,YAAW,WAAW;IAC9C,EAAE,SAAW;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,gBAAgB,CAAgB;gBAE5B,QAAQ,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE;IAKrD,cAAc,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAqB3E,SAAS,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAwHtC,mBAAmB,IAAI,MAAM,EAAE;IAIzB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAoBjD,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC;IAKzD,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAO3C,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAyExC,UAAU,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,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC;IAKzD,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAO3C,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAyExC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB1E,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBvE,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAO5C,cAAc,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAuF/D,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAIzD"}
@@ -4,7 +4,7 @@ import { docChanged, parseTaskReadme, renderTaskReadme, taskReadmePath, } from "
4
4
  import { isRecord } from "../../shared/guards.js";
5
5
  import { writeTextIfChanged } from "../../shared/write-if-changed.js";
6
6
  import { buildTaskIndexEntry, loadTaskIndex, resolveTaskIndexPath, saveTaskIndex, } from "../task-index.js";
7
- import { DEFAULT_DOC_UPDATED_BY, DOC_VERSION, defaultPlanApproval, defaultVerificationResult, extractTaskDoc, generateTaskId, invalidLengthMessage, mapLimit, mergeTaskDoc, missingTaskIdMessage, nowIso, resolveDocUpdatedByFromFrontmatter, resolveDocUpdatedByFromTask, taskRecordToData, validateTaskId, writeTasksExportFromTasks, } from "./shared.js";
7
+ import { DEFAULT_DOC_UPDATED_BY, defaultPlanApproval, defaultVerificationResult, extractTaskDoc, generateTaskId, invalidLengthMessage, mapLimit, mergeTaskDoc, missingTaskIdMessage, normalizeDocVersion, nowIso, resolveDocUpdatedByFromFrontmatter, resolveDocUpdatedByFromTask, taskRecordToData, validateTaskId, writeTasksExportFromTasks, } from "./shared.js";
8
8
  export class LocalBackend {
9
9
  id = "local";
10
10
  root;
@@ -229,18 +229,17 @@ export class LocalBackend {
229
229
  if (payload.verification === undefined) {
230
230
  payload.verification = defaultVerificationResult();
231
231
  }
232
+ const existingDocVersion = normalizeDocVersion(existingFrontmatter.doc_version);
232
233
  if (task.doc !== undefined) {
233
234
  const docText = String(task.doc ?? "");
234
235
  body = mergeTaskDoc(body, docText);
235
236
  if (docChanged(existingDoc, docText)) {
236
- payload.doc_version = DOC_VERSION;
237
+ payload.doc_version = normalizeDocVersion(task.doc_version, existingDocVersion);
237
238
  payload.doc_updated_at = nowIso();
238
239
  payload.doc_updated_by = resolveDocUpdatedByFromTask(task, this.updatedBy);
239
240
  }
240
241
  }
241
- if (payload.doc_version !== DOC_VERSION) {
242
- payload.doc_version = DOC_VERSION;
243
- }
242
+ payload.doc_version = normalizeDocVersion(payload.doc_version, existingDocVersion);
244
243
  if (payload.doc_updated_at === undefined || payload.doc_updated_at === "") {
245
244
  payload.doc_updated_at = nowIso();
246
245
  }
@@ -258,14 +257,13 @@ export class LocalBackend {
258
257
  const docText = String(doc ?? "");
259
258
  const body = mergeTaskDoc(parsed.body, docText);
260
259
  const frontmatter = { ...parsed.frontmatter };
260
+ const currentDocVersion = normalizeDocVersion(frontmatter.doc_version);
261
261
  if (docChanged(extractTaskDoc(parsed.body), docText) || !frontmatter.doc_updated_at) {
262
- frontmatter.doc_version = DOC_VERSION;
262
+ frontmatter.doc_version = currentDocVersion;
263
263
  frontmatter.doc_updated_at = nowIso();
264
264
  frontmatter.doc_updated_by = resolveDocUpdatedByFromFrontmatter(frontmatter, updatedBy, this.updatedBy);
265
265
  }
266
- if (frontmatter.doc_version !== DOC_VERSION) {
267
- frontmatter.doc_version = DOC_VERSION;
268
- }
266
+ frontmatter.doc_version = normalizeDocVersion(frontmatter.doc_version, currentDocVersion);
269
267
  const next = renderTaskReadme(frontmatter, body);
270
268
  await writeTextIfChanged(readme, next.endsWith("\n") ? next : `${next}\n`);
271
269
  }
@@ -274,7 +272,7 @@ export class LocalBackend {
274
272
  const text = await readFile(readme, "utf8");
275
273
  const parsed = parseTaskReadme(text);
276
274
  const frontmatter = { ...parsed.frontmatter };
277
- frontmatter.doc_version = DOC_VERSION;
275
+ frontmatter.doc_version = normalizeDocVersion(frontmatter.doc_version);
278
276
  frontmatter.doc_updated_at = nowIso();
279
277
  frontmatter.doc_updated_by = resolveDocUpdatedByFromFrontmatter(frontmatter, updatedBy, this.updatedBy);
280
278
  const next = renderTaskReadme(frontmatter, parsed.body || "");
@@ -340,8 +338,7 @@ export class LocalBackend {
340
338
  }
341
339
  if (payload.verification === undefined)
342
340
  payload.verification = defaultVerificationResult();
343
- if (payload.doc_version !== DOC_VERSION)
344
- payload.doc_version = DOC_VERSION;
341
+ payload.doc_version = normalizeDocVersion(payload.doc_version, normalizeDocVersion(fm.doc_version));
345
342
  if (payload.doc_updated_at === undefined || payload.doc_updated_at === "") {
346
343
  payload.doc_updated_at = nowIso();
347
344
  }
@@ -1 +1 @@
1
- {"version":3,"file":"redmine-backend.d.ts","sourceRoot":"","sources":["../../../src/backends/task-backend/redmine-backend.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA2BvD,OAAO,EAkBL,KAAK,WAAW,EAChB,KAAK,QAAQ,EAEd,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,UAAU,CAAC,EAAE,MAA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QACf,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;QAC3B,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,eAAe,GAAG,MAAM,CAAC;QAC7D,KAAK,EAAE,OAAO,CAAC;QACf,OAAO,EAAE,OAAO,CAAC;KAClB,GAAG,OAAO,CAAC,IAAI,CAAC;IAYjB,OAAO,CAAC,iBAAiB;YAOX,QAAQ;YAoBR,QAAQ;YAoCR,cAAc;IAsB5B,OAAO,CAAC,SAAS;IAejB,OAAO,CAAC,WAAW;YAML,SAAS;IAMvB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,wBAAwB;YAQlB,eAAe;IAa7B,OAAO,CAAC,gBAAgB;YAIV,0BAA0B;YAW1B,8BAA8B;IAwC5C,OAAO,CAAC,oBAAoB;YAqCd,iBAAiB;IAgB/B,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,iBAAiB;YAIX,kBAAkB;IAchC,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,gBAAgB;YAIV,WAAW;CAgB1B"}
@@ -7,7 +7,7 @@ import { doneRatioForStatus, issueToTask as issueToTaskImpl, startDateFromTaskId
7
7
  import { coerceDocVersion as coerceRedmineDocVersion, maybeParseJson as maybeParseRedmineJson, } from "./redmine/parse.js";
8
8
  import { findIssueByTaskId as findIssueByTaskIdImpl, listTasksRemote as listTasksRemoteImpl, } from "./redmine/remote.js";
9
9
  import { readRedmineEnv } from "./redmine/env.js";
10
- import { BackendError, DEFAULT_DOC_UPDATED_BY, DOC_VERSION, RedmineUnavailable, ensureDocMetadata, firstNonEmptyString, generateTaskId, mapLimit, missingTaskIdMessage, nowIso, redmineConfigMissingEnvMessage, redmineIssueIdMissingMessage, sleep, toStringSafe, unknownTaskIdMessage, validateTaskId, writeTasksExportFromTasks, } from "./shared.js";
10
+ import { BackendError, DEFAULT_DOC_UPDATED_BY, DOC_VERSION, RedmineUnavailable, ensureDocMetadata, firstNonEmptyString, generateTaskId, mapLimit, missingTaskIdMessage, normalizeDocVersion, nowIso, redmineConfigMissingEnvMessage, redmineIssueIdMissingMessage, sleep, toStringSafe, unknownTaskIdMessage, validateTaskId, writeTasksExportFromTasks, } from "./shared.js";
11
11
  export class RedmineBackend {
12
12
  id = "redmine";
13
13
  baseUrl;
@@ -151,7 +151,11 @@ export class RedmineBackend {
151
151
  const issueIdText = toStringSafe(issue.id);
152
152
  if (!issueIdText)
153
153
  throw new Error(redmineIssueIdMissingMessage());
154
- const taskDoc = { doc: String(doc ?? "") };
154
+ const cachedTask = this.issueToTask(issue, taskId);
155
+ const taskDoc = {
156
+ doc: String(doc ?? ""),
157
+ doc_version: cachedTask?.doc_version,
158
+ };
155
159
  ensureDocMetadata(taskDoc, updatedBy);
156
160
  const customFields = [];
157
161
  this.appendCustomField(customFields, "doc", taskDoc.doc);
@@ -161,13 +165,12 @@ export class RedmineBackend {
161
165
  await this.requestJson("PUT", `issues/${issueIdText}.json`, {
162
166
  issue: { custom_fields: customFields },
163
167
  });
164
- const task = this.issueToTask(issue, taskId);
165
- if (task) {
166
- task.doc = taskDoc.doc;
167
- task.doc_version = taskDoc.doc_version;
168
- task.doc_updated_at = taskDoc.doc_updated_at;
169
- task.doc_updated_by = taskDoc.doc_updated_by;
170
- await this.cacheTask(task, false);
168
+ if (cachedTask) {
169
+ cachedTask.doc = taskDoc.doc;
170
+ cachedTask.doc_version = taskDoc.doc_version;
171
+ cachedTask.doc_updated_at = taskDoc.doc_updated_at;
172
+ cachedTask.doc_updated_by = taskDoc.doc_updated_by;
173
+ await this.cacheTask(cachedTask, false);
171
174
  }
172
175
  }
173
176
  catch (err) {
@@ -195,7 +198,11 @@ export class RedmineBackend {
195
198
  if (!issueIdText)
196
199
  throw new Error(redmineIssueIdMissingMessage());
197
200
  const docValue = this.customFieldValue(issue, this.customFields.doc);
198
- const taskDoc = { doc: docValue ?? "" };
201
+ const cachedTask = this.issueToTask(issue, taskId);
202
+ const taskDoc = {
203
+ doc: docValue ?? "",
204
+ doc_version: cachedTask?.doc_version,
205
+ };
199
206
  ensureDocMetadata(taskDoc, updatedBy);
200
207
  const customFields = [];
201
208
  this.appendCustomField(customFields, "doc_version", taskDoc.doc_version);
@@ -205,12 +212,11 @@ export class RedmineBackend {
205
212
  await this.requestJson("PUT", `issues/${issueIdText}.json`, {
206
213
  issue: { custom_fields: customFields },
207
214
  });
208
- const task = this.issueToTask(issue, taskId);
209
- if (task) {
210
- task.doc_version = taskDoc.doc_version;
211
- task.doc_updated_at = taskDoc.doc_updated_at;
212
- task.doc_updated_by = taskDoc.doc_updated_by;
213
- await this.cacheTask(task, false);
215
+ if (cachedTask) {
216
+ cachedTask.doc_version = taskDoc.doc_version;
217
+ cachedTask.doc_updated_at = taskDoc.doc_updated_at;
218
+ cachedTask.doc_updated_by = taskDoc.doc_updated_by;
219
+ await this.cacheTask(cachedTask, false);
214
220
  }
215
221
  }
216
222
  }
@@ -311,8 +317,7 @@ export class RedmineBackend {
311
317
  ensureDocMetadata(task) {
312
318
  if (task.doc === undefined)
313
319
  return;
314
- if (task.doc_version !== DOC_VERSION)
315
- task.doc_version = DOC_VERSION;
320
+ task.doc_version = normalizeDocVersion(task.doc_version);
316
321
  task.doc_updated_at ??= nowIso();
317
322
  task.doc_updated_by ??= DEFAULT_DOC_UPDATED_BY;
318
323
  }
@@ -1,4 +1,5 @@
1
1
  export declare const TASK_ID_RE: RegExp;
2
2
  export declare const DEFAULT_DOC_UPDATED_BY = "agentplane";
3
3
  export declare const DOC_VERSION = 2;
4
+ export declare const SUPPORTED_DOC_VERSIONS: readonly [2, 3];
4
5
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/backends/task-backend/shared/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,QAA6D,CAAC;AACrF,eAAO,MAAM,sBAAsB,eAAe,CAAC;AACnD,eAAO,MAAM,WAAW,IAAI,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/backends/task-backend/shared/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,QAA6D,CAAC;AACrF,eAAO,MAAM,sBAAsB,eAAe,CAAC;AACnD,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,sBAAsB,iBAAkB,CAAC"}
@@ -2,3 +2,4 @@ import { TASK_ID_ALPHABET } from "@agentplaneorg/core";
2
2
  export const TASK_ID_RE = new RegExp(String.raw `^\d{12}-[${TASK_ID_ALPHABET}]{4,}$`);
3
3
  export const DEFAULT_DOC_UPDATED_BY = "agentplane";
4
4
  export const DOC_VERSION = 2;
5
+ export const SUPPORTED_DOC_VERSIONS = [2, 3];
@@ -6,6 +6,7 @@ declare const mergeTaskDoc: MergeTaskDoc;
6
6
  export declare function nowIso(): string;
7
7
  export declare function resolveDocUpdatedByFromFrontmatter(frontmatter: Record<string, unknown>, updatedBy: string | undefined, fallback: string): string;
8
8
  export declare function resolveDocUpdatedByFromTask(task: TaskData, fallback: string): string;
9
+ export declare function normalizeDocVersion(value: unknown, fallback?: 2 | 3): 2 | 3;
9
10
  export declare function ensureDocMetadata(task: TaskDocMeta & Partial<Pick<TaskData, "comments" | "owner">>, updatedBy?: string): void;
10
11
  export { extractTaskDoc, mergeTaskDoc };
11
12
  //# sourceMappingURL=doc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"doc.d.ts","sourceRoot":"","sources":["../../../../src/backends/task-backend/shared/doc.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAExD,KAAK,cAAc,GAAG,CAAC,IAAI,E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,EACpC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,QAAQ,EAAE,MAAM,GACf,MAAM,CAaR;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CASpF;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,GAAE,CAAC,GAAG,CAAe,GAAG,CAAC,GAAG,CAAC,CAExF;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,EACjE,SAAS,CAAC,EAAE,MAAM,GACjB,IAAI,CAUN;AAED,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC"}
@@ -64,8 +64,11 @@ export function resolveDocUpdatedByFromTask(task, fallback) {
64
64
  const fallbackValue = normalizeUpdatedBy(fallback);
65
65
  return fallbackValue || fallback;
66
66
  }
67
+ export function normalizeDocVersion(value, fallback = DOC_VERSION) {
68
+ return value === 3 ? 3 : value === 2 ? 2 : fallback;
69
+ }
67
70
  export function ensureDocMetadata(task, updatedBy) {
68
- task.doc_version = DOC_VERSION;
71
+ task.doc_version = normalizeDocVersion(task.doc_version);
69
72
  task.doc_updated_at = nowIso();
70
73
  const explicit = normalizeUpdatedBy(updatedBy);
71
74
  if (updatedBy !== undefined) {
@@ -3,8 +3,8 @@ import { mkdir } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { canonicalizeJson } from "@agentplaneorg/core";
5
5
  import { writeJsonStableIfChanged } from "../../../shared/write-if-changed.js";
6
- import { DEFAULT_DOC_UPDATED_BY, DOC_VERSION } from "./constants.js";
7
- import { resolveDocUpdatedByFromTask } from "./doc.js";
6
+ import { DEFAULT_DOC_UPDATED_BY } from "./constants.js";
7
+ import { normalizeDocVersion, resolveDocUpdatedByFromTask } from "./doc.js";
8
8
  import { toStringArray } from "./strings.js";
9
9
  function taskDataToExport(task) {
10
10
  const base = {
@@ -22,7 +22,7 @@ function taskDataToExport(task) {
22
22
  comments: Array.isArray(task.comments)
23
23
  ? task.comments.filter((item) => !!item && typeof item.author === "string" && typeof item.body === "string")
24
24
  : [],
25
- doc_version: task.doc_version ?? DOC_VERSION,
25
+ doc_version: normalizeDocVersion(task.doc_version),
26
26
  doc_updated_at: task.doc_updated_at ?? "",
27
27
  doc_updated_by: resolveDocUpdatedByFromTask(task, DEFAULT_DOC_UPDATED_BY),
28
28
  dirty: Boolean(task.dirty),
@@ -7,9 +7,7 @@ export type BootstrapSection = {
7
7
  };
8
8
  export declare const BOOTSTRAP_PREFLIGHT_COMMANDS: readonly ["agentplane config show", "agentplane quickstart", "agentplane task list", "git status --short --untracked-files=no", "git rev-parse --abbrev-ref HEAD"];
9
9
  export declare const BOOTSTRAP_TASK_PREP_COMMANDS: string[];
10
- export declare const BOOTSTRAP_TASK_LIFECYCLE_COMMANDS: readonly [...string[], "agentplane task start-ready <task-id> --author <ROLE> --body \"Start: ...\"", "agentplane verify <task-id> --ok|--rework --by <ROLE> --note \"...\"", "agentplane finish <task-id> --author <ROLE> --body \"Verified: ...\" --result \"...\" --commit <git-rev>"];
11
- export declare const BOOTSTRAP_VERIFY_AND_FINISH_COMMANDS: readonly ["agentplane task verify-show <task-id>", "agentplane verify <task-id> --ok|--rework --by <ROLE> --note \"...\"", "agentplane finish <task-id> --author <ROLE> --body \"Verified: ...\" --result \"...\" --commit <git-rev>"];
12
- export declare const BOOTSTRAP_VERIFICATION_COMMANDS: readonly ["agentplane task verify-show <task-id>", "agentplane verify <task-id> --ok|--rework --by <ROLE> --note \"...\"", "agentplane doctor", "node .agentplane/policy/check-routing.mjs"];
10
+ export declare const BOOTSTRAP_DIRECT_HAPPY_PATH_COMMANDS: readonly [...string[], "agentplane task start-ready <task-id> --author <ROLE> --body \"Start: ...\"", "agentplane task verify-show <task-id>", "agentplane verify <task-id> --ok|--rework --by <ROLE> --note \"...\"", "agentplane finish <task-id> --author <ROLE> --body \"Verified: ...\" --result \"...\" --commit <git-rev>"];
13
11
  export declare const BOOTSTRAP_RECOVERY_COMMANDS: readonly ["agentplane doctor", "agentplane upgrade --dry-run", "agentplane upgrade"];
14
12
  export declare const BOOTSTRAP_SECTIONS: readonly BootstrapSection[];
15
13
  export declare function renderBootstrapReferenceLine(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap-guide.d.ts","sourceRoot":"","sources":["../../src/cli/bootstrap-guide.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB,4CAA4C,CAAC;AAElF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,4BAA4B,oKAM/B,CAAC;AAEX,eAAO,MAAM,4BAA4B,UAIxC,CAAC;AAEF,eAAO,MAAM,iCAAiC,2RAKpC,CAAC;AAEX,eAAO,MAAM,oCAAoC,wOAIvC,CAAC;AAEX,eAAO,MAAM,+BAA+B,8LAKlC,CAAC;AAEX,eAAO,MAAM,2BAA2B,sFAI9B,CAAC;AAEX,eAAO,MAAM,kBAAkB,EAAE,SAAS,gBAAgB,EA+ChD,CAAC;AAEX,wBAAgB,4BAA4B,IAAI,MAAM,CAErD;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,GAAG,MAAM,EAAE,CAiB3F;AAMD,wBAAgB,kBAAkB,IAAI,MAAM,CA0B3C"}
1
+ {"version":3,"file":"bootstrap-guide.d.ts","sourceRoot":"","sources":["../../src/cli/bootstrap-guide.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB,4CAA4C,CAAC;AAElF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,4BAA4B,oKAM/B,CAAC;AAEX,eAAO,MAAM,4BAA4B,UAIxC,CAAC;AAEF,eAAO,MAAM,oCAAoC,oUAMvC,CAAC;AAEX,eAAO,MAAM,2BAA2B,sFAI9B,CAAC;AAEX,eAAO,MAAM,kBAAkB,EAAE,SAAS,gBAAgB,EAmChD,CAAC;AAEX,wBAAgB,4BAA4B,IAAI,MAAM,CAErD;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,GAAG,MAAM,EAAE,CAiB3F;AAMD,wBAAgB,kBAAkB,IAAI,MAAM,CA2B3C"}
@@ -12,23 +12,13 @@ export const BOOTSTRAP_TASK_PREP_COMMANDS = [
12
12
  'agentplane task plan set <task-id> --text "..." --updated-by <ROLE>',
13
13
  "agentplane task plan approve <task-id> --by ORCHESTRATOR",
14
14
  ];
15
- export const BOOTSTRAP_TASK_LIFECYCLE_COMMANDS = [
15
+ export const BOOTSTRAP_DIRECT_HAPPY_PATH_COMMANDS = [
16
16
  ...BOOTSTRAP_TASK_PREP_COMMANDS,
17
17
  COMMAND_SNIPPETS.core.startTask,
18
- COMMAND_SNIPPETS.core.verifyTask,
19
- 'agentplane finish <task-id> --author <ROLE> --body "Verified: ..." --result "..." --commit <git-rev>',
20
- ];
21
- export const BOOTSTRAP_VERIFY_AND_FINISH_COMMANDS = [
22
18
  "agentplane task verify-show <task-id>",
23
19
  COMMAND_SNIPPETS.core.verifyTask,
24
20
  'agentplane finish <task-id> --author <ROLE> --body "Verified: ..." --result "..." --commit <git-rev>',
25
21
  ];
26
- export const BOOTSTRAP_VERIFICATION_COMMANDS = [
27
- "agentplane task verify-show <task-id>",
28
- COMMAND_SNIPPETS.core.verifyTask,
29
- "agentplane doctor",
30
- "node .agentplane/policy/check-routing.mjs",
31
- ];
32
22
  export const BOOTSTRAP_RECOVERY_COMMANDS = [
33
23
  "agentplane doctor",
34
24
  "agentplane upgrade --dry-run",
@@ -45,36 +35,25 @@ export const BOOTSTRAP_SECTIONS = [
45
35
  ],
46
36
  },
47
37
  {
48
- heading: "2. Prepare executable task scope",
49
- summary: "Work only through executable task ids. Create the task, fill plan/docs, then approve the plan.",
50
- commands: BOOTSTRAP_TASK_PREP_COMMANDS,
38
+ heading: "2. Direct happy path",
39
+ summary: "Use one short direct-mode route: create the task, approve it, start it, verify it, and finish it.",
40
+ commands: BOOTSTRAP_DIRECT_HAPPY_PATH_COMMANDS,
51
41
  notes: [
52
42
  "Use `task doc set` to fill required README sections before approval.",
53
43
  "For dependent tasks, wait until upstream tasks are DONE before `task start-ready`.",
54
- ],
55
- },
56
- {
57
- heading: "3. Start work deterministically",
58
- summary: "Move the task to DOING only after plan approval succeeds.",
59
- commands: [COMMAND_SNIPPETS.core.startTask],
60
- notes: ["`task plan approve` and `task start-ready` must run sequentially, never in parallel."],
61
- },
62
- {
63
- heading: "4. Verify and finish",
64
- summary: "Treat Verify Steps as the contract, then record verification and close with traceable metadata.",
65
- commands: BOOTSTRAP_VERIFY_AND_FINISH_COMMANDS,
66
- notes: [
44
+ "`task plan approve` and `task start-ready` must run sequentially, never in parallel.",
67
45
  "In `direct`, `finish` creates the deterministic close commit by default.",
68
- "Use `--no-close-commit` only for explicit manual close handling.",
46
+ "Treat `task verify-show` as the verification contract right before `verify` and `finish`.",
69
47
  ],
70
48
  },
71
49
  {
72
- heading: "5. Recover mixed or broken state",
73
- summary: "Use diagnostics before manual repair, especially after framework upgrades or partial edits.",
50
+ heading: "3. Fallbacks and recovery",
51
+ summary: "Keep exceptional paths out of the normal route: use these only for recovery, framework upgrades, or branch_pr work.",
74
52
  commands: BOOTSTRAP_RECOVERY_COMMANDS,
75
53
  notes: [
76
54
  "Run `doctor` before touching managed policy files by hand.",
77
55
  "`upgrade` applies the managed framework files from the installed CLI bundle.",
56
+ "Manual close handling (`--no-close-commit`, `--close-unstage-others`) belongs here, not in the default direct path.",
78
57
  ],
79
58
  },
80
59
  ];
@@ -118,14 +97,15 @@ export function renderBootstrapDoc() {
118
97
  "",
119
98
  ...renderCommandBlock(BOOTSTRAP_PREFLIGHT_COMMANDS),
120
99
  "",
121
- "After preflight, continue with the smallest task flow that matches your mode and role.",
100
+ "After preflight, stay on the direct happy path unless the repository state is broken or you are explicitly in `branch_pr`.",
122
101
  "",
123
102
  ...renderBootstrapSectionLines(BOOTSTRAP_SECTIONS),
124
103
  "",
125
- "## Direct vs branch_pr",
104
+ "## Non-default paths",
126
105
  "",
127
- "- `direct`: work in the current checkout and finish the task yourself.",
106
+ "- `direct`: the default route is `task new/plan approve/start-ready -> task verify-show -> verify -> finish`.",
128
107
  "- `branch_pr`: start a task branch/worktree, maintain PR artifacts, and let INTEGRATOR close on base.",
108
+ "- Use manual close flags only when a specific policy or recovery situation requires them.",
129
109
  "",
130
110
  ];
131
111
  return `${lines.join("\n")}\n`;
@@ -1 +1 @@
1
- {"version":3,"file":"command-guide.d.ts","sourceRoot":"","sources":["../../src/cli/command-guide.ts"],"names":[],"mappings":"AA+GA,wBAAgB,SAAS,IAAI,MAAM,EAAE,CAEpC;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOzD;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAsCzC"}
1
+ {"version":3,"file":"command-guide.d.ts","sourceRoot":"","sources":["../../src/cli/command-guide.ts"],"names":[],"mappings":"AA4GA,wBAAgB,SAAS,IAAI,MAAM,EAAE,CAEpC;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOzD;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAoCzC"}
@@ -1,17 +1,8 @@
1
1
  import { COMMAND_SNIPPETS } from "./command-snippets.js";
2
- import { AGENT_BOOTSTRAP_DOC_PATH, BOOTSTRAP_SECTIONS, renderBootstrapReferenceLine, } from "./bootstrap-guide.js";
3
- function renderBootstrapOverview() {
4
- const lines = [];
5
- for (const section of BOOTSTRAP_SECTIONS) {
6
- lines.push(`## ${section.heading}`, "", section.summary, "");
7
- for (const command of section.commands) {
8
- lines.push(`- \`${command}\``);
9
- }
10
- lines.push("");
11
- }
12
- if (lines.at(-1) === "")
13
- lines.pop();
14
- return lines;
2
+ import { AGENT_BOOTSTRAP_DOC_PATH, BOOTSTRAP_PREFLIGHT_COMMANDS, BOOTSTRAP_TASK_PREP_COMMANDS, } from "./bootstrap-guide.js";
3
+ const CLI_REFERENCE_DOC_PATH = "docs/user/cli-reference.generated.mdx";
4
+ function renderQuickstartCommandBlock(commands) {
5
+ return ["```bash", ...commands, "```"];
15
6
  }
16
7
  const ROLE_GUIDES = [
17
8
  {
@@ -39,6 +30,7 @@ const ROLE_GUIDES = [
39
30
  `- Start deterministically with \`${COMMAND_SNIPPETS.core.startTask}\` after plan approval.`,
40
31
  '- Treat `agentplane task verify-show <task-id>` as the verification contract, then record `agentplane verify <task-id> --ok|--rework --by <ROLE> --note "..."`.',
41
32
  `- Preferred direct close path: \`${COMMAND_SNIPPETS.core.finishTask}\` with \`--result "..." \`; add \`--no-close-commit\` only for explicit manual close handling.`,
33
+ "- For manual close or allowlist detail, use `agentplane help finish` and `agentplane help commit` on demand.",
42
34
  ],
43
35
  },
44
36
  {
@@ -48,6 +40,7 @@ const ROLE_GUIDES = [
48
40
  "- Start only after plan approval and explicit Verify Steps exist.",
49
41
  '- Use `agentplane task verify-show <task-id>` before running checks, then record `agentplane verify <task-id> --ok|--rework --by <ROLE> --note "..."`.',
50
42
  `- In direct mode, close with \`${COMMAND_SNIPPETS.core.finishTask}\` plus \`--result "..." \` when you own final verification.`,
43
+ "- For mixed-state recovery or runtime ambiguity, use `agentplane doctor` and `agentplane runtime explain` instead of relying on the short quickstart screen.",
51
44
  ],
52
45
  },
53
46
  {
@@ -56,6 +49,7 @@ const ROLE_GUIDES = [
56
49
  `- Shared bootstrap path: \`${COMMAND_SNIPPETS.core.quickstart}\` -> \`${AGENT_BOOTSTRAP_DOC_PATH}\`.`,
57
50
  '- Keep task docs and user docs aligned with runtime behavior via `agentplane task doc set <task-id> --section <name> --text "..."`.',
58
51
  "- For implementation tasks, verify generated/help surfaces after changing CLI-facing text.",
52
+ `- Treat \`${CLI_REFERENCE_DOC_PATH}\` as the deep reference surface; keep first-screen help intentionally shorter.`,
59
53
  ],
60
54
  },
61
55
  {
@@ -72,6 +66,7 @@ const ROLE_GUIDES = [
72
66
  `- Shared bootstrap path: \`${COMMAND_SNIPPETS.core.quickstart}\` -> \`${AGENT_BOOTSTRAP_DOC_PATH}\`.`,
73
67
  '- branch_pr: `agentplane pr check <task-id>` -> `agentplane integrate <task-id> --branch task/<task-id>/<slug> --merge-strategy squash --run-verify` -> `agentplane finish <task-id> --commit <git-rev> --author INTEGRATOR --body "Verified: ..." --result "..." --close-commit`.',
74
68
  `- direct: the task owner normally closes with \`${COMMAND_SNIPPETS.core.finishTask}\` plus \`--result "..." \`.`,
69
+ "- For branch-level flags and branch/base diagnostics, use `agentplane help work start`, `agentplane help integrate`, and `agentplane help branch base`.",
75
70
  ],
76
71
  },
77
72
  {
@@ -115,38 +110,36 @@ export function renderQuickstart() {
115
110
  return [
116
111
  "# agentplane quickstart",
117
112
  "",
118
- "The policy gateway file (AGENTS.md or CLAUDE.md) is the source of truth for workflow/process policy. CLI syntax lives in quickstart and `agentplane role <ROLE>`.",
113
+ "The policy gateway file (AGENTS.md or CLAUDE.md) is the source of truth for workflow/process policy.",
114
+ "Keep this first screen short: use it for startup only, then go deeper with `agentplane role <ROLE>` or `agentplane help <command>`.",
119
115
  "Do not edit `.agentplane/tasks.json` by hand.",
120
116
  "If the repository is not initialized yet, stop and run `agentplane init` first.",
121
117
  "",
122
- renderBootstrapReferenceLine(),
118
+ `Canonical bootstrap doc: \`${AGENT_BOOTSTRAP_DOC_PATH}\`.`,
123
119
  "",
124
- ...renderBootstrapOverview(),
120
+ "## First screen",
125
121
  "",
126
- "## Role-specific deltas",
122
+ "Run preflight:",
127
123
  "",
128
- `- Use \`${COMMAND_SNIPPETS.core.role}\` for role-specific constraints after you understand the shared bootstrap path.`,
129
- "- Role output should add deltas, not replace the canonical bootstrap flow.",
124
+ ...renderQuickstartCommandBlock(BOOTSTRAP_PREFLIGHT_COMMANDS),
130
125
  "",
131
- "## Branch workflow extras",
126
+ "Default direct route:",
132
127
  "",
133
- "- `agentplane work start <task-id> --agent <ROLE> --slug <slug> --worktree`",
134
- "- `agentplane pr open <task-id>` / `agentplane pr update <task-id>` / `agentplane pr check <task-id>`",
135
- "- `agentplane integrate <task-id> --branch task/<task-id>/<slug> --run-verify`",
128
+ `- Task setup: \`${BOOTSTRAP_TASK_PREP_COMMANDS[0]}\` -> \`${BOOTSTRAP_TASK_PREP_COMMANDS[1]}\` -> \`${BOOTSTRAP_TASK_PREP_COMMANDS[2]}\`.`,
129
+ `- Execution: \`${COMMAND_SNIPPETS.core.startTask}\` -> \`agentplane task verify-show <task-id>\` -> \`${COMMAND_SNIPPETS.core.verifyTask}\` -> \`${COMMAND_SNIPPETS.core.finishTask}\` with \`--result "..." \`.`,
130
+ "- In `direct`, `finish` creates the deterministic close commit by default.",
136
131
  "",
137
- "## More guidance",
132
+ "## Go deeper",
138
133
  "",
139
- "- `agentplane help <command>` for command-level flags and examples.",
140
- `- \`${COMMAND_SNIPPETS.core.role}\` for role-specific deltas.`,
141
- `- \`${AGENT_BOOTSTRAP_DOC_PATH}\` for the canonical startup path in repository docs.`,
134
+ `- \`${COMMAND_SNIPPETS.core.role}\` for role-specific deltas and mode-specific ownership rules.`,
135
+ "- `agentplane help <command>` for flags, examples, and exceptional/manual flows.",
136
+ `- \`${AGENT_BOOTSTRAP_DOC_PATH}\` for the full startup path instead of repeating it on the first screen.`,
137
+ `- \`${CLI_REFERENCE_DOC_PATH}\` for the generated full command reference.`,
142
138
  "",
143
- "## Commit message format",
139
+ "## Non-default",
144
140
  "",
145
- "Use: `<emoji> <suffix> <scope>: <summary>`.",
146
- "",
147
- "Notes:",
148
- "- `suffix` is the task ID segment after the last dash.",
149
- "- When using comment-driven flags, the subject is auto-built as `<emoji> <suffix> <primary>: <status>` and only for major transitions (TODO->DOING, DOING->BLOCKED, BLOCKED->DOING, DOING->DONE).",
150
- "- Comment-driven commit bodies are structured: `Task`, `Primary`, `Status`, `Comment`.",
141
+ "- `branch_pr`: use `agentplane help work start`, `agentplane help pr`, and `agentplane help integrate`.",
142
+ "- Recovery/mixed state: use `agentplane doctor`, `agentplane upgrade`, and `agentplane runtime explain`.",
143
+ "- Manual close or allowlist details belong in command-specific help, not on this first screen.",
151
144
  ].join("\n");
152
145
  }
@@ -0,0 +1,7 @@
1
+ import { COMMANDS } from "./command-catalog.js";
2
+ export type CatalogMatch = {
3
+ entry: (typeof COMMANDS)[number];
4
+ consumed: number;
5
+ };
6
+ export declare function matchCommandCatalog(tokens: readonly string[]): CatalogMatch | null;
7
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/cli/run-cli/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,EAAE,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAElF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,YAAY,GAAG,IAAI,CAkBlF"}
@@ -0,0 +1,22 @@
1
+ import { COMMANDS } from "./command-catalog.js";
2
+ export function matchCommandCatalog(tokens) {
3
+ let best = null;
4
+ for (const entry of COMMANDS) {
5
+ const id = entry.spec.id;
6
+ if (tokens.length < id.length)
7
+ continue;
8
+ let ok = true;
9
+ for (const [i, seg] of id.entries()) {
10
+ if (tokens[i] !== seg) {
11
+ ok = false;
12
+ break;
13
+ }
14
+ }
15
+ if (!ok)
16
+ continue;
17
+ if (!best || id.length > best.consumed) {
18
+ best = { entry, consumed: id.length };
19
+ }
20
+ }
21
+ return best;
22
+ }
@@ -15,5 +15,5 @@ export type CommandEntry = {
15
15
  needsConfig: boolean;
16
16
  needsTaskContext: boolean;
17
17
  };
18
- export declare const COMMANDS: readonly [CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry];
18
+ export declare const COMMANDS: readonly [CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry, CommandEntry];
19
19
  //# sourceMappingURL=command-catalog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-catalog.d.ts","sourceRoot":"","sources":["../../../src/cli/run-cli/command-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAkHvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEzE,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,CAAC,s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IAC3E,kBAAkB,EAAE,MAAM,SAAS,QAAQ,EAAE,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC3B,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAgBF,eAAO,MAAM,QAAQ,+5CA6iBuB,CAAC"}
@@ -67,6 +67,7 @@ import { workflowBuildSpec } from "../../commands/workflow-build.command.js";
67
67
  import { workflowRestoreSpec } from "../../commands/workflow-restore.command.js";
68
68
  import { workflowDebugSpec, workflowLandSpec, workflowSyncSpec, } from "../../commands/workflow-playbook.command.js";
69
69
  import { docsCliSpec } from "../../commands/docs/cli.command.js";
70
+ import { runtimeExplainSpec, runtimeSpec } from "../../commands/runtime.command.js";
70
71
  import { hooksSpec } from "../../commands/hooks/hooks.command.js";
71
72
  import { hooksInstallSpec } from "../../commands/hooks/install.command.js";
72
73
  import { hooksUninstallSpec } from "../../commands/hooks/uninstall.command.js";
@@ -124,6 +125,16 @@ export const COMMANDS = [
124
125
  needsConfig: false,
125
126
  needsTaskContext: false,
126
127
  }),
128
+ entry(runtimeSpec, () => import("../../commands/runtime.command.js").then((m) => m.runRuntime), {
129
+ needsProject: false,
130
+ needsConfig: false,
131
+ needsTaskContext: false,
132
+ }),
133
+ entry(runtimeExplainSpec, () => import("../../commands/runtime.command.js").then((m) => m.runRuntimeExplain), {
134
+ needsProject: false,
135
+ needsConfig: false,
136
+ needsTaskContext: false,
137
+ }),
127
138
  entry(roleSpec, () => import("./commands/core.js").then((m) => m.runRole), {
128
139
  needsProject: false,
129
140
  needsConfig: false,
@@ -1 +1 @@
1
- {"version":3,"file":"write-config.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/write-config.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,cAAc,GAAG,UAAU,GAAG,YAAY,CAAC;IACpD,gBAAgB,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC5C,WAAW,EAAE;QACX,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,yCAAyC,EAAE,MAAM,EAAE,CAAC;CACrD,CAAC;AAEF,wBAAsB,oBAAoB,CACxC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,OAAO,GAAG,SAAS,GAC3B,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC;IACjC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,sBAAsB,EAAE,OAAO,CAAC;IAChC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,SAAS,EAAE,mBAAmB,CAAC;CAChC,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBhB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBhB"}
1
+ {"version":3,"file":"write-config.d.ts","sourceRoot":"","sources":["../../../../../src/cli/run-cli/commands/init/write-config.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,cAAc,GAAG,UAAU,GAAG,YAAY,CAAC;IACpD,gBAAgB,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC5C,WAAW,EAAE;QACX,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,yCAAyC,EAAE,MAAM,EAAE,CAAC;CACrD,CAAC;AAEF,wBAAsB,oBAAoB,CACxC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,OAAO,GAAG,SAAS,GAC3B,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC;IACjC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,sBAAsB,EAAE,OAAO,CAAC;IAChC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,SAAS,EAAE,mBAAmB,CAAC;CAChC,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BhB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBhB"}
@@ -2,6 +2,7 @@ import { mkdir } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { defaultConfig, saveConfig, setByDottedKey } from "@agentplaneorg/core";
4
4
  import { writeJsonStableIfChanged } from "../../../../shared/write-if-changed.js";
5
+ import { getVersion } from "../../../../meta/version.js";
5
6
  export async function ensureAgentplaneDirs(agentplaneDir, backend) {
6
7
  await mkdir(agentplaneDir, { recursive: true });
7
8
  await mkdir(path.join(agentplaneDir, "tasks"), { recursive: true });
@@ -21,6 +22,7 @@ export async function writeInitConfig(opts) {
21
22
  setByDottedKey(rawConfig, "agents.approvals.require_plan", String(opts.requirePlanApproval));
22
23
  setByDottedKey(rawConfig, "agents.approvals.require_network", String(opts.requireNetworkApproval));
23
24
  setByDottedKey(rawConfig, "agents.approvals.require_verify", String(opts.requireVerifyApproval));
25
+ setByDottedKey(rawConfig, "framework.cli.expected_version", getVersion());
24
26
  setByDottedKey(rawConfig, "execution", JSON.stringify(opts.execution));
25
27
  await saveConfig(opts.agentplaneDir, rawConfig);
26
28
  }