@exaudeus/workrail 3.25.0 → 3.26.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 (59) hide show
  1. package/dist/cli/commands/index.d.ts +5 -0
  2. package/dist/cli/commands/index.js +12 -1
  3. package/dist/cli/commands/worktrain-await.d.ts +35 -0
  4. package/dist/cli/commands/worktrain-await.js +207 -0
  5. package/dist/cli/commands/worktrain-inbox.d.ts +23 -0
  6. package/dist/cli/commands/worktrain-inbox.js +82 -0
  7. package/dist/cli/commands/worktrain-init.d.ts +23 -0
  8. package/dist/cli/commands/worktrain-init.js +338 -0
  9. package/dist/cli/commands/worktrain-spawn.d.ts +28 -0
  10. package/dist/cli/commands/worktrain-spawn.js +106 -0
  11. package/dist/cli/commands/worktrain-tell.d.ts +25 -0
  12. package/dist/cli/commands/worktrain-tell.js +32 -0
  13. package/dist/cli-worktrain.d.ts +2 -0
  14. package/dist/cli-worktrain.js +169 -0
  15. package/dist/cli.js +13 -3
  16. package/dist/config/config-file.d.ts +2 -0
  17. package/dist/config/config-file.js +55 -0
  18. package/dist/daemon/agent-loop.d.ts +90 -0
  19. package/dist/daemon/agent-loop.js +214 -0
  20. package/dist/daemon/pi-mono-loader.d.ts +0 -5
  21. package/dist/daemon/pi-mono-loader.js +0 -64
  22. package/dist/daemon/soul-template.d.ts +2 -0
  23. package/dist/daemon/soul-template.js +22 -0
  24. package/dist/daemon/workflow-runner.d.ts +24 -2
  25. package/dist/daemon/workflow-runner.js +244 -120
  26. package/dist/manifest.json +147 -51
  27. package/dist/mcp/output-schemas.d.ts +154 -154
  28. package/dist/mcp/transports/bridge-entry.js +20 -2
  29. package/dist/mcp/transports/bridge-events.d.ts +34 -0
  30. package/dist/mcp/transports/bridge-events.js +24 -0
  31. package/dist/mcp/transports/fatal-exit.d.ts +5 -0
  32. package/dist/mcp/transports/fatal-exit.js +82 -0
  33. package/dist/mcp/transports/http-entry.js +3 -0
  34. package/dist/mcp/transports/stdio-entry.js +3 -7
  35. package/dist/mcp/v2/tools.d.ts +7 -7
  36. package/dist/trigger/delivery-action.d.ts +37 -0
  37. package/dist/trigger/delivery-action.js +204 -0
  38. package/dist/trigger/delivery-client.d.ts +11 -0
  39. package/dist/trigger/delivery-client.js +27 -0
  40. package/dist/trigger/trigger-listener.d.ts +2 -0
  41. package/dist/trigger/trigger-listener.js +12 -2
  42. package/dist/trigger/trigger-router.d.ts +8 -2
  43. package/dist/trigger/trigger-router.js +164 -6
  44. package/dist/trigger/trigger-store.d.ts +11 -3
  45. package/dist/trigger/trigger-store.js +254 -13
  46. package/dist/trigger/types.d.ts +24 -0
  47. package/dist/trigger/types.js +4 -0
  48. package/dist/v2/durable-core/schemas/execution-snapshot/blocked-snapshot.d.ts +22 -22
  49. package/dist/v2/durable-core/schemas/execution-snapshot/execution-snapshot.v1.d.ts +114 -114
  50. package/dist/v2/durable-core/schemas/export-bundle/index.d.ts +454 -454
  51. package/dist/v2/durable-core/schemas/session/blockers.d.ts +14 -14
  52. package/dist/v2/durable-core/schemas/session/events.d.ts +93 -93
  53. package/dist/v2/durable-core/schemas/session/gaps.d.ts +2 -2
  54. package/dist/v2/durable-core/schemas/session/validation-event.d.ts +4 -4
  55. package/dist/v2/usecases/console-routes.js +33 -3
  56. package/package.json +6 -4
  57. package/spec/workflow-tags.json +1 -0
  58. package/workflows/classify-task-workflow.json +68 -0
  59. package/workflows/coding-task-workflow-agentic.lean.v2.json +43 -13
@@ -170,7 +170,7 @@ export declare const GapRecordedDataV1Schema: z.ZodObject<{
170
170
  resolvesGapId: string;
171
171
  };
172
172
  gapId: string;
173
- severity: "warning" | "info" | "critical";
173
+ severity: "info" | "warning" | "critical";
174
174
  evidenceRefs?: ({
175
175
  kind: "event";
176
176
  eventId: string;
@@ -200,7 +200,7 @@ export declare const GapRecordedDataV1Schema: z.ZodObject<{
200
200
  resolvesGapId: string;
201
201
  };
202
202
  gapId: string;
203
- severity: "warning" | "info" | "critical";
203
+ severity: "info" | "warning" | "critical";
204
204
  evidenceRefs?: ({
205
205
  kind: "event";
206
206
  eventId: string;
@@ -47,22 +47,22 @@ export declare const ValidationPerformedDataV1Schema: z.ZodObject<{
47
47
  }>;
48
48
  }, "strict", z.ZodTypeAny, {
49
49
  contractRef: string;
50
- attemptId: string;
51
- validationId: string;
52
50
  result: {
53
51
  issues: readonly string[];
54
52
  valid: boolean;
55
53
  suggestions: readonly string[];
56
54
  };
57
- }, {
58
- contractRef: string;
59
55
  attemptId: string;
60
56
  validationId: string;
57
+ }, {
58
+ contractRef: string;
61
59
  result: {
62
60
  issues: readonly string[];
63
61
  valid: boolean;
64
62
  suggestions: readonly string[];
65
63
  };
64
+ attemptId: string;
65
+ validationId: string;
66
66
  }>;
67
67
  export type ValidationPerformedDataV1 = z.infer<typeof ValidationPerformedDataV1Schema>;
68
68
  export type ValidationPerformedResultV1 = z.infer<typeof ValidationPerformedResultV1Schema>;
@@ -44,6 +44,8 @@ const worktree_service_js_1 = require("./worktree-service.js");
44
44
  const workflow_js_1 = require("../../types/workflow.js");
45
45
  const dev_mode_js_1 = require("../../mcp/dev-mode.js");
46
46
  const workflow_runner_js_1 = require("../../daemon/workflow-runner.js");
47
+ const start_js_1 = require("../../mcp/handlers/v2-execution/start.js");
48
+ const v2_token_ops_js_1 = require("../../mcp/handlers/v2-token-ops.js");
47
49
  function watchSessionsDir(sessionsDir, onChanged) {
48
50
  try {
49
51
  fs_1.default.mkdirSync(sessionsDir, { recursive: true });
@@ -384,20 +386,48 @@ function mountConsoleRoutes(app, consoleService, workflowService, timingRingBuff
384
386
  res.status(503).json({ success: false, error: 'No LLM credentials available. Set ANTHROPIC_API_KEY or AWS_PROFILE.' });
385
387
  return;
386
388
  }
389
+ const startResult = await (0, start_js_1.executeStartWorkflow)({ workflowId, workspacePath, goal }, v2ToolContext, { is_autonomous: 'true' });
390
+ if (startResult.isErr()) {
391
+ const errDetail = `${startResult.error.kind}${'message' in startResult.error ? `: ${startResult.error.message}` : ''}`;
392
+ res.status(400).json({ success: false, error: `Session creation failed: ${errDetail}` });
393
+ return;
394
+ }
395
+ const startResponse = startResult.value.response;
396
+ const startContinueToken = startResponse.continueToken;
397
+ let sessionHandle;
398
+ if (startContinueToken) {
399
+ const tokenResult = await (0, v2_token_ops_js_1.parseContinueTokenOrFail)(startContinueToken, v2ToolContext.v2.tokenCodecPorts, v2ToolContext.v2.tokenAliasStore);
400
+ if (tokenResult.isErr()) {
401
+ console.error(`[ConsoleRoutes] Failed to decode session handle from continueToken: ${tokenResult.error.message}`);
402
+ res.status(500).json({ success: false, error: 'Internal error: could not extract session handle.' });
403
+ return;
404
+ }
405
+ sessionHandle = tokenResult.value.sessionId;
406
+ }
407
+ else {
408
+ sessionHandle = workflowId;
409
+ }
410
+ const trigger = { workflowId, goal, workspacePath, context, _preAllocatedStartResponse: startResponse };
387
411
  if (triggerRouter) {
388
- triggerRouter.dispatch({ workflowId, goal, workspacePath, context });
412
+ triggerRouter.dispatch(trigger);
389
413
  }
390
414
  else {
391
- void (0, workflow_runner_js_1.runWorkflow)({ workflowId, goal, workspacePath, context }, v2ToolContext, apiKey ?? '').then((result) => {
415
+ void (0, workflow_runner_js_1.runWorkflow)(trigger, v2ToolContext, apiKey ?? '').then((result) => {
392
416
  if (result._tag === 'success') {
393
417
  console.log(`[ConsoleRoutes] Auto dispatch completed: workflowId=${workflowId} stopReason=${result.stopReason}`);
394
418
  }
419
+ else if (result._tag === 'timeout') {
420
+ console.log(`[ConsoleRoutes] Auto dispatch timed out: workflowId=${workflowId}`);
421
+ }
422
+ else if (result._tag === 'delivery_failed') {
423
+ console.log(`[ConsoleRoutes] Auto dispatch delivery failed: workflowId=${workflowId}`);
424
+ }
395
425
  else {
396
426
  console.log(`[ConsoleRoutes] Auto dispatch failed: workflowId=${workflowId} error=${result.message}`);
397
427
  }
398
428
  });
399
429
  }
400
- res.json({ success: true, data: { status: 'dispatched', workflowId } });
430
+ res.json({ success: true, data: { status: 'dispatched', workflowId, sessionHandle } });
401
431
  });
402
432
  app.get('/api/v2/triggers', (_req, res) => {
403
433
  if (!triggerRouter) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exaudeus/workrail",
3
- "version": "3.25.0",
3
+ "version": "3.26.1",
4
4
  "description": "Step-by-step workflow enforcement for AI agents via MCP",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -12,7 +12,8 @@
12
12
  },
13
13
  "homepage": "https://github.com/EtienneBBeaulac/workrail#readme",
14
14
  "bin": {
15
- "workrail": "dist/mcp-server.js"
15
+ "workrail": "dist/mcp-server.js",
16
+ "worktrain": "dist/cli-worktrain.js"
16
17
  },
17
18
  "exports": {
18
19
  ".": "./dist/mcp-server.js",
@@ -84,8 +85,8 @@
84
85
  "prepare": "bash scripts/setup-hooks.sh"
85
86
  },
86
87
  "dependencies": {
87
- "@mariozechner/pi-agent-core": "0.67.2",
88
- "@mariozechner/pi-ai": "0.67.2",
88
+ "@anthropic-ai/bedrock-sdk": "^0.28.1",
89
+ "@anthropic-ai/sdk": "^0.73.0",
89
90
  "@modelcontextprotocol/sdk": "^1.24.0",
90
91
  "@scure/base": "1.1.9",
91
92
  "ajv": "^8.17.1",
@@ -112,6 +113,7 @@
112
113
  "task-management"
113
114
  ],
114
115
  "devDependencies": {
116
+ "@duckdb/node-api": "^1.5.2-r.1",
115
117
  "@playwright/test": "^1.55.1",
116
118
  "@semantic-release/changelog": "^6.0.3",
117
119
  "@semantic-release/exec": "^7.1.0",
@@ -125,6 +125,7 @@
125
125
  "workflow-diagnose-environment": { "tags": ["investigation"] },
126
126
  "workflow-for-workflows": { "tags": ["authoring"] },
127
127
  "wr.discovery": { "tags": ["design", "investigation"] },
128
+ "classify-task-workflow": { "tags": ["routines", "coding"] },
128
129
  "test-artifact-loop-control": { "tags": ["coding"], "hidden": true },
129
130
  "test-session-persistence": { "tags": ["coding"], "hidden": true },
130
131
  "test-missing-context": { "tags": ["coding"], "hidden": true }
@@ -0,0 +1,68 @@
1
+ {
2
+ "id": "classify-task-workflow",
3
+ "name": "Classify Task",
4
+ "version": "0.1.0",
5
+ "description": "Classifies a software task from the session goal into structured output variables used by coordinator scripts to decide which pipeline phases to run.",
6
+ "about": "## Classify Task Workflow\n\nThis is a fast, single-step classification utility. It reads the session goal and outputs structured variables that coordinator scripts use to decide which pipeline phases to run.\n\n### What it does\n\nGiven a task description, the agent classifies the work along seven dimensions and recommends an ordered pipeline of workflow IDs to execute.\n\n### When to use it\n\nUse this workflow at the start of a coordinator pipeline when you need to decide which downstream workflows to run. It is intentionally fast and cheap -- one LLM step, no subagents, no codebase reads.\n\n### What it produces\n\nA structured classification block in the step notes containing all seven output variables:\n- `taskComplexity` -- Small / Medium / Large\n- `riskLevel` -- Low / Medium / High\n- `hasUI` -- true / false\n- `touchesArchitecture` -- true / false\n- `taskType` -- feature / bug-fix / refactor / investigation / docs / chore\n- `affectedDomains` -- array of likely codebase areas\n- `recommendedPipeline` -- ordered array of workflow IDs\n\n### How to get good results\n\nProvide a specific, concrete task description as the session goal. The more specific the goal, the more accurate the classification. When the goal is ambiguous, the workflow defaults to conservative (higher complexity, more pipeline phases).",
7
+ "examples": [
8
+ "Classify: add real-time presence indicators to the messaging inbox UI",
9
+ "Classify: fix the race condition in the cache invalidation path",
10
+ "Classify: refactor the payment module to use Result types instead of exceptions",
11
+ "Classify: investigate why the build server fails on the integration test suite",
12
+ "Classify: update the onboarding docs to reflect the new CLI commands"
13
+ ],
14
+ "validatedAgainstSpecVersion": 3,
15
+ "recommendedPreferences": {
16
+ "recommendedAutonomy": "full_auto_never_stop",
17
+ "recommendedRiskPolicy": "aggressive"
18
+ },
19
+ "metaGuidance": [
20
+ "CONSERVATIVE DEFAULT: when in doubt, classify up -- higher complexity, more pipeline phases. It is safer to recommend an extra phase than to skip a critical one.",
21
+ "STRUCTURED OUTPUT REQUIRED: output must be a labeled structured block. Free-form prose does not satisfy this workflow's contract.",
22
+ "NO TOOLS NEEDED: classify from the goal text alone. Do not read files, run commands, or gather context. This workflow is intentionally cheap.",
23
+ "NO SUBAGENTS: do not delegate. The classification is a single reasoning pass by the main agent.",
24
+ "PIPELINE SELECTION LOGIC: use the provided decision rules in the step procedure. Do not invent new pipeline logic."
25
+ ],
26
+ "steps": [
27
+ {
28
+ "id": "classify-task",
29
+ "title": "Classify Task",
30
+ "promptBlocks": {
31
+ "goal": "Read the session goal and classify the software task into all seven required output variables. Produce a structured classification block that a coordinator script can parse reliably.",
32
+ "constraints": [
33
+ "Classify from goal text only. Do not read files, search the codebase, or gather context.",
34
+ "When any dimension is ambiguous, default to the more conservative value (higher complexity, higher risk, more pipeline phases).",
35
+ "All seven output variables are required. An empty or missing variable is a failure.",
36
+ "Output the classification block in the exact format shown in the procedure. Use the exact key names.",
37
+ "Output `affectedDomains` and `recommendedPipeline` as single-line JSON arrays -- no line breaks within the array value."
38
+ ],
39
+ "procedure": [
40
+ "1. Read the session goal carefully.",
41
+ "2. Classify each dimension using these rules:\n\n **taskComplexity** (Small / Medium / Large)\n - Small: isolated change, one component, clear path, low ambiguity (e.g. fix a typo, rename a symbol, update a config value)\n - Medium: touches 2-4 components, moderate scope, some design decisions needed\n - Large: cross-cutting change, architectural impact, high ambiguity, or significant new behavior\n - Default: Medium when unsure\n\n **riskLevel** (Low / Medium / High)\n - Low: no user-visible behavior change, reversible, isolated\n - Medium: user-visible change, moderate blast radius, or touches shared infrastructure\n - High: data migration, payment/auth paths, production-critical infrastructure, irreversible changes\n - Default: Medium when unsure\n\n **hasUI** (true / false)\n - true: task mentions UI, frontend, visual, screen, component, design, UX, CSS, layout, accessibility, animation, or any user-facing interface\n - false: otherwise\n - Default: false when unsure\n\n **touchesArchitecture** (true / false)\n - true: task introduces new abstractions, changes system boundaries, affects how components interact, changes APIs, or modifies data models in a non-trivial way\n - false: otherwise (e.g. bug fix in existing logic, docs update, minor refactor within a component)\n - Default: false when unsure\n - Rule: Large tasks always set `touchesArchitecture: true` -- large scope changes affect system structure by definition\n\n **taskType** (feature / bug-fix / refactor / investigation / docs / chore)\n - feature: new user-visible functionality\n - bug-fix: fixing incorrect behavior\n - refactor: restructuring existing code without changing observable behavior\n - investigation: diagnosing or understanding a problem without implementing a fix\n - docs: documentation changes only\n - chore: tooling, CI, deps, build, internal cleanup with no user impact\n - Default: feature when unsure\n\n **affectedDomains** (array)\n - Scan the goal text for known domain keywords and infer likely areas. Use these domain labels: daemon, trigger, console, mcp, schema, engine, workflows, docs, infra, api, auth, payments, mobile, web\n - Include a domain if the goal text strongly implies it, even if not named explicitly\n - Use an empty array only if no domains can be reasonably inferred\n\n **recommendedPipeline** (array of workflow IDs, in execution order)\n Apply these selection rules in order:\n - If taskType = 'bug-fix': prepend 'bug-investigation.agentic.v2'\n - If taskComplexity is Medium or Large: include 'wr.discovery'\n - If hasUI = true: include 'ui-ux-design-workflow'\n - If touchesArchitecture = true OR riskLevel = High: include 'architecture-scalability-audit'\n - If taskType is NOT 'investigation' AND taskType is NOT 'docs': include 'coding-task-workflow-agentic' -- note: chore is included here because chores can require code changes and benefit from review\n - If 'coding-task-workflow-agentic' is included: include 'mr-review-workflow.agentic.v2' after it\n - If riskLevel = High: append 'production-readiness-audit' at the end\n - Order: [bug-investigation?, wr.discovery?, ui-ux-design-workflow?, architecture-scalability-audit?, coding-task-workflow-agentic?, mr-review-workflow.agentic.v2?, production-readiness-audit?]",
42
+ "3. Output the classification block using this exact format:\n\n```\n## Task Classification\n\ntaskComplexity: <Small|Medium|Large>\nriskLevel: <Low|Medium|High>\nhasUI: <true|false>\ntouchesArchitecture: <true|false>\ntaskType: <feature|bug-fix|refactor|investigation|docs|chore>\naffectedDomains: [\"<domain1>\", \"<domain2>\"]\nrecommendedPipeline: [\"<workflow-id-1>\", \"<workflow-id-2>\"]\n```\n\nAfter the block, add 2-4 sentences of reasoning: why you chose the key values, and what made anything uncertain."
43
+ ],
44
+ "outputRequired": {
45
+ "taskComplexity": "One of: Small / Medium / Large",
46
+ "riskLevel": "One of: Low / Medium / High",
47
+ "hasUI": "true or false -- does this task touch any UI, frontend, or visual layer?",
48
+ "touchesArchitecture": "true or false -- does this introduce new abstractions, change system boundaries, or affect how components interact?",
49
+ "taskType": "One of: feature / bug-fix / refactor / investigation / docs / chore",
50
+ "affectedDomains": "Array of likely codebase areas (e.g. [\"daemon\", \"console\"]). Use [] only if none can be inferred.",
51
+ "recommendedPipeline": "Ordered array of workflow IDs selected using the pipeline selection rules in the procedure."
52
+ },
53
+ "verify": [
54
+ "All seven output variables are present in the classification block.",
55
+ "Each variable uses the exact key name specified (taskComplexity, riskLevel, hasUI, touchesArchitecture, taskType, affectedDomains, recommendedPipeline).",
56
+ "recommendedPipeline contains only valid workflow IDs from the available library.",
57
+ "If taskType is feature, bug-fix, or refactor, recommendedPipeline includes coding-task-workflow-agentic.",
58
+ "If riskLevel is High, production-readiness-audit is the last item in recommendedPipeline.",
59
+ "If `hasUI` is true, `recommendedPipeline` includes `ui-ux-design-workflow`.",
60
+ "If `touchesArchitecture` is true OR `riskLevel` is High, `recommendedPipeline` includes `architecture-scalability-audit`.",
61
+ "If `taskType` is `bug-fix`, `bug-investigation.agentic.v2` is the first item in `recommendedPipeline`.",
62
+ "If `coding-task-workflow-agentic` is present in `recommendedPipeline`, `mr-review-workflow.agentic.v2` immediately follows it.",
63
+ "If `taskComplexity` is `Large`, `touchesArchitecture` must be `true`."
64
+ ]
65
+ }
66
+ }
67
+ ]
68
+ }
@@ -22,7 +22,10 @@
22
22
  {
23
23
  "id": "design_soundness",
24
24
  "purpose": "Design decision is made, tradeoffs are recorded, and there is no remaining ambiguity about the chosen approach.",
25
- "levels": ["low", "high"]
25
+ "levels": [
26
+ "low",
27
+ "high"
28
+ ]
26
29
  }
27
30
  ]
28
31
  },
@@ -33,7 +36,10 @@
33
36
  {
34
37
  "id": "design_gaps",
35
38
  "purpose": "Active scan completed: either no material gaps were found, or any found were addressed or explicitly filed.",
36
- "levels": ["low", "high"]
39
+ "levels": [
40
+ "low",
41
+ "high"
42
+ ]
37
43
  }
38
44
  ]
39
45
  },
@@ -44,7 +50,10 @@
44
50
  {
45
51
  "id": "plan_completeness",
46
52
  "purpose": "Slices have clear boundaries and acceptance criteria. The agent knows what done looks like for each.",
47
- "levels": ["low", "high"]
53
+ "levels": [
54
+ "low",
55
+ "high"
56
+ ]
48
57
  }
49
58
  ]
50
59
  },
@@ -55,7 +64,10 @@
55
64
  {
56
65
  "id": "invariant_clarity",
57
66
  "purpose": "Named invariants are checkable in the implementation. Non-goals are stated and will prevent scope creep.",
58
- "levels": ["low", "high"]
67
+ "levels": [
68
+ "low",
69
+ "high"
70
+ ]
59
71
  }
60
72
  ]
61
73
  },
@@ -66,7 +78,10 @@
66
78
  {
67
79
  "id": "plan_gaps",
68
80
  "purpose": "Active scan completed: either no material gaps were found, or any found were addressed or explicitly filed.",
69
- "levels": ["low", "high"]
81
+ "levels": [
82
+ "low",
83
+ "high"
84
+ ]
70
85
  }
71
86
  ]
72
87
  },
@@ -77,7 +92,10 @@
77
92
  {
78
93
  "id": "build_correctness",
79
94
  "purpose": "Build succeeds and tests pass. No compilation errors or failing assertions.",
80
- "levels": ["low", "high"]
95
+ "levels": [
96
+ "low",
97
+ "high"
98
+ ]
81
99
  }
82
100
  ]
83
101
  },
@@ -88,7 +106,10 @@
88
106
  {
89
107
  "id": "invariant_preservation",
90
108
  "purpose": "Each named invariant from the plan has been verified in the implementation.",
91
- "levels": ["low", "high"]
109
+ "levels": [
110
+ "low",
111
+ "high"
112
+ ]
92
113
  }
93
114
  ]
94
115
  },
@@ -99,7 +120,10 @@
99
120
  {
100
121
  "id": "implementation_gaps",
101
122
  "purpose": "Active scan completed: gaps found are either fixed inline, filed as follow-up tickets, or explicitly deferred with rationale.",
102
- "levels": ["low", "high"]
123
+ "levels": [
124
+ "low",
125
+ "high"
126
+ ]
103
127
  }
104
128
  ]
105
129
  }
@@ -260,7 +284,9 @@
260
284
  ],
261
285
  "assessmentConsequences": [
262
286
  {
263
- "when": { "anyEqualsLevel": "low" },
287
+ "when": {
288
+ "anyEqualsLevel": "low"
289
+ },
264
290
  "effect": {
265
291
  "kind": "require_followup",
266
292
  "guidance": "Address whichever gate scored low: design_soundness low -- the design decision is still ambiguous; commit to an approach and record the rationale before proceeding. design_gaps low -- the gap scan was not completed or found unaddressed gaps; either resolve them or explicitly file them before proceeding."
@@ -361,7 +387,9 @@
361
387
  ],
362
388
  "assessmentConsequences": [
363
389
  {
364
- "when": { "anyEqualsLevel": "low" },
390
+ "when": {
391
+ "anyEqualsLevel": "low"
392
+ },
365
393
  "effect": {
366
394
  "kind": "require_followup",
367
395
  "guidance": "Address whichever gate scored low: plan_completeness low -- one or more slices lack clear boundaries or verifiable acceptance criteria; sharpen them before implementation begins. invariant_clarity low -- invariants or non-goals are too vague to verify against; make them concrete. plan_gaps low -- the gap scan was not completed or found unaddressed gaps; resolve or file them before proceeding."
@@ -472,7 +500,7 @@
472
500
  "var": "taskComplexity",
473
501
  "equals": "Small"
474
502
  },
475
- "prompt": "For Small tasks, fast does not mean shallow. Every item below is required.\n\n**1. Confirm all wiring points with tools.**\nDon't assume a file you create is reachable. Check every public entry point:\n- Does the new symbol need to be exported from an index file?\n- Does it need to be imported and registered somewhere (CLI command map, router, DI container, plugin registry)?\n- Is there a test file that needs to reference it?\nTrace the full call path from the public interface down to your new code before writing anything.\n\n**2. Implement the smallest correct change.**\nChange exactly what needs changing. No drive-by refactors, no extra abstractions.\n\n**3. Verify end-to-end.**\n- Run build and tests. Both must pass.\n- Manually trace the new behavior through the public entry point (e.g. run the CLI command, check the export resolves, hit the endpoint). If you can't do this deterministically with tools, say why.\n- Apply the user's coding philosophy as the review lens. Flag any violation by principle name.\n\n**4. Produce a handoff note.**\nOutput a notes artifact containing:\n- `commitType`: feat / fix / chore / refactor / docs / test / perf (pick one)\n- `commitScope`: product area only (console / mcp / workflows / engine / schema / docs)\n- `commitSubject`: imperative mood, max 72 chars total with type(scope): prefix, no period\n- `prTitle`: same as full commit first line\n- `prBody`: markdown with ## Summary (bullets) and ## Test plan (checklist)\n- `followUpTickets`: list of deferred items, or empty\n- `filesChanged`: list of every file you created or modified\n\nThe daemon will use this artifact to run git commit and open the PR. Do not commit or push yourself.\n\nDo not create heavyweight planning artifacts unless risk unexpectedly grows.",
503
+ "prompt": "For Small tasks, fast does not mean shallow. Every item below is required.\n\n**1. Confirm all wiring points with tools.**\nDon't assume a file you create is reachable. Check every public entry point:\n- Does the new symbol need to be exported from an index file?\n- Does it need to be imported and registered somewhere (CLI command map, router, DI container, plugin registry)?\n- Is there a test file that needs to reference it?\nTrace the full call path from the public interface down to your new code before writing anything.\n\n**2. Implement the smallest correct change.**\nChange exactly what needs changing. No drive-by refactors, no extra abstractions.\n\n**3. Verify end-to-end.**\n- Run build and tests. Both must pass.\n- Manually trace the new behavior through the public entry point (e.g. run the CLI command, check the export resolves, hit the endpoint). If you can't do this deterministically with tools, say why.\n- Apply the user's coding philosophy as the review lens. Flag any violation by principle name.\n\n**4. Produce a handoff note.**\nOutput a notes artifact containing a JSON fenced block with the following fields.\nThe daemon reads this block to run `git commit` and `gh pr create` -- write it exactly as shown:\n\n```json\n{\n \"commitType\": \"feat\",\n \"commitScope\": \"mcp\",\n \"commitSubject\": \"imperative mood, max 72 chars total with type(scope): prefix, no period\",\n \"prTitle\": \"same as full commit first line\",\n \"prBody\": \"markdown with ## Summary (bullets) and ## Test plan (checklist)\",\n \"followUpTickets\": [],\n \"filesChanged\": [\"src/path/to/file.ts\", \"tests/unit/file.test.ts\"]\n}\n```\n\nFields:\n- `commitType`: feat / fix / chore / refactor / docs / test / perf (pick one)\n- `commitScope`: product area only (console / mcp / workflows / engine / schema / docs)\n- `commitSubject`: imperative mood, max 72 chars total with type(scope): prefix, no period\n- `prTitle`: same as full commit first line\n- `prBody`: markdown with ## Summary (bullets) and ## Test plan (checklist)\n- `followUpTickets`: list of deferred items, or empty array\n- `filesChanged`: list of every file you created or modified (required -- do not omit)\n\nThe daemon will use this artifact to run git commit and open the PR. Do not commit or push yourself.\n\nDo not create heavyweight planning artifacts unless risk unexpectedly grows.",
476
504
  "requireConfirmation": false
477
505
  },
478
506
  {
@@ -594,7 +622,9 @@
594
622
  ],
595
623
  "assessmentConsequences": [
596
624
  {
597
- "when": { "anyEqualsLevel": "low" },
625
+ "when": {
626
+ "anyEqualsLevel": "low"
627
+ },
598
628
  "effect": {
599
629
  "kind": "require_followup",
600
630
  "guidance": "Address whichever gate scored low: build_correctness low -- the build or tests are still failing; fix them before this step can complete. invariant_preservation low -- one or more invariants from the plan are violated; fix the implementation. implementation_gaps low -- the gap scan was not completed or found unaddressed gaps; fix them inline, file as follow-up tickets, or explicitly defer with rationale."
@@ -606,7 +636,7 @@
606
636
  {
607
637
  "id": "phase-7c-loop-decision",
608
638
  "title": "Final Verification Loop Decision",
609
- "prompt": "Decide whether final verification needs another pass or whether we're done.\n\nThis loop gets up to two verify/fix passes.\n- If verification found real issues and you fixed them, keep going so the fixes get re-verified.\n- If the issues are clean or resolved, stop.\n- If you've hit the limit, stop and record what remains.\n\nWhen you stop, include:\n- acceptance criteria status\n- invariant status\n- test/build summary\n- a concise PR/MR draft (why, test plan, rollout notes)\n- follow-up tickets\n- any philosophy tensions you accepted on purpose\n\nThen emit the required loop-control artifact in this shape (`decision` must be `continue` or `stop`):\n```json\n{\n \"artifacts\": [{\n \"kind\": \"wr.loop_control\",\n \"decision\": \"continue\"\n }]\n}\n```",
639
+ "prompt": "Decide whether final verification needs another pass or whether we're done.\n\nThis loop gets up to two verify/fix passes.\n- If verification found real issues and you fixed them, keep going so the fixes get re-verified.\n- If the issues are clean or resolved, stop.\n- If you've hit the limit, stop and record what remains.\n\nWhen you stop, include:\n- acceptance criteria status\n- invariant status\n- test/build summary\n- follow-up tickets\n- any philosophy tensions you accepted on purpose\n\n**Handoff block (required for daemon auto-commit):**\nInclude a JSON fenced block in your notes. The daemon reads this to run `git commit` and `gh pr create`:\n\n```json\n{\n \"commitType\": \"feat\",\n \"commitScope\": \"mcp\",\n \"commitSubject\": \"imperative mood, max 72 chars total with type(scope): prefix, no period\",\n \"prTitle\": \"same as full commit first line\",\n \"prBody\": \"markdown with ## Summary (bullets) and ## Test plan (checklist)\",\n \"followUpTickets\": [],\n \"filesChanged\": [\"src/path/to/file.ts\", \"tests/unit/file.test.ts\"]\n}\n```\n\nFields: `commitType` (feat/fix/chore/refactor/docs/test/perf), `commitScope` (product area only: console/mcp/workflows/engine/schema/docs), `commitSubject` (imperative, <=72 chars including prefix, no period), `prTitle` (same as commit first line), `prBody` (markdown), `followUpTickets` (array), `filesChanged` (required -- every file created or modified).\n\nThen emit the required loop-control artifact in this shape (`decision` must be `continue` or `stop`):\n```json\n{\n \"artifacts\": [{\n \"kind\": \"wr.loop_control\",\n \"decision\": \"continue\"\n }]\n}\n```",
610
640
  "requireConfirmation": true,
611
641
  "outputContract": {
612
642
  "contractRef": "wr.contracts.loop_control"