@exaudeus/workrail 3.67.0 → 3.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application/services/compiler/template-registry.js +10 -1
- package/dist/cli/commands/worktrain-init.js +1 -1
- package/dist/console-ui/assets/{index-tOl8Vowf.js → index-CyzltI6D.js} +1 -1
- package/dist/console-ui/index.html +1 -1
- package/dist/coordinators/modes/full-pipeline.js +4 -4
- package/dist/coordinators/modes/implement-shared.js +5 -5
- package/dist/coordinators/modes/implement.js +4 -4
- package/dist/coordinators/pr-review.js +4 -4
- package/dist/daemon/workflow-runner.d.ts +1 -0
- package/dist/daemon/workflow-runner.js +1 -0
- package/dist/manifest.json +25 -25
- package/dist/mcp/handlers/v2-workflow.js +1 -1
- package/dist/mcp/workflow-protocol-contracts.js +2 -2
- package/docs/authoring-v2.md +4 -4
- package/docs/changelog-recent.md +3 -3
- package/docs/configuration.md +1 -1
- package/docs/design/adaptive-coordinator-context-candidates.md +1 -1
- package/docs/design/adaptive-coordinator-context.md +1 -1
- package/docs/design/adaptive-coordinator-routing-candidates.md +18 -18
- package/docs/design/adaptive-coordinator-routing-review.md +1 -1
- package/docs/design/adaptive-coordinator-routing.md +34 -34
- package/docs/design/agent-cascade-protocol.md +2 -2
- package/docs/design/console-daemon-separation-discovery.md +323 -0
- package/docs/design/context-assembly-design-candidates.md +1 -1
- package/docs/design/context-assembly-implementation-plan.md +1 -1
- package/docs/design/context-assembly-layer.md +2 -2
- package/docs/design/context-assembly-review-findings.md +1 -1
- package/docs/design/coordinator-access-audit.md +293 -0
- package/docs/design/coordinator-architecture-audit.md +62 -0
- package/docs/design/coordinator-error-handling-audit.md +240 -0
- package/docs/design/coordinator-testability-audit.md +426 -0
- package/docs/design/daemon-architecture-discovery.md +1 -1
- package/docs/design/daemon-console-separation-discovery.md +242 -0
- package/docs/design/daemon-memory-audit.md +203 -0
- package/docs/design/design-candidates-console-daemon-separation.md +256 -0
- package/docs/design/design-candidates-discovery-loop-fix.md +141 -0
- package/docs/design/design-review-findings-console-daemon-separation.md +106 -0
- package/docs/design/design-review-findings-discovery-loop-fix.md +81 -0
- package/docs/design/discovery-loop-fix-candidates.md +161 -0
- package/docs/design/discovery-loop-fix-design-review.md +106 -0
- package/docs/design/discovery-loop-fix-validation.md +258 -0
- package/docs/design/discovery-loop-investigation-A.md +188 -0
- package/docs/design/discovery-loop-investigation-B.md +287 -0
- package/docs/design/exploration-workflow-candidates.md +205 -0
- package/docs/design/exploration-workflow-design-review.md +166 -0
- package/docs/design/exploration-workflow-discovery.md +443 -0
- package/docs/design/ide-context-files-candidates.md +231 -0
- package/docs/design/ide-context-files-design-review.md +85 -0
- package/docs/design/ide-context-files.md +615 -0
- package/docs/design/implementation-plan-discovery-loop-fix.md +199 -0
- package/docs/design/implementation-plan-queue-poll-rotation.md +102 -0
- package/docs/design/in-process-http-audit.md +190 -0
- package/docs/design/layer3b-ghost-nodes-design-candidates.md +2 -2
- package/docs/design/loadSessionNotes-candidates.md +108 -0
- package/docs/design/loadSessionNotes-test-coverage-discovery.md +297 -0
- package/docs/design/loadSessionNotes-test-coverage-session4.md +209 -0
- package/docs/design/loadSessionNotes-test-coverage-v3.md +321 -0
- package/docs/design/probe-session-design-candidates.md +261 -0
- package/docs/design/probe-session-phase0.md +490 -0
- package/docs/design/routines-guide.md +7 -7
- package/docs/design/session-metrics-attribution-candidates.md +250 -0
- package/docs/design/session-metrics-attribution-design-review.md +115 -0
- package/docs/design/session-metrics-attribution-discovery.md +319 -0
- package/docs/design/session-metrics-candidates.md +227 -0
- package/docs/design/session-metrics-design-review.md +104 -0
- package/docs/design/session-metrics-discovery.md +454 -0
- package/docs/design/spawn-session-debug.md +202 -0
- package/docs/design/trigger-validator-candidates.md +214 -0
- package/docs/design/trigger-validator-review.md +109 -0
- package/docs/design/trigger-validator-shaping-phase0.md +239 -0
- package/docs/design/trigger-validator.md +454 -0
- package/docs/design/v2-core-design-locks.md +2 -2
- package/docs/design/workflow-extension-points.md +15 -15
- package/docs/design/workflow-id-validation-at-startup.md +1 -1
- package/docs/design/workflow-id-validation-implementation-plan.md +2 -2
- package/docs/design/workflow-trigger-lifecycle-audit.md +175 -0
- package/docs/design/worktrain-task-queue-candidates.md +5 -5
- package/docs/design/worktrain-task-queue.md +4 -4
- package/docs/discovery/coordinator-script-design.md +1 -1
- package/docs/discovery/coordinator-ux-discovery.md +3 -3
- package/docs/discovery/simulation-report.md +1 -1
- package/docs/discovery/workflow-modernization-discovery.md +326 -0
- package/docs/discovery/workflow-selection-for-discovery-tasks.md +33 -33
- package/docs/discovery/worktrain-status-briefing.md +1 -1
- package/docs/discovery/wr-discovery-goal-reframing.md +1 -1
- package/docs/docker.md +1 -1
- package/docs/ideas/backlog.md +227 -0
- package/docs/ideas/third-party-workflow-setup-design-thinking.md +1 -1
- package/docs/integrations/claude-code.md +5 -5
- package/docs/integrations/firebender.md +1 -1
- package/docs/plans/agentic-orchestration-roadmap.md +2 -2
- package/docs/plans/mr-review-workflow-redesign.md +9 -9
- package/docs/plans/ui-ux-workflow-design-candidates.md +4 -4
- package/docs/plans/ui-ux-workflow-discovery.md +2 -2
- package/docs/plans/workflow-categories-candidates.md +8 -8
- package/docs/plans/workflow-categories-discovery.md +4 -4
- package/docs/plans/workflow-modernization-design.md +430 -0
- package/docs/plans/workflow-staleness-detection-candidates.md +11 -11
- package/docs/plans/workflow-staleness-detection-review.md +4 -4
- package/docs/plans/workflow-staleness-detection.md +9 -9
- package/docs/plans/workrail-platform-vision.md +3 -3
- package/docs/reference/agent-context-cleaner-snippet.md +1 -1
- package/docs/reference/agent-context-guidance.md +4 -4
- package/docs/reference/context-optimization.md +2 -2
- package/docs/roadmap/now-next-later.md +2 -2
- package/docs/roadmap/open-work-inventory.md +16 -16
- package/docs/workflows.md +31 -31
- package/package.json +1 -1
- package/spec/workflow-tags.json +47 -47
- package/workflows/adaptive-ticket-creation.json +16 -16
- package/workflows/architecture-scalability-audit.json +22 -22
- package/workflows/bug-investigation.agentic.v2.json +3 -3
- package/workflows/classify-task-workflow.json +1 -1
- package/workflows/coding-task-workflow-agentic.json +6 -6
- package/workflows/cross-platform-code-conversion.v2.json +8 -8
- package/workflows/document-creation-workflow.json +8 -8
- package/workflows/documentation-update-workflow.json +8 -8
- package/workflows/intelligent-test-case-generation.json +2 -2
- package/workflows/learner-centered-course-workflow.json +2 -2
- package/workflows/mr-review-workflow.agentic.v2.json +4 -4
- package/workflows/personal-learning-materials-creation-branched.json +8 -8
- package/workflows/presentation-creation.json +5 -5
- package/workflows/production-readiness-audit.json +1 -1
- package/workflows/relocation-workflow-us.json +31 -31
- package/workflows/routines/context-gathering.json +1 -1
- package/workflows/routines/design-review.json +1 -1
- package/workflows/routines/execution-simulation.json +1 -1
- package/workflows/routines/feature-implementation.json +3 -3
- package/workflows/routines/final-verification.json +1 -1
- package/workflows/routines/hypothesis-challenge.json +1 -1
- package/workflows/routines/ideation.json +1 -1
- package/workflows/routines/parallel-work-partitioning.json +3 -3
- package/workflows/routines/philosophy-alignment.json +2 -2
- package/workflows/routines/plan-analysis.json +1 -1
- package/workflows/routines/plan-generation.json +1 -1
- package/workflows/routines/tension-driven-design.json +6 -6
- package/workflows/scoped-documentation-workflow.json +26 -26
- package/workflows/ui-ux-design-workflow.json +14 -14
- package/workflows/workflow-diagnose-environment.json +1 -1
- package/workflows/workflow-for-workflows.json +1 -1
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# Design Candidates: triggers.yml Validator
|
|
2
|
+
|
|
3
|
+
*Raw investigative material for main agent synthesis. See trigger-validator.md for the full design doc.*
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Problem Understanding
|
|
8
|
+
|
|
9
|
+
### Core Tensions
|
|
10
|
+
|
|
11
|
+
**Tension A: Fail-fast vs. partial degradation**
|
|
12
|
+
trigger-listener.ts currently uses skip-and-continue for invalid triggers (not daemon-fatal). Adding hard errors to validateAndResolveTrigger() causes affected triggers to be skipped at startup, not the daemon. This is the correct behavior for a multi-trigger deployment, but means the operator needs to notice the warning in startup logs.
|
|
13
|
+
|
|
14
|
+
**Tension B: Explicit config vs. sensible defaults**
|
|
15
|
+
Forcing maxSessionMinutes on every trigger adds config noise. The true danger fields are branchStrategy and concurrencyMode. The design must not over-constrain safe defaults.
|
|
16
|
+
|
|
17
|
+
**Tension C: Startup validation vs. validate subcommand**
|
|
18
|
+
Hard errors at startup (trigger skipped, logged) are the safety net. The validate subcommand is the observability tool. Both are needed for different jobs. An operator who never runs validate relies entirely on startup logs for safety warnings.
|
|
19
|
+
|
|
20
|
+
**Tension D: Semantic vs. structural validation**
|
|
21
|
+
Structural validation (is maxSessionMinutes a positive integer?) is already in validateAndResolveTrigger(). Semantic validation (should autoCommit:true require an explicit branchStrategy?) is a different concern. Conflating them makes the function harder to test and extend. Separating them clarifies responsibilities.
|
|
22
|
+
|
|
23
|
+
### Likely Seam
|
|
24
|
+
|
|
25
|
+
The correct boundaries are:
|
|
26
|
+
1. `validateAndResolveTrigger()` in trigger-store.ts -- for safety violations (parse-time hard errors)
|
|
27
|
+
2. New `validateTriggerStrict()` function (pure, post-parse) -- for observability warnings
|
|
28
|
+
|
|
29
|
+
NOT trigger-listener.ts (out of scope). Hard error upgrades in validateAndResolveTrigger propagate automatically through trigger-listener.ts's existing loadTriggerConfigFromFile() call.
|
|
30
|
+
|
|
31
|
+
### What Makes This Hard
|
|
32
|
+
|
|
33
|
+
The severity decision for `autoCommit: true` + `branchStrategy: none` under **serial** concurrency. Under serial mode, only one session runs at a time -- no corruption risk today. But changing to parallel later (one field change) makes it dangerous immediately. The design must decide: warn now (footgun-prevention) or only error on the dangerous active combination (parallel + none + autoCommit).
|
|
34
|
+
|
|
35
|
+
**Resolution chosen:** Hard error on autoCommit:true + branchStrategy absent-or-none regardless of concurrencyMode. The error message explains the latent danger.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Philosophy Constraints
|
|
40
|
+
|
|
41
|
+
### Principles That Matter Here
|
|
42
|
+
|
|
43
|
+
- **Errors are data** -- new validation issues must be TriggerValidationIssue values, not exceptions. Already the pattern in trigger-store.ts (70+ Result<>/ok()/err() uses).
|
|
44
|
+
- **Make illegal states unrepresentable** -- the correct fix is a type-level discriminated union. The runtime validator is a pragmatic patch. Note as follow-up.
|
|
45
|
+
- **Explicit domain types** -- TriggerValidationIssue needs a `rule: string` discriminant (not just a message). Rules should be a finite named set to enable programmatic handling.
|
|
46
|
+
- **Pure functions, DI** -- validateTriggerStrict must be a pure function taking TriggerDefinition; CLI command must inject I/O via a deps interface.
|
|
47
|
+
- **Validate at boundaries** -- trigger-store.ts IS the boundary. No new boundary needed.
|
|
48
|
+
|
|
49
|
+
### Philosophy Conflict
|
|
50
|
+
|
|
51
|
+
**Stated:** make illegal states unrepresentable.
|
|
52
|
+
**Practiced:** branchStrategy is `?: 'worktree' | 'none'` (optional) on TriggerDefinition, making the dangerous combination representable.
|
|
53
|
+
|
|
54
|
+
The validator design is a runtime patch over this type-level gap. A follow-up task should explore replacing the optional field with a discriminated AutoCommitConfig union type.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Impact Surface
|
|
59
|
+
|
|
60
|
+
- **trigger-store.ts** -- new hard error checks in validateAndResolveTrigger(); new exported types TriggerValidationIssue, functions validateTriggerStrict() and validateAllTriggers()
|
|
61
|
+
- **types.ts** -- new TriggerValidationIssue interface
|
|
62
|
+
- **cli-worktrain.ts** -- new `worktrain trigger validate` subcommand under existing triggerCommand group
|
|
63
|
+
- **trigger-listener.ts** (NOT TOUCHING) -- startup behavior changes automatically because it calls loadTriggerConfigFromFile()
|
|
64
|
+
- **Test files** -- existing tests that construct TriggerDefinition with missing fields will now get those triggers skipped (behavior change consistent with new hard errors)
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Candidates
|
|
69
|
+
|
|
70
|
+
### Candidate A: Minimal Safety Patch
|
|
71
|
+
|
|
72
|
+
**Summary:** Add 3 hard error returns inside validateAndResolveTrigger() for safety violations; no new functions, no CLI change.
|
|
73
|
+
|
|
74
|
+
**Tensions resolved:** A (hard errors at startup via skip), D (validation stays in existing boundary)
|
|
75
|
+
**Tensions accepted:** B (no observability warnings), C (no validate subcommand)
|
|
76
|
+
|
|
77
|
+
**Boundary:** validateAndResolveTrigger() -- correct seam, already handles structural validation.
|
|
78
|
+
|
|
79
|
+
**Why this boundary:** It is the existing validation seam, called automatically at startup and via CLI. Adding checks here requires no new call sites.
|
|
80
|
+
|
|
81
|
+
**Failure mode:** Triggers are silently skipped at startup. Operators who don't read logs won't know. No UX improvement over current behavior.
|
|
82
|
+
|
|
83
|
+
**Repo-pattern relationship:** Exact follow -- same err() return pattern, same TriggerStoreError kinds.
|
|
84
|
+
|
|
85
|
+
**Gains:** Zero new surface area, minimum risk, fixes safety violations.
|
|
86
|
+
**Losses:** No validate CLI, no observability warnings, no per-trigger summary.
|
|
87
|
+
|
|
88
|
+
**Scope judgment:** Too narrow for the full ask. Satisfies safety goal only.
|
|
89
|
+
|
|
90
|
+
**Philosophy:** Honors errors-as-data, validate-at-boundaries. Does not progress on make-illegal-states-unrepresentable.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
### Candidate B: Two-Layer Validation + CLI Subcommand (RECOMMENDED)
|
|
95
|
+
|
|
96
|
+
**Summary:** (1) Add 3 hard error returns in validateAndResolveTrigger() for safety violations. (2) Add new pure exported function validateTriggerStrict(trigger: TriggerDefinition): readonly TriggerValidationIssue[] for observability warnings. (3) Add worktrain trigger validate subcommand that calls loadTriggerConfigFromFile() then validateAllTriggers() and prints per-trigger summary.
|
|
97
|
+
|
|
98
|
+
**Tensions resolved:** All four -- safety violations become hard errors (A), observability gaps produce named warnings (B), static validate CLI exits 0/1 (C), semantic validation cleanly separated from structural parsing (D).
|
|
99
|
+
|
|
100
|
+
**Boundary solved at:**
|
|
101
|
+
1. validateAndResolveTrigger() -- structural + safety (parse-time errors, existing boundary)
|
|
102
|
+
2. validateTriggerStrict() -- semantic (post-parse, new pure function)
|
|
103
|
+
Both boundaries are correct for their respective concerns.
|
|
104
|
+
|
|
105
|
+
**Why this boundary:** TriggerDefinition is fully resolved at validateTriggerStrict time (secrets expanded, defaults applied, branding done). Cross-field semantics like 'autoCommit:true + branchStrategy absent' can be checked cleanly on a fully-assembled value. The parse-time boundary is wrong for this -- at parse time, branchStrategy might still be absent for a legitimate reason (worktree isolation is optional for read-only triggers).
|
|
106
|
+
|
|
107
|
+
**Failure mode:** Two validation layers = two places to add new rules. An operator who only runs the daemon (never validate CLI) won't see semantic warnings. Mitigation: loadTriggerConfig() can log 'run worktrain trigger validate for a full config health check' on successful parse.
|
|
108
|
+
|
|
109
|
+
**Repo-pattern relationship:** Adapts -- extends existing function plus new exported function following same pure-function and DI patterns. New CLI subcommand follows WorktrainTriggerTestDeps injection pattern exactly.
|
|
110
|
+
|
|
111
|
+
**New types (concrete specification):**
|
|
112
|
+
```typescript
|
|
113
|
+
// In types.ts
|
|
114
|
+
export interface TriggerValidationIssue {
|
|
115
|
+
readonly severity: 'error' | 'warning';
|
|
116
|
+
readonly rule:
|
|
117
|
+
| 'auto_commit_requires_branch_isolation'
|
|
118
|
+
| 'auto_open_pr_requires_auto_commit'
|
|
119
|
+
| 'worktree_requires_base_branch'
|
|
120
|
+
| 'worktree_requires_branch_prefix'
|
|
121
|
+
| 'max_session_minutes_not_set'
|
|
122
|
+
| 'concurrent_without_worktree'
|
|
123
|
+
| 'goal_template_implicit'
|
|
124
|
+
| 'max_turns_not_set'
|
|
125
|
+
| 'auto_commit_without_secret_scan';
|
|
126
|
+
readonly triggerId: string;
|
|
127
|
+
readonly message: string;
|
|
128
|
+
readonly suggestedFix?: string;
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Note: `rule` is a closed string-literal union (not bare string) for exhaustiveness and programmatic handling.
|
|
133
|
+
|
|
134
|
+
**New exports from trigger-store.ts:**
|
|
135
|
+
```typescript
|
|
136
|
+
export function validateTriggerStrict(trigger: TriggerDefinition): readonly TriggerValidationIssue[];
|
|
137
|
+
export function validateAllTriggers(config: TriggerConfig): readonly TriggerValidationIssue[];
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**New CLI file:** `src/cli/commands/worktrain-trigger-validate.ts` following WorktrainTriggerTestDeps injection pattern.
|
|
141
|
+
|
|
142
|
+
**Gains:** Full solution -- safety + observability + CLI. Clean separation. Easy to test validateTriggerStrict in isolation. TriggerValidationIssue is an explicit domain type (not bare string). Closed rule enum enables exhaustiveness.
|
|
143
|
+
**Losses:** More surface area than A. Two places to add new validation rules. Startup path only runs first layer.
|
|
144
|
+
|
|
145
|
+
**Scope judgment:** Best-fit. Covers all five decision criteria within the stated scope.
|
|
146
|
+
|
|
147
|
+
**Philosophy:** Honors all -- errors-as-data, immutability, explicit domain types, pure functions, DI. The closed rule union advances exhaustiveness. Does not yet fix the make-illegal-states-unrepresentable gap (follow-up).
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
### Candidate C: Type-Level Discriminated Union
|
|
152
|
+
|
|
153
|
+
**Summary:** Replace `branchStrategy?: 'worktree' | 'none'` in TriggerDefinition with a discriminated union `type CommitConfig = { readonly autoCommit: false } | { readonly autoCommit: true; readonly branchStrategy: 'worktree'; readonly baseBranch: string; readonly branchPrefix: string }` so the dangerous combination is unrepresentable at compile time.
|
|
154
|
+
|
|
155
|
+
**Tensions resolved:** Tension B (type-level guarantee, permanent prevention rather than runtime detection). Fully resolves make-illegal-states-unrepresentable.
|
|
156
|
+
|
|
157
|
+
**Tensions accepted:** Tension A, C, D. Does not provide CLI. Large refactor.
|
|
158
|
+
|
|
159
|
+
**Boundary:** types.ts (TriggerDefinition), trigger-store.ts (assembly code). Would cascade to all TriggerDefinition construction sites including trigger-listener.ts tests (out of scope).
|
|
160
|
+
|
|
161
|
+
**Why this boundary is wrong for now:** trigger-listener.ts and test files are out of scope. The type change cascades beyond the allowed boundary.
|
|
162
|
+
|
|
163
|
+
**Failure mode:** All test fixtures that construct TriggerDefinition objects must be updated. High risk for the stated scope.
|
|
164
|
+
|
|
165
|
+
**Repo-pattern relationship:** Departs from existing flat-interface pattern. Follows philosophy strictly.
|
|
166
|
+
|
|
167
|
+
**Gains:** Compiler catches dangerous combinations at build time. Zero runtime overhead.
|
|
168
|
+
**Losses:** Large refactor, many files beyond scope. Does not address CLI observability.
|
|
169
|
+
|
|
170
|
+
**Scope judgment:** Too broad.
|
|
171
|
+
|
|
172
|
+
**Philosophy:** Best honors make-illegal-states-unrepresentable. Conflicts with YAGNI -- more complexity than needed for the immediate problem.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Comparison and Recommendation
|
|
177
|
+
|
|
178
|
+
| Criterion | A | B | C |
|
|
179
|
+
|---|---|---|---|
|
|
180
|
+
| Safety violations become hard errors | Yes | Yes | Yes (compile-time) |
|
|
181
|
+
| Observability warnings | No | Yes | No |
|
|
182
|
+
| Static validate CLI | No | Yes | No |
|
|
183
|
+
| No API break | Yes | Yes | No (type break) |
|
|
184
|
+
| Fits scope | Yes | Yes | No |
|
|
185
|
+
| Easiest to evolve | Yes (tiny) | Yes (clean seams) | Risky |
|
|
186
|
+
| Philosophy alignment | Good | Best | Highest (but scope-breaking) |
|
|
187
|
+
|
|
188
|
+
**Recommendation: Candidate B.** It satisfies all five decision criteria, fits the scope, and follows established patterns. Candidate A is the right Phase 1 of B. Candidate C is the right long-term follow-up.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Self-Critique
|
|
193
|
+
|
|
194
|
+
**Strongest counter-argument against B:** Semantic warnings are only visible via `worktrain trigger validate`. An operator who never runs the CLI misses them entirely. The startup path only runs the structural validator. This means the observability improvement requires operator behavior change (run validate before deploying).
|
|
195
|
+
|
|
196
|
+
**Why it still wins:** The alternative (putting semantic warnings in startup logs) is already partially implemented (see the existing console.warn for autoOpenPR without autoCommit). The problem is not that warnings are absent -- it is that they are scattered across trigger-store.ts console.warn calls with no structured output. Candidate B consolidates them into a proper reporting layer.
|
|
197
|
+
|
|
198
|
+
**Narrower option considered:** Candidate A. It loses because it provides no observability improvement, which is half the stated goal.
|
|
199
|
+
|
|
200
|
+
**Broader option considered:** Candidate C. It would be justified if the scope constraint is relaxed or if a follow-up task is planned immediately after this design.
|
|
201
|
+
|
|
202
|
+
**Assumption that would invalidate this design:** If adding new hard errors to validateAndResolveTrigger() causes unexpected startup failures in production (e.g., a trigger that was loading with a bad default is now skipped entirely, breaking the deployment). Mitigation: the production triggers.yml was audited and passes all proposed checks. The hard errors only affect configs that would have caused production incidents anyway.
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Open Questions for Main Agent
|
|
207
|
+
|
|
208
|
+
1. **autoCommit:true + branchStrategy:none + serial concurrency** -- should this be a hard error (latent danger) or a warning (safe today)? Design doc recommends hard error. Do you agree?
|
|
209
|
+
|
|
210
|
+
2. **Migration path for self-improvement trigger** -- it has no explicit concurrencyMode (defaults to serial) and no explicit goalTemplate (defaults to {{$.goal}}). These are warnings under the proposed design. Is that the right call, or should we add these fields to the production triggers.yml as part of this work?
|
|
211
|
+
|
|
212
|
+
3. **worktrain init template** -- should fixing the triggers.yml template scaffolding be part of this implementation? (The framing risk: if init generates missing fields, the validator catches hand-edits but not init-generated configs.) The init command is in `src/cli/commands/worktrain-init.ts` -- also in scope since cli-worktrain.ts is allowed.
|
|
213
|
+
|
|
214
|
+
4. **TriggerValidationIssue.rule as closed union vs. bare string** -- the closed union enables exhaustiveness in switch statements but makes the rule set less extensible. Should it be `string` with a named constants object instead?
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Design Review Findings: triggers.yml Validator (Candidate B)
|
|
2
|
+
|
|
3
|
+
*Concise actionable findings for main agent synthesis.*
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Tradeoff Review
|
|
8
|
+
|
|
9
|
+
### T1: Semantic warnings only visible via validate CLI (not daemon startup)
|
|
10
|
+
**Severity: Yellow**
|
|
11
|
+
Acceptable under realistic conditions. Observability gaps (missing maxSessionMinutes, implicit goalTemplate) are non-blocking. Hard errors still protect against safety violations at startup. The design does not make the current situation worse.
|
|
12
|
+
|
|
13
|
+
**Hidden assumption:** Operators know to run `worktrain trigger validate` before deploying new triggers.
|
|
14
|
+
**Mitigation required:** Add a console.log hint in loadTriggerConfig() on successful parse: "Loaded N trigger(s). Run `worktrain trigger validate` for a full config health check."
|
|
15
|
+
|
|
16
|
+
### T2: Two validation layers = two places to add rules
|
|
17
|
+
**Severity: Orange**
|
|
18
|
+
Manageable with documentation and tests, but creates a meaningful maintenance risk. The specific dangerous scenario: a rule is added to validateAndResolveTrigger (causes trigger skip at startup) but not to validateTriggerStrict (so validate CLI reports Status: OK for a trigger that will be skipped). This actively misleads operators.
|
|
19
|
+
|
|
20
|
+
**Mitigation required:** (1) Add a contract comment in validateTriggerStrict documenting that all error-severity rules in validateAndResolveTrigger must have a counterpart in validateTriggerStrict. (2) Unit test that verifies TriggerDefinitions which fail structural validation also produce error-severity issues from validateTriggerStrict.
|
|
21
|
+
|
|
22
|
+
### T3: autoOpenPR+no autoCommit upgraded from warning to hard error
|
|
23
|
+
**Severity: Yellow**
|
|
24
|
+
Breaking behavioral change. Safe for the production config (no such combination exists). Must be documented as a breaking change in the implementation PR. Clear error message required.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Failure Mode Review
|
|
29
|
+
|
|
30
|
+
### FM1: Operator never runs validate, misses observability warnings
|
|
31
|
+
**Severity: Yellow**
|
|
32
|
+
The startup hint (T1 mitigation) reduces this risk substantially. Worst case is the current situation (confusing startup messages about missing fields), not a regression.
|
|
33
|
+
|
|
34
|
+
### FM2: validate CLI says OK but daemon skips trigger (sync failure)
|
|
35
|
+
**Severity: Orange -- MOST DANGEROUS**
|
|
36
|
+
If a safety rule is in validateAndResolveTrigger but not in validateTriggerStrict, the validate CLI is actively misleading. This is the highest-risk failure mode.
|
|
37
|
+
|
|
38
|
+
**Required mitigation:** Implement validateTriggerStrict to reproduce all error-severity rules from validateAndResolveTrigger as TriggerValidationIssue with severity:'error'. The validate CLI must be a strict superset of what the daemon checks. Document this invariant in code comments.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Runner-Up / Simpler Alternative Review
|
|
43
|
+
|
|
44
|
+
**Candidate A (minimal patch):** No simplification opportunity. Candidate A is Phase 1 of Candidate B. No elements to borrow -- B already includes A's changes.
|
|
45
|
+
|
|
46
|
+
**Simpler variant (single-layer: validateTriggerStrict only):** Analyzed. Does not work. Hard errors in validateAndResolveTrigger prevent dangerous triggers from being dispatched. Moving them to validateTriggerStrict would let dangerous triggers load and dispatch (the validate CLI would show errors, but the daemon would still run the trigger). The two-layer architecture is required.
|
|
47
|
+
|
|
48
|
+
**Verdict:** No simplification satisfies all acceptance criteria. Candidate B as specified is the minimal correct design.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Philosophy Alignment
|
|
53
|
+
|
|
54
|
+
### Fully Satisfied
|
|
55
|
+
- Errors are data (TriggerValidationIssue is a value, not an exception)
|
|
56
|
+
- Explicit domain types (closed rule union, named interface)
|
|
57
|
+
- Exhaustiveness (closed rule union enables switch exhaustiveness)
|
|
58
|
+
- Immutability (all readonly fields and return types)
|
|
59
|
+
- Pure functions (validateTriggerStrict has no I/O)
|
|
60
|
+
- Dependency injection (CLI uses WorktrainTriggerValidateDeps interface)
|
|
61
|
+
- Validate at boundaries (trigger-store.ts is the boundary)
|
|
62
|
+
|
|
63
|
+
### Under Tension (Acceptable)
|
|
64
|
+
- **Make illegal states unrepresentable:** branchStrategy still optional on TriggerDefinition. Runtime patch accepted for scope constraint. Follow-up: Candidate C (discriminated union).
|
|
65
|
+
- **Architectural fixes over patches:** The validator is a runtime patch. Documented as follow-up.
|
|
66
|
+
- **YAGNI with discipline:** Slight over-engineering vs. Candidate A, but all new surface is directly required by the stated goal.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Findings
|
|
71
|
+
|
|
72
|
+
### Red (blocking)
|
|
73
|
+
None.
|
|
74
|
+
|
|
75
|
+
### Orange (important, requires mitigation before implementation)
|
|
76
|
+
|
|
77
|
+
**O1: Sync invariant must be documented in code** -- validateTriggerStrict must reproduce all error-severity rules from validateAndResolveTrigger as TriggerValidationIssue errors. Without this contract, the two-layer architecture creates a misleading validate CLI.
|
|
78
|
+
|
|
79
|
+
**O2: Unit test required for sync coverage** -- A test that constructs a TriggerDefinition that would cause a startup-skip (e.g., autoCommit:true + branchStrategy:none) and verifies validateTriggerStrict reports it as severity:'error'. This prevents regression.
|
|
80
|
+
|
|
81
|
+
### Yellow (recommended, not blocking)
|
|
82
|
+
|
|
83
|
+
**Y1: Startup hint required** -- loadTriggerConfig() should log "Run `worktrain trigger validate` for a full config health check" on successful parse. Without this, observability warnings are effectively invisible.
|
|
84
|
+
|
|
85
|
+
**Y2: Breaking change documentation** -- The autoOpenPR+no autoCommit upgrade from warning to hard error must be documented in the implementation PR and in the changelog as a breaking change.
|
|
86
|
+
|
|
87
|
+
**Y3: Closed rule union vs. constants** -- Open question: should TriggerValidationIssue.rule be a closed string-literal union or a `string` with a named constants object? The closed union is better for exhaustiveness but less extensible. Recommendation: closed union for now (9 rules is a small set); switch to constants if the rule set grows beyond ~15.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Recommended Revisions to Design Doc
|
|
92
|
+
|
|
93
|
+
1. Add to Phase 2 implementation notes: "validateTriggerStrict must reproduce all error-severity checks from validateAndResolveTrigger as TriggerValidationIssue with severity:'error'. Document this as a maintained invariant in code comments."
|
|
94
|
+
|
|
95
|
+
2. Add to Phase 1 implementation notes: "loadTriggerConfig() should log a hint to run `worktrain trigger validate` on successful parse of any triggers."
|
|
96
|
+
|
|
97
|
+
3. Add to Phase 3 implementation notes: "Add unit tests verifying that TriggerDefinitions which would be skipped by validateAndResolveTrigger also produce error-severity issues from validateTriggerStrict."
|
|
98
|
+
|
|
99
|
+
4. Note Y3 (rule union vs. constants) as an open implementation decision for the coding task.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Residual Concerns
|
|
104
|
+
|
|
105
|
+
1. **worktrain init template not in scope:** The framing risk (init generates configs without required fields) is unresolved. It is recommended but not required to check worktrain-init.ts during implementation and add the missing explicit field scaffolding. This is a separate, smaller task.
|
|
106
|
+
|
|
107
|
+
2. **Candidate C deferred:** The type-level discriminated union for AutoCommitConfig is the correct long-term fix. It should be tracked as a follow-up issue. The runtime validator does not prevent a developer from constructing a TriggerDefinition with the dangerous combination programmatically (only from parsing a triggers.yml with it).
|
|
108
|
+
|
|
109
|
+
3. **Self-improvement trigger warnings:** The production `self-improvement` trigger will produce 2 warnings from validateTriggerStrict (goalTemplate implicit, concurrencyMode not set). These should be fixed in the triggers.yml file as part of this implementation (add explicit `goalTemplate: "{{$.title}}"` and `concurrencyMode: serial`).
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# Phase 0: Understand and Path Recommendation -- WorkTrain Trigger Validator
|
|
2
|
+
|
|
3
|
+
**Generated:** 2026-04-20 | **Workflow:** wr.shaping | **Session:** sess_d47ycoddoji3ml5dl5qib2ag7u
|
|
4
|
+
**Status:** Phase 0b complete -- capabilities confirmed, artifact strategy recorded
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Artifact Strategy
|
|
9
|
+
|
|
10
|
+
**This document is human-readable reference only.** It is NOT execution truth.
|
|
11
|
+
|
|
12
|
+
- Execution truth lives in WorkRail session notes and context variables
|
|
13
|
+
- If a chat rewind occurs, notes and context variables survive; this file may not
|
|
14
|
+
- Do not treat this file as a source of truth for what was decided -- check the session context
|
|
15
|
+
|
|
16
|
+
**What this doc is for:** A human reading back through the design history, or a coding agent needing to understand why certain decisions were made.
|
|
17
|
+
|
|
18
|
+
**What this doc is NOT for:** Recovering session state after a rewind. That comes from session notes.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Capability Observations (Phase 0b)
|
|
23
|
+
|
|
24
|
+
| Capability | Available | Evidence | Used Here |
|
|
25
|
+
|---|---|---|---|
|
|
26
|
+
| Web browsing (curl/HTTP) | Yes | `curl https://example.com` returned HTTP 200 | No -- no external research needed; all context is local |
|
|
27
|
+
| Structured web research (MCP browser tool) | Not observed | No browser MCP tool in session context | N/A |
|
|
28
|
+
| Delegation (spawn_agent) | Yes | Tool is defined in session | No -- setup step; delegation adds overhead without benefit |
|
|
29
|
+
| `worktrain` CLI (local dist) | Yes | `node dist/cli-worktrain.js --version` → `0.0.3` | N/A -- validate subcommand not yet built |
|
|
30
|
+
| `worktrain trigger validate` | Not yet available | `trigger --help` shows only `test` subcommand | Will exist after Phase 4 is implemented |
|
|
31
|
+
|
|
32
|
+
**Web browsing fallback:** Network is reachable, but no structured web research tool is available. All required context for this shaping task exists locally (design docs, codebase, existing pitch). Web research is not needed and was not used.
|
|
33
|
+
|
|
34
|
+
**Delegation fallback:** `spawn_agent` is available but was not used in Phases 0-0b. These phases are sequential analytical work where parallelism adds no value. Delegation will be considered in later phases (e.g., parallel assumption challenges in Step 3) if independent cognitive perspectives would improve output quality.
|
|
35
|
+
|
|
36
|
+
**Retriage needed:** No. Path recommendation (`design_first`) is confirmed by capability assessment -- there are no external sources that would change the design direction, and the local codebase state is the authoritative landscape.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Context / Ask
|
|
43
|
+
|
|
44
|
+
### Stated Goal (original -- solution-framed)
|
|
45
|
+
|
|
46
|
+
> Produce a pitch at .workrail/current-pitch.md for the WorkTrain trigger validator (Candidate B two-layer validation + CLI subcommand), covering all 4 implementation phases with concrete implementation details
|
|
47
|
+
|
|
48
|
+
**This is a `solution_statement`, not a `problem_statement`.** It names a specific output, prescribes a design candidate, and asks for "concrete implementation details" -- language that the wr.shaping metaGuidance explicitly prohibits in a pitch.
|
|
49
|
+
|
|
50
|
+
### Reframed Problem Statement
|
|
51
|
+
|
|
52
|
+
When an operator adds or modifies a trigger in `triggers.yml`, they have no way to detect dangerous or confusing misconfiguration before deploying, so production incidents are their first signal that the config was wrong.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Critical Finding: Landscape Has Changed Since the Pitch Was Written
|
|
57
|
+
|
|
58
|
+
**The existing pitch (`2026-04-19-worktrain-trigger-validator.md`) is partially obsolete.** Phase 1 is already implemented.
|
|
59
|
+
|
|
60
|
+
### What the pitch specified vs. current codebase state (Apr 20, 2026):
|
|
61
|
+
|
|
62
|
+
| Phase 1 item | Pitch says | Codebase now |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| `autoOpenPR + !autoCommit` → hard error | Upgrade from warning | **DONE** (lines 941-947) |
|
|
65
|
+
| `autoCommit + branchStrategy absent/none` → hard error | New hard error | **DONE** (lines 977-987) |
|
|
66
|
+
| Startup hint mentioning `worktrain trigger validate` | Add to `loadTriggerConfig()` | **DONE** (3 references in trigger-store.ts) |
|
|
67
|
+
|
|
68
|
+
**Phase 1 is fully implemented in the current codebase. Phases 2, 3, and 4 are not.**
|
|
69
|
+
|
|
70
|
+
### What still needs to be built:
|
|
71
|
+
|
|
72
|
+
| Phase | Item | Status |
|
|
73
|
+
|---|---|---|
|
|
74
|
+
| Phase 2 | `TriggerValidationIssue` interface in `types.ts` | **Missing** |
|
|
75
|
+
| Phase 2 | `validateTriggerStrict()` export in `trigger-store.ts` | **Missing** |
|
|
76
|
+
| Phase 2 | `validateAllTriggers()` export in `trigger-store.ts` | **Missing** |
|
|
77
|
+
| Phase 3 | `src/cli/commands/worktrain-trigger-validate.ts` new file | **Missing** |
|
|
78
|
+
| Phase 4 | `worktrain trigger validate` CLI subcommand in `cli-worktrain.ts` | **Missing** |
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Path Recommendation
|
|
83
|
+
|
|
84
|
+
**Recommended path: `design_first`**
|
|
85
|
+
|
|
86
|
+
### Justification
|
|
87
|
+
|
|
88
|
+
**Why not `landscape_first`:** The landscape is now fully known from code inspection. trigger-store.ts is readable, the design docs are complete, and Phase 1 implementation is already in the codebase. There is no landscape knowledge gap to fill.
|
|
89
|
+
|
|
90
|
+
**Why not `full_spectrum`:** The problem framing was already done rigorously in the prior `wr.discovery` session (`trigger-validator.md`). Candidate B was selected after a full three-candidate evaluation and design review. The candidates are not open questions.
|
|
91
|
+
|
|
92
|
+
**Why `design_first`:** The stated goal has a specific framing distortion that needs resolution before any artifacts are produced:
|
|
93
|
+
1. The goal asks for "concrete implementation details" in a pitch -- which violates wr.shaping's own metaGuidance
|
|
94
|
+
2. The existing pitch already contains implementation-level detail (function signatures, TypeScript types, specific line numbers) making it closer to an engineering spec than a product pitch
|
|
95
|
+
3. Phase 1 is already implemented, which changes what the pitch needs to say about the problem's solved/unsolved state
|
|
96
|
+
4. Three prior coding sessions (`sess_5fk`, `sess_ntum`, `sess_v6r`) were started with implementation-level goals and appear to have stalled -- suggesting the problem may be that the "pitch" is being used as the context bundle for a coding agent, which is an architectural misuse of the shaping workflow
|
|
97
|
+
|
|
98
|
+
**The core design question to resolve:** Should this workflow produce a product-level pitch (as wr.shaping intends) OR a coding-task context bundle (what the goal actually requests)? These are different artifacts with different shapes and different downstream uses. Producing the wrong one wastes work or sends a coding agent in the wrong direction.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Constraints / Anti-Goals
|
|
103
|
+
|
|
104
|
+
### Constraints (from design history + AGENTS.md)
|
|
105
|
+
|
|
106
|
+
- Scope: only `src/trigger/trigger-store.ts`, `src/trigger/types.ts`, `src/cli-worktrain.ts` + new `src/cli/commands/worktrain-trigger-validate.ts`
|
|
107
|
+
- No `src/mcp/` changes
|
|
108
|
+
- No `src/trigger/trigger-listener.ts` changes (hard errors propagate automatically)
|
|
109
|
+
- No external dependencies for the validator
|
|
110
|
+
- `loadTriggerConfig()` public signature must not change
|
|
111
|
+
- Result types, not exceptions -- consistent with TriggerStoreError pattern
|
|
112
|
+
|
|
113
|
+
### Anti-Goals
|
|
114
|
+
|
|
115
|
+
- Do not produce implementation-level detail (function signatures, line numbers, test code) in the pitch portion
|
|
116
|
+
- Do not re-design what Phase 1 already implemented
|
|
117
|
+
- Do not add a `--strict` flag to daemon config (introduces hidden behavior)
|
|
118
|
+
- Do not build a general-purpose YAML schema validator
|
|
119
|
+
- Do not auto-fix config files
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Landscape Packet
|
|
124
|
+
|
|
125
|
+
### Current State: trigger-store.ts validation after PR 685 (Apr 20, 2026)
|
|
126
|
+
|
|
127
|
+
| Check | Behavior | Source |
|
|
128
|
+
|---|---|---|
|
|
129
|
+
| `autoOpenPR: true` without `autoCommit: true` | **Hard error** | lines 941-947 |
|
|
130
|
+
| `autoCommit: true` + `branchStrategy` absent or `'none'` | **Hard error** | lines 977-987 |
|
|
131
|
+
| `branchStrategy` invalid value | **Hard error** | lines 969-975 |
|
|
132
|
+
| Startup hint: "Run 'worktrain trigger validate'" | **Logged** | ~line 940, 979, 1333 |
|
|
133
|
+
|
|
134
|
+
### What is still missing (Phases 2-4)
|
|
135
|
+
|
|
136
|
+
| What | Why it matters |
|
|
137
|
+
|---|---|
|
|
138
|
+
| `TriggerValidationIssue` interface | Enables structured reporting; named rule IDs for programmatic use |
|
|
139
|
+
| `validateTriggerStrict()` | Pure function for semantic validation; required by CLI |
|
|
140
|
+
| `validateAllTriggers()` | Applies validateTriggerStrict across a full TriggerConfig |
|
|
141
|
+
| `worktrain trigger validate` CLI | Pre-deploy observability; surfaces warnings before production |
|
|
142
|
+
|
|
143
|
+
### Prior Coding Sessions
|
|
144
|
+
|
|
145
|
+
Three coding sessions (`sess_5fk`, `sess_ntum`, `sess_v6r`) were started with detailed implementation goals. Session `sess_5fk` reached the implementation plan phase (event index 120) but shows no `run_completed` event -- suggesting it stalled or timed out. None produced a merged PR for the validator. The blocker appears to be that coding sessions were started without a clean context bundle, leading to repeated discovery work.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Problem Frame Packet
|
|
150
|
+
|
|
151
|
+
### The Real Problem Behind the Goal
|
|
152
|
+
|
|
153
|
+
The goal asks for a pitch. But three prior coding sessions were started with the implementation-level goals derived from that pitch and appear to have stalled. The real problem is not "we don't have a pitch" -- it is "we don't have a clean, current, executable context bundle that a coding agent can run against without rediscovering the landscape."
|
|
154
|
+
|
|
155
|
+
The pitch at `2026-04-19-worktrain-trigger-validator.md` covers all 4 phases including concrete types and function signatures -- it is already functioning as a context bundle. Its one gap: it was written before Phase 1 was implemented, so it describes Phase 1 as work to do (which would cause a coding agent to try to re-implement it and fail or conflict).
|
|
156
|
+
|
|
157
|
+
### The Core Tension
|
|
158
|
+
|
|
159
|
+
The wr.shaping workflow is designed to produce a **product-level pitch** (user story, appetite, breadboard, rabbit holes). The goal asks it to produce a **coding context bundle** (function signatures, test cases, file paths, phase sequencing). These are different artifacts:
|
|
160
|
+
|
|
161
|
+
| Product Pitch | Coding Context Bundle |
|
|
162
|
+
|---|---|
|
|
163
|
+
| What the feature does for users | What files to change and how |
|
|
164
|
+
| Appetite in calendar days | Phase breakdown in LOC |
|
|
165
|
+
| Breadboard in words/arrows | Function signatures in TypeScript |
|
|
166
|
+
| Rabbit holes at product level | Implementation risks with line numbers |
|
|
167
|
+
| No-gos as user-visible exclusions | No-gos as explicit non-goals |
|
|
168
|
+
|
|
169
|
+
**Resolution path:** The wr.shaping workflow should produce a product-level pitch (what it is designed for). The implementation detail from the existing pitch should be preserved in the design docs (`docs/design/trigger-validator.md`), which already contains it. The coding agent should be pointed at the design doc, not at the pitch.
|
|
170
|
+
|
|
171
|
+
### Challenge Notes (from Step 1)
|
|
172
|
+
|
|
173
|
+
**A1:** A pitch is the right output -- *challenged*. The existing pitch is already complete and marked ready for implementation. The work may be as small as updating `current-pitch.md` with Phase 1's done status.
|
|
174
|
+
|
|
175
|
+
**A2:** Concrete implementation details belong in the pitch -- *challenged*. The wr.shaping metaGuidance explicitly prohibits this. The goal misuses the shaping workflow as an engineering spec generator.
|
|
176
|
+
|
|
177
|
+
**A3:** The existing pitch is insufficient -- *challenged*. Its only gap is that it describes Phase 1 as pending when Phase 1 is already implemented. A targeted update addresses this without a full re-shape.
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Candidate Directions
|
|
182
|
+
|
|
183
|
+
### Direction 1: Update the existing pitch to reflect current state (RECOMMENDED)
|
|
184
|
+
|
|
185
|
+
Update `2026-04-19-worktrain-trigger-validator.md` (or produce a revised `current-pitch.md`) with:
|
|
186
|
+
- Phase 1 marked as **IMPLEMENTED** (not pending)
|
|
187
|
+
- The remaining work clearly labeled as Phases 2-4
|
|
188
|
+
- Problem statement updated to reflect that the two most dangerous safety violations are now caught at startup
|
|
189
|
+
- Appetite revised: the remaining work is smaller than the original `m` estimate (only Phases 2-4, ~200 LOC, 3 files not 4)
|
|
190
|
+
|
|
191
|
+
**Pros:** Respects the existing design work. Accurate about what's done. Gives a coding agent a true picture.
|
|
192
|
+
**Cons:** This is not the "full shaping run" the goal asks for.
|
|
193
|
+
|
|
194
|
+
### Direction 2: Full wr.shaping re-run with a corrected problem framing
|
|
195
|
+
|
|
196
|
+
Run the full shaping workflow (Steps 1-9) but with the reframed problem statement (not the solution-framed original), producing a genuine product-level pitch that:
|
|
197
|
+
- Treats Phase 1 as already solved context (background)
|
|
198
|
+
- Focuses the shaped solution on Phases 2-4 (the observability layer + CLI)
|
|
199
|
+
- Produces a pitch that is actually product-level (not an engineering spec)
|
|
200
|
+
|
|
201
|
+
**Pros:** Produces a clean, product-level document following wr.shaping's intended output contract.
|
|
202
|
+
**Cons:** Loses the implementation detail that the existing pitch already contains and that a coding agent needs. May be solving a solved problem.
|
|
203
|
+
|
|
204
|
+
### Direction 3: Produce a coding task context bundle directly (bypass wr.shaping intent)
|
|
205
|
+
|
|
206
|
+
Acknowledge that the real need is a coding context bundle (not a product pitch), and produce the right artifact directly: a context bundle for `wr.coding-task` that:
|
|
207
|
+
- States the current codebase state (Phase 1 done)
|
|
208
|
+
- Specifies the 9 rules with exact names and severities
|
|
209
|
+
- Lists the 3 remaining files and exact changes needed
|
|
210
|
+
- Provides test requirements
|
|
211
|
+
|
|
212
|
+
**Pros:** Most directly addresses what the three stalled coding sessions needed.
|
|
213
|
+
**Cons:** Bypasses the wr.shaping workflow's output contract. Produces something that is not a pitch.
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Resolution Notes
|
|
218
|
+
|
|
219
|
+
**Chosen path: Direction 2 (full re-shape with corrected framing), with Direction 1 elements preserved.**
|
|
220
|
+
|
|
221
|
+
**Rationale:**
|
|
222
|
+
- The goal explicitly asks for a pitch at `current-pitch.md`. The workflow should produce what it is designed for.
|
|
223
|
+
- The reframed problem is the right framing: the problem is now "operators have no pre-deploy observability tool" (Phase 1 solved the dangerous silent default; Phase 2-4 solve the observability gap).
|
|
224
|
+
- The existing design docs (`trigger-validator.md`, `trigger-validator-candidates.md`, `trigger-validator-review.md`) contain the full implementation detail a coding agent needs. The pitch should reference them, not reproduce them.
|
|
225
|
+
- The pitch should be accurate about what has already been shipped (Phase 1) and what remains (Phases 2-4).
|
|
226
|
+
|
|
227
|
+
**Path to pitch:** The shaping should reframe from "add validator + CLI" to "add pre-deploy observability for trigger configurations." Phase 1 is already solved and becomes background. The shaped solution is the observability layer: `validateTriggerStrict`, `validateAllTriggers`, and `worktrain trigger validate`.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Decision Log
|
|
232
|
+
|
|
233
|
+
| Date | Decision | Rationale |
|
|
234
|
+
|---|---|---|
|
|
235
|
+
| 2026-04-20 | `goalWasSolutionStatement: true` | Goal names specific design candidate, output path, and asks for implementation detail |
|
|
236
|
+
| 2026-04-20 | `pathRecommendation: design_first` | Framing distortion requires design-level correction before artifact production |
|
|
237
|
+
| 2026-04-20 | Phase 1 is already implemented | Code inspection confirmed all Phase 1 items in trigger-store.ts post PR 685 |
|
|
238
|
+
| 2026-04-20 | Direction 2 chosen | Produce a clean product-level pitch focused on Phases 2-4, with Phase 1 as background |
|
|
239
|
+
| 2026-04-20 | Capability assessment: no delegation needed | All required context is in local files; analytical work only |
|