@chllming/wave-orchestration 0.8.4 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +41 -1
  2. package/README.md +31 -13
  3. package/docs/README.md +4 -0
  4. package/docs/agents/wave-design-role.md +47 -0
  5. package/docs/concepts/what-is-a-wave.md +11 -7
  6. package/docs/context7/bundles.json +19 -20
  7. package/docs/context7/planner-agent/README.md +4 -1
  8. package/docs/guides/author-and-run-waves.md +27 -0
  9. package/docs/guides/planner.md +46 -0
  10. package/docs/guides/signal-wrappers.md +165 -0
  11. package/docs/guides/terminal-surfaces.md +13 -0
  12. package/docs/plans/context7-wave-orchestrator.md +24 -7
  13. package/docs/plans/current-state.md +10 -2
  14. package/docs/plans/end-state-architecture.md +22 -5
  15. package/docs/plans/examples/wave-example-design-handoff.md +262 -0
  16. package/docs/plans/examples/wave-example-live-proof.md +1 -1
  17. package/docs/plans/migration.md +301 -75
  18. package/docs/plans/wave-orchestrator.md +16 -3
  19. package/docs/reference/cli-reference.md +22 -1
  20. package/docs/reference/npmjs-trusted-publishing.md +2 -2
  21. package/docs/reference/sample-waves.md +14 -7
  22. package/docs/reference/skills.md +18 -0
  23. package/docs/reference/wave-control.md +2 -0
  24. package/package.json +1 -1
  25. package/releases/manifest.json +38 -0
  26. package/scripts/context7-api-check.sh +57 -13
  27. package/scripts/wave-orchestrator/agent-state.mjs +64 -0
  28. package/scripts/wave-orchestrator/config.mjs +5 -0
  29. package/scripts/wave-orchestrator/control-cli.mjs +19 -0
  30. package/scripts/wave-orchestrator/coordination.mjs +77 -1
  31. package/scripts/wave-orchestrator/gate-engine.mjs +106 -2
  32. package/scripts/wave-orchestrator/install.mjs +5 -0
  33. package/scripts/wave-orchestrator/launcher-runtime.mjs +18 -1
  34. package/scripts/wave-orchestrator/launcher.mjs +75 -1
  35. package/scripts/wave-orchestrator/ledger.mjs +56 -27
  36. package/scripts/wave-orchestrator/local-executor.mjs +37 -0
  37. package/scripts/wave-orchestrator/planner.mjs +24 -4
  38. package/scripts/wave-orchestrator/result-envelope.mjs +32 -1
  39. package/scripts/wave-orchestrator/retry-control.mjs +17 -2
  40. package/scripts/wave-orchestrator/retry-engine.mjs +85 -0
  41. package/scripts/wave-orchestrator/role-helpers.mjs +73 -1
  42. package/scripts/wave-orchestrator/session-supervisor.mjs +113 -0
  43. package/scripts/wave-orchestrator/shared.mjs +2 -0
  44. package/scripts/wave-orchestrator/signals.mjs +681 -0
  45. package/scripts/wave-orchestrator/skills.mjs +1 -0
  46. package/scripts/wave-orchestrator/task-entity.mjs +65 -45
  47. package/scripts/wave-orchestrator/wave-control-schema.mjs +2 -0
  48. package/scripts/wave-orchestrator/wave-files.mjs +85 -1
  49. package/scripts/wave-orchestrator/wave-state-reducer.mjs +24 -7
  50. package/scripts/wave-status.sh +200 -0
  51. package/scripts/wave-watch.sh +200 -0
  52. package/skills/README.md +10 -0
  53. package/skills/role-design/SKILL.md +50 -0
  54. package/skills/role-design/skill.json +36 -0
  55. package/skills/signal-hygiene/SKILL.md +51 -0
  56. package/skills/signal-hygiene/skill.json +20 -0
  57. package/skills/tui-design/SKILL.md +77 -0
  58. package/skills/tui-design/references/tui-design.md +259 -0
  59. package/skills/tui-design/skill.json +36 -0
  60. package/wave.config.json +15 -1
@@ -0,0 +1,165 @@
1
+ # Signal Wrappers And Long-Running Wake Loops
2
+
3
+ Use this guide when you want shell-friendly monitoring, external automation hooks, or intentionally long-running agents that should wake only when the orchestrator publishes a new signal version.
4
+
5
+ If you want the broader tmux or VS Code operator flow, read [terminal-surfaces.md](./terminal-surfaces.md). This page stays focused on the signal snapshots, wrapper scripts, and ack-loop contract.
6
+
7
+ ## What The Runtime Writes
8
+
9
+ Wave now publishes versioned signal snapshots under:
10
+
11
+ - `.tmp/<lane>-wave-launcher/signals/wave-<n>.json`
12
+ Wave-level signal for the whole wave.
13
+ - `.tmp/<lane>-wave-launcher/signals/wave-<n>/<agentId>.json`
14
+ Per-agent signal state.
15
+ - `.tmp/<lane>-wave-launcher/signals/wave-<n>/acks/<agentId>.json`
16
+ Per-agent acknowledgement file written by a long-running watcher after it observes a new signal version.
17
+
18
+ The resident orchestrator uses the same pattern with `resident-orchestrator` as the agent id.
19
+
20
+ Signal snapshots are derived projections, not canonical decision state. They are machine-friendly wake surfaces built from `wave control status --json`.
21
+
22
+ ## Signal Kinds
23
+
24
+ The shipped signal vocabulary is:
25
+
26
+ - `stable`
27
+ - `waiting`
28
+ - `feedback-requested`
29
+ - `feedback-answered`
30
+ - `coordination-action`
31
+ - `resume-ready`
32
+ - `completed`
33
+ - `failed`
34
+
35
+ `completed` and `failed` are terminal. Long-running watchers should stop waiting once either one appears.
36
+
37
+ ## Wrapper Scripts
38
+
39
+ Starter repos now include two thin helper scripts:
40
+
41
+ - `scripts/wave-status.sh`
42
+ - `scripts/wave-watch.sh`
43
+
44
+ They read `wave control status --json`. They do not recompute status independently.
45
+
46
+ ### `wave-status.sh`
47
+
48
+ Examples:
49
+
50
+ ```bash
51
+ scripts/wave-status.sh --lane main --wave 3
52
+ scripts/wave-status.sh --lane main --wave 3 --agent A1
53
+ scripts/wave-status.sh --lane main --wave 3 --agent A1 --json
54
+ ```
55
+
56
+ Exit codes:
57
+
58
+ - `0`
59
+ Terminal success (`signal=completed`)
60
+ - `10`
61
+ Still active or waiting (`stable`, `waiting`, `feedback-answered`, `coordination-action`, `resume-ready`)
62
+ - `20`
63
+ Input required (`signal=feedback-requested`)
64
+ - `40`
65
+ Terminal failure (`signal=failed`)
66
+
67
+ The printed machine line includes `signal`, `phase`, `status`, `version`, `blocking`, and `should_wake`.
68
+
69
+ ### `wave-watch.sh`
70
+
71
+ Examples:
72
+
73
+ ```bash
74
+ scripts/wave-watch.sh --lane main --wave 3 --agent A1 --follow
75
+ scripts/wave-watch.sh --lane main --wave 3 --agent A1 --until-change --refresh-ms 500
76
+ ```
77
+
78
+ Modes:
79
+
80
+ - `--follow`
81
+ Keep polling until the signal becomes terminal or input-required.
82
+ - `--until-change`
83
+ Exit as soon as the watched signal version changes.
84
+
85
+ Exit codes:
86
+
87
+ - `0`
88
+ Terminal success
89
+ - `20`
90
+ Input required
91
+ - `30`
92
+ The watched signal version changed, but the wave is still active
93
+ - `40`
94
+ Terminal failure
95
+
96
+ Use `--until-change` when an outer supervisor or CI job should re-enter only after a new signal is published.
97
+
98
+ ## Long-Running Agents
99
+
100
+ For non-resident agents, opt in explicitly with:
101
+
102
+ ```md
103
+ ### Skills
104
+
105
+ - signal-hygiene
106
+ ```
107
+
108
+ That skill is only for intentionally long-running agents. Do not attach it to normal one-shot implementation agents.
109
+
110
+ When `signal-hygiene` is active, the runtime injects two prompt-visible paths:
111
+
112
+ - the signal-state JSON path
113
+ - the signal-ack JSON path
114
+
115
+ The watcher loop is:
116
+
117
+ 1. Read the signal state.
118
+ 2. Compare its `version` with the version already recorded in the ack file.
119
+ 3. If the version did not change, stay idle.
120
+ 4. If the version increased, write the ack file immediately.
121
+ 5. Re-read the inbox, shared summary, message board, and any referenced artifacts.
122
+ 6. Act once for that version.
123
+ 7. Stop entirely when the signal becomes `completed` or `failed`.
124
+
125
+ Ack payload shape:
126
+
127
+ ```json
128
+ {
129
+ "agentId": "A1",
130
+ "version": 4,
131
+ "signal": "coordination-action",
132
+ "observedAt": "2026-03-25T19:00:00.000Z"
133
+ }
134
+ ```
135
+
136
+ ## Resident Orchestrator Behavior
137
+
138
+ The resident orchestrator does not need the `signal-hygiene` skill. It always receives the same signal-state and ack-path contract when `--resident-orchestrator` is enabled.
139
+
140
+ That lets the launcher know whether the resident monitor actually observed a reroute, feedback answer, or terminal state change.
141
+
142
+ ## External Automation Pattern
143
+
144
+ Typical shell loop:
145
+
146
+ ```bash
147
+ while true; do
148
+ scripts/wave-watch.sh --lane main --wave 3 --agent A1 --until-change --refresh-ms 500
149
+ code=$?
150
+ if [ "$code" -eq 0 ]; then
151
+ echo "wave completed"
152
+ break
153
+ fi
154
+ if [ "$code" -eq 20 ]; then
155
+ echo "human input required"
156
+ break
157
+ fi
158
+ if [ "$code" -eq 40 ]; then
159
+ echo "wave failed"
160
+ break
161
+ fi
162
+ done
163
+ ```
164
+
165
+ Use `wave control status --json` directly when you need the full structured payload. Use the wrapper scripts when you want stable exit codes and a single machine-readable line.
@@ -78,6 +78,19 @@ Important flags:
78
78
  - Pair `--keep-sessions` with incident review or deep debugging, not as a default steady-state mode.
79
79
  - Pair `--no-dashboard` with scripted dry-runs or when the board and summaries are sufficient.
80
80
 
81
+ ## Operator Wrappers
82
+
83
+ Starter repos now include two thin helper scripts:
84
+
85
+ - `scripts/wave-status.sh`
86
+ Reads `wave control status --json`, prints a single machine-friendly line, and exits `0` for completed, `10` for waiting/running, `20` for input-required, and `40` for failed.
87
+ - `scripts/wave-watch.sh`
88
+ Polls the same status JSON until the watched signal version changes. `--until-change` exits `30` when the signal changed but the wave is still active, and both follow mode and until-change mode terminate immediately with `40` on failed terminal signals.
89
+
90
+ Both wrappers are convenience readers only. The canonical surface is the versioned signal projection under `.tmp/<lane>-wave-launcher/signals/`.
91
+
92
+ For the full wrapper contract, long-running-agent ack loop, and external automation patterns, read [signal-wrappers.md](./signal-wrappers.md).
93
+
81
94
  ## Suggested Defaults
82
95
 
83
96
  - Local development:
@@ -34,11 +34,12 @@ pnpm context7:api-check
34
34
  ```
35
35
 
36
36
  4. Review [docs/context7/bundles.json](../context7/bundles.json) and trim it to the external libraries your repository actually uses.
37
+ 5. Prefer exact `libraryId` values. Use `libraryName` only during one-off discovery, then replace it with the pinned id returned by Context7 before committing the bundle.
37
38
 
38
39
  ## Planner Bundle
39
40
 
40
- The shipped bundle index includes `planner-agentic`, which expects a published
41
- Context7 library named `wave-planner-agentic`.
41
+ The shipped bundle index includes `planner-agentic`, but it is intentionally a
42
+ local-only placeholder by default.
42
43
 
43
44
  The source files for that library live under `docs/context7/planner-agent/`.
44
45
  Refresh that folder from the ignored agent-context cache with:
@@ -47,8 +48,8 @@ Refresh that folder from the ignored agent-context cache with:
47
48
  pnpm research:sync-planner-context7
48
49
  ```
49
50
 
50
- After you publish the folder to Context7, the agentic planner will prefetch that
51
- bundle through `planner.agentic.context7Bundle`.
51
+ After you publish the folder to Context7, replace the placeholder bundle entry
52
+ with the exact published `libraryId`. Do not commit a guessed `libraryName`.
52
53
 
53
54
  ## Resolution Order
54
55
 
@@ -59,7 +60,8 @@ bundle through `planner.agentic.context7Bundle`.
59
60
 
60
61
  ## Bundle Authoring
61
62
 
62
- Each bundle should be small and task-shaped. A bundle entry can name libraries by `libraryName` and optionally add a `queryHint` to keep fetched docs focused.
63
+ Each bundle should be small and task-shaped. Prefer exact `libraryId` values and
64
+ add a `queryHint` to keep fetched docs focused.
63
65
 
64
66
  Example:
65
67
 
@@ -70,11 +72,11 @@ Example:
70
72
  "description": "Node.js and TypeScript runtime docs.",
71
73
  "libraries": [
72
74
  {
73
- "libraryName": "nodejs",
75
+ "libraryId": "/nodejs/node",
74
76
  "queryHint": "child processes, streams, filesystem, process lifecycle"
75
77
  },
76
78
  {
77
- "libraryName": "typescript",
79
+ "libraryId": "/microsoft/typescript",
78
80
  "queryHint": "module resolution, declarations, compiler behavior"
79
81
  }
80
82
  ]
@@ -105,6 +107,20 @@ Agent-level override:
105
107
  - query: "TypeScript declarations and module resolution"
106
108
  ````
107
109
 
110
+ ## Making Attachment Explicit
111
+
112
+ If you want Context7 attachment to be reviewable instead of implied, make all of
113
+ these explicit:
114
+
115
+ 1. The wave or agent selects a concrete bundle id in `## Context7 defaults` or
116
+ `### Context7`.
117
+ 2. `docs/context7/bundles.json` pins the bundle's libraries by exact
118
+ `libraryId`, not a guessed `libraryName`.
119
+ 3. Placeholder bundles stay empty until the real published `libraryId` exists.
120
+ 4. `pnpm context7:api-check` succeeds against the committed ids.
121
+ 5. The launcher log shows `Context7 bundle <bundle-id> attached (...)` for the
122
+ run, or a fail-open warning if the API was unavailable.
123
+
108
124
  ## Injection
109
125
 
110
126
  When a bundle is active, the launcher injects:
@@ -150,3 +166,4 @@ Those inbox artifacts are repository-state summaries. Context7 stays reserved fo
150
166
  - Do not use Context7 for repository architecture, plan decisions, ownership rules, or internal contracts.
151
167
  - Prefer one active backend family in a bundle instead of mixing competing frameworks.
152
168
  - Keep queries specific enough that the prefetched block stays small and useful.
169
+ - Run `pnpm context7:api-check` after editing bundle ids to verify every pinned library still resolves and returns promptable context.
@@ -1,6 +1,6 @@
1
1
  # Current State
2
2
 
3
- - The starter workspace in this source repo reflects the `0.8.4` package release surface.
3
+ - The published package is `0.8.6`, and that release now includes the optional pre-implementation `design` worker role, the `role-design`, `tui-design`, and `signal-hygiene` starter bundles, plus the seeded signal-wrapper scripts for long-running-agent and operator wait loops.
4
4
  - The canonical shipped runtime architecture is documented in `docs/plans/end-state-architecture.md`; historical cutover notes remain in `docs/plans/architecture-hardening-migration.md`.
5
5
  - The repository contains the published `@chllming/wave-orchestration` package plus the starter scaffold used by `wave init`.
6
6
  - The runtime is package-first and non-destructive for adopting repos: `wave init --adopt-existing` records existing repo-owned plans, waves, prompts, and config without overwriting them, and `wave upgrade` writes only `.wave/install-state.json` plus `.wave/upgrade-history/`.
@@ -26,11 +26,13 @@
26
26
  - lane config can attach skills by base, role, runtime, and deploy kind
27
27
  - wave agents can add explicit `### Skills`
28
28
  - runtime projections are generated for Codex, Claude, OpenCode, and local execution
29
+ - the starter surface includes `skills/role-design/`, `skills/tui-design/`, `skills/signal-hygiene/`, `roles.designRolePromptPath`, and `executors.profiles.design-pass`
29
30
  - The runtime now includes:
30
31
  - a canonical authority set built from wave definitions, coordination JSONL logs, and control-plane JSONL events
31
32
  - immutable attempt-scoped result envelopes for structured role outcomes under `.tmp/<lane>-wave-launcher/results/wave-<n>/attempt-<a>/<agent>.json`
32
33
  - a generated markdown board projection
33
34
  - compiled shared summaries and per-agent inboxes
35
+ - canonical versioned signal projections under `.tmp/<lane>-wave-launcher/signals/` for waves, per-agent wake state, and resident-orchestrator acknowledgement loops
34
36
  - active live-wave orchestration refresh that keeps summaries, inboxes, clarification triage, and dashboard coordination metrics current while agents are still running
35
37
  - a per-wave ledger
36
38
  - docs queues
@@ -42,13 +44,16 @@
42
44
  - orchestrator-first clarification triage plus human escalation artifacts
43
45
  - answered human-feedback responses that reconcile canonical coordination state, helper assignments, and safe continuation intent even when the launcher is no longer active
44
46
  - optional `--resident-orchestrator` support for a long-running, non-owning orchestrator session during live waves
47
+ - seeded operator wrappers `scripts/wave-status.sh` and `scripts/wave-watch.sh` that expose machine-friendly wait, completion, failure, and input-required status by reading `wave control status --json`
45
48
  - persisted relaunch plans under `.tmp/<lane>-wave-launcher/status/` so targeted retry intent can survive a launcher restart
46
- - a canonical control-plane event log under `.tmp/<lane>-wave-launcher/control-plane/` that records operator tasks, rerun requests, proof bundles, contradictions, facts, human-input workflow, and observed `wave_run`, `attempt`, and `agent_run` lifecycle events as append-only JSONL; `wave control` materializes state from this log
49
+ - a canonical control-plane event log under `.tmp/<lane>-wave-launcher/control-plane/` that records operator tasks, rerun requests, proof bundles, contradictions, facts, human-input workflow, observed `wave_run`, `attempt`, and `agent_run` lifecycle events, plus `wave_signal` and `agent_signal` update events as append-only JSONL; `wave control` materializes state from this log
47
50
  - operator-applied retry overrides projected to `.tmp/<lane>-wave-launcher/control/` for compatibility with selected reruns, explicit reuse selectors, reuse clearing or preservation, and explicit resume targets
48
51
  - authoritative proof registries projected to `.tmp/<lane>-wave-launcher/proof/` for compatibility, while preserving proof bundle lifecycle state so revoked or superseded operator evidence cannot keep satisfying closure
49
52
  - optional Wave Control telemetry under `.tmp/<lane>-wave-launcher/control-plane/telemetry/` for local-first, best-effort reporting to the Railway-hosted analysis plane
50
53
  - reducer-driven live state snapshots plus persisted machine-readable shadow diffs for helper-assignment, blocker, contradiction, closure, and retry slices
51
54
  - reducer-authoritative helper-assignment blocking, retry target selection, and resume planning, with live gate and closure reads now driven from validated result envelopes
55
+ - optional design agents that publish validated design packets under `docs/plans/waves/design/wave-<n>-<agent>.md`, gate implementation through `designGate`, and run before code-owning implementation agents
56
+ - hybrid design stewards that stay docs-first by default but can explicitly own source-code slices, rejoin the implementation fan-out after the design pass, and satisfy both the design packet contract and normal implementation proof
52
57
  - hermetic replay that reconstructs contradiction-driven blockers from bundled control-plane events
53
58
  - contradiction replay for non-promoted traces that no longer depends on copied component-matrix parsing
54
59
  - consistent `requireComponentPromotionsFromWave` threshold handling across both component-promotion proof validation and component-matrix current-level validation
@@ -75,6 +80,9 @@
75
80
  - open capability-targeted requests become explicit helper assignments
76
81
  - helper assignments are written into coordination state, the ledger, summaries, and traces
77
82
  - helper assignments remain blocking until the linked follow-up resolves
83
+ - Waves with a `design` worker role now run that design pass before code-owning implementation starts; implementation resumes only after every design packet is `ready-for-implementation`.
84
+ - Long-running non-resident agents can opt into `signal-hygiene` through explicit `### Skills`; that skill makes them wait on signal-version changes, acknowledge a new version through an ack file, and only then resume work.
85
+ - Terminal signal state now dominates stale answered feedback or coordination wakeups, so `completed` and `failed` actually stop long-running watcher loops instead of leaving them on a non-terminal signal.
78
86
  - Closure now runs in staged order through the wave's effective closure roles: implementation and proof, then optional `cont-EVAL`, then optional security review, then integration, then documentation, then `cont-QA`. Starter defaults remain `E0`, security reviewer, `A8`, `A9`, and `A0` when a wave does not override them.
79
87
  - `E0` is hybrid: planner-generated waves keep it report-only, while hand-authored waves may assign explicit tuning files and thereby make `E0` participate in implementation proof gating.
80
88
  - Live closure is strict: `cont-EVAL` must prove the declared eval contract with exact target and benchmark ids, and `cont-QA` must provide both final verdict and final gate artifacts. Legacy evaluator-era shapes remain replay-only compatibility inputs.
@@ -1,6 +1,6 @@
1
1
  # End-State Architecture
2
2
 
3
- This document describes the canonical architecture for the current Wave runtime. It is the authoritative reference for the engine boundaries, canonical authority set, and artifact ownership model that the shipped code now follows.
3
+ This document describes the canonical architecture for the current Wave runtime. It is the authoritative reference for the engine boundaries, canonical authority set, and artifact ownership model that the shipped `0.8.6` surface now follows.
4
4
 
5
5
  The thesis is unchanged: bounded waves, closure roles, proof artifacts, selective rerun, and delivery discipline. What changes is the internal authority model. The launcher stops being the decision engine and becomes a thin orchestrator that reads decisions from canonical state, sequences the engines, and delegates process work to the session supervisor.
6
6
 
@@ -41,13 +41,15 @@ The system uses **Model B: canonical authority set**, not a single event log. Th
41
41
  | Source | Kind | Authority Over |
42
42
  |--------|------|----------------|
43
43
  | Wave definitions (`docs/plans/waves/`) | Parsed declarations, read-only after parse | Goals, agent roles, component promotions, exit contracts, proof artifact requirements, eval targets, skill bindings |
44
- | Control-plane event log (`.tmp/<lane>-wave-launcher/control-plane/wave-<N>.jsonl`) | Append-only JSONL | Lifecycle state: tasks, attempts, proof bundles, rerun requests, gates, contradictions, facts, human inputs, wave runs, agent runs, artifacts, benchmarks, verifications, reviews |
44
+ | Control-plane event log (`.tmp/<lane>-wave-launcher/control-plane/wave-<N>.jsonl`) | Append-only JSONL | Lifecycle state: tasks, attempts, proof bundles, rerun requests, gates, contradictions, facts, human inputs, wave runs, agent runs, signal updates, artifacts, benchmarks, verifications, reviews |
45
45
  | Coordination log (`.tmp/<lane>-wave-launcher/coordination/wave-<N>.jsonl`) | Append-only JSONL | Conversational/workflow state: requests, acks, claims, evidence, decisions, blockers, handoffs, clarifications, human feedback, escalations, orchestrator guidance, integration summaries |
46
46
 
47
- **Everything else is a projection.** Shared summaries, dashboards, inboxes, proof registries, retry overrides, relaunch plans, assignment snapshots, dependency snapshots, ledgers, docs queues, security summaries, integration summaries, markdown boards, and trace bundles are all derived from these three canonical sources plus immutable agent result envelopes.
47
+ **Everything else is a projection.** Shared summaries, dashboards, inboxes, signal snapshots, proof registries, retry overrides, relaunch plans, assignment snapshots, dependency snapshots, ledgers, docs queues, security summaries, integration summaries, markdown boards, and trace bundles are all derived from these three canonical sources plus immutable agent result envelopes.
48
48
 
49
49
  The reducer consumes all three canonical sources plus result envelopes to rebuild state. No other input is read for decision-making.
50
50
 
51
+ Optional design packets live in repo-owned docs, usually under `docs/plans/waves/design/`. They are not canonical runtime state by themselves, but the validated packet path and final `design` result are captured in summaries, envelopes, reducer state, and traces.
52
+
51
53
  ---
52
54
 
53
55
  ## Module Architecture
@@ -87,6 +89,8 @@ implementation-engine.mjs Drives the implementation phase
87
89
  Outputs: run selections, launch requests,
88
90
  executor assignments,
89
91
  prompt construction requests
92
+ Rule: optional design workers run before
93
+ code-owning implementation workers
90
94
  Does NOT output: agent_run.started, attempt.running
91
95
  (those are observed facts written by the supervisor)
92
96
 
@@ -109,7 +113,7 @@ gate-engine.mjs Evaluates all closure gates
109
113
  per-task owned_slice_proven verdicts
110
114
  Does NOT write: gate events to control-plane
111
115
  (the caller writes gate events after receiving verdicts)
112
- Gates: implementation-proof, cont-eval, security,
116
+ Gates: design, implementation-proof, cont-eval, security,
113
117
  integration, documentation, cont-qa,
114
118
  component-matrix, assignment-barrier,
115
119
  dependency-barrier, clarification-barrier
@@ -149,7 +153,7 @@ wave-state-reducer.mjs Rebuilds full wave state from canonical authority set
149
153
 
150
154
  The supervisor is the only module that interacts with the outside world: launching processes, managing terminals, and monitoring sessions. It reads decisions from phase engines and executes them. It is the only module that writes observed lifecycle events.
151
155
 
152
- The projection writer is the single module responsible for projection writes. Workflow-owned compatibility state, clarification triage, and canonical coordination/control-plane mutations stay in their own modules.
156
+ `projection-writer.mjs` owns the operator-facing projection writes family: dashboards, traces, summaries, inboxes, ledgers, docs queues, board projections, and assignment or dependency snapshots. `signals.mjs` owns the separate versioned signal projections used by long-running agents and operator wrappers. Workflow-owned compatibility state, clarification triage, and canonical coordination/control-plane mutations stay in their own modules.
153
157
 
154
158
  ```
155
159
  session-supervisor.mjs Launches and monitors agent sessions
@@ -184,6 +188,16 @@ projection-writer.mjs Writes projection outputs
184
188
  Rule: never reads its own outputs,
185
189
  always writes atomically,
186
190
  labels every artifact with its class
191
+
192
+ signals.mjs Writes versioned signal projections
193
+ Inputs: materialized control status for a wave,
194
+ logical-agent state, feedback state
195
+ Outputs: wave-level signal snapshot,
196
+ per-agent signal snapshots,
197
+ resident-orchestrator signal snapshot
198
+ Rule: versions snapshots only when the normalized
199
+ wake payload changes and tracks ack state
200
+ for long-running watcher loops
187
201
  ```
188
202
 
189
203
  ### Layer 4 — Launcher Orchestrator
@@ -198,6 +212,7 @@ launcher.mjs Thin orchestrator
198
212
  a. reducer.rebuild() → current state
199
213
  b. retry-engine.plan() → retry decisions
200
214
  c. implementation-engine.select() → run selections
215
+ (design-first when the wave declares design workers)
201
216
  d. derived-state-engine.materialize() → derived payloads
202
217
  e. supervisor.launch(run selections) → agent sessions
203
218
  (supervisor writes agent_run.started)
@@ -559,6 +574,8 @@ Projections materialized from Class 1 and Class 2 sources. Can be deleted and re
559
574
  | Run state | `.tmp/<lane>-wave-launcher/run-state.json` | JSON |
560
575
  | Quality metrics | `.tmp/<lane>-wave-launcher/traces/wave-<N>/attempt-<A>/quality.json` | JSON |
561
576
  | Reducer snapshot | `.tmp/<lane>-wave-launcher/reducer/wave-<N>.json` | JSON |
577
+ | Wave signal snapshot | `.tmp/<lane>-wave-launcher/signals/wave-<N>.json` | JSON |
578
+ | Agent signal snapshot | `.tmp/<lane>-wave-launcher/signals/wave-<N>/<agentId>.json` | JSON |
562
579
 
563
580
  ### Class 4 — Human-Facing Projections
564
581
 
@@ -0,0 +1,262 @@
1
+ # Wave 12 - Optional Design Steward Handoff
2
+
3
+ This is a showcase-first sample wave for the shipped `design` worker role in `0.8.6`.
4
+
5
+ This example demonstrates the docs-first design-steward path where a design packet is published before code-owning implementation begins.
6
+
7
+ Use this shape when:
8
+
9
+ - the task has interface or architecture ambiguity
10
+ - multiple implementation owners need the same decisions and assumptions
11
+ - you want explicit design lineage instead of re-deriving the same plan in each coding prompt
12
+
13
+ If you want the hybrid design-steward variant instead, keep the same packet path but also assign that same design agent implementation-owned files plus the normal implementation contract sections. The runtime will then run the design pass first and include that same agent in the later implementation fan-out.
14
+
15
+ **Commit message**: `Feat: add design packet before implementation fan-out`
16
+
17
+ ## Component promotions
18
+
19
+ - api-boundary: repo-landed
20
+ - runtime-integration: repo-landed
21
+
22
+ ## Context7 defaults
23
+
24
+ - bundle: node-typescript
25
+ - query: "Interface boundaries, migration sequencing, and implementation handoff patterns for repository work"
26
+
27
+ ## Agent A0: cont-QA
28
+
29
+ ### Role prompts
30
+
31
+ - docs/agents/wave-cont-qa-role.md
32
+
33
+ ### Executor
34
+
35
+ - profile: deep-review
36
+
37
+ ### Context7
38
+
39
+ - bundle: none
40
+
41
+ ### Prompt
42
+
43
+ ```text
44
+ Primary goal:
45
+ - Judge whether the design packet, implementation slices, and closure evidence line up without hidden architectural drift.
46
+
47
+ Required context before coding:
48
+ - Read docs/reference/repository-guidance.md.
49
+ - Read docs/plans/current-state.md and docs/plans/migration.md.
50
+ - Read docs/plans/waves/design/wave-12-D1.md.
51
+
52
+ File ownership (only touch these paths):
53
+ - docs/plans/waves/reviews/wave-12-cont-qa.md
54
+ ```
55
+
56
+ ## Agent A8: Integration Steward
57
+
58
+ ### Role prompts
59
+
60
+ - docs/agents/wave-integration-role.md
61
+
62
+ ### Executor
63
+
64
+ - profile: deep-review
65
+
66
+ ### Context7
67
+
68
+ - bundle: none
69
+
70
+ ### Prompt
71
+
72
+ ```text
73
+ Primary goal:
74
+ - Reconcile the landed implementation against the design packet and the actual repo changes.
75
+
76
+ Required context before coding:
77
+ - Read docs/plans/current-state.md.
78
+ - Read docs/plans/waves/design/wave-12-D1.md.
79
+
80
+ File ownership (only touch these paths):
81
+ - .tmp/main-wave-launcher/integration/wave-12.md
82
+ - .tmp/main-wave-launcher/integration/wave-12.json
83
+ ```
84
+
85
+ ## Agent A9: Documentation Steward
86
+
87
+ ### Role prompts
88
+
89
+ - docs/agents/wave-documentation-role.md
90
+
91
+ ### Executor
92
+
93
+ - profile: docs-pass
94
+
95
+ ### Context7
96
+
97
+ - bundle: none
98
+
99
+ ### Prompt
100
+
101
+ ```text
102
+ Primary goal:
103
+ - Keep the shared docs and migration notes aligned with the design packet and final implementation outcome.
104
+
105
+ Required context before coding:
106
+ - Read docs/plans/current-state.md.
107
+ - Read docs/plans/migration.md.
108
+ - Read docs/plans/waves/design/wave-12-D1.md.
109
+
110
+ File ownership (only touch these paths):
111
+ - docs/plans/current-state.md
112
+ - docs/plans/migration.md
113
+ ```
114
+
115
+ ## Agent D1: Design Steward
116
+
117
+ ### Role prompts
118
+
119
+ - docs/agents/wave-design-role.md
120
+
121
+ ### Executor
122
+
123
+ - profile: design-pass
124
+
125
+ ### Context7
126
+
127
+ - bundle: none
128
+
129
+ ### Skills
130
+
131
+ - role-design
132
+
133
+ Add `tui-design` here too when the design packet owns terminal UX, dashboards, or other operator-surface behavior. Omit it for generic API or migration design.
134
+
135
+ ### Capabilities
136
+
137
+ - design
138
+ - interface-handoff
139
+ - decision-lineage
140
+
141
+ ### Prompt
142
+
143
+ ```text
144
+ Primary goal:
145
+ - Produce the implementation-ready design packet for the Wave 12 slice before coding starts.
146
+
147
+ Required context before coding:
148
+ - Read docs/reference/repository-guidance.md.
149
+ - Read docs/plans/current-state.md.
150
+ - Read docs/plans/migration.md.
151
+
152
+ Specific expectations:
153
+ - make the implementation handoff concrete enough that A1 and A2 can start without re-deriving the same architecture
154
+ - keep assumptions and open questions explicit
155
+ - do not silently expand into source-code changes
156
+
157
+ File ownership (only touch these paths):
158
+ - docs/plans/waves/design/wave-12-D1.md
159
+ ```
160
+
161
+ ## Agent A1: API Boundary Update
162
+
163
+ ### Executor
164
+
165
+ - profile: implement-fast
166
+
167
+ ### Context7
168
+
169
+ - bundle: node-typescript
170
+ - query: "API boundary refactors and compatibility-safe migration sequencing"
171
+
172
+ ### Skills
173
+
174
+ - role-implementation
175
+ - runtime-codex
176
+ - repo-coding-rules
177
+
178
+ ### Components
179
+
180
+ - api-boundary
181
+
182
+ ### Deliverables
183
+
184
+ - scripts/wave-orchestrator/api-boundary.mjs
185
+ - test/wave-orchestrator/api-boundary.test.ts
186
+
187
+ ### Exit contract
188
+
189
+ - completion: integrated
190
+ - durability: durable
191
+ - proof: integration
192
+ - doc-impact: none
193
+
194
+ ### Prompt
195
+
196
+ ```text
197
+ Primary goal:
198
+ - Land the API-boundary changes described in the Wave 12 design packet.
199
+
200
+ Required context before coding:
201
+ - Read docs/plans/waves/design/wave-12-D1.md before changing code.
202
+
203
+ File ownership (only touch these paths):
204
+ - scripts/wave-orchestrator/api-boundary.mjs
205
+ - test/wave-orchestrator/api-boundary.test.ts
206
+ ```
207
+
208
+ ## Agent A2: Runtime Integration Update
209
+
210
+ ### Executor
211
+
212
+ - profile: implement-fast
213
+
214
+ ### Context7
215
+
216
+ - bundle: node-typescript
217
+ - query: "Runtime integration updates and handoff-safe staged migration"
218
+
219
+ ### Skills
220
+
221
+ - role-implementation
222
+ - runtime-codex
223
+ - repo-coding-rules
224
+
225
+ ### Components
226
+
227
+ - runtime-integration
228
+
229
+ ### Deliverables
230
+
231
+ - scripts/wave-orchestrator/runtime-integration.mjs
232
+ - test/wave-orchestrator/runtime-integration.test.ts
233
+
234
+ ### Exit contract
235
+
236
+ - completion: integrated
237
+ - durability: durable
238
+ - proof: integration
239
+ - doc-impact: none
240
+
241
+ ### Prompt
242
+
243
+ ```text
244
+ Primary goal:
245
+ - Land the runtime integration changes described in the Wave 12 design packet.
246
+
247
+ Required context before coding:
248
+ - Read docs/plans/waves/design/wave-12-D1.md before changing code.
249
+
250
+ File ownership (only touch these paths):
251
+ - scripts/wave-orchestrator/runtime-integration.mjs
252
+ - test/wave-orchestrator/runtime-integration.test.ts
253
+ ```
254
+
255
+ ## Why This Example Exists
256
+
257
+ This example demonstrates the intended boundary:
258
+
259
+ - the design steward is report-first and docs/spec-owned
260
+ - implementation owners still own code changes and proof
261
+ - closure roles stay the same
262
+ - the design packet becomes an explicit handoff artifact instead of hidden reasoning inside one agent transcript
@@ -2,7 +2,7 @@
2
2
 
3
3
  This is a showcase-first sample wave.
4
4
 
5
- Use it as the single reference example for the current `0.8.4` Wave surface.
5
+ Use it as the single reference example for the current `0.8.6` Wave surface.
6
6
 
7
7
  It intentionally combines more sections than a normal production wave so one file can demonstrate:
8
8