@exaudeus/workrail 1.1.0 → 1.3.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.
- package/dist/application/services/validation-engine.d.ts +15 -1
- package/dist/application/services/validation-engine.js +81 -51
- package/dist/application/services/workflow-compiler.d.ts +3 -0
- package/dist/application/services/workflow-compiler.js +26 -0
- package/dist/application/services/workflow-interpreter.d.ts +4 -1
- package/dist/application/services/workflow-interpreter.js +85 -24
- package/dist/application/services/workflow-service.js +19 -2
- package/dist/manifest.json +299 -83
- package/dist/mcp/handlers/shared/with-timeout.d.ts +1 -0
- package/dist/mcp/handlers/shared/with-timeout.js +9 -0
- package/dist/mcp/handlers/v2-advance-core.d.ts +45 -0
- package/dist/mcp/handlers/v2-advance-core.js +433 -0
- package/dist/mcp/handlers/v2-context-budget.d.ts +17 -0
- package/dist/mcp/handlers/v2-context-budget.js +169 -0
- package/dist/mcp/handlers/v2-error-mapping.d.ts +34 -0
- package/dist/mcp/handlers/v2-error-mapping.js +125 -0
- package/dist/mcp/handlers/v2-execution-helpers.js +4 -1
- package/dist/mcp/handlers/v2-execution.d.ts +19 -0
- package/dist/mcp/handlers/v2-execution.js +278 -765
- package/dist/mcp/handlers/v2-state-conversion.d.ts +40 -0
- package/dist/mcp/handlers/v2-state-conversion.js +132 -0
- package/dist/mcp/handlers/v2-token-ops.d.ts +33 -0
- package/dist/mcp/handlers/v2-token-ops.js +62 -0
- package/dist/mcp/handlers/v2-workflow.js +3 -8
- package/dist/mcp/handlers/workflow.js +4 -11
- package/dist/mcp/output-schemas.d.ts +272 -20
- package/dist/mcp/output-schemas.js +20 -1
- package/dist/mcp/server.js +2 -0
- package/dist/mcp/tool-descriptions.js +67 -51
- package/dist/mcp/types.d.ts +2 -0
- package/dist/mcp/v2/tools.d.ts +23 -2
- package/dist/mcp/v2/tools.js +35 -4
- package/dist/types/workflow-definition.d.ts +19 -0
- package/dist/v2/durable-core/constants.d.ts +2 -0
- package/dist/v2/durable-core/constants.js +3 -1
- package/dist/v2/durable-core/domain/ack-advance-append-plan.d.ts +1 -0
- package/dist/v2/durable-core/domain/ack-advance-append-plan.js +11 -1
- package/dist/v2/durable-core/domain/artifact-contract-validator.d.ts +31 -0
- package/dist/v2/durable-core/domain/artifact-contract-validator.js +98 -0
- package/dist/v2/durable-core/domain/blocked-node-builder.d.ts +20 -0
- package/dist/v2/durable-core/domain/blocked-node-builder.js +94 -0
- package/dist/v2/durable-core/domain/bundle-builder.d.ts +27 -0
- package/dist/v2/durable-core/domain/bundle-builder.js +93 -0
- package/dist/v2/durable-core/domain/bundle-validator.d.ts +4 -0
- package/dist/v2/durable-core/domain/bundle-validator.js +129 -0
- package/dist/v2/durable-core/domain/decision-trace-builder.d.ts +33 -0
- package/dist/v2/durable-core/domain/decision-trace-builder.js +92 -0
- package/dist/v2/durable-core/domain/function-definition-expander.js +1 -1
- package/dist/v2/durable-core/domain/loop-control-evaluator.d.ts +13 -0
- package/dist/v2/durable-core/domain/loop-control-evaluator.js +24 -0
- package/dist/v2/durable-core/domain/observation-builder.d.ts +16 -0
- package/dist/v2/durable-core/domain/observation-builder.js +42 -0
- package/dist/v2/durable-core/domain/outputs.js +2 -2
- package/dist/v2/durable-core/domain/prompt-renderer.js +37 -4
- package/dist/v2/durable-core/domain/reason-model.d.ts +3 -1
- package/dist/v2/durable-core/domain/reason-model.js +16 -3
- package/dist/v2/durable-core/domain/recommendation-warnings.d.ts +20 -0
- package/dist/v2/durable-core/domain/recommendation-warnings.js +35 -0
- package/dist/v2/durable-core/domain/risk-policy-guardrails.d.ts +15 -0
- package/dist/v2/durable-core/domain/risk-policy-guardrails.js +78 -0
- package/dist/v2/durable-core/domain/validation-criteria-validator.d.ts +8 -0
- package/dist/v2/durable-core/domain/validation-criteria-validator.js +30 -0
- package/dist/v2/durable-core/domain/validation-event-builder.d.ts +26 -0
- package/dist/v2/durable-core/domain/validation-event-builder.js +100 -0
- package/dist/v2/durable-core/domain/validation-loader.d.ts +11 -0
- package/dist/v2/durable-core/domain/validation-loader.js +21 -0
- package/dist/v2/durable-core/projections/snapshot-state.js +1 -1
- package/dist/v2/durable-core/schemas/artifacts/index.d.ts +4 -0
- package/dist/v2/durable-core/schemas/artifacts/index.js +18 -0
- package/dist/v2/durable-core/schemas/artifacts/loop-control.d.ts +66 -0
- package/dist/v2/durable-core/schemas/artifacts/loop-control.js +47 -0
- package/dist/v2/durable-core/schemas/execution-snapshot/blocked-snapshot.d.ts +598 -0
- package/dist/v2/durable-core/schemas/execution-snapshot/blocked-snapshot.js +89 -0
- package/dist/v2/durable-core/schemas/execution-snapshot/execution-snapshot.v1.d.ts +3801 -57
- package/dist/v2/durable-core/schemas/execution-snapshot/execution-snapshot.v1.js +12 -2
- package/dist/v2/durable-core/schemas/execution-snapshot/index.d.ts +2 -0
- package/dist/v2/durable-core/schemas/execution-snapshot/index.js +3 -1
- package/dist/v2/durable-core/schemas/export-bundle/index.d.ts +4682 -758
- package/dist/v2/durable-core/schemas/session/events.d.ts +158 -45
- package/dist/v2/durable-core/schemas/session/events.js +8 -1
- package/dist/v2/durable-core/schemas/session/validation-event.d.ts +68 -0
- package/dist/v2/durable-core/schemas/session/validation-event.js +52 -0
- package/dist/v2/durable-core/tokens/payloads.d.ts +16 -16
- package/dist/v2/infra/local/workspace-anchor/index.d.ts +9 -0
- package/dist/v2/infra/local/workspace-anchor/index.js +44 -0
- package/dist/v2/ports/workspace-anchor.port.d.ts +18 -0
- package/dist/v2/ports/workspace-anchor.port.js +2 -0
- package/dist/v2/projections/artifacts.d.ts +22 -0
- package/dist/v2/projections/artifacts.js +53 -0
- package/dist/v2/projections/projection-timing.d.ts +13 -0
- package/dist/v2/projections/projection-timing.js +23 -0
- package/dist/v2/projections/run-dag.d.ts +1 -1
- package/dist/v2/projections/run-status-signals.js +3 -8
- package/dist/v2/usecases/export-session.d.ts +47 -0
- package/dist/v2/usecases/export-session.js +92 -0
- package/dist/v2/usecases/import-session.d.ts +34 -0
- package/dist/v2/usecases/import-session.js +57 -0
- package/package.json +1 -1
- package/spec/workflow.schema.json +60 -0
- package/spec/workflow.schema.v0.0.1.json +38 -0
- package/workflows/coding-task-workflow-agentic.json +11 -18
- package/workflows/test-artifact-loop-control.json +59 -0
|
@@ -223,6 +223,9 @@
|
|
|
223
223
|
"$ref": "#/$defs/validationComposition"
|
|
224
224
|
}
|
|
225
225
|
]
|
|
226
|
+
},
|
|
227
|
+
"outputContract": {
|
|
228
|
+
"$ref": "#/$defs/outputContract"
|
|
226
229
|
}
|
|
227
230
|
},
|
|
228
231
|
"required": [
|
|
@@ -243,6 +246,23 @@
|
|
|
243
246
|
"maxLength": 256
|
|
244
247
|
},
|
|
245
248
|
"uniqueItems": true
|
|
249
|
+
},
|
|
250
|
+
"recommendedPreferences": {
|
|
251
|
+
"type": "object",
|
|
252
|
+
"description": "Workflow-level preference recommendations. When effective preferences exceed these, structured warnings are emitted. Never hard-blocks user choice.",
|
|
253
|
+
"properties": {
|
|
254
|
+
"recommendedAutonomy": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"enum": ["guided", "full_auto_stop_on_user_deps", "full_auto_never_stop"],
|
|
257
|
+
"description": "Recommended autonomy level for this workflow"
|
|
258
|
+
},
|
|
259
|
+
"recommendedRiskPolicy": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"enum": ["conservative", "balanced", "aggressive"],
|
|
262
|
+
"description": "Recommended risk policy for this workflow"
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"additionalProperties": false
|
|
246
266
|
}
|
|
247
267
|
},
|
|
248
268
|
"required": [
|
|
@@ -388,6 +408,24 @@
|
|
|
388
408
|
"$ref": "#/$defs/validationComposition"
|
|
389
409
|
}
|
|
390
410
|
]
|
|
411
|
+
},
|
|
412
|
+
"outputContract": {
|
|
413
|
+
"type": "object",
|
|
414
|
+
"description": "Typed output contract declaring required artifact schema",
|
|
415
|
+
"properties": {
|
|
416
|
+
"contractRef": {
|
|
417
|
+
"type": "string",
|
|
418
|
+
"description": "Artifact contract reference (e.g. wr.contracts.loop_control)",
|
|
419
|
+
"minLength": 1
|
|
420
|
+
},
|
|
421
|
+
"required": {
|
|
422
|
+
"type": "boolean",
|
|
423
|
+
"description": "Whether the artifact is required (default true)",
|
|
424
|
+
"default": true
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
"required": ["contractRef"],
|
|
428
|
+
"additionalProperties": false
|
|
391
429
|
}
|
|
392
430
|
}
|
|
393
431
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "coding-task-workflow-agentic",
|
|
3
3
|
"name": "Agentic Task Dev Workflow (Invariants • Architecture • Vertical Slices • PR Sizing • Audits • Resumable)",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"description": "Coding workflow that explores multiple approaches before committing—avoids anchoring on the first idea. Flow: constraints → approaches → compare → decide → slices → verify. Use when getting it right matters.",
|
|
6
|
+
"recommendedPreferences": {
|
|
7
|
+
"recommendedAutonomy": "guided",
|
|
8
|
+
"recommendedRiskPolicy": "conservative"
|
|
9
|
+
},
|
|
6
10
|
"preconditions": [
|
|
7
11
|
"User provides a task description (ticket text or equivalent) and success criteria (even if partial).",
|
|
8
12
|
"Agent has read access to the codebase and can use tools (search/read/edit/terminal).",
|
|
@@ -283,17 +287,8 @@
|
|
|
283
287
|
"var": "taskComplexity",
|
|
284
288
|
"not_equals": "Small"
|
|
285
289
|
},
|
|
286
|
-
"prompt": "Initialize a bounded plan-iteration loop.\n\
|
|
287
|
-
"requireConfirmation": false
|
|
288
|
-
"validationCriteria": {
|
|
289
|
-
"and": [
|
|
290
|
-
{
|
|
291
|
-
"type": "contains",
|
|
292
|
-
"value": "continuePlanning = true",
|
|
293
|
-
"message": "Must explicitly set: continuePlanning = true (otherwise the planning loop may not run)"
|
|
294
|
-
}
|
|
295
|
-
]
|
|
296
|
-
}
|
|
290
|
+
"prompt": "Initialize a bounded plan-iteration loop.\n\nRule: max 5 iterations. Continue while issues are found; stop when a pass is clean (no findings).\n\nThe loop will enter automatically. The exit decision step inside the loop will use a typed artifact to control continuation.",
|
|
291
|
+
"requireConfirmation": false
|
|
297
292
|
},
|
|
298
293
|
{
|
|
299
294
|
"id": "phase-5-plan-iterations",
|
|
@@ -344,15 +339,13 @@
|
|
|
344
339
|
{
|
|
345
340
|
"id": "phase-5d-loop-exit-decision",
|
|
346
341
|
"title": "Loop Exit Decision (Fail-Safe)",
|
|
347
|
-
"prompt": "**Non-optional:**
|
|
342
|
+
"prompt": "**Non-optional:** Provide a loop control decision artifact.\n\n**Output (exact format):**\n- Loop control artifact with decision: continue or stop\n- `reason`: one sentence\n- `whatChangedSinceLastIteration`: 1–3 bullets\n\n**Loop continuation logic (continue while issues found):**\n\n- If `planFindings` is **NON-EMPTY** (issues found this pass):\n → decision: continue\n → Rationale: Amendments need verification; may have introduced new issues\n\n- If `planFindings` is **EMPTY** (clean pass):\n → decision: stop\n → Rationale: Plan is stable, no more issues to find\n\n**Max iterations (5) still applies** — if you've hit 5 iterations and still finding issues, exit anyway and note remaining concerns.\n\n**Override to exit early:**\n- User explicitly requests to proceed\n- All findings are Minor AND `planConfidence >= 8`\n\nIf continuing, name what was found + what changes next iteration.\n\n**CONTEXT LOGGING:** Update CONTEXT.md Decision Log (follow format from metaGuidance) and update Machine State Checkpoint (keep last 3).",
|
|
348
343
|
"requireConfirmation": true,
|
|
344
|
+
"outputContract": {
|
|
345
|
+
"contractRef": "wr.contracts.loop_control"
|
|
346
|
+
},
|
|
349
347
|
"validationCriteria": {
|
|
350
348
|
"and": [
|
|
351
|
-
{
|
|
352
|
-
"type": "contains",
|
|
353
|
-
"value": "continuePlanning",
|
|
354
|
-
"message": "Must explicitly set: continuePlanning = true or false"
|
|
355
|
-
},
|
|
356
349
|
{
|
|
357
350
|
"type": "contains",
|
|
358
351
|
"value": "reason:",
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "test-artifact-loop-control",
|
|
3
|
+
"name": "Test Artifact Loop Control",
|
|
4
|
+
"description": "Test workflow demonstrating typed artifact loop control (Phase 3 migration pattern)",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"metaGuidance": [
|
|
7
|
+
"This workflow demonstrates the new artifact-based loop control pattern.",
|
|
8
|
+
"Instead of prose validation (checking for 'continuePlanning = true' in text),",
|
|
9
|
+
"agents provide structured artifacts with typed decisions.",
|
|
10
|
+
"VARIABLE TYPES: Booleans: loopShouldContinue (derived from artifact, not prose)."
|
|
11
|
+
],
|
|
12
|
+
"steps": [
|
|
13
|
+
{
|
|
14
|
+
"id": "init-loop",
|
|
15
|
+
"title": "Initialize Loop",
|
|
16
|
+
"prompt": "Initialize the bounded iteration loop.\n\n**Provide a loop control artifact:**\n```json\n{\n \"artifacts\": [{\n \"kind\": \"wr.loop_control\",\n \"loopId\": \"test-iteration\",\n \"decision\": \"continue\",\n \"metadata\": {\n \"reason\": \"Starting iteration loop\"\n }\n }]\n}\n```\n\nThe artifact must have:\n- kind: 'wr.loop_control'\n- loopId: 'test-iteration' (lowercase with hyphens)\n- decision: 'continue' or 'stop'",
|
|
17
|
+
"requireConfirmation": false,
|
|
18
|
+
"outputContract": {
|
|
19
|
+
"contractRef": "wr.contracts.loop_control"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "iteration-loop",
|
|
24
|
+
"type": "loop",
|
|
25
|
+
"title": "Iteration Loop",
|
|
26
|
+
"loop": {
|
|
27
|
+
"type": "while",
|
|
28
|
+
"condition": {
|
|
29
|
+
"var": "loopShouldContinue",
|
|
30
|
+
"equals": true
|
|
31
|
+
},
|
|
32
|
+
"maxIterations": 3
|
|
33
|
+
},
|
|
34
|
+
"body": [
|
|
35
|
+
{
|
|
36
|
+
"id": "do-work",
|
|
37
|
+
"title": "Do Iteration Work",
|
|
38
|
+
"prompt": "Perform work for this iteration.\n\nDescribe what you're doing this iteration.",
|
|
39
|
+
"requireConfirmation": false
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": "decide-continue",
|
|
43
|
+
"title": "Loop Decision",
|
|
44
|
+
"prompt": "Decide whether to continue or stop the loop.\n\n**Provide a loop control artifact:**\n```json\n{\n \"artifacts\": [{\n \"kind\": \"wr.loop_control\",\n \"loopId\": \"test-iteration\",\n \"decision\": \"continue\",\n \"metadata\": {\n \"reason\": \"More work needed\",\n \"iterationIndex\": 1\n }\n }]\n}\n```\n\n**Decision logic:**\n- If more work is needed: decision = 'continue'\n- If work is complete: decision = 'stop'\n\nThe artifact must have:\n- kind: 'wr.loop_control'\n- loopId: 'test-iteration'\n- decision: 'continue' or 'stop'",
|
|
45
|
+
"requireConfirmation": true,
|
|
46
|
+
"outputContract": {
|
|
47
|
+
"contractRef": "wr.contracts.loop_control"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "complete",
|
|
54
|
+
"title": "Complete",
|
|
55
|
+
"prompt": "The iteration loop has completed. Summarize what was accomplished.",
|
|
56
|
+
"requireConfirmation": false
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|