@exaudeus/workrail 3.73.2 → 3.74.1
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/cli-worktrain.js +126 -1
- package/dist/console-ui/assets/{index-CfI4I3OX.js → index-BmDxs-a5.js} +1 -1
- package/dist/console-ui/index.html +1 -1
- package/dist/coordinators/pr-review.d.ts +11 -1
- package/dist/coordinators/types.d.ts +15 -0
- package/dist/coordinators/types.js +2 -0
- package/dist/manifest.json +17 -9
- package/dist/trigger/coordinator-deps.js +203 -36
- package/docs/authoring.md +23 -0
- package/docs/ideas/backlog.md +299 -60
- package/docs/planning/README.md +6 -9
- package/docs/roadmap/archive/README.md +8 -0
- package/docs/tickets/next-up.md +6 -1
- package/docs/vision.md +115 -0
- package/package.json +1 -1
- package/spec/authoring-spec.json +36 -1
- /package/docs/roadmap/{now-next-later.md → archive/now-next-later.md} +0 -0
- /package/docs/roadmap/{open-work-inventory.md → archive/open-work-inventory.md} +0 -0
package/docs/vision.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# WorkTrain Vision
|
|
2
|
+
|
|
3
|
+
## What WorkTrain is
|
|
4
|
+
|
|
5
|
+
WorkTrain is an autonomous software development daemon. It runs continuously in the background, picks up tasks from external systems (GitHub issues, GitLab MRs, Jira tickets, webhooks), and drives them through the full development lifecycle -- discovery, shaping, implementation, review, fix, merge -- without human intervention between phases.
|
|
6
|
+
|
|
7
|
+
The operator's job is to configure what WorkTrain works on and what rules it follows. WorkTrain's job is to do the actual work, autonomously, reliably, and correctly.
|
|
8
|
+
|
|
9
|
+
## The self-improvement loop
|
|
10
|
+
|
|
11
|
+
WorkTrain builds WorkTrain. This is not a metaphor -- it is the intended operating mode and the ultimate test of whether the system works.
|
|
12
|
+
|
|
13
|
+
WorkTrain runs the workrail repository as one of its own workspaces. It picks up tickets from the workrail GitHub issue queue, runs the full pipeline (discovery, shaping, coding, review, fix, merge), and ships improvements to itself. Every feature built into WorkTrain is a feature WorkTrain could have built using its own infrastructure. Every bug fixed in WorkTrain is a bug WorkTrain found in itself.
|
|
14
|
+
|
|
15
|
+
This creates a direct feedback loop: if WorkTrain's development pipeline is flawed, it will produce flawed changes to itself and catch them in review. If its context injection is thin, it will miss things in its own codebase that a well-briefed agent would catch. The quality of WorkTrain's output is the quality of WorkTrain.
|
|
16
|
+
|
|
17
|
+
The self-improvement loop is not fully operational today. The pieces -- coordinator session chaining, full development pipeline, spec as ground truth, living work context -- are being built. But it is the north star. If WorkTrain cannot build WorkTrain well, it cannot be trusted to build anything else.
|
|
18
|
+
|
|
19
|
+
## What success looks like
|
|
20
|
+
|
|
21
|
+
An operator assigns a ticket to WorkTrain in the morning. By the time they check in, there is a merged PR, a closed ticket, and a summary of what was done and why. They did not intervene between phases. Nothing surprising happened that required their attention.
|
|
22
|
+
|
|
23
|
+
WorkTrain earns trust over time by doing this correctly, repeatedly, at scale -- not just for one-off tasks but as the default mode of software development. The ultimate expression of this: WorkTrain builds and ships improvements to itself, autonomously, using the same pipeline it uses for everything else.
|
|
24
|
+
|
|
25
|
+
## What WorkTrain is not
|
|
26
|
+
|
|
27
|
+
- **Not a chatbot or copilot.** WorkTrain does not assist humans doing development. It does development. The human is the operator, not the pair programmer.
|
|
28
|
+
- **Not the WorkRail MCP server.** The WorkRail engine and MCP server are infrastructure WorkTrain uses. They are separate systems. Do not conflate them.
|
|
29
|
+
- **Not a replacement for judgment.** WorkTrain surfaces decisions to humans when it hits genuine ambiguity. It does not pretend to understand things it does not, and it does not merge changes it is not confident in.
|
|
30
|
+
|
|
31
|
+
## How WorkTrain thinks about work
|
|
32
|
+
|
|
33
|
+
**Phases, not turns.** A task is a pipeline of phases: discovery, shaping, coding, review, fix, re-review, merge. Each phase is a session with a typed output contract. The coordinator decides what phase to run next based on the previous phase's structured result -- not on natural language reasoning.
|
|
34
|
+
|
|
35
|
+
**Zero LLM turns for routing.** Coordinator decisions -- what workflow to run next, whether findings are blocking, when to merge -- are deterministic TypeScript code. LLM turns are used for cognitive work: understanding code, writing code, evaluating findings. Never for deciding "what do I do next?".
|
|
36
|
+
|
|
37
|
+
**Structured outputs at every boundary.** Each phase produces a typed result. The next phase reads that result. Free-text scraping between phases is a design smell. `ChildSessionResult`, `wr.coordinator_result`, `wr.review_verdict` are the contracts that make phases composable without a main agent holding context.
|
|
38
|
+
|
|
39
|
+
**Correctness over speed.** WorkTrain does not merge changes it is not confident in. Review findings are addressed. Tests pass. The right next step is not always the fastest one.
|
|
40
|
+
|
|
41
|
+
## What makes WorkTrain different from other autonomous coding agents
|
|
42
|
+
|
|
43
|
+
Most autonomous coding agents are single-session: they get a task, they work on it, they produce output. WorkTrain is a pipeline system: each phase is isolated, typed, and observable. The coordinator has no implicit memory -- it only knows what the typed outputs of previous phases told it. This makes pipelines:
|
|
44
|
+
|
|
45
|
+
- **Reproducible**: the same task run twice takes the same path
|
|
46
|
+
- **Observable**: every phase, every result, every decision is in the session store
|
|
47
|
+
- **Recoverable**: a crashed phase is retried with the same inputs
|
|
48
|
+
- **Auditable**: no black box; you can see exactly what each phase decided and why
|
|
49
|
+
|
|
50
|
+
## Principles that guide every decision
|
|
51
|
+
|
|
52
|
+
1. **Zero LLM turns for routing** -- coordinator logic is code, not reasoning
|
|
53
|
+
2. **Typed contracts at phase boundaries** -- structured results, not free-text
|
|
54
|
+
3. **The spec is the source of truth** -- every agent in a pipeline reads the same spec
|
|
55
|
+
4. **Correctness over speed** -- do it right, not just done
|
|
56
|
+
5. **Observable by default** -- every decision visible in the session store and console
|
|
57
|
+
6. **Overnight-safe** -- the system must work while the operator is asleep
|
|
58
|
+
|
|
59
|
+
## Quality standards WorkTrain holds itself to
|
|
60
|
+
|
|
61
|
+
WorkTrain does not ship work it is not confident in. Specifically:
|
|
62
|
+
|
|
63
|
+
- Review findings are addressed before merge -- no "I'll file a ticket for this later" on findings that block
|
|
64
|
+
- Tests pass. If tests were broken before the task started, that is noted explicitly, not silently ignored
|
|
65
|
+
- A PR that triggered the escalating review chain (Critical finding → re-review → re-review) never auto-merges without human approval
|
|
66
|
+
- If WorkTrain makes a change that degrades something outside its immediate scope, it surfaces that -- it does not document collateral damage as "a known tradeoff" and move on
|
|
67
|
+
- When WorkTrain is wrong about something, it acknowledges it explicitly in the session notes so the next session starts with accurate context
|
|
68
|
+
|
|
69
|
+
## How WorkTrain handles uncertainty and mistakes
|
|
70
|
+
|
|
71
|
+
WorkTrain will make mistakes. The system is designed around this:
|
|
72
|
+
|
|
73
|
+
- When an agent is uncertain about the task intent, it states its interpretation explicitly before acting. The coordinator can pause and surface this to the operator rather than proceeding on a wrong assumption.
|
|
74
|
+
- Mistakes produce structured findings in the session store. The demo repo feedback loop and per-run retrospective are how WorkTrain learns from patterns of failure and improves its workflows over time.
|
|
75
|
+
- "That's out of scope for this task" is not a valid reason to proceed past something that is genuinely wrong. Scope is for routing work, not for suppressing correctness.
|
|
76
|
+
|
|
77
|
+
## The operator relationship
|
|
78
|
+
|
|
79
|
+
The operator configures what WorkTrain works on (triggers, workflows, workspace rules) and sets the boundaries within which it operates. WorkTrain decides autonomously how to do the work.
|
|
80
|
+
|
|
81
|
+
WorkTrain pauses and surfaces to the operator when:
|
|
82
|
+
- It encounters genuine ambiguity about what the task is asking for
|
|
83
|
+
- A finding is Critical and requires explicit human approval before merging
|
|
84
|
+
- A child session fails in a way that exhausts automated retries
|
|
85
|
+
- Something unexpected happened that the coordinator's routing logic does not cover
|
|
86
|
+
|
|
87
|
+
WorkTrain does not pause for: implementation decisions within a well-specified task, routine review findings it can fix autonomously, or any decision that fits within the rules the operator already configured.
|
|
88
|
+
|
|
89
|
+
This boundary is still being tested and refined through real usage. Where exactly "genuine ambiguity" begins is an open question.
|
|
90
|
+
|
|
91
|
+
## What is still being built
|
|
92
|
+
|
|
93
|
+
WorkTrain is not finished. The vision above is where it is going, not where it is today. Key pieces still in progress:
|
|
94
|
+
|
|
95
|
+
- **Living work context** -- shared knowledge store that accumulates across all phases so every agent starts informed (`docs/ideas/backlog.md`: "Living work context")
|
|
96
|
+
- **Coordinator pipeline templates** -- actual coordinator scripts for full development pipeline, bug-fix, grooming (`docs/ideas/backlog.md`: "Scripts-first coordinator")
|
|
97
|
+
- **`worktrain spawn`/`await` CLI** -- CLI surface for coordinator scripts
|
|
98
|
+
- **Knowledge graph** -- per-workspace structural understanding so agents skip discovery on repeated tasks
|
|
99
|
+
- **Spec as ground truth** -- wiring `wr.shaping` output into coordinator dispatch so coding/review agents work from the same spec
|
|
100
|
+
|
|
101
|
+
For the current prioritized list, see `npm run backlog` or `docs/ideas/backlog.md`.
|
|
102
|
+
|
|
103
|
+
## Open questions
|
|
104
|
+
|
|
105
|
+
These are genuinely unresolved. Any agent operating in this system should know they exist and not assume they are answered.
|
|
106
|
+
|
|
107
|
+
- **Does WorkTrain need a main orchestrating agent?** The vision calls for pure coordinator scripts with zero LLM routing turns. But when something unexpected happens mid-pipeline -- a child session returns an ambiguous result, a finding doesn't fit expected categories -- a deterministic script either fails or ignores it. Whether a thin "judgment agent" is needed at the coordinator level, or whether well-designed typed contracts make it unnecessary, is an empirical question that requires real pipeline testing to answer.
|
|
108
|
+
|
|
109
|
+
- **Where exactly is the operator boundary?** The rules above are directionally right but have fuzzy edges. "Genuine ambiguity" is not yet precisely defined. This will sharpen through real usage and failure modes, not through upfront design.
|
|
110
|
+
|
|
111
|
+
- **How does WorkTrain know when it doesn't understand something?** An agent that mis-understands a task produces code that's correct for its interpretation but wrong for the operator's intent. Detecting this before implementation begins -- via explicit intent confirmation, pattern matching against prior sessions, or something else -- is an open problem. See `docs/ideas/backlog.md`: "Intent gap".
|
|
112
|
+
|
|
113
|
+
- **What is the right granularity of tasks?** WorkTrain is being designed for ticket-sized work. Whether it handles epics (by decomposing them), hotfixes (by moving fast and deferring thoroughness), and architectural changes (which may require multiple sessions across multiple days) the same way is untested.
|
|
114
|
+
|
|
115
|
+
- **Is "document" the right abstraction for the living work context?** A flat document implies agents read it linearly. Agents need to query it selectively -- the coding agent wants constraints relevant to a specific decision, the review agent wants what the coding agent said about a specific module. A structured knowledge store (typed facts, queryable by topic) may be more useful than a document. See `docs/ideas/backlog.md`: "Living work context".
|
package/package.json
CHANGED
package/spec/authoring-spec.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"version": 3,
|
|
4
4
|
"title": "WorkRail Authoring Rules",
|
|
5
5
|
"purpose": "Canonical current rules for authoring good WorkRail workflows. workflow.schema.json remains the source of truth for legal structure.",
|
|
6
|
-
"lastReviewed": "2026-04-
|
|
6
|
+
"lastReviewed": "2026-04-28",
|
|
7
7
|
"principles": [
|
|
8
8
|
"Schema defines what is valid. These rules define what is good.",
|
|
9
9
|
"Prefer current authoring rules over design rationale or historical notes.",
|
|
@@ -189,6 +189,10 @@
|
|
|
189
189
|
"id": "artifact.verification",
|
|
190
190
|
"description": "Verification or handoff artifacts"
|
|
191
191
|
},
|
|
192
|
+
{
|
|
193
|
+
"id": "artifact.coordinator-result",
|
|
194
|
+
"description": "wr.coordinator_result artifact emitted by coordinator-phase workflows to signal phase completion to the coordinator"
|
|
195
|
+
},
|
|
192
196
|
{
|
|
193
197
|
"id": "delegation.context-packet",
|
|
194
198
|
"description": "Structured context passed to subagents"
|
|
@@ -1429,6 +1433,37 @@
|
|
|
1429
1433
|
"id": "artifacts",
|
|
1430
1434
|
"title": "Artifacts and planning surfaces",
|
|
1431
1435
|
"rules": [
|
|
1436
|
+
{
|
|
1437
|
+
"id": "coordinator-result-artifact-schema",
|
|
1438
|
+
"status": "active",
|
|
1439
|
+
"level": "required",
|
|
1440
|
+
"scope": [
|
|
1441
|
+
"artifact.coordinator-result"
|
|
1442
|
+
],
|
|
1443
|
+
"rule": "When a workflow step signals coordinator phase completion, emit a `wr.coordinator_result` artifact with exactly 4 fields: `outcome` (enum: success|failed|timed_out|await_degraded), `summary` (string), `sessionId` (string), `error` (string|null). No additional fields allowed.",
|
|
1444
|
+
"why": "Coordinators read this artifact to determine whether to proceed, retry, or escalate. Extra fields pollute the schema boundary and break forward compatibility. The 4-field constraint is a hard limit, not a guideline.",
|
|
1445
|
+
"enforcement": [
|
|
1446
|
+
"advisory"
|
|
1447
|
+
],
|
|
1448
|
+
"checks": [
|
|
1449
|
+
"Exactly 4 fields present: outcome, summary, sessionId, error.",
|
|
1450
|
+
"outcome is one of: success, failed, timed_out, await_degraded.",
|
|
1451
|
+
"error is string|null -- null when outcome is success, non-null string when outcome is failed.",
|
|
1452
|
+
"No workflow-specific fields (prUrl, branchName, commitSha, etc.) in wr.coordinator_result. Those belong in workflow-specific artifacts."
|
|
1453
|
+
],
|
|
1454
|
+
"antiPatterns": [
|
|
1455
|
+
"Adding prUrl, branchName, or commitSha to wr.coordinator_result",
|
|
1456
|
+
"Using a free-form notes string instead of the typed outcome enum",
|
|
1457
|
+
"Omitting sessionId (required for coordinator tracing and console parent-child display)"
|
|
1458
|
+
],
|
|
1459
|
+
"sourceRefs": [
|
|
1460
|
+
{
|
|
1461
|
+
"kind": "runtime",
|
|
1462
|
+
"path": "src/coordinators/types.ts",
|
|
1463
|
+
"note": "ChildSessionResult discriminated union -- the runtime type that wr.coordinator_result maps to."
|
|
1464
|
+
}
|
|
1465
|
+
]
|
|
1466
|
+
},
|
|
1432
1467
|
{
|
|
1433
1468
|
"id": "artifact-canonicality",
|
|
1434
1469
|
"status": "active",
|
|
File without changes
|
|
File without changes
|