@exaudeus/workrail 3.66.0 → 3.68.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 (150) hide show
  1. package/dist/application/services/compiler/template-registry.js +10 -1
  2. package/dist/application/validation.js +1 -1
  3. package/dist/cli/commands/worktrain-init.js +1 -1
  4. package/dist/console/standalone-console.js +4 -1
  5. package/dist/console-ui/assets/{index-BynU38Vu.js → index-CyzltI6D.js} +1 -1
  6. package/dist/console-ui/index.html +1 -1
  7. package/dist/coordinators/modes/full-pipeline.js +4 -4
  8. package/dist/coordinators/modes/implement-shared.js +5 -5
  9. package/dist/coordinators/modes/implement.js +4 -4
  10. package/dist/coordinators/pr-review.js +4 -4
  11. package/dist/daemon/workflow-runner.d.ts +1 -0
  12. package/dist/daemon/workflow-runner.js +1 -0
  13. package/dist/infrastructure/storage/schema-validating-workflow-storage.d.ts +21 -2
  14. package/dist/infrastructure/storage/schema-validating-workflow-storage.js +48 -0
  15. package/dist/manifest.json +41 -41
  16. package/dist/mcp/handlers/v2-workflow.js +24 -7
  17. package/dist/mcp/output-schemas.d.ts +36 -0
  18. package/dist/mcp/output-schemas.js +11 -1
  19. package/dist/mcp/workflow-protocol-contracts.js +2 -2
  20. package/dist/v2/projections/session-metrics.d.ts +1 -1
  21. package/dist/v2/projections/session-metrics.js +16 -35
  22. package/dist/v2/usecases/console-routes.d.ts +2 -2
  23. package/docs/authoring-v2.md +4 -4
  24. package/docs/changelog-recent.md +3 -3
  25. package/docs/configuration.md +1 -1
  26. package/docs/design/adaptive-coordinator-context-candidates.md +1 -1
  27. package/docs/design/adaptive-coordinator-context.md +1 -1
  28. package/docs/design/adaptive-coordinator-routing-candidates.md +18 -18
  29. package/docs/design/adaptive-coordinator-routing-review.md +1 -1
  30. package/docs/design/adaptive-coordinator-routing.md +34 -34
  31. package/docs/design/agent-cascade-protocol.md +2 -2
  32. package/docs/design/console-daemon-separation-discovery.md +323 -0
  33. package/docs/design/context-assembly-design-candidates.md +1 -1
  34. package/docs/design/context-assembly-implementation-plan.md +1 -1
  35. package/docs/design/context-assembly-layer.md +2 -2
  36. package/docs/design/context-assembly-review-findings.md +1 -1
  37. package/docs/design/coordinator-access-audit.md +293 -0
  38. package/docs/design/coordinator-architecture-audit.md +62 -0
  39. package/docs/design/coordinator-error-handling-audit.md +240 -0
  40. package/docs/design/coordinator-testability-audit.md +426 -0
  41. package/docs/design/daemon-architecture-discovery.md +1 -1
  42. package/docs/design/daemon-console-separation-discovery.md +242 -0
  43. package/docs/design/daemon-memory-audit.md +203 -0
  44. package/docs/design/design-candidates-console-daemon-separation.md +256 -0
  45. package/docs/design/design-candidates-discovery-loop-fix.md +141 -0
  46. package/docs/design/design-review-findings-console-daemon-separation.md +106 -0
  47. package/docs/design/design-review-findings-discovery-loop-fix.md +81 -0
  48. package/docs/design/discovery-loop-fix-candidates.md +161 -0
  49. package/docs/design/discovery-loop-fix-design-review.md +106 -0
  50. package/docs/design/discovery-loop-fix-validation.md +258 -0
  51. package/docs/design/discovery-loop-investigation-A.md +188 -0
  52. package/docs/design/discovery-loop-investigation-B.md +287 -0
  53. package/docs/design/exploration-workflow-candidates.md +205 -0
  54. package/docs/design/exploration-workflow-design-review.md +166 -0
  55. package/docs/design/exploration-workflow-discovery.md +443 -0
  56. package/docs/design/ide-context-files-candidates.md +231 -0
  57. package/docs/design/ide-context-files-design-review.md +85 -0
  58. package/docs/design/ide-context-files.md +615 -0
  59. package/docs/design/implementation-plan-discovery-loop-fix.md +199 -0
  60. package/docs/design/implementation-plan-queue-poll-rotation.md +102 -0
  61. package/docs/design/in-process-http-audit.md +190 -0
  62. package/docs/design/layer3b-ghost-nodes-design-candidates.md +2 -2
  63. package/docs/design/loadSessionNotes-candidates.md +108 -0
  64. package/docs/design/loadSessionNotes-test-coverage-discovery.md +297 -0
  65. package/docs/design/loadSessionNotes-test-coverage-session4.md +209 -0
  66. package/docs/design/loadSessionNotes-test-coverage-v3.md +321 -0
  67. package/docs/design/probe-session-design-candidates.md +261 -0
  68. package/docs/design/probe-session-phase0.md +490 -0
  69. package/docs/design/routines-guide.md +7 -7
  70. package/docs/design/session-metrics-attribution-candidates.md +250 -0
  71. package/docs/design/session-metrics-attribution-design-review.md +115 -0
  72. package/docs/design/session-metrics-attribution-discovery.md +319 -0
  73. package/docs/design/session-metrics-candidates.md +227 -0
  74. package/docs/design/session-metrics-design-review.md +104 -0
  75. package/docs/design/session-metrics-discovery.md +454 -0
  76. package/docs/design/spawn-session-debug.md +202 -0
  77. package/docs/design/trigger-validator-candidates.md +214 -0
  78. package/docs/design/trigger-validator-review.md +109 -0
  79. package/docs/design/trigger-validator-shaping-phase0.md +239 -0
  80. package/docs/design/trigger-validator.md +454 -0
  81. package/docs/design/v2-core-design-locks.md +2 -2
  82. package/docs/design/workflow-extension-points.md +15 -15
  83. package/docs/design/workflow-id-validation-at-startup.md +1 -1
  84. package/docs/design/workflow-id-validation-implementation-plan.md +2 -2
  85. package/docs/design/workflow-trigger-lifecycle-audit.md +175 -0
  86. package/docs/design/worktrain-task-queue-candidates.md +5 -5
  87. package/docs/design/worktrain-task-queue.md +4 -4
  88. package/docs/discovery/coordinator-script-design.md +1 -1
  89. package/docs/discovery/coordinator-ux-discovery.md +3 -3
  90. package/docs/discovery/simulation-report.md +1 -1
  91. package/docs/discovery/workflow-modernization-discovery.md +326 -0
  92. package/docs/discovery/workflow-selection-for-discovery-tasks.md +33 -33
  93. package/docs/discovery/worktrain-status-briefing.md +1 -1
  94. package/docs/discovery/wr-discovery-goal-reframing.md +1 -1
  95. package/docs/docker.md +1 -1
  96. package/docs/ideas/backlog.md +227 -0
  97. package/docs/ideas/third-party-workflow-setup-design-thinking.md +1 -1
  98. package/docs/integrations/claude-code.md +5 -5
  99. package/docs/integrations/firebender.md +1 -1
  100. package/docs/plans/agentic-orchestration-roadmap.md +2 -2
  101. package/docs/plans/mr-review-workflow-redesign.md +9 -9
  102. package/docs/plans/ui-ux-workflow-design-candidates.md +4 -4
  103. package/docs/plans/ui-ux-workflow-discovery.md +2 -2
  104. package/docs/plans/workflow-categories-candidates.md +8 -8
  105. package/docs/plans/workflow-categories-discovery.md +4 -4
  106. package/docs/plans/workflow-modernization-design.md +430 -0
  107. package/docs/plans/workflow-staleness-detection-candidates.md +11 -11
  108. package/docs/plans/workflow-staleness-detection-review.md +4 -4
  109. package/docs/plans/workflow-staleness-detection.md +9 -9
  110. package/docs/plans/workrail-platform-vision.md +3 -3
  111. package/docs/reference/agent-context-cleaner-snippet.md +1 -1
  112. package/docs/reference/agent-context-guidance.md +4 -4
  113. package/docs/reference/context-optimization.md +2 -2
  114. package/docs/roadmap/now-next-later.md +2 -2
  115. package/docs/roadmap/open-work-inventory.md +16 -16
  116. package/docs/workflows.md +31 -31
  117. package/package.json +1 -1
  118. package/spec/workflow-tags.json +47 -47
  119. package/workflows/adaptive-ticket-creation.json +16 -16
  120. package/workflows/architecture-scalability-audit.json +22 -22
  121. package/workflows/bug-investigation.agentic.v2.json +3 -3
  122. package/workflows/classify-task-workflow.json +1 -1
  123. package/workflows/coding-task-workflow-agentic.json +6 -6
  124. package/workflows/cross-platform-code-conversion.v2.json +8 -8
  125. package/workflows/document-creation-workflow.json +8 -8
  126. package/workflows/documentation-update-workflow.json +8 -8
  127. package/workflows/intelligent-test-case-generation.json +2 -2
  128. package/workflows/learner-centered-course-workflow.json +2 -2
  129. package/workflows/mr-review-workflow.agentic.v2.json +4 -4
  130. package/workflows/personal-learning-materials-creation-branched.json +8 -8
  131. package/workflows/presentation-creation.json +5 -5
  132. package/workflows/production-readiness-audit.json +1 -1
  133. package/workflows/relocation-workflow-us.json +31 -31
  134. package/workflows/routines/context-gathering.json +1 -1
  135. package/workflows/routines/design-review.json +1 -1
  136. package/workflows/routines/execution-simulation.json +1 -1
  137. package/workflows/routines/feature-implementation.json +3 -3
  138. package/workflows/routines/final-verification.json +1 -1
  139. package/workflows/routines/hypothesis-challenge.json +1 -1
  140. package/workflows/routines/ideation.json +1 -1
  141. package/workflows/routines/parallel-work-partitioning.json +3 -3
  142. package/workflows/routines/philosophy-alignment.json +2 -2
  143. package/workflows/routines/plan-analysis.json +1 -1
  144. package/workflows/routines/plan-generation.json +1 -1
  145. package/workflows/routines/tension-driven-design.json +6 -6
  146. package/workflows/scoped-documentation-workflow.json +26 -26
  147. package/workflows/ui-ux-design-workflow.json +14 -14
  148. package/workflows/workflow-diagnose-environment.json +1 -1
  149. package/workflows/workflow-for-workflows.json +32 -77
  150. package/workflows/workflow-for-workflows.v2.json +0 -788
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "ui-ux-design-workflow",
2
+ "id": "wr.ui-ux-design",
3
3
  "name": "UI/UX Design Workflow",
4
4
  "version": "0.1.0",
5
5
  "metricsProfile": "design",
@@ -25,7 +25,7 @@
25
25
  ],
26
26
  "metaGuidance": [
27
27
  "PROCESS IS THE VALUE: the biggest failure mode in AI-assisted design is skipping to solutions before understanding the problem. This workflow makes that structurally impossible. Do not shortcut Phase 0.",
28
- "EVIDENCE OVER PLATITUDES: every finding must cite a specific element from the context packet. 'Consider reducing cognitive load' is not a finding. 'The settings panel has 14 options, violating Miller’s Law (7±2)' is a finding.",
28
+ "EVIDENCE OVER PLATITUDES: every finding must cite a specific element from the context packet. 'Consider reducing cognitive load' is not a finding. 'The settings panel has 14 options, violating Miller\u2019s Law (7\u00b12)' is a finding.",
29
29
  "SIMPLE CRITERIA: designComplexity=Simple is only valid for a single existing component with a minor change, no new user flows, no information architecture changes, and no new interaction patterns. If uncertain, classify upward.",
30
30
  "HONEST LIMITS: this workflow produces a text-based design spec. It cannot produce visual mockups, conduct usability testing, or verify visual quality. Say so explicitly in the handoff and flag what still needs human visual review.",
31
31
  "CONTEXT BLINDNESS: if the user has not provided design system, existing component patterns, or platform conventions, surface this gap in Phase 0 and ask. Do not silently design without this context.",
@@ -75,14 +75,14 @@
75
75
  "promptBlocks": {
76
76
  "goal": "Generate 2-3 genuinely different design directions before committing to any one of them.",
77
77
  "constraints": [
78
- "Directions must be genuinely different not variations of the same pattern with different labels.",
78
+ "Directions must be genuinely different \u2014 not variations of the same pattern with different labels.",
79
79
  "Each direction needs an information architecture sketch: how is content organized, what is the primary navigation path, what is the visual hierarchy?",
80
80
  "Do not select a direction in this phase. Exploration comes before convergence."
81
81
  ],
82
82
  "procedure": [
83
83
  "Generate Direction A: the most conventional approach that follows existing platform patterns and design system. Low risk, familiar to users.",
84
- "Generate Direction B: an approach that prioritizes the primary user goal differently different IA, different entry point, or different interaction model.",
85
- "Generate Direction C (if designComplexity=Complex): a third direction that challenges the assumptions in A and B a more radical rethinking of the problem.",
84
+ "Generate Direction B: an approach that prioritizes the primary user goal differently \u2014 different IA, different entry point, or different interaction model.",
85
+ "Generate Direction C (if designComplexity=Complex): a third direction that challenges the assumptions in A and B \u2014 a more radical rethinking of the problem.",
86
86
  "For each direction, describe: (1) the primary IA sketch (main sections, navigation path, content hierarchy), (2) the core interaction model (how does the user accomplish their goal?), (3) the key tradeoffs relative to user goals and constraints.",
87
87
  "After describing all directions, restate which user goals each direction serves well and where each direction is weakest."
88
88
  ],
@@ -108,8 +108,8 @@
108
108
  "promptBlocks": {
109
109
  "goal": "Assemble a neutral context packet that all reviewer families will use as shared truth, then declare which reviewers are needed.",
110
110
  "constraints": [
111
- "The context packet is neutral it presents the design problem and directions without advocating for any one.",
112
- "Select the direction to develop further before running reviewers reviewers evaluate a specific direction, not an abstract problem.",
111
+ "The context packet is neutral \u2014 it presents the design problem and directions without advocating for any one.",
112
+ "Select the direction to develop further before running reviewers \u2014 reviewers evaluate a specific direction, not an abstract problem.",
113
113
  "All 5 reviewer families are active for Complex designs; IA and UX laws reviewers are always included for Standard."
114
114
  ],
115
115
  "procedure": [
@@ -152,7 +152,7 @@
152
152
  "procedure": [
153
153
  "Before delegating, restate the selected direction and the user goal it serves best.",
154
154
  "Spawn one WorkRail Executor per selected reviewer family simultaneously. Each executor receives: the designContextPacket, their specific reviewer mission, and the finding format requirement.",
155
- "Reviewer family missions: (1) IA reviewer evaluate content hierarchy, navigation paths, grouping logic, and information scent against user goals; cite specific IA decisions; (2) UX laws reviewer check each relevant law: Hick's Law (decision count), Miller's Law (working memory), Jakob's Law (familiar patterns), Fitts's Law (target size and distance), Peak-End Rule (emotional journey), Tesler's Law (irreducible complexity), Von Restorff Effect (visual differentiation of important elements); cite specific violations or confirmations; (3) accessibility reviewer check WCAG requirements: color contrast ratios (4.5:1 normal, 3:1 large text), keyboard navigation path, touch target sizes (44x44px minimum), screen reader labels, focus indicators, animation controls; produce specific requirements not 'follow WCAG'; (4) edge cases reviewer for each interactive element, explicitly address: empty state (no data), error state (failed action), loading state, first-use/onboarding, offline or degraded state, destructive actions; flag any state not addressed in the current design; (5) content reviewer evaluate every label, button copy, placeholder, error message, and helper text against clarity, user language vs. technical jargon, and actionability of error messages.",
155
+ "Reviewer family missions: (1) IA reviewer \u2014 evaluate content hierarchy, navigation paths, grouping logic, and information scent against user goals; cite specific IA decisions; (2) UX laws reviewer \u2014 check each relevant law: Hick's Law (decision count), Miller's Law (working memory), Jakob's Law (familiar patterns), Fitts's Law (target size and distance), Peak-End Rule (emotional journey), Tesler's Law (irreducible complexity), Von Restorff Effect (visual differentiation of important elements); cite specific violations or confirmations; (3) accessibility reviewer \u2014 check WCAG requirements: color contrast ratios (4.5:1 normal, 3:1 large text), keyboard navigation path, touch target sizes (44x44px minimum), screen reader labels, focus indicators, animation controls; produce specific requirements not 'follow WCAG'; (4) edge cases reviewer \u2014 for each interactive element, explicitly address: empty state (no data), error state (failed action), loading state, first-use/onboarding, offline or degraded state, destructive actions; flag any state not addressed in the current design; (5) content reviewer \u2014 evaluate every label, button copy, placeholder, error message, and helper text against clarity, user language vs. technical jargon, and actionability of error messages.",
156
156
  "After receiving all executor outputs, synthesize explicitly: what was confirmed, what was new, what looks weak or generic, and what has citations vs. what is speculation.",
157
157
  "Set evidenceWeakCount to the number of findings without specific citations."
158
158
  ],
@@ -250,13 +250,13 @@
250
250
  "promptBlocks": {
251
251
  "goal": "Verify all quality gates pass before writing the design spec.",
252
252
  "constraints": [
253
- "If any gate fails, fix the underlying issue before advancing do not write the spec over known gaps."
253
+ "If any gate fails, fix the underlying issue before advancing \u2014 do not write the spec over known gaps."
254
254
  ],
255
255
  "procedure": [
256
- "Gate 1 Evidence citations: confirm every finding in reviewerFindings cites a specific design element from the context packet. Flag any finding that is generic advice without a specific reference and either improve it or mark it advisory-only.",
257
- "Gate 2 Reviewer coverage: confirm every declared reviewer family has at least one substantive finding. If a family has no findings, state explicitly why (e.g., 'IA reviewer found no issues the single-screen design has no navigation structure to evaluate').",
258
- "Gate 3 Edge case coverage: confirm empty state, error state, loading state, and first-use are addressed for each interactive element in the selected design direction. List any that are not yet addressed.",
259
- "Gate 4 Accessibility specificity: confirm accessibility requirements are listed as specific constraints (color contrast ratios, touch target sizes, keyboard tab order), not as a generic 'follow WCAG' instruction."
256
+ "Gate 1 \u2014 Evidence citations: confirm every finding in reviewerFindings cites a specific design element from the context packet. Flag any finding that is generic advice without a specific reference and either improve it or mark it advisory-only.",
257
+ "Gate 2 \u2014 Reviewer coverage: confirm every declared reviewer family has at least one substantive finding. If a family has no findings, state explicitly why (e.g., 'IA reviewer found no issues \u2014 the single-screen design has no navigation structure to evaluate').",
258
+ "Gate 3 \u2014 Edge case coverage: confirm empty state, error state, loading state, and first-use are addressed for each interactive element in the selected design direction. List any that are not yet addressed.",
259
+ "Gate 4 \u2014 Accessibility specificity: confirm accessibility requirements are listed as specific constraints (color contrast ratios, touch target sizes, keyboard tab order), not as a generic 'follow WCAG' instruction."
260
260
  ],
261
261
  "outputRequired": {
262
262
  "notesMarkdown": "Gate check results: which passed, which failed, what was fixed.",
@@ -281,7 +281,7 @@
281
281
  "Do not drift into implementation planning (specific component libraries, code) unless explicitly asked."
282
282
  ],
283
283
  "procedure": [
284
- "Write the design spec covering: (1) Design Decision which direction was chosen and the specific reason it was chosen over the others; (2) Information Architecture content hierarchy, navigation structure, primary user path; (3) Interaction Design how each interactive element works, what triggers what, what feedback the user gets; (4) States for each element: default, hover/focus, loading, error, empty, first-use, disabled; (5) Accessibility Requirements specific requirements (color contrast ratios, keyboard tab order, touch target sizes, screen reader labels); (6) Content all copy, labels, error messages, placeholders, and onboarding text; (7) Reviewer Findings per-dimension findings with citations that the design should address or has already addressed; (8) Open Questions what still needs human input (visual design, usability testing, design system component availability).",
284
+ "Write the design spec covering: (1) Design Decision \u2014 which direction was chosen and the specific reason it was chosen over the others; (2) Information Architecture \u2014 content hierarchy, navigation structure, primary user path; (3) Interaction Design \u2014 how each interactive element works, what triggers what, what feedback the user gets; (4) States \u2014 for each element: default, hover/focus, loading, error, empty, first-use, disabled; (5) Accessibility Requirements \u2014 specific requirements (color contrast ratios, keyboard tab order, touch target sizes, screen reader labels); (6) Content \u2014 all copy, labels, error messages, placeholders, and onboarding text; (7) Reviewer Findings \u2014 per-dimension findings with citations that the design should address or has already addressed; (8) Open Questions \u2014 what still needs human input (visual design, usability testing, design system component availability).",
285
285
  "Close the spec by naming: what visual review a human designer should perform, and what this workflow cannot verify (visual quality, usability, emotional feel)."
286
286
  ],
287
287
  "outputRequired": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "workflow-diagnose-environment",
2
+ "id": "wr.diagnose-environment",
3
3
  "name": "Diagnostic: Environment & Subagents",
4
4
  "version": "1.0.0",
5
5
  "metricsProfile": "none",
@@ -1,7 +1,7 @@
1
1
  {
2
- "id": "workflow-for-workflows",
2
+ "id": "wr.workflow-for-workflows",
3
3
  "name": "Workflow Authoring Workflow",
4
- "version": "2.4.0",
4
+ "version": "2.5.0",
5
5
  "metricsProfile": "design",
6
6
  "description": "Use this to author or modernize a WorkRail workflow. Guides through understanding the task, defining effectiveness targets, designing architecture and quality gates, drafting, validating, assigning tags, and handing off.",
7
7
  "about": "## Workflow Authoring Workflow\n\nThis is the standard WorkRail workflow for creating a new workflow from scratch or modernizing an existing one. It is the trust gate for all other workflows: a workflow is not considered production-ready until it has passed through here.\n\n**What it does:**\nThe workflow walks through the full authoring lifecycle: understanding the task, choosing the right baseline and archetype, designing the phase and quality-gate architecture, drafting the workflow JSON, running structural validators, auditing state fields for bloat, simulating execution against real scenarios, running an adversarial quality review, and producing a final trust handoff. For modernization tasks it builds a value inventory first to ensure enforcement mechanisms, domain knowledge, and behavioral rules are preserved or equivalently replaced.\n\n**When to use it:**\n- You want to author a new WorkRail workflow for a recurring task or problem\n- You have an existing workflow that is outdated, uses legacy patterns (pseudo-DSL, regex validation, satisfaction-score loops), or produces shallow results\n- You want a workflow that will pass the WorkRail quality bar and be trusted to run in production\n\n**What it produces:**\nA validated, tagged workflow JSON file with a `validatedAgainstSpecVersion` stamp. A final trust handoff with readiness verdict, known failure modes, residual weaknesses, and testing guidance.\n\n**How to get good results:**\nDescribe the recurring task the workflow should solve, who will run it, and what a satisfying result looks like. For modernization, point to the existing workflow file. The workflow reads the schema and authoring spec itself -- you do not need to know the JSON format in advance.",
@@ -211,10 +211,8 @@
211
211
  ],
212
212
  "procedure": [
213
213
  "Decide the phase list, one-line goal for each phase, and overall ordering.",
214
- "Identify meaningful input classifications that require different workflow paths. For each variant dimension, decide the branching mechanism: `runCondition` on separate steps (diverging paths), `promptFragments` (additive behavior on a shared base), or a separate workflow entirely. For each captured variable that drives branching, define its closed set of valid values — unexpected values are a common source of silent misbehavior.",
215
214
  "Design loops with explicit exit rules, bounded maxIterations, and real reasons for another pass.",
216
- "Decide confirmation gates, delegation vs template injection vs direct execution, promptFragments, references, artifacts, and metaGuidance.",
217
- "If the authored workflow encodes domain knowledge tied to a specific version of an external system or codebase, decide how to handle staleness: prefer reading the codebase at runtime over hardcoding patterns, or explicitly document versioned assumptions so they surface as maintenance debt."
215
+ "Decide confirmation gates, delegation vs template injection vs direct execution, promptFragments, references, artifacts, and metaGuidance."
218
216
  ],
219
217
  "outputRequired": {
220
218
  "notesMarkdown": "Structured workflow outline, loop design, confirmation design, delegation design, artifact plan, and modernization mapping.",
@@ -267,7 +265,7 @@
267
265
  "procedure": [
268
266
  "Decide whether the authored workflow needs a hypothesis step, neutral fact packet, reviewer or validator families, contradiction loop, final validation bundle, or explicit blind-spot handling.",
269
267
  "Design the confidence model, blind-spot model, and state economy plan.",
270
- "Decide the hard-gate dimensions that would make the authored workflow unsafe or unsatisfying if they fail. Choose the right enforcement mechanism for each gate: `assessments` + `assessmentRefs` + `assessmentConsequences` for bounded confidence judgments (each dimension captures a distinct orthogonal failure mode see `mr-review-workflow.agentic.v2.json` and `bug-investigation.agentic.v2.json`); `validationCriteria` with context-aware conditions for completion-gating on structured checklists or required output content (the engine enforces that required content appears in the response before the step can complete, without a loop — conditions on individual rules can match the workflow's branching context); a re-verification loop for fix-and-verify cycles where the agent must act then prove the action worked. Do not default to a loop when `validationCriteria` is the right tool, or to `requireConfirmation` when a hard gate is needed.",
268
+ "Decide the hard-gate dimensions that would make the authored workflow unsafe or unsatisfying if they fail. If hard gates exist, implement them using the native `assessments` + `assessmentRefs` + `assessmentConsequences` schema fields rather than informal notes or `requireConfirmation` alone. Each dimension should capture a distinct orthogonal failure mode -- not restate the workflow's existing confidence band. See `mr-review-workflow.agentic.v2.json` and `bug-investigation.agentic.v2.json` as exemplars.",
271
269
  "Write the redesign triggers that should force architectural revision rather than cosmetic refinement."
272
270
  ],
273
271
  "outputRequired": {
@@ -556,84 +554,14 @@
556
554
  "text": "For modernize_existing: add a heritage_reviewer to the adversarial bundle. Its job is to check each valueInventory item and find what was lost or weakened -- it ignores format improvements. It must answer: which enforcement mechanisms are now prose-only? Which domain knowledge items are absent? Which behavioral rules were removed without equivalent replacement? Heritage_reviewer findings drive enforcementStrength and modernizationDiscipline scores."
557
555
  }
558
556
  ],
559
- "hasValidation": true,
557
+ "requireConfirmation": false,
560
558
  "validationCriteria": [
561
- {
562
- "type": "contains",
563
- "value": "voiceClarity",
564
- "message": "Review must score voiceClarity"
565
- },
566
- {
567
- "type": "contains",
568
- "value": "ceremonyLevel",
569
- "message": "Review must score ceremonyLevel"
570
- },
571
- {
572
- "type": "contains",
573
- "value": "loopSoundness",
574
- "message": "Review must score loopSoundness"
575
- },
576
- {
577
- "type": "contains",
578
- "value": "delegationBoundedness",
579
- "message": "Review must score delegationBoundedness"
580
- },
581
- {
582
- "type": "contains",
583
- "value": "artifactClarity",
584
- "message": "Review must score artifactClarity"
585
- },
586
- {
587
- "type": "contains",
588
- "value": "taskEffectiveness",
589
- "message": "Review must score taskEffectiveness"
590
- },
591
- {
592
- "type": "contains",
593
- "value": "falseConfidenceResistance",
594
- "message": "Review must score falseConfidenceResistance"
595
- },
596
- {
597
- "type": "contains",
598
- "value": "stateMinimality",
599
- "message": "Review must score stateMinimality"
600
- },
601
- {
602
- "type": "contains",
603
- "value": "coverageSharpness",
604
- "message": "Review must score coverageSharpness"
605
- },
606
- {
607
- "type": "contains",
608
- "value": "domainFit",
609
- "message": "Review must score domainFit"
610
- },
611
- {
612
- "type": "contains",
613
- "value": "handoffUtility",
614
- "message": "Review must score handoffUtility"
615
- },
616
559
  {
617
560
  "type": "contains",
618
561
  "value": "complexityScaling",
619
562
  "message": "Review must score complexityScaling"
620
- },
621
- {
622
- "type": "contains",
623
- "value": "enforcementStrength",
624
- "message": "Review must score enforcementStrength"
625
- },
626
- {
627
- "type": "contains",
628
- "value": "modernizationDiscipline",
629
- "condition": {
630
- "var": "authoringMode",
631
- "equals": "modernize_existing"
632
- },
633
- "message": "Modernization reviews must score modernizationDiscipline"
634
563
  }
635
564
  ],
636
- "requireConfirmation": false,
637
565
  "assessmentRefs": [
638
566
  "authoring-integrity-gate",
639
567
  "outcome-effectiveness-gate"
@@ -743,6 +671,33 @@
743
671
  },
744
672
  "requireConfirmation": false
745
673
  },
674
+ {
675
+ "id": "phase-7b-declare-metrics-profile",
676
+ "title": "Phase 7b: Declare metricsProfile",
677
+ "promptBlocks": {
678
+ "goal": "Declare the metricsProfile field in the authored workflow JSON, or explicitly justify omitting it. The metricsProfile field enables engine-injected metrics instrumentation footers in step prompts. When set, the engine injects context key accumulation reminders into every step prompt -- guiding compliant agents to report outcome, commit SHAs, PR numbers, and diff stats at session completion. Without this field, captureConfidence is always 'none' and no session metrics are collected.",
679
+ "procedure": [
680
+ "Choose the correct profile based on what the workflow produces:",
681
+ " - 'coding': produces code commits. Use for implementation, refactoring, bug-fix, migration, and documentation-writing workflows.",
682
+ " - 'review': produces a review decision on a PR or MR. Use for code review, audit, and change validation workflows.",
683
+ " - 'research': produces a finding or recommendation but no commits. Use for investigation, diagnosis, and analysis workflows.",
684
+ " - 'design': produces a design artifact (pitch, spec, ADR, architecture doc) but no commits.",
685
+ " - 'ticket': creates or updates work items in an external system (Jira, GitHub Issues, Linear).",
686
+ " - 'none': meta-workflow, authoring tool, utility routine, or no measurable outcome. Set explicitly and document the reason.",
687
+ "Add `\"metricsProfile\": \"<profile>\"` as a top-level field in the workflow JSON, after `recommendedPreferences` if that field exists.",
688
+ "If choosing 'none', record the justification in your notes so the decision is auditable."
689
+ ],
690
+ "constraints": [
691
+ "Do not invent a new profile value. The closed set is: 'coding', 'review', 'research', 'design', 'ticket', 'none'.",
692
+ "The engine does NOT derive the profile from tags automatically. You must set it explicitly.",
693
+ "workflow-for-workflows itself produces a workflow JSON artifact (a design output) -- use 'design'. It does not commit code."
694
+ ],
695
+ "outputRequired": {
696
+ "notesMarkdown": "State the chosen metricsProfile and a one-line justification. If omitting, explain why."
697
+ }
698
+ },
699
+ "requireConfirmation": false
700
+ },
746
701
  {
747
702
  "id": "phase-7-final-trust-handoff",
748
703
  "title": "Phase 7: Final Trust Handoff",