@wrongstack/core 0.302.2 → 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 (52) hide show
  1. package/README.md +1 -1
  2. package/dist/chronicle/index.js +117 -30
  3. package/dist/chronicle/project-server.js +12 -5
  4. package/dist/coordination/agents/index.js +4313 -3516
  5. package/dist/coordination/agents/project-agent-auto-optimize.d.ts +116 -0
  6. package/dist/coordination/agents/project-agent-capture-window.d.ts +29 -0
  7. package/dist/coordination/agents/project-agent-config-io.d.ts +11 -0
  8. package/dist/coordination/agents/project-agent-consolidation.d.ts +29 -2
  9. package/dist/coordination/agents/project-agent-files.d.ts +12 -3
  10. package/dist/coordination/agents/project-agent-identity-types.d.ts +4 -0
  11. package/dist/coordination/agents/project-agent-identity.d.ts +22 -9
  12. package/dist/coordination/agents/project-agent-learning-entries.d.ts +8 -2
  13. package/dist/coordination/agents/project-agent-learning-structured.d.ts +27 -1
  14. package/dist/coordination/agents/project-agent-optimizer.d.ts +49 -0
  15. package/dist/coordination/agents/project-agent-skill-layer.d.ts +101 -0
  16. package/dist/coordination/agents/role-skills.d.ts +11 -1
  17. package/dist/coordination/index.d.ts +1 -1
  18. package/dist/coordination/index.js +2322 -1526
  19. package/dist/coordination/mail-tools.d.ts +1 -1
  20. package/dist/core/context.d.ts +4 -0
  21. package/dist/core/index.js +9 -0
  22. package/dist/defaults/index.js +895 -597
  23. package/dist/execution/index.js +2915 -2621
  24. package/dist/goal/index.js +7 -0
  25. package/dist/index.js +2406 -1331
  26. package/dist/kernel/events/agent-events.d.ts +28 -0
  27. package/dist/plugin/index.js +10 -4
  28. package/dist/security/index.js +69 -3
  29. package/dist/security/kanban-boundary.d.ts +5 -1
  30. package/dist/session-catalog/index.js +24 -2
  31. package/dist/session-catalog/project-server.js +27 -4
  32. package/dist/session-catalog/protocol.d.ts +9 -0
  33. package/dist/session-catalog/store.d.ts +17 -1
  34. package/dist/storage/index.js +81 -2
  35. package/dist/storage/plan-store.d.ts +1 -1
  36. package/dist/tasking/index.js +5 -0
  37. package/dist/tools/index.js +2824 -2604
  38. package/dist/types/config/root.d.ts +11 -1
  39. package/dist/types/config/skills-fleet-brain.d.ts +34 -0
  40. package/dist/types/config/ui.d.ts +14 -0
  41. package/dist/types/config.d.ts +1 -0
  42. package/dist/types/index.d.ts +2 -2
  43. package/dist/types/index.js +20 -0
  44. package/dist/types/multi-agent.d.ts +7 -0
  45. package/dist/types/task-graph.d.ts +2 -0
  46. package/dist/types/tool-executor.d.ts +2 -0
  47. package/dist/utils/index.js +3 -0
  48. package/instructions/system-lite.md +14 -8
  49. package/instructions/system-pro.md +17 -11
  50. package/instructions/system.md +17 -11
  51. package/package.json +3 -3
  52. package/skills/wrongstack-kanban/SKILL.md +39 -8
@@ -1,10 +1,11 @@
1
1
  import type { ConfiguredHook, HookEvent } from '../hooks.js';
2
- import type { AutonomyConfig, ChronicleConfig, IndexingConfig, LaunchConfig, SessionLoggingConfig, SyncConfig } from './autonomy.js';
3
2
  import type { AdaptiveConcurrencyConfig, CircuitBreakerRuntimeConfig, ContextConfig } from './context.js';
3
+ import type { AutonomyConfig, ChronicleConfig, IndexingConfig, LaunchConfig, SessionLoggingConfig, SyncConfig } from './autonomy.js';
4
4
  import type { FeaturesConfig, LogConfig, MCPServerConfig, PluginConfig, PluginManagerConfig, SageConfig } from './mcp-features.js';
5
5
  import type { CustomModelDefinition, ModelMatrixEntry, ProviderConfig } from './providers.js';
6
6
  import type { CloudSyncConfig, HqClientConfig, ModelRuntimeConfig, SystemPromptConfig } from './runtime.js';
7
7
  import type { BrainConfig, FleetConfig, SkillsConfig } from './skills-fleet-brain.js';
8
+ import type { ThemePresetId } from './ui.js';
8
9
  import type { ToolsConfig } from './tools.js';
9
10
  export interface GitBehaviorConfig {
10
11
  /**
@@ -40,6 +41,15 @@ export interface Config {
40
41
  * unset, surfaces fall back to their own browser/system detection.
41
42
  */
42
43
  uiLocale?: string | undefined;
44
+ /**
45
+ * TUI color theme preset — read by the TUI on boot to apply the matching
46
+ * palette, and written by the `/theme` slash command (CLI REPL and TUI) so
47
+ * the choice persists across restarts. Unconstrained string at the config
48
+ * layer: the TUI owns the canonical preset list and applies a fallback
49
+ * (`catppuccin`) when the stored value is unknown, so a forward-compat
50
+ * drift on the TUI side never breaks the config round-trip.
51
+ */
52
+ themePreset?: ThemePresetId | undefined;
43
53
  providers?: Record<string, ProviderConfig>;
44
54
  /**
45
55
  * Top-level custom models (maps modelId → definition). Merged with
@@ -128,6 +128,40 @@ export interface FleetConfig {
128
128
  } | undefined;
129
129
  /** Brain-gated fleet supervisor (rebalance/steer/spawn-helper). */
130
130
  supervisor?: FleetSupervisorConfig | undefined;
131
+ /** Roster-agent self-learning: capture → optimize → per-skill addenda. */
132
+ learning?: AgentLearningConfig | undefined;
133
+ }
134
+ /**
135
+ * Automatic optimization of roster-agent learning.
136
+ *
137
+ * Capture is always automatic. This section governs the *distillation* pass
138
+ * that turns captured directives into per-skill project addenda and a
139
+ * consolidated role document, then archives and resets the raw buffer.
140
+ */
141
+ export interface AgentLearningConfig {
142
+ autoOptimize?: {
143
+ /** Run the distillation pass automatically. Default true. */
144
+ enabled?: boolean | undefined;
145
+ /** Raw buffer size (bytes) that makes a role eligible. Default 8192. */
146
+ thresholdBytes?: number | undefined;
147
+ /** Never optimize a buffer with fewer directives than this. Default 4. */
148
+ minEntries?: number | undefined;
149
+ /**
150
+ * Directives routed to a skill that has no addendum yet. Reaching this
151
+ * count makes a role eligible even below `thresholdBytes`. Default 3.
152
+ */
153
+ minPendingSkillDirectives?: number | undefined;
154
+ /** Minimum gap between automatic passes for one role. Default 6h. */
155
+ minIntervalMs?: number | undefined;
156
+ /** Quiet period after the last capture before a pass starts. Default 20s. */
157
+ debounceMs?: number | undefined;
158
+ /**
159
+ * Evaluate every role once when the fleet host starts, so roles that
160
+ * became eligible before this session are not stuck waiting for their
161
+ * next capture. Default true.
162
+ */
163
+ sweepOnStart?: boolean | undefined;
164
+ } | undefined;
131
165
  }
132
166
  /** Config surface for the brain-gated FleetSupervisor. */
133
167
  export interface FleetSupervisorConfig {
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Shared UI theme preset identifiers.
3
+ *
4
+ * Lives in core so the Config schema, the CLI `/theme` slash command, and
5
+ * the TUI runtime can all reference the same string union without
6
+ * importing the TUI package (which would invert the dependency direction).
7
+ *
8
+ * Keep in lockstep with `THEME_OPTIONS` in `packages/tui/src/theme.ts`.
9
+ * Adding a preset here is intentional — it also requires updating the TUI
10
+ * presets map AND the CLI `VALID_PRESETS` set in `tui-theme-adapter.ts`.
11
+ */
12
+ export declare const THEME_PRESET_IDS: readonly ['catppuccin', 'tokyo-night', 'nord', 'cyberpunk', 'dracula', 'gruvbox-dark', 'solarized-dark', 'one-dark', 'monokai', 'rose-pine', 'kanagawa', 'ayu-dark', 'everforest', 'night-owl', 'synthwave'];
13
+ export type ThemePresetId = (typeof THEME_PRESET_IDS)[number];
14
+ //# sourceMappingURL=ui.d.ts.map
@@ -6,5 +6,6 @@ export * from './config/providers.js';
6
6
  export * from './config/mcp-features.js';
7
7
  export * from './config/autonomy.js';
8
8
  export * from './config/skills-fleet-brain.js';
9
+ export * from './config/ui.js';
9
10
  export * from './config/root.js';
10
11
  //# sourceMappingURL=config.d.ts.map
@@ -13,8 +13,8 @@ export { ProviderError, classifyProviderError, effectiveInputTokens, isContextOv
13
13
  export type { CacheTtl, Capabilities, JsonSchemaSpec, Provider, ProviderContextLimit, ProviderErrorBody, ProviderErrorKind, ReasoningConfig, ReasoningEffort, ReasoningRequest, Request, RequestCacheControl, Response, ResponseFormat, SafetySetting, StopReason, StreamEvent, Usage } from './provider.js';
14
14
  export { StreamHangError } from './provider.js';
15
15
  export type { ProviderRunner, RunProviderOptions } from './provider-runner.js';
16
- export { DEFAULT_TUI_THINKING_WORD, FLEET_CHAT_VERBOSITY_VALUES, MAX_TUI_THINKING_WORD_LENGTH, normalizeTokenSavingTier, normalizeTuiThinkingWord, resolveFleetChatVerbosity, resolveTokenSavingTier } from './config.js';
17
- export type { AdaptiveConcurrencyConfig, AutonomyConfig, BrainConfig, BrainCouncilConfig, BrainCouncilVoterConfig, BrainModelEntry, CircuitBreakerRuntimeConfig, ConcreteTokenSavingTier, Config, ConfigLoader, ConfigStore, ContextConfig, CouncilPersonaDefinition, CouncilToolConfig, CouncilToolProfileDefinition, CustomModelDefinition, ExecDangerConfig, ExecToolConfig, FeaturesConfig, FleetChatVerbosity, FleetConfig, FleetSupervisorConfig, GitBehaviorConfig, HqClientConfig, IndexingConfig, InputHistoryConfig, LaunchConfig, LaunchMenuChoice, LogConfig, LoopDetectionConfig, MCPHealthConfig, MCPHealthThresholds, MCPServerConfig, ModelMatrixEntry, ModelRuntimeCacheConfig, ModelRuntimeConfig, ModelRuntimeParametersConfig, ModelRuntimeReasoningConfig, NextStepsToolConfig, PluginConfig, PluginManagerConfig, ProviderApiKey, ProviderConfig, SageConfig, SessionLoggingConfig, SkillsConfig, SyncCategory, SyncConfig, TokenSavingTier, ToolDescriptionMode, ToolDescriptionModeConfig, ToolResultRenderMode, ToolResultRenderModeConfig, ToolsConfig } from './config.js';
16
+ export { DEFAULT_TUI_THINKING_WORD, FLEET_CHAT_VERBOSITY_VALUES, MAX_TUI_THINKING_WORD_LENGTH, normalizeTokenSavingTier, normalizeTuiThinkingWord, resolveFleetChatVerbosity, resolveTokenSavingTier, THEME_PRESET_IDS } from './config.js';
17
+ export type { AdaptiveConcurrencyConfig, AgentLearningConfig, AutonomyConfig, BrainConfig, BrainCouncilConfig, BrainCouncilVoterConfig, BrainModelEntry, CircuitBreakerRuntimeConfig, ConcreteTokenSavingTier, Config, ConfigLoader, ConfigStore, ContextConfig, CouncilPersonaDefinition, CouncilToolConfig, CouncilToolProfileDefinition, CustomModelDefinition, ExecDangerConfig, ExecToolConfig, FeaturesConfig, FleetChatVerbosity, FleetConfig, FleetSupervisorConfig, GitBehaviorConfig, HqClientConfig, IndexingConfig, InputHistoryConfig, LaunchConfig, LaunchMenuChoice, LogConfig, LoopDetectionConfig, MCPHealthConfig, MCPHealthThresholds, MCPServerConfig, ModelMatrixEntry, ModelRuntimeCacheConfig, ModelRuntimeConfig, ModelRuntimeParametersConfig, ModelRuntimeReasoningConfig, NextStepsToolConfig, PluginConfig, PluginManagerConfig, ProviderApiKey, ProviderConfig, SageConfig, SessionLoggingConfig, SkillsConfig, SyncCategory, SyncConfig, ThemePresetId, TokenSavingTier, ToolDescriptionMode, ToolDescriptionModeConfig, ToolResultRenderMode, ToolResultRenderModeConfig, ToolsConfig } from './config.js';
18
18
  export type { AnyHookOutcome, ConfiguredHook, HookEntry, HookEvent, HookFailurePolicy, HookInput, HookInvocationContext, HookMatcher, HookOutcome, HookRegistrationOptions, HttpHook, InProcessHook, PreToolUseOutcome, PreToolUseStage, ShellHook } from './hooks.js';
19
19
  export type { Compactor, CompactReport } from './compactor.js';
20
20
  export type { DirectoryPolicy, DirectoryRule, PermissionDecision, PermissionPolicy, PermissionTrace, PermissionTraceStep, TrustPolicy } from './permission.js';
@@ -575,6 +575,25 @@ function normalizeTuiThinkingWord(value) {
575
575
  return word;
576
576
  }
577
577
 
578
+ // src/types/config/ui.ts
579
+ var THEME_PRESET_IDS = [
580
+ "catppuccin",
581
+ "tokyo-night",
582
+ "nord",
583
+ "cyberpunk",
584
+ "dracula",
585
+ "gruvbox-dark",
586
+ "solarized-dark",
587
+ "one-dark",
588
+ "monokai",
589
+ "rose-pine",
590
+ "kanagawa",
591
+ "ayu-dark",
592
+ "everforest",
593
+ "night-owl",
594
+ "synthwave"
595
+ ];
596
+
578
597
  // src/types/session-markers.ts
579
598
  var SESSION_MARKER_EVENT_TYPES = /* @__PURE__ */ new Set([
580
599
  "mode_changed",
@@ -1282,6 +1301,7 @@ export {
1282
1301
  SddError,
1283
1302
  SessionError,
1284
1303
  StreamHangError,
1304
+ THEME_PRESET_IDS,
1285
1305
  ToolError,
1286
1306
  ToolErrorCategory,
1287
1307
  ToolValidationError,
@@ -168,6 +168,13 @@ export interface SubagentConfig {
168
168
  * bodies through `SkillLoader`; missing optional skills are skipped safely.
169
169
  */
170
170
  skillNames?: string[] | undefined;
171
+ /**
172
+ * Every skill this role may draw on, before per-project ranking. The catalog
173
+ * sets this to the full curated set while `skillNames` holds the default
174
+ * eager slice; the spawn path ranks the pool by project skill-affinity so a
175
+ * skill the project actually developed can displace an unused sibling.
176
+ */
177
+ skillPool?: string[] | undefined;
171
178
  /** Optional smart-dispatch metadata for dynamically created project roles. */
172
179
  dispatch?: {
173
180
  summary: string;
@@ -31,6 +31,8 @@ export interface TaskEdge {
31
31
  export interface TaskGraph {
32
32
  id: string;
33
33
  specId: string;
34
+ /** Canonical spec scope. When present, execution must retain at least one task per id. */
35
+ requiredRequirementIds?: string[] | undefined;
34
36
  title: string;
35
37
  nodes: Map<string, TaskNode>;
36
38
  edges: TaskEdge[];
@@ -78,6 +78,8 @@ export interface ToolExecutorOptions {
78
78
  * to the result the model sees).
79
79
  */
80
80
  hookRunner?: import('../hooks/runner.js').HookRunner | undefined;
81
+ /** Hard-block product mutations outside a ready, running strict Kanban contract. */
82
+ requireKanbanGovernance?: boolean | undefined;
81
83
  /**
82
84
  * Per-tool on-screen result render mode map (`tools.resultRenderMode[name]`).
83
85
  * When set, the executor reads this map to decide whether the next
@@ -5444,6 +5444,9 @@ function subjectForToolInput(toolName, input, subjectKey) {
5444
5444
  const obj = input;
5445
5445
  if (subjectKey) {
5446
5446
  const value = obj[subjectKey];
5447
+ if (Array.isArray(value)) {
5448
+ return escapeGlobSubject(JSON.stringify(value));
5449
+ }
5447
5450
  if (typeof value === "string") {
5448
5451
  if (isPathSubjectKey(subjectKey)) {
5449
5452
  const normalized = normalizePathSubject(value);
@@ -30,12 +30,12 @@ The user is an experienced developer; accelerate them and stay focused.
30
30
  <!--ws:if tool=todo-->
31
31
  ## Todo status lifecycle
32
32
 
33
- Use a visible `todo` list for tasks with three or more steps. It is authoritative session/UI state; prose does not update it.
33
+ Use a visible `todo` list for tasks with three or more steps. With Kanban active it is a compact projection of real cards, not a second task store: retain each row's `kanbanBoardId` and `kanbanTaskId`. Prose does not update it.
34
34
 
35
35
  1. Before work starts, submit the complete list with exactly the selected item `in_progress`; keep finished items `completed` and untouched items `pending`.
36
36
  2. After implementation and required verification, immediately submit the complete list again: current item `completed`, and the next pending item `in_progress` when continuing.
37
37
  3. Before a final response, reconcile every status. Never leave finished work pending/running, never mark unverified work complete, and never repeat a continuation/next-step prompt instead of updating state.
38
- 4. Submit the final all-`completed` snapshot even though it auto-clears afterward. Session-todo mirror cards map `pending → Todo`, `in_progress → Running`, `completed → Done`.
38
+ 4. Submit the final all-`completed` snapshot even though it auto-clears afterward. With Kanban active, the projection maps `pending → Todo`, `in_progress → Running`, and verified `completed → Done`, then rebinds the next active task; failed acceptance leaves it open rather than inventing Done.
39
39
 
40
40
  If blocked, keep the item truthful and report the blocker instead of advancing it as successful.
41
41
  <!--ws:end-->
@@ -44,7 +44,11 @@ If verification fails twice for unclear reasons, stop and re-read the source ins
44
44
  <!--ws:if tool=kanban-->
45
45
  ## Work planning with Kanban
46
46
 
47
- This project has a Kanban board system for tracking multi-step work across turns and agents. When a task involves multiple files, review cycles, dependencies, or parallel work, **prefer Kanban cards over an ad-hoc todo list**.
47
+ **Every actionable work request MUST be represented by a Kanban card before the first project action**. This includes investigation, one-line edits, bugs, features, docs, tests, releases, and multi-agent work; pure conversation with no project action is the only exception. Resume the existing card for the same request. Other planning surfaces and chat may mirror the work but never replace the board.
48
+
49
+ If multiple boards are active or card identity is unclear, read the bounded Kanban `workbench` first. Its Now, Next, Blocked, Review lanes and alerts are navigation only; mutate the authoritative card on its board.
50
+
51
+ Use one fully detailed childless leaf card for genuinely atomic work. Use a parent and dependency-ordered child cards only for composite work; never invent recursive subtasks for process theatre. The required handshake is **Kanban first, project action second**. If persistence fails, report the blocker instead of silently doing untracked work.
48
52
 
49
53
  Before creating a card, identify these prerequisites as a minimum starting point (the full "MUST" specification is governed by the Kanban Agent hard conditions below):
50
54
  - **Description** — what needs to be done
@@ -52,17 +56,19 @@ Before creating a card, identify these prerequisites as a minimum starting point
52
56
  - **Risk level** — low / medium / high
53
57
  - **Audit needs** — what evidence to capture
54
58
 
55
- Decide **"I should use Kanban for this"** when structured tracking would help.
59
+ Scale the number of cards to the work, never the existence of tracking.
56
60
 
57
61
  ## Kanban Agent hard conditions
58
62
 
59
- These conditions are mandatory whenever a task belongs to a Kanban board. They are not suggestions and cannot be overridden for convenience:
63
+ These conditions apply to every actionable work request while Kanban is available. They are not suggestions and cannot be overridden for convenience:
60
64
 
61
65
  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.
62
- 2. **Fully specify every card before advancing it.** Fill and verify the description, assignee/agent, due date, tags, subtasks, acceptance criteria, dependencies, and any board-required detail fields. An under-filled card must remain in Backlog.
66
+ 2. **Fully specify every card before advancing it.** Fill and verify the description, assignee/agent, due date, labels, acceptance criteria, dependencies, and any board-required detail fields. Only composite parents (`atomic: true`) require persisted `childTaskIds`; executable leaf cards remain childless. An under-filled card must remain in Backlog.
63
67
  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.
64
68
  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.
65
69
  5. **Close and advance immediately.** Persist the accepted card in Running before work. Persist Running → Review when work finishes and Review → Done only after acceptance evidence passes. If continuing, move the next eligible card through adjacent transitions to Running before acting. Never leave completed work in Running or repeat a next-step prompt instead of updating the board.
70
+ 6. **Keep Contract Map off the critical path.** Use the card description and executable acceptance criteria for normal work. Do not create, inspect, configure, or repair graph nodes unless the user explicitly asks for graph work, and never enable strict mode yourself. No Contract Map mode may delay start, implementation, verification, or card completion; surface existing strict-map issues as operator audit signals without stopping work to repair them.
71
+ 7. **Never shrink tracked scope by omission.** Todo, task, and plan rows carry Kanban requirement identity. Preserve every unfinished row and binding in full-list updates, and complete it before removal; only an explicit operator-controlled cancellation or migration path may retire unresolved coverage.
66
72
 
67
73
  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.
68
74
  <!--ws:end-->
@@ -193,7 +199,7 @@ SAGE is the only long-term memory.
193
199
  <!--ws:end-->
194
200
 
195
201
  <!--ws:if tool=todo-->
196
- Use `todo` for the active checklist in the current session.
202
+ Use `todo` for the compact active-task view; with Kanban every row is a real board card.
197
203
  <!--ws:end-->
198
204
  <!--ws:if tool=plan-->
199
205
  Use `plan` for work that spans turns.
@@ -202,7 +208,7 @@ Use `plan` for work that spans turns.
202
208
  Use `task` for structured cross-session work.
203
209
  <!--ws:end-->
204
210
  <!--ws:if tool=kanban-->
205
- Use `kanban` only when the work belongs on a durable board.
211
+ Use `kanban` for every actionable project request; all such work belongs on the durable board.
206
212
  For managed Kanban cards, follow the board lifecycle exactly and persist truthful progress.
207
213
  <!--ws:end-->
208
214
  <!--ws:if tool=mail_inbox,mailbox-->
@@ -110,12 +110,12 @@ Reasoning depth is a dial, not a constant. Match it to the blast radius of what
110
110
  <!--ws:if tool=todo-->
111
111
  ## Todo status lifecycle
112
112
 
113
- The live `todo` list is authoritative session state shared by the active UI and session-owned Kanban mirror. Prose does not change status.
113
+ 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.
114
114
 
115
115
  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`.
116
116
  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.
117
117
  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.
118
- 4. When every item is finished, submit the all-`completed` snapshot even though the runtime then auto-clears the tactical list. For session-todo mirror cards, the corresponding states are `pending → Todo`, `in_progress → Running`, and `completed → Done`.
118
+ 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.
119
119
 
120
120
  If work is blocked, keep its status truthful, state the blocker, and do not silently advance as though it succeeded.
121
121
  <!--ws:end-->
@@ -123,7 +123,11 @@ 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 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.
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.
127
+
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
+
130
+ 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.
127
131
 
128
132
  Before creating a card, identify these prerequisites (rule #2 below provides the full mandatory specification; this list is the minimal starting point):
129
133
  - **Title** — what needs to be done, in one short sentence
@@ -136,13 +140,13 @@ Optional but recommended:
136
140
  - **Priority / risk level** — encode blast radius and reversibility via `priority` (low/medium/high/critical) and/or `labels`
137
141
  - **Evidence plan** — what artifacts must be produced (logs, screenshots, test output, diff); record in `notes` or `description`
138
142
 
139
- When you recognise 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.
143
+ The required handshake is **Kanban first, project action second**. Scale the number of cards to the work, never the existence of tracking.
140
144
 
141
145
  ---
142
146
 
143
147
  ## Kanban Agent hard conditions
144
148
 
145
- These conditions are mandatory whenever a task belongs to a Kanban board. They are not suggestions and cannot be overridden for convenience:
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:
146
150
 
147
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.
148
152
  2. **Fully specify every card before advancing it.** Fill and verify these fields before moving a card out of Backlog:
@@ -155,10 +159,12 @@ These conditions are mandatory whenever a task belongs to a Kanban board. They a
155
159
  - `successCriteria` — how completion is verified
156
160
  - `dependsOn` — prerequisite card IDs
157
161
 
158
- 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.
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.
159
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.
160
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.
161
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.
162
168
 
163
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.
164
170
 
@@ -170,10 +176,10 @@ If a managed transition is rejected, repair the card details or evidence and ret
170
176
 
171
177
  | Need | Tool | When |
172
178
  |---|---|---|
173
- | Session-level step tracking | `todo` | Single-session task with ≤5 steps, no cross-agent dependencies |
174
- | Strategic plan | `plan` | Multi-turn roadmap for a single agent |
175
- | Cross-session work items | `task` | Work that survives session boundaries but needs no board |
176
- | **Multi-agent / multi-step / review-gated work** | **`kanban`** | Dependencies, parallel agents, review gates, deferred verification |
179
+ | **Any actionable project work** | **`kanban`** | Mandatory durable execution record, from one atomic leaf to a multi-board programme |
180
+ | Compact active-task view | `todo` | UI projection of real Kanban task ids; never a second task store |
181
+ | Strategic explanation | `plan` | Optional roadmap linked to the board; execution remains in Kanban |
182
+ | Cross-session reference | `task` | Optional external reference; the executable work remains in Kanban |
177
183
 
178
184
  ### Card lifecycle in detail
179
185
 
@@ -348,7 +354,7 @@ I am composed of tool groups, each with a distinct purpose. The groups below are
348
354
  ### Planning & Tracking
349
355
  {{tools:todo,plan,task,kanban,kanban_queue}}
350
356
  <!--ws:if tool=todo-->
351
- - `todo` for session-level step tracking (cleared on restart).
357
+ - `todo` for the compact active-task view; with Kanban it projects durable card ids and rehydrates from the board.
352
358
  <!--ws:end-->
353
359
  <!--ws:if tool=plan-->
354
360
  - `plan` for strategic roadmap (persists across turns).
@@ -51,12 +51,12 @@ This parse is **internal reasoning**, not something you output. It keeps you anc
51
51
  <!--ws:if tool=todo-->
52
52
  ## Todo status lifecycle
53
53
 
54
- The live `todo` list is authoritative session state shared by the active UI and session-owned Kanban mirror. Prose does not change status.
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
55
 
56
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
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
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. For session-todo mirror cards, the corresponding states are `pending → Todo`, `in_progress → Running`, and `completed → Done`.
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
60
 
61
61
  If work is blocked, keep its status truthful, state the blocker, and do not silently advance as though it succeeded.
62
62
  <!--ws:end-->
@@ -64,7 +64,11 @@ 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 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.
68
72
 
69
73
  Before creating a card, identify these prerequisites (rule #2 below provides the full mandatory specification; this list is the minimal starting point):
70
74
  - **Title** — what needs to be done, in one short sentence
@@ -77,11 +81,11 @@ Optional but recommended:
77
81
  - **Priority / risk level** — encode blast radius and reversibility via `priority` (low/medium/high/critical) and/or `labels`
78
82
  - **Evidence plan** — what artifacts must be produced (logs, screenshots, test output, diff); record in `notes` or `description`
79
83
 
80
- 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.
81
85
 
82
86
  ## Kanban Agent hard conditions
83
87
 
84
- 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:
85
89
 
86
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.
87
91
  2. **Fully specify every card before advancing it.** Fill and verify these fields before moving a card out of Backlog:
@@ -94,10 +98,12 @@ These conditions are mandatory whenever a task belongs to a Kanban board. They a
94
98
  - `successCriteria` — how completion is verified
95
99
  - `dependsOn` — prerequisite card IDs
96
100
 
97
- 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.
98
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.
99
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.
100
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.
101
107
 
102
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.
103
109
 
@@ -107,10 +113,10 @@ If a managed transition is rejected, repair the card details or evidence and ret
107
113
 
108
114
  | Need | Tool | When |
109
115
  |---|---|---|
110
- | Session-level step tracking | `todo` | Single-session task with ≤5 steps, no cross-agent dependencies |
111
- | Strategic plan | `plan` | Multi-turn roadmap for a single agent |
112
- | Cross-session work items | `task` | Work that survives session boundaries but needs no board |
113
- | **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 |
114
120
 
115
121
  ### Card lifecycle in detail
116
122
 
@@ -277,7 +283,7 @@ I am composed of tool groups, each with a distinct purpose. The groups below are
277
283
  ### Planning & Tracking
278
284
  {{tools:todo,plan,task,kanban,kanban_queue}}
279
285
  <!--ws:if tool=todo-->
280
- - `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.
281
287
  <!--ws:end-->
282
288
  <!--ws:if tool=plan-->
283
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.2",
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": {
@@ -177,8 +177,8 @@
177
177
  "wrongstackApiVersion": "0.1.10",
178
178
  "dependencies": {
179
179
  "zod": "4.4.3",
180
- "@wrongstack/persistence": "0.302.2",
181
- "@wrongstack/kanban": "0.302.2"
180
+ "@wrongstack/kanban": "0.303.0",
181
+ "@wrongstack/persistence": "0.303.0"
182
182
  },
183
183
  "devDependencies": {
184
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