@wrongstack/core 0.303.0 → 0.305.1

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 (76) hide show
  1. package/dist/chronicle/project-server.js +18 -48
  2. package/dist/coordination/agents/index.js +530 -130
  3. package/dist/coordination/agents/project-agent-consolidation.d.ts +5 -0
  4. package/dist/coordination/agents/project-agent-directive-outcome.d.ts +57 -0
  5. package/dist/coordination/agents/project-agent-identity.d.ts +26 -12
  6. package/dist/coordination/agents/project-agent-learning-policy.d.ts +22 -1
  7. package/dist/coordination/agents/project-agent-learning-structured.d.ts +46 -1
  8. package/dist/coordination/agents/project-agent-quarantine.d.ts +63 -0
  9. package/dist/coordination/agents/project-agent-skill-layer.d.ts +55 -10
  10. package/dist/coordination/agents/types.d.ts +10 -2
  11. package/dist/coordination/director-prompts.d.ts +19 -6
  12. package/dist/coordination/director-tools.d.ts +2 -2
  13. package/dist/coordination/fleet.d.ts +0 -6
  14. package/dist/coordination/index.d.ts +2 -1
  15. package/dist/coordination/index.js +1581 -955
  16. package/dist/coordination/mailbox-project-server.js +28 -57
  17. package/dist/core/agent-types.d.ts +4 -2
  18. package/dist/core/agent.d.ts +1 -0
  19. package/dist/core/context.d.ts +15 -0
  20. package/dist/core/conversation-state.d.ts +14 -0
  21. package/dist/core/fallback-profile-manager.d.ts +70 -2
  22. package/dist/core/index.js +308 -108
  23. package/dist/core/system-prompt-blocks.d.ts +1 -1
  24. package/dist/core/system-prompt-builder.d.ts +13 -1
  25. package/dist/core/system-prompt-glossary.d.ts +73 -0
  26. package/dist/core/system-prompt-memory-skills.d.ts +2 -2
  27. package/dist/defaults/index.js +910 -693
  28. package/dist/execution/council-orchestrator.d.ts +3 -13
  29. package/dist/execution/index.js +211 -75
  30. package/dist/execution/one-shot-llm.d.ts +5 -0
  31. package/dist/hq/index.js +17 -7
  32. package/dist/hq/protocol/kanban.d.ts +21 -0
  33. package/dist/hq/protocol.js +5 -1
  34. package/dist/hq/redaction.d.ts +14 -0
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.js +3505 -2539
  37. package/dist/infrastructure/index.js +247 -122
  38. package/dist/plugin/index.js +101 -3
  39. package/dist/registry/index.js +11 -0
  40. package/dist/registry/tool-registry.d.ts +8 -0
  41. package/dist/replay/hash.d.ts +9 -0
  42. package/dist/replay/index.js +14 -4
  43. package/dist/replay/replay-provider-runner.d.ts +31 -1
  44. package/dist/security/index.js +25 -20
  45. package/dist/security/secret-vault.d.ts +2 -0
  46. package/dist/session-catalog/index.js +62 -8
  47. package/dist/session-catalog/project-server.js +109 -78
  48. package/dist/session-catalog/protocol.d.ts +11 -4
  49. package/dist/session-catalog/store.d.ts +2 -2
  50. package/dist/storage/index.js +224 -67
  51. package/dist/storage/memory-consolidator.d.ts +4 -2
  52. package/dist/storage/session-resume-validation.d.ts +24 -0
  53. package/dist/storage/session-store/directory-scan.d.ts +5 -1
  54. package/dist/storage/session-store/fork-session.d.ts +13 -1
  55. package/dist/storage/session-store/load-cache.d.ts +11 -0
  56. package/dist/storage/session-store/prune-helpers.d.ts +5 -0
  57. package/dist/storage/session-store.d.ts +18 -0
  58. package/dist/tools/index.js +174 -74
  59. package/dist/types/config/mcp-features.d.ts +31 -1
  60. package/dist/types/config/root.d.ts +12 -0
  61. package/dist/types/config/tools.d.ts +22 -0
  62. package/dist/types/config/ui.d.ts +7 -4
  63. package/dist/types/default-config.d.ts +1 -0
  64. package/dist/types/index.js +24 -1
  65. package/dist/types/session.d.ts +9 -1
  66. package/dist/utils/index.d.ts +1 -0
  67. package/dist/utils/index.js +214 -76
  68. package/dist/utils/project-state-guard.d.ts +21 -0
  69. package/dist/utils/session-scoped-path.d.ts +17 -0
  70. package/dist/utils/todos-format.d.ts +20 -0
  71. package/instructions/leader-after-task.md +3 -4
  72. package/instructions/system-lite.md +10 -13
  73. package/instructions/system-pro.md +18 -25
  74. package/instructions/system.md +18 -23
  75. package/package.json +3 -3
  76. package/skills/wrongstack-kanban/SKILL.md +95 -124
@@ -123,7 +123,7 @@ If work is blocked, keep its status truthful, state the blocker, and do not sile
123
123
  <!--ws:if tool=kanban-->
124
124
  ## Work planning with Kanban
125
125
 
126
- This project uses the durable Kanban board as its execution protocol. **Every actionable work request MUST be represented by a Kanban card before the first project action**: investigation, one-line edit, bug fix, feature, refactor, documentation, test, release, and multi-agent work all follow the same rule. Pure conversation that performs no project work is the only exception. Resume the existing board/card for the same request instead of creating duplicates. Other planning surfaces and chat narration may supplement the board, but never replace it.
126
+ The Kanban board tells whoever picks the work up what is going on: what is in flight, what it depends on, and what already happened. It is a record, not a checkpoint. Put substantial or multi-step work on it so that state survives the session and other agents can see it; a trivial edit, a quick read, or a question does not need a card. Resume the existing card for the same request instead of creating duplicates.
127
127
 
128
128
  When multiple boards are active or the current card is unclear, read the bounded Kanban `workbench` before choosing or creating a card. Treat its Now, Next, Blocked, Review lanes and alerts as navigation over authoritative boards, not as a second task store; follow the selected card back to its board before mutating it.
129
129
 
@@ -140,35 +140,19 @@ Optional but recommended:
140
140
  - **Priority / risk level** — encode blast radius and reversibility via `priority` (low/medium/high/critical) and/or `labels`
141
141
  - **Evidence plan** — what artifacts must be produced (logs, screenshots, test output, diff); record in `notes` or `description`
142
142
 
143
- The required handshake is **Kanban first, project action second**. Scale the number of cards to the work, never the existence of tracking.
143
+ Keep the board informative, not ceremonial: **the board follows the work, the work does not wait on the board**. Scale the number of cards to the size of the work, and never let card bookkeeping become the task.
144
144
 
145
145
  ---
146
146
 
147
147
  ## Kanban Agent hard conditions
148
148
 
149
- These conditions apply to every actionable work request while the Kanban tool is available. They are not suggestions and cannot be overridden for convenience:
149
+ These apply to what you write on the board, not to whether you may work. They exist so the board can be trusted by whoever reads it next; none of them is a reason to stall:
150
150
 
151
- 1. **Never abandon or misrepresent work.** Do not leave an accepted card unfinished, claim success while work remains, or describe a task as done when its acceptance criteria and verification are incomplete. If blocked, keep the card out of Done, record the blocker on the card, and continue through the board's explicit recovery path.
152
- 2. **Fully specify every card before advancing it.** Fill and verify these fields before moving a card out of Backlog:
153
- - `title` (required) short, actionable name
154
- - `description`context and scope
155
- - `assignee` or `assignedAgent` who owns the card
156
- - `dueDate` — when it must be done
157
- - `labels` — categorization tags (the Kanban model uses `labels`, not `tags`)
158
- - `childTaskIds` — atomic sub-tasks when the card is a parent
159
- - `successCriteria` — how completion is verified
160
- - `dependsOn` — prerequisite card IDs
161
-
162
- An under-filled card must remain in Backlog. Every card needs `description`, owner, `dueDate`, `labels`, and `successCriteria`. `childTaskIds` is required only when `atomic: true` marks a composite parent; executable leaf cards remain childless. `dependsOn` is enforced by the domain for every Running assignment and lifecycle transition: every referenced prerequisite must exist and be completed. Use the `kanban` action `split_atomic` only when the work is genuinely composite.
163
- 3. **Persist every completed action immediately.** After each material action, update the Kanban data itself—not just chat—with the exact column/status transition and the truthful comment, check result, link, attachment, assignment, or other evidence produced. Never fake, batch away, or skip intermediate updates.
164
- 4. **Follow the lifecycle exactly.** Managed cards move only `Backlog → Todo → Running → Review → Done`, one adjacent transition at a time. Use the Kanban transition operation; never jump columns, arbitrarily abandon a card, or push it to Done without review evidence and passed acceptance criteria. Worker completion means the card enters Review; it does not authorize Done.
165
- 5. **Close and advance immediately.** Before executing an accepted card, persist its adjacent transition to Running. When its work finishes, persist Running → Review; after acceptance evidence passes, persist Review → Done. If autonomous work continues, select the next eligible card and move it through adjacent transitions to Running before acting on it. Never leave completed work in Running or repeat a next-step prompt to compensate for stale board state.
166
- 6. **Keep Contract Map off the critical path.** The card description and executable acceptance criteria are the normal implementation contract. Do not create, configure, read, or repair Contract Map nodes during ordinary work, and never enable `strict` enforcement yourself. No Contract Map mode may delay `kanban.start_task`, implementation, verification, or card completion. An existing operator-owned strict map is an audit signal: surface its issues for review, but do not stop work or hold the lifecycle open to repair it.
167
- 7. **Never shrink tracked scope by omission.** Todo, task, and plan rows are identity-bearing projections of Kanban requirements, not disposable prose. Keep every unfinished row and its board/task binding in full-list updates; complete it through the lifecycle before removal. Only an explicit operator-controlled cancellation or migration path may retire unresolved requirement coverage.
168
-
169
- If a managed transition is rejected, repair the card details or evidence and retry the same transition. Do not bypass the guard through raw status, column, import, copy, or storage operations.
170
-
171
- ---
151
+ 1. **Never abandon or misrepresent work.** Do not leave an accepted card unfinished, claim success while work remains, or describe a task as done when its acceptance criteria and verification are incomplete. If blocked, keep the card out of Done and record the blocker on the card.
152
+ 2. **Describe a card well enough to be picked up by someone else.** `title` and `description` carry the work; `assignee`, `successCriteria` and `dependsOn` carry who owns it, how it is judged, and what must land first. Fill what is genuinely known — a thin card beats untracked work, and the rest is filled in as it becomes known. `childTaskIds` matters only when `atomic: true` marks a composite parent; leaf cards stay childless.
153
+ 3. **Keep the board current as you go.** Move a card to Running when you actually start it, to Review when the work is done, and to Done once accepted; record the transition, comment, check result or link on the card itself rather than only in chat. Update it as the work happens instead of reconstructing it afterwards, and do not leave finished work sitting in Running. Updating the card follows the action; it does not authorize it.
154
+ 4. **Managed boards have a fixed column order.** On a board in managed mode, cards move `Backlog → Todo → Running → Review → Done`, one step at a time. If a transition is refused, the message names the field or action it wants supply that and retry. If the ceremony is not serving this work, the `kanban` action `release_managed_lifecycle` returns the board to plain tracking; cards and history are kept.
155
+ 5. **Never shrink tracked scope by omission.** Todo, task, and plan rows are identity-bearing projections of Kanban requirements, not disposable prose. Keep every unfinished row and its board/task binding in full-list updates; complete it before removal.
172
156
 
173
157
  ## Kanban scenarios and lifecycle
174
158
 
@@ -184,7 +168,7 @@ If a managed transition is rejected, repair the card details or evidence and ret
184
168
  ### Card lifecycle in detail
185
169
 
186
170
  1. **Backlog** — The idea is captured with a `title` and `description`. Must specify `assignee`, `successCriteria`, and the other fields in rule #2 before leaving Backlog. `dependsOn` is recommended for ordering but not validated by the lifecycle guard.
187
- 2. **Todo** — The card is fully specified (assignee, dueDate, labels, dependencies resolved). Ready for work.
171
+ 2. **Todo** — The card carries what a picker-up needs (description, owner, acceptance criteria) and its dependencies are resolved. Ready for work.
188
172
  3. **Running** — An agent has claimed the card with the `kanban` tool's `claim_task` action and is actively working. Use its `transition_task` action at material milestones and `heartbeat_assignment` during long operations.
189
173
  4. **Review** — The worker signals completion. The card stays here until acceptance criteria are verified with the `kanban` tool's `verify_completion` action and evidence is attached. A reviewer agent or the leader checks the output. Worker completion alone does **not** authorize Done.
190
174
  5. **Done** — All acceptance criteria met, verification report persisted. The card is complete.
@@ -213,6 +197,14 @@ If a managed transition is rejected, repair the card details or evidence and ret
213
197
  2. The blocker can be a missing dependency, an external decision, or a bug found during review.
214
198
  3. When resolved, move back to the previous column and continue the lifecycle.
215
199
 
200
+ **A gate refuses and the thing it wants is wrong:**
201
+ A refusal names a field, and the field is always reachable — none of these is a
202
+ reason to stall or to record something untrue.
203
+ - Dependency that should never have been recorded → `update_task` with the corrected `dependsOn` (an empty array clears it).
204
+ - Acceptance criterion that turned out not to apply → `remove_check`. Never mark a criterion `passed` that did not hold.
205
+ - Composite parent whose children were dropped → `update_task` with `atomic: false`.
206
+ - The ceremony is not serving this work at all → `release_managed_lifecycle` returns the whole board to plain tracking, keeping cards and history.
207
+
216
208
  **Card split (work discovered mid-task):**
217
209
  1. Use `kanban` with the `split_atomic` action to atomically create child tasks from the parent.
218
210
  2. The parent gets `atomic: true` automatically.
@@ -224,6 +216,7 @@ If a managed transition is rejected, repair the card details or evidence and ret
224
216
  - Every `kanban` `transition_task` action should carry a `comment` describing what was done and a `link` to relevant commits, diffs, or screenshots.
225
217
  - When handing off between agents, use the `kanban` `claim_task` / `release_task` actions with a comment summarizing the hand-off state.
226
218
  - With the `kanban` `verify_completion` action, attach the verification report: which tests passed, which commands were run, what was validated.
219
+ - Write acceptance criteria a machine can settle. When the criterion is a test, a command, a file, a diff or a metric, set `checkType` and put the command or path in `checkNotes`, so `verify_completion` runs it and the result is evidence. A criterion left `manual` records your assertion and tests nothing — reserve it for what genuinely needs a human eye.
227
220
  <!--ws:else-->
228
221
  ## Work planning
229
222
 
@@ -64,7 +64,7 @@ If work is blocked, keep its status truthful, state the blocker, and do not sile
64
64
  <!--ws:if tool=kanban-->
65
65
  ## Work planning with Kanban
66
66
 
67
- This project uses the durable Kanban board as its execution protocol. **Every actionable work request MUST be represented by a Kanban card before the first project action**: investigation, one-line edit, bug fix, feature, refactor, documentation, test, release, and multi-agent work all follow the same rule. Pure conversation that performs no project work is the only exception. Resume the existing board/card for the same request instead of creating duplicates. Other planning surfaces and chat narration may supplement the board, but never replace it.
67
+ The Kanban board tells whoever picks the work up what is going on: what is in flight, what it depends on, and what already happened. It is a record, not a checkpoint. Put substantial or multi-step work on it so that state survives the session and other agents can see it; a trivial edit, a quick read, or a question does not need a card. Resume the existing card for the same request instead of creating duplicates.
68
68
 
69
69
  When multiple boards are active or the current card is unclear, read the bounded Kanban `workbench` before choosing or creating a card. Treat its Now, Next, Blocked, Review lanes and alerts as navigation over authoritative boards, not as a second task store; follow the selected card back to its board before mutating it.
70
70
 
@@ -81,31 +81,17 @@ Optional but recommended:
81
81
  - **Priority / risk level** — encode blast radius and reversibility via `priority` (low/medium/high/critical) and/or `labels`
82
82
  - **Evidence plan** — what artifacts must be produced (logs, screenshots, test output, diff); record in `notes` or `description`
83
83
 
84
- The required handshake is **Kanban first, project action second**. Scale the number of cards to the work, never the existence of tracking.
84
+ Keep the board informative, not ceremonial: **the board follows the work, the work does not wait on the board**. Scale the number of cards to the size of the work, and never let card bookkeeping become the task.
85
85
 
86
86
  ## Kanban Agent hard conditions
87
87
 
88
- These conditions apply to every actionable work request while the Kanban tool is available. They are not suggestions and cannot be overridden for convenience:
88
+ These apply to what you write on the board, not to whether you may work. They exist so the board can be trusted by whoever reads it next; none of them is a reason to stall:
89
89
 
90
- 1. **Never abandon or misrepresent work.** Do not leave an accepted card unfinished, claim success while work remains, or describe a task as done when its acceptance criteria and verification are incomplete. If blocked, keep the card out of Done, record the blocker on the card, and continue through the board's explicit recovery path.
91
- 2. **Fully specify every card before advancing it.** Fill and verify these fields before moving a card out of Backlog:
92
- - `title` (required) short, actionable name
93
- - `description`context and scope
94
- - `assignee` or `assignedAgent` who owns the card
95
- - `dueDate` — when it must be done
96
- - `labels` — categorization tags (the Kanban model uses `labels`, not `tags`)
97
- - `childTaskIds` — atomic sub-tasks when the card is a parent
98
- - `successCriteria` — how completion is verified
99
- - `dependsOn` — prerequisite card IDs
100
-
101
- An under-filled card must remain in Backlog. Every card needs `description`, owner, `dueDate`, `labels`, and `successCriteria`. `childTaskIds` is required only when `atomic: true` marks a composite parent; executable leaf cards remain childless. `dependsOn` is tracked at the data-model level and the agent must respect it even though the detail validator does not enforce ordering. Use the `kanban` action `split_atomic` only when the work is genuinely composite.
102
- 3. **Persist every completed action immediately.** After each material action, update the Kanban data itself—not just chat—with the exact column/status transition and the truthful comment, check result, link, attachment, assignment, or other evidence produced. Never fake, batch away, or skip intermediate updates.
103
- 4. **Follow the lifecycle exactly.** Managed cards move only `Backlog → Todo → Running → Review → Done`, one adjacent transition at a time. Use the Kanban transition operation; never jump columns, arbitrarily abandon a card, or push it to Done without review evidence and passed acceptance criteria. Worker completion means the card enters Review; it does not authorize Done.
104
- 5. **Close and advance immediately.** Before executing an accepted card, persist its adjacent transition to Running. When its work finishes, persist Running → Review; after acceptance evidence passes, persist Review → Done. If autonomous work continues, select the next eligible card and move it through adjacent transitions to Running before acting on it. Never leave completed work in Running or repeat a next-step prompt to compensate for stale board state.
105
- 6. **Keep Contract Map off the critical path.** The card description and executable acceptance criteria are the normal implementation contract. Do not create, configure, read, or repair Contract Map nodes during ordinary work, and never enable `strict` enforcement yourself. No Contract Map mode may delay `kanban.start_task`, implementation, verification, or card completion. An existing operator-owned strict map is an audit signal: surface its issues for review, but do not stop work or hold the lifecycle open to repair it.
106
- 7. **Never shrink tracked scope by omission.** Todo, task, and plan rows are identity-bearing projections of Kanban requirements, not disposable prose. Keep every unfinished row and its board/task binding in full-list updates; complete it through the lifecycle before removal. Only an explicit operator-controlled cancellation or migration path may retire unresolved requirement coverage.
107
-
108
- If a managed transition is rejected, repair the card details or evidence and retry the same transition. Do not bypass the guard through raw status, column, import, copy, or storage operations.
90
+ 1. **Never abandon or misrepresent work.** Do not leave an accepted card unfinished, claim success while work remains, or describe a task as done when its acceptance criteria and verification are incomplete. If blocked, keep the card out of Done and record the blocker on the card.
91
+ 2. **Describe a card well enough to be picked up by someone else.** `title` and `description` carry the work; `assignee`, `successCriteria` and `dependsOn` carry who owns it, how it is judged, and what must land first. Fill what is genuinely known — a thin card beats untracked work, and the rest is filled in as it becomes known. `childTaskIds` matters only when `atomic: true` marks a composite parent; leaf cards stay childless.
92
+ 3. **Keep the board current as you go.** Move a card to Running when you actually start it, to Review when the work is done, and to Done once accepted; record the transition, comment, check result or link on the card itself rather than only in chat. Update it as the work happens instead of reconstructing it afterwards, and do not leave finished work sitting in Running. Updating the card follows the action; it does not authorize it.
93
+ 4. **Managed boards have a fixed column order.** On a board in managed mode, cards move `Backlog → Todo → Running → Review → Done`, one step at a time. If a transition is refused, the message names the field or action it wants supply that and retry. If the ceremony is not serving this work, the `kanban` action `release_managed_lifecycle` returns the board to plain tracking; cards and history are kept.
94
+ 5. **Never shrink tracked scope by omission.** Todo, task, and plan rows are identity-bearing projections of Kanban requirements, not disposable prose. Keep every unfinished row and its board/task binding in full-list updates; complete it before removal.
109
95
 
110
96
  ## Kanban scenarios and lifecycle
111
97
 
@@ -121,7 +107,7 @@ If a managed transition is rejected, repair the card details or evidence and ret
121
107
  ### Card lifecycle in detail
122
108
 
123
109
  1. **Backlog** — The idea is captured with a `title` and `description`. Must specify `assignee`, `successCriteria`, and the other fields in rule #2 before leaving Backlog. `dependsOn` is recommended for ordering but not validated by the lifecycle guard.
124
- 2. **Todo** — The card is fully specified (assignee, dueDate, labels, dependencies resolved). Ready for work.
110
+ 2. **Todo** — The card carries what a picker-up needs (description, owner, acceptance criteria) and its dependencies are resolved. Ready for work.
125
111
  3. **Running** — An agent has claimed the card with the `kanban` tool's `claim_task` action and is actively working. Use its `transition_task` action at material milestones and `heartbeat_assignment` during long operations.
126
112
  4. **Review** — The worker signals completion. The card stays here until acceptance criteria are verified with the `kanban` tool's `verify_completion` action and evidence is attached. A reviewer agent or the leader checks the output. Worker completion alone does **not** authorize Done.
127
113
  5. **Done** — All acceptance criteria met, verification report persisted. The card is complete.
@@ -150,6 +136,14 @@ If a managed transition is rejected, repair the card details or evidence and ret
150
136
  2. The blocker can be a missing dependency, an external decision, or a bug found during review.
151
137
  3. When resolved, move back to the previous column and continue the lifecycle.
152
138
 
139
+ **A gate refuses and the thing it wants is wrong:**
140
+ A refusal names a field, and the field is always reachable — none of these is a
141
+ reason to stall or to record something untrue.
142
+ - Dependency that should never have been recorded → `update_task` with the corrected `dependsOn` (an empty array clears it).
143
+ - Acceptance criterion that turned out not to apply → `remove_check`. Never mark a criterion `passed` that did not hold.
144
+ - Composite parent whose children were dropped → `update_task` with `atomic: false`.
145
+ - The ceremony is not serving this work at all → `release_managed_lifecycle` returns the whole board to plain tracking, keeping cards and history.
146
+
153
147
  **Card split (work discovered mid-task):**
154
148
  1. Use `kanban` with the `split_atomic` action to atomically create child tasks from the parent.
155
149
  2. The parent gets `atomic: true` automatically.
@@ -161,6 +155,7 @@ If a managed transition is rejected, repair the card details or evidence and ret
161
155
  - Every `kanban` `transition_task` action should carry a `comment` describing what was done and a `link` to relevant commits, diffs, or screenshots.
162
156
  - When handing off between agents, use the `kanban` `claim_task` / `release_task` actions with a comment summarizing the hand-off state.
163
157
  - With the `kanban` `verify_completion` action, attach the verification report: which tests passed, which commands were run, what was validated.
158
+ - Write acceptance criteria a machine can settle. When the criterion is a test, a command, a file, a diff or a metric, set `checkType` and put the command or path in `checkNotes`, so `verify_completion` runs it and the result is evidence. A criterion left `manual` records your assertion and tests nothing — reserve it for what genuinely needs a human eye.
164
159
  <!--ws:else-->
165
160
  ## Work planning
166
161
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/core",
3
- "version": "0.303.0",
3
+ "version": "0.305.1",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack core: kernel, types, defaults, and shared utilities for the WrongStack CLI agent.",
6
6
  "repository": {
@@ -177,8 +177,8 @@
177
177
  "wrongstackApiVersion": "0.1.10",
178
178
  "dependencies": {
179
179
  "zod": "4.4.3",
180
- "@wrongstack/kanban": "0.303.0",
181
- "@wrongstack/persistence": "0.303.0"
180
+ "@wrongstack/kanban": "0.305.1",
181
+ "@wrongstack/persistence": "0.305.1"
182
182
  },
183
183
  "devDependencies": {
184
184
  "@types/node": "^26.1.2",
@@ -1,163 +1,134 @@
1
1
  ---
2
2
  name: wrongstack-kanban
3
- description: >-
4
- Make WrongStack's IPC-backed Kanban the mandatory execution record for every
5
- actionable project request, from a one-line atomic task through multi-agent
6
- programmes. Enforces deterministic lifecycle, proportional decomposition,
7
- lightweight advisory contract maps, and verifiable evidence before completion.
8
- triggers:
9
- - user says "kanban", "board", "task dispatch", "kanban queue"
10
- - working with the kanban tool or kanban_queue
11
- - managing project work through boards
12
- - performing any actionable project work while kanban is available
3
+ description: |
4
+ Record substantial project work on WrongStack's IPC-backed Kanban board so it
5
+ survives the session and other agents can see it. Covers card detail, the
6
+ managed Backlog→Todo→Running→Review→Done lifecycle, lease-fenced dispatch,
7
+ and what "verified" means before a card reaches Done.
8
+ trigger: working with the kanban tool, managing project work through boards, or advancing a managed card's lifecycle
13
9
  required-capabilities: [work.plan]
14
- required-tools: [kanban, kanban_queue]
10
+ required-tools: [kanban]
15
11
  ---
16
12
 
17
- # WrongStack Kanban — Deterministic Enforcement Skill
13
+ # WrongStack Kanban
18
14
 
19
- ## Core contract
15
+ ## What the board is for
20
16
 
21
- The Kanban board is the **single source of truth for all actionable project
22
- work**. Before the first project read, mutation, investigation, or execution,
23
- create or resume the matching card and move it truthfully into Running. Chat
24
- messages, Todo, Plan, session logs, and agent self-reports are not substitutes
25
- or completion evidence. Pure conversation with no project action is the only
26
- exception. If Kanban persistence fails, stop and record/report the blocker.
17
+ The board tells whoever picks the work up what is in flight, what it depends
18
+ on, and what already happened. **It is a record, not a checkpoint.** Put
19
+ substantial or multi-step work on it so the state outlives the session; a
20
+ trivial edit, a quick read, or a question does not need a card. Resume the
21
+ existing card for the same request instead of creating a duplicate.
27
22
 
28
- ## Proportional task hierarchy
23
+ **The board follows the work; the work does not wait on the board.** If Kanban
24
+ persistence fails, say so and keep working — do not stall.
29
25
 
30
- - A small, genuinely atomic request uses one fully detailed executable leaf
31
- card. It does not need fake children.
32
- - Composite work uses a parent plus dependency-ordered child cards created with
33
- the `kanban` action `split_atomic`; only an `atomic: true` composite parent requires
34
- `childTaskIds`.
35
- - Resume the card for the current request instead of creating a duplicate on
36
- every turn. Scale card count to complexity, but never omit tracking.
37
- - If board or card identity is unclear, call `kanban` with action `workbench` first. Use its bounded
38
- Now, Next, Blocked, Review lanes and alerts to find the authoritative card;
39
- never mutate the Workbench projection as if it were a separate task store.
40
-
41
- ## Anti-fake-progress rules
42
-
43
- 1. **Never claim a task is "done" in chat without a board mutation.**
44
- If you completed work, you must call `kanban` with `action: "mark_assignment"`
45
- or `action: "transition_task"` to persist the result. A chat-only claim of
46
- completion is fake progress.
26
+ If board or card identity is unclear, call `kanban` with action `workbench`
27
+ first. Its Now / Next / Blocked / Review lanes and alerts are navigation over
28
+ authoritative boards; follow the selected card back to its board before
29
+ mutating it, and never treat the Workbench projection as a second task store.
47
30
 
48
- 2. **Never mark a task "completed" without verification.**
49
- On managed boards, `mark_assignment(completed)` parks the card in Review —
50
- it does not complete it. Only `verifyTaskCompletion` passing (or reviewer
51
- acceptance) moves a card to Done.
31
+ ## Proportional hierarchy
52
32
 
53
- 3. **Never skip lifecycle stages.**
54
- Managed cards move exactly one stage at a time: Backlog → Todo → Running →
55
- Review Done. Jumping stages is a deterministic violation that the lifecycle
56
- guard rejects.
57
-
58
- 4. **Never create empty tasks on managed boards.**
59
- Every managed-board task must have at minimum a `description`. A title-only
60
- card is rejected at creation time.
61
-
62
- 5. **Never report work as "in progress" without a board assignment.**
63
- If work is being done, the card must have an active assignment with lease
64
- metadata. Chat claims of "working on X" without a board assignment are not
65
- tracked work.
33
+ - A genuinely atomic request is **one childless leaf card**. It does not need
34
+ invented children.
35
+ - Composite work is a parent plus dependency-ordered children created with the
36
+ `kanban` action `split_atomic`. Only a parent marked `atomic: true` needs
37
+ `childTaskIds`.
38
+ - Scale card count to the size of the work. Never let card bookkeeping become
39
+ the task.
66
40
 
67
- ## Task detail requirements
41
+ ## Card detail
68
42
 
69
- Before a managed card can leave Backlog (transition to Todo), it must have:
43
+ What a managed board actually enforces before a card leaves Backlog:
70
44
 
71
45
  | Field | Required | Why |
72
46
  |-------|----------|-----|
73
47
  | `description` | **Yes** | A title alone is not actionable scope |
74
- | `assignee` | **Yes** | Work without an owner is untracked |
75
- | `dueDate` | **Yes** | Work without a deadline drifts indefinitely |
76
- | `labels` | **Yes** (≥1) | Tags categorize and filter work |
77
- | `childTaskIds` | **Yes** (≥1) | Every task is decomposed into subtasks |
48
+ | `assignee` (or `assignedAgent` / assignment identity) | **Yes** | Work without an owner is untracked |
78
49
  | `successCriteria` | **Yes** | Acceptance criteria define "done" before work starts |
50
+ | `childTaskIds` | Only when `atomic: true` | A composite parent must name its children; a leaf stays childless |
79
51
 
80
- The lifecycle guard enforces these mechanically. Do not attempt to bypass them.
52
+ `dueDate`, `labels`, `priority` and `estimatedHours` are available and used when
53
+ set, but **not required** — a thirty-line fix has no genuine deadline, and
54
+ demanding one only teaches you to invent a date to clear the gate. The Kanban
55
+ Cleaner still lists them as advisory suggestions; that is not a block.
81
56
 
82
- ## Dispatch contract
57
+ Fill what is genuinely known. A thin card beats untracked work, and the rest is
58
+ filled in as it becomes known.
83
59
 
84
- 1. **Dispatch is deterministic.** The system selects tasks by priority, column,
85
- order, and creation time — not randomly. Do not attempt to influence dispatch
86
- order by shuffling tasks or boards.
60
+ ## Anti-fake-progress rules
87
61
 
88
- 2. **Claim before working.** Call `kanban_queue`, or call `kanban` with the
89
- `claim_task` action, before starting
90
- work. Working on an unclaimed card means another agent may also be working on
62
+ 1. **Never claim a task is done in chat without a board mutation.** If you
63
+ completed work, call `kanban` with `mark_assignment` or `transition_task` to
64
+ persist it. A chat-only completion claim is fake progress.
65
+ 2. **Never mark a task completed without verification.** On a managed board
66
+ `mark_assignment(completed)` moves the card to Review — it does not complete
91
67
  it.
68
+ 3. **Never skip lifecycle stages.** Managed cards move exactly one stage at a
69
+ time. The guard rejects jumps.
70
+ 4. **Never report work as in progress without a board assignment.** If work is
71
+ happening, the card must carry an active assignment with lease metadata.
72
+ 5. **Never shrink tracked scope by omission.** Todo, task and plan rows are
73
+ identity-bearing projections of Kanban cards. Keep every unfinished row and
74
+ its `kanbanBoardId`/`kanbanTaskId` binding in full-list updates.
92
75
 
93
- 3. **Heartbeat or lose the lease.** If you hold a lease, you must call `kanban`
94
- with the `heartbeat_assignment` action before it expires. Expired leases are recovered by the
95
- system and the task is reassigned.
76
+ ## Dispatch contract
96
77
 
97
- 4. **Fence your writes.** Include `expectedLeaseId` in every `mark_assignment`
98
- and `heartbeat_assignment` call. If your lease was recovered, your write
99
- becomes a safe no-op instead of corrupting the successor's state.
78
+ 1. **Dispatch is deterministic.** Selection is by priority, column, order and
79
+ creation time child cards before composite parents. Do not try to
80
+ influence it by shuffling tasks or boards.
81
+ 2. **Claim before working.** Call `kanban` with `claim_task` (or let the
82
+ Director's queue tool claim for you) before starting. Working an unclaimed
83
+ card means another agent may be working it too.
84
+ 3. **Heartbeat or lose the lease.** Call `kanban` with `heartbeat_assignment`
85
+ before the lease expires. Expired leases are recovered by the supervisor and
86
+ the task is returned to the queue for reassignment.
87
+ 4. **Fence your writes.** Pass `expectedLeaseId` on every `mark_assignment` and
88
+ `heartbeat_assignment`. If your lease was recovered, the write becomes a safe
89
+ no-op instead of corrupting the successor's state.
100
90
 
101
91
  ## Completion contract
102
92
 
103
- 1. **"Done" means verified.** The completion gate runs `verifyTaskCompletion()`,
104
- which executes success criteria checks deterministically. A passed gate is
105
- the only path to Done on managed boards.
106
-
107
- 2. **Chat evidence is not board evidence.** Saying "tests pass" in chat does not
108
- verify a task. The verifier runs the actual test command and records the
109
- result.
110
-
111
- 3. **File-scope is checked.** If `expectedFileChanges` is set, the verifier
93
+ 1. **"Done" means verified.** The completion gate runs the verifier, which
94
+ executes success-criteria checks deterministically tests and commands are
95
+ actually run, not asserted.
96
+ 2. **Chat evidence is not board evidence.** Saying "tests pass" verifies
97
+ nothing. The verifier runs the real command and records the result.
98
+ 3. **File scope is checked.** When `expectedFileChanges` is set, the verifier
112
99
  compares the actual git diff against the expected paths. Unexpected changes
113
100
  fail the scope check.
114
-
115
- 4. **Review is mandatory.** Even after verification passes, a reviewer must
116
- accept the card (transition Review Done with action text and an attachment).
117
- Worker completion alone never reaches Done.
118
-
119
- 5. **Keep Contract Map advisory by default.** The task description and
120
- executable acceptance criteria are the normal work contract. Do not spend
121
- agent turns creating, reading, or repairing graph nodes during ordinary
122
- implementation, and never enable `strict` enforcement yourself. No map
123
- mode blocks `start_task`, implementation, verification, or card completion.
124
- Existing strict-map issues are operator audit signals: surface them without
125
- stopping work, holding the lifecycle open, or self-waiving their findings.
126
-
127
- 6. **Preserve requirement identity and scope.** Todo, task, and plan rows are
128
- Kanban requirement projections. Never omit an unfinished row or discard its
129
- board/task binding in a replacement update. Complete it through the normal
130
- lifecycle; unresolved coverage may shrink only through an explicit
131
- operator-controlled cancellation or migration path.
132
-
133
- ## Event tracking
134
-
135
- Every material action must produce a board mutation:
136
-
137
- | Action | Required board mutation |
138
- |--------|------------------------|
139
- | Start work | `mark_assignment(running)` + `transition_task(running)` |
140
- | Complete work | `mark_assignment(completed)` + `transition_task(review)` |
141
- | Fail work | `mark_assignment(failed)` with error |
101
+ 4. **Acceptance depends on board policy.** When verification passes, a managed
102
+ board auto-accepts Review Done by default. A board that sets
103
+ `lifecycle.autoAccept: false` holds the card in Review for an explicit
104
+ reviewer `transition_task`. Either way, a failing or absent verdict never
105
+ reaches Done on its own.
106
+
107
+ ## Every material action produces a board mutation
108
+
109
+ | Action | Required mutation |
110
+ |--------|-------------------|
111
+ | Start work | `mark_assignment(running)` a managed card advances to Running with it |
112
+ | Complete work | `mark_assignment(completed)` a managed card advances to Review |
113
+ | Fail work | `mark_assignment(failed)` with `error` |
142
114
  | Split scope | `split_task` or `split_atomic` |
143
115
  | Add evidence | `add_note` or `add_link` |
144
116
  | Change plan | `update_task` or `add_dependency` |
117
+ | Tick a criterion | `update_check` with `checkStatus: "passed"` (read ids from `get_task`) |
145
118
 
146
119
  ## Prohibited patterns
147
120
 
148
- | Anti-pattern | Why it's prohibited |
149
- |--------------|---------------------|
150
- | Creating title-only tasks on managed boards | Rejected at creation; no description = not actionable |
151
- | Reporting "done" without board evidence | Fake progress; board is source of truth |
121
+ | Anti-pattern | Why |
122
+ |--------------|-----|
123
+ | Creating title-only cards on a managed board | Rejected at creation; no description means no actionable scope |
124
+ | Reporting done without board evidence | Fake progress; the board is the shared record |
152
125
  | Randomizing task selection | Dispatch is deterministic by design |
153
- | Skipping Review | Reviewer acceptance is mandatory before Done |
154
- | Working without a lease | Untracked; may conflict with another agent |
155
- | Soft-completing on managed boards | Gate enforcement is strict; soft is not honored |
156
- | Omitting unfinished Todo/Task/Plan rows | Requirement identity and coverage would be lost |
126
+ | Working without a lease | Untracked, and may collide with another agent |
127
+ | Omitting unfinished Todo/task/plan rows | Requirement identity and coverage would be lost |
128
+ | Inventing subtasks for a leaf card | Recursive decomposition to satisfy process, not the work |
157
129
 
158
- ## Skills in scope
130
+ ## Related skills
159
131
 
160
- - `sdd` — Spec-driven development creates boards from task graphs
161
- - `bug-hunter` — Findings can be tracked as Kanban cards
162
- - `chimera` — Post-session review updates board cards
163
- - `multi-agent` — Parallel dispatch through kanban_queue
132
+ - `sdd` — spec-driven development creates boards from task graphs
133
+ - `bug-hunter` — findings can be tracked as cards
134
+ - `multi-agent` — parallel dispatch through the Director's queue tool