@exaudeus/workrail 3.42.0 → 3.44.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/console-ui/assets/{index-DwfWMKvv.js → index-Bi38ITiQ.js} +1 -1
- package/dist/console-ui/index.html +1 -1
- package/dist/daemon/workflow-runner.d.ts +15 -1
- package/dist/daemon/workflow-runner.js +86 -9
- package/dist/manifest.json +39 -23
- package/dist/trigger/adapters/github-queue-poller.d.ts +34 -0
- package/dist/trigger/adapters/github-queue-poller.js +200 -0
- package/dist/trigger/delivery-action.d.ts +2 -0
- package/dist/trigger/delivery-action.js +24 -0
- package/dist/trigger/github-queue-config.d.ts +18 -0
- package/dist/trigger/github-queue-config.js +155 -0
- package/dist/trigger/polling-scheduler.d.ts +1 -0
- package/dist/trigger/polling-scheduler.js +185 -6
- package/dist/trigger/trigger-router.js +24 -1
- package/dist/trigger/trigger-store.js +77 -2
- package/dist/trigger/types.d.ts +19 -0
- package/docs/design/adaptive-coordinator-context-candidates.md +265 -0
- package/docs/design/adaptive-coordinator-context-review.md +101 -0
- package/docs/design/adaptive-coordinator-context.md +504 -0
- package/docs/design/adaptive-coordinator-routing-candidates.md +340 -0
- package/docs/design/adaptive-coordinator-routing-design-review.md +135 -0
- package/docs/design/adaptive-coordinator-routing-review.md +156 -0
- package/docs/design/adaptive-coordinator-routing.md +660 -0
- package/docs/design/context-assembly-layer-design-review.md +110 -0
- package/docs/design/context-assembly-layer.md +622 -0
- package/docs/design/stuck-escalation-candidates.md +176 -0
- package/docs/design/stuck-escalation-design-review.md +70 -0
- package/docs/design/stuck-escalation.md +326 -0
- package/docs/design/worktrain-task-queue-candidates.md +252 -0
- package/docs/design/worktrain-task-queue-design-review.md +109 -0
- package/docs/design/worktrain-task-queue.md +443 -0
- package/docs/design/worktree-review-findings-candidates.md +101 -0
- package/docs/design/worktree-review-findings-design-review.md +65 -0
- package/docs/design/worktree-review-findings-implementation-plan.md +153 -0
- package/docs/ideas/backlog.md +148 -0
- package/package.json +3 -3
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Context Assembly Layer -- Design Review Findings
|
|
2
|
+
|
|
3
|
+
**Reviewing:** Candidate B-hybrid (ContextAssembler service + typed assembledContext field on WorkflowTrigger)
|
|
4
|
+
**Date:** 2026-04-19
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Tradeoff Review
|
|
9
|
+
|
|
10
|
+
| Tradeoff | Acceptable? | What would make it unacceptable |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| Context serialized to string for agent consumption | YES (agents consume natural language) | If coordinators need to inspect bundle content for dispatch decisions -- not a planned use case |
|
|
13
|
+
| 150 LOC new module vs. 50 LOC inline | YES (justified by multi-coordinator reuse) | If second coordinator never arrives within 6 months |
|
|
14
|
+
| buildSystemPrompt() change (3 lines) | YES (daemon-only, not engine) | If buildSystemPrompt() is treated as a versioned public API -- it is not |
|
|
15
|
+
| workflow-runner.ts imports ContextBundle | YES (coupling direction is correct) | If ContextBundle grows to include I/O -- it must remain a pure value type |
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Failure Mode Review
|
|
20
|
+
|
|
21
|
+
| Failure Mode | Design handling | Missing mitigation | Risk |
|
|
22
|
+
|---|---|---|---|
|
|
23
|
+
| renderContextBundle() accumulates coordinator-specific formatting | Not addressed in v1 | Add `RenderOpts` interface with optional section labels | LOW |
|
|
24
|
+
| Agent ignores assembled context (attention threshold) | Section appended at end of system prompt | Test with prior session notes first; add reference in step prompts | **MEDIUM -- existential** |
|
|
25
|
+
| gitDiff source fails silently | Per-field Result<T,string> -- fails gracefully | Add WARN log in coordinator when source fails | LOW |
|
|
26
|
+
| Second coordinator wants different rendering | Not addressed | RenderOpts mitigation from FM1 | LOW (v1) |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Runner-Up / Simpler Alternative Review
|
|
31
|
+
|
|
32
|
+
**Candidate A strength incorporated:** Typed `assembledContext?: ContextBundle` field on `WorkflowTrigger` is cleaner than string-in-context-map. This is the B-hybrid improvement over pure Candidate B.
|
|
33
|
+
|
|
34
|
+
**Simpler alternative (prior session notes only):** Would satisfy 3/5 acceptance criteria but NOT criterion 4 (pr-review.ts shrinks by 100 LOC). Not sufficient.
|
|
35
|
+
|
|
36
|
+
**Hybrid adopted:** B + typed field from A. This is the recommended design.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Philosophy Alignment
|
|
41
|
+
|
|
42
|
+
| Principle | Status |
|
|
43
|
+
|---|---|
|
|
44
|
+
| Dependency injection for boundaries | SATISFIED |
|
|
45
|
+
| Errors are data | SATISFIED |
|
|
46
|
+
| Immutability by default | SATISFIED |
|
|
47
|
+
| Make illegal states unrepresentable | SATISFIED (discriminated union) |
|
|
48
|
+
| Compose with small, pure functions | SATISFIED |
|
|
49
|
+
| Validate at boundaries | SATISFIED |
|
|
50
|
+
| YAGNI | ACCEPTABLE TENSION (coding_task kind is speculative but planned) |
|
|
51
|
+
| Explicit domain types | MINOR TENSION -- define SessionNote as a proper interface, not string |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Findings
|
|
56
|
+
|
|
57
|
+
### RED (blocking)
|
|
58
|
+
|
|
59
|
+
None.
|
|
60
|
+
|
|
61
|
+
### ORANGE (should be addressed before implementation)
|
|
62
|
+
|
|
63
|
+
**O1: Assembled context visibility to agent is unverified**
|
|
64
|
+
|
|
65
|
+
The system prompt injection in `buildSystemPrompt()` adds the assembled context section AFTER the base system prompt and workspace context. In a dense system prompt (32KB CLAUDE.md + soul file), the assembled context may receive insufficient agent attention. This is the existential risk for the design.
|
|
66
|
+
|
|
67
|
+
**Required action before implementation:** Run one session with only `priorSessionNotes` injected. Verify the agent cites or references the prior session notes in its first turn. If it does not, investigate prompt positioning.
|
|
68
|
+
|
|
69
|
+
### YELLOW (note before implementation)
|
|
70
|
+
|
|
71
|
+
**Y1: SessionNote is not defined as a domain type**
|
|
72
|
+
|
|
73
|
+
`ContextAssemblerDeps.listRecentSessions` returns `Result<readonly SessionNote[], string>`. `SessionNote` must be defined as a proper `readonly` interface:
|
|
74
|
+
```typescript
|
|
75
|
+
export interface SessionNote {
|
|
76
|
+
readonly sessionId: string;
|
|
77
|
+
readonly recapSnippet: string;
|
|
78
|
+
readonly sessionTitle: string | null;
|
|
79
|
+
readonly gitBranch: string | null;
|
|
80
|
+
readonly lastModifiedMs: number;
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
This maps directly to `HealthySessionSummary` fields in `LocalSessionSummaryProviderV2`.
|
|
84
|
+
|
|
85
|
+
**Y2: renderContextBundle needs RenderOpts stub**
|
|
86
|
+
|
|
87
|
+
Even in v1, add an optional `RenderOpts` parameter to `renderContextBundle()` (empty interface for now). This preserves the extension point without implementing it.
|
|
88
|
+
|
|
89
|
+
**Y3: WARN logging for source failures**
|
|
90
|
+
|
|
91
|
+
When `bundle.gitDiff.kind === 'err'`, the coordinator should log at WARN level. Add this to the coordinator refactor spec.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Recommended Revisions
|
|
96
|
+
|
|
97
|
+
1. **Keep B-hybrid:** ContextAssembler service + typed `assembledContext?: ContextBundle` field on `WorkflowTrigger`. Do NOT use string-in-context-map.
|
|
98
|
+
2. **Add O1 mitigation:** Pilot test with `priorSessionNotes` source only before wiring all three sources.
|
|
99
|
+
3. **Define `SessionNote` interface** in `src/context-assembly/types.ts` before implementation.
|
|
100
|
+
4. **Add `RenderOpts` stub** to `renderContextBundle()` signature.
|
|
101
|
+
5. **Add WARN logs** in coordinator when source fails.
|
|
102
|
+
6. **Position assembled context section** in `buildSystemPrompt()` BEFORE the referenceUrls section (higher attention) -- small positioning change.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Residual Concerns
|
|
107
|
+
|
|
108
|
+
1. **Second coordinator timeline is unscheduled.** The multi-coordinator reuse argument for Candidate B over A depends on a second coordinator being built. If this is more than 6 months away, Candidate A is the pragmatic choice.
|
|
109
|
+
2. **`LocalSessionSummaryProviderV2` wiring.** The session summary provider is currently wired only to the MCP server/console path. Using it from `ContextAssemblerDeps` requires either re-exporting its ports or constructing a lightweight adapter. Scope should be confirmed during shaping.
|
|
110
|
+
3. **git diff strategy.** `git diff HEAD~1 --stat` gives a file list; `git diff HEAD~1` gives full diff content. Full diff for large PRs could be 50-100KB. The v1 strategy should be `--stat` (file names and change counts only) -- this fits in the assembled context without hitting budget limits.
|