devflow-kit 3.8.0 → 3.10.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 (211) hide show
  1. package/CHANGELOG.md +231 -0
  2. package/README.md +6 -6
  3. package/dist/agents/code.md +10 -10
  4. package/dist/agents/fix.md +7 -7
  5. package/dist/agents/git.md +2 -2
  6. package/dist/agents/harden.md +7 -6
  7. package/dist/agents/refactor.md +6 -6
  8. package/dist/agents/skim.md +1 -1
  9. package/dist/agents/triage.md +7 -0
  10. package/dist/cli/commands/ambient.js +10 -2
  11. package/dist/cli/commands/compliance-prompts.js +9 -4
  12. package/dist/cli/commands/compliance.js +171 -24
  13. package/dist/cli/commands/curation.js +79 -23
  14. package/dist/cli/commands/gate-level-prompts.js +39 -23
  15. package/dist/cli/commands/gates.js +6 -7
  16. package/dist/cli/commands/init.js +150 -145
  17. package/dist/cli/commands/install-report.js +34 -0
  18. package/dist/cli/commands/legacy-sweep.js +64 -0
  19. package/dist/cli/commands/memory.js +59 -12
  20. package/dist/cli/commands/proxy.js +6 -1
  21. package/dist/cli/commands/rules.js +29 -12
  22. package/dist/cli/commands/skills.js +42 -9
  23. package/dist/cli/commands/tracker.js +9 -3
  24. package/dist/cli/commands/uninstall.js +354 -60
  25. package/dist/commands/bug-analysis.md +71 -122
  26. package/dist/commands/code-review.md +11 -11
  27. package/dist/commands/debug.md +2 -2
  28. package/dist/commands/dynamic-build.md +25 -25
  29. package/dist/commands/dynamic-plan.md +2 -2
  30. package/dist/commands/dynamic-profile.md +2 -2
  31. package/dist/commands/dynamic-tickets.md +2 -2
  32. package/dist/commands/explore.md +2 -2
  33. package/dist/commands/implement.md +48 -34
  34. package/dist/commands/plan.md +2 -2
  35. package/dist/commands/release.md +3 -3
  36. package/dist/commands/research.md +2 -2
  37. package/dist/commands/resolve.md +50 -46
  38. package/dist/commands/self-review.md +10 -9
  39. package/dist/compliance-off/agents/git.md +120 -0
  40. package/dist/compliance-off/agents/triage.md +180 -0
  41. package/dist/compliance-off/commands/bug-analysis.md +398 -0
  42. package/dist/compliance-off/commands/code-review.md +520 -0
  43. package/dist/compliance-off/commands/dynamic-build.md +1251 -0
  44. package/dist/compliance-off/commands/dynamic-tickets.md +676 -0
  45. package/dist/compliance-off/commands/implement.md +736 -0
  46. package/dist/compliance-off/commands/plan.md +671 -0
  47. package/dist/compliance-off/commands/release.md +309 -0
  48. package/dist/compliance-off/commands/resolve.md +742 -0
  49. package/dist/compliance-off/skills/git/references/decision-markers.md +17 -0
  50. package/dist/compliance-off/skills/git/references/learn-conventions.md +80 -0
  51. package/dist/compliance-off/skills/git/references/pr/check-ci-status.md +33 -0
  52. package/dist/compliance-off/skills/git/references/pr/check-merge-readiness.md +49 -0
  53. package/dist/compliance-off/skills/git/references/pr/fetch-review-threads.md +52 -0
  54. package/dist/compliance-off/skills/git/references/pr/validate-branch.md +47 -0
  55. package/dist/compliance-off/skills/git/references/tracker/_contract.md +33 -0
  56. package/dist/compliance-off/skills/git/references/tracker/_mcp.md +153 -0
  57. package/dist/compliance-off/skills/git/references/tracker/github/create-release.md +35 -0
  58. package/dist/compliance-off/skills/git/references/tracker/github/ensure-pr-ready.md +100 -0
  59. package/dist/compliance-off/skills/git/references/tracker/github/ensure-traceable-issue.md +74 -0
  60. package/dist/compliance-off/skills/git/references/tracker/github/fetch-issue.md +69 -0
  61. package/dist/compliance-off/skills/git/references/tracker/github/fetch-issues-batch.md +65 -0
  62. package/dist/compliance-off/skills/git/references/tracker/github/gather-release-evidence.md +48 -0
  63. package/dist/compliance-off/skills/git/references/tracker/github/setup-task.md +77 -0
  64. package/dist/compliance-off/skills/git/references/tracker/jira/create-release.md +35 -0
  65. package/dist/compliance-off/skills/git/references/tracker/jira/ensure-pr-ready.md +100 -0
  66. package/dist/compliance-off/skills/git/references/tracker/jira/ensure-traceable-issue.md +61 -0
  67. package/dist/compliance-off/skills/git/references/tracker/jira/fetch-issue.md +51 -0
  68. package/dist/compliance-off/skills/git/references/tracker/jira/fetch-issues-batch.md +63 -0
  69. package/dist/compliance-off/skills/git/references/tracker/jira/gather-release-evidence.md +47 -0
  70. package/dist/compliance-off/skills/git/references/tracker/jira/setup-task.md +82 -0
  71. package/dist/compliance-off/skills/git/references/tracker/linear/create-release.md +35 -0
  72. package/dist/compliance-off/skills/git/references/tracker/linear/ensure-pr-ready.md +100 -0
  73. package/dist/compliance-off/skills/git/references/tracker/linear/ensure-traceable-issue.md +61 -0
  74. package/dist/compliance-off/skills/git/references/tracker/linear/fetch-issue.md +51 -0
  75. package/dist/compliance-off/skills/git/references/tracker/linear/fetch-issues-batch.md +63 -0
  76. package/dist/compliance-off/skills/git/references/tracker/linear/gather-release-evidence.md +47 -0
  77. package/dist/compliance-off/skills/git/references/tracker/linear/setup-task.md +83 -0
  78. package/dist/compliance-off/skills/git/references/trust-rule.md +7 -0
  79. package/dist/core/agent-models.js +19 -4
  80. package/dist/core/area-pause-notice.js +44 -0
  81. package/dist/core/assets.js +126 -17
  82. package/dist/core/compliance-off-files.js +27 -0
  83. package/dist/core/curation-move-skip.js +4 -5
  84. package/dist/core/curation-queue-cleanup.js +6 -5
  85. package/dist/core/curation-store.js +1 -0
  86. package/dist/core/curation-variants.js +460 -112
  87. package/dist/core/evidence-policy.js +10 -8
  88. package/dist/core/flags.js +2 -2
  89. package/dist/core/installed-variants.js +63 -0
  90. package/dist/core/manifest.js +48 -5
  91. package/dist/core/mds-variants.js +700 -3
  92. package/dist/core/orphan-sweep.js +11 -2
  93. package/dist/core/plugins.js +69 -12
  94. package/dist/core/tracked-areas.js +138 -14
  95. package/dist/curation-compliance-off/agents/triage.md +176 -0
  96. package/dist/curation-compliance-off/commands/bug-analysis.md +349 -0
  97. package/dist/curation-compliance-off/commands/code-review.md +481 -0
  98. package/dist/curation-compliance-off/commands/dynamic-build.md +1211 -0
  99. package/dist/curation-compliance-off/commands/dynamic-tickets.md +634 -0
  100. package/dist/curation-compliance-off/commands/implement.md +689 -0
  101. package/dist/curation-compliance-off/commands/plan.md +631 -0
  102. package/dist/curation-compliance-off/commands/release.md +279 -0
  103. package/dist/curation-compliance-off/commands/resolve.md +692 -0
  104. package/dist/curation-off/agents/code.md +10 -10
  105. package/dist/curation-off/agents/fix.md +7 -7
  106. package/dist/curation-off/agents/harden.md +7 -6
  107. package/dist/curation-off/agents/refactor.md +6 -6
  108. package/dist/curation-off/agents/triage.md +7 -0
  109. package/dist/curation-off/commands/bug-analysis.md +69 -119
  110. package/dist/curation-off/commands/code-review.md +11 -11
  111. package/dist/curation-off/commands/debug.md +2 -2
  112. package/dist/curation-off/commands/dynamic-build.md +25 -25
  113. package/dist/curation-off/commands/explore.md +2 -2
  114. package/dist/curation-off/commands/implement.md +48 -34
  115. package/dist/curation-off/commands/plan.md +2 -2
  116. package/dist/curation-off/commands/release.md +1 -1
  117. package/dist/curation-off/commands/resolve.md +50 -46
  118. package/dist/curation-off/commands/self-review.md +10 -9
  119. package/dist/hud/components/curation-counts.js +27 -0
  120. package/dist/skills/git/references/pr/post-resolution-summary.md +12 -11
  121. package/dist/skills/git/references/pr/post-review-summary.md +12 -11
  122. package/dist/skills/git/references/pr/resolve-review-threads.md +1 -1
  123. package/dist/skills/git/references/pr/update-pr-evidence.md +2 -2
  124. package/dist/skills/git/references/publication-gate.md +6 -7
  125. package/dist/skills/git/references/tracker/github/manage-debt.md +6 -2
  126. package/dist/skills/git/references/tracker/jira/manage-debt.md +6 -2
  127. package/dist/skills/git/references/tracker/linear/manage-debt.md +6 -2
  128. package/dist/targets/claude-code/behavior-install.js +23 -9
  129. package/dist/targets/claude-code/charter-render.js +374 -0
  130. package/dist/targets/claude-code/compliance-install.js +32 -12
  131. package/dist/targets/claude-code/compliance-off-files.js +245 -0
  132. package/dist/targets/claude-code/curation-install.js +570 -100
  133. package/dist/targets/claude-code/installer.js +467 -62
  134. package/dist/targets/claude-code/language-stamp.js +6 -0
  135. package/dist/targets/claude-code/linked-folder.js +182 -0
  136. package/dist/targets/claude-code/reference-converge.js +118 -0
  137. package/dist/targets/claude-code/tracker-install.js +21 -8
  138. package/dist/targets/claude-code/tracker-servers.js +20 -6
  139. package/dist/targets/claude-code/workflow-folder-install.js +231 -0
  140. package/dist/variant-axes.json +109 -0
  141. package/package.json +1 -1
  142. package/src/assets/agents/_partials/_code.mds +6 -6
  143. package/src/assets/agents/code.mds +4 -4
  144. package/src/assets/agents/evaluate.md +7 -13
  145. package/src/assets/agents/fix.mds +1 -1
  146. package/src/assets/agents/git.mds +34 -2
  147. package/src/assets/agents/harden.mds +7 -6
  148. package/src/assets/agents/skim.mds +1 -1
  149. package/src/assets/agents/test.md +21 -12
  150. package/src/assets/agents/triage.mds +9 -0
  151. package/src/assets/agents/validate.md +27 -34
  152. package/src/assets/commands/_partials/_compliance.mds +5 -3
  153. package/src/assets/commands/_partials/_decisions.mds +10 -8
  154. package/src/assets/commands/_partials/_engine.mds +9 -8
  155. package/src/assets/commands/_partials/_publication.mds +10 -1
  156. package/src/assets/commands/_partials/_settings.mds +2 -2
  157. package/src/assets/commands/bug-analysis.mds +80 -126
  158. package/src/assets/commands/code-review.mds +52 -9
  159. package/src/assets/commands/dynamic-build.mds +109 -15
  160. package/src/assets/commands/dynamic-tickets.mds +13 -0
  161. package/src/assets/commands/implement.mds +145 -33
  162. package/src/assets/commands/plan.mds +19 -0
  163. package/src/assets/commands/release.mds +50 -1
  164. package/src/assets/commands/resolve.mds +229 -44
  165. package/src/assets/commands/self-review.mds +8 -7
  166. package/src/assets/mds/git/_ops.mds +29 -1
  167. package/src/assets/mds/git/_ops_pr.mds +20 -10
  168. package/src/assets/mds/git/_ops_steps.mds +27 -0
  169. package/src/assets/mds/git/_pr.mds +15 -15
  170. package/src/assets/mds/git/_references.mds +12 -7
  171. package/src/assets/mds/tracker/_common.mds +4 -0
  172. package/src/assets/mds/tracker/_github.mds +43 -4
  173. package/src/assets/mds/tracker/_jira.mds +44 -4
  174. package/src/assets/mds/tracker/_linear.mds +44 -4
  175. package/src/assets/rules/quality.md +2 -0
  176. package/src/assets/scripts/ci-wait.cjs +493 -118
  177. package/src/assets/scripts/hooks/assets/implement-installed +1 -0
  178. package/src/assets/scripts/hooks/assets/orchestrator-charter.md +13 -11
  179. package/src/assets/scripts/hooks/background-memory-update +79 -1
  180. package/src/assets/scripts/hooks/json-helper.cjs +44 -2
  181. package/src/assets/scripts/hooks/lib/curation-store.cjs +82 -20
  182. package/src/assets/scripts/hooks/lib/render-decisions.cjs +9 -1
  183. package/src/assets/scripts/hooks/lib/tracked-areas.cjs +226 -33
  184. package/src/assets/scripts/hooks/memory-permission +10 -2
  185. package/src/assets/scripts/hooks/memory-worker +11 -0
  186. package/src/assets/scripts/hooks/pre-compact-memory +11 -0
  187. package/src/assets/scripts/hooks/preamble +18 -8
  188. package/src/assets/scripts/hooks/queue-append +218 -1
  189. package/src/assets/scripts/hooks/session-start-context +89 -37
  190. package/src/assets/scripts/hooks/session-start-memory +39 -0
  191. package/src/assets/scripts/hooks/session-start-orchestrator +4 -2
  192. package/src/assets/scripts/pr-evidence.cjs +46 -4
  193. package/src/assets/scripts/resolve-settings.cjs +244 -30
  194. package/src/assets/scripts/verify-evidence.cjs +708 -124
  195. package/src/assets/skills/agent-references/SKILL.md +7 -1
  196. package/src/assets/skills/agent-references/references/commands/implement-levels.md +6 -4
  197. package/src/assets/skills/agent-references/references/commands/implement-revalidate.md +3 -3
  198. package/src/assets/skills/agent-references/references/commands/plan-levels.md +1 -1
  199. package/src/assets/skills/agent-references/references/commands/resolve-levels.md +3 -2
  200. package/src/assets/skills/agent-references/references/synthesize/bug-analysis.md +6 -2
  201. package/src/assets/skills/agent-references/references/synthesize/review.md +4 -4
  202. package/src/assets/skills/agent-references/references/triage/severity-tiers.md +43 -0
  203. package/src/assets/skills/agent-references/references/validate/passed-alone.md +14 -0
  204. package/src/assets/skills/docs-framework/SKILL.md +5 -2
  205. package/src/assets/skills/git/SKILL.md +3 -3
  206. package/src/assets/skills/git/references/github-api.md +2 -139
  207. package/src/assets/skills/git/references/github-posting.md +158 -0
  208. package/src/assets/skills/review-methodology/SKILL.md +1 -1
  209. package/src/assets/skills/review-methodology/references/patterns.md +1 -1
  210. package/src/assets/skills/review-methodology/references/report-template.md +1 -2
  211. package/src/assets/skills/testing/SKILL.md +2 -4
@@ -67,6 +67,13 @@ column-0 `## ` line outside a fence terminates the section for every guard that
67
67
  reads it through `extractOpSectionFromCorpus`, and everything under it becomes
68
68
  invisible while the bytes stay on disk.
69
69
 
70
+ A compliance arm (the `compliance:on`, `compliance:off` and `compliance:end` marker lines)
71
+ opens and closes inside one define, so inside one operation's section. The compliance-off
72
+ file keeps the off text: `setup-task` forwards no plan artifact, `create-release` composes
73
+ no shipped-issues list, `ensure-traceable-issue` writes nothing to an existing issue, posts
74
+ no artifact comment and has no `## Implementation Plan` section, and a kept operation never
75
+ names an omitted reference.
76
+
70
77
  The comment-body cap is a PROVIDER FACT and is stated once, as `comment_cap()`
71
78
  below; every site that renders it invokes the define. It is not in `_mcp.mds`
72
79
  with the shared rules because it is not provider-independent — the CLI provider's
@@ -104,7 +111,11 @@ Load when the resolved tracker provider is `jira` and the operation is `setup-ta
104
111
  {{steps.base_branch_step()}}
105
112
  1. **`ISSUE_INPUT` pre-flight**, when provided: it is an existing issue key. {{common.ref_preflight_single("jira", "`^[A-Z][A-Z0-9_]{1,9}-[1-9][0-9]{0,8}$`")}} Step 3 resolves an admitted key with *fetch by key*.
106
113
  {{common.conventions_step()}}
114
+ <!-- compliance:on -->
107
115
  1c. Issue-first, only when `ISSUE_REQUIRED` is `true` and `ISSUE_INPUT` is absent: invoke `ensure-traceable-issue` with `TASK_DESCRIPTION` (and `PLAN_ARTIFACT_PATH` if provided) and capture the returned key for step 3's `{type}/{KEY}-{slug}`.
116
+ <!-- compliance:off -->
117
+ 1c. Issue-first, only when `ISSUE_REQUIRED` is `true` and `ISSUE_INPUT` is absent: invoke `ensure-traceable-issue` with `TASK_DESCRIPTION` and capture the returned key for step 3's `{type}/{KEY}-{slug}`.
118
+ <!-- compliance:end -->
108
119
  - Preconditions: the *create issue* and *fetch by key* capabilities are both available. Either one absent or denied ⇒ `TRACEABILITY: DEGRADED (no tracker tool for {capability})` naming the capability, and continue to step 2. **The branch is still cut and the PR is still opened**, with the traceability field carrying `Tracked (pending)` and the reason. **NEVER create a GitHub issue as a fallback**.
109
120
  {{common.branch_detection_step()}}
110
121
  - The convention owns the branch **shape**, `## Reference Rendering` only the **token** in it; neither is the other's fallback.
@@ -177,10 +188,7 @@ Load when the resolved tracker provider is `jira` and the operation is `manage-d
177
188
 
178
189
  1. Find or create the rolling "Tech Debt Backlog" item. `## Tech Debt` defaults to a **single rolling item**, so this operation looks for exactly one: use the *search* capability once with a structured filter over the resolved project and the tech-debt label. Absent ⇒ create it with the *create issue* capability, using only the field names `## Required Fields` allows.
179
190
  2. Check the item's description length against the `{{comment_cap()}}`-character cap; archive when it is over.
180
- 3. Extract items to add:
181
- - `## Fix Separately` entries from `{REVIEW_DIR}/resolution-summary.md` (FIX_SEPARATE from Triage agent)
182
- - `## Deferred to Tech Debt` entries from `{REVIEW_DIR}/resolution-summary.md` (TECH_DEBT from Triage agent)
183
- - Pre-existing issues (Category 3) from review reports
191
+ {{opsteps.manage_debt_step_3()}}
184
192
  4. Deduplicate against existing items using semantic matching.
185
193
  5. Remove items that have been fixed (verify in codebase).
186
194
  6. Compose the updated description and post it through the gate in `### Posting gate` below, using the *update description* capability.
@@ -207,11 +215,16 @@ Over `{{comment_cap()}}` characters the rolling item is closed and a successor i
207
215
 
208
216
  Load when the resolved tracker provider is `jira` and the operation is `create-release`.
209
217
 
218
+ <!-- compliance:on -->
210
219
  **Mechanics held here:** the release-host steps 1a–6 — version check, annotated tag, tag push, notes composition, the D11 scrub and the release itself — and this provider's shipped-issues step inside step 5. The release-host steps are release-host mechanics, not tracker mechanics, and are the same under every provider.
220
+ <!-- compliance:off -->
221
+ **Mechanics held here:** the release-host steps 1a–6 — version check, annotated tag, tag push, notes composition, the D11 scrub and the release itself. The release-host steps are release-host mechanics, not tracker mechanics, and are the same under every provider.
222
+ <!-- compliance:end -->
211
223
 
212
224
  ### Process
213
225
 
214
226
  {{opsteps.create_release_steps()}}
227
+ <!-- compliance:on -->
215
228
 
216
229
  Inside step 5 (compose release notes):
217
230
 
@@ -222,6 +235,7 @@ Inside step 5 (compose release notes):
222
235
  {{mcp.reference_rendering_gate()}}
223
236
 
224
237
  **This provider's documented default is `{{pr_link_default()}}`.** It is stated here because it is a provider fact, and the gate above is what routes to it: a section that is absent, a file that is absent and a token the gate discarded all render this, and none of them is a degradation.
238
+ <!-- compliance:end -->
225
239
  @end
226
240
 
227
241
  @define gather_release_evidence():
@@ -245,7 +259,11 @@ Load when the resolved tracker provider is `jira` and the operation is `gather-r
245
259
  - {{common.ref_preflight_list("jira", "`^[A-Z][A-Z0-9_]{1,9}-[1-9][0-9]{0,8}$`", "", "", ".")}}
246
260
  - Confirm the survivors exist with **one** call to the *batch fetch* capability over the whole set, bounded `≤50` with `TRUNCATED ({n} not processed)` for the remainder — **one query, never a per-item loop**.
247
261
  - **Because the closing-reference step degraded, the enrichment is incomplete by construction: never report the status as `COMPLETE`.** Report `PARTIAL ({n} DEGRADED)` whenever any step above degraded, and `TRUNCATED ({n} not processed)` whenever the bound was reached. A release that reads `COMPLETE` over an unresolvable evidence set is the one report nobody re-checks.
262
+ <!-- compliance:on -->
248
263
  - On a tool error for an individual item → DEGRADED for that item, continue. On backpressure → follow `### Provider signals (Jira)` in this operation's `backlink-shipped-issues` reference, which is where this provider's one signal is stated.
264
+ <!-- compliance:off -->
265
+ - On a tool error for an individual item → DEGRADED for that item, continue. On backpressure — this provider's one signal is a `Retry-After` value on a 429, reported and never slept on — stop the enrichment and report the remaining items as `THROTTLED`; there is no earlier rung.
266
+ <!-- compliance:end -->
249
267
  {{steps.release_evidence_gate_step()}}
250
268
  {{common.trace_map_step("--grammar jira --key {KEY}", "`{KEY}` is the resolved project key; with none usable, skip the run and take the arm below. ")}}
251
269
  @end
@@ -334,21 +352,30 @@ Load when the resolved tracker provider is `jira` and the operation is `associat
334
352
 
335
353
  Load when the resolved tracker provider is `jira` and the operation is `ensure-traceable-issue`.
336
354
 
355
+ <!-- compliance:on -->
337
356
  **Mechanics held here:** the `### Process` body — issue creation, and how the design artifact is attached on a provider whose comment format has no collapsed-block analogue.
357
+ <!-- compliance:off -->
358
+ **Mechanics held here:** the `### Process` body — issue creation.
359
+ <!-- compliance:end -->
338
360
 
339
361
  {{common.traceable_issue_rules()}}
340
362
 
341
363
  ### Process
342
364
 
343
365
  1. If `ISSUE_INPUT` is provided — an issue key, or free prose to resolve through the *search* capability with a structured filter:
366
+ <!-- compliance:on -->
344
367
  - Compose a structured comment using the D3 sections and post it through `### Posting gate` below. **NEVER rewrite the issue description** — an existing description is somebody's work.
345
368
  - If `PLAN_ARTIFACT_PATH` is provided: **the artifact is NOT inlined.** See `### The artifact is posted as content`.
369
+ <!-- compliance:off -->
370
+ - Write nothing to the issue: no comment and no edit. **NEVER rewrite the issue description** — an existing description is somebody's work.
371
+ <!-- compliance:end -->
346
372
  - Return the issue key.
347
373
  2. If no `ISSUE_INPUT`: create a new issue through the *create issue* capability.
348
374
  - Summary: derived from `TASK_DESCRIPTION` (same slug logic as `setup-task`).
349
375
  - Fields: only the names `## Required Fields` allows, and the issue type by exact match against the types enumerated this run. The capability absent or denied ⇒ `TRACEABILITY: DEGRADED (no tracker tool for create issue)` and return without an issue key; the caller proceeds with `Tracked (pending)` and the reason, and **never creates a GitHub issue instead**.
350
376
  - **Description** — composed from the D3 template and posted through `### Posting gate` below. `TASK_DESCRIPTION`, `INITIAL_REQUEST` and `REQUIREMENTS` are caller-supplied and untrusted — they reach the call as values, never as part of a query or a command.
351
377
  3. Return the issue key.
378
+ <!-- compliance:on -->
352
379
 
353
380
  ### The artifact is posted as content
354
381
 
@@ -357,18 +384,31 @@ This provider's comment format has **no HTML-comment node and no collapsed-block
357
384
  Measure the composed body against the `{{comment_cap()}}`-character cap **after redaction** — the scrubber's tokens can grow it. Over the cap, post **none of the plan**: post the pointer sentence alone — `Implementation plan: {PLAN_ARTIFACT_PATH} (not committed; ask the author)` — and emit `TRACEABILITY: DEGRADED (plan artifact exceeds comment cap)`. A truncated plan is worse than a pointer, because the reader cannot tell which half is missing.
358
385
 
359
386
  Over the `{{comment_cap()}}`-character cap after redaction, truncate in **preservation order** — line 1 the marker, then the status and DEGRADED lines, then the pointer sentence; the untrusted middle is what gets cut — and end with `NOTE: body exceeded the {{comment_cap()}}-character cap after redaction — truncated/stub posted`. The pointer sentence is the last thing to go because it is the only line that still leads somewhere.
387
+ <!-- compliance:off -->
388
+
389
+ Over the `{{comment_cap()}}`-character cap after redaction, truncate any body this operation posts in **preservation order** — the status and DEGRADED lines are kept; the untrusted middle is what gets cut — and end with `NOTE: body exceeded the {{comment_cap()}}-character cap after redaction — truncated/stub posted`.
390
+ <!-- compliance:end -->
360
391
 
361
392
  {{mcp.query_safety()}}
362
393
 
363
394
  {{mcp.posting_gate_head("every write below")}}
395
+ <!-- compliance:on -->
364
396
  4. Post through the *add comment* capability with arguments (issue key, body: {SCRUBBED_BODY}), or on a new issue through the *create issue* capability with the description field carrying the same gated value.
397
+ <!-- compliance:off -->
398
+ 4. Create the issue through the *create issue* capability with the description field carrying the gated value.
399
+ <!-- compliance:end -->
365
400
 
366
401
  ### Traceability Issue Template (D3)
367
402
 
368
403
  The D3 section headings are the canonical ones; only the transport differs from the GitHub path. Rules:
369
404
 
405
+ <!-- compliance:on -->
370
406
  - Pre-existing issues: post a structured comment using the D3 sections — NEVER rewrite the issue description.
371
407
  - New issues: create with the D3 description, then post the artifact as its own comment and reference it from the `## Implementation Plan` section.
408
+ <!-- compliance:off -->
409
+ - Pre-existing issues: write nothing to them, no comment and no edit — NEVER rewrite the issue description.
410
+ - New issues: create with the D3 description.
411
+ <!-- compliance:end -->
372
412
  @end
373
413
 
374
414
  @define post_wave_report():
@@ -69,6 +69,13 @@ invisible while the bytes stay on disk. The one `## ` heading in this
69
69
  file is the module-level section below, which sits above every section marker and
70
70
  is therefore emitted nowhere.
71
71
 
72
+ A compliance arm (the `compliance:on`, `compliance:off` and `compliance:end` marker lines)
73
+ opens and closes inside one define, so inside one operation's section. The compliance-off
74
+ file keeps the off text: `setup-task` forwards no plan artifact, `create-release` composes
75
+ no shipped-issues list, `ensure-traceable-issue` writes nothing to an existing issue, posts
76
+ no artifact comment and has no `## Implementation Plan` section, and a kept operation never
77
+ names an omitted reference.
78
+
72
79
  ## Known Unknowns
73
80
 
74
81
  <!-- twin: docs/cli-reference.md § Known Unknowns — Linear -->
@@ -141,7 +148,11 @@ Load when the resolved tracker provider is `linear` and the operation is `setup-
141
148
  {{steps.base_branch_step()}}
142
149
  1. **`ISSUE_INPUT` pre-flight**, when provided: it is an existing issue reference. {{common.ref_preflight_single("linear", "**either** anchored form — the team-key form `^[A-Z][A-Z0-9]{0,9}-[1-9][0-9]{0,8}$` or the internal-id form `^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$`", "**ASCII-upper-normalise it first** — a reference copied out of a branch name or a URL arrives lowercased. ", ", never joined into one alternation")}} Step 3 resolves an admitted reference with *fetch by key*.
143
150
  {{common.conventions_step()}}
151
+ <!-- compliance:on -->
144
152
  1c. Issue-first, only when `ISSUE_REQUIRED` is `true` and `ISSUE_INPUT` is absent: invoke `ensure-traceable-issue` with `TASK_DESCRIPTION` (and `PLAN_ARTIFACT_PATH` if provided) and capture the returned reference for step 3's `{type}/{REF}-{slug}`.
153
+ <!-- compliance:off -->
154
+ 1c. Issue-first, only when `ISSUE_REQUIRED` is `true` and `ISSUE_INPUT` is absent: invoke `ensure-traceable-issue` with `TASK_DESCRIPTION` and capture the returned reference for step 3's `{type}/{REF}-{slug}`.
155
+ <!-- compliance:end -->
145
156
  - Preconditions: the *create issue* and *fetch by key* capabilities are both available. Either one absent or denied ⇒ `TRACEABILITY: DEGRADED (no tracker tool for {capability})` naming the capability, and continue to step 2. **The branch is still cut and the PR is still opened**, with the traceability field carrying `Tracked (pending)` and the reason. **NEVER create a GitHub issue as a fallback**.
146
157
  {{common.branch_detection_step()}}
147
158
  - The convention owns the branch **shape**, `## Reference Rendering` only the **token** in it; neither is the other's fallback.
@@ -215,10 +226,7 @@ Load when the resolved tracker provider is `linear` and the operation is `manage
215
226
 
216
227
  1. Find or create the rolling "Tech Debt Backlog" item. `## Tech Debt` defaults to a **single rolling item**, so this operation looks for exactly one: use the *search* capability once with a structured filter over the resolved team and the tech-debt label. Absent ⇒ create it with the *create issue* capability, using only the field names `## Required Fields` allows.
217
228
  2. Check the item's description length against the `{{comment_cap()}}`-character cap; archive when it is over.
218
- 3. Extract items to add:
219
- - `## Fix Separately` entries from `{REVIEW_DIR}/resolution-summary.md` (FIX_SEPARATE from Triage agent)
220
- - `## Deferred to Tech Debt` entries from `{REVIEW_DIR}/resolution-summary.md` (TECH_DEBT from Triage agent)
221
- - Pre-existing issues (Category 3) from review reports
229
+ {{opsteps.manage_debt_step_3()}}
222
230
  4. Deduplicate against existing items using semantic matching.
223
231
  5. Remove items that have been fixed (verify in codebase).
224
232
  6. Compose the updated description and post it through the gate in `### Posting gate` below, using the *update description* capability.
@@ -245,11 +253,16 @@ Over `{{comment_cap()}}` characters the rolling item is closed and a successor i
245
253
 
246
254
  Load when the resolved tracker provider is `linear` and the operation is `create-release`.
247
255
 
256
+ <!-- compliance:on -->
248
257
  **Mechanics held here:** the release-host steps 1a–6 — version check, annotated tag, tag push, notes composition, the D11 scrub and the release itself — and this provider's shipped-issues step inside step 5. The release-host steps are release-host mechanics, not tracker mechanics, and are the same under every provider.
258
+ <!-- compliance:off -->
259
+ **Mechanics held here:** the release-host steps 1a–6 — version check, annotated tag, tag push, notes composition, the D11 scrub and the release itself. The release-host steps are release-host mechanics, not tracker mechanics, and are the same under every provider.
260
+ <!-- compliance:end -->
249
261
 
250
262
  ### Process
251
263
 
252
264
  {{opsteps.create_release_steps()}}
265
+ <!-- compliance:on -->
253
266
 
254
267
  Inside step 5 (compose release notes):
255
268
 
@@ -260,6 +273,7 @@ Inside step 5 (compose release notes):
260
273
  {{mcp.reference_rendering_gate()}}
261
274
 
262
275
  **This provider's documented default is `{{pr_link_default()}}`.** It is stated here because it is a provider fact, and the gate above is what routes to it: a section that is absent, a file that is absent and a token the gate discarded all render this, and none of them is a degradation.
276
+ <!-- compliance:end -->
263
277
  @end
264
278
 
265
279
  @define gather_release_evidence():
@@ -283,7 +297,11 @@ Load when the resolved tracker provider is `linear` and the operation is `gather
283
297
  - {{common.ref_preflight_list("linear", "**either** anchored form — the team-key form `^[A-Z][A-Z0-9]{0,9}-[1-9][0-9]{0,8}$` or the internal-id form `^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$`", "**ASCII-upper-normalise every entry first.** ", ", never joined into one alternation", ".")}}
284
298
  - Confirm the survivors exist with **one** call to the *batch fetch* capability over the whole set, bounded `≤50` with `TRUNCATED ({n} not processed)` for the remainder — **one query, never a per-item loop**.
285
299
  - **Because the closing-reference step degraded, the enrichment is incomplete by construction: never report the status as `COMPLETE`.** Report `PARTIAL ({n} DEGRADED)` whenever any step above degraded, and `TRUNCATED ({n} not processed)` whenever the bound was reached. A release that reads `COMPLETE` over an unresolvable evidence set is the one report nobody re-checks.
300
+ <!-- compliance:on -->
286
301
  - On a tool error for an individual item → DEGRADED for that item, continue. On backpressure → follow `### Provider signals (Linear)` in this operation's `backlink-shipped-issues` reference, which is where this provider's one signal is stated.
302
+ <!-- compliance:off -->
303
+ - On a tool error for an individual item → DEGRADED for that item, continue. On backpressure — this provider's one signal is an HTTP `400` carrying `RATELIMITED`, which a tool call surfaces as error text, not as a 429 — stop the enrichment and report the remaining items as `THROTTLED`; there is no earlier rung.
304
+ <!-- compliance:end -->
287
305
  {{steps.release_evidence_gate_step()}}
288
306
  {{common.trace_map_step("--grammar linear --key {KEY}", "`{KEY}` is the resolved team key; with none usable, skip the run and take the arm below. ")}}
289
307
  @end
@@ -376,21 +394,30 @@ Load when the resolved tracker provider is `linear` and the operation is `associ
376
394
 
377
395
  Load when the resolved tracker provider is `linear` and the operation is `ensure-traceable-issue`.
378
396
 
397
+ <!-- compliance:on -->
379
398
  **Mechanics held here:** the `### Process` body — issue creation, and how the design artifact is attached on a provider whose comment format has no collapsed-block analogue.
399
+ <!-- compliance:off -->
400
+ **Mechanics held here:** the `### Process` body — issue creation.
401
+ <!-- compliance:end -->
380
402
 
381
403
  {{common.traceable_issue_rules()}}
382
404
 
383
405
  ### Process
384
406
 
385
407
  1. If `ISSUE_INPUT` is provided — an issue reference, or free prose to resolve through the *search* capability with a structured filter:
408
+ <!-- compliance:on -->
386
409
  - Compose a structured comment using the D3 sections and post it through `### Posting gate` below. **NEVER rewrite the issue description** — an existing description is somebody's work.
387
410
  - If `PLAN_ARTIFACT_PATH` is provided: **the artifact is NOT inlined.** See `### The artifact is posted as content`.
411
+ <!-- compliance:off -->
412
+ - Write nothing to the issue: no comment and no edit. **NEVER rewrite the issue description** — an existing description is somebody's work.
413
+ <!-- compliance:end -->
388
414
  - Return the issue reference.
389
415
  2. If no `ISSUE_INPUT`: create a new issue through the *create issue* capability.
390
416
  - Title: derived from `TASK_DESCRIPTION` (same slug logic as `setup-task`).
391
417
  - Fields: only the names `## Required Fields` allows, and the issue type by exact match against the types enumerated this run. The capability absent or denied ⇒ `TRACEABILITY: DEGRADED (no tracker tool for create issue)` and return without a reference; the caller proceeds with `Tracked (pending)` and the reason, and **never creates a GitHub issue instead**.
392
418
  - **Description** — composed from the D3 template and posted through `### Posting gate` below. `TASK_DESCRIPTION`, `INITIAL_REQUEST` and `REQUIREMENTS` are caller-supplied and untrusted — they reach the call as values, never as part of a query or a command.
393
419
  3. Return the issue reference.
420
+ <!-- compliance:on -->
394
421
 
395
422
  ### The artifact is posted as content
396
423
 
@@ -399,18 +426,31 @@ This provider's comment format has **no HTML-comment node and no collapsed-block
399
426
  Measure the composed body against the `{{comment_cap()}}`-character cap **after redaction** — the scrubber's tokens can grow it. Over the cap, post **none of the plan**: post the pointer sentence alone — `Implementation plan: {PLAN_ARTIFACT_PATH} (not committed; ask the author)` — and emit `TRACEABILITY: DEGRADED (plan artifact exceeds comment cap)`. A truncated plan is worse than a pointer, because the reader cannot tell which half is missing.
400
427
 
401
428
  Over the `{{comment_cap()}}`-character cap after redaction, truncate in **preservation order** — line 1 the marker, then the status and DEGRADED lines, then the pointer sentence; the untrusted middle is what gets cut — and end with `NOTE: body exceeded the {{comment_cap()}}-character cap after redaction — truncated/stub posted`. The pointer sentence is the last thing to go because it is the only line that still leads somewhere.
429
+ <!-- compliance:off -->
430
+
431
+ Over the `{{comment_cap()}}`-character cap after redaction, truncate any body this operation posts in **preservation order** — the status and DEGRADED lines are kept; the untrusted middle is what gets cut — and end with `NOTE: body exceeded the {{comment_cap()}}-character cap after redaction — truncated/stub posted`.
432
+ <!-- compliance:end -->
402
433
 
403
434
  {{mcp.query_safety()}}
404
435
 
405
436
  {{mcp.posting_gate_head("every write below")}}
437
+ <!-- compliance:on -->
406
438
  4. Post through the *add comment* capability with arguments (issue reference, body: {SCRUBBED_BODY}), or on a new issue through the *create issue* capability with the description field carrying the same gated value.
439
+ <!-- compliance:off -->
440
+ 4. Create the issue through the *create issue* capability with the description field carrying the gated value.
441
+ <!-- compliance:end -->
407
442
 
408
443
  ### Traceability Issue Template (D3)
409
444
 
410
445
  The D3 section headings are the canonical ones; only the transport differs from the GitHub path. Rules:
411
446
 
447
+ <!-- compliance:on -->
412
448
  - Pre-existing issues: post a structured comment using the D3 sections — NEVER rewrite the issue description.
413
449
  - New issues: create with the D3 description, then post the artifact as its own comment and reference it from the `## Implementation Plan` section.
450
+ <!-- compliance:off -->
451
+ - Pre-existing issues: write nothing to them, no comment and no edit — NEVER rewrite the issue description.
452
+ - New issues: create with the D3 description.
453
+ <!-- compliance:end -->
414
454
  @end
415
455
 
416
456
  @define post_wave_report():
@@ -6,10 +6,12 @@ paths: []
6
6
  **Match existing patterns — consistency beats cleverness.**
7
7
 
8
8
  - Single responsibility: one reason to change per module
9
+ - Find the existing owner: extend it when new code shares its job, never add a parallel copy; a trust-boundary or fail-closed check is not a copy
9
10
  - No regressions: every change must pass existing tests
10
11
  - Behavior-focused tests: assert outcomes, not implementation details
11
12
  - If you can't explain it in 5 minutes, it's too complex — simplify first
12
13
  - Delete dead code — commented-out code is not version control
13
14
  - Leave the end-state, not the transition — after removing or renaming, strip the residue: tombstone comments ("no longer does X"), `*_old`/`v2` names, guards for now-impossible states, leftover migration scaffolding. Git holds the history.
15
+ - When a change alters a name, path or behavior, update the current tracked docs that state the old fact, not released changelog entries; for a security fix, state the effect only
14
16
  - Cut leftover debug statements, unused imports, unnecessary variables used once right after assignment, nested ternaries; cut checks the types enforce and catches around code that cannot throw, never at a trust boundary or fail-closed path
15
17
  - Zero warnings policy — treat all compiler and linter warnings as errors