@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,110 @@
1
+ # Workflow Categories & Category-First Discovery
2
+
3
+ ## Context / Ask
4
+
5
+ The workflow catalog has grown to ~36 items (25 JSON files + routines + bundled). A flat `list_workflows` call returns all of them with full descriptions, consuming 3-5K tokens. Agents often don't know the exact workflow ID — they know the task family. Design category-first discovery: categories as metadata, `list_workflows` returns a summary when called without a category filter.
6
+
7
+ ## Path Recommendation
8
+
9
+ `landscape_first` — the problem and desired outcome are clear. The key unknowns are implementation shape (where categories live, how the contract changes) and what the natural category taxonomy looks like for the current catalog. Understanding these grounds the design decision.
10
+
11
+ ## Constraints / Anti-goals
12
+
13
+ - Must not break existing `list_workflows` callers (additive, not breaking)
14
+ - Categories must not require maintaining a parallel structure that drifts
15
+ - `list_workflows` contract change must be backwards-compatible
16
+
17
+ ## Landscape Packet
18
+
19
+ *(to be populated)*
20
+
21
+ ## Problem Frame Packet
22
+
23
+ *(to be populated)*
24
+
25
+ ## Candidate Directions
26
+
27
+ *(to be populated)*
28
+
29
+ ## Challenge Notes
30
+
31
+ *(to be populated)*
32
+
33
+ ## Resolution Notes
34
+
35
+ *(to be populated)*
36
+
37
+ ## Decision Log
38
+
39
+ *(to be populated)*
40
+
41
+ ## Final Summary
42
+
43
+ *(to be populated)*
44
+
45
+ ## Final Summary
46
+
47
+ ### Selected Direction: Candidate A — spec overlay + category filter
48
+
49
+ **Confidence: High.** Three candidates evaluated, challenged, reviewed. No direction changes required.
50
+
51
+ ### Implementation shape
52
+
53
+ **1. `spec/workflow-categories.json`** (new file)
54
+ ```json
55
+ {
56
+ "categories": [
57
+ { "id": "coding", "displayName": "Coding & Development" },
58
+ { "id": "review_audit", "displayName": "Review & Audit" },
59
+ { "id": "investigation", "displayName": "Investigation & Debugging" },
60
+ { "id": "design", "displayName": "Design & Discovery" },
61
+ { "id": "documentation", "displayName": "Documentation" },
62
+ { "id": "tickets", "displayName": "Tickets & Planning" },
63
+ { "id": "learning", "displayName": "Learning & Personal" },
64
+ { "id": "routines", "displayName": "Routines (Internal)" },
65
+ { "id": "authoring", "displayName": "Workflow Authoring" },
66
+ { "id": "testing", "displayName": "Testing & Diagnostics" }
67
+ ],
68
+ "workflows": {
69
+ "mr-review-workflow-agentic": { "category": "review_audit" },
70
+ "bug-investigation-agentic": { "category": "investigation" },
71
+ "coding-task-workflow-agentic": { "category": "coding" },
72
+ "test-session-persistence": { "category": "testing", "hidden": true },
73
+ ...
74
+ }
75
+ }
76
+ ```
77
+
78
+ **2. `V2ListWorkflowsInput`**: add `category?: string`
79
+
80
+ **3. `V2WorkflowListOutputSchema`**: add `categorySummary?: { id, displayName, count, representatives }[]`
81
+
82
+ **4. Response contract:**
83
+ - No `category` passed → `{ workflows: [], categorySummary: [...10 categories with counts...] }` (~500 tokens)
84
+ - `category=coding` → `{ workflows: [...full list for coding...], categorySummary: undefined }` (~800 tokens)
85
+
86
+ **5. `validate:registry`**: error (not warning) on uncategorized non-hidden workflows
87
+
88
+ **6. `list_workflows` tool description**: update to explain category browsing
89
+
90
+ ### Decision Log
91
+
92
+ - A (spec overlay) selected: hash stable, backwards compatible, CI-checkable, follows includeSources pattern
93
+ - B (convention inference) rejected: only covers ~30% of catalog reliably
94
+ - C (embedded with hash isolation) rejected: compiler complexity for no gain over A
95
+ - Challenge: two-call adoption risk — resolved, summary is DEFAULT not opt-in
96
+ - Orange finding: response contract clarified (`workflows: []` + `categorySummary` when no category passed)
97
+
98
+ ### Residual risks
99
+
100
+ 1. Per-workspace custom categories deferred to v2
101
+ 2. Routines visibility (show in summary or hide?) — open question, recommend show with "Routines (Internal)" label
102
+ 3. validate:registry must not be removable without replacing the uncategorized-workflow check
103
+
104
+ ### 5 open questions to resolve before building
105
+
106
+ 1. Should `testing` workflows be `hidden: true` or shown in summary?
107
+ 2. Should routines appear in summary or be hidden?
108
+ 3. Should `categorySummary` include a short description per category?
109
+ 4. What display name for `review_audit`?
110
+ 5. Should workflow-for-workflows Phase 7 prompt for category?
@@ -0,0 +1,51 @@
1
+ # Workflow Categories Design Review Findings
2
+
3
+ ## Tradeoff Review
4
+
5
+ | Tradeoff | Verdict | Condition of failure |
6
+ |---|---|---|
7
+ | Two-file maintenance | Acceptable | If validate:registry check removed — uncategorized workflows silently absent |
8
+ | Two-call pattern | Acceptable | Summary is DEFAULT — no agent behavior change needed for token savings |
9
+ | Overlay drift | Acceptable | With CI enforcement (validate:registry must treat uncategorized non-hidden as error) |
10
+
11
+ ## Failure Mode Review
12
+
13
+ | Failure Mode | Risk | Coverage | Fix |
14
+ |---|---|---|---|
15
+ | New workflow not categorized | Medium | validate:registry warning | Upgrade to error for non-hidden workflows |
16
+ | Agent passes unknown category | Low | Returns empty list | Add hint listing valid categories in response |
17
+ | **Existing callers break** | **High** | **Not yet addressed** | **`categorySummary` must be ADDITIVE — keep `workflows` in response** |
18
+
19
+ **Most dangerous**: existing callers that iterate `workflows` will get an empty array if we change the default to summary-only. Fix: when no `category` is passed, return `categorySummary` (new field) PLUS `workflows: []` (existing field, now empty). Callers that check `workflows` see empty and know to browse by category.
20
+
21
+ ## Runner-Up / Simpler Alternative Review
22
+
23
+ No runner-up worth borrowing from. Simpler variant (no validate:registry check) rejected — silent data loss is worse than maintenance burden.
24
+
25
+ ## Philosophy Alignment
26
+
27
+ All principles satisfied: determinism (explicit overlay), validate-at-boundaries (CI check), YAGNI (no compiler changes), explicit domain types (typed enum).
28
+
29
+ Minor acceptable tension: empty `workflows` array in summary response is technically correct but slightly awkward UX.
30
+
31
+ ## Findings
32
+
33
+ **Orange — backward compatibility not fully specified**
34
+ The current design description doesn't explicitly address what `workflows` contains when no `category` is passed. If it returns all workflows (current behavior), the token savings are lost. If it returns empty, existing callers break. Must explicitly specify: `workflows: []` when in summary mode, `categorySummary` is the new primary field.
35
+
36
+ **Yellow — validate:registry check must be error, not warning**
37
+ An uncategorized non-hidden workflow that shows as a warning doesn't block CI. Should be an error so new workflows can't ship without a category.
38
+
39
+ **Yellow — tool description in tools.ts needs updating**
40
+ The `list_workflows` tool description says it returns workflow details. It needs to explain the new summary default and the `category` parameter.
41
+
42
+ ## Recommended Revisions
43
+
44
+ 1. Specify response contract explicitly: when `category` absent → `{ workflows: [], categorySummary: [...] }`; when `category` present → `{ workflows: [...full list...], categorySummary: undefined }`
45
+ 2. validate:registry: treat uncategorized non-hidden workflows as an **error** (not warning) in CI
46
+ 3. Update `list_workflows` tool description to explain category browsing
47
+
48
+ ## Residual Concerns
49
+
50
+ - Per-workspace custom categories not addressed (v2 concern, not v1)
51
+ - Should routines be hidden from summary by default? They're internal plumbing, not user-invoked. Recommend: routines visible in summary but clearly labeled, agents can filter by category=routines when needed
@@ -0,0 +1,94 @@
1
+ # Workflow Discovery Model: Design Candidates
2
+
3
+ ## Problem Understanding
4
+
5
+ **The real seam**: The `description` field already exists on every workflow. The problem is descriptions are written as marketing copy, not as intent phrases. The category layer is a symptom of descriptions not carrying enough signal for agents to match on.
6
+
7
+ **Core tensions:**
8
+ 1. Human browsing vs. agent matching — humans scan groups visually; agents match text probabilistically
9
+ 2. Compact summary vs. enough signal — 500 tokens only helps if the signal density is right
10
+ 3. Multi-fit workflows — forcing single assignment loses information
11
+ 4. Taxonomy maintenance vs. description maintenance — both together is double burden
12
+
13
+ **Key insight**: categories organize by type ("what kind of thing is this?"), agents need organization by intent ("when would I use this?"). These are different questions.
14
+
15
+ ## Philosophy Constraints
16
+
17
+ - **Determinism**: `when` phrases must be explicitly authored, not computed or inferred
18
+ - **YAGNI**: don't add tags/embeddings before evidence they're needed
19
+ - **Explicit domain types**: intent phrases must be first-class authored fields, not derived
20
+
21
+ ## Candidates
22
+
23
+ ### A: Better descriptions only (too narrow)
24
+
25
+ Rewrite all 36 workflow descriptions as intent phrases. No categories, no overlay.
26
+
27
+ - **Fixes**: agent matching quality on second call
28
+ - **Doesn't fix**: 500-token first call (36 descriptions = ~3K tokens)
29
+ - **Scope**: too narrow — prerequisite, not a solution
30
+
31
+ ### B: Categories + `when` phrases in categorySummary ✓ RECOMMENDED
32
+
33
+ Keep categories as the organizing layer. Enrich `categorySummary` with a `when: [...]` array of 2-4 intent phrases per category.
34
+
35
+ **Example first call (~500 tokens):**
36
+ ```json
37
+ {
38
+ "categorySummary": [
39
+ {
40
+ "id": "review_audit",
41
+ "displayName": "Review & Audit",
42
+ "count": 3,
43
+ "when": ["reviewing a merge request", "auditing production readiness", "checking architecture scalability"]
44
+ },
45
+ {
46
+ "id": "investigation",
47
+ "displayName": "Investigation & Debugging",
48
+ "count": 2,
49
+ "when": ["diagnosing a bug in code", "diagnosing tool or environment issues"]
50
+ }
51
+ ]
52
+ }
53
+ ```
54
+
55
+ - **Fixes**: 500-token budget, human browsing (categories), agent intent matching (`when` phrases), multi-fit (multiple `when` phrases can reference overlapping use cases across categories)
56
+ - **Maintenance**: per-category (9 entries), not per-workflow (36 entries)
57
+ - **Failure mode**: `when` phrases too coarse — agent can't distinguish within a category. Solvable by writing better phrases.
58
+ - **Scope**: best-fit
59
+ - **Philosophy**: honors determinism (authored explicitly), YAGNI (minimal addition)
60
+
61
+ ### C: Intent clusters without categories (too broad)
62
+
63
+ Per-workflow `triggers` array, clustered dynamically into groups with computed labels.
64
+
65
+ - **Fixes**: multi-fit perfectly
66
+ - **Breaks**: determinism (computed clusters shift), 36x maintenance burden, YAGNI
67
+ - **Scope**: too broad — solves a problem we don't yet have
68
+
69
+ ### D: Tags + categories (too broad)
70
+
71
+ Primary category for human browsing, multiple tags for multi-fit intent signals.
72
+
73
+ - **Fixes**: multi-fit
74
+ - **Breaks**: YAGNI (tags before evidence needed), governance burden
75
+ - **Scope**: too broad
76
+
77
+ ## Comparison and Recommendation
78
+
79
+ **B + A together.** B handles compactness and both human/agent discovery. A (better descriptions) is B's prerequisite — it improves the second call after agents pick a category.
80
+
81
+ The `when` array lives at the **category level** (9 entries), not the workflow level (36 entries). This is the key: low maintenance cost, high signal density, no taxonomy proliferation.
82
+
83
+ ## Self-Critique
84
+
85
+ **Strongest counter-argument**: `when` phrases at category level are too coarse. An agent wanting a "security review" won't find it if `when` only says "reviewing a merge request." Counter: this is a description quality problem in the phrases, not structural — write better phrases.
86
+
87
+ **Pivot condition**: if agents still mis-select after good `when` phrases, move to per-workflow `triggers` authored as explicit fields (not computed). Candidate C's structure, A's maintenance discipline.
88
+
89
+ ## Open Questions
90
+
91
+ 1. Who maintains the `when` phrases — inline in `spec/workflow-categories.json` alongside the category definitions?
92
+ 2. How many `when` phrases per category? 3-5 seems right but worth confirming.
93
+ 3. Should `when` phrases be surfaced in the `workrail://categories` MCP resource so agents can read them before calling `list_workflows`?
94
+ 4. Does A (better descriptions) ship in the same PR or separately?
@@ -0,0 +1,74 @@
1
+ # Workflow Discovery Model: Alternatives to Categories
2
+
3
+ ## Context / Ask
4
+
5
+ Hierarchical categories break down when items fit multiple buckets or none. Exploring whether a superior organization model exists for WorkRail's ~36 workflow catalog, specifically for token-efficient agent discovery.
6
+
7
+ ## Path Recommendation
8
+
9
+ `full_spectrum` — problem framing matters here. The wrong model will feel natural to build but create friction in practice. Need both landscape (what models exist) and reframing (what do agents actually need when discovering workflows).
10
+
11
+ ## Constraints / Anti-goals
12
+
13
+ - Must keep first `list_workflows` call compact (~500 tokens)
14
+ - Must be maintainable — no model that requires constant curation to stay accurate
15
+ - Must work for agents (text-based, probabilistic matching) not just humans (visual scanning)
16
+
17
+ ## Landscape Packet
18
+
19
+ *(to be populated)*
20
+
21
+ ## Problem Frame Packet
22
+
23
+ *(to be populated)*
24
+
25
+ ## Candidate Directions
26
+
27
+ *(to be populated)*
28
+
29
+ ## Challenge Notes / Resolution Notes / Decision Log / Final Summary
30
+
31
+ *(to be populated)*
32
+
33
+ ## Final Summary
34
+
35
+ ### Selected Direction: B + A — Categories with `when` phrases + intent-oriented descriptions
36
+
37
+ **Confidence: High.**
38
+
39
+ ### The enriched `categorySummary` response
40
+
41
+ Each category entry in the first `list_workflows` call contains:
42
+ - `id`: stable identifier
43
+ - `displayName`: human-readable name
44
+ - `count`: number of workflows
45
+ - `when: string[]`: 3-5 intent phrases agents match against ("reviewing a merge request before merging", "auditing a service before deployment")
46
+ - `examples: string[]`: 1-2 representative workflow IDs for agents that recognize names
47
+
48
+ **First call (~500 tokens)** → agent reads `when` phrases, picks category
49
+ **Second call with `category=`** → agent reads intent-oriented `description` per workflow, picks specific workflow
50
+
51
+ ### Workflow descriptions (A component)
52
+
53
+ All 36 workflow descriptions rewritten as intent phrases: "Use this to [verb] [object] [context]". Ships in same PR as the category changes.
54
+
55
+ ### What changed from original Candidate A (prior session)
56
+
57
+ The original spec overlay + category filter design is unchanged structurally. The key additions:
58
+ 1. Each category gains a `when: string[]` array in `spec/workflow-categories.json`
59
+ 2. Each category gains an `examples: string[]` array (1-2 workflow IDs)
60
+ 3. All workflow `description` fields rewritten as intent phrases
61
+ 4. `workrail://categories` MCP resource exposes `when` phrases so agents can read them independently
62
+ 5. Authoring guidelines added as comments in `spec/workflow-categories.json`
63
+
64
+ ### Decision Log
65
+
66
+ - A alone (better descriptions) rejected: doesn't solve 500-token first call
67
+ - C (per-workflow triggers) rejected for now: unnecessary maintenance burden; it's the pivot condition if B proves insufficient
68
+ - D (tags) rejected: YAGNI
69
+ - B selected: categories + `when` phrases at category level. Low maintenance (9 entries), high signal density, both human and agent discovery served
70
+
71
+ ### Residual risks
72
+
73
+ 1. `when` phrase quality is load-bearing — content quality problem, not structural. Authoring guidelines mitigate.
74
+ 2. Per-workflow triggers (C evolved) remains the right escalation if `when` phrases prove too coarse after real usage.
@@ -0,0 +1,48 @@
1
+ # Workflow Discovery Model: Design Review Findings
2
+
3
+ ## Tradeoff Review
4
+
5
+ | Tradeoff | Verdict | Condition of failure |
6
+ |---|---|---|
7
+ | Single-category assignment per workflow | Acceptable | If a workflow genuinely spans two unrelated domains (none currently do) |
8
+ | `when` phrases at category level | Acceptable | If phrases written lazily rather than specifically |
9
+ | Two-call pattern | Acceptable | Agents already willing to make second calls; first call is cheap |
10
+
11
+ ## Failure Mode Review
12
+
13
+ | Mode | Risk | Coverage |
14
+ |---|---|---|
15
+ | `when` phrases too coarse | Medium — content quality risk | Write phrases with concrete examples, not abstractions |
16
+ | Descriptions not updated | Medium | A+B ship together in same PR |
17
+ | Multi-fit miscategorization | Low | `when` phrases can overlap across categories |
18
+
19
+ **Highest risk**: lazy `when` phrases. Quality of this content determines whether the first call actually helps agents.
20
+
21
+ ## Runner-Up / Simpler Alternative Review
22
+
23
+ - Runner-up (C evolved) has nothing to borrow now; it's the pivot condition if B proves insufficient
24
+ - Simpler variant (A only) doesn't solve 500-token first call
25
+ - **Hybrid opportunity**: add small `examples` array per category (1-2 specific workflow IDs) alongside `when`. Lets experienced agents short-circuit the second call. Low cost, high value.
26
+
27
+ ## Philosophy Alignment
28
+
29
+ All principles satisfied: determinism (explicitly authored), YAGNI, explicit domain types, validate-at-boundaries.
30
+
31
+ ## Findings
32
+
33
+ **Yellow — `when` phrase quality is load-bearing**
34
+ The entire value of B depends on `when` phrases being written specifically enough for agents to match ('before merging a PR', not 'reviewing code'). No structural enforcement exists. Add authoring guidelines as comments in `spec/workflow-categories.json`.
35
+
36
+ **Yellow — `examples` field is a low-cost improvement**
37
+ Adding 1-2 representative workflow IDs per category in the summary response lets agents short-circuit the second call if they recognize a workflow name. Should be included in the design.
38
+
39
+ ## Recommended Revisions
40
+
41
+ 1. Add `examples: string[]` (1-2 workflow IDs) to each category entry in `spec/workflow-categories.json` and the `categorySummary` response
42
+ 2. Add authoring guidelines as comments in `spec/workflow-categories.json` explaining how to write good `when` phrases
43
+ 3. Descriptions (A component) must ship in same PR as B
44
+
45
+ ## Residual Concerns
46
+
47
+ - Per-workflow triggers (C evolved) remains the right pivot if `when` phrases prove too coarse after real usage
48
+ - `workrail://categories` MCP resource should expose `when` phrases so agents can read them before calling `list_workflows`
@@ -0,0 +1,245 @@
1
+ # Workflow Source Setup Phase 1
2
+
3
+ This is the **canonical durable plan/design doc** for the near-term workflow-source setup initiative.
4
+
5
+ Use it for:
6
+
7
+ - the preferred phase-1 setup path
8
+ - the core design boundaries that should remain true during implementation
9
+ - migration and coexistence rules for legacy source setup
10
+ - acceptance criteria for when phase 1 is done enough to build on
11
+
12
+ Do **not** use this doc as a code-shadow full of exact APIs or step-by-step implementation recipes. Those should live in tickets, code, and tests.
13
+
14
+ ## Goal
15
+
16
+ Make the common team-sharing path for workflows feel like **product setup**, not infrastructure wiring.
17
+
18
+ Phase 1 should make it easy for a user to understand:
19
+
20
+ - where team-shared workflows should live
21
+ - how WorkRail discovers them
22
+ - why they are visible
23
+ - how this new path coexists with older setup paths during migration
24
+
25
+ ## Phase-1 product shape
26
+
27
+ Phase 1 is:
28
+
29
+ - **`Rooted Team Sharing`**
30
+ - plus a **minimal `Source Control Tower`**
31
+
32
+ That means:
33
+
34
+ - explicit `workspacePath` on discovery-sensitive behavior
35
+ - remembered workspace roots at user scope
36
+ - recursive discovery of `.workrail/workflows/` under remembered roots
37
+ - grouped source visibility
38
+ - minimal provenance and precedence explanation
39
+ - migration-aware guidance while legacy setup paths still exist
40
+
41
+ ## Why this is phase 1
42
+
43
+ This path is the best near-term fit because it:
44
+
45
+ - aligns with the platform vision already documented in `docs/plans/workrail-platform-vision.md`
46
+ - reuses source metadata and discovery concepts already present in the codebase
47
+ - improves the highest-frequency team-sharing path without requiring broad setup automation first
48
+ - keeps the architecture explainable while the long-term source model is still being clarified
49
+
50
+ ## Non-goals for phase 1
51
+
52
+ Phase 1 is **not**:
53
+
54
+ - a generalized guided install flow for arbitrary third-party sources
55
+ - the full canonical source catalog
56
+ - a complete console/control-plane experience
57
+ - final automation for remote/self-hosted auth setup
58
+ - the final permanent ownership split for every `.workrail/*` file
59
+
60
+ Those may follow later, but they are not required to make phase 1 useful and coherent.
61
+
62
+ ## Core user model
63
+
64
+ The preferred team-sharing story should be simple enough to explain in plain language:
65
+
66
+ - “Team workflows live in `.workrail/workflows/` in the repo.”
67
+ - “This repo is registered as a workflow root once.”
68
+ - “WorkRail discovers workflows from registered roots.”
69
+ - “WorkRail can show which source made a workflow visible.”
70
+
71
+ If the user still has to think in raw source kinds, env-var names, or storage internals for the common path, phase 1 is not simple enough.
72
+
73
+ ## Canonical phase-1 behavior
74
+
75
+ ### Team-shared workflows
76
+
77
+ The preferred near-term convention is:
78
+
79
+ - store team-shared workflows in repo-local `.workrail/workflows/`
80
+ - allow nested/module-local `.workrail/workflows/` within remembered roots
81
+ - rely on root registration instead of per-workflow source hookup
82
+
83
+ ### Workspace identity
84
+
85
+ Discovery-sensitive tools should use **explicit `workspacePath`** as the trusted anchor.
86
+
87
+ This initiative should continue the existing movement away from implicit server-process cwd behavior for workflow discovery and related operations.
88
+
89
+ ### Remembered roots
90
+
91
+ WorkRail should remember repo/workspace roots at **user scope**.
92
+
93
+ For phase 1, this remembered-root state is allowed to live in user-level `.workrail/` configuration, but the exact long-term ownership split of `.workrail/config.json` versus other `.workrail/*` artifacts remains intentionally unresolved.
94
+
95
+ ### Source visibility
96
+
97
+ Users must be able to see enough information to trust the result:
98
+
99
+ - which workflows are built-in
100
+ - which came from remembered roots
101
+ - which group/root made them visible
102
+ - when multiple setup paths overlap, what precedence explanation applies
103
+
104
+ Grouped visibility is part of the product, not polish.
105
+
106
+ ## Config ownership decisions for phase 1
107
+
108
+ ### Decided now
109
+
110
+ - WorkRail should own the preferred rooted-sharing setup path under the `.workrail/` namespace.
111
+ - User-level remembered roots are a valid phase-1 concept.
112
+ - Repo-local `.workrail/workflows/` is the preferred team-sharing convention.
113
+ - The system should avoid forcing users back to raw env configuration for the common path.
114
+
115
+ ### Intentionally not finalized yet
116
+
117
+ - whether all user-level remembered-root state belongs in `~/.workrail/config.json`
118
+ - whether repo-local metadata should live in repo `.workrail/config.json` or a separate artifact
119
+ - how environment/capability cache state should be separated from source-setup state long-term
120
+
121
+ Implementation should preserve this flexibility instead of baking in an overloaded single-file assumption.
122
+
123
+ ## Migration and coexistence rules
124
+
125
+ Phase 1 must coexist with current setup behavior instead of pretending it does not exist.
126
+
127
+ The doc and product should acknowledge these existing paths:
128
+
129
+ - `./workflows`
130
+ - `~/.workrail/workflows`
131
+ - env-based source configuration such as custom storage paths, Git repos, registries, and plugins
132
+
133
+ ### Migration stance
134
+
135
+ - keep existing paths working during transition
136
+ - make the preferred rooted-sharing path unmistakable
137
+ - use dual-read compatibility where needed
138
+ - explain overlap rather than silently hiding it
139
+
140
+ ### Required explanation during migration
141
+
142
+ When legacy sources and rooted-sharing both apply, the user should be able to understand:
143
+
144
+ - which path is preferred going forward
145
+ - which source currently made a workflow visible
146
+ - what precedence rule resolved any overlap
147
+
148
+ If WorkRail cannot explain this clearly, automation should not expand further.
149
+
150
+ ## Acceptance criteria
151
+
152
+ Phase 1 is successful when all of the following are true:
153
+
154
+ ### User-facing outcomes
155
+
156
+ - A user can set up team-shared workflows in **1–3 guided actions**.
157
+ - A user can explain the model in plain language without naming env vars.
158
+ - A user can tell the difference between built-in, personal, and repo-derived workflows.
159
+ - A user can understand how the preferred rooted-sharing path relates to older setup paths.
160
+
161
+ ### Product/design outcomes
162
+
163
+ - `workspacePath` is required anywhere discovery semantics materially depend on workspace identity.
164
+ - Rooted discovery under remembered roots is available and reliable.
165
+ - Source visibility is grouped enough to answer “where did this come from?”
166
+ - Minimal precedence explanation exists for overlapping legacy and rooted sources.
167
+
168
+ ### Maintenance outcomes
169
+
170
+ - Another maintainer can use this doc as the initiative entrypoint without needing the exploration notes first.
171
+ - Follow-on tickets can be written from this doc without reopening the entire option space.
172
+
173
+ ## Recommended implementation slices
174
+
175
+ These are the likely implementation slices for phase 1, in rough order:
176
+
177
+ 1. **Workspace anchoring**
178
+ - require and propagate `workspacePath` where discovery behavior depends on it
179
+ 2. **Remembered roots**
180
+ - persist user-level root registration in WorkRail-owned config
181
+ 3. **Rooted discovery**
182
+ - recursively discover `.workrail/workflows/` under remembered roots
183
+ 4. **Grouped visibility**
184
+ - expose source-aware workflow listing and inspection
185
+ 5. **Precedence and migration explanation**
186
+ - explain overlap with legacy setup paths
187
+
188
+ This order matters more than exact file shapes.
189
+
190
+ ## Risks to guard against
191
+
192
+ - **Config overload**: turning `.workrail/config.json` into a catch-all without a clear ownership model
193
+ - **Hybrid-model confusion**: leaving old and new setup paths equally canonical for too long
194
+ - **Invisible precedence**: making discovery broader without explaining why a workflow is visible
195
+ - **Over-automation**: trying to automate cross-client setup before WorkRail can explain its own effective source state
196
+
197
+ ## Future phases
198
+
199
+ This doc is still the canonical reference for **phase 1**, but the initiative should also be understandable beyond the first slice.
200
+
201
+ ### Phase 2 direction
202
+
203
+ If phase 1 succeeds, the most likely next step is:
204
+
205
+ - **`Guided Install + Canonical Source Catalog`**
206
+
207
+ The goal of phase 2 is to make broader workflow hookup simpler across more source types without regressing explainability.
208
+
209
+ Phase 2 likely includes:
210
+
211
+ - a more explicit canonical source catalog owned by WorkRail
212
+ - guided install flows for common third-party source types
213
+ - clearer source health, update mode, and provenance reporting
214
+ - a better-defined ownership split across user-global and repo-local `.workrail/*` configuration
215
+
216
+ Phase 2 should **not** begin by bypassing the phase-1 visibility model. It should build on a trusted, explainable source model rather than trying to invent one in the installer itself.
217
+
218
+ ### Phase 3 and beyond
219
+
220
+ Later phases may expand into:
221
+
222
+ - richer control-tower / console visibility
223
+ - portable workflow-pack or packaging conventions
224
+ - broader install/distribution flows for community and cross-repo sharing
225
+ - more opinionated management of remote and self-hosted source lifecycle
226
+
227
+ These should be treated as follow-on opportunities, not implicit commitments.
228
+
229
+ ### Sequencing rule
230
+
231
+ Future phases should continue to respect this order:
232
+
233
+ 1. make the effective source model visible and trustworthy
234
+ 2. make the common setup path simple
235
+ 3. expand automation and distribution breadth only after the model stays explainable
236
+
237
+ If a later-phase idea weakens provenance, precedence clarity, or config ownership discipline, it should be considered out of sequence.
238
+
239
+ ## Companion docs
240
+
241
+ - `docs/plans/workrail-platform-vision.md`
242
+ - `docs/ideas/third-party-workflow-setup-design-thinking.md`
243
+ - `docs/configuration.md`
244
+
245
+ The design-thinking doc remains useful as exploration history, but this file is the preferred durable reference for the initiative’s near-term direction.