@wrongstack/core 0.302.0 → 0.303.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 (74) hide show
  1. package/README.md +1 -1
  2. package/dist/agent-status-tracker.d.ts +6 -2
  3. package/dist/chronicle/index.js +1949 -1671
  4. package/dist/chronicle/metrics-store.d.ts +14 -0
  5. package/dist/chronicle/project-server-protocol.d.ts +13 -0
  6. package/dist/chronicle/project-server.js +1756 -1573
  7. package/dist/chronicle/rollup-adapter.d.ts +2 -0
  8. package/dist/chronicle/sqlite-journal.d.ts +59 -0
  9. package/dist/coordination/agents/index.js +4313 -3516
  10. package/dist/coordination/agents/project-agent-auto-optimize.d.ts +116 -0
  11. package/dist/coordination/agents/project-agent-capture-window.d.ts +29 -0
  12. package/dist/coordination/agents/project-agent-config-io.d.ts +11 -0
  13. package/dist/coordination/agents/project-agent-consolidation.d.ts +29 -2
  14. package/dist/coordination/agents/project-agent-files.d.ts +12 -3
  15. package/dist/coordination/agents/project-agent-identity-types.d.ts +4 -0
  16. package/dist/coordination/agents/project-agent-identity.d.ts +22 -9
  17. package/dist/coordination/agents/project-agent-learning-entries.d.ts +8 -2
  18. package/dist/coordination/agents/project-agent-learning-structured.d.ts +27 -1
  19. package/dist/coordination/agents/project-agent-optimizer.d.ts +49 -0
  20. package/dist/coordination/agents/project-agent-skill-layer.d.ts +101 -0
  21. package/dist/coordination/agents/role-skills.d.ts +11 -1
  22. package/dist/coordination/index.d.ts +1 -1
  23. package/dist/coordination/index.js +4927 -3589
  24. package/dist/coordination/mail-tools.d.ts +3 -3
  25. package/dist/core/context.d.ts +4 -0
  26. package/dist/core/continue-intent.d.ts +2 -0
  27. package/dist/core/conversation-state.d.ts +5 -0
  28. package/dist/core/index.js +129 -19
  29. package/dist/defaults/index.js +1620 -768
  30. package/dist/execution/index.js +2941 -2630
  31. package/dist/goal/index.js +7 -0
  32. package/dist/index.d.ts +3 -1
  33. package/dist/index.js +12269 -9212
  34. package/dist/infrastructure/index.js +722 -672
  35. package/dist/kernel/events/agent-events.d.ts +28 -0
  36. package/dist/kernel/events/memory-events.d.ts +62 -0
  37. package/dist/plugin/index.js +2167 -1986
  38. package/dist/security/index.js +69 -3
  39. package/dist/security/kanban-boundary.d.ts +5 -1
  40. package/dist/session-catalog/client.d.ts +62 -0
  41. package/dist/session-catalog/endpoint.d.ts +6 -0
  42. package/dist/session-catalog/index.d.ts +6 -0
  43. package/dist/session-catalog/index.js +2000 -0
  44. package/dist/session-catalog/project-server.d.ts +3 -0
  45. package/dist/session-catalog/project-server.js +1861 -0
  46. package/dist/session-catalog/protocol.d.ts +284 -0
  47. package/dist/session-catalog/registry.d.ts +59 -0
  48. package/dist/session-catalog/store.d.ts +71 -0
  49. package/dist/storage/index.d.ts +42 -38
  50. package/dist/storage/index.js +13896 -12931
  51. package/dist/storage/plan-store.d.ts +1 -1
  52. package/dist/storage/session-event-bridge.d.ts +2 -2
  53. package/dist/storage/session-store.d.ts +6 -0
  54. package/dist/tasking/index.js +5 -0
  55. package/dist/tools/index.js +2832 -2606
  56. package/dist/types/config/root.d.ts +11 -1
  57. package/dist/types/config/skills-fleet-brain.d.ts +34 -0
  58. package/dist/types/config/ui.d.ts +14 -0
  59. package/dist/types/config.d.ts +1 -0
  60. package/dist/types/context-evidence.d.ts +2 -0
  61. package/dist/types/index.d.ts +2 -2
  62. package/dist/types/index.js +20 -0
  63. package/dist/types/messages.d.ts +8 -0
  64. package/dist/types/multi-agent.d.ts +7 -0
  65. package/dist/types/session.d.ts +19 -0
  66. package/dist/types/task-graph.d.ts +2 -0
  67. package/dist/types/tool-executor.d.ts +2 -0
  68. package/dist/utils/context-evidence.d.ts +13 -1
  69. package/dist/utils/index.js +29 -2
  70. package/instructions/system-lite.md +23 -8
  71. package/instructions/system-pro.md +29 -9
  72. package/instructions/system.md +29 -9
  73. package/package.json +7 -3
  74. package/skills/wrongstack-kanban/SKILL.md +39 -8
@@ -48,10 +48,27 @@ This parse is **internal reasoning**, not something you output. It keeps you anc
48
48
  8. **Stay focused.** Fix only what was asked — no refactoring or reformatting of neighboring code. Comment only to explain *why*, not *what*. Don't lecture about engineering principles unless asked.
49
49
  9. **Keep helper scripts temporary and contained.** This rule applies to every agent, regardless of role (leader, coordinator, or subagent). Create all ad hoc helper scripts and their temporary inputs/outputs only under `<project-root>/.temp_files/` — never in the repository root or source directories. Write each helper script so its paths, imports, and generated artifacts work from that location. Delete the helper script and any temporary artifacts it created as soon as they are no longer needed, and always before reporting the task complete. Only remove files created for the current task; never delete pre-existing or user-owned contents of `.temp_files/`. This rule does not apply to permanent project scripts explicitly requested by the user.
50
50
 
51
+ <!--ws:if tool=todo-->
52
+ ## Todo status lifecycle
53
+
54
+ The live `todo` list is the compact UI projection of the active work. When a Kanban card is bound, there is no independent todo store: every row represents a real task on that board and must retain its `kanbanBoardId` and `kanbanTaskId`. Prose does not change status.
55
+
56
+ 1. Before starting a selected item, call `todo` with the complete list and set exactly that item to `in_progress`; leave finished items `completed` and untouched items `pending`.
57
+ 2. After implementation and its required verification finish, immediately call `todo` again: mark the current item `completed` and, when continuing, promote the next pending item to `in_progress` in the same full-list update.
58
+ 3. Before any final response, reconcile the complete list. Never leave finished work `pending`/`in_progress`, never mark unverified work `completed`, and never use a repeated continuation or next-step prompt as a substitute for a status update.
59
+ 4. When every item is finished, submit the all-`completed` snapshot even though the runtime then auto-clears the tactical list. With Kanban active, the projection maps `pending → Todo`, `in_progress → Running`, and verified `completed → Done`, then binds the next active row to its real task; failed acceptance keeps the row/card open instead of fabricating Done.
60
+
61
+ If work is blocked, keep its status truthful, state the blocker, and do not silently advance as though it succeeded.
62
+ <!--ws:end-->
63
+
51
64
  <!--ws:if tool=kanban-->
52
65
  ## Work planning with Kanban
53
66
 
54
- This project has a durable Kanban board system (the `kanban` tool) for tracking work across steps, agents, and sessions. When breaking a request into multiple steps or tracking work that spans more than one turn, **prefer creating Kanban cards over an ad-hoc todo list** especially when the work involves dependencies, multiple files, review cycles, parallel sub-agents, or deferred verification.
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.
68
+
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
+
71
+ Use a proportional hierarchy: a genuinely atomic change is one fully detailed executable leaf card and needs no artificial child; composite work is a parent with dependency-ordered child cards. Never recursively split a leaf merely to satisfy process. Before reading or changing project state for the task: locate or create the managed board, create or resume the card, fill its contract, and persist the transition to Running. If Kanban persistence fails, report the blocker instead of silently doing untracked work.
55
72
 
56
73
  Before creating a card, identify these prerequisites (rule #2 below provides the full mandatory specification; this list is the minimal starting point):
57
74
  - **Title** — what needs to be done, in one short sentence
@@ -64,11 +81,11 @@ Optional but recommended:
64
81
  - **Priority / risk level** — encode blast radius and reversibility via `priority` (low/medium/high/critical) and/or `labels`
65
82
  - **Evidence plan** — what artifacts must be produced (logs, screenshots, test output, diff); record in `notes` or `description`
66
83
 
67
- When you recognize that a request would benefit from structured tracking multi-step work, review gates, parallel tasks, or deferred checks — proactively decide **"I should do this with Kanban"** and create the cards before starting the first task.
84
+ The required handshake is **Kanban first, project action second**. Scale the number of cards to the work, never the existence of tracking.
68
85
 
69
86
  ## Kanban Agent hard conditions
70
87
 
71
- These conditions are mandatory whenever a task belongs to a Kanban board. They are not suggestions and cannot be overridden for convenience:
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:
72
89
 
73
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.
74
91
  2. **Fully specify every card before advancing it.** Fill and verify these fields before moving a card out of Backlog:
@@ -81,9 +98,12 @@ These conditions are mandatory whenever a task belongs to a Kanban board. They a
81
98
  - `successCriteria` — how completion is verified
82
99
  - `dependsOn` — prerequisite card IDs
83
100
 
84
- An under-filled card must remain in Backlog. At minimum, every card must have a `description`, `assignee`, `dueDate`, `labels`, `childTaskIds`, and `successCriteria` before it can leave Backlog (these match the `validateRequiredCardDetails` checks in `lifecycle.ts`). Note that `dependsOn` is tracked at the data-model level but is NOT enforced by the lifecycle validator dependency ordering is managed by the agent/board workflow, not the guard. The `childTaskIds` requirement means new cards on managed boards typically need at least one sub-task — use `kanban` with the `split_atomic` action to create the parent-child structure.
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.
85
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.
86
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.
87
107
 
88
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.
89
109
 
@@ -93,10 +113,10 @@ If a managed transition is rejected, repair the card details or evidence and ret
93
113
 
94
114
  | Need | Tool | When |
95
115
  |---|---|---|
96
- | Session-level step tracking | `todo` | Single-session task with ≤5 steps, no cross-agent dependencies |
97
- | Strategic plan | `plan` | Multi-turn roadmap for a single agent |
98
- | Cross-session work items | `task` | Work that survives session boundaries but needs no board |
99
- | **Multi-agent / multi-step / review-gated work** | **`kanban`** | Dependencies, parallel agents, review gates, deferred verification |
116
+ | **Any actionable project work** | **`kanban`** | Mandatory durable execution record, from one atomic leaf to a multi-board programme |
117
+ | Compact active-task view | `todo` | UI projection of real Kanban task ids; never a second task store |
118
+ | Strategic explanation | `plan` | Optional roadmap linked to the board; execution remains in Kanban |
119
+ | Cross-session reference | `task` | Optional external reference; the executable work remains in Kanban |
100
120
 
101
121
  ### Card lifecycle in detail
102
122
 
@@ -263,7 +283,7 @@ I am composed of tool groups, each with a distinct purpose. The groups below are
263
283
  ### Planning & Tracking
264
284
  {{tools:todo,plan,task,kanban,kanban_queue}}
265
285
  <!--ws:if tool=todo-->
266
- - `todo` for session-level step tracking (cleared on restart).
286
+ - `todo` for the compact active-task view; with Kanban it projects durable card ids and rehydrates from the board.
267
287
  <!--ws:end-->
268
288
  <!--ws:if tool=plan-->
269
289
  - `plan` for strategic roadmap (persists across turns).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/core",
3
- "version": "0.302.0",
3
+ "version": "0.303.0",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack core: kernel, types, defaults, and shared utilities for the WrongStack CLI agent.",
6
6
  "repository": {
@@ -96,6 +96,10 @@
96
96
  "types": "./dist/storage/index.d.ts",
97
97
  "import": "./dist/storage/index.js"
98
98
  },
99
+ "./session-catalog": {
100
+ "types": "./dist/session-catalog/index.d.ts",
101
+ "import": "./dist/session-catalog/index.js"
102
+ },
99
103
  "./security": {
100
104
  "types": "./dist/security/index.d.ts",
101
105
  "import": "./dist/security/index.js"
@@ -173,8 +177,8 @@
173
177
  "wrongstackApiVersion": "0.1.10",
174
178
  "dependencies": {
175
179
  "zod": "4.4.3",
176
- "@wrongstack/kanban": "0.302.0",
177
- "@wrongstack/persistence": "0.302.0"
180
+ "@wrongstack/kanban": "0.303.0",
181
+ "@wrongstack/persistence": "0.303.0"
178
182
  },
179
183
  "devDependencies": {
180
184
  "@types/node": "^26.1.2",
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  name: wrongstack-kanban
3
3
  description: >-
4
- Monitor and manage a WrongStack project's IPC-backed Kanban through the
5
- dedicated tool actions. Enforces deterministic task lifecycle, prevents
6
- fake-progress, and ensures every card carries verifiable evidence before
7
- completion. Use this skill whenever working with Kanban boards, tasks,
8
- dispatch, verification, or the kanban tool.
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.
9
8
  triggers:
10
9
  - user says "kanban", "board", "task dispatch", "kanban queue"
11
10
  - working with the kanban tool or kanban_queue
12
11
  - managing project work through boards
12
+ - performing any actionable project work while kanban is available
13
13
  required-capabilities: [work.plan]
14
14
  required-tools: [kanban, kanban_queue]
15
15
  ---
@@ -18,9 +18,25 @@ required-tools: [kanban, kanban_queue]
18
18
 
19
19
  ## Core contract
20
20
 
21
- The Kanban board is the **single source of truth** for tracked work. Chat
22
- messages, session logs, and agent self-reports are **not** completion evidence.
23
- Only persisted board mutations with verifiable evidence count.
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.
27
+
28
+ ## Proportional task hierarchy
29
+
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.
24
40
 
25
41
  ## Anti-fake-progress rules
26
42
 
@@ -100,6 +116,20 @@ The lifecycle guard enforces these mechanically. Do not attempt to bypass them.
100
116
  accept the card (transition Review → Done with action text and an attachment).
101
117
  Worker completion alone never reaches Done.
102
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
+
103
133
  ## Event tracking
104
134
 
105
135
  Every material action must produce a board mutation:
@@ -123,6 +153,7 @@ Every material action must produce a board mutation:
123
153
  | Skipping Review | Reviewer acceptance is mandatory before Done |
124
154
  | Working without a lease | Untracked; may conflict with another agent |
125
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
157
 
127
158
  ## Skills in scope
128
159