@exaudeus/workrail 3.10.0 → 3.11.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 (64) hide show
  1. package/dist/application/services/validation-engine.js +134 -0
  2. package/dist/application/services/workflow-compiler.js +54 -0
  3. package/dist/manifest.json +138 -74
  4. package/dist/mcp/handlers/v2-advance-core/assessment-consequences.d.ts +14 -0
  5. package/dist/mcp/handlers/v2-advance-core/assessment-consequences.js +27 -0
  6. package/dist/mcp/handlers/v2-advance-core/assessment-validation.d.ts +16 -0
  7. package/dist/mcp/handlers/v2-advance-core/assessment-validation.js +213 -0
  8. package/dist/mcp/handlers/v2-advance-core/event-builders.d.ts +1 -0
  9. package/dist/mcp/handlers/v2-advance-core/event-builders.js +3 -2
  10. package/dist/mcp/handlers/v2-advance-core/index.js +23 -8
  11. package/dist/mcp/handlers/v2-advance-core/input-validation.d.ts +9 -1
  12. package/dist/mcp/handlers/v2-advance-core/input-validation.js +22 -2
  13. package/dist/mcp/handlers/v2-advance-core/outcome-blocked.d.ts +2 -0
  14. package/dist/mcp/handlers/v2-advance-core/outcome-blocked.js +69 -19
  15. package/dist/mcp/handlers/v2-advance-core/outcome-success.js +22 -0
  16. package/dist/mcp/handlers/v2-execution/replay.js +7 -0
  17. package/dist/mcp/output-schemas.d.ts +156 -42
  18. package/dist/mcp/output-schemas.js +15 -0
  19. package/dist/mcp/v2-response-formatter.js +7 -1
  20. package/dist/types/workflow-definition.d.ts +26 -0
  21. package/dist/types/workflow-definition.js +16 -1
  22. package/dist/v2/durable-core/constants.d.ts +2 -0
  23. package/dist/v2/durable-core/constants.js +2 -0
  24. package/dist/v2/durable-core/domain/assessment-consequence-event-builder.d.ts +23 -0
  25. package/dist/v2/durable-core/domain/assessment-consequence-event-builder.js +36 -0
  26. package/dist/v2/durable-core/domain/assessment-record.d.ts +12 -0
  27. package/dist/v2/durable-core/domain/assessment-record.js +2 -0
  28. package/dist/v2/durable-core/domain/assessment-recorded-event-builder.d.ts +22 -0
  29. package/dist/v2/durable-core/domain/assessment-recorded-event-builder.js +38 -0
  30. package/dist/v2/durable-core/domain/blocked-node-builder.d.ts +1 -1
  31. package/dist/v2/durable-core/domain/blocked-node-builder.js +8 -0
  32. package/dist/v2/durable-core/domain/blocking-decision.d.ts +6 -0
  33. package/dist/v2/durable-core/domain/blocking-decision.js +15 -0
  34. package/dist/v2/durable-core/domain/prompt-renderer.js +25 -1
  35. package/dist/v2/durable-core/domain/reason-model.d.ts +12 -2
  36. package/dist/v2/durable-core/domain/reason-model.js +27 -2
  37. package/dist/v2/durable-core/domain/risk-policy-guardrails.js +1 -0
  38. package/dist/v2/durable-core/domain/validation-criteria-validator.d.ts +1 -0
  39. package/dist/v2/durable-core/domain/validation-criteria-validator.js +11 -0
  40. package/dist/v2/durable-core/schemas/artifacts/assessment.d.ts +55 -0
  41. package/dist/v2/durable-core/schemas/artifacts/assessment.js +29 -0
  42. package/dist/v2/durable-core/schemas/artifacts/index.d.ts +2 -1
  43. package/dist/v2/durable-core/schemas/artifacts/index.js +8 -1
  44. package/dist/v2/durable-core/schemas/compiled-workflow/index.d.ts +24 -24
  45. package/dist/v2/durable-core/schemas/execution-snapshot/blocked-snapshot.d.ts +141 -21
  46. package/dist/v2/durable-core/schemas/execution-snapshot/blocked-snapshot.js +10 -1
  47. package/dist/v2/durable-core/schemas/execution-snapshot/execution-snapshot.v1.d.ts +729 -171
  48. package/dist/v2/durable-core/schemas/export-bundle/index.d.ts +1442 -202
  49. package/dist/v2/durable-core/schemas/session/events.d.ts +231 -8
  50. package/dist/v2/durable-core/schemas/session/events.js +36 -0
  51. package/dist/v2/durable-core/schemas/session/gaps.d.ts +2 -2
  52. package/dist/v2/projections/assessment-consequences.d.ts +19 -0
  53. package/dist/v2/projections/assessment-consequences.js +33 -0
  54. package/dist/v2/projections/assessments.d.ts +21 -0
  55. package/dist/v2/projections/assessments.js +35 -0
  56. package/package.json +1 -1
  57. package/spec/authoring-spec.json +38 -4
  58. package/spec/production-readiness-audit-rubric.md +43 -0
  59. package/spec/workflow.schema.json +110 -0
  60. package/workflows/bug-investigation.agentic.v2.json +28 -2
  61. package/workflows/production-readiness-audit.json +354 -0
  62. package/workflows/test-artifact-loop-control.json +28 -2
  63. package/workflows/workflow-for-workflows.v2.json +395 -58
  64. package/workflows/wr.discovery.json +33 -69
@@ -11,26 +11,6 @@
11
11
  "wr.features.capabilities",
12
12
  "wr.features.subagent_guidance"
13
13
  ],
14
- "extensionPoints": [
15
- {
16
- "slotId": "candidate_generation",
17
- "purpose": "Let me swap in a different way of generating candidate directions without forking the whole workflow.",
18
- "default": "routine-tension-driven-design",
19
- "acceptedKinds": ["routine", "workflow"]
20
- },
21
- {
22
- "slotId": "direction_review",
23
- "purpose": "Let me swap in a different way of pressure-testing the selected direction without giving up parent workflow synthesis.",
24
- "default": "routine-design-review",
25
- "acceptedKinds": ["routine", "workflow"]
26
- },
27
- {
28
- "slotId": "final_validation",
29
- "purpose": "Let me swap in a different final challenge or validation pass before handoff.",
30
- "default": "routine-hypothesis-challenge",
31
- "acceptedKinds": ["routine", "workflow"]
32
- }
33
- ],
34
14
  "preconditions": [
35
15
  "I can tell you what problem, opportunity, or decision I want help thinking through.",
36
16
  "You can keep durable state in `output.notesMarkdown` and `continue_workflow` context keys.",
@@ -453,56 +433,48 @@
453
433
  },
454
434
  {
455
435
  "id": "phase-3b-candidates-deep",
456
- "title": "Phase 3b: Candidate Generation (Injected Routine)",
436
+ "title": "Phase 3b: Candidate Generation Setup",
457
437
  "runCondition": {
458
438
  "var": "rigorMode",
459
439
  "not_equals": "QUICK"
460
440
  },
461
441
  "promptBlocks": {
462
- "goal": "Run the configured candidate-generation approach and produce `design-candidates.md` for me.",
442
+ "goal": "Set up the injected candidate-generation pass so it produces the right kind of candidate set for this path.",
463
443
  "constraints": [
464
- "Candidate generation is a bounded cognitive phase. You still own selection and synthesis at the parent workflow level.",
465
- "The generated candidate set should reflect the selected path and current decision criteria."
444
+ "The next step injects the reusable candidate-generation routine inline.",
445
+ "Record any path-specific bias or extra rigor expectation before the injected routine runs."
466
446
  ],
467
447
  "procedure": [
468
- "Choose the execution mode that is most likely to produce a strong candidate set here. If you can get there well yourself, follow the bounded candidate-generation implementation referenced by `{{wr.bindings.candidate_generation}}` and produce `design-candidates.md` directly.",
469
- "If delegation is likely to give you a clearly better spread of options or a stronger challenge pass, spawn ONE WorkRail Executor running `{{wr.bindings.candidate_generation}}` with the current path, tensions, landscape packet, problem frame, and decision criteria, then capture the resulting candidate set in `design-candidates.md`. If you do not delegate, keep going yourself and record why that is enough."
448
+ "State what the injected candidate-generation routine must emphasize for this path and why.",
449
+ "For `design_first`, require at least one direction that meaningfully reframes the problem instead of only packaging obvious solutions.",
450
+ "For `landscape_first`, require the candidate set to clearly reflect landscape precedents, constraints, and contradictions rather than drifting into free invention.",
451
+ "For `THOROUGH`, require one extra push if the first spread still feels clustered or too safe.",
452
+ "Write these expectations into `designDocPath` so the later synthesis can judge whether the injected routine met them."
470
453
  ],
471
454
  "verify": [
472
- "`design-candidates.md` exists and contains a genuinely differentiated candidate set rather than minor variations on one idea."
455
+ "The path-specific expectations for candidate generation are explicit before the injected routine runs."
473
456
  ]
474
457
  },
475
- "promptFragments": [
476
- {
477
- "id": "p3b-design-reframe",
478
- "when": {
479
- "var": "pathRecommendation",
480
- "equals": "design_first"
481
- },
482
- "text": "Because this is `design_first`, make sure the candidate set includes at least one direction that meaningfully reframes the problem instead of only packaging obvious solutions."
483
- },
484
- {
485
- "id": "p3b-landscape-ground",
486
- "when": {
487
- "var": "pathRecommendation",
488
- "equals": "landscape_first"
489
- },
490
- "text": "Because this is `landscape_first`, make sure the candidate set clearly reflects landscape precedents, constraints, and contradictions rather than drifting into free invention."
491
- },
492
- {
493
- "id": "p3b-thorough-depth",
494
- "when": {
495
- "var": "rigorMode",
496
- "equals": "THOROUGH"
497
- },
498
- "text": "Because this is a `THOROUGH` pass, do not stop at the first good spread. Push once more if the set still feels clustered or too safe."
458
+ "requireConfirmation": false
459
+ },
460
+ {
461
+ "id": "phase-3c-candidates-deep-core",
462
+ "title": "Phase 3c: Candidate Generation (Injected Routine)",
463
+ "runCondition": {
464
+ "var": "rigorMode",
465
+ "not_equals": "QUICK"
466
+ },
467
+ "templateCall": {
468
+ "templateId": "wr.templates.routine.tension-driven-design",
469
+ "args": {
470
+ "deliverableName": "design-candidates.md"
499
471
  }
500
- ],
472
+ },
501
473
  "requireConfirmation": false
502
474
  },
503
475
  {
504
- "id": "phase-3c-select-direction",
505
- "title": "Phase 3c: Challenge and Select Direction",
476
+ "id": "phase-3d-select-direction",
477
+ "title": "Phase 3d: Challenge and Select Direction",
506
478
  "promptBlocks": {
507
479
  "goal": "Read `design-candidates.md`, challenge the leading option, and make the final selection for me.",
508
480
  "constraints": [
@@ -515,7 +487,7 @@
515
487
  "procedure": [
516
488
  "Compare candidates against `pathRecommendation` and `decisionCriteria`: which candidate best fits, which candidate is the strongest alternative, and what evidence or stakeholder tension the top candidate still risks missing.",
517
489
  "Self-produce the strongest argument against the leading option.",
518
- "If `delegationAvailable = true` and (`rigorMode != QUICK` or `pathRecommendation = full_spectrum`), decide whether a delegated challenge is likely to sharpen the decision enough to be worth the extra step. If yes, spawn ONE WorkRail Executor running `{{wr.bindings.final_validation}}` against the leading option. If not, keep the challenge in your own hands and say why.",
490
+ "If `delegationAvailable = true` and (`rigorMode != QUICK` or `pathRecommendation = full_spectrum`), decide whether a delegated challenge is likely to sharpen the decision enough to be worth the extra step. If yes, spawn ONE WorkRail Executor running `routine-hypothesis-challenge` against the leading option. If not, keep the challenge in your own hands and say why.",
519
491
  "If `delegationAvailable = true` and `rigorMode = THOROUGH`, decide whether an execution simulation would materially sharpen the decision. If yes, you may also spawn ONE WorkRail Executor running `routine-execution-simulation`.",
520
492
  "Choose `selectedDirection` and `runnerUpDirection`.",
521
493
  "Record `acceptedTradeoffs`, `identifiedFailureModes`, and what would trigger a switch.",
@@ -579,19 +551,11 @@
579
551
  {
580
552
  "id": "phase-4a-review-core",
581
553
  "title": "Direction Review Core",
582
- "promptBlocks": {
583
- "goal": "Run the configured direction review approach and produce `design-review-findings.md`.",
584
- "constraints": [
585
- "You remain responsible for interpreting the findings.",
586
- "Treat the selected direction and its known tradeoffs as input context, not as guaranteed truth."
587
- ],
588
- "procedure": [
589
- "Choose the execution mode that is most likely to produce a useful review here. If direct execution is enough, follow the bounded review implementation referenced by `{{wr.bindings.direction_review}}` and produce `design-review-findings.md`.",
590
- "If delegation is likely to surface better weaknesses or hidden tradeoffs, spawn ONE WorkRail Executor running `{{wr.bindings.direction_review}}` with the selected direction, accepted tradeoffs, failure modes, and path context, then capture the resulting findings in `design-review-findings.md`. If you do not delegate, record why direct review is enough."
591
- ],
592
- "verify": [
593
- "`design-review-findings.md` exists and reflects an actual review pass, not a placeholder."
594
- ]
554
+ "templateCall": {
555
+ "templateId": "wr.templates.routine.design-review",
556
+ "args": {
557
+ "deliverableName": "design-review-findings.md"
558
+ }
595
559
  },
596
560
  "requireConfirmation": false
597
561
  },
@@ -852,7 +816,7 @@
852
816
  ],
853
817
  "procedure": [
854
818
  "Validate that the selected path still makes sense in hindsight, the chosen direction still beats the strongest alternative, the remaining uncertainty is named honestly, and the design doc is complete enough for a human to use.",
855
- "If a serious unresolved concern remains and `delegationAvailable = true`, decide whether a delegated final challenge is likely to change the result or sharpen the caveats. If yes, spawn ONE WorkRail Executor running `{{wr.bindings.final_validation}}` against the final recommendation. If not, keep the challenge in your own hands and record why.",
819
+ "If a serious unresolved concern remains and `delegationAvailable = true`, decide whether a delegated final challenge is likely to change the result or sharpen the caveats. If yes, spawn ONE WorkRail Executor running `routine-hypothesis-challenge` against the final recommendation. If not, keep the challenge in your own hands and record why.",
856
820
  "Set these keys in the next `continue_workflow` call's `context` object: `finalConfidenceBand`, `residualRiskCount`, `handoffReady`."
857
821
  ],
858
822
  "verify": [