@exaudeus/workrail 3.75.0 → 3.77.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-D9pYbwS0.js +28 -0
- package/dist/console-ui/index.html +1 -1
- package/dist/coordinators/adaptive-pipeline.d.ts +8 -0
- package/dist/coordinators/context-assembly.d.ts +4 -0
- package/dist/coordinators/context-assembly.js +156 -0
- package/dist/coordinators/modes/full-pipeline.d.ts +1 -1
- package/dist/coordinators/modes/full-pipeline.js +140 -27
- package/dist/coordinators/modes/implement-shared.d.ts +3 -2
- package/dist/coordinators/modes/implement-shared.js +16 -6
- package/dist/coordinators/modes/implement.js +49 -3
- package/dist/coordinators/pipeline-run-context.d.ts +1811 -0
- package/dist/coordinators/pipeline-run-context.js +114 -0
- package/dist/daemon/context-loader.d.ts +1 -1
- package/dist/daemon/core/agent-client.d.ts +7 -0
- package/dist/daemon/core/agent-client.js +31 -0
- package/dist/daemon/core/index.d.ts +6 -0
- package/dist/daemon/core/index.js +19 -0
- package/dist/daemon/core/session-context.d.ts +14 -0
- package/dist/daemon/core/session-context.js +24 -0
- package/dist/daemon/core/session-result.d.ts +10 -0
- package/dist/daemon/core/session-result.js +92 -0
- package/dist/daemon/core/system-prompt.d.ts +6 -0
- package/dist/daemon/core/system-prompt.js +151 -0
- package/dist/daemon/io/conversation-log.d.ts +2 -0
- package/dist/daemon/io/conversation-log.js +45 -0
- package/dist/daemon/io/execution-stats.d.ts +7 -0
- package/dist/daemon/io/execution-stats.js +86 -0
- package/dist/daemon/io/index.d.ts +5 -0
- package/dist/daemon/io/index.js +24 -0
- package/dist/daemon/io/session-notes-loader.d.ts +4 -0
- package/dist/daemon/io/session-notes-loader.js +45 -0
- package/dist/daemon/io/soul-loader.d.ts +3 -0
- package/dist/daemon/io/soul-loader.js +68 -0
- package/dist/daemon/io/workspace-context-loader.d.ts +17 -0
- package/dist/daemon/io/workspace-context-loader.js +137 -0
- package/dist/daemon/runner/agent-loop-runner.d.ts +28 -0
- package/dist/daemon/runner/agent-loop-runner.js +250 -0
- package/dist/daemon/runner/construct-tools.d.ts +5 -0
- package/dist/daemon/runner/construct-tools.js +30 -0
- package/dist/daemon/runner/finalize-session.d.ts +3 -0
- package/dist/daemon/runner/finalize-session.js +75 -0
- package/dist/daemon/runner/index.d.ts +8 -0
- package/dist/daemon/runner/index.js +18 -0
- package/dist/daemon/runner/pre-agent-session.d.ts +7 -0
- package/dist/daemon/runner/pre-agent-session.js +227 -0
- package/dist/daemon/runner/runner-types.d.ts +73 -0
- package/dist/daemon/runner/runner-types.js +39 -0
- package/dist/daemon/runner/tool-schemas.d.ts +1 -0
- package/dist/daemon/runner/tool-schemas.js +151 -0
- package/dist/daemon/session-scope.d.ts +1 -1
- package/dist/daemon/startup-recovery.d.ts +20 -0
- package/dist/daemon/startup-recovery.js +323 -0
- package/dist/daemon/state/index.d.ts +6 -0
- package/dist/daemon/state/index.js +14 -0
- package/dist/daemon/state/session-state.d.ts +23 -0
- package/dist/daemon/state/session-state.js +44 -0
- package/dist/daemon/state/stuck-detection.d.ts +22 -0
- package/dist/daemon/state/stuck-detection.js +25 -0
- package/dist/daemon/state/terminal-signal.d.ts +9 -0
- package/dist/daemon/state/terminal-signal.js +10 -0
- package/dist/daemon/tools/file-tools.d.ts +1 -1
- package/dist/daemon/turn-end/detect-stuck.d.ts +2 -2
- package/dist/daemon/turn-end/detect-stuck.js +2 -2
- package/dist/daemon/turn-end/step-injector.d.ts +1 -1
- package/dist/daemon/types.d.ts +105 -0
- package/dist/daemon/types.js +11 -0
- package/dist/daemon/workflow-enricher.d.ts +16 -0
- package/dist/daemon/workflow-enricher.js +58 -0
- package/dist/daemon/workflow-runner.d.ts +13 -277
- package/dist/daemon/workflow-runner.js +63 -1421
- package/dist/manifest.json +280 -56
- package/dist/trigger/coordinator-deps.d.ts +1 -1
- package/dist/trigger/coordinator-deps.js +131 -0
- package/dist/trigger/delivery-client.d.ts +1 -1
- package/dist/trigger/delivery-pipeline.d.ts +1 -1
- package/dist/trigger/notification-service.d.ts +1 -1
- package/dist/trigger/trigger-listener.js +6 -2
- package/dist/trigger/trigger-router.d.ts +2 -2
- package/dist/v2/durable-core/domain/artifact-contract-validator.js +99 -0
- package/dist/v2/durable-core/schemas/artifacts/discovery-handoff.d.ts +39 -0
- package/dist/v2/durable-core/schemas/artifacts/discovery-handoff.js +10 -1
- package/dist/v2/durable-core/schemas/artifacts/index.d.ts +2 -1
- package/dist/v2/durable-core/schemas/artifacts/index.js +12 -1
- package/dist/v2/durable-core/schemas/artifacts/phase-handoff.d.ts +89 -0
- package/dist/v2/durable-core/schemas/artifacts/phase-handoff.js +56 -0
- package/docs/authoring-v2.md +12 -0
- package/docs/ideas/backlog.md +639 -25
- package/docs/reference/worktrain-daemon-invariants.md +33 -49
- package/docs/vision.md +5 -15
- package/package.json +2 -2
- package/workflows/coding-task-workflow-agentic.json +9 -6
- package/workflows/mr-review-workflow.agentic.v2.json +2 -2
- package/workflows/wr.discovery.json +2 -1
- package/workflows/wr.shaping.json +7 -4
- package/dist/console-ui/assets/index-BvBihscd.js +0 -28
package/docs/ideas/backlog.md
CHANGED
|
@@ -192,6 +192,200 @@ The delivery pipeline was extracted into `delivery-pipeline.ts` with explicit st
|
|
|
192
192
|
|
|
193
193
|
## WorkTrain Daemon
|
|
194
194
|
|
|
195
|
+
### Context injection bugs: double-injection, byte-slice truncation, workspaceRules[0] drop (Apr 30, 2026)
|
|
196
|
+
|
|
197
|
+
**Status: idea** | Priority: high
|
|
198
|
+
|
|
199
|
+
**Score: 13** | Cor:3 Cap:1 Eff:3 Lev:3 Con:3 | Blocked: no
|
|
200
|
+
|
|
201
|
+
Three active bugs in the context injection pipeline that waste tokens, produce incorrect truncation, and silently discard workspace context. Confirmed by codebase audit (Apr 30, 2026).
|
|
202
|
+
|
|
203
|
+
1. **Double-injection (`session-context.ts:117-119`):** `trigger.context` is JSON-serialized in full into the initial user message. Since coordinators write `assembledContextSummary` *into* `trigger.context`, the assembled context appears twice -- once in the system prompt (8KB cap applied) and once in the initial user message (uncapped). These diverge when the content exceeds 8KB.
|
|
204
|
+
|
|
205
|
+
2. **Byte-slice truncation (`system-prompt.ts:200-202`):** `assembledContextSummary` is truncated by raw byte index (`ctxStr.slice(0, 8192)`), which splits mid-sentence, mid-section, and can produce malformed UTF-8. The section-aware `buildBudgetedOutput()` pattern already exists in `src/coordinators/context-assembly.ts` and handles this correctly.
|
|
206
|
+
|
|
207
|
+
3. **`workspaceRules[0]` silent drop (`session-context.ts:106`):** `ContextBundle.workspaceRules` is typed as `ContextRule[]` but only `[0]` is consumed. All additional workspace context rules are silently dropped. The type implies per-file rules are supported; the consumer silently ignores them.
|
|
208
|
+
|
|
209
|
+
**Also in scope:** introduce `WorkflowContextSlots` typed fields on `WorkflowTrigger` (or a companion type) for system-managed context fields (`assembledContextSummary`, `priorSessionNotes`, `gitDiffStat`). This eliminates the stringly-typed `trigger.context['assembledContextSummary']` access pattern and is a prerequisite for the universal enricher (see next item). Scope Phase 0 changes to consumption sites only (`buildSystemPrompt`, `buildSessionContext`); coordinator write sites migrate in Phase 1.
|
|
210
|
+
|
|
211
|
+
**Done looks like:** no `trigger.context` JSON dump in `initialPrompt`; `assembledContextSummary` truncated at section boundaries; all `workspaceRules` entries injected; `WorkflowContextSlots` typed fields replace stringly-typed access in consumption sites.
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
### Universal context enricher for all session entry points (Apr 30, 2026)
|
|
216
|
+
|
|
217
|
+
**Status: idea** | Priority: high
|
|
218
|
+
|
|
219
|
+
**Score: 11** | Cor:1 Cap:3 Eff:2 Lev:3 Con:2 | Blocked: yes (needs context injection bugs fixed first)
|
|
220
|
+
|
|
221
|
+
Today 4 of 6 session entry points receive zero assembled context: raw webhook triggers, direct dispatch, `spawn_agent` children, and crash-recovered sessions never get cross-session notes or git diff state. Only coordinator-spawned sessions (via `pr-review.ts` or the adaptive pipeline) get assembled context -- and even then only through opt-in coordinator logic, not structural injection.
|
|
222
|
+
|
|
223
|
+
There is no single layer that all dispatch paths share where assembly can run universally. Coordinators that care must call assembly explicitly; everything else gets nothing. This means every new entry point or coordinator is another opportunity to forget assembly.
|
|
224
|
+
|
|
225
|
+
**Design (from Apr 30 discovery):** A `WorkflowEnricher` service injected into `runWorkflow()` that fires for root sessions only (`spawnDepth === 0`). Provides prior workspace session notes (max 3, newest-first, workspace-scoped) and `git diff HEAD~1 --stat` to all entry points. Injected via `WorkflowContextSlots` typed fields (see context injection bugs item). When a coordinator has already set `assembledContextSummary`, the enricher skips prior-notes injection (coordinator's richer context takes precedence) but still provides git diff stat if absent.
|
|
226
|
+
|
|
227
|
+
**Critical gate:** before this ships, run a pilot test -- one session with `assembledContextSummary` injected, inspect turn-1 reasoning for citation. If agents don't reference pre-loaded context, the investment in universal enrichment adds tokens without improving outcomes.
|
|
228
|
+
|
|
229
|
+
**Things to hash out:**
|
|
230
|
+
- Where exactly does the enricher inject: inside `runWorkflow()` before `buildPreAgentSession()`, or inside `buildPreAgentSession()` itself? The latter is cleaner but changes the pre-agent phase boundary.
|
|
231
|
+
- `listRecentSessions` must have a 1s wall-clock timeout with partial-result fallback. Without it, large session stores silently slow all session startups. This is a spec requirement, not optional.
|
|
232
|
+
- `spawn_agent` children don't get enriched (they'd trigger redundant assembly for deeply nested trees). Is there a case where children should optionally enrich? Candidate: an `inheritParentContext: boolean` flag in the `spawn_agent` tool schema.
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
### MemoryStore: indexed session history and mid-session query_memory tool (Apr 30, 2026)
|
|
237
|
+
|
|
238
|
+
**Status: idea** | Priority: medium
|
|
239
|
+
|
|
240
|
+
**Score: 10** | Cor:1 Cap:3 Eff:1 Lev:3 Con:2 | Blocked: yes (needs universal enricher first)
|
|
241
|
+
|
|
242
|
+
The session event log is rich -- it records goals, step notes, artifacts, delivered commits, git state, and phase handoffs. But querying it requires a full directory scan and per-session event projection on every call. `LocalSessionSummaryProviderV2` does this today and is used in exactly one place (the PR-review coordinator). Every other consumer either skips it or re-implements a slower version.
|
|
243
|
+
|
|
244
|
+
There is no mid-session memory query capability at all. An agent mid-session cannot ask "what did we decide about this module last week" and get an answer from persistent memory -- it can only use what was pre-loaded at session start.
|
|
245
|
+
|
|
246
|
+
**Design (from Apr 30 discovery):** A `MemoryStore` port backed by `~/.workrail/memory.db` (SQLite, WAL mode) indexed by `finalizeSession()` as fire-and-forget after each session completes. Query kinds v1: `recent_sessions` (by workspace path hash), `sessions_by_goal_keywords`. A `query_memory` tool added to the daemon tool set. Replaces the slow `listRecentSessions` scan in the universal enricher.
|
|
247
|
+
|
|
248
|
+
Phase 2b (separate): index phase artifacts via a new `phase_artifact_appended` session event kind -- bridges the current PipelineRunContext silo into the session event log so phase artifacts are queryable alongside session notes. Requires engine schema review before implementation.
|
|
249
|
+
|
|
250
|
+
**Things to hash out:**
|
|
251
|
+
- SQLite native compilation may fail in some deployment environments (Docker, Alpine Linux). Mitigation: use `@sqlite.org/sqlite-wasm` (pure WASM) or make `MemoryStore` fully optional -- daemon works without it, just no indexed queries.
|
|
252
|
+
- `phase_artifact_appended` event schema change is the highest-risk part of Phase 2b. Should it reuse the existing artifact channel with a new content type, or be a new event kind? Each has different backward-compatibility implications.
|
|
253
|
+
- Should `query_memory` be a general-purpose tool or typed with specific query kinds? A typed discriminated union prevents agents from inventing unsupported query shapes.
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
### worktrain session analyze: verify agents actually use pre-loaded context (Apr 30, 2026)
|
|
258
|
+
|
|
259
|
+
**Status: idea** | Priority: medium
|
|
260
|
+
|
|
261
|
+
**Score: 8** | Cor:1 Cap:2 Eff:2 Lev:2 Con:2 | Blocked: no
|
|
262
|
+
|
|
263
|
+
There is no way to verify whether agents actually use pre-loaded context (soul, workspace context, `assembledContextSummary`, session notes) in their reasoning. The entire memory architecture investment (universal enricher, MemoryStore, knowledge graph) assumes agents reference pre-loaded context at turn 1 -- but this assumption is unvalidated. If agents receive 32KB of workspace context and `assembledContextSummary` but don't cite them in their reasoning before acting, richer pre-loading adds token cost without improving outcomes.
|
|
264
|
+
|
|
265
|
+
Today, validating this requires manually reading raw session transcripts, which is impractical at scale. A `worktrain session analyze <sessionId>` command that reads the agent turn events and reports whether any pre-loaded context fields were cited in turn-1 reasoning would make this automatable and support data-driven decisions about context loading investment.
|
|
266
|
+
|
|
267
|
+
**Done looks like:** `worktrain session analyze <sessionId>` reads the session event log, extracts turn-1 assistant message content, checks for citations of injected fields (workspace context file names, goal text, prior step note content), and reports a structured summary: fields injected, fields cited, fields ignored.
|
|
268
|
+
|
|
269
|
+
**Things to hash out:**
|
|
270
|
+
- "Citation" is hard to define precisely -- the agent might paraphrase rather than quote. Does substring matching suffice, or does this need an LLM similarity check?
|
|
271
|
+
- Should this be a CLI command or a console feature? The console already reads session data; this could be a "context audit" view.
|
|
272
|
+
- The primary use case is a one-time validation gate (before shipping the universal enricher). Does this justify a permanent command, or is it a one-off script?
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
### Per-run retrospective: structured learning from pipeline outcomes (Apr 30, 2026)
|
|
277
|
+
|
|
278
|
+
**Status: idea** | Priority: medium
|
|
279
|
+
|
|
280
|
+
**Score: 9** | Cor:1 Cap:2 Eff:2 Lev:2 Con:2 | Blocked: no
|
|
281
|
+
|
|
282
|
+
After a pipeline run completes -- whether it merged, escalated, or failed -- there is no structured mechanism for WorkTrain to record what it learned. Mistakes that occurred in one run (wrong interpretation, missed edge case, collateral damage rationalized as a tradeoff) are not surfaced to future sessions. Each run starts with the same baseline.
|
|
283
|
+
|
|
284
|
+
A per-run retrospective is a lightweight post-completion step that answers: what went wrong or unexpectedly, what assumption turned out to be false, what should the next session starting on this codebase know that this session didn't? The output would be a structured record written to the session store and made available as Tier 0 context for future sessions on the same workspace.
|
|
285
|
+
|
|
286
|
+
This is distinct from the per-step `report_issue` mechanism (which records obstacles mid-session) and from the `wr.coding-task` phase-8 retrospective workflow (which is an agent-facing step prompt). This is a coordinator-level mechanism that runs after the pipeline exits, regardless of which workflows ran.
|
|
287
|
+
|
|
288
|
+
**Things to hash out:**
|
|
289
|
+
- Who runs the retrospective -- the coordinator (deterministic, reads phase results and produces structured output), a lightweight LLM step, or the agent in a final workflow phase?
|
|
290
|
+
- What is the output format? A structured `RetrospectiveArtifactV1` that feeds Tier 0 context injection, or freeform notes that accumulate in a `workspace-knowledge.md` file?
|
|
291
|
+
- Where does the output live? Per-run (alongside `PipelineRunContext`), per-workspace (accumulated knowledge store), or per-session in the session store?
|
|
292
|
+
- When a retrospective records "assumption X was wrong," how does that fact reach future sessions? It needs to be injected as Tier 0 context -- which requires the context loading path to know where to look.
|
|
293
|
+
- Should the retrospective run on every pipeline outcome (merge, escalate, timeout, error), or only on non-merge outcomes where something went wrong?
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
### Phase quality gate policy: partial vs escalate (May 5, 2026)
|
|
298
|
+
|
|
299
|
+
**Status: idea** | Priority: medium
|
|
300
|
+
|
|
301
|
+
**Score: 9** | Cor:2 Cap:2 Eff:2 Lev:2 Con:2 | Blocked: no
|
|
302
|
+
|
|
303
|
+
The current phase quality gate policy (implemented in living work context, PR #939) is: `fallback` → escalate, `partial` → proceed with warning, `full` → proceed normally. The `partial` path is a deliberate judgment call that favors progress over quality: the agent ran for 25-65 minutes and produced partial output, and retrying might also produce partial output.
|
|
304
|
+
|
|
305
|
+
The open question: should `partial` also escalate, or is "proceed with warning" the right default? This requires observability data to answer. If `partial` phases regularly produce wrong downstream output (review catches issues caused by missing upstream context, fix loops triggered by context gaps), the policy should shift to escalate-on-partial. If `partial` phases produce acceptable output, the current policy is correct.
|
|
306
|
+
|
|
307
|
+
**Things to hash out:**
|
|
308
|
+
- What metric determines whether `partial` downstream output is "wrong enough" to justify policy change? Review findings that cite missing upstream context? Fix loop iteration count?
|
|
309
|
+
- Should the policy be configurable per-trigger (some pipelines tolerate partial, others don't)?
|
|
310
|
+
- Should the `partial` warning in `assembledContextSummary` be structured enough that the downstream agent can flag "I was working with incomplete context" in its handoff artifact, making the degradation chain traceable?
|
|
311
|
+
- Is there a smarter policy -- e.g. retry the prior phase once before escalating?
|
|
312
|
+
|
|
313
|
+
**Note:** This is not a correctness problem with the current implementation. `fallback` correctly escalates. `partial` correctly proceeds with an explicit warning. The question is whether the `partial` threshold is in the right place. Revisit after observing real pipeline runs.
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
### Lifecycle integration tests: assert each workflow emits expected handoff artifact (May 5, 2026)
|
|
318
|
+
|
|
319
|
+
**Status: idea** | Priority: medium
|
|
320
|
+
|
|
321
|
+
**Score: 8** | Cor:2 Cap:1 Eff:2 Lev:2 Con:3 | Blocked: no
|
|
322
|
+
|
|
323
|
+
Issue #934 (living work context) required "lifecycle integration tests asserting each of the 4 workflows (wr.shaping, wr.coding-task, wr.discovery, mr-review) emits expected artifact at final step." PR #939 shipped the adversarial behavioral test (proves the chain works end-to-end) and the `contractRef` validation test (proves no unregistered refs ship), but did not ship per-workflow lifecycle harness tests that run each workflow through compilation + stepping and assert the final step emits the correct artifact kind.
|
|
324
|
+
|
|
325
|
+
Without these tests: a workflow prompt change that removes or breaks the artifact emission instruction would pass all existing tests (smoke test only checks compilation, not artifact emission) until a real pipeline run catches it.
|
|
326
|
+
|
|
327
|
+
**Done looks like:** `tests/lifecycle/` tests that run `wr.shaping`, `wr.coding-task`, `wr.discovery`, and `mr-review-workflow` through the lifecycle harness and assert the final step produces an artifact with the expected `kind` field.
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
### Slack/Teams/chat integration for pipeline completion alerts (May 4, 2026)
|
|
332
|
+
|
|
333
|
+
**Status: idea** | Priority: medium
|
|
334
|
+
|
|
335
|
+
**Score: 9** | Cor:1 Cap:3 Eff:2 Lev:1 Con:2 | Blocked: no
|
|
336
|
+
|
|
337
|
+
When WorkTrain completes a pipeline run -- whether it produced a PR, escalated, timed out, or failed -- the operator currently has no push notification. They have to poll the console or check their email. For overnight-safe autonomous operation (the vision's stated success condition), the operator needs to know when work is ready for their attention without having to check. Beyond the individual operator, the team that will review the PR also needs to know it exists and is ready. Neither is addressed today.
|
|
338
|
+
|
|
339
|
+
The use case has two layers: (1) operator-facing -- "your pipeline finished, here's the PR URL and outcome summary," sent to the operator's Slack/Teams DM or a dedicated channel; (2) team-facing -- "a PR is ready for review," sent to the team's review channel with enough context for a reviewer to triage without navigating to GitHub.
|
|
340
|
+
|
|
341
|
+
**Things to hash out:**
|
|
342
|
+
- Is this a WorkTrain daemon concern (coordinator sends notification after pipeline completion) or a trigger-layer concern (configured alongside the trigger)? The `callbackUrl` mechanism already exists for HTTP POST on completion -- is Slack/Teams just a specialized callback, or does it need first-class support?
|
|
343
|
+
- What is the configuration model? Per-trigger (`notifyOnComplete: { slack: { channel: "#pr-reviews", token: "$SLACK_TOKEN" } }`) or workspace-level (`~/.workrail/config.json`)?
|
|
344
|
+
- How does the team-facing notification avoid becoming noise? If WorkTrain opens 10 PRs in a day, each triggering a Slack message, the channel becomes unusable. Is there a batching, threading, or filtering mechanism?
|
|
345
|
+
- What is the authentication and secret management story? Same `$ENV_VAR_NAME` resolution as trigger HMAC secrets, or a separate credentials store?
|
|
346
|
+
|
|
347
|
+
**See also:** Daemon working hours / dispatch scheduling (below) -- notifications sent outside working hours are noise.
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
### Daemon working hours and dispatch scheduling (May 4, 2026)
|
|
352
|
+
|
|
353
|
+
**Status: idea** | Priority: medium
|
|
354
|
+
|
|
355
|
+
**Score: 9** | Cor:1 Cap:3 Eff:2 Lev:2 Con:2 | Blocked: no
|
|
356
|
+
|
|
357
|
+
WorkTrain is designed for overnight-safe autonomous operation, but "overnight-safe" currently means the daemon keeps working through the night without human oversight -- not that it respects the operator's or team's working hours. A PR opened at 2am sits unreviewed until morning. Slack/Teams notifications at 3am are noise. Triggers that fire from monitoring alerts at midnight might not be appropriate to dispatch.
|
|
358
|
+
|
|
359
|
+
There is no current mechanism to configure when the daemon dispatches new sessions, when it sends notifications, or when it holds work for the next business day.
|
|
360
|
+
|
|
361
|
+
**Things to hash out:**
|
|
362
|
+
- What is the scope? Working hours could affect: (a) trigger dispatch (hold incoming triggers until working hours), (b) notifications (send alerts only during working hours), (c) both. These may need separate configuration.
|
|
363
|
+
- What is the configuration model? Per-workspace (`~/.workrail/config.json: { workingHours: { timezone: "America/New_York", days: ["Mon"-"Fri"], start: "09:00", end: "18:00" } }`) or per-trigger (some triggers are critical and should dispatch any time)?
|
|
364
|
+
- How does "critical" work? An on-call incident trigger probably should not be gated by working hours. What is the mechanism for a trigger to opt out? A `priority: critical` flag, or explicit `ignoreWorkingHours: true`?
|
|
365
|
+
- What happens to triggers that fire outside working hours? Queue and dispatch at next working-hours start, discard, or dispatch anyway but suppress notifications?
|
|
366
|
+
- How does this interact with multi-timezone teams?
|
|
367
|
+
|
|
368
|
+
**See also:** Slack/Teams notification integration (above) -- the two features are designed to be used together.
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
### Assumption resolution before acting: agents should fill information gaps with available tools (May 4, 2026)
|
|
373
|
+
|
|
374
|
+
**Status: idea** | Priority: high
|
|
375
|
+
|
|
376
|
+
**Score: 11** | Cor:3 Cap:3 Eff:2 Lev:2 Con:1 | Blocked: no
|
|
377
|
+
|
|
378
|
+
Pipeline agents currently have two options when they hit an information gap: proceed with an explicit assumption, or get stuck. Neither is optimal. The coding agent might assume a function signature, proceed with the wrong implementation, and only discover the error in review. Any phase agent might miss context that was resolvable with a two-second tool call (gh, glab, jira, glean, codebase search, MCP tools). There is currently no structured mechanism in the workflow engine or in individual workflows that asks agents to explicitly audit their open assumptions and use available tools to close them before committing to an approach.
|
|
379
|
+
|
|
380
|
+
**Things to hash out:**
|
|
381
|
+
- Is this a workflow-level concern (each workflow author decides when and where to add assumption resolution) or an engine-level concern (the engine injects it automatically)?
|
|
382
|
+
- Is the right mechanism a routine (injected via `templateCall`, creating a visible dedicated step with notes output), a feature (engine-injected constraint on every step), or both?
|
|
383
|
+
- Should assumption resolution happen once per workflow (front-loaded as the first step) or opportunistically (at any step where the agent identifies a gap)?
|
|
384
|
+
- What tools should the agent be expected to use? The set varies by workspace (some have Jira, some have GitLab, some have Glean). A generic routine can only say "use whatever tools are available" -- is that specific enough to be useful?
|
|
385
|
+
- How does this interact with the task-scoped rules idea and the ephemeral per-turn injection idea? All three are trying to get the right context to the agent at the right time.
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
195
389
|
### Intent gap: agent builds what it understood, not what the user meant (Apr 30, 2026)
|
|
196
390
|
|
|
197
391
|
**Status: idea** | Priority: medium
|
|
@@ -223,6 +417,239 @@ This is categorically different from bugs (the agent implemented the right thing
|
|
|
223
417
|
|
|
224
418
|
---
|
|
225
419
|
|
|
420
|
+
### Intent resolution: tiered context harvest to close the intent gap before coding starts (May 4, 2026)
|
|
421
|
+
|
|
422
|
+
**Status: designing -- not ready for shaping or implementation** | Priority: high
|
|
423
|
+
|
|
424
|
+
**Score: 13** | Cor:3 Cap:3 Eff:2 Lev:3 Con:2 | Blocked: no
|
|
425
|
+
|
|
426
|
+
The intent gap entry names the failure mode. This entry is the resolution design. The root cause is not that agents misread tickets -- it is that agents form interpretations without access to the context that would resolve ambiguity. The fix is a structured, tiered context harvest during discovery, a mid-discovery interpretation checkpoint, and a configurable escalation ladder when ambiguity survives the harvest.
|
|
427
|
+
|
|
428
|
+
**The core insight:** a ticket description is almost never the most authoritative source of intent. The epic it belongs to, the design doc it references, the Slack thread where the feature was scoped, the vision doc that defines what the project is trying to become -- these carry far more signal. An agent that only reads the ticket is working with the thinnest slice of available context. Importantly, none of these sources need to live in the codebase -- they can be in Confluence, Notion, Slack, Google Docs, or a GitHub wiki. The tool layer is the access mechanism regardless of where the content lives.
|
|
429
|
+
|
|
430
|
+
**Two distinct failure subtypes -- require different responses:**
|
|
431
|
+
|
|
432
|
+
Research (AmbiEval 2026, Orchid 2026, AskBench 2026) distinguishes two failure modes:
|
|
433
|
+
- **Subtype A -- vagueness/ambiguity:** the ticket is underspecified or has multiple valid interpretations. "Delete the record" -- soft-delete or hard-delete? The tiered harvest + council addresses this.
|
|
434
|
+
- **Subtype B -- wrong prior:** the ticket is clear, but the agent has a systematically wrong prior about what tickets like this mean in this codebase. "Fix the auth issue" -- agent knows what auth issues usually mean, but this codebase does it differently. No amount of context harvest resolves this; it requires challenging the agent's assumptions explicitly.
|
|
435
|
+
|
|
436
|
+
**Critical decision before building: measure which subtype dominates your actual failure distribution.** Retrospectively classify 10-20 past wrong-implementation cases as Subtype A vs B. If Subtype B is significant, the council and detection scaffold are insufficient -- Subtype B requires assumption-logging and adversarial plan review, not just ambiguity detection. The entire design below addresses Subtype A well and Subtype B only partially.
|
|
437
|
+
|
|
438
|
+
**Tiered context harvest:**
|
|
439
|
+
|
|
440
|
+
Tier 0 -- project identity (always injected, not searched):
|
|
441
|
+
- Vision doc, active backlog items, design locks/ADRs for the affected area, coding philosophy
|
|
442
|
+
- Not searched for relevance -- injected unconditionally because they constrain every interpretation
|
|
443
|
+
- Source locations are workspace-configured and can be anywhere: local files (`docs/vision.md`), Confluence, Notion, Google Docs, GitHub wiki -- resolved via the same tool layer as other tiers
|
|
444
|
+
- `ContextLoader` resolves Tier 0 sources before session start using whatever tools the workspace has configured
|
|
445
|
+
- If Tier 0 is empty (no project identity configured), the minimum `ambiguityLevel` floor is `'uncertain'` regardless of agent self-report
|
|
446
|
+
|
|
447
|
+
Tier 1 -- structured task sources (highest signal, deterministic):
|
|
448
|
+
- Jira/Linear: linked epics, acceptance criteria, parent ticket, comments, attachments
|
|
449
|
+
- GitHub/GitLab: linked PRs, prior implementations of the same feature, commit history on affected files, related issues
|
|
450
|
+
- The ticket's own epic/milestone context -- a vague ticket is often disambiguated by the epic it belongs to
|
|
451
|
+
|
|
452
|
+
Tier 2 -- conversational sources (high signal, noisier):
|
|
453
|
+
- Slack: the thread where the ticket was discussed, the channel where the feature was scoped, off-ticket decisions
|
|
454
|
+
- Notion/Confluence/Google Docs: design docs linked in the ticket or epic, ADRs for the affected area
|
|
455
|
+
- Hard retrieval budget: top 2-3 most relevant sources, 4K token cap total. Beyond budget, sources logged as "available but not injected" and added to `unresolvedAssumptions[]`
|
|
456
|
+
- Conflict resolution: when a lower-tier source contradicts a higher-tier source, the higher tier wins and the contradiction surfaces in `unresolvedAssumptions[]`. Priority: Tier 0 ADRs > Tier 1 acceptance criteria > Tier 1 linked epic > Tier 2 design docs > Tier 2 Slack threads
|
|
457
|
+
|
|
458
|
+
Tier 3 -- codebase itself:
|
|
459
|
+
- How similar features were implemented previously
|
|
460
|
+
- Naming conventions, existing abstractions, patterns that constrain valid interpretations
|
|
461
|
+
- Tests that describe current behavior of the affected area
|
|
462
|
+
|
|
463
|
+
**"Enough context" checklist (harvest stops when satisfied, not when budget is full):**
|
|
464
|
+
1. Tier 0 was injected or confirmed unavailable
|
|
465
|
+
2. Tier 1 structured sources were queried (epic, acceptance criteria, linked issues)
|
|
466
|
+
3. If Tier 1 returned ambiguity-relevant signal, Tier 2 search attempted for the most specific query
|
|
467
|
+
4. Agent can articulate at least one rival interpretation with evidence
|
|
468
|
+
|
|
469
|
+
**Ticket quality pre-flight (lightweight, independent of the full harvest):**
|
|
470
|
+
Before dispatch, run 5 INVEST-based quality checks on the ticket: unambiguous, testable, non-compound, has acceptance criteria, scoped. USeR (arxiv 2503.02049) provides 34 automated RE quality metrics; these 5 are the highest-signal subset. Deployable independently of the full detection scaffold. A ticket that fails multiple quality checks is routed to Subtype A treatment immediately without spending turns on harvest.
|
|
471
|
+
|
|
472
|
+
**Tool graceful degradation:** tool failure never blocks session start. When a configured source is unreachable, log the error, treat as empty, include in `unresolvedAssumptions[]`, and elevate `ambiguityLevel` accordingly. When a tool is not configured, skip silently.
|
|
473
|
+
|
|
474
|
+
**Mid-discovery interpretation checkpoint:**
|
|
475
|
+
|
|
476
|
+
Not pre-discovery (too low signal) and not post-discovery (too expensive to correct). The right spot is early in discovery after the agent has read the file structure, recent git history, relevant modules, and harvested Tier 0-1 context. Roughly turns 3-5.
|
|
477
|
+
|
|
478
|
+
The checkpoint first classifies task type, then produces the interpretation artifact:
|
|
479
|
+
|
|
480
|
+
`taskType: 'targeted_fix' | 'feature' | 'refactor' | 'architectural'`
|
|
481
|
+
- `targeted_fix`: well-scoped, additive, low ambiguity risk -- council can be skipped
|
|
482
|
+
- `feature`: new behavior, moderate ambiguity risk
|
|
483
|
+
- `refactor`: structural change, high ambiguity risk
|
|
484
|
+
- `architectural`: systemic change -- always requires council, minimum `ambiguityLevel` is `'uncertain'`
|
|
485
|
+
|
|
486
|
+
Interpretation artifact:
|
|
487
|
+
- `interpretation`: "I understand this task as X"
|
|
488
|
+
- `rivalInterpretations[]`: genuine alternative readings -- must be architecturally different, not minor variations. Use falsification forcing: "What is the single most important word or phrase that, if read differently, leads to a substantially different implementation? Describe both implementations."
|
|
489
|
+
- `unresolvedAssumptions[]`: what would have to be true for the primary interpretation to be wrong
|
|
490
|
+
- `ambiguityLevel: 'clear' | 'uncertain' | 'ambiguous'` -- self-reported, used as floor only
|
|
491
|
+
- `confidenceBreakdown`: `{ tier0Injected, tier1Complete, tier2Retrieved, rivalInterpretationStrength: 'weak' | 'plausible' | 'strong', unresolvedAssumptionCount, overallAmbiguityLevel }`
|
|
492
|
+
|
|
493
|
+
**Add: clarification question generation as an independent signal.** Ask: "What is the one question you would most want answered before implementing this?" A specific high-stakes question ("Does 'delete' mean soft-delete or hard-delete?") = ambiguous. Inability to generate a meaningful question = likely clear. Specificity and number of non-trivial questions generated is an independent ambiguity meter (KC et al. 2025).
|
|
494
|
+
|
|
495
|
+
**Critical: self-reported ambiguity is untrustworthy.** RLHF trains models to provide confident, forward-moving responses (Sharma et al. 2023). Use `max(introspective, structural)` as the effective level:
|
|
496
|
+
|
|
497
|
+
Structural pre-filter signals (fast, no LLM, computed before checkpoint):
|
|
498
|
+
- Presence of weak modals ("should", "may"), vague quantifiers ("fast", "large"), passive without agent, undefined pronouns, no acceptance criteria -- RE literature, 70-89% precision on formal requirements
|
|
499
|
+
- `taskType` is `'architectural'` or `'refactor'`
|
|
500
|
+
- Tier 0 is empty
|
|
501
|
+
- `unresolvedAssumptionCount > 2`
|
|
502
|
+
- Tier 1 returned empty
|
|
503
|
+
|
|
504
|
+
Semantic entropy sampling (behavioral, no self-report):
|
|
505
|
+
Sample the interpretation step 5-7 times at temperature ~0.8. Cluster semantically equivalent outputs. Compute Shannon entropy over clusters. High entropy = model is generating genuinely different interpretations, independent of self-report. Well-established (Wang et al. ICLR 2023, Kuhn et al. ICLR 2023 Spotlight). Cost: ~6-8x single inference, fully parallelizable.
|
|
506
|
+
|
|
507
|
+
**Escalation ladder (coordinator routes deterministically on effective ambiguity level):**
|
|
508
|
+
|
|
509
|
+
1. `'clear'` → proceed to full discovery automatically
|
|
510
|
+
2. `'uncertain'` → council of agents (see below). Re-evaluate on council output.
|
|
511
|
+
3. Still `'uncertain'` after council + `requireIntentConfirmation: 'uncertain'` on trigger → structured clarification request to operator. Structured options: "A / B / proceed with best judgment / abandon" + default-if-no-reply timeout (e.g. 4 hours → proceed with A). Delivered via configured channel (Slack > webhook > console outbox). Correction injected as `steer`; agent re-orients mid-discovery without restarting.
|
|
512
|
+
4. `'ambiguous'` + `requireIntentConfirmation: 'always'` → pause for human approval.
|
|
513
|
+
5. Genuinely unanswerable → escalate to outbox with full context packet.
|
|
514
|
+
|
|
515
|
+
`requireIntentConfirmation: 'never' | 'uncertain' | 'always'` per trigger, defaulting to `'uncertain'`. Global workspace default overridable per trigger.
|
|
516
|
+
|
|
517
|
+
**Vagueness vs. ambiguity routing:**
|
|
518
|
+
|
|
519
|
+
- **Vague ticket** (underspecified -- doesn't say enough): clarification request to operator. Only the operator can add missing information. Council will not help -- both challengers fill the same gap the same way.
|
|
520
|
+
- **Ambiguous ticket** (multiple valid interpretations): council of agents, then operator if unresolved.
|
|
521
|
+
|
|
522
|
+
The detection layer classifies which failure mode before routing.
|
|
523
|
+
|
|
524
|
+
**Council of agents -- cross-family comparison, not same-model debate:**
|
|
525
|
+
|
|
526
|
+
The council handles ambiguous tickets. Its purpose is detecting interpretation error, not resolving genuine ambiguity (that requires the operator).
|
|
527
|
+
|
|
528
|
+
**Critical research findings:**
|
|
529
|
+
- "When Two LLMs Debate" (2025, 10-model study): both agents escalate to ~83% stated confidence by round 3 regardless of correctness. Never use stated confidence from a council -- compare interpretation content only.
|
|
530
|
+
- "Persona Collapse / Chameleon's Limit" (2026): same-model instances with different personas converge to a narrow behavioral mode regardless of role assignment. Role prompts do not produce genuinely independent populations.
|
|
531
|
+
- "Diversity of Thought in MAD" (2024): different model families achieve 91% vs 82% on reasoning benchmarks. Cross-family diversity reduces correlated interpretation errors.
|
|
532
|
+
|
|
533
|
+
**Cross-family model diversity is required for genuine independence.** Role assignment can be layered on top but cannot substitute for it.
|
|
534
|
+
|
|
535
|
+
The council is structured as comparison, not debate -- no "primary defends" turn:
|
|
536
|
+
|
|
537
|
+
1. Primary agent (model family A) submits interpretation artifact
|
|
538
|
+
2. Two challenger agents spawn in parallel from different model families (B, C), each with raw ticket + Tier 0-2 context but NOT the primary's interpretation. Each produces an independent reading.
|
|
539
|
+
3. Coordinator compares all three outputs for substantive semantic divergence.
|
|
540
|
+
4. Council produces typed output contract: `{ revisedAmbiguityLevel, failureMode: 'ambiguous' | 'vague', primaryInterpretationSurvived: boolean, winningInterpretation: { text, basis }, dissents[] }`
|
|
541
|
+
5. Coordinator routes on `revisedAmbiguityLevel` and `failureMode`. Zero LLM turns.
|
|
542
|
+
|
|
543
|
+
Challenger constraints:
|
|
544
|
+
- Hard `maxTurns` cap (10-15 each) -- each challenger has one job
|
|
545
|
+
- Spawned with `maxSubagentDepth: 1` -- challengers cannot spawn challengers
|
|
546
|
+
- `mode: 'blind'` isolation -- no prior phase artifacts (per context isolation modes entry below)
|
|
547
|
+
|
|
548
|
+
**ClarifyGPT consistency check (cheaper alternative to full council):**
|
|
549
|
+
Generate the implementation plan twice independently. If the two plans are inconsistent, ask a targeted clarification question (arxiv 2310.10996). Cheaper than a full multi-family council; useful as a pre-council filter for `'uncertain'` cases before spending on cross-family challengers.
|
|
550
|
+
|
|
551
|
+
**Program distribution divergence (Tier 2 behavioral signal where test oracles exist):**
|
|
552
|
+
SpecFix (2025): generate N independent implementations (N=5-10), compare behavioral divergence on tests. 43.58% of ambiguous function-specs detected, +30.9% Pass@1 on repaired specs. Hard prerequisite: requires a test oracle. Viable only for repos with good test coverage. Transfer to informal GitHub-style descriptions is the highest-priority unvalidated gap before treating as production-ready.
|
|
553
|
+
|
|
554
|
+
**Operator clarification UX:**
|
|
555
|
+
|
|
556
|
+
A useful clarification request is answerable in one decision, time-bounded, and shows what changes between interpretations:
|
|
557
|
+
```
|
|
558
|
+
Task: "Improve error handling in auth module"
|
|
559
|
+
|
|
560
|
+
Interpretation A: Add try/catch to the 3 unhandled failure points in token-service.ts (~50 lines, 1-2 hours)
|
|
561
|
+
Interpretation B: Redesign the error type hierarchy across the auth subsystem (~300 lines, needs separate shaping)
|
|
562
|
+
|
|
563
|
+
Evidence for A: ticket title says "improve" not "redesign"; linked issue reports a specific NPE in token-service.ts
|
|
564
|
+
Evidence for B: parent epic is "Auth module modernization"; prior PR comment mentioned "error types need a complete overhaul"
|
|
565
|
+
|
|
566
|
+
Reply: A / B / proceed with best judgment / abandon
|
|
567
|
+
[Default if no reply in 4 hours: A]
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
For overnight queues: batched clarification UX (approve/correct a queue, not N individual notifications) is more practical. Undesigned -- needs its own design pass.
|
|
571
|
+
|
|
572
|
+
**Feedback and calibration:**
|
|
573
|
+
|
|
574
|
+
Build the calibration data capture layer now. Log: checkpoint outcome, `confidenceBreakdown`, operator correction, downstream PR verdict, and review findings tagged as interpretation-related. Use behavior-based ground truth -- divergent implementations as the ambiguity label, not human majority-vote polls (majority-voted labels miscalibrate detectors by 55-87% ECE, 2026).
|
|
575
|
+
|
|
576
|
+
**`skipIntentResolution` escape hatch:**
|
|
577
|
+
Operator sets `skipIntentResolution: true` on a trigger, or agent self-declares skip for: very short ticket + very narrow affected area + `taskType: 'targeted_fix'` + no rival interpretations possible. Skipped sessions still require a one-line interpretation statement.
|
|
578
|
+
|
|
579
|
+
**Relationship to living work context:**
|
|
580
|
+
Tier 0 injection needs a dedicated system prompt section separate from `assembledContextSummary` to avoid the 8KB cap. The interpretation checkpoint artifact flows into `DiscoveryHandoffArtifactV1` and `PipelineRunContext` once living work context lands. Downstream phases should see what interpretation the discovery agent committed to.
|
|
581
|
+
|
|
582
|
+
**Research findings (resolved questions):**
|
|
583
|
+
- **Role prompts vs. model families**: Persona Collapse (2026) shows same-model role-separated agents converge. Cross-family required for genuine independence. Resolved: cross-family > role prompts.
|
|
584
|
+
- **Multi-agent debate confidence**: both agents escalate to ~83% confidence regardless of correctness. Never use stated confidence. Resolved: compare content only.
|
|
585
|
+
- **Rival interpretation generation**: open-ended enumeration produces anchored minor variations. Falsification forcing is more reliable. Resolved.
|
|
586
|
+
- **Vagueness vs. ambiguity**: empirically distinct failure modes requiring different responses. Resolved.
|
|
587
|
+
- **Production systems**: SWE-agent, AutoCodeRover, Agentless have no ambiguity detection phase. Confirmed by 4 independent 2025-2026 benchmarks. WorkTrain architecture is differentiated.
|
|
588
|
+
- **Calibration ground truth**: use divergent implementations, not human majority-vote labels. Resolved.
|
|
589
|
+
|
|
590
|
+
**Things still to hash out:**
|
|
591
|
+
- **Measure Subtype A vs B distribution first** -- retrospectively classify 10-20 past wrong-implementation cases before committing to the full design. If Subtype B dominates, the design needs explicit assumption-challenging and assumption-logging components that aren't here yet.
|
|
592
|
+
- Semantic entropy sampling cost at scale -- always on, or triggered only when structural signals fire first?
|
|
593
|
+
- Program distribution divergence (Tier 2) requires a test oracle. Fallback for repos without tests?
|
|
594
|
+
- Council model selection: which model families for challengers, how configured per workspace?
|
|
595
|
+
- Council cadence for large overnight queues: sampling approach may be more practical initially.
|
|
596
|
+
- `taskType` classification: separate pre-checkpoint step or first output of the same checkpoint?
|
|
597
|
+
- Batched clarification UX for overnight operators is undesigned.
|
|
598
|
+
- Minimal interim wiring for interpretation commitment through phases before living work context lands?
|
|
599
|
+
|
|
600
|
+
---
|
|
601
|
+
|
|
602
|
+
### Subtype B intent failure: agent has a wrong prior about what this codebase does (May 5, 2026)
|
|
603
|
+
|
|
604
|
+
**Status: idea -- needs empirical study before design** | Priority: high
|
|
605
|
+
|
|
606
|
+
**Score: 12** | Cor:3 Cap:3 Eff:2 Lev:2 Con:1 | Blocked: no
|
|
607
|
+
|
|
608
|
+
The intent resolution entry (above) addresses Subtype A failures -- tickets that are ambiguous or underspecified. This entry addresses Subtype B, which is categorically different and currently has no empirical intervention study in the literature.
|
|
609
|
+
|
|
610
|
+
**The failure mode:** The ticket is clear and specific. The agent reads it correctly. But the agent has a systematically wrong prior about what the described thing means in this codebase -- because its training data, or a superficially similar pattern it has seen, leads it to a confident interpretation that is locally coherent but wrong for this specific system.
|
|
611
|
+
|
|
612
|
+
Examples:
|
|
613
|
+
- "Add rate limiting to the auth service" -- agent implements token bucket at the HTTP layer because that's what rate limiting means in most codebases. This codebase does it at the middleware layer with a different interface. The ticket was clear; the agent's prior was wrong.
|
|
614
|
+
- "Fix the session expiry bug" -- agent finds and fixes the obvious TTL check. The actual expiry logic in this codebase is spread across three collaborating modules in a non-obvious way. The agent's mental model of "how session expiry works" doesn't match this codebase.
|
|
615
|
+
- "Update the delivery pipeline to handle X" -- agent knows what delivery pipelines look like. This codebase's delivery pipeline has specific invariants (atomic stage ordering, sidecar lifecycle) that violate the agent's general expectations. The update is technically correct in isolation but violates a codebase-specific invariant the agent didn't know existed.
|
|
616
|
+
|
|
617
|
+
**Why it's different from Subtype A:** You cannot fix this with more context harvest from Jira or Slack. The ticket is correctly specified. You cannot fix it with a council of agents -- challenger agents from different model families share the same wrong prior from training data. The problem is not ambiguity; it is that the agent's internal model of the codebase diverges from the actual codebase.
|
|
618
|
+
|
|
619
|
+
**Why it's hard to detect:** the agent's interpretation feels correct and internally consistent. It will self-report high confidence. The semantic entropy signal may be low (all samples converge on the same wrong interpretation). A challenger agent may produce the same wrong interpretation independently. The failure is invisible until review or testing.
|
|
620
|
+
|
|
621
|
+
**What might actually work (inferred, not empirically validated):**
|
|
622
|
+
|
|
623
|
+
*Explicit assumption surfacing before acting:* Before touching any code, require the agent to write down: "Here is how I believe this component works based on what I have read." Then verify those beliefs against the codebase. If the agent's stated model of "how the delivery pipeline works" conflicts with what the code actually does, that conflict is the signal. This is different from rival interpretations (Subtype A) -- it is rival models of the existing system.
|
|
624
|
+
|
|
625
|
+
*Assumption-challenging agent:* A separate lightweight agent reads the primary agent's stated assumptions about the codebase and actively searches for contradicting evidence. Not "is the ticket ambiguous" but "is the agent's model of this codebase correct?" Spawned with `mode: 'blind'` (no prior context) so it approaches the codebase fresh, then compares its reading to the primary agent's stated model.
|
|
626
|
+
|
|
627
|
+
*Prior-invalidation pass in discovery:* Discovery workflow includes a mandatory step: for each major architectural assumption the agent is making, find one piece of codebase evidence that would invalidate it. If the agent assumes "rate limiting is at the HTTP layer," it must search for evidence that this is wrong before proceeding. Forces falsification of the prior rather than confirmation.
|
|
628
|
+
|
|
629
|
+
*Historical session notes as prior correction:* If prior sessions have established "in this codebase, X works differently than you'd expect because Y," that context must be injected before the agent forms its model. This is the living work context applied across pipeline runs, not just within one run -- a per-workspace knowledge store of "things that are surprising about this codebase." Related to the knowledge graph backlog item.
|
|
630
|
+
|
|
631
|
+
**Why Confidence is 1 (needs discovery before design can begin):**
|
|
632
|
+
|
|
633
|
+
There is no empirical study of interventions for Subtype B in ticket-driven coding agents. AskBench's AskOverconfidence condition (arxiv 2602.11199) confirms agents fail differently on false-premise queries -- but "false premise" in a benchmark is a planted incorrect assumption, not a wrong prior from training data. The mechanisms may be similar but the intervention pathway is different. This needs:
|
|
634
|
+
1. Empirical measurement of how often Subtype B vs Subtype A causes WorkTrain failures (the NS2 step from the independent research brief)
|
|
635
|
+
2. A controlled study of whether assumption-surfacing before acting actually reduces Subtype B failures
|
|
636
|
+
3. Design of the assumption-challenging agent -- what exactly it reads, what it produces, how the coordinator uses it
|
|
637
|
+
|
|
638
|
+
**Relationship to other entries:**
|
|
639
|
+
- "Intent resolution" (above): addresses Subtype A. This entry is the Subtype B complement.
|
|
640
|
+
- "Living work context": the per-workspace knowledge store of codebase surprises is partial infrastructure for fixing Subtype B across sessions.
|
|
641
|
+
- "Knowledge graph" (backlog): structural understanding of the codebase that would give the agent a ground-truth model to compare its priors against.
|
|
642
|
+
- "Context isolation modes": the assumption-challenging agent needs `mode: 'blind'` to approach the codebase without anchoring on the primary agent's stated assumptions.
|
|
643
|
+
|
|
644
|
+
**Things to hash out:**
|
|
645
|
+
- How do you distinguish "the agent has a wrong prior" from "the ticket is genuinely ambiguous about which part of the system to change"? The boundary is fuzzy -- a ticket that doesn't name the specific module is Subtype A; a ticket that names the module but the agent's model of that module is wrong is Subtype B.
|
|
646
|
+
- What format should "stated assumptions" take? Free-prose is hard to verify. A structured list of `{ assumption: string, evidence: string, falsificationQuery: string }` is verifiable but requires the agent to produce it honestly.
|
|
647
|
+
- The assumption-challenging agent needs to approach the codebase independently. But it also needs to know what assumptions to challenge -- which means it needs the primary agent's stated assumption list. Is that contamination? No -- it is exactly the right input. The isolation is from the primary agent's conclusions, not its stated premises.
|
|
648
|
+
- How does this interact with the `skipIntentResolution` escape hatch? Subtype B failures can occur even on tickets that pass quality pre-screening and look unambiguous. The skip hatch should not bypass assumption surfacing for `'refactor'` or `'architectural'` tasks.
|
|
649
|
+
- Is the right long-term fix a knowledge graph (structural ground truth the agent can compare its model against) rather than per-session assumption surfacing? Knowledge graph is higher-confidence but much higher cost to build. Assumption surfacing is lower cost but relies on the agent honestly reporting its own priors.
|
|
650
|
+
|
|
651
|
+
---
|
|
652
|
+
|
|
226
653
|
### Scope rationalization: agent silently accepts collateral damage (Apr 30, 2026)
|
|
227
654
|
|
|
228
655
|
**Status: idea** | Priority: medium
|
|
@@ -260,10 +687,20 @@ The autonomous workflow runner (`worktrain daemon`). Completely separate from th
|
|
|
260
687
|
|
|
261
688
|
### Living work context: shared knowledge document that accumulates across the full pipeline (Apr 30, 2026)
|
|
262
689
|
|
|
263
|
-
**Status:
|
|
690
|
+
**Status: partial** | Core infra shipped May 5, 2026 (PR #939). Three gaps remain.
|
|
264
691
|
|
|
265
692
|
**Score: 13** | Cor:3 Cap:3 Eff:2 Lev:3 Con:2 | Blocked: no
|
|
266
693
|
|
|
694
|
+
**Shipped (PR #939):** `ShapingHandoffArtifactV1` + `CodingHandoffArtifactV1` + enriched `DiscoveryHandoffArtifactV1`, `PhaseHandoffArtifact` union, `buildContextSummary()` pure function with per-phase selection, `PipelineRunContext` per-run JSON with `PhaseResult<T>`, crash recovery via `active-run.json` pointer, phase quality gates (fallback escalates, partial warns), persistence failure escalation, 4 workflow authoring changes, adversarial behavioral test (AC 21), `contractRef` validation test. Deferred: `buildSystemPrompt()` named semantic slots, console visualization, retry logic, epic-mode task graph, extensible contract registration, per-workflow lifecycle artifact tests.
|
|
695
|
+
|
|
696
|
+
**Remaining gaps (not tracked elsewhere):**
|
|
697
|
+
|
|
698
|
+
1. **No end-to-end validation that context reaches downstream agents.** The `assembledContextSummary` is wired through `trigger.context` → `buildSystemPrompt()` → system prompt, but there is no test that runs a full pipeline (discovery → shaping → coding) and asserts that the coding agent's system prompt actually contains the discovery context. The adversarial behavioral test (AC 21) proves the pipeline structure -- it does not prove the context content is meaningful to the downstream agent.
|
|
699
|
+
|
|
700
|
+
2. **Not all coordinator pipeline modes populate `assembledContextSummary`.** Some modes (e.g. quick-review) may exit without writing a full `PipelineRunContext`. When context is absent, `buildSystemPrompt()` silently injects nothing -- the downstream agent gets no prior context with no warning. There is no check that the coordinator always writes context before dispatching a downstream session.
|
|
701
|
+
|
|
702
|
+
3. **No operator visibility into injected context.** The "Prior Context" section in an agent's system prompt is invisible from the console. An operator has no way to see what context was injected into a session without reading raw conversation logs. The console should surface this -- at minimum, whether the session had prior context and how many bytes.
|
|
703
|
+
|
|
267
704
|
When a multi-agent pipeline runs -- discovery → shaping → coding → review → fix → re-review -- no agent has a complete picture of what came before it. The coding agent has the goal. The review agent has the code. The fix agent has the findings. None of them have the accumulated context from the full pipeline: why this approach was chosen over alternatives, what was ruled out, what constraints were discovered, what architectural decisions were made, what edge cases were handled, what the review found and why.
|
|
268
705
|
|
|
269
706
|
Each agent reconstructs intent from incomplete context, which is why review finds things coding missed (review doesn't know what the coding agent was trying to do), why fix sessions address symptoms without understanding causes (no access to the architectural reasoning), and why agents repeat work that earlier agents already did.
|
|
@@ -352,6 +789,67 @@ This is related to the "Coordinator context injection standard" and "Context bud
|
|
|
352
789
|
|
|
353
790
|
---
|
|
354
791
|
|
|
792
|
+
### Subagent context isolation modes: enforced context sharing and contamination prevention (May 5, 2026)
|
|
793
|
+
|
|
794
|
+
**Status: idea** | Priority: high
|
|
795
|
+
|
|
796
|
+
**Score: 12** | Cor:3 Cap:2 Eff:2 Lev:3 Con:2 | Blocked: no
|
|
797
|
+
|
|
798
|
+
When WorkTrain spawns a subagent, the spawning agent decides what context to pass. Today this is purely by convention -- there is no mechanism to enforce isolation or guarantee completeness. Two distinct failure modes require opposite fixes:
|
|
799
|
+
|
|
800
|
+
**Contamination (too much context):** A challenger agent spawned to independently evaluate an interpretation receives the primary agent's interpretation in the context bundle. It anchors on it and produces a biased reading. A review agent receives the coding agent's self-assessment and validates it rather than challenging it. These are cases where context leakage actively undermines the agent's purpose -- independence destroyed by prior context.
|
|
801
|
+
|
|
802
|
+
**Starvation (too little context):** A coding agent spawned without discovery findings re-investigates settled questions. A review agent without shaping constraints cannot check whether the implementation satisfies them. Context absence causes wasted work or wrong output.
|
|
803
|
+
|
|
804
|
+
Today both are addressed by convention. Convention fails silently -- the spawning agent follows its own judgment, which may be wrong. Even the orchestrating agent can contaminate a challenger without realizing it (as happened when spawning the research agents in this session without realizing context was being leaked).
|
|
805
|
+
|
|
806
|
+
**The right fix is structural enforcement, not rules.** Context isolation mode should be a declared property of the spawn call, enforced by coordinator infrastructure, not managed by following instructions.
|
|
807
|
+
|
|
808
|
+
**Proposed isolation modes:**
|
|
809
|
+
|
|
810
|
+
```typescript
|
|
811
|
+
type ContextIsolationMode =
|
|
812
|
+
| { mode: 'full' }
|
|
813
|
+
// Agent receives complete accumulated context: Tier 0 project identity +
|
|
814
|
+
// prior phase artifacts + task context. Default for most pipeline phases.
|
|
815
|
+
|
|
816
|
+
| { mode: 'task-only' }
|
|
817
|
+
// Agent receives only task description + Tier 0 project identity.
|
|
818
|
+
// No prior phase artifacts, no intermediate results.
|
|
819
|
+
// For agents that should approach the task fresh but know the project.
|
|
820
|
+
|
|
821
|
+
| { mode: 'blind' }
|
|
822
|
+
// Agent receives only the raw inputs declared at spawn time.
|
|
823
|
+
// No Tier 0 injection, no prior artifacts, no accumulated context.
|
|
824
|
+
// For adversarial/challenger agents where independence is the whole point.
|
|
825
|
+
// The spawning call must explicitly declare what inputs to pass.
|
|
826
|
+
|
|
827
|
+
| { mode: 'custom'; include: ContextKey[]; exclude: ContextKey[] }
|
|
828
|
+
// Explicit allowlist/blocklist. For partial context cases
|
|
829
|
+
// (e.g. review agent gets shaping constraints but not coding agent's self-assessment).
|
|
830
|
+
```
|
|
831
|
+
|
|
832
|
+
`mode: 'blind'` should be the enforced default for any session with `role: 'challenger' | 'adversarial' | 'evaluator'`. The coordinator cannot accidentally contaminate a challenger when the session declaration forbids it.
|
|
833
|
+
|
|
834
|
+
**Note on 'blind' mode:** true blindness (no Tier 0 either) may be too aggressive. A challenger without the project's coding philosophy or architectural principles is missing the most important constraints. "No prior phase artifacts" is probably the right isolation boundary, not "no context whatsoever." A `challenger` mode that strips prior results but keeps Tier 0 may be more useful. Open question.
|
|
835
|
+
|
|
836
|
+
**Enforcement point:** `spawnSession` in the coordinator infrastructure (`createCoordinatorDeps`). The spawning call declares the mode; the infrastructure assembles the context bundle according to the declared mode; the spawning agent cannot override it by passing extra fields. Validate at boundaries, trust inside.
|
|
837
|
+
|
|
838
|
+
**Observability:** when an evaluation was produced by a `blind` or `task-only` session, that fact should be recorded in the session store so the independence of the evaluation is auditable. Without this, the isolation guarantee is invisible.
|
|
839
|
+
|
|
840
|
+
**Relationship to existing entries:**
|
|
841
|
+
- "Subagent context package" (above) is about ensuring agents receive enough context -- the `full` and `task-only` modes are the enforcement side of that design.
|
|
842
|
+
- "Council of agents" in the intent resolution entry assumes `blind` mode for challengers -- this entry is what makes that assumption enforceable.
|
|
843
|
+
- `buildContextSummary(priorArtifacts, targetPhase)` in living work context is the selection logic for `custom` mode.
|
|
844
|
+
|
|
845
|
+
**Things to hash out:**
|
|
846
|
+
- Should `mode` be declared on the workflow definition, the trigger, or the `spawnSession` call? Workflow definition is the right answer (the workflow knows its role), but requires a new schema field.
|
|
847
|
+
- How does declared mode interact with the agent's tool access? A `blind` challenger can still read workspace files. True isolation may require tool path restrictions alongside context restrictions.
|
|
848
|
+
- Custom `include`/`exclude` lists create maintenance burden as context keys evolve. Is there a better abstraction -- e.g. declaring the agent's role and having infrastructure derive the right context set from a role-to-context mapping?
|
|
849
|
+
- Should `task-only` include or exclude Tier 0 project identity? Including it is almost always better, but the operator may have reasons to exclude it.
|
|
850
|
+
|
|
851
|
+
---
|
|
852
|
+
|
|
355
853
|
### Agent-assisted backlog and issue enrichment (Apr 28, 2026)
|
|
356
854
|
|
|
357
855
|
**Status: idea** | Priority: medium
|
|
@@ -619,6 +1117,25 @@ The daemon reads `triggers.yml` once at startup. Any change requires a full daem
|
|
|
619
1117
|
|
|
620
1118
|
---
|
|
621
1119
|
|
|
1120
|
+
### External task tracker integrations: Jira, Linear, Notion, and beyond (Apr 30, 2026)
|
|
1121
|
+
|
|
1122
|
+
**Status: idea** | Priority: medium
|
|
1123
|
+
|
|
1124
|
+
**Score: 11** | Cor:1 Cap:3 Eff:1 Lev:3 Con:2 | Blocked: no
|
|
1125
|
+
|
|
1126
|
+
WorkTrain currently picks up work from GitHub and GitLab. Most engineering teams track work in Jira, Linear, Notion, or similar systems -- not in GitHub issues. Without native trigger adapters for these systems, WorkTrain cannot be used as the default development workflow for teams that don't use GitHub Issues as their primary tracker.
|
|
1127
|
+
|
|
1128
|
+
The vision says WorkTrain picks up tasks "from external systems (GitHub issues, GitLab MRs, Jira tickets, webhooks)." The webhook trigger (`provider: generic`) handles anything with a POST endpoint, but it requires the operator to wire up field extraction manually and provides no assignee filtering, label filtering, or status-transition detection out of the box. A first-class adapter for each tracker would handle the integration details and give operators a clean configuration surface.
|
|
1129
|
+
|
|
1130
|
+
**Things to hash out:**
|
|
1131
|
+
- What is the right abstraction boundary? A generic polling adapter with per-tracker field mapping (same pattern as `github_issues_poll` / `gitlab_poll`) vs. a more opinionated per-tracker adapter that understands Jira workflow states, Linear priorities, etc.
|
|
1132
|
+
- Jira's API requires OAuth or API token; Linear uses API keys; Notion uses integration tokens. Is secret resolution via `$ENV_VAR_NAME` sufficient, or is a richer credentials model needed?
|
|
1133
|
+
- For Jira specifically: issue assignment events are not available via webhook without Jira admin access to configure webhooks. Does WorkTrain need a polling adapter (`jira_poll`) as the primary path, with webhook as an optional enhancement?
|
|
1134
|
+
- What context does each tracker inject into the workflow session? Jira issues have epics, acceptance criteria, sprint context, labels. Linear issues have priority, team, estimate, project. The context mapping needs to capture what's useful without overwhelming the session.
|
|
1135
|
+
- How does deduplication work across tracker adapters? A Jira issue that was already picked up and is in-flight should not be dispatched again on the next poll cycle, even if it was updated.
|
|
1136
|
+
|
|
1137
|
+
---
|
|
1138
|
+
|
|
622
1139
|
### GitHub webhook trigger with assignee/event filtering (Apr 20, 2026)
|
|
623
1140
|
|
|
624
1141
|
**Status: idea** | Priority: medium-high
|
|
@@ -879,6 +1396,8 @@ Demo repo tasks (worktrain:ready issues)
|
|
|
879
1396
|
|
|
880
1397
|
**Score: 11** | Cor:3 Cap:2 Eff:2 Lev:2 Con:2 | Blocked: no
|
|
881
1398
|
|
|
1399
|
+
**Note (May 5, 2026):** PR #939 shipped *coordinator-level* pipeline crash recovery: `active-run.json` pointer + `PipelineRunContext` file allow the next coordinator startup to restore prior phase artifacts and resume without re-running completed phases. This item is about *agent session* crash recovery (the agent itself dies mid-session, worktree state, step advances). Both layers are needed.
|
|
1400
|
+
|
|
882
1401
|
**The problem:** A daemon crash loop kills all in-flight sessions. The queue correctly detects the sidecar and skips re-dispatch for the TTL window, but when the sidecar expires the session is re-dispatched from scratch with zero context. An agent that spent 10 min in Phase 0, read codebase files, and formed a plan loses all of that work.
|
|
883
1402
|
|
|
884
1403
|
**What we want:** WorkTrain detects orphaned sessions on startup and makes an autonomous decision: resume if meaningful progress was made, discard and re-dispatch from scratch if too early to be worth resuming.
|
|
@@ -1501,7 +2020,7 @@ Each file is injected only into sessions running the matching pipeline phase. Re
|
|
|
1501
2020
|
|
|
1502
2021
|
**Status: idea** | Priority: medium
|
|
1503
2022
|
|
|
1504
|
-
**Score: 9** | Cor:1 Cap:2 Eff:2 Lev:2 Con:2 | Blocked:
|
|
2023
|
+
**Score: 9** | Cor:1 Cap:2 Eff:2 Lev:2 Con:2 | Blocked: no (unblocked by Apr 30 discovery -- context assembly does not require the knowledge graph)
|
|
1505
2024
|
|
|
1506
2025
|
**Problem:** `src/coordinators/pr-review.ts` is already ~500 LOC doing session dispatch, result aggregation, finding classification, merge routing, message queue drain, and outbox writes. Adding knowledge graph queries, context bundle assembly, and prior session lookups would create a god class.
|
|
1507
2026
|
|
|
@@ -1509,18 +2028,17 @@ Each file is injected only into sessions running the matching pipeline phase. Re
|
|
|
1509
2028
|
```
|
|
1510
2029
|
Trigger layer src/trigger/ receives events, validates, enqueues
|
|
1511
2030
|
Dispatch layer (TBD) decides which workflow + what goal
|
|
1512
|
-
Context assembly
|
|
2031
|
+
Context assembly src/daemon/ enriches trigger before runWorkflow() fires
|
|
1513
2032
|
Orchestration layer src/coordinators/ spawns, awaits, routes, retries, escalates
|
|
1514
2033
|
Delivery layer src/trigger/delivery posts results back to origin systems
|
|
1515
2034
|
```
|
|
1516
2035
|
|
|
1517
|
-
**Context assembly
|
|
2036
|
+
**Resolution from Apr 30 discovery:** Context assembly does NOT require the knowledge graph as a prerequisite. The universal enricher (Phase 1 of the memory architecture) provides a structural context assembly layer via `WorkflowEnricher` injected into `runWorkflow()` -- this IS the missing layer. The orchestration scripts (coordinators) continue to add task-specific richer context on top (phase artifacts, git diff for PRs) via the existing `assembledContextSummary` mechanism. The two layers compose: universal enricher provides the floor, coordinators provide the ceiling.
|
|
1518
2037
|
|
|
1519
|
-
**
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
-
|
|
1523
|
-
- Who owns the context assembly API contract -- the engine (as a new primitive), the daemon (as an infrastructure capability), or user-authored scripts?
|
|
2038
|
+
**The Dispatch layer question** is resolved by the adaptive pipeline coordinator (`src/coordinators/adaptive-pipeline.ts`) -- it IS the dispatch layer for queue-polled tasks. For webhook-triggered tasks, `TriggerRouter.route()` performs dispatch. The layering is already present; it just isn't documented as such.
|
|
2039
|
+
|
|
2040
|
+
**Remaining open question:**
|
|
2041
|
+
- When a coordinator calls `spawnSession()` with an `assembledContextSummary`, should the universal enricher's prior-notes injection be suppressed (coordinator already covered it) or additive (both run)? The discovery recommends suppression -- enricher skips prior notes when `assembledContextSummary` is already set.
|
|
1524
2042
|
|
|
1525
2043
|
---
|
|
1526
2044
|
|
|
@@ -1949,6 +2467,42 @@ When an MR review session (run by a WorkTrain agent) finds issues in a coding se
|
|
|
1949
2467
|
|
|
1950
2468
|
---
|
|
1951
2469
|
|
|
2470
|
+
### wr.discovery lacks domain-specific ideation guidance (May 6, 2026)
|
|
2471
|
+
|
|
2472
|
+
**Status: idea** | Priority: medium
|
|
2473
|
+
|
|
2474
|
+
**Score: 9** | Cor:1 Cap:2 Eff:2 Lev:2 Con:2 | Blocked: no
|
|
2475
|
+
|
|
2476
|
+
`wr.discovery` classifies `problemDomain` (software / product / ux / personal / general) and uses it for a few things -- philosophy source lookup, vision doc location, and `decisionCriteria` examples. But candidate generation, challenge framing, and resolution path guidance do not adapt to domain at all. A personal career decision, a product strategy question, and a software architecture problem have meaningfully different ideation patterns, different failure modes in candidate generation, different challenge rubrics, and different resolution artifacts. The workflow currently treats them all identically after `problemDomain` is set.
|
|
2477
|
+
|
|
2478
|
+
The result is that `problemDomain` is a classification that carries almost no behavioral weight past phase-0 and phase-2. It reads well but does not change the actual work.
|
|
2479
|
+
|
|
2480
|
+
**Things to hash out:**
|
|
2481
|
+
- Where is domain-specific guidance most needed? Candidate generation (different ideation patterns per domain) and challenge framing (different adversarial angles) are the clearest gaps. Are there others -- resolution mode selection, confidence dimensions, handoff format?
|
|
2482
|
+
- What is the right mechanism -- `promptFragments` conditioned on `problemDomain`, a domain-specific routine injected via `templateCall`, or richer domain context blocks injected at workflow start? The answer probably varies by where in the workflow the guidance applies.
|
|
2483
|
+
- How much domain specificity is enough? Software vs non-software is the biggest gap. Within non-software, personal vs product vs ux are also meaningfully different. Is a two-level split (software / general) sufficient for now, or is the full five-way split worth tackling immediately?
|
|
2484
|
+
- Are there domain-specific output formats worth considering? A personal decision probably ends with a different handoff shape than a software architecture decision -- different fields, different confidence dimensions, different "next actions" structure.
|
|
2485
|
+
|
|
2486
|
+
---
|
|
2487
|
+
|
|
2488
|
+
### wr.discovery anchors candidates to existing infrastructure instead of the ideal solution (Apr 30, 2026)
|
|
2489
|
+
|
|
2490
|
+
**Status: idea** | Priority: high
|
|
2491
|
+
|
|
2492
|
+
**Score: 11** | Cor:1 Cap:3 Eff:2 Lev:3 Con:2 | Blocked: no
|
|
2493
|
+
|
|
2494
|
+
`wr.discovery` produces candidates bounded by what already exists. The landscape step grounds the agent in the current codebase, which anchors candidate generation to what is buildable today rather than what would be best. On a discovery run for context-passing, for example, candidates are shaped by the current pre-load architecture instead of questioning whether pre-load is the right model at all. Decisions that should be challenged by the discovery process are instead silently inherited from it.
|
|
2495
|
+
|
|
2496
|
+
The result is that discovery optimizes within the current design space rather than finding the edge of it. Problems that require restructuring existing code -- not just adding to it -- tend to produce timid candidates that paper over the root cause instead of addressing it. Discovery is supposed to find the best answer; it is currently finding the best answer that doesn't require changing much.
|
|
2497
|
+
|
|
2498
|
+
**Things to hash out:**
|
|
2499
|
+
- Should the ideal-first reasoning happen before or after the landscape pass? Before risks ignoring hard constraints; after risks being anchored by them. What is the right sequencing, and is it always the same or does it depend on the problem type?
|
|
2500
|
+
- How do non-negotiable constraints (e.g. "must not change the engine API", "must work without a running daemon") get introduced without becoming the excuse for avoiding the best answer? There's a real difference between a hard constraint and an inherited assumption that could be challenged.
|
|
2501
|
+
- Is "what would the ideal look like, and what's the migration path from here?" a step inside discovery, or does it belong in `wr.shaping`? Shaping already produces an appetite and scope cut -- is ideal-first reasoning a discovery concern or a shaping concern, or does each need it independently?
|
|
2502
|
+
- When the ideal requires multi-sprint groundwork (e.g. "first build the KG, then build context assembly on top of it"), how should discovery represent that? As a sequenced multi-phase candidate? As a separate "phase 1" item that gets its own discovery?
|
|
2503
|
+
|
|
2504
|
+
---
|
|
2505
|
+
|
|
1952
2506
|
### Workflow previewer for compiled and runtime behavior
|
|
1953
2507
|
|
|
1954
2508
|
**Status: idea** | Priority: medium
|
|
@@ -2780,33 +3334,33 @@ openclaw is worth studying deeply before building out the platform layer. Draw i
|
|
|
2780
3334
|
|
|
2781
3335
|
**Status: idea** | Priority: medium
|
|
2782
3336
|
|
|
2783
|
-
**Score: 10** | Cor:1 Cap:3 Eff:1 Lev:3 Con:2 | Blocked:
|
|
3337
|
+
**Score: 10** | Cor:1 Cap:3 Eff:1 Lev:3 Con:2 | Blocked: yes (needs MemoryStore first as Phase 2 prerequisite)
|
|
2784
3338
|
|
|
2785
|
-
**Problem:** Every session starts with a full repo sweep. Context gathering subagents re-read the same files, re-trace the same call chains, re-identify the same invariants.
|
|
3339
|
+
**Problem:** Every session starts with a full repo sweep. Context gathering subagents re-read the same files, re-trace the same call chains, re-identify the same invariants. And cross-session semantic queries ("what did we find about this module last week") cannot be answered without a vector index.
|
|
3340
|
+
|
|
3341
|
+
**Position in the phased memory architecture (from Apr 30 discovery):** This is Phase 3 in a four-phase sequence. Phase 0 (bug fixes) → Phase 1 (universal enricher) → Phase 2 (MemoryStore SQLite) → Phase 3 (knowledge graph). The MemoryStore SQLite from Phase 2 answers 6 of 8 memory queries without a vector model. The knowledge graph adds the remaining two: code-structure traversal (Q8) and semantic similarity ("what is related to X"). Phase 3a (structural layer) extends the existing spike; Phase 3b (vector layer) is a feature flag.
|
|
2786
3342
|
|
|
2787
3343
|
**Design -- two-layer hybrid:**
|
|
2788
3344
|
|
|
2789
|
-
**Layer 1: Structural graph (hard edges, deterministic)**
|
|
2790
|
-
|
|
3345
|
+
**Layer 1: Structural graph (hard edges, deterministic) -- Phase 3a**
|
|
3346
|
+
Extends existing `src/knowledge-graph/` spike (DuckDB + ts-morph, already in `dependencies`). New node kinds: `session`, `pipeline_run`, `workspace_convention`. New edge kinds: `produced_by` (session → file), `applies_to_workspace`. Current spike only tracks import edges and CLI commands; session data from Phase 2 MemoryStore migrates here. Answers: "what imports trigger-router.ts?", "what files did session X touch?", "what sessions ran in this workspace?"
|
|
2791
3347
|
|
|
2792
|
-
**Layer 2: Vector similarity (soft weights, semantic)**
|
|
2793
|
-
|
|
3348
|
+
**Layer 2: Vector similarity (soft weights, semantic) -- Phase 3b (feature flag)**
|
|
3349
|
+
LanceDB (embedded, TypeScript-native, local-first). Embeddings over session recaps and workspace conventions. Off by default (`WORKRAIL_VECTOR_SEARCH=1` to enable). Answers: "what sessions are semantically related to this bug?", "what workspace conventions mention authentication?"
|
|
2794
3350
|
|
|
2795
3351
|
**Technology:**
|
|
2796
|
-
- Structural: `ts-morph` + DuckDB
|
|
2797
|
-
- Vector: LanceDB + local embedding model
|
|
2798
|
-
- Unified query: `
|
|
2799
|
-
|
|
2800
|
-
**Build order:** Structural layer spike first (1-day). Vector layer after spike proves the foundation. Incremental update: re-index only files in `filesChanged` after each session.
|
|
3352
|
+
- Structural: `ts-morph` + DuckDB (existing spike, already in dependencies)
|
|
3353
|
+
- Vector: LanceDB + local embedding model -- `@xenova/transformers` (in-process, no external dep) preferred over Ollama (better quality but requires external process)
|
|
3354
|
+
- Unified query: `query_knowledge(intent, workspacePath)` replaces `query_memory` tool when Phase 3a lands
|
|
2801
3355
|
|
|
2802
3356
|
**Build decision (from Apr 15 research):** ts-morph + DuckDB wins. Cognee: Python-only. GraphRAG/LightRAG: use LLMs to build graph (violates scripts-over-agent). Mem0/Zep: conversational memory, not code graphs. Sourcegraph: enterprise weight, overkill.
|
|
2803
3357
|
|
|
2804
3358
|
**Things to hash out:**
|
|
2805
|
-
-
|
|
2806
|
-
-
|
|
2807
|
-
- The
|
|
2808
|
-
- DuckDB is in-process --
|
|
2809
|
-
- Is the KG per-workspace or global?
|
|
3359
|
+
- Phase 3a scope: should the structural layer replace the Phase 2 SQLite MemoryStore (same data, different engine) or exist alongside it? Replacing is cleaner; coexisting avoids a migration.
|
|
3360
|
+
- `@xenova/transformers` vs Ollama for Phase 3b: @xenova runs in-process (no setup friction) but has lower embedding quality. Ollama is better quality but adds an external process dependency. Which matters more for the target user base?
|
|
3361
|
+
- The incremental update strategy (re-index only `filesChanged` after each session) requires accurate change tracking. What is the fallback when `filesChanged` is unavailable?
|
|
3362
|
+
- DuckDB is in-process -- WAL mode handles read concurrency but writes are serialized. Is the concurrency story acceptable when 3 sessions complete simultaneously?
|
|
3363
|
+
- Is the KG per-workspace or global? Per-workspace is simpler; global enables cross-workspace queries but adds federation complexity.
|
|
2810
3364
|
|
|
2811
3365
|
---
|
|
2812
3366
|
|
|
@@ -4292,3 +4846,63 @@ WorkTrain has no tooling to surface the state of worktrees and branches relative
|
|
|
4292
4846
|
- Common-ground `make sync` distributing the script reliably
|
|
4293
4847
|
|
|
4294
4848
|
**Priority:** Medium. The shared scripts work and have been tested. Main remaining work is the shell wrapper, token storage, and integration with common-ground's team config.
|
|
4849
|
+
|
|
4850
|
+
---
|
|
4851
|
+
|
|
4852
|
+
### Cross-system blind benchmark: compare AI coding tools/models on the same tasks (May 6, 2026)
|
|
4853
|
+
|
|
4854
|
+
**Status: idea** | Priority: medium
|
|
4855
|
+
|
|
4856
|
+
**Score: 9** | Cor:1 Cap:3 Eff:1 Lev:2 Con:2 | Blocked: no
|
|
4857
|
+
|
|
4858
|
+
There is no reproducible way to compare WorkTrain against other AI coding systems (Cursor, Copilot, raw Claude Code, competing agent frameworks) or to compare model families within WorkTrain on the same real tasks. Without this, claims about WorkTrain's quality are anecdotal and there is no principled way to understand where WorkTrain adds value versus where it falls short.
|
|
4859
|
+
|
|
4860
|
+
**Things to hash out:**
|
|
4861
|
+
- What constitutes a valid "task" for comparison? Real GitHub issues from a well-understood repo are higher quality than synthetic benchmarks, but may not reproduce cleanly across different tool setups. What is the minimum reproducibility requirement?
|
|
4862
|
+
- How do you grade fairly? A grader that can see code style, comments, or formatting may infer which system produced the output. What does true blind evaluation look like here, and how blind is "blind enough"?
|
|
4863
|
+
- Should the rubric be global (same for all task types) or per-task-type (refactor vs feature vs bug fix)?
|
|
4864
|
+
- Token usage comparison requires accurate per-system accounting. Not all tools expose this. Is a cost-adjusted comparison feasible, or does this reduce to a quality-only benchmark?
|
|
4865
|
+
- Is this a one-time study or a continuous regression benchmark? The demo-repo benchmark entry covers regression -- this is specifically about cross-system comparative evaluation.
|
|
4866
|
+
|
|
4867
|
+
**Relationship to existing entries:** the demo-repo benchmark (existing entry) runs the same tasks after each WorkRail release to track regression. This entry is about comparing WorkTrain vs other systems, not WorkTrain past vs present.
|
|
4868
|
+
|
|
4869
|
+
---
|
|
4870
|
+
|
|
4871
|
+
### WorkTrain as a full software team: design, PM, data science, opex, and everything in between (May 6, 2026)
|
|
4872
|
+
|
|
4873
|
+
**Status: idea** | Priority: high
|
|
4874
|
+
|
|
4875
|
+
**Score: 13** | Cor:2 Cap:3 Eff:1 Lev:3 Con:2 | Blocked: no
|
|
4876
|
+
|
|
4877
|
+
The current vision defines WorkTrain as an autonomous *software development* system. But shipping software requires more than coding -- product management, design, data science, operations, release engineering, and the feedback loop from production back into ideas are all necessary to deliver something that works and keeps working. WorkTrain currently handles only the coding-and-review slice of this. Everything before "write the code" (discovery what to build, analyzing what users actually need) and everything after "merge the PR" (instrumentation, metrics analysis, idea generation, rollout management, incident response) is done manually.
|
|
4878
|
+
|
|
4879
|
+
The result is that the value loop -- PR → metrics → insight → idea → spec → PR -- is only partially automated. Humans still have to bridge analysis → idea and metrics → iteration gaps. An autonomous system that stops at "ship a PR" requires continuous human intervention to keep it pointed at the right work.
|
|
4880
|
+
|
|
4881
|
+
The constraint on idea generation specifically: ideas grounded in vague intuition are not useful. The gap is not that WorkTrain can't generate suggestions -- it can. The gap is that those suggestions are not grounded in specific, verifiable facts about the actual system and its users. An idea like "23% of users who reach step 3 abandon, and the median time on that step is 47 seconds, and here is what the error logs show" is categorically different from "users might want X."
|
|
4882
|
+
|
|
4883
|
+
**Relationship to existing entries:** Many existing backlog entries are partial implementations of this broader capability -- monitoring loops, analytics integration, feature flag management, opex, the blind benchmark entry. This entry captures the full frame so those entries can be understood as steps toward it rather than isolated features.
|
|
4884
|
+
|
|
4885
|
+
**Things to hash out:**
|
|
4886
|
+
- The vision.md defines WorkTrain as "autonomous software development." Does this require a vision revision, or is design/PM/data science/opex a natural extension of "everything that ships software"?
|
|
4887
|
+
- Design and PM work requires product domain knowledge -- not just technical knowledge. There is no obvious equivalent of AGENTS.md for product context. What is the right mechanism for WorkTrain to acquire and maintain that context?
|
|
4888
|
+
- Data science work requires access to event logs, metrics stores, and potentially sensitive user data. What is the authorization model? What is the minimum access needed to produce useful insights without exposing sensitive data?
|
|
4889
|
+
- Release management requires write access to production systems (feature flag platforms, deployment infrastructure). What safeguards are necessary before WorkTrain can act autonomously there?
|
|
4890
|
+
- Opex (incident response, SLO management) has a different urgency profile than coding work. How does it fit into the existing pipeline model, which is designed for hours-to-days timescales?
|
|
4891
|
+
|
|
4892
|
+
---
|
|
4893
|
+
|
|
4894
|
+
### Task completion enforcement: detect and prevent deferred work within tasks (May 6, 2026)
|
|
4895
|
+
|
|
4896
|
+
**Status: idea** | Priority: high
|
|
4897
|
+
|
|
4898
|
+
**Score: 12** | Cor:3 Cap:2 Eff:2 Lev:2 Con:2 | Blocked: no
|
|
4899
|
+
|
|
4900
|
+
Agents routinely defer work within tasks rather than completing it. Common patterns: "I'll file a ticket for this later," "this is out of scope, leaving for a follow-up," "TODO: handle this edge case," "I noticed X but didn't address it to stay focused." These deferral patterns are individually plausible but collectively mean tasks are never actually finished -- they transition from "in progress" to "apparently done" while work accumulates in a long tail of unfiled tickets and unresolved TODOs.
|
|
4901
|
+
|
|
4902
|
+
There is no mechanism to distinguish "this genuinely needs a separate session with different scope" from "I could have done this but chose not to." There is no enforcement that deferred items are tracked and eventually completed. There is no way to prove a task is actually done versus claimed done. A task that leaves TODOs in the code, or that defers 3 of its 5 acceptance criteria, is not done -- but the system currently has no way to detect or prevent this.
|
|
4903
|
+
|
|
4904
|
+
**Things to hash out:**
|
|
4905
|
+
- What does "done" mean in a provable sense? What evidence would allow a coordinator to conclude that a task is complete rather than merely that an agent has stopped working on it?
|
|
4906
|
+
- How do you distinguish legitimate scope decisions from avoidance? A session on a performance bug that surfaces an unrelated security issue is right to defer the security issue. A session that addresses only 2 of 3 acceptance criteria is not. What is the principled distinction?
|
|
4907
|
+
- TODO comments in code are not always deferred work -- some are architectural notes, some are pre-existing. How do you identify TODOs that represent deferred task-scope work versus incidental notes?
|
|
4908
|
+
- How does this interact with the existing stuck detection system? A stuck agent and a "done-claiming but not actually done" agent are different failure modes. How does the system tell them apart?
|