@exaudeus/workrail 3.9.0 → 3.9.2

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.
@@ -0,0 +1,915 @@
1
+ {
2
+ "id": "wr.discovery",
3
+ "name": "Discovery Workflow (Bundled • Exploration + Design Synthesis)",
4
+ "version": "3.1.0",
5
+ "description": "Use this when you want the agent to help you think something through end to end. It should combine the old exploration and design-thinking behaviors into one adaptive notes-first flow, moving between landscape exploration, problem framing, candidate generation, challenge, and uncertainty-resolution through landscape-first, full-spectrum, and design-first paths.",
6
+ "recommendedPreferences": {
7
+ "recommendedAutonomy": "guided",
8
+ "recommendedRiskPolicy": "conservative"
9
+ },
10
+ "features": [
11
+ "wr.features.capabilities",
12
+ "wr.features.subagent_guidance"
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
+ "preconditions": [
35
+ "I can tell you what problem, opportunity, or decision I want help thinking through.",
36
+ "You can keep durable state in `output.notesMarkdown` and `continue_workflow` context keys.",
37
+ "You can create and maintain a human-facing design document when the work is substantial enough to need one."
38
+ ],
39
+ "metaGuidance": [
40
+ "Default behavior: use tools and keep moving. Only stop to ask me for things you cannot responsibly infer, verify, or access yourself.",
41
+ "Durability: keep the durable truth in `output.notesMarkdown` and explicit `continue_workflow` context keys. Do not rely on the design doc alone as memory.",
42
+ "Artifact strategy: treat `designDocPath` as the human-facing canonical artifact. Keep it readable and current, but keep execution truth in notes and structured context.",
43
+ "Own the synthesis yourself. Delegated output is evidence, not a decision. You own framing, comparison, challenge adjudication, selection, uncertainty-resolution, and final handoff.",
44
+ "Positioning: treat this as the canonical successor to the old exploration and design-thinking workflows. If I ask for either of those by name, this is the workflow I mean.",
45
+ "Path model: pick one emphasis path early, but keep the shared core. Every path still needs landscape understanding, problem or stakeholder understanding, candidate generation, challenge, and a recommendation or learning artifact.",
46
+ "Paths: use `landscape_first` for current-state understanding and comparison. Use `full_spectrum` for important or ambiguous problems. Use `design_first` when reframing, tensions, and prototype-driven learning matter most.",
47
+ "Re-triage: treat the initial path choice as provisional. If early context shows the center of gravity is somewhere else, change course deliberately.",
48
+ "Anti-anchoring: do not let the first framing or favorite option dominate the work. Generate at least one materially different direction and challenge the leading one directly.",
49
+ "Parallelism: parallelize independent research lenses, stakeholder lenses, and bounded cognitive routines. Serialize synthesis, recommendation decisions, and canonical document writes.",
50
+ "Capability fallbacks: if web browsing is unavailable, use repo context, user context, and internal knowledge, then record the evidence gaps explicitly. If delegation is unavailable, do the passes yourself in sequence.",
51
+ "Doc discipline: keep append-only decision reasoning in the design doc. Record assumptions, contradictions, abandoned paths, and why the selected direction won.",
52
+ "Boundary: this workflow can end with a recommendation memo, prototype or test plan, or a research-informed direction. It should not implement production code."
53
+ ],
54
+ "functionDefinitions": [
55
+ {
56
+ "name": "landscapePacketTemplate",
57
+ "definition": "Use this shape for the landscape packet in `designDocPath`:\n## Landscape Packet\n- Current state summary\n- Existing approaches / precedents\n- Option categories\n- Contradictions / disagreements\n- Evidence gaps\n- Why this matters for path selection and recommendation"
58
+ },
59
+ {
60
+ "name": "problemFrameTemplate",
61
+ "definition": "Use this shape for the problem frame packet in `designDocPath`:\n## Problem Frame Packet\n- Users / stakeholders\n- Jobs, goals, or outcomes\n- Pains / tensions / constraints\n- Success criteria\n- Assumptions\n- Reframes / HMW questions\n- What would make this framing wrong"
62
+ },
63
+ {
64
+ "name": "prototypeSpecTemplate",
65
+ "definition": "Use this shape for a lightweight prototype or validation artifact:\n## Goal\n## Non-goals\n## Learning question\n## Artifact type\n## What will be exercised\n## Falsification criteria\n## Test scenarios\n## Expected signals\n## Pivot / stop rule"
66
+ }
67
+ ],
68
+ "steps": [
69
+ {
70
+ "id": "phase-0-select-path",
71
+ "title": "Phase 0: Understand, Classify, and Recommend a Path",
72
+ "promptBlocks": {
73
+ "goal": "Figure out what I actually need help with, then recommend the best path through this workflow.",
74
+ "constraints": [
75
+ [
76
+ { "kind": "ref", "refId": "wr.refs.notes_first_durability" }
77
+ ],
78
+ "Use tools to answer your own questions whenever possible.",
79
+ "Recommend a path with rationale instead of making me pick cold.",
80
+ "If the task is important, ambiguous, or easy to misframe, default to `full_spectrum` unless a narrower path will still answer the real question."
81
+ ],
82
+ "procedure": [
83
+ "Capture: `problemStatement`, `desiredOutcome`, `coreConstraints`, `antiGoals`, `primaryUncertainty`, `knownApproaches`, `importantStakeholders`, `rigorMode`, `automationLevel`, `pathRecommendation`, `pathRationale`, `designDocPath`.",
84
+ "Choose `landscape_first` when my dominant need is understanding the current landscape or comparing options. Choose `full_spectrum` when both landscape grounding and reframing are needed. Choose `design_first` when the dominant risk is solving the wrong problem or shaping the wrong concept.",
85
+ "Create or update `designDocPath` with sections for Context / Ask, Path Recommendation, Constraints / Anti-goals, Landscape Packet, Problem Frame Packet, Candidate Directions, Challenge Notes, Resolution Notes, Decision Log, and Final Summary.",
86
+ "Set these keys in the next `continue_workflow` call's `context` object: `problemStatement`, `desiredOutcome`, `coreConstraints`, `antiGoals`, `primaryUncertainty`, `knownApproaches`, `importantStakeholders`, `rigorMode`, `automationLevel`, `pathRecommendation`, `pathRationale`, `designDocPath`."
87
+ ],
88
+ "verify": [
89
+ "The chosen path is justified against the other two, not just named.",
90
+ "The design doc exists and the path recommendation is recorded there."
91
+ ]
92
+ },
93
+ "requireConfirmation": {
94
+ "or": [
95
+ { "var": "pathRecommendation", "equals": "full_spectrum" },
96
+ { "var": "rigorMode", "equals": "THOROUGH" }
97
+ ]
98
+ }
99
+ },
100
+ {
101
+ "id": "phase-0b-capability-setup",
102
+ "title": "Phase 0b: Capability and Artifact Setup",
103
+ "promptBlocks": {
104
+ "goal": "Figure out what capabilities are actually available and set up the human artifact strategy I need.",
105
+ "constraints": [
106
+ [
107
+ { "kind": "ref", "refId": "wr.refs.notes_first_durability" }
108
+ ],
109
+ "Probe capability availability through real work or explicit checks, then record the result structurally.",
110
+ "If web browsing or delegation is unavailable, keep going with the best fallback and record the gap."
111
+ ],
112
+ "procedure": [
113
+ "Observe and record `delegationAvailable` and `webBrowsingAvailable`.",
114
+ "Update `designDocPath` with the chosen artifact strategy: this doc is for people to read; notes/context remain execution truth.",
115
+ "Set these keys in the next `continue_workflow` call's `context` object: `delegationAvailable`, `webBrowsingAvailable`, `retriageNeeded`."
116
+ ],
117
+ "verify": [
118
+ "Capability fallbacks are explicit.",
119
+ "The design doc states what it is for and what it is not for."
120
+ ]
121
+ },
122
+ "requireConfirmation": false
123
+ },
124
+ {
125
+ "id": "phase-1a-landscape-first",
126
+ "title": "Phase 1a: Landscape Understanding (Landscape-first)",
127
+ "runCondition": {
128
+ "var": "pathRecommendation",
129
+ "equals": "landscape_first"
130
+ },
131
+ "promptBlocks": {
132
+ "goal": "Build the landscape understanding needed for a landscape-first pass.",
133
+ "constraints": [
134
+ [
135
+ { "kind": "ref", "refId": "wr.refs.parallelize_cognition_serialize_synthesis" }
136
+ ],
137
+ "If web browsing is available, use it for current-state grounding; otherwise fall back explicitly and mark the evidence gap.",
138
+ "Surface the main existing approaches, hard constraints, notable contradictions, and strongest evidence gaps before moving on."
139
+ ],
140
+ "procedure": [
141
+ "Gather a current-state summary, existing approaches or precedents, option categories, notable contradictions, strong constraints from the world, and evidence gaps.",
142
+ "If `delegationAvailable = true`, decide whether parallel research is likely to give you a better read here. If yes, spawn TWO WorkRail Executors SIMULTANEOUSLY running `routine-context-gathering` with focus=COMPLETENESS and focus=DEPTH, then synthesize the outputs yourself. If not, keep going yourself and record why solo work is enough.",
143
+ "Update `designDocPath` using `landscapePacketTemplate`.",
144
+ "Set these keys in the next `continue_workflow` call's `context` object: `landscapeSummary`, `landscapeGapCount`, `contradictionCount`, `precedentCount`, `retriageNeeded`."
145
+ ],
146
+ "verify": [
147
+ "Important contradictions or evidence gaps are explicit.",
148
+ "The landscape work is strong enough to support a real comparison later."
149
+ ]
150
+ },
151
+ "functionReferences": [
152
+ "landscapePacketTemplate()"
153
+ ],
154
+ "requireConfirmation": false
155
+ },
156
+ {
157
+ "id": "phase-1b-landscape-full",
158
+ "title": "Phase 1b: Landscape Understanding (Full-spectrum)",
159
+ "runCondition": {
160
+ "var": "pathRecommendation",
161
+ "equals": "full_spectrum"
162
+ },
163
+ "promptBlocks": {
164
+ "goal": "Build strong but bounded landscape understanding for a full-spectrum pass.",
165
+ "constraints": [
166
+ [
167
+ { "kind": "ref", "refId": "wr.refs.parallelize_cognition_serialize_synthesis" }
168
+ ],
169
+ "If web browsing is available, use it for current-state grounding; otherwise fall back explicitly and mark the evidence gap.",
170
+ "Go broad enough to avoid reinventing the obvious, but do not let research sprawl crowd out framing and synthesis."
171
+ ],
172
+ "procedure": [
173
+ "Gather a current-state summary, existing approaches or precedents, option categories, notable contradictions, strong constraints from the world, and evidence gaps.",
174
+ "If `delegationAvailable = true` and `rigorMode != QUICK`, decide whether parallel research is likely to sharpen the landscape meaningfully. If yes, spawn TWO WorkRail Executors SIMULTANEOUSLY running `routine-context-gathering` with focus=COMPLETENESS and focus=DEPTH, then synthesize the outputs yourself. If not, keep going yourself and record why solo work is enough.",
175
+ "Update `designDocPath` using `landscapePacketTemplate`.",
176
+ "Set these keys in the next `continue_workflow` call's `context` object: `landscapeSummary`, `landscapeGapCount`, `contradictionCount`, `precedentCount`, `retriageNeeded`."
177
+ ],
178
+ "verify": [
179
+ "Important contradictions or evidence gaps are explicit.",
180
+ "The landscape work is strong enough to ground later synthesis without turning into open-ended research."
181
+ ]
182
+ },
183
+ "functionReferences": [
184
+ "landscapePacketTemplate()"
185
+ ],
186
+ "requireConfirmation": false
187
+ },
188
+ {
189
+ "id": "phase-1c-landscape-design",
190
+ "title": "Phase 1c: Landscape Understanding (Design-first)",
191
+ "runCondition": {
192
+ "var": "pathRecommendation",
193
+ "equals": "design_first"
194
+ },
195
+ "promptBlocks": {
196
+ "goal": "Do the lightest landscape pass that still keeps the design-first work grounded.",
197
+ "constraints": [
198
+ [
199
+ { "kind": "ref", "refId": "wr.refs.parallelize_cognition_serialize_synthesis" }
200
+ ],
201
+ "Do not skip the basics: surface the main existing approaches, hard constraints, and obvious contradictions.",
202
+ "Keep this lean unless the evidence clearly says the landscape is more important than the framing."
203
+ ],
204
+ "procedure": [
205
+ "Gather a current-state summary, the main existing approaches or precedents, hard constraints from the world, obvious contradictions, and evidence gaps.",
206
+ "If `delegationAvailable = true` and `rigorMode = THOROUGH`, decide whether a parallel scan is worth the extra step. If yes, spawn bounded research support and synthesize it yourself. If not, keep going yourself and record why solo work is enough.",
207
+ "Update `designDocPath` using `landscapePacketTemplate`.",
208
+ "Set these keys in the next `continue_workflow` call's `context` object: `landscapeSummary`, `landscapeGapCount`, `contradictionCount`, `precedentCount`, `retriageNeeded`."
209
+ ],
210
+ "verify": [
211
+ "The design-first path is still grounded in reality rather than invention alone.",
212
+ "Any evidence gaps that might cap confidence later are named explicitly."
213
+ ]
214
+ },
215
+ "functionReferences": [
216
+ "landscapePacketTemplate()"
217
+ ],
218
+ "requireConfirmation": false
219
+ },
220
+ {
221
+ "id": "phase-1d-frame-landscape",
222
+ "title": "Phase 1d: Problem Frame and Stakeholders (Landscape-first)",
223
+ "runCondition": {
224
+ "var": "pathRecommendation",
225
+ "equals": "landscape_first"
226
+ },
227
+ "promptBlocks": {
228
+ "goal": "Keep the framing lean, but do not skip the people and tensions that could change the recommendation.",
229
+ "constraints": [
230
+ [
231
+ { "kind": "ref", "refId": "wr.refs.parallelize_cognition_serialize_synthesis" }
232
+ ],
233
+ "Do not silently promote assumptions into facts.",
234
+ "Even in a landscape-first pass, capture the core tension, primary stakeholders, success criteria, and what could make the framing wrong."
235
+ ],
236
+ "procedure": [
237
+ "Capture users or stakeholders, jobs or outcomes, pains or tensions, constraints that matter in lived use, success criteria, assumptions, and at least 2 reframes or HMW questions.",
238
+ "If `delegationAvailable = true` and `rigorMode = THOROUGH`, decide whether parallel stakeholder lenses would actually sharpen the result. If yes, run them in parallel. If not, keep going yourself. In either case, you must synthesize the result yourself.",
239
+ "Update `designDocPath` using `problemFrameTemplate`.",
240
+ "Set these keys in the next `continue_workflow` call's `context` object: `problemFrame`, `primaryUsers`, `tensionCount`, `successCriteriaCount`, `framingRiskCount`, `needsChallenge`, `retriageNeeded`."
241
+ ],
242
+ "verify": [
243
+ "The framing names what could still be wrong.",
244
+ "The stakeholder/problem packet covers the core tension, primary stakeholders, success criteria, and framing risk."
245
+ ]
246
+ },
247
+ "functionReferences": [
248
+ "problemFrameTemplate()"
249
+ ],
250
+ "requireConfirmation": false
251
+ },
252
+ {
253
+ "id": "phase-1e-frame-full",
254
+ "title": "Phase 1e: Problem Frame and Stakeholders (Full-spectrum)",
255
+ "runCondition": {
256
+ "var": "pathRecommendation",
257
+ "equals": "full_spectrum"
258
+ },
259
+ "promptBlocks": {
260
+ "goal": "Build a strong problem frame that can stand alongside the landscape work.",
261
+ "constraints": [
262
+ [
263
+ { "kind": "ref", "refId": "wr.refs.parallelize_cognition_serialize_synthesis" }
264
+ ],
265
+ "Do not silently promote assumptions into facts.",
266
+ "Go strong on framing here without bloating the work into ceremony."
267
+ ],
268
+ "procedure": [
269
+ "Capture users or stakeholders, jobs or outcomes, pains or tensions, constraints that matter in lived use, success criteria, assumptions, and at least 2 reframes or HMW questions.",
270
+ "If `delegationAvailable = true`, decide whether parallel stakeholder lenses would actually sharpen the result. If yes, run them in parallel. If not, keep going yourself. In either case, you must synthesize the result yourself.",
271
+ "Update `designDocPath` using `problemFrameTemplate`.",
272
+ "Set these keys in the next `continue_workflow` call's `context` object: `problemFrame`, `primaryUsers`, `tensionCount`, `successCriteriaCount`, `framingRiskCount`, `needsChallenge`, `retriageNeeded`."
273
+ ],
274
+ "verify": [
275
+ "The framing names what could still be wrong.",
276
+ "The frame is strong enough to influence candidate generation and later selection."
277
+ ]
278
+ },
279
+ "functionReferences": [
280
+ "problemFrameTemplate()"
281
+ ],
282
+ "requireConfirmation": false
283
+ },
284
+ {
285
+ "id": "phase-1f-frame-design",
286
+ "title": "Phase 1f: Problem Frame and Stakeholders (Design-first)",
287
+ "runCondition": {
288
+ "var": "pathRecommendation",
289
+ "equals": "design_first"
290
+ },
291
+ "promptBlocks": {
292
+ "goal": "Go deep on people, tensions, and framing risk before you move into solution shaping.",
293
+ "constraints": [
294
+ [
295
+ { "kind": "ref", "refId": "wr.refs.parallelize_cognition_serialize_synthesis" }
296
+ ],
297
+ "Do not silently promote assumptions into facts.",
298
+ "This is a deep framing pass. Surface the strongest tensions, success criteria, and what could make the framing wrong."
299
+ ],
300
+ "procedure": [
301
+ "Capture users or stakeholders, jobs or outcomes, pains or tensions, constraints that matter in lived use, success criteria, assumptions, and at least 2 reframes or HMW questions.",
302
+ "If `delegationAvailable = true`, decide whether parallel stakeholder lenses would actually sharpen the result. If yes, run them in parallel. If not, keep going yourself. In either case, you must synthesize the result yourself.",
303
+ "Update `designDocPath` using `problemFrameTemplate`.",
304
+ "Set these keys in the next `continue_workflow` call's `context` object: `problemFrame`, `primaryUsers`, `tensionCount`, `successCriteriaCount`, `framingRiskCount`, `needsChallenge`, `retriageNeeded`."
305
+ ],
306
+ "verify": [
307
+ "The framing names what could still be wrong.",
308
+ "The framing depth is strong enough to justify a design-first path."
309
+ ]
310
+ },
311
+ "functionReferences": [
312
+ "problemFrameTemplate()"
313
+ ],
314
+ "requireConfirmation": false
315
+ },
316
+ {
317
+ "id": "phase-1g-retriage",
318
+ "title": "Phase 1g: Re-Triage After Early Context",
319
+ "runCondition": {
320
+ "var": "retriageNeeded",
321
+ "equals": true
322
+ },
323
+ "promptBlocks": {
324
+ "goal": "Reassess the path now that you have real landscape and framing context instead of just my initial wording.",
325
+ "constraints": [
326
+ "Base the re-triage on actual evidence gathered so far, not on the original default path alone.",
327
+ "Only change the path or rigor when the center of gravity has materially shifted."
328
+ ],
329
+ "procedure": [
330
+ "Review whether the dominant uncertainty is still what you thought it was at the start.",
331
+ "Review whether `landscapeGapCount`, `contradictionCount`, or `framingRiskCount` materially change the center of gravity.",
332
+ "Review whether the task now clearly needs a prototype, more research, or a broader synthesis pass.",
333
+ "Confirm or adjust `pathRecommendation` and `rigorMode`.",
334
+ "Set `pathChangedAfterContext`, `needsPrototype`, and `needsFurtherResearch`.",
335
+ "Set these keys in the next `continue_workflow` call's `context` object: `pathRecommendation`, `rigorMode`, `pathChangedAfterContext`, `needsPrototype`, `needsFurtherResearch`."
336
+ ],
337
+ "verify": [
338
+ "Any path change is justified by the evidence gathered so far.",
339
+ "Prototype and research needs are called explicitly rather than left implicit."
340
+ ]
341
+ },
342
+ "requireConfirmation": {
343
+ "or": [
344
+ { "var": "pathChangedAfterContext", "equals": true },
345
+ { "var": "rigorMode", "equals": "THOROUGH" }
346
+ ]
347
+ }
348
+ },
349
+ {
350
+ "id": "phase-2-synthesize",
351
+ "title": "Phase 2: Synthesize the Opportunity and Decision Shape",
352
+ "promptBlocks": {
353
+ "goal": "Combine the landscape packet and problem frame into a coherent decision shape before you generate candidates.",
354
+ "constraints": [
355
+ [
356
+ { "kind": "ref", "refId": "wr.refs.synthesis_under_disagreement" }
357
+ ],
358
+ "If the landscape and framing stories disagree, treat that disagreement as first-class work.",
359
+ "State what kind of uncertainty remains: recommendation uncertainty, research uncertainty, or prototype-learning uncertainty."
360
+ ],
361
+ "procedure": [
362
+ "Produce a concise synthesis of the opportunity, the 3-5 criteria the final direction must satisfy, the strongest framing risk, and the current best explanation of what success looks like.",
363
+ "Set `candidateCountTarget` adaptively: QUICK = 2-3, STANDARD = 3-4, THOROUGH = 4-5.",
364
+ "Set these keys in the next `continue_workflow` call's `context` object: `decisionCriteria`, `riskiestAssumption`, `candidateCountTarget`, `needsPrototype`, `needsFurtherResearch`, `pathReady`."
365
+ ],
366
+ "verify": [
367
+ "You can explain why this is the right path and what a good answer must satisfy.",
368
+ "Remaining uncertainty is categorized explicitly instead of left fuzzy."
369
+ ]
370
+ },
371
+ "promptFragments": [
372
+ {
373
+ "id": "p2-challenge-needed",
374
+ "when": {
375
+ "var": "needsChallenge",
376
+ "equals": true
377
+ },
378
+ "text": "Because the framing still needs challenge, produce the strongest case against it yourself before moving on."
379
+ },
380
+ {
381
+ "id": "p2-challenge-deleg",
382
+ "when": {
383
+ "and": [
384
+ { "var": "needsChallenge", "equals": true },
385
+ { "var": "delegationAvailable", "equals": true },
386
+ { "var": "rigorMode", "not_equals": "QUICK" }
387
+ ]
388
+ },
389
+ "text": "Also decide whether a delegated challenge is worth the extra step. If yes, spawn ONE WorkRail Executor running `routine-hypothesis-challenge` against the current framing, then synthesize it yourself. If not, record why your own challenge is enough."
390
+ },
391
+ {
392
+ "id": "p2-full-balance",
393
+ "when": {
394
+ "var": "pathRecommendation",
395
+ "equals": "full_spectrum"
396
+ },
397
+ "text": "Because this is a `full_spectrum` pass, make sure the decision criteria reflect both landscape truth and stakeholder truth rather than letting one dominate the other."
398
+ },
399
+ {
400
+ "id": "p2-design-criteria",
401
+ "when": {
402
+ "var": "pathRecommendation",
403
+ "equals": "design_first"
404
+ },
405
+ "text": "Because this is a `design_first` pass, keep the criteria anchored in framing quality, tension resolution, and learning value, not just comparison of known approaches."
406
+ }
407
+ ],
408
+ "requireConfirmation": false
409
+ },
410
+ {
411
+ "id": "phase-3a-candidates-quick",
412
+ "title": "Phase 3a: Candidate Generation (QUICK)",
413
+ "runCondition": {
414
+ "var": "rigorMode",
415
+ "equals": "QUICK"
416
+ },
417
+ "promptBlocks": {
418
+ "goal": "Generate enough genuinely distinct candidates for me to support a real choice and write `design-candidates.md`.",
419
+ "constraints": [
420
+ "Create at least 2 materially different candidates, and add another if the set still clusters too tightly.",
421
+ "Include at least one runner-up strong enough that switching to it would feel real, not hypothetical."
422
+ ],
423
+ "procedure": [
424
+ "Include one simplest plausible direction and one direction that better serves the selected path's emphasis.",
425
+ "For each candidate, include the summary, why it fits the path, strongest evidence for it, strongest risk against it, and when it should win.",
426
+ "Update `designDocPath` with a short Candidate Directions section that points to the candidate set.",
427
+ "Before finishing, say what would change your mind between the top two candidates."
428
+ ],
429
+ "verify": [
430
+ "`design-candidates.md` contains a genuinely distinct quick candidate set rather than shallow variations.",
431
+ "The quick path still leaves a real choice on the table."
432
+ ]
433
+ },
434
+ "promptFragments": [
435
+ {
436
+ "id": "p3a-design-bias",
437
+ "when": {
438
+ "var": "pathRecommendation",
439
+ "equals": "design_first"
440
+ },
441
+ "text": "Because this is `design_first`, bias at least one candidate toward a stronger reframe or learning-oriented direction instead of staying too close to the current shape."
442
+ },
443
+ {
444
+ "id": "p3a-landscape-ground",
445
+ "when": {
446
+ "var": "pathRecommendation",
447
+ "equals": "landscape_first"
448
+ },
449
+ "text": "Because this is `landscape_first`, make sure at least one candidate clearly reflects what the landscape already taught you instead of inventing in a vacuum."
450
+ }
451
+ ],
452
+ "requireConfirmation": false
453
+ },
454
+ {
455
+ "id": "phase-3b-candidates-deep",
456
+ "title": "Phase 3b: Candidate Generation (Injected Routine)",
457
+ "runCondition": {
458
+ "var": "rigorMode",
459
+ "not_equals": "QUICK"
460
+ },
461
+ "promptBlocks": {
462
+ "goal": "Run the configured candidate-generation approach and produce `design-candidates.md` for me.",
463
+ "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."
466
+ ],
467
+ "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."
470
+ ],
471
+ "verify": [
472
+ "`design-candidates.md` exists and contains a genuinely differentiated candidate set rather than minor variations on one idea."
473
+ ]
474
+ },
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."
499
+ }
500
+ ],
501
+ "requireConfirmation": false
502
+ },
503
+ {
504
+ "id": "phase-3c-select-direction",
505
+ "title": "Phase 3c: Challenge and Select Direction",
506
+ "promptBlocks": {
507
+ "goal": "Read `design-candidates.md`, challenge the leading option, and make the final selection for me.",
508
+ "constraints": [
509
+ [
510
+ { "kind": "ref", "refId": "wr.refs.adversarial_challenge_rules" }
511
+ ],
512
+ "You own the selection. Candidate generation output is evidence, not the final decision.",
513
+ "If the leading option no longer looks best after challenge, switch deliberately rather than defending sunk cost."
514
+ ],
515
+ "procedure": [
516
+ "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
+ "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.",
519
+ "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
+ "Choose `selectedDirection` and `runnerUpDirection`.",
521
+ "Record `acceptedTradeoffs`, `identifiedFailureModes`, and what would trigger a switch.",
522
+ "Update `designDocPath` Decision Log with why the winner won and why the runner-up lost.",
523
+ "Set these keys in the next `continue_workflow` call's `context` object: `selectedDirection`, `runnerUpDirection`, `acceptedTradeoffs`, `identifiedFailureModes`, `hasStrongAlternative`, `needsPrototype`, `needsFurtherResearch`, `recommendationConfidenceBand`."
524
+ ],
525
+ "outputRequired": {
526
+ "notesMarkdown": "Explain the winning direction for me, the strongest alternative, and what challenge pressure changed or failed to change."
527
+ },
528
+ "verify": [
529
+ "The strongest alternative was developed enough that switching to it would feel real, not just imaginable.",
530
+ "Tradeoffs, failure modes, and switch triggers are explicit."
531
+ ]
532
+ },
533
+ "promptFragments": [
534
+ {
535
+ "id": "p3c-full-balance",
536
+ "when": {
537
+ "var": "pathRecommendation",
538
+ "equals": "full_spectrum"
539
+ },
540
+ "text": "Because this is `full_spectrum`, do not let the final choice overfit either the landscape or the framing. Make the winner earn both."
541
+ },
542
+ {
543
+ "id": "p3c-prototype-test",
544
+ "when": {
545
+ "var": "needsPrototype",
546
+ "equals": true
547
+ },
548
+ "text": "Because the work may still need a prototype, favor directions whose biggest uncertainty can be tested cleanly rather than directions that only sound convincing on paper."
549
+ }
550
+ ],
551
+ "requireConfirmation": {
552
+ "or": [
553
+ { "var": "automationLevel", "equals": "Low" },
554
+ { "var": "pathRecommendation", "equals": "full_spectrum" }
555
+ ]
556
+ }
557
+ },
558
+ {
559
+ "id": "phase-4-review-loop",
560
+ "type": "loop",
561
+ "title": "Phase 4: Direction Review Loop",
562
+ "runCondition": {
563
+ "or": [
564
+ { "var": "rigorMode", "not_equals": "QUICK" },
565
+ { "var": "pathRecommendation", "equals": "full_spectrum" },
566
+ { "var": "pathRecommendation", "equals": "design_first" }
567
+ ]
568
+ },
569
+ "loop": {
570
+ "type": "while",
571
+ "conditionSource": {
572
+ "kind": "artifact_contract",
573
+ "contractRef": "wr.contracts.loop_control",
574
+ "loopId": "discovery_direction_review_loop"
575
+ },
576
+ "maxIterations": 2
577
+ },
578
+ "body": [
579
+ {
580
+ "id": "phase-4a-review-core",
581
+ "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
+ ]
595
+ },
596
+ "requireConfirmation": false
597
+ },
598
+ {
599
+ "id": "phase-4b-review-synthesis",
600
+ "title": "Synthesize Direction Review",
601
+ "promptBlocks": {
602
+ "goal": "Read `design-review-findings.md` and decide whether the selected direction you would give me should change.",
603
+ "constraints": [
604
+ "Interpret review findings yourself rather than adopting them wholesale.",
605
+ "If the review surfaces bounded issues but not a direction change, record them as residual concerns instead of pretending the design is perfect."
606
+ ],
607
+ "procedure": [
608
+ "Compare the review findings to your own prior reasoning.",
609
+ "State what changed your mind, what did not, and why.",
610
+ "If issues are real, update `selectedDirection`, `runnerUpDirection`, `acceptedTradeoffs`, `identifiedFailureModes`, and the Decision Log in `designDocPath`.",
611
+ "Set these keys in the next `continue_workflow` call's `context` object: `directionFindings`, `directionRevised`, `needsPrototype`, `needsFurtherResearch`, `recommendationConfidenceBand`."
612
+ ],
613
+ "verify": [
614
+ "Your decision reflects synthesized judgment, not copied review output."
615
+ ]
616
+ },
617
+ "requireConfirmation": false
618
+ },
619
+ {
620
+ "id": "phase-4c-review-loop-decision",
621
+ "title": "Direction Review Loop Decision",
622
+ "promptBlocks": {
623
+ "goal": "Decide whether the direction review loop should continue.",
624
+ "constraints": [
625
+ "Base the decision on whether the selected direction materially changed or still needs another review pass."
626
+ ],
627
+ "procedure": [
628
+ "If `directionFindings` is non-empty and `directionRevised = true`, continue.",
629
+ "If review findings are only residual concerns, stop.",
630
+ "If max iterations are reached, stop and document the remaining concerns clearly.",
631
+ "Provide a `wr.loop_control` artifact with decision `continue` or `stop`."
632
+ ],
633
+ "outputRequired": {
634
+ "artifacts": "Provide a valid `wr.loop_control` artifact for the active loop."
635
+ },
636
+ "verify": [
637
+ "The loop decision matches the actual review outcome."
638
+ ]
639
+ },
640
+ "requireConfirmation": false,
641
+ "outputContract": {
642
+ "contractRef": "wr.contracts.loop_control"
643
+ }
644
+ }
645
+ ]
646
+ },
647
+ {
648
+ "id": "phase-5-resolution",
649
+ "title": "Phase 5: Choose the Uncertainty-Resolution Strategy",
650
+ "promptBlocks": {
651
+ "goal": "Decide whether you should end with a recommendation for me, a targeted research follow-up, or a prototype/test artifact.",
652
+ "constraints": [
653
+ [
654
+ { "kind": "ref", "refId": "wr.refs.adversarial_challenge_rules" }
655
+ ],
656
+ "Do the least work that can still resolve the most important remaining uncertainty. If a lighter pass would leave the main risk unresolved, do not choose it.",
657
+ "A prototype exists to falsify a direction, not to decorate it."
658
+ ],
659
+ "procedure": [
660
+ "Choose `resolutionMode` as one of: `direct_recommendation`, `research_followup`, `prototype_test`.",
661
+ "Choose `direct_recommendation` when confidence is already strong. Choose `research_followup` when the main gap is still external or current-state evidence. Choose `prototype_test` when uncertainty is best resolved by simulating the selected direction or testing reactions and behavior.",
662
+ "Set `iterationBudget`: QUICK = 1, STANDARD = 2, THOROUGH = 3.",
663
+ "Set these keys in the next `continue_workflow` call's `context` object: `resolutionMode`, `iterationBudget`, `remainingGapCount`."
664
+ ],
665
+ "verify": [
666
+ "The chosen resolution mode matches the actual remaining uncertainty.",
667
+ "You are not forcing a prototype when a recommendation is already sufficiently grounded."
668
+ ]
669
+ },
670
+ "requireConfirmation": {
671
+ "or": [
672
+ { "var": "resolutionMode", "equals": "prototype_test" },
673
+ { "var": "remainingGapCount", "gt": 0 }
674
+ ]
675
+ }
676
+ },
677
+ {
678
+ "id": "phase-5b-direct",
679
+ "title": "Phase 5b: Direct Recommendation",
680
+ "runCondition": {
681
+ "var": "resolutionMode",
682
+ "equals": "direct_recommendation"
683
+ },
684
+ "promptBlocks": {
685
+ "goal": "Turn the current work into a recommendation without adding extra resolution work that is no longer needed.",
686
+ "constraints": [
687
+ "Only take the direct path if the remaining uncertainty is low enough to justify it.",
688
+ "Be explicit about the confidence band and residual risks."
689
+ ],
690
+ "procedure": [
691
+ "Consolidate the recommendation, strongest alternative, confidence band, and residual risks in `designDocPath`.",
692
+ "Set these keys in the next `continue_workflow` call's `context` object: `finalConfidenceBand`, `residualRiskCount`, `handoffReady`."
693
+ ],
694
+ "verify": [
695
+ "The direct recommendation path is justified by the actual remaining uncertainty.",
696
+ "The handoff can proceed without pretending unresolved work has vanished."
697
+ ]
698
+ },
699
+ "requireConfirmation": false
700
+ },
701
+ {
702
+ "id": "phase-5c-research-loop",
703
+ "type": "loop",
704
+ "title": "Phase 5c: Research Follow-up Loop",
705
+ "runCondition": {
706
+ "var": "resolutionMode",
707
+ "equals": "research_followup"
708
+ },
709
+ "loop": {
710
+ "type": "while",
711
+ "conditionSource": {
712
+ "kind": "artifact_contract",
713
+ "contractRef": "wr.contracts.loop_control",
714
+ "loopId": "discovery_research_followup_loop"
715
+ },
716
+ "maxIterations": 3
717
+ },
718
+ "body": [
719
+ {
720
+ "id": "phase-5c-research-pass",
721
+ "title": "Run Research Follow-up Pass",
722
+ "promptBlocks": {
723
+ "goal": "Resolve the remaining uncertainty through targeted follow-up research.",
724
+ "constraints": [
725
+ "Gather only the missing evidence that could actually change the recommendation.",
726
+ "Do not reopen broad exploration once the workflow has already narrowed the field."
727
+ ],
728
+ "procedure": [
729
+ "Gather the missing evidence that could actually change the recommendation and update the Landscape Packet and Decision Log in `designDocPath`.",
730
+ "Update assumptions, confidence, and the recommended next action for me.",
731
+ "Set these keys in the next `continue_workflow` call's `context` object: `resolutionInsightCount`, `invalidatedAssumptionCount`, `remainingGapCount`, `resolutionContinueRecommended`, `recommendationConfidenceBand`."
732
+ ],
733
+ "outputRequired": {
734
+ "notesMarkdown": "Summarize what the research follow-up taught you and how it changed the recommendation."
735
+ },
736
+ "verify": [
737
+ "The pass materially addressed a real missing evidence gap."
738
+ ]
739
+ },
740
+ "requireConfirmation": false
741
+ },
742
+ {
743
+ "id": "phase-5c-research-decision",
744
+ "title": "Research Follow-up Loop Decision",
745
+ "promptBlocks": {
746
+ "goal": "Decide whether the research follow-up loop should continue.",
747
+ "constraints": [
748
+ "Continue only when a meaningful evidence gap still exists and another cheap pass is likely to matter."
749
+ ],
750
+ "procedure": [
751
+ "Continue if `resolutionContinueRecommended = true`, `remainingGapCount > 0`, and budget remains.",
752
+ "Stop if confidence is now sufficient or further cheap research is unlikely to change the recommendation.",
753
+ "Provide a `wr.loop_control` artifact with decision `continue` or `stop`."
754
+ ],
755
+ "outputRequired": {
756
+ "artifacts": "Provide a valid `wr.loop_control` artifact for the active loop."
757
+ },
758
+ "verify": [
759
+ "The loop decision reflects both the remaining evidence gap and the likely value of another pass."
760
+ ]
761
+ },
762
+ "requireConfirmation": false,
763
+ "outputContract": {
764
+ "contractRef": "wr.contracts.loop_control"
765
+ }
766
+ }
767
+ ]
768
+ },
769
+ {
770
+ "id": "phase-5d-prototype-loop",
771
+ "type": "loop",
772
+ "title": "Phase 5d: Prototype/Test Loop",
773
+ "runCondition": {
774
+ "var": "resolutionMode",
775
+ "equals": "prototype_test"
776
+ },
777
+ "loop": {
778
+ "type": "while",
779
+ "conditionSource": {
780
+ "kind": "artifact_contract",
781
+ "contractRef": "wr.contracts.loop_control",
782
+ "loopId": "discovery_prototype_test_loop"
783
+ },
784
+ "maxIterations": 3
785
+ },
786
+ "body": [
787
+ {
788
+ "id": "phase-5d-prototype-pass",
789
+ "title": "Run Prototype/Test Pass",
790
+ "promptBlocks": {
791
+ "goal": "Resolve the remaining uncertainty through a prototype or test pass.",
792
+ "constraints": [
793
+ "Do the smallest test that can still falsify the direction or give it real support.",
794
+ "When using prototype-oriented validation, favor falsification over persuasion."
795
+ ],
796
+ "procedure": [
797
+ "Create or update a minimal prototype/test spec in `designDocPath` using `prototypeSpecTemplate`, then run the cheapest test that can still falsify the direction or give it real support.",
798
+ "Capture what worked, what failed, and what would falsify it.",
799
+ "Update assumptions, confidence, and the recommended next action for me.",
800
+ "Set these keys in the next `continue_workflow` call's `context` object: `resolutionInsightCount`, `invalidatedAssumptionCount`, `remainingGapCount`, `resolutionContinueRecommended`, `recommendationConfidenceBand`."
801
+ ],
802
+ "outputRequired": {
803
+ "notesMarkdown": "Summarize what the prototype or test pass taught you and how it changed the recommendation."
804
+ },
805
+ "verify": [
806
+ "The pass materially addressed the selected remaining uncertainty."
807
+ ]
808
+ },
809
+ "functionReferences": [
810
+ "prototypeSpecTemplate()"
811
+ ],
812
+ "requireConfirmation": false
813
+ },
814
+ {
815
+ "id": "phase-5d-prototype-decision",
816
+ "title": "Prototype/Test Loop Decision",
817
+ "promptBlocks": {
818
+ "goal": "Decide whether the prototype/test loop should continue.",
819
+ "constraints": [
820
+ "Continue only when a meaningful remaining gap still exists and cheap learning remains available."
821
+ ],
822
+ "procedure": [
823
+ "Continue if `resolutionContinueRecommended = true`, `remainingGapCount > 0`, and budget remains.",
824
+ "Stop if confidence is now sufficient, the top direction was falsified, or more cheap learning is not realistically available.",
825
+ "Provide a `wr.loop_control` artifact with decision `continue` or `stop`."
826
+ ],
827
+ "outputRequired": {
828
+ "artifacts": "Provide a valid `wr.loop_control` artifact for the active loop."
829
+ },
830
+ "verify": [
831
+ "The loop decision reflects both remaining uncertainty and budget reality."
832
+ ]
833
+ },
834
+ "requireConfirmation": false,
835
+ "outputContract": {
836
+ "contractRef": "wr.contracts.loop_control"
837
+ }
838
+ }
839
+ ]
840
+ },
841
+ {
842
+ "id": "phase-6-validate",
843
+ "title": "Phase 6: Final Validation",
844
+ "promptBlocks": {
845
+ "goal": "Validate that you are ending with the right level of confidence and the right caveats for me.",
846
+ "constraints": [
847
+ [
848
+ { "kind": "ref", "refId": "wr.refs.synthesis_under_disagreement" }
849
+ ],
850
+ "Do not claim certainty you do not have.",
851
+ "If important contradictions or gaps remain, downgrade confidence and say so explicitly."
852
+ ],
853
+ "procedure": [
854
+ "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.",
856
+ "Set these keys in the next `continue_workflow` call's `context` object: `finalConfidenceBand`, `residualRiskCount`, `handoffReady`."
857
+ ],
858
+ "verify": [
859
+ "The confidence band matches the evidence quality and remaining risks.",
860
+ "The handoff is recommendation-ready, not just thought-complete."
861
+ ]
862
+ },
863
+ "promptFragments": [
864
+ {
865
+ "id": "p6-prototype-caveats",
866
+ "when": {
867
+ "var": "resolutionMode",
868
+ "equals": "prototype_test"
869
+ },
870
+ "text": "Because this recommendation came through a prototype/test path, make sure the final caveats clearly distinguish what was learned from what is still inferred."
871
+ },
872
+ {
873
+ "id": "p6-research-caveats",
874
+ "when": {
875
+ "var": "resolutionMode",
876
+ "equals": "research_followup"
877
+ },
878
+ "text": "Because this recommendation came through a research-follow-up path, make sure the final caveats clearly distinguish what is grounded in evidence from what still rests on interpretation."
879
+ },
880
+ {
881
+ "id": "p6-design-grounding",
882
+ "when": {
883
+ "var": "pathRecommendation",
884
+ "equals": "design_first"
885
+ },
886
+ "text": "Because this was a `design_first` path, double-check that the final recommendation is still grounded enough in the outside world and not only in internal coherence."
887
+ }
888
+ ],
889
+ "requireConfirmation": false
890
+ },
891
+ {
892
+ "id": "phase-7-handoff",
893
+ "title": "Phase 7: Final Handoff",
894
+ "promptBlocks": {
895
+ "goal": "Finalize the design doc and deliver a clear recommendation, artifact, or next-step direction to me.",
896
+ "constraints": [
897
+ [
898
+ { "kind": "ref", "refId": "wr.refs.notes_first_durability" }
899
+ ],
900
+ "Keep the final chat output concise.",
901
+ "Do not drift into production implementation planning beyond high-level next actions."
902
+ ],
903
+ "procedure": [
904
+ "Update `designDocPath` with a final summary containing the selected path, problem framing, landscape takeaways, chosen direction, strongest alternative, why it lost, confidence band, residual risks, and next actions.",
905
+ "In the final chat output, tell me the selected path, the chosen direction, the key reason it won, and where to find `designDocPath`."
906
+ ],
907
+ "verify": [
908
+ "The design doc reads like a coherent human artifact.",
909
+ "The final answer tells me what to do next or what was learned."
910
+ ]
911
+ },
912
+ "requireConfirmation": true
913
+ }
914
+ ]
915
+ }