@exaudeus/workrail 3.27.0 → 3.29.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 (160) hide show
  1. package/dist/console/assets/{index-FtTaDku8.js → index-BZ6HkxGf.js} +1 -1
  2. package/dist/console/index.html +1 -1
  3. package/dist/manifest.json +3 -3
  4. package/docs/README.md +57 -0
  5. package/docs/adrs/001-hybrid-storage-backend.md +38 -0
  6. package/docs/adrs/002-four-layer-context-classification.md +38 -0
  7. package/docs/adrs/003-checkpoint-trigger-strategy.md +35 -0
  8. package/docs/adrs/004-opt-in-encryption-strategy.md +36 -0
  9. package/docs/adrs/005-agent-first-workflow-execution-tokens.md +105 -0
  10. package/docs/adrs/006-append-only-session-run-event-log.md +76 -0
  11. package/docs/adrs/007-resume-and-checkpoint-only-sessions.md +51 -0
  12. package/docs/adrs/008-blocked-nodes-architectural-upgrade.md +178 -0
  13. package/docs/adrs/009-bridge-mode-single-instance-mcp.md +195 -0
  14. package/docs/adrs/010-release-pipeline.md +89 -0
  15. package/docs/architecture/README.md +7 -0
  16. package/docs/architecture/refactor-audit.md +364 -0
  17. package/docs/authoring-v2.md +527 -0
  18. package/docs/authoring.md +873 -0
  19. package/docs/changelog-recent.md +201 -0
  20. package/docs/configuration.md +505 -0
  21. package/docs/ctc-mcp-proposal.md +518 -0
  22. package/docs/design/README.md +22 -0
  23. package/docs/design/agent-cascade-protocol.md +96 -0
  24. package/docs/design/autonomous-console-design-candidates.md +253 -0
  25. package/docs/design/autonomous-console-design-review.md +111 -0
  26. package/docs/design/autonomous-platform-mvp-discovery.md +525 -0
  27. package/docs/design/claude-code-source-deep-dive.md +713 -0
  28. package/docs/design/console-cyberpunk-ui-discovery.md +504 -0
  29. package/docs/design/console-execution-trace-candidates-final.md +160 -0
  30. package/docs/design/console-execution-trace-candidates.md +211 -0
  31. package/docs/design/console-execution-trace-design-candidates-v2.md +113 -0
  32. package/docs/design/console-execution-trace-design-review.md +74 -0
  33. package/docs/design/console-execution-trace-discovery.md +394 -0
  34. package/docs/design/console-execution-trace-final-review.md +77 -0
  35. package/docs/design/console-execution-trace-review.md +92 -0
  36. package/docs/design/console-performance-discovery.md +415 -0
  37. package/docs/design/console-ui-backlog.md +280 -0
  38. package/docs/design/daemon-architecture-discovery.md +853 -0
  39. package/docs/design/daemon-design-candidates.md +318 -0
  40. package/docs/design/daemon-design-review-findings.md +119 -0
  41. package/docs/design/daemon-engine-design-candidates.md +210 -0
  42. package/docs/design/daemon-engine-design-review.md +131 -0
  43. package/docs/design/daemon-execution-engine-discovery.md +280 -0
  44. package/docs/design/daemon-gap-analysis.md +554 -0
  45. package/docs/design/daemon-owns-console-plan.md +168 -0
  46. package/docs/design/daemon-owns-console-review.md +91 -0
  47. package/docs/design/daemon-owns-console.md +195 -0
  48. package/docs/design/data-model-erd.md +11 -0
  49. package/docs/design/design-candidates-consolidate-dev-staleness.md +98 -0
  50. package/docs/design/design-candidates-walk-cache-depth-limit.md +80 -0
  51. package/docs/design/design-review-consolidate-dev-staleness.md +54 -0
  52. package/docs/design/design-review-walk-cache-depth-limit.md +48 -0
  53. package/docs/design/implementation-plan-consolidate-dev-staleness.md +142 -0
  54. package/docs/design/implementation-plan-walk-cache-depth-limit.md +141 -0
  55. package/docs/design/layer3b-ghost-nodes-design-candidates.md +229 -0
  56. package/docs/design/layer3b-ghost-nodes-design-review.md +93 -0
  57. package/docs/design/layer3b-ghost-nodes-implementation-plan.md +219 -0
  58. package/docs/design/list-workflows-latency-fix-plan.md +128 -0
  59. package/docs/design/list-workflows-latency-fix-review.md +55 -0
  60. package/docs/design/list-workflows-latency-fix.md +109 -0
  61. package/docs/design/native-context-management-api.md +11 -0
  62. package/docs/design/performance-sweep-2026-04.md +96 -0
  63. package/docs/design/routines-guide.md +219 -0
  64. package/docs/design/sequence-diagrams.md +11 -0
  65. package/docs/design/subagent-design-principles.md +220 -0
  66. package/docs/design/temporal-patterns-design-candidates.md +312 -0
  67. package/docs/design/temporal-patterns-design-review-findings.md +163 -0
  68. package/docs/design/test-isolation-from-config-file.md +335 -0
  69. package/docs/design/v2-core-design-locks.md +2746 -0
  70. package/docs/design/v2-lock-registry.json +734 -0
  71. package/docs/design/workflow-authoring-v2.md +1044 -0
  72. package/docs/design/workflow-docs-spec.md +218 -0
  73. package/docs/design/workflow-extension-points.md +687 -0
  74. package/docs/design/workrail-auto-trigger-system.md +359 -0
  75. package/docs/design/workrail-config-file-discovery.md +513 -0
  76. package/docs/docker.md +110 -0
  77. package/docs/generated/v2-lock-closure-plan.md +26 -0
  78. package/docs/generated/v2-lock-coverage.json +797 -0
  79. package/docs/generated/v2-lock-coverage.md +177 -0
  80. package/docs/ideas/backlog.md +3927 -0
  81. package/docs/ideas/design-candidates-mcp-resilience.md +208 -0
  82. package/docs/ideas/design-review-findings-mcp-resilience.md +119 -0
  83. package/docs/ideas/implementation_plan.md +249 -0
  84. package/docs/ideas/third-party-workflow-setup-design-thinking.md +1948 -0
  85. package/docs/implementation/02-architecture.md +316 -0
  86. package/docs/implementation/04-testing-strategy.md +124 -0
  87. package/docs/implementation/09-simple-workflow-guide.md +835 -0
  88. package/docs/implementation/13-advanced-validation-guide.md +874 -0
  89. package/docs/implementation/README.md +21 -0
  90. package/docs/integrations/claude-code.md +300 -0
  91. package/docs/integrations/firebender.md +315 -0
  92. package/docs/migration/v0.1.0.md +147 -0
  93. package/docs/naming-conventions.md +45 -0
  94. package/docs/planning/README.md +104 -0
  95. package/docs/planning/github-ticketing-playbook.md +195 -0
  96. package/docs/plans/README.md +24 -0
  97. package/docs/plans/agent-managed-ticketing-design.md +605 -0
  98. package/docs/plans/agentic-orchestration-roadmap.md +112 -0
  99. package/docs/plans/assessment-gates-engine-handoff.md +536 -0
  100. package/docs/plans/content-coherence-and-references.md +151 -0
  101. package/docs/plans/library-extraction-plan.md +340 -0
  102. package/docs/plans/mr-review-workflow-redesign.md +1451 -0
  103. package/docs/plans/native-context-management-epic.md +11 -0
  104. package/docs/plans/perf-fixes-design-candidates.md +225 -0
  105. package/docs/plans/perf-fixes-design-review-findings.md +61 -0
  106. package/docs/plans/perf-fixes-new-issues-candidates.md +264 -0
  107. package/docs/plans/perf-fixes-new-issues-review.md +110 -0
  108. package/docs/plans/prompt-fragments.md +53 -0
  109. package/docs/plans/ui-ux-workflow-design-candidates.md +120 -0
  110. package/docs/plans/ui-ux-workflow-discovery.md +100 -0
  111. package/docs/plans/ui-ux-workflow-review.md +48 -0
  112. package/docs/plans/v2-followup-enhancements.md +587 -0
  113. package/docs/plans/workflow-categories-candidates.md +105 -0
  114. package/docs/plans/workflow-categories-discovery.md +110 -0
  115. package/docs/plans/workflow-categories-review.md +51 -0
  116. package/docs/plans/workflow-discovery-model-candidates.md +94 -0
  117. package/docs/plans/workflow-discovery-model-discovery.md +74 -0
  118. package/docs/plans/workflow-discovery-model-review.md +48 -0
  119. package/docs/plans/workflow-source-setup-phase-1.md +245 -0
  120. package/docs/plans/workflow-source-setup-phase-2.md +361 -0
  121. package/docs/plans/workflow-staleness-detection-candidates.md +104 -0
  122. package/docs/plans/workflow-staleness-detection-review.md +58 -0
  123. package/docs/plans/workflow-staleness-detection.md +80 -0
  124. package/docs/plans/workflow-v2-design.md +69 -0
  125. package/docs/plans/workflow-v2-roadmap.md +74 -0
  126. package/docs/plans/workflow-validation-design.md +98 -0
  127. package/docs/plans/workflow-validation-roadmap.md +108 -0
  128. package/docs/plans/workrail-platform-vision.md +420 -0
  129. package/docs/reference/agent-context-cleaner-snippet.md +94 -0
  130. package/docs/reference/agent-context-guidance.md +140 -0
  131. package/docs/reference/context-optimization.md +284 -0
  132. package/docs/reference/example-workflow-repository-template/.github/workflows/validate.yml +125 -0
  133. package/docs/reference/example-workflow-repository-template/README.md +268 -0
  134. package/docs/reference/example-workflow-repository-template/workflows/example-workflow.json +80 -0
  135. package/docs/reference/external-workflow-repositories.md +916 -0
  136. package/docs/reference/feature-flags-architecture.md +472 -0
  137. package/docs/reference/feature-flags.md +349 -0
  138. package/docs/reference/god-tier-workflow-validation.md +272 -0
  139. package/docs/reference/loop-optimization.md +209 -0
  140. package/docs/reference/loop-validation.md +176 -0
  141. package/docs/reference/loops.md +465 -0
  142. package/docs/reference/mcp-platform-constraints.md +59 -0
  143. package/docs/reference/recovery.md +88 -0
  144. package/docs/reference/releases.md +177 -0
  145. package/docs/reference/troubleshooting.md +105 -0
  146. package/docs/reference/workflow-execution-contract.md +998 -0
  147. package/docs/roadmap/README.md +22 -0
  148. package/docs/roadmap/legacy-planning-status.md +103 -0
  149. package/docs/roadmap/now-next-later.md +70 -0
  150. package/docs/roadmap/open-work-inventory.md +389 -0
  151. package/docs/tickets/README.md +39 -0
  152. package/docs/tickets/next-up.md +76 -0
  153. package/docs/workflow-management.md +317 -0
  154. package/docs/workflow-templates.md +423 -0
  155. package/docs/workflow-validation.md +184 -0
  156. package/docs/workflows.md +254 -0
  157. package/package.json +3 -1
  158. package/spec/authoring-spec.json +61 -16
  159. package/workflows/workflow-for-workflows.json +252 -93
  160. package/workflows/workflow-for-workflows.v2.json +188 -77
@@ -0,0 +1,605 @@
1
+ # Single-Dev Ticketing with Agents
2
+
3
+ This is the **live design doc** for a lightweight ticketing system that works well for a **single developer using agents**.
4
+
5
+ Use this doc to refine:
6
+
7
+ - how work is captured and promoted
8
+ - what role agents should play in ticket management
9
+ - how GitHub issues should be structured
10
+ - how much autonomy agents should have over prioritization, execution, and closure
11
+
12
+ ## Goal
13
+
14
+ Create a ticketing system that is:
15
+
16
+ - lightweight enough for one developer
17
+ - explicit enough for agents when they are asked to help
18
+ - easy to operate from the GitHub CLI
19
+ - hard for agents to misinterpret or over-manage
20
+
21
+ ## Non-goals
22
+
23
+ - recreating a heavyweight project-management system
24
+ - building a full scrum workflow
25
+ - making agents responsible for product strategy
26
+ - treating every idea as a GitHub issue
27
+
28
+ ## Current operating mode
29
+
30
+ Right now this design assumes:
31
+
32
+ - the developer chooses what to work on
33
+ - agents do **not** autonomously browse the backlog and pick tickets
34
+ - agents are **assistant executors/shapers**, not autonomous backlog managers
35
+
36
+ That means the system should optimize for **human-directed, agent-assisted** work first, while leaving room for a stricter future mode if autonomous agent pickup is introduced later.
37
+
38
+ ## Core problem
39
+
40
+ A system that works for a human alone is often **too implicit** for agents.
41
+
42
+ Humans tolerate:
43
+
44
+ - fuzzy status
45
+ - soft priorities
46
+ - incomplete acceptance criteria
47
+ - informal “I know what I mean” issue bodies
48
+
49
+ Agents do not handle those gaps well. If agents browse and manage the work, ambiguity turns into:
50
+
51
+ - bad prioritization
52
+ - premature execution
53
+ - over-creation of tickets
54
+ - accidental scope expansion
55
+ - false claims of completion
56
+
57
+ ## Design principles
58
+
59
+ ### 1. Lightweight for the human, strict for the agent
60
+
61
+ The system should minimize ceremony for the developer while making ticket state and execution readiness explicit enough for an agent to act safely.
62
+
63
+ ### 2. Separate capture from execution
64
+
65
+ Not every thought should become a ticket.
66
+
67
+ Use:
68
+
69
+ - **ideas** for raw capture
70
+ - **GitHub issues** for work that is concrete enough to track
71
+ - **pull requests** for execution records
72
+
73
+ ### 3. Readiness must be machine-legible
74
+
75
+ Agents need a clear answer to:
76
+
77
+ - may I start?
78
+ - what counts as done?
79
+ - what requires a human decision first?
80
+
81
+ ### 4. Human owns priority and product intent
82
+
83
+ Agents may help **draft, refine, and execute**, but they should not silently become product managers.
84
+
85
+ ### 5. Done must be concrete
86
+
87
+ Tickets should define completion in a way an agent can verify, not just narrate.
88
+
89
+ ## Two-phase model
90
+
91
+ ### Phase 1: Human-directed, agent-assisted
92
+
93
+ This is the **current target**.
94
+
95
+ Characteristics:
96
+
97
+ - you decide what to work on
98
+ - you point an agent at an issue when useful
99
+ - agents help shape, implement, and summarize
100
+ - agents do **not** independently curate the backlog
101
+
102
+ ### Phase 2: Agent-managed backlog
103
+
104
+ This is **future work**, not the current recommendation.
105
+
106
+ Characteristics:
107
+
108
+ - agents may browse the backlog directly
109
+ - agents may propose or manage readiness/state transitions
110
+ - the ticket system must become more machine-legible and permissioned
111
+
112
+ This phase needs stricter lifecycle semantics, clearer authority boundaries, and tighter closure rules than Phase 1.
113
+
114
+ ### Future supervised execution loop
115
+
116
+ A likely intermediate step before full autonomous backlog management is a **supervised execution loop**:
117
+
118
+ - the agent reads the local GitHub/ticketing docs
119
+ - the agent inspects GitHub issues labeled as viable candidates (for example `next`)
120
+ - the agent suggests one ticket to the developer
121
+ - the developer approves or rejects the suggestion
122
+ - after approval, the agent executes the issue through WorkRail
123
+ - the agent opens the PR, watches checks, and reports status
124
+ - merge behavior stays explicitly policy-controlled
125
+
126
+ This is different from a fully autonomous backlog agent because the human still approves:
127
+
128
+ - which issue gets worked
129
+ - whether execution should start now
130
+ - whether merge authority is delegated
131
+
132
+ This future mode likely needs:
133
+
134
+ - a ticket selection policy
135
+ - a clear approval gate before execution
136
+ - a mapping from GitHub issue fields into a WorkRail task workflow
137
+ - a PR/check watcher
138
+ - explicit merge policy
139
+
140
+ ## Implemented Phase 1 artifacts
141
+
142
+ - `.github/ISSUE_TEMPLATE/work-item.yml`
143
+ - `.github/pull_request_template.md`
144
+ - `docs/planning/github-ticketing-playbook.md`
145
+
146
+ ## Recommended system model
147
+
148
+ ### Layer 1: Ideas
149
+
150
+ Use local docs for:
151
+
152
+ - raw ideas
153
+ - half-formed observations
154
+ - things that are worth remembering but not ready for execution
155
+
156
+ Current home:
157
+
158
+ - `docs/ideas/backlog.md`
159
+
160
+ ### Layer 2: GitHub issues
161
+
162
+ Use GitHub issues for:
163
+
164
+ - work that is real enough to potentially do
165
+ - bugs with enough detail to investigate
166
+ - features with a clear problem and goal
167
+ - chores that have a meaningful completion condition
168
+
169
+ ### Layer 3: Pull requests
170
+
171
+ Use pull requests for:
172
+
173
+ - the implementation record
174
+ - review
175
+ - closure of the associated issue
176
+
177
+ ## Recommended lifecycle for Phase 1
178
+
179
+ Keep the current lifecycle simple:
180
+
181
+ - **`next`** — good candidate for upcoming work
182
+ - **`active`** — currently being worked
183
+ - **`blocked`** — cannot proceed
184
+
185
+ Everything else can remain implicit in the issue body for now.
186
+
187
+ ## Phase 1A: Concrete operating contract
188
+
189
+ This section is the **current implementation target** for the human-directed, agent-assisted mode.
190
+
191
+ ### 1. When to create a GitHub issue
192
+
193
+ Create a GitHub issue when at least one of these is true:
194
+
195
+ - it is a real candidate for near- or medium-term work
196
+ - it is a confirmed bug with enough detail to investigate
197
+ - it is follow-up work discovered during active implementation that should not be lost
198
+ - the developer explicitly wants the work tracked in GitHub
199
+
200
+ Rule of thumb:
201
+
202
+ - if you would plausibly work on it in the next few weeks, or need to preserve it as real follow-up work, it can be an issue
203
+
204
+ Do **not** create a GitHub issue for:
205
+
206
+ - raw ideas that are still fuzzy
207
+ - tiny observations that do not yet justify execution tracking
208
+ - speculative product thoughts with no current intent to act
209
+
210
+ Those should stay in:
211
+
212
+ - `docs/ideas/backlog.md`
213
+
214
+ #### Agent issue creation in Phase 1
215
+
216
+ Agents may always:
217
+
218
+ - draft issue bodies
219
+
220
+ Agents may create an issue directly only when one of these is true:
221
+
222
+ - the developer explicitly asked for the issue to be created
223
+ - the work is a confirmed bug with enough context to be tracked
224
+ - the work is important follow-up discovered during active execution and is likely to be lost otherwise
225
+
226
+ ### 2. Minimal Phase 1 labels
227
+
228
+ Use only:
229
+
230
+ - **type**: `feature`, `bug`, `chore`
231
+ - **state**: `next`, `active`, `blocked`
232
+
233
+ Do not add more labels in Phase 1 unless the current set proves insufficient in practice.
234
+
235
+ ### 3. Minimum issue body
236
+
237
+ Every issue intended for execution should contain:
238
+
239
+ - **Problem**
240
+ - **Goal**
241
+ - **Acceptance criteria**
242
+ - **Verification**
243
+ - **Non-goals**
244
+ - **Context**
245
+
246
+ And, if an agent might be asked to execute it:
247
+
248
+ - **Agent execution note**
249
+
250
+ Phase 1 minimum quality bar:
251
+
252
+ - at least one acceptance criterion
253
+ - at least one verification step
254
+ - explicit non-goals or `none`
255
+ - enough context that the developer could hand the issue to an agent without additional reconstruction
256
+
257
+ ### 4. What qualifies for `next`
258
+
259
+ An issue should get `next` only when:
260
+
261
+ - the problem is understandable
262
+ - the goal is understandable
263
+ - acceptance criteria exist
264
+ - verification exists
265
+ - non-goals exist
266
+ - there is no unresolved decision blocking normal execution
267
+
268
+ `next` means:
269
+
270
+ - this is a serious candidate for upcoming work
271
+ - if the developer points an agent at it, the agent should have enough structure to proceed
272
+
273
+ ### 5. What qualifies for `blocked`
274
+
275
+ Use `blocked` when work cannot reasonably continue because of:
276
+
277
+ - missing required context
278
+ - an unresolved decision
279
+ - dependency on another change
280
+ - a failing prerequisite outside the current issue
281
+
282
+ When something becomes blocked, the issue should get:
283
+
284
+ - a short comment explaining **what is blocked**
285
+ - the **kind of block** (`decision`, `dependency`, `context`, or `external/tooling`)
286
+ - the **next thing needed** to unblock it
287
+
288
+ ### 6. Closure rule for Phase 1
289
+
290
+ An issue should be closed only when one of these is true:
291
+
292
+ - a PR landed and the acceptance criteria were actually satisfied
293
+ - the issue was intentionally closed with a clear no-code resolution
294
+ - the issue was superseded by another explicitly linked issue
295
+
296
+ Before closure, verify:
297
+
298
+ - acceptance criteria were met
299
+ - verification was actually performed
300
+ - scope did not silently expand past the non-goals
301
+
302
+ Default closure ownership:
303
+
304
+ - the developer closes issues by default
305
+ - an agent may close an issue only when closure is clearly mechanical and the verification is explicit
306
+
307
+ ### 7. Current agent permissions
308
+
309
+ In Phase 1, agents may:
310
+
311
+ - draft issue bodies
312
+ - refine issue structure
313
+ - suggest that something should become `next`
314
+ - mark a ticket `active` when explicitly asked to work on it
315
+ - mark a ticket `blocked` with an explanation
316
+ - implement a ticket the developer explicitly handed them
317
+ - open a PR linked to the issue
318
+
319
+ In Phase 1, agents should **not**:
320
+
321
+ - freely browse and pick backlog work on their own
322
+ - invent priority
323
+ - create large numbers of new issues from minor observations
324
+ - close issues unless completion is clear and verification is explicit
325
+
326
+ ### 8. Default single-dev rule
327
+
328
+ Default operating stance:
329
+
330
+ - many ideas
331
+ - small number of GitHub issues
332
+ - small `next` set
333
+ - usually one `active` issue
334
+
335
+ ### 9. Phase 1 defaults checklist
336
+
337
+ Use this as the default operating checklist:
338
+
339
+ - ideas stay in docs until they are concrete enough to track
340
+ - issues are for real work, confirmed bugs, or important follow-up
341
+ - labels stay minimal: `feature|bug|chore` and `next|active|blocked`
342
+ - `next` stays small
343
+ - `blocked` always gets a short explanatory comment
344
+ - the developer chooses what becomes active
345
+ - agents help when explicitly pointed at a ticket
346
+
347
+ ### Deferred lifecycle for Phase 2
348
+
349
+ If agents later start browsing and picking up work autonomously, introduce a stricter lifecycle:
350
+
351
+ - `inbox`
352
+ - `shaped`
353
+ - `ready`
354
+ - `active`
355
+ - `blocked`
356
+ - `done`
357
+
358
+ And add an explicit `decision-needed` control state.
359
+
360
+ ## Recommended authority split
361
+
362
+ ### Human-owned
363
+
364
+ - prioritization
365
+ - promotion from idea to issue
366
+ - final product decisions
367
+ - scope changes that alter user intent
368
+ - deciding whether ambiguous work is actually done
369
+
370
+ ### Agent-owned
371
+
372
+ - drafting issues
373
+ - refining issue structure
374
+ - updating progress/comments
375
+ - implementing work that you explicitly hand them
376
+ - opening pull requests
377
+ - linking PRs to issues
378
+
379
+ ### Agent-restricted
380
+
381
+ Agents should **not** freely:
382
+
383
+ - create many tickets from every small observation
384
+ - reprioritize the backlog
385
+ - close ambiguous tickets without explicit verification
386
+
387
+ ## Recommended GitHub label set
388
+
389
+ Keep the label set small.
390
+
391
+ ### Work type
392
+
393
+ - `feature`
394
+ - `bug`
395
+ - `chore`
396
+
397
+ ### State
398
+
399
+ - `next`
400
+ - `active`
401
+ - `blocked`
402
+
403
+ ### Optional later labels
404
+
405
+ These are useful only if backlog-managing agents become real later:
406
+
407
+ - `decision-needed`
408
+ - `ready`
409
+ - `agent-ok`
410
+ - `human-check`
411
+
412
+ ## Recommended ticket schema
413
+
414
+ Every execution-oriented GitHub issue should have:
415
+
416
+ ### Problem
417
+
418
+ What is wrong, missing, or confusing?
419
+
420
+ ### Goal
421
+
422
+ What outcome do we want?
423
+
424
+ ### Acceptance criteria
425
+
426
+ What must be true for this to count as done?
427
+
428
+ ### Verification
429
+
430
+ How should completion be checked?
431
+
432
+ ### Non-goals
433
+
434
+ What is intentionally out of scope?
435
+
436
+ ### Context
437
+
438
+ Relevant files, docs, prior issues, PRs, or design notes.
439
+
440
+ ### Agent execution note
441
+
442
+ For Phase 1, keep this light:
443
+
444
+ - **Can an agent take this if I point them at it?** yes/no
445
+ - **Anything the agent should avoid?**
446
+
447
+ Save the heavier autonomy contract for Phase 2.
448
+
449
+ ## Recommended issue template for Phase 1
450
+
451
+ ```md
452
+ ## Problem
453
+
454
+ ## Goal
455
+
456
+ ## Acceptance criteria
457
+ - [ ]
458
+
459
+ ## Verification
460
+ - [ ]
461
+
462
+ ## Non-goals
463
+ -
464
+
465
+ ## Context
466
+ -
467
+
468
+ ## Agent execution note
469
+ - Can an agent take this if I explicitly hand it over: yes/no
470
+ - Avoid:
471
+ ```
472
+
473
+ ## Recommended promotion rules
474
+
475
+ ### Idea → issue
476
+
477
+ Promote an idea into a GitHub issue when:
478
+
479
+ - it is likely real work
480
+ - the problem is understandable
481
+ - there is enough context to shape it
482
+
483
+ ### Issue → next
484
+
485
+ A ticket becomes `next` when:
486
+
487
+ - the problem is clear enough
488
+ - the goal is clear enough
489
+ - acceptance criteria exist
490
+ - non-goals exist
491
+
492
+ ### Next → active
493
+
494
+ Only one ticket should usually be `active` at a time for a single developer unless there is a very intentional reason otherwise.
495
+
496
+ ## Recommended single-dev operating model
497
+
498
+ ### Inbox
499
+
500
+ Raw ideas and newly created issues.
501
+
502
+ ### Next
503
+
504
+ Small set of `next` tickets.
505
+
506
+ ### Active
507
+
508
+ Usually one ticket.
509
+
510
+ ### Done
511
+
512
+ Closed issues with a linked PR or explicit closure rationale.
513
+
514
+ ## How agents should manage it
515
+
516
+ ### Good agent behaviors in Phase 1
517
+
518
+ - draft or refine tickets from rough notes
519
+ - ask for shaping when a ticket is not actually clear enough
520
+ - execute only work you explicitly point them at
521
+ - update the issue with progress and blockers
522
+ - open a PR that closes the issue
523
+
524
+ ### Bad agent behaviors
525
+
526
+ - interpreting vague notes as permission to implement
527
+ - inventing priority
528
+ - silently expanding scope
529
+ - creating too many tickets from minor observations
530
+ - closing work based on partial implementation plus persuasive prose
531
+
532
+ ## GitHub CLI flow
533
+
534
+ ### Shaping
535
+
536
+ - create issue with `gh issue create`
537
+ - inspect/refine with `gh issue view`
538
+ - comment or edit as the shape improves
539
+
540
+ ### Execution
541
+
542
+ - pick the issue you explicitly want to work on
543
+ - implement
544
+ - open PR with `gh pr create`
545
+ - link PR to issue
546
+
547
+ ### Closure
548
+
549
+ - close via PR or explicit `gh issue close`
550
+ - leave a concise summary of what landed and what did not
551
+
552
+ ## Main gaps and risks
553
+
554
+ ### 1. Tickets can still be underspecified
555
+
556
+ Even in Phase 1, weak issue bodies will make agent execution worse.
557
+
558
+ ### 2. Agents can still overstep if prompts are loose
559
+
560
+ If you hand an issue to an agent without scope guidance, they may still expand it.
561
+
562
+ ### 3. Closure can drift from real verification
563
+
564
+ If “done” is not checked concretely, agents may optimize for plausible summaries instead of true completion.
565
+
566
+ ### 4. The system can get overbuilt too early
567
+
568
+ If we optimize now for autonomous backlog agents that do not exist yet, we add unnecessary ceremony.
569
+
570
+ ## Recommended defaults
571
+
572
+ For this repo and workflow, the default stance should be:
573
+
574
+ - ideas live first in docs
575
+ - only concrete, execution-worthy work becomes GitHub issues
576
+ - labels stay lightweight
577
+ - one active issue at a time by default
578
+ - human keeps ownership of priority and product decisions
579
+ - agents help when explicitly pointed at a ticket
580
+
581
+ ## Open questions
582
+
583
+ - When do we actually want to introduce a stricter `ready` state?
584
+ - Should agents be allowed to create issues directly, or mainly draft them?
585
+ - Do we want one standard issue template for all work, or separate templates for `feature`, `bug`, and `chore`?
586
+ - At what point would GitHub Projects/custom fields become worth the complexity?
587
+ - Do we want a supervised agent loop that suggests one `next` ticket, waits for approval, then executes it through WorkRail?
588
+ - If so, what should the merge policy be: ask before merge, or merge automatically after green checks?
589
+
590
+ ## Current recommendation
591
+
592
+ Start simple:
593
+
594
+ 1. keep ideas in `docs/ideas/backlog.md`
595
+ 2. use GitHub issues for work that is concrete enough to track
596
+ 3. use a minimal `next` / `active` / `blocked` label set
597
+ 4. keep the issue body clear enough for an agent when you explicitly hand it over
598
+ 5. keep human control over priority and decision-making
599
+
600
+ If this works well, we can later refine:
601
+
602
+ - issue templates
603
+ - label taxonomy
604
+ - GitHub CLI conventions
605
+ - a future Phase 2 readiness/permission model for autonomous backlog agents
@@ -0,0 +1,112 @@
1
+ # Product Plan: The "Agentic Orchestration" Evolution
2
+
3
+ ## Executive Summary
4
+ This document outlines the roadmap for evolving WorkRail from a monolithic workflow engine into a **Composable, Agent-Aware Orchestration Platform**. This evolution enables WorkRail to
5
+ use modern Agentic IDE features (Subagents, Parallel Execution) while maintaining universal compatibility and backward compatibility.
6
+
7
+ The rollout is structured in **3 Phased Tiers**, gated by feature flags, ensuring safe and iterative delivery.
8
+
9
+ ---
10
+
11
+ ## Phase 1: The "Manual" Prototype (Completed)
12
+ **Goal:** Enable Subagent support *today* using existing primitives, verifying the "Agent Cascade Protocol" without core engine refactors.
13
+
14
+ **Feature Flag:** `WORKRAIL_ENABLE_AGENTIC_ROUTINES=true`
15
+
16
+ ### Key Deliverables:
17
+ 1. **The "Routine" Concept:**
18
+ * Creation of `workflows/routines/` directory (hidden unless flag enabled).
19
+ * Core Routines: `context-gathering`, `hypothesis-challenge`, `plan-analysis`, `execution-simulation`, `feature-implementation`.
20
+ * **Ideate -> Plan -> Execute** strategy pattern implemented in all routines.
21
+ 2. **The "Dual-Path" Handoff:**
22
+ * Creation of `bug-investigation.agentic.json` with manual delegation instructions.
23
+ * Implementation of the "Delegate or Proxy" prompt pattern directly in the JSON.
24
+ 3. **The Diagnostic Suite:**
25
+ * `workflow-diagnose-environment.json`: Agent-driven wizard to probe capabilities and generate config.
26
+ * `docs/integrations/firebender.md`: Documentation on tool whitelisting constraints.
27
+
28
+ **User Experience:**
29
+ * *Before:* Agent does everything linearly.
30
+ * *After:* Agent is instructed to "Delegate to Researcher" manually. If capable, it runs the Routine parallel/isolated.
31
+
32
+ ---
33
+
34
+ ## Phase 2: The "Composition & Middleware" Engine (Next Up)
35
+ **Goal:** Modularize the system and enable **Auto-Injection**. Replace manual prompt copying with a structural "Assembler" that builds workflows dynamically.
36
+
37
+ **Feature Flag:** `WORKRAIL_ENABLE_COMPOSITION=true`
38
+
39
+ ### Key Deliverables:
40
+ 1. **The Workflow Assembler:**
41
+ * Server-side logic to parse a `composition` field in Workflow JSON.
42
+ * Recursively loads and flattens referenced fragments/routines.
43
+ 2. **Workflow Middleware:**
44
+ * **Auto-Injection:** Logic to inject required steps based on workflow metadata.
45
+ * *Example:* If workflow `requires: ["subagents"]`, automatically prepend `routine-environment-handshake`.
46
+ * Eliminates the need for every workflow to manually include setup steps.
47
+ 3. **Fragment Schema:**
48
+ * Formal definition of a "Fragment" (Inputs, Steps, Output Schema).
49
+
50
+ **User Experience:**
51
+ * *Transparent:* Users just see standard steps, but they are dynamically assembled.
52
+ * *Magic Setup:* Workflows automatically verify environment capabilities without the user needing to run a manual setup wizard every time.
53
+
54
+ ---
55
+
56
+ ## Phase 3: The "Adapter" Intelligence (Future Proofing)
57
+ **Goal:** Make workflows "Smart." Move conditional logic (Delegate vs. Proxy) out of text prompts and into the Schema/Engine.
58
+
59
+ **Feature Flag:** `WORKRAIL_ENABLE_ADAPTERS=true`
60
+
61
+ ### Key Deliverables:
62
+ 1. **The Adapter System:**
63
+ * `SubagentAdapter.ts`: Code that detects `capabilities.hasSubagents`.
64
+ * `CloudAdapter.ts`: (Future) For cloud execution.
65
+ 2. **Schema Variants:**
66
+ * New `variants` field in Workflow Schema.
67
+ * Logic to select a variant based on context flags (e.g., `if (hasSubagents) useDelegateVariant`).
68
+ 3. **Runtime Probe & Persistence:**
69
+ * Refined `routine-environment-handshake` that is smarter about caching capabilities.
70
+ * Persistent `WorkRailConfig` reading for environment settings.
71
+
72
+ **User Experience:**
73
+ * *Adaptive:* WorkRail automatically detects if Subagents are available and switches the instructions to "Delegation Mode" without the user doing anything.
74
+
75
+ ---
76
+
77
+ ## Backlog Candidates / Open Product Directions
78
+
79
+ ### Authorable Response Supplements
80
+
81
+ **Goal:** Let workflow authors declare small, typed response-boundary supplements that WorkRail can deliver separately from the main authored step prompt.
82
+
83
+ **Why it matters:**
84
+ * Keeps the primary step prompt user-voiced while still allowing start/resume-only guidance.
85
+ * Makes current runtime-owned supplement behavior explicit and eventually authorable.
86
+ * Gives workflow-for-workflows and future linting a real schema surface instead of relying on hidden server policy.
87
+
88
+ **Constraints:**
89
+ * Should be a **narrow, typed feature**, not arbitrary extra prompt sludge.
90
+ * Must preserve separation between **core step instructions** and **delivery-owned framing**.
91
+ * `once_per_session` semantics must be explicit: policy-level first, durable tracking only if truly required later.
92
+
93
+ **Likely shape:**
94
+ * A dedicated workflow field such as `responseSupplements`
95
+ * Typed supplement kinds, lifecycle targeting (`start`, `rehydrate`, maybe `advance`), and explicit delivery modes
96
+ * Strong validation and authoring guidance to prevent misuse
97
+
98
+ ---
99
+
100
+ ## Summary of Phased Rollout
101
+
102
+ | Phase | Focus | Technical Change | Risk | Value |
103
+ | :--- | :--- | :--- | :--- | :--- |
104
+ | **1. Prototype** | Manual Handoff | JSON Content only | Low | Immediate Subagent support |
105
+ | **2. Composition** | Modularity & Injection | Server Logic (Assembler) | Medium | Reusability & Auto-Setup |
106
+ | **3. Adapters** | Intelligence | Core Engine + Schema | High | Zero-Config "Magic" |
107
+
108
+ ## Feature Flagging Strategy
109
+ All new logic will be wrapped in `WorkRailConfig.features.*` checks.
110
+ * **Default:** All flags `false`.
111
+ * **Opt-In:** Users enable via `.env` or `.workrail/config.json` to test new capabilities.
112
+ * **Graduation:** Once a phase is stable, its flag defaults to `true` in the next major release.