agentplane 0.3.8 → 0.3.10

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 (268) hide show
  1. package/assets/AGENTS.md +4 -2
  2. package/assets/agents/CODER.json +1 -1
  3. package/assets/policy/dod.core.md +1 -1
  4. package/assets/policy/governance.md +3 -0
  5. package/assets/policy/incidents.md +22 -11
  6. package/assets/policy/workflow.branch_pr.md +2 -0
  7. package/assets/policy/workflow.direct.md +3 -1
  8. package/dist/.build-manifest.json +323 -128
  9. package/dist/cli/bootstrap-guide.d.ts +1 -0
  10. package/dist/cli/bootstrap-guide.d.ts.map +1 -1
  11. package/dist/cli/bootstrap-guide.js +19 -1
  12. package/dist/cli/command-invocations.d.ts.map +1 -1
  13. package/dist/cli/command-invocations.js +2 -0
  14. package/dist/cli/command-snippets.d.ts +2 -0
  15. package/dist/cli/command-snippets.d.ts.map +1 -1
  16. package/dist/cli/command-snippets.js +2 -0
  17. package/dist/cli/run-cli/command-catalog/core.d.ts +1 -1
  18. package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
  19. package/dist/cli/run-cli/command-catalog/core.js +10 -0
  20. package/dist/cli/run-cli/command-catalog.d.ts +1 -1
  21. package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
  22. package/dist/cli/run-cli/commands/config.d.ts.map +1 -1
  23. package/dist/cli/run-cli/commands/config.js +13 -0
  24. package/dist/cli/run-cli.js +2 -2
  25. package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
  26. package/dist/cli/run-cli.test-helpers.js +34 -8
  27. package/dist/commands/backend.d.ts.map +1 -1
  28. package/dist/commands/backend.js +4 -0
  29. package/dist/commands/hooks/index.d.ts.map +1 -1
  30. package/dist/commands/hooks/index.js +8 -4
  31. package/dist/commands/incidents/advise.command.d.ts +15 -0
  32. package/dist/commands/incidents/advise.command.d.ts.map +1 -0
  33. package/dist/commands/incidents/advise.command.js +139 -0
  34. package/dist/commands/incidents/collect.command.d.ts +11 -0
  35. package/dist/commands/incidents/collect.command.d.ts.map +1 -0
  36. package/dist/commands/incidents/collect.command.js +67 -0
  37. package/dist/commands/incidents/incidents.command.d.ts +5 -0
  38. package/dist/commands/incidents/incidents.command.d.ts.map +1 -0
  39. package/dist/commands/incidents/incidents.command.js +21 -0
  40. package/dist/commands/incidents/shared.d.ts +42 -0
  41. package/dist/commands/incidents/shared.d.ts.map +1 -0
  42. package/dist/commands/incidents/shared.js +107 -0
  43. package/dist/commands/pr/check.d.ts.map +1 -1
  44. package/dist/commands/pr/check.js +73 -2
  45. package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
  46. package/dist/commands/pr/integrate/cmd.js +4 -0
  47. package/dist/commands/pr/integrate/internal/merge.d.ts +4 -0
  48. package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -1
  49. package/dist/commands/pr/integrate/internal/merge.js +23 -2
  50. package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
  51. package/dist/commands/pr/integrate/internal/prepare.js +26 -1
  52. package/dist/commands/pr/internal/note-store.d.ts +18 -0
  53. package/dist/commands/pr/internal/note-store.d.ts.map +1 -0
  54. package/dist/commands/pr/internal/note-store.js +66 -0
  55. package/dist/commands/pr/internal/pr-paths.d.ts +3 -0
  56. package/dist/commands/pr/internal/pr-paths.d.ts.map +1 -1
  57. package/dist/commands/pr/internal/pr-paths.js +3 -0
  58. package/dist/commands/pr/internal/review-template.d.ts +24 -4
  59. package/dist/commands/pr/internal/review-template.d.ts.map +1 -1
  60. package/dist/commands/pr/internal/review-template.js +188 -33
  61. package/dist/commands/pr/internal/sync.d.ts +32 -0
  62. package/dist/commands/pr/internal/sync.d.ts.map +1 -0
  63. package/dist/commands/pr/internal/sync.js +258 -0
  64. package/dist/commands/pr/note.d.ts.map +1 -1
  65. package/dist/commands/pr/note.js +37 -4
  66. package/dist/commands/pr/open.d.ts.map +1 -1
  67. package/dist/commands/pr/open.js +7 -54
  68. package/dist/commands/pr/pr.command.d.ts.map +1 -1
  69. package/dist/commands/pr/pr.command.js +6 -3
  70. package/dist/commands/pr/update.d.ts.map +1 -1
  71. package/dist/commands/pr/update.js +5 -79
  72. package/dist/commands/recipes/impl/apply.d.ts +1 -1
  73. package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
  74. package/dist/commands/recipes/impl/apply.js +1 -1
  75. package/dist/commands/recipes/impl/commands/cache-prune.d.ts.map +1 -1
  76. package/dist/commands/recipes/impl/commands/cache-prune.js +14 -0
  77. package/dist/commands/recipes/impl/commands/explain.js +1 -1
  78. package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
  79. package/dist/commands/recipes/impl/commands/install.js +3 -2
  80. package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -1
  81. package/dist/commands/recipes/impl/commands/list-remote.js +1 -0
  82. package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
  83. package/dist/commands/recipes/impl/commands/remove.js +9 -1
  84. package/dist/commands/recipes/impl/installed-recipes.d.ts +1 -1
  85. package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
  86. package/dist/commands/recipes/impl/installed-recipes.js +2 -1
  87. package/dist/commands/recipes/impl/project-installed-recipes.d.ts +1 -1
  88. package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -1
  89. package/dist/commands/recipes/impl/project-installed-recipes.js +2 -1
  90. package/dist/commands/recipes/impl/resolver.d.ts +1 -1
  91. package/dist/commands/recipes/impl/resolver.d.ts.map +1 -1
  92. package/dist/commands/recipes/impl/resolver.js +1 -1
  93. package/dist/commands/recipes.d.ts +4 -4
  94. package/dist/commands/recipes.d.ts.map +1 -1
  95. package/dist/commands/recipes.js +3 -3
  96. package/dist/commands/release/apply.command.d.ts.map +1 -1
  97. package/dist/commands/release/apply.command.js +9 -0
  98. package/dist/commands/release.test-helpers.d.ts +14 -0
  99. package/dist/commands/release.test-helpers.d.ts.map +1 -1
  100. package/dist/commands/release.test-helpers.js +14 -3
  101. package/dist/commands/shared/approval-requirements.d.ts +5 -7
  102. package/dist/commands/shared/approval-requirements.d.ts.map +1 -1
  103. package/dist/commands/shared/approval-requirements.js +3 -73
  104. package/dist/commands/shared/network-approval.d.ts +2 -0
  105. package/dist/commands/shared/network-approval.d.ts.map +1 -1
  106. package/dist/commands/shared/network-approval.js +1 -1
  107. package/dist/commands/shared/pr-meta.d.ts +9 -0
  108. package/dist/commands/shared/pr-meta.d.ts.map +1 -1
  109. package/dist/commands/shared/pr-meta.js +27 -3
  110. package/dist/commands/shared/task-backend.d.ts +2 -0
  111. package/dist/commands/shared/task-backend.d.ts.map +1 -1
  112. package/dist/commands/shared/task-local-freshness.d.ts +13 -0
  113. package/dist/commands/shared/task-local-freshness.d.ts.map +1 -0
  114. package/dist/commands/shared/task-local-freshness.js +20 -0
  115. package/dist/commands/shared/task-mutation.d.ts +2 -0
  116. package/dist/commands/shared/task-mutation.d.ts.map +1 -1
  117. package/dist/commands/shared/task-mutation.js +7 -0
  118. package/dist/commands/task/block.d.ts.map +1 -1
  119. package/dist/commands/task/block.js +1 -0
  120. package/dist/commands/task/close-shared.d.ts.map +1 -1
  121. package/dist/commands/task/close-shared.js +1 -0
  122. package/dist/commands/task/finish-shared.d.ts.map +1 -1
  123. package/dist/commands/task/finish-shared.js +5 -2
  124. package/dist/commands/task/finish.d.ts.map +1 -1
  125. package/dist/commands/task/finish.js +24 -0
  126. package/dist/commands/task/new.d.ts.map +1 -1
  127. package/dist/commands/task/new.js +69 -29
  128. package/dist/commands/task/set-status.d.ts.map +1 -1
  129. package/dist/commands/task/set-status.js +1 -0
  130. package/dist/commands/task/shared/transition-command.d.ts +2 -0
  131. package/dist/commands/task/shared/transition-command.d.ts.map +1 -1
  132. package/dist/commands/task/shared/transition-command.js +1 -0
  133. package/dist/commands/task/start-ready.d.ts.map +1 -1
  134. package/dist/commands/task/start-ready.js +12 -1
  135. package/dist/commands/task/start.d.ts.map +1 -1
  136. package/dist/commands/task/start.js +11 -0
  137. package/dist/commands/task/verify-record.d.ts.map +1 -1
  138. package/dist/commands/task/verify-record.js +27 -0
  139. package/dist/commands/upgrade.d.ts.map +1 -1
  140. package/dist/commands/upgrade.js +6 -1
  141. package/dist/policy/engine.d.ts +3 -1
  142. package/dist/policy/engine.d.ts.map +1 -1
  143. package/dist/policy/engine.js +5 -6
  144. package/dist/policy/taxonomy.d.ts +17 -0
  145. package/dist/policy/taxonomy.d.ts.map +1 -0
  146. package/dist/policy/taxonomy.js +302 -0
  147. package/dist/policy/types.d.ts +2 -1
  148. package/dist/policy/types.d.ts.map +1 -1
  149. package/dist/runner/artifacts.d.ts.map +1 -1
  150. package/dist/runner/artifacts.js +2 -0
  151. package/dist/runner/context/base-prompts.d.ts +25 -0
  152. package/dist/runner/context/base-prompts.d.ts.map +1 -1
  153. package/dist/runner/context/base-prompts.js +182 -54
  154. package/dist/runner/context/recipe-context.d.ts.map +1 -1
  155. package/dist/runner/context/recipe-context.js +5 -0
  156. package/dist/runner/types.d.ts +12 -0
  157. package/dist/runner/types.d.ts.map +1 -1
  158. package/dist/runner/usecases/scenario-materialize-task.d.ts.map +1 -1
  159. package/dist/runner/usecases/scenario-materialize-task.js +81 -11
  160. package/dist/runner/usecases/task-run-inspect.d.ts.map +1 -1
  161. package/dist/runner/usecases/task-run-inspect.js +9 -7
  162. package/dist/runner/usecases/task-run-lifecycle-shared.d.ts.map +1 -1
  163. package/dist/runner/usecases/task-run-lifecycle-shared.js +8 -6
  164. package/dist/runner/usecases/task-run.d.ts.map +1 -1
  165. package/dist/runner/usecases/task-run.js +59 -12
  166. package/dist/runtime/approvals/index.d.ts +3 -0
  167. package/dist/runtime/approvals/index.d.ts.map +1 -0
  168. package/dist/runtime/approvals/index.js +1 -0
  169. package/dist/runtime/approvals/runtime.d.ts +12 -0
  170. package/dist/runtime/approvals/runtime.d.ts.map +1 -0
  171. package/dist/runtime/approvals/runtime.js +154 -0
  172. package/dist/runtime/approvals/types.d.ts +31 -0
  173. package/dist/runtime/approvals/types.d.ts.map +1 -0
  174. package/dist/runtime/approvals/types.js +1 -0
  175. package/dist/runtime/behavior/index.d.ts +3 -0
  176. package/dist/runtime/behavior/index.d.ts.map +1 -0
  177. package/dist/runtime/behavior/index.js +1 -0
  178. package/dist/runtime/behavior/resolve.d.ts +7 -0
  179. package/dist/runtime/behavior/resolve.d.ts.map +1 -0
  180. package/dist/runtime/behavior/resolve.js +66 -0
  181. package/dist/runtime/behavior/types.d.ts +25 -0
  182. package/dist/runtime/behavior/types.d.ts.map +1 -0
  183. package/dist/runtime/behavior/types.js +1 -0
  184. package/dist/runtime/capabilities/backend.d.ts +7 -0
  185. package/dist/runtime/capabilities/backend.d.ts.map +1 -0
  186. package/dist/runtime/capabilities/backend.js +104 -0
  187. package/dist/runtime/capabilities/index.d.ts +6 -0
  188. package/dist/runtime/capabilities/index.d.ts.map +1 -0
  189. package/dist/runtime/capabilities/index.js +4 -0
  190. package/dist/runtime/capabilities/recipe.d.ts +10 -0
  191. package/dist/runtime/capabilities/recipe.d.ts.map +1 -0
  192. package/dist/runtime/capabilities/recipe.js +123 -0
  193. package/dist/runtime/capabilities/registry.d.ts +6 -0
  194. package/dist/runtime/capabilities/registry.d.ts.map +1 -0
  195. package/dist/runtime/capabilities/registry.js +69 -0
  196. package/dist/runtime/capabilities/runner.d.ts +8 -0
  197. package/dist/runtime/capabilities/runner.d.ts.map +1 -0
  198. package/dist/runtime/capabilities/runner.js +73 -0
  199. package/dist/runtime/capabilities/types.d.ts +28 -0
  200. package/dist/runtime/capabilities/types.d.ts.map +1 -0
  201. package/dist/runtime/capabilities/types.js +1 -0
  202. package/dist/runtime/execution-profile/index.d.ts +3 -0
  203. package/dist/runtime/execution-profile/index.d.ts.map +1 -0
  204. package/dist/runtime/execution-profile/index.js +1 -0
  205. package/dist/runtime/execution-profile/resolve.d.ts +9 -0
  206. package/dist/runtime/execution-profile/resolve.d.ts.map +1 -0
  207. package/dist/runtime/execution-profile/resolve.js +80 -0
  208. package/dist/runtime/execution-profile/types.d.ts +27 -0
  209. package/dist/runtime/execution-profile/types.d.ts.map +1 -0
  210. package/dist/runtime/execution-profile/types.js +1 -0
  211. package/dist/runtime/explain/index.d.ts +3 -0
  212. package/dist/runtime/explain/index.d.ts.map +1 -0
  213. package/dist/runtime/explain/index.js +1 -0
  214. package/dist/runtime/explain/resolve.d.ts +14 -0
  215. package/dist/runtime/explain/resolve.d.ts.map +1 -0
  216. package/dist/runtime/explain/resolve.js +50 -0
  217. package/dist/runtime/explain/types.d.ts +28 -0
  218. package/dist/runtime/explain/types.d.ts.map +1 -0
  219. package/dist/runtime/explain/types.js +1 -0
  220. package/dist/runtime/harness/index.d.ts +4 -0
  221. package/dist/runtime/harness/index.d.ts.map +1 -0
  222. package/dist/runtime/harness/index.js +2 -0
  223. package/dist/runtime/harness/resolve-from-command-context.d.ts +4 -0
  224. package/dist/runtime/harness/resolve-from-command-context.d.ts.map +1 -0
  225. package/dist/runtime/harness/resolve-from-command-context.js +11 -0
  226. package/dist/runtime/harness/resolve.d.ts +13 -0
  227. package/dist/runtime/harness/resolve.d.ts.map +1 -0
  228. package/dist/runtime/harness/resolve.js +146 -0
  229. package/dist/runtime/harness/types.d.ts +65 -0
  230. package/dist/runtime/harness/types.d.ts.map +1 -0
  231. package/dist/runtime/harness/types.js +1 -0
  232. package/dist/runtime/incidents/index.d.ts +3 -0
  233. package/dist/runtime/incidents/index.d.ts.map +1 -0
  234. package/dist/runtime/incidents/index.js +1 -0
  235. package/dist/runtime/incidents/resolve.d.ts +26 -0
  236. package/dist/runtime/incidents/resolve.d.ts.map +1 -0
  237. package/dist/runtime/incidents/resolve.js +437 -0
  238. package/dist/runtime/incidents/types.d.ts +72 -0
  239. package/dist/runtime/incidents/types.d.ts.map +1 -0
  240. package/dist/runtime/incidents/types.js +1 -0
  241. package/dist/runtime/protocol/index.d.ts +3 -0
  242. package/dist/runtime/protocol/index.d.ts.map +1 -0
  243. package/dist/runtime/protocol/index.js +2 -0
  244. package/dist/runtime/protocol/resolve.d.ts +16 -0
  245. package/dist/runtime/protocol/resolve.d.ts.map +1 -0
  246. package/dist/runtime/protocol/resolve.js +36 -0
  247. package/dist/runtime/protocol/types.d.ts +36 -0
  248. package/dist/runtime/protocol/types.d.ts.map +1 -0
  249. package/dist/runtime/protocol/types.js +1 -0
  250. package/dist/runtime/task-intake/index.d.ts +3 -0
  251. package/dist/runtime/task-intake/index.d.ts.map +1 -0
  252. package/dist/runtime/task-intake/index.js +1 -0
  253. package/dist/runtime/task-intake/resolve.d.ts +48 -0
  254. package/dist/runtime/task-intake/resolve.d.ts.map +1 -0
  255. package/dist/runtime/task-intake/resolve.js +316 -0
  256. package/dist/runtime/task-intake/types.d.ts +117 -0
  257. package/dist/runtime/task-intake/types.d.ts.map +1 -0
  258. package/dist/runtime/task-intake/types.js +1 -0
  259. package/dist/shared/protected-paths.d.ts +4 -0
  260. package/dist/shared/protected-paths.d.ts.map +1 -1
  261. package/dist/shared/protected-paths.js +4 -4
  262. package/dist/usecases/context/resolve-context.d.ts +55 -6
  263. package/dist/usecases/context/resolve-context.d.ts.map +1 -1
  264. package/dist/usecases/context/resolve-context.js +96 -6
  265. package/dist/usecases/task/task-list-usecase.d.ts.map +1 -1
  266. package/dist/usecases/task/task-list-usecase.js +8 -2
  267. package/dist/usecases/task/task-new-usecase.js +4 -4
  268. package/package.json +2 -3
package/assets/AGENTS.md CHANGED
@@ -17,7 +17,7 @@ Detailed procedures live in canonical modules from `## CANONICAL DOCS`.
17
17
  - Repository type: user project initialized with `agentplane`.
18
18
  - Gateway role: keep this file compact and deterministic; move scenario-specific details to policy modules.
19
19
  - CLI rule: use `agentplane` from `PATH`; if unavailable, stop and request installation guidance (do not invent repo-local entrypoints).
20
- - Startup shortcut: run `## COMMANDS -> Preflight`, then use `agentplane quickstart`; activate `agentplane role ORCHESTRATOR` for planning and `agentplane role <ROLE>` for the active owner before owner-scoped execution; then apply `## LOAD RULES` before any mutation. In this repository, `workflow_mode=branch_pr`, so the normal guarded route starts from `agentplane work start ... --worktree` on the base branch; treat `direct` as an explicit alternative only when intentionally selected.
20
+ - Startup shortcut: run `## COMMANDS -> Preflight`, then use `agentplane quickstart`; activate `agentplane role ORCHESTRATOR` for planning and `agentplane role <ROLE>` for the active owner before owner-scoped execution; then apply `## LOAD RULES` before any mutation. The guarded route is determined by `workflow_mode` in `.agentplane/config.json`; use `agentplane quickstart` as the canonical summary of the active path before mutating. In `branch_pr`, start from `agentplane work start ... --worktree`; in `direct`, stay in the current checkout and use the task lifecycle route.
21
21
 
22
22
  ---
23
23
 
@@ -84,6 +84,8 @@ agentplane finish <task-id> --author INTEGRATOR --body "Verified: ..." --result
84
84
  ```bash
85
85
  agentplane task verify-show <task-id>
86
86
  agentplane verify <task-id> --ok|--rework --by <ROLE> --note "..."
87
+ agentplane incidents advise <task-id>
88
+ agentplane incidents collect <task-id> --check
87
89
  agentplane doctor
88
90
  node .agentplane/policy/check-routing.mjs
89
91
  ```
@@ -207,5 +209,5 @@ Detailed DoD rules are in `.agentplane/policy/dod.core.md`, `.agentplane/policy/
207
209
  ## CHANGE CONTROL
208
210
 
209
211
  - Follow incident-log, immutability, and policy-budget rules in `.agentplane/policy/governance.md`.
210
- - Record situational incident rules only in `.agentplane/policy/incidents.md`; do not load/read that file during normal startup unless the task directly touches it or recovery/incident handling requires it.
212
+ - Record situational incident rules only in `.agentplane/policy/incidents.md`; use targeted lookup/promotion (`task start-ready`, `incidents advise`, `incidents collect`, `finish`) instead of bulk-loading it during normal startup.
211
213
  - Keep `AGENTS.md` as a gateway; move detailed procedures to canonical modules.
@@ -24,7 +24,7 @@
24
24
  "Document edits with exact file paths and concise before/after rationale.",
25
25
  "Run the smallest sufficient local commands (tests/linters/formatters) and summarize only the output lines that change a decision.",
26
26
  "Prefer declared verify commands; treat `Verify Steps` as the acceptance contract and request PLANNER updates when the contract itself drifts.",
27
- "Record local deviations, follow-ups, and incident candidates in the task-local observation section (`Notes` for v2, `Findings` for v3); do not promote directly into policy incidents.",
27
+ "Record local deviations, follow-ups, and incident candidates in the task-local observation section (`Notes` for v2, `Findings` for v3); use structured `incident-candidate` blocks for external/unfixable-in-repo incidents and let `finish` or `agentplane incidents collect` promote them.",
28
28
  "Separate confirmed facts, inferred risks, and open questions in handoff summaries.",
29
29
  "Coordinate handoffs to TESTER/REVIEWER/DOCS only when those roles already have explicit executable tasks; otherwise keep findings and verification in the same task.",
30
30
  "Avoid task closure in branch_pr; keep commits task-scoped and update status via agentplane."
@@ -34,7 +34,7 @@ Target `doc_version=3` tasks use:
34
34
  - `Rollback Plan`
35
35
  - `Findings`
36
36
 
37
- `Findings` is task-local. Policy incidents are curated separately in `.agentplane/policy/incidents.md`.
37
+ `Findings` is task-local. Reusable external incident advice stays there first, then is promoted into `.agentplane/policy/incidents.md` through `finish` or `agentplane incidents collect <task-id>`.
38
38
 
39
39
  ## Material drift criteria
40
40
 
@@ -5,6 +5,9 @@
5
5
  - `.agentplane/policy/incidents.md` is the single incident registry.
6
6
  - Incident-derived and situational rules MUST be added only to `incidents.md`.
7
7
  - MUST NOT create additional incident policy files under `.agentplane/policy/`.
8
+ - New reusable operational incidents SHOULD be promoted from task `Findings` via `agentplane finish` or `agentplane incidents collect <task-id>`.
9
+ - Auto-promotion is reserved for explicit `incident-candidate` blocks marked `IncidentExternal: true`; repository-fixable defects stay task-local unless curated manually.
10
+ - Normal startup MUST NOT bulk-load `incidents.md`; targeted lookup for analogous work is allowed through `task start-ready` and `agentplane incidents advise`.
8
11
 
9
12
  ## Stabilization criteria
10
13
 
@@ -6,7 +6,9 @@ This is the single file for incident-derived and situational policy rules.
6
6
 
7
7
  - Add entries append-only.
8
8
  - Every entry MUST include: `id`, `date`, `scope`, `failure`, `rule`, `evidence`, `enforcement`, `state`.
9
+ - New machine-matched entries SHOULD also include: `tags`, `match`, `advice`, `source_task`, `fixability`.
9
10
  - `rule` MUST be concrete and testable (`MUST` / `MUST NOT`).
11
+ - `fixability: external` means the issue cannot be removed by changing only repository code and should stay as reusable operational advice.
10
12
  - `state` values: `open`, `stabilized`, `promoted`.
11
13
 
12
14
  ## Entry template
@@ -14,29 +16,26 @@ This is the single file for incident-derived and situational policy rules.
14
16
  - id: `INC-YYYYMMDD-NN`
15
17
  - date: `YYYY-MM-DD`
16
18
  - scope: `<affected scope>`
19
+ - tags: `<comma-separated matching tags>`
20
+ - match: `<comma-separated lookup keywords>`
17
21
  - failure: `<observed failure mode>`
22
+ - advice: `<reusable recovery or prevention guidance>`
18
23
  - rule: `<new or refined MUST/MUST NOT>`
19
24
  - evidence: `<task ids / logs / links>`
20
25
  - enforcement: `<CI|test|lint|script|manual>`
26
+ - source_task: `<task id>`
27
+ - fixability: `<external>`
21
28
  - state: `<open|stabilized|promoted>`
22
29
 
23
- <!-- example:start
24
- - id: INC-20260305-01
25
- - date: 2026-03-05
26
- - scope: commit-msg hook in repo development mode
27
- - failure: commit-msg rejected valid commits because stale-dist check blocked src_dirty/git_head_changed
28
- - rule: commit-msg MUST validate subject semantics and MUST NOT block on stale dist freshness checks
29
- - evidence: task 20260305-HOOKS-FIX, commit 9fe55c73
30
- - enforcement: test + hook script
31
- - state: open
32
- example:end -->
33
-
34
30
  ## Entries
35
31
 
36
32
  - id: INC-20260308-01
37
33
  date: 2026-03-08
38
34
  scope: release apply internal push path
35
+ tags: release, git, hooks
36
+ match: release, push, pre-push, hooks
39
37
  failure: release apply re-entered local pre-push hooks and could stall after creating the local release commit and tag
38
+ advice: keep release ref pushes inside the release orchestrator path and avoid recursively re-entering local pre-push hooks
40
39
  rule: Release orchestration MUST push its own release refs without recursively re-entering local pre-push hooks.
41
40
  evidence: task 202603061532-9Y41NM; docs/developer/cli-bug-ledger-v0-3-x.mdx entry 4
42
41
  enforcement: test + command implementation
@@ -45,7 +44,10 @@ example:end -->
45
44
  - id: INC-20260308-02
46
45
  date: 2026-03-08
47
46
  scope: stale-dist guard in framework checkout
47
+ tags: runtime, framework, diagnostics
48
+ match: stale-dist, runtime, dirty-tree, diagnostics
48
49
  failure: stale-dist enforcement treated git dirtiness as stale runtime and blocked diagnostics or rebuilt checkouts incorrectly
50
+ advice: compare stale-dist state against recorded build snapshots and let read-only diagnostics warn instead of hard-failing on dirty runtime trees
49
51
  rule: Stale-dist freshness MUST compare current runtime inputs against the recorded build snapshot, and read-only diagnostics MUST warn-and-run instead of hard-failing on dirty runtime trees.
50
52
  evidence: tasks 202603072032-2M0V8V, 202603072032-1BC7VQ, 202603072032-V9VGT2, 202603072032-4D9ASG
51
53
  enforcement: test + runtime guard
@@ -54,7 +56,10 @@ example:end -->
54
56
  - id: INC-20260308-03
55
57
  date: 2026-03-08
56
58
  scope: framework checkout PATH resolution
59
+ tags: runtime, framework, cli
60
+ match: path, runtime, handoff, global-cli
57
61
  failure: contributors inside the framework repo could execute an older global agentplane binary instead of the checkout they were editing
62
+ advice: verify the active runtime inside the framework checkout and keep PATH handoff repo-local by default unless a deliberate global override is set
58
63
  rule: Inside the framework checkout, agentplane resolved from PATH MUST hand off to the repo-local runtime by default unless an explicit global opt-out is set.
59
64
  evidence: tasks 202603071647-M0Q79C, 202603071647-Y4BZ1T, 202603071647-25WS52
60
65
  enforcement: test + wrapper logic
@@ -63,7 +68,10 @@ example:end -->
63
68
  - id: INC-20260308-04
64
69
  date: 2026-03-08
65
70
  scope: release mutation generated surfaces
71
+ tags: release, docs, generated
72
+ match: release, generated-docs, versioned-docs
66
73
  failure: release apply could leave version-sensitive generated docs stale until later parity checks failed
74
+ advice: regenerate version-sensitive generated docs inside the release mutation itself instead of deferring them to later parity checks
67
75
  rule: Release mutation MUST regenerate and stage generated docs that encode released package versions as part of the release commit itself.
68
76
  evidence: task 202603071745-T3QE04; docs/developer/cli-bug-ledger-v0-3-x.mdx entry 5
69
77
  enforcement: test + release mutation
@@ -72,7 +80,10 @@ example:end -->
72
80
  - id: INC-20260308-05
73
81
  date: 2026-03-08
74
82
  scope: release mutation repository CLI expectation
83
+ tags: release, cli, config
84
+ match: release, expected-version, config
75
85
  failure: repository-owned framework.cli.expected_version could drift behind the actual released version because release apply did not persist it
86
+ advice: keep repository CLI expectation aligned with the released package version whenever release mutation touches repository config
76
87
  rule: Release mutation MUST keep framework.cli.expected_version aligned with the released package version whenever repository config is present.
77
88
  evidence: tasks 202603081315-Y4D6AE, 202603081538-GF7P9C; docs/developer/cli-bug-ledger-v0-3-x.mdx entry 3
78
89
  enforcement: test + release mutation
@@ -29,6 +29,8 @@ agentplane finish <task-id> --author INTEGRATOR --body "Verified: ..." --result
29
29
  - MUST NOT perform mutating actions before explicit user approval.
30
30
  - Task documentation updates MAY be batched within one turn before approval.
31
31
  - MUST run `task plan approve` then `task start-ready` as `Step 1 -> wait -> Step 2` (never parallel).
32
+ - `task start-ready` MAY surface targeted incident advice for analogous scope/tags; follow it before widening scope.
33
+ - Keep structured external `incident-candidate` findings in the task README; base-branch `finish` or `agentplane incidents collect <task-id>` promotes valid entries into `.agentplane/policy/incidents.md`.
32
34
  - MUST stop and request re-approval on material drift.
33
35
  - Planning and closure happen on base checkout.
34
36
  - Do not export task snapshots from task branches.
@@ -38,14 +38,16 @@ If any step fails:
38
38
  - `doc_version=3`: task `Findings`
39
39
  3. Mark task blocked: `agentplane block <task-id> --author <ROLE> --body "Blocked: ..."`.
40
40
  4. Request re-approval before scope/risk changes.
41
- 5. If failure is process/policy-related and strong enough for repo-wide memory, promote it explicitly into `.agentplane/policy/incidents.md`.
41
+ 5. If failure is external/process-related and should become reusable advice, record a structured `incident-candidate` block in `Findings` and let `agentplane finish` or `agentplane incidents collect <task-id>` promote it.
42
42
 
43
43
  ## Constraints
44
44
 
45
45
  - MUST NOT perform mutating actions before explicit user approval.
46
46
  - Task documentation updates MAY be batched within one turn before approval.
47
47
  - MUST run `task plan approve` then `task start-ready` as `Step 1 -> wait -> Step 2` (never parallel).
48
+ - `task start-ready` MAY surface targeted incident advice for analogous scope/tags; follow it before widening scope.
48
49
  - In direct mode, `finish` auto-creates the deterministic close commit by default; use `--no-close-commit` only for explicit manual handling.
50
+ - `finish` evaluates structured external `incident-candidate` findings and appends valid entries to `.agentplane/policy/incidents.md`.
49
51
  - MUST stop and request re-approval on material drift.
50
52
  - Do not use worktrees in direct mode.
51
53
  - Do not perform `branch_pr`-only operations.