@chllming/wave-orchestration 0.5.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +549 -0
  3. package/docs/agents/wave-deploy-verifier-role.md +34 -0
  4. package/docs/agents/wave-documentation-role.md +30 -0
  5. package/docs/agents/wave-evaluator-role.md +43 -0
  6. package/docs/agents/wave-infra-role.md +34 -0
  7. package/docs/agents/wave-integration-role.md +32 -0
  8. package/docs/agents/wave-launcher-role.md +37 -0
  9. package/docs/context7/bundles.json +91 -0
  10. package/docs/plans/component-cutover-matrix.json +112 -0
  11. package/docs/plans/component-cutover-matrix.md +49 -0
  12. package/docs/plans/context7-wave-orchestrator.md +130 -0
  13. package/docs/plans/current-state.md +44 -0
  14. package/docs/plans/master-plan.md +16 -0
  15. package/docs/plans/migration.md +23 -0
  16. package/docs/plans/wave-orchestrator.md +254 -0
  17. package/docs/plans/waves/wave-0.md +165 -0
  18. package/docs/reference/github-packages-setup.md +52 -0
  19. package/docs/reference/migration-0.2-to-0.5.md +622 -0
  20. package/docs/reference/npmjs-trusted-publishing.md +55 -0
  21. package/docs/reference/repository-guidance.md +18 -0
  22. package/docs/reference/runtime-config/README.md +85 -0
  23. package/docs/reference/runtime-config/claude.md +105 -0
  24. package/docs/reference/runtime-config/codex.md +81 -0
  25. package/docs/reference/runtime-config/opencode.md +93 -0
  26. package/docs/research/agent-context-sources.md +57 -0
  27. package/docs/roadmap.md +626 -0
  28. package/package.json +53 -0
  29. package/releases/manifest.json +101 -0
  30. package/scripts/context7-api-check.sh +21 -0
  31. package/scripts/context7-export-env.sh +52 -0
  32. package/scripts/research/agent-context-archive.mjs +472 -0
  33. package/scripts/research/generate-agent-context-indexes.mjs +85 -0
  34. package/scripts/research/import-agent-context-archive.mjs +793 -0
  35. package/scripts/research/manifests/harness-and-blackboard-2026-03-21.mjs +201 -0
  36. package/scripts/wave-autonomous.mjs +13 -0
  37. package/scripts/wave-cli-bootstrap.mjs +27 -0
  38. package/scripts/wave-dashboard.mjs +11 -0
  39. package/scripts/wave-human-feedback.mjs +11 -0
  40. package/scripts/wave-launcher.mjs +11 -0
  41. package/scripts/wave-local-executor.mjs +13 -0
  42. package/scripts/wave-orchestrator/agent-state.mjs +416 -0
  43. package/scripts/wave-orchestrator/autonomous.mjs +367 -0
  44. package/scripts/wave-orchestrator/clarification-triage.mjs +605 -0
  45. package/scripts/wave-orchestrator/config.mjs +848 -0
  46. package/scripts/wave-orchestrator/context7.mjs +464 -0
  47. package/scripts/wave-orchestrator/coord-cli.mjs +286 -0
  48. package/scripts/wave-orchestrator/coordination-store.mjs +987 -0
  49. package/scripts/wave-orchestrator/coordination.mjs +768 -0
  50. package/scripts/wave-orchestrator/dashboard-renderer.mjs +254 -0
  51. package/scripts/wave-orchestrator/dashboard-state.mjs +473 -0
  52. package/scripts/wave-orchestrator/dep-cli.mjs +219 -0
  53. package/scripts/wave-orchestrator/docs-queue.mjs +75 -0
  54. package/scripts/wave-orchestrator/executors.mjs +385 -0
  55. package/scripts/wave-orchestrator/feedback.mjs +372 -0
  56. package/scripts/wave-orchestrator/install.mjs +540 -0
  57. package/scripts/wave-orchestrator/launcher.mjs +3879 -0
  58. package/scripts/wave-orchestrator/ledger.mjs +332 -0
  59. package/scripts/wave-orchestrator/local-executor.mjs +263 -0
  60. package/scripts/wave-orchestrator/replay.mjs +246 -0
  61. package/scripts/wave-orchestrator/roots.mjs +10 -0
  62. package/scripts/wave-orchestrator/routing-state.mjs +542 -0
  63. package/scripts/wave-orchestrator/shared.mjs +405 -0
  64. package/scripts/wave-orchestrator/terminals.mjs +209 -0
  65. package/scripts/wave-orchestrator/traces.mjs +1094 -0
  66. package/scripts/wave-orchestrator/wave-files.mjs +1923 -0
  67. package/scripts/wave.mjs +103 -0
  68. package/wave.config.json +115 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,41 @@
1
+ # Changelog
2
+
3
+ ## 0.5.1 - 2026-03-22
4
+
5
+ - Fixed the Phase 4 autonomous finalization barrier so completed lanes still block on unresolved human feedback or escalation tickets from earlier waves.
6
+ - Fixed the launcher-generated trace tests to rewrite seeded agent executor blocks for local-only replay fixtures, preventing accidental live Codex, Claude Code, or OpenCode launches during hermetic trace coverage.
7
+ - Added a dedicated npmjs trusted-publishing workflow alongside the existing GitHub Packages workflow, and updated package metadata so `npm publish` targets can be selected by workflow instead of being hardwired in `package.json`.
8
+ - Added maintainer documentation for the npmjs bootstrap path and clarified that GitHub Packages remains the current authenticated install path until the first npmjs release is published.
9
+
10
+ ## 0.5.0 - 2026-03-22
11
+
12
+ - Added Phase 4 runtime coordination: capability-targeted requests now become explicit helper assignments with deterministic assignee selection, assignment snapshots, ledger coverage, inbox visibility, and closure barriers.
13
+ - Added typed cross-lane dependency workflows with `wave dep post|show|resolve|render`, per-wave inbound/outbound dependency projections, dependency-aware gating, and replay-visible dependency state.
14
+ - Expanded hermetic trace and replay acceptance around the runtime-orchestration layer with stored outcome snapshots, launcher-generated local trace fixtures, and stronger replay comparison coverage for fallback, clarification, and dependency paths.
15
+ - Added package repository metadata (`repository`, `homepage`, and `bugs`) so GitHub Packages can link the package back to the source repository more cleanly.
16
+
17
+ ## 0.4.0 - 2026-03-21
18
+
19
+ - Expanded the runtime surface across Codex, Claude Code, and OpenCode, including Codex `exec` model/profile/config/search/image/add-dir/JSON/ephemeral flags, Claude settings-overlay merging, and OpenCode merged config overlays plus multi-file attachments.
20
+ - Added dry-run runtime harness coverage so `wave launch --dry-run --no-dashboard` now materializes prompts, merged runtime overlays, and executor launch previews for all supported real runtimes.
21
+ - Added dedicated runtime configuration reference docs under `docs/reference/runtime-config/` and seeded them through `wave init` so repos can configure executor defaults, profiles, lane overrides, and per-agent `### Executor` blocks from one canonical reference.
22
+ - Added hermetic `traceVersion: 2` trace bundles with copied launched-agent artifacts, cumulative quality metrics, hash validation, and an internal read-only replay validator for bundle integrity checks.
23
+ - Hardened runtime retry and coordination behavior by blocking retry fallback when no policy-safe fallback is available, tightening clarification-follow-up matching, and surfacing artifact-linked coordination in owning-agent inboxes.
24
+ - Added regression coverage for runtime config normalization, mixed-runtime dry runs, retry fallback gating, clarification/inbox coordination behavior, and trace replay validation.
25
+
26
+ ## 0.3.0 - 2026-03-21
27
+
28
+ - Added the Phase 1 and 2 harness runtime: canonical coordination store, compiled inboxes, wave ledger, integration summaries, and clarification triage.
29
+ - Added planning-time runtime profiles, lane runtime policy, hard runtime-mix validation, and retry fallback reassignment recording.
30
+ - Added integration stewardship and staged closure so integration gates documentation and evaluator closure.
31
+
32
+ ## 0.2.0 - 2026-03-21
33
+
34
+ - Added workspace-root aware runtime support so the package can run from `node_modules` against an adopting repository.
35
+ - Added package management commands: `wave init`, `wave upgrade`, `wave changelog`, and `wave doctor`.
36
+ - Added `.wave/install-state.json` and upgrade-history reporting for non-destructive repo upgrades.
37
+
38
+ ## 0.1.0 - 2026-03-21
39
+
40
+ - Initial generic wave orchestrator runtime.
41
+ - Added Context7 bundle resolution and multi-executor support for Codex, Claude Code, and OpenCode.
package/README.md ADDED
@@ -0,0 +1,549 @@
1
+ # Wave Orchestration
2
+
3
+ Wave Orchestration is a generic repository harness for running multi-agent work in bounded waves.
4
+
5
+ It includes:
6
+
7
+ - wave parsing and validation
8
+ - launcher, dashboard, autonomous, and human-feedback CLIs
9
+ - coordination log, helper-assignment decisions, generated board projection, compiled inboxes, and a per-wave ledger
10
+ - integration stewardship, docs queues, and versioned trace bundles under `.tmp/`
11
+ - typed cross-lane dependency tickets plus `wave dep` operator commands
12
+ - role prompt imports and closure-sweep gating
13
+ - component-cutover tracking and promotion gates
14
+ - Context7 bundle selection, prefetch, caching, and prompt injection
15
+ - starter docs and a sample wave scaffold
16
+
17
+ ## Quick Start
18
+
19
+ Published package:
20
+ - `@chllming/wave-orchestration@0.5.1`
21
+ - Current release registry: `https://npm.pkg.github.com`
22
+ - Release: [v0.5.1](https://github.com/chllming/wave-orchestration/releases/tag/v0.5.1)
23
+ - npmjs trusted publishing workflow: [publish-npm.yml](./.github/workflows/publish-npm.yml)
24
+
25
+ Install after configuring the current GitHub Packages path from [github-packages-setup.md](./docs/reference/github-packages-setup.md):
26
+
27
+ ```bash
28
+ pnpm add -D @chllming/wave-orchestration
29
+ pnpm exec wave init
30
+ pnpm exec wave doctor
31
+ pnpm exec wave launch --lane main --dry-run --no-dashboard
32
+ pnpm exec wave coord show --lane main --wave 0 --dry-run
33
+ ```
34
+
35
+ If your repo already has Wave config, docs, or waves you want to keep:
36
+
37
+ ```bash
38
+ pnpm exec wave init --adopt-existing
39
+ ```
40
+
41
+ ## New In 0.5.1
42
+
43
+ - Phase 4 finalization now correctly stays blocked on unresolved human feedback and escalation items from completed waves.
44
+ - Hermetic trace fixtures now force local executor coverage for seeded control-plane agents, so replay tests cannot accidentally launch real Codex, Claude Code, or OpenCode sessions.
45
+ - npmjs trusted publishing is now wired in parallel with GitHub Packages, with maintainer docs for the first public npmjs release bootstrap.
46
+
47
+ ## New In 0.5.0
48
+
49
+ - Capability-targeted work is now first-class: open capability requests become explicit helper assignments with deterministic assignee resolution, ledger visibility, inbox coverage, and closure barriers.
50
+ - Cross-lane work is now first-class too: `wave dep post|show|resolve|render` manages typed dependency tickets, and required inbound or outbound dependencies now surface directly in lane state and gating.
51
+ - Hermetic replay acceptance is now stronger around the runtime-orchestration layer, with stored outcome snapshots and launcher-generated local trace fixtures covering fallback, clarification, and dependency paths.
52
+ - The package now carries explicit repository metadata so GitHub Packages can link it back to this repo cleanly.
53
+
54
+ ## Requirements
55
+
56
+ - Node.js 22+
57
+ - `pnpm`
58
+ - `tmux` on `PATH` for dashboarded wave runs
59
+ - one or more real executors on `PATH`: `codex`, `claude`, or `opencode`
60
+ - optional: `CONTEXT7_API_KEY` for launcher-side Context7 prefetch
61
+
62
+ ## Install Into Another Repo
63
+
64
+ 1. Use the current GitHub Packages install path from [github-packages-setup.md](./docs/reference/github-packages-setup.md).
65
+
66
+ npmjs trusted publishing is prepared in this repo, but zero-token npmjs installs only become available after the first npmjs release is published.
67
+
68
+ GitHub Packages npm installs still require authentication, even for public packages on `npm.pkg.github.com`.
69
+
70
+ 2. Add the package:
71
+
72
+ ```bash
73
+ pnpm add -D @chllming/wave-orchestration
74
+ ```
75
+
76
+ 3. Initialize the repo:
77
+
78
+ Fresh repo:
79
+
80
+ ```bash
81
+ pnpm exec wave init
82
+ ```
83
+
84
+ Existing repo with Wave config/docs/waves you want to preserve:
85
+
86
+ ```bash
87
+ pnpm exec wave init --adopt-existing
88
+ ```
89
+
90
+ 4. Run a non-mutating health check:
91
+
92
+ ```bash
93
+ pnpm exec wave doctor
94
+ pnpm exec wave launch --lane main --dry-run --no-dashboard
95
+ ```
96
+
97
+ 5. Upgrade later without overwriting plans or waves:
98
+
99
+ ```bash
100
+ pnpm up @chllming/wave-orchestration
101
+ pnpm exec wave upgrade
102
+ pnpm exec wave changelog --since-installed
103
+ ```
104
+
105
+ `wave upgrade` only updates `.wave/install-state.json` and writes upgrade reports under `.wave/upgrade-history/`. It does not overwrite existing `wave.config.json`, role prompts, plan docs, or wave files.
106
+
107
+ ## Develop This Package
108
+
109
+ 1. Install dependencies in this source repo:
110
+
111
+ ```bash
112
+ pnpm install
113
+ ```
114
+
115
+ 2. Review the package-level config and starter assets in [wave.config.json](./wave.config.json) and [docs](./docs).
116
+
117
+ This source repo is kept as an adopted Wave workspace; `node scripts/wave.mjs doctor --json` should stay green here.
118
+
119
+ 3. Review the starter runbook in [docs/plans/wave-orchestrator.md](./docs/plans/wave-orchestrator.md), [docs/plans/context7-wave-orchestrator.md](./docs/plans/context7-wave-orchestrator.md), and [docs/plans/component-cutover-matrix.md](./docs/plans/component-cutover-matrix.md).
120
+
121
+ 4. Dry-parse the starter wave:
122
+
123
+ ```bash
124
+ node scripts/wave.mjs launch --lane main --dry-run --no-dashboard
125
+ ```
126
+
127
+ 5. When the wave parses cleanly, launch a single wave:
128
+
129
+ ```bash
130
+ node scripts/wave.mjs launch --lane main --start-wave 0 --end-wave 0 --executor codex --codex-sandbox danger-full-access
131
+ ```
132
+
133
+ Alternative real executors:
134
+
135
+ ```bash
136
+ node scripts/wave.mjs launch --lane main --start-wave 0 --end-wave 0 --executor claude
137
+ node scripts/wave.mjs launch --lane main --start-wave 0 --end-wave 0 --executor opencode
138
+ ```
139
+
140
+ ## Documentation Map
141
+
142
+ - [README.md](./README.md): package entry point, install flow, executor behavior, Context7 behavior, and command quick reference
143
+ - [docs/plans/wave-orchestrator.md](./docs/plans/wave-orchestrator.md): operator runbook for launch, coordination, closure, and upgrade flow
144
+ - [docs/plans/context7-wave-orchestrator.md](./docs/plans/context7-wave-orchestrator.md): Context7 setup, bundle authoring, injection order, and executor layering
145
+ - [docs/plans/current-state.md](./docs/plans/current-state.md): shipped runtime and package capabilities
146
+ - [docs/plans/master-plan.md](./docs/plans/master-plan.md): next priorities after the current shipped runtime
147
+ - [docs/plans/migration.md](./docs/plans/migration.md): adopt this package into another repository
148
+ - [docs/reference/github-packages-setup.md](./docs/reference/github-packages-setup.md): `.npmrc` and GitHub Packages auth details
149
+ - [docs/reference/npmjs-trusted-publishing.md](./docs/reference/npmjs-trusted-publishing.md): maintainer setup for zero-token npmjs publishing from GitHub Actions
150
+ - [docs/reference/runtime-config/README.md](./docs/reference/runtime-config/README.md): runtime precedence, merge rules, and generated artifact paths
151
+ - [docs/reference/runtime-config/codex.md](./docs/reference/runtime-config/codex.md): full Codex configuration reference
152
+ - [docs/reference/runtime-config/claude.md](./docs/reference/runtime-config/claude.md): full Claude configuration reference
153
+ - [docs/reference/runtime-config/opencode.md](./docs/reference/runtime-config/opencode.md): full OpenCode configuration reference
154
+ - [docs/reference/migration-0.2-to-0.5.md](./docs/reference/migration-0.2-to-0.5.md): migration guide for older Wave repos
155
+ - [docs/roadmap.md](./docs/roadmap.md): rationale, delivered phases, and remaining roadmap items
156
+
157
+ ## Typical Harness Workflow
158
+
159
+ 1. Initialize or adopt the workspace:
160
+ Use `pnpm exec wave init` for a fresh repo or `pnpm exec wave init --adopt-existing` for an existing repo you do not want seeded with starter content.
161
+
162
+ 2. Configure the repo:
163
+ Edit [wave.config.json](./wave.config.json) for your docs layout, shared plan docs, role prompt paths, validator thresholds, component-cutover matrix paths, Context7 bundle index path, executor profiles, and per-lane runtime policy.
164
+
165
+ 3. Write or revise the shared docs:
166
+ Keep the shared plan docs aligned with the work you want the harness to execute.
167
+
168
+ 4. Replace or revise the component cutover matrix:
169
+ Keep [docs/plans/component-cutover-matrix.md](./docs/plans/component-cutover-matrix.md) and [docs/plans/component-cutover-matrix.json](./docs/plans/component-cutover-matrix.json) aligned with the components and maturity levels your repo actually uses.
170
+
171
+ 5. Create a wave file:
172
+ Put wave markdown under [docs/plans/waves](./docs/plans/waves) using the same sections as the sample [wave-0.md](./docs/plans/waves/wave-0.md).
173
+
174
+ 6. Dry-run first:
175
+
176
+ ```bash
177
+ pnpm exec wave doctor
178
+ pnpm exec wave launch --lane main --dry-run --no-dashboard
179
+ ```
180
+
181
+ Dry-run now writes compiled prompts and executor previews under `.tmp/<lane>-wave-launcher/dry-run/`, including `executors/wave-<n>/<agent-slug>/launch-preview.json`.
182
+
183
+ 7. Inspect the seeded coordination state and generated inboxes:
184
+
185
+ ```bash
186
+ pnpm exec wave coord show --lane main --wave 0 --dry-run
187
+ pnpm exec wave coord inbox --lane main --wave 0 --agent A1 --dry-run
188
+ pnpm exec wave dep show --lane main --wave 0 --json
189
+ ```
190
+
191
+ 8. Reconcile stale state if needed:
192
+
193
+ ```bash
194
+ pnpm exec wave launch --lane main --reconcile-status
195
+ ```
196
+
197
+ 9. Check pending human feedback:
198
+
199
+ ```bash
200
+ pnpm exec wave feedback list --lane main --pending
201
+ ```
202
+
203
+ The harness now tries to resolve clarification requests before asking a human. Agents should emit `clarification-request` coordination records first; unresolved items are written into `.tmp/<lane>-wave-launcher/feedback/triage/` and only then become human feedback tickets. Routed clarification follow-ups stay blocking until the linked request or escalation is fully resolved.
204
+
205
+ Cross-lane work is also explicit and operator-visible:
206
+
207
+ ```bash
208
+ pnpm exec wave dep post --owner-lane main --requester-lane release --owner-wave 0 --requester-wave 2 --agent launcher --summary "Need shared-plan reconciliation" --target capability:docs-shared-plan --required
209
+ pnpm exec wave dep show --lane main --wave 0 --json
210
+ pnpm exec wave dep resolve --lane main --id <dependency-id> --agent A8
211
+ ```
212
+
213
+ 10. Launch one wave at a time until the plan is stable:
214
+
215
+ ```bash
216
+ pnpm exec wave launch --lane main --start-wave 0 --end-wave 0 --executor codex --codex-sandbox danger-full-access
217
+ ```
218
+
219
+ 11. Use autonomous mode only after the wave set is already solid:
220
+
221
+ ```bash
222
+ pnpm exec wave autonomous --lane main --executor codex --codex-sandbox danger-full-access
223
+ ```
224
+
225
+ ## Runtime Artifacts
226
+
227
+ The launcher writes runtime state under `.tmp/<lane>-wave-launcher/`:
228
+
229
+ - `coordination/wave-<n>.jsonl`: append-only coordination upsert log
230
+ - `assignments/wave-<n>.json`: resolved helper-assignment snapshot derived from open requests
231
+ - `messageboards/wave-<n>.md`: generated board projection for humans
232
+ - `inboxes/wave-<n>/`: compiled shared summary plus per-agent inboxes
233
+ - `ledger/wave-<n>.json`: derived task/blocker/closure state
234
+ - `integration/wave-<n>.json|md`: explicit or synthesized integration summary
235
+ - `dependencies/wave-<n>.json|md`: per-wave inbound/outbound dependency snapshot
236
+ - `docs-queue/wave-<n>.json`: documentation reconciliation queue
237
+ - `traces/wave-<n>/attempt-<k>/`: versioned attempt bundle with run metadata, quality metrics, prompts, logs, statuses, inboxes, and structured signals
238
+ - `feedback/triage/wave-<n>.jsonl|/pending-human.md`: clarification triage log plus unresolved human escalations
239
+ - `prompts/`, `logs/`, `status/`, `executors/`, and `context7-cache/`: run artifacts, overlays, and cached external-doc snippets
240
+
241
+ `wave.config.json` can now declare executor profiles and lane runtime policy. In this repo, `main` defaults implementation roles to `codex`, integration/documentation/evaluator roles to `claude`, and research or ops-heavy roles to `opencode`. Runtime mix targets are enforced before launch, retry fallbacks are chosen from the configured fallback chain when a failed agent can move safely, and those fallback decisions are recorded in the ledger, integration summary, and traces. Generic `budget.minutes` now caps attempt timeouts, and `budget.turns` seeds vendor turn or step limits when the executor-specific settings are absent.
242
+
243
+ ## Trace And Replay
244
+
245
+ - `--dry-run` is still pre-attempt only. It writes the manifest, coordination log, rendered board, ledger, docs queue, integration summary, and compiled inboxes under `.tmp/<lane>-wave-launcher/dry-run/`.
246
+ - `--dry-run` does not write `attempt-<k>` trace snapshots. The `traces/` directory may exist in dry-run state, but it should remain file-empty.
247
+ - Real attempts write a full hermetic `traceVersion: 2` bundle under `.tmp/<lane>-wave-launcher/traces/wave-<n>/attempt-<k>/`.
248
+ - `run-metadata.json` is the canonical bundle index. It records the wave hash, attempt number, launcher settings, agent prompt hashes, executor history, Context7 snippet hashes, gate snapshot, artifact-presence map, `replayContext`, and `historySnapshot`.
249
+ - `outcome.json` is the stored replay baseline for the bundle. It carries the normalized stored gate snapshot plus the stored cumulative quality report so replay can compare recomputed results against a hashed bundle-local source of truth.
250
+ - For `traceVersion: 2`, every launched agent must have copied prompt, log, status, inbox, and summary artifacts inside the bundle. Waves with `## Component promotions` must also carry the copied component matrix JSON.
251
+ - `quality.json` is cumulative through the current attempt. It reports unresolved request and clarification counts, human-escalation and orchestrator-resolution counts, contradiction and documentation-drift counts, proof completeness, relaunch counts, fallback rate, acknowledgement and blocker timing, evaluator reversal, helper-assignment and dependency timing, and the final integration recommendation.
252
+ - Hermetic replay is read-only. Replay uses only the stored bundle contents, ignores inline summary duplicates in `run-metadata.json`, revalidates recorded artifact hashes, reports stored-vs-recomputed diffs for gate and quality state, and does not rewrite summaries or other bundle files.
253
+ - Legacy `traceVersion: 1` bundles are still accepted in best-effort mode with explicit warnings. They are not treated as fully hermetic.
254
+ - Replay validation is internal today. The source tree exposes helper modules for loading, validating, and replaying trace bundles, but there is no supported `wave replay` public CLI yet.
255
+
256
+ ## Wave File Shape
257
+
258
+ Each wave is regular markdown. The harness looks for:
259
+
260
+ - `## Component promotions`
261
+ - `## Context7 defaults`
262
+ - `## Agent <id>: <title>`
263
+ - `### Executor`
264
+ - `### Role prompts`
265
+ - `### Context7`
266
+ - `### Components`
267
+ - `### Capabilities`
268
+ - `### Exit contract`
269
+ - `### Prompt`
270
+
271
+ Under the starter config in this repo, wave 0 and later also require:
272
+
273
+ - `A0` as the evaluator
274
+ - `A8` as the integration steward
275
+ - `A9` as the documentation steward
276
+
277
+ Optional standing roles are also available for infra- or rollout-heavy waves:
278
+
279
+ - `docs/agents/wave-infra-role.md`
280
+ - `docs/agents/wave-deploy-verifier-role.md`
281
+
282
+ The sample [wave-0.md](./docs/plans/waves/wave-0.md) is a complete valid example. The excerpt below shows the implementation-agent portion of a full wave:
283
+
284
+ ````md
285
+ # Wave 1 - Example
286
+
287
+ ## Component promotions
288
+
289
+ - wave-parser-and-launcher: repo-landed
290
+
291
+ ## Context7 defaults
292
+
293
+ - bundle: node-typescript
294
+ - query: "Node process spawning and vitest usage"
295
+
296
+ ## Agent A0: Running Evaluator
297
+
298
+ ### Role prompts
299
+
300
+ - docs/agents/wave-evaluator-role.md
301
+
302
+ ### Context7
303
+
304
+ - bundle: none
305
+
306
+ ### Prompt
307
+ ```text
308
+ Read docs/reference/repository-guidance.md.
309
+ Read docs/research/agent-context-sources.md.
310
+
311
+ File ownership (only touch these paths):
312
+ - docs/plans/waves/reviews/wave-1-evaluator.md
313
+ ```
314
+
315
+ ## Agent A1: Runtime Work
316
+
317
+ ### Executor
318
+
319
+ - id: claude
320
+ - model: claude-sonnet-4-6
321
+ - claude.max_turns: 4
322
+
323
+ ### Context7
324
+
325
+ - bundle: node-typescript
326
+ - query: "Node child_process and test execution"
327
+
328
+ ### Components
329
+
330
+ - wave-parser-and-launcher
331
+
332
+ ### Capabilities
333
+
334
+ - runtime
335
+ - validation
336
+
337
+ ### Exit contract
338
+
339
+ - completion: integrated
340
+ - durability: none
341
+ - proof: integration
342
+ - doc-impact: owned
343
+
344
+ ### Prompt
345
+ ```text
346
+ Read docs/reference/repository-guidance.md.
347
+ Read docs/research/agent-context-sources.md.
348
+
349
+ File ownership (only touch these paths):
350
+ - src/example.ts
351
+ - test/example.test.ts
352
+ ```
353
+ ````
354
+
355
+ `## Component promotions` declares the component levels this wave is responsible for proving. `### Components` assigns each promoted component to one or more implementation agents.
356
+
357
+ `### Capabilities` is optional. It lets the coordination layer route targeted follow-up work to a capability rather than a single hard-coded agent.
358
+
359
+ Open capability-targeted requests now become explicit helper assignments. The launcher resolves them deterministically, writes the assignment snapshot under `.tmp/`, mirrors the decision into the coordination log for the board and replay surface, and keeps the wave blocked until the linked follow-up resolves.
360
+
361
+ The component matrix is also expected to reflect the landed state. Before a promoted wave closes, `docs/plans/component-cutover-matrix.json` should advance each promoted component's `currentLevel` to the proved target.
362
+
363
+ `### Executor` is optional. Resolution order is:
364
+
365
+ - per-agent `### Executor`
366
+ - selected executor profile id
367
+ - lane role default
368
+ - launcher `--executor`
369
+ - `wave.config.json` `executors.default`
370
+
371
+ Common keys:
372
+
373
+ - `id`
374
+ - `profile`
375
+ - `model`
376
+ - `fallbacks`
377
+ - `tags`
378
+ - `budget.turns`
379
+ - `budget.minutes`
380
+
381
+ The full supported runtime surface lives in:
382
+
383
+ - [docs/reference/runtime-config/README.md](./docs/reference/runtime-config/README.md)
384
+ - [docs/reference/runtime-config/codex.md](./docs/reference/runtime-config/codex.md)
385
+ - [docs/reference/runtime-config/claude.md](./docs/reference/runtime-config/claude.md)
386
+ - [docs/reference/runtime-config/opencode.md](./docs/reference/runtime-config/opencode.md)
387
+
388
+ Example runtime blocks:
389
+
390
+ ````md
391
+ ### Executor
392
+
393
+ - id: codex
394
+ - model: gpt-5-codex
395
+ - codex.profile_name: review
396
+ - codex.config: model_reasoning_effort=high
397
+ - codex.search: true
398
+ - codex.json: true
399
+ ````
400
+
401
+ ````md
402
+ ### Executor
403
+
404
+ - id: claude
405
+ - model: claude-sonnet-4-6
406
+ - claude.settings_json: {"permissions":{"allow":["Read"]}}
407
+ - claude.hooks_json: {"Stop":[{"command":"echo stop"}]}
408
+ - claude.allowed_http_hook_urls: https://example.com/hooks
409
+ ````
410
+
411
+ ````md
412
+ ### Executor
413
+
414
+ - id: opencode
415
+ - opencode.files: README.md,docs/plans/current-state.md
416
+ - opencode.config_json: {"instructions":["Keep shared-plan edits concise."]}
417
+ ````
418
+
419
+ When an implementation agent owns components, it must emit:
420
+
421
+ ```text
422
+ [wave-component] component=<id> level=<level> state=<met|gap> detail=<short-note>
423
+ ```
424
+
425
+ The launcher will not accept final completion until every promoted component has at least one matching `state=met` proof marker at the declared level.
426
+
427
+ ## Executor Behavior
428
+
429
+ - `codex`
430
+ The harness sends the generated task prompt through `codex exec` stdin. `--codex-sandbox` and `wave.config.json` `executors.codex.sandbox` control the default sandbox. Current runtime support includes CLI profile selection, inline `-c` overrides, search, images, extra directories, JSON mode, and ephemeral sessions.
431
+ - `claude`
432
+ The harness launches `claude -p` headlessly. The generated task prompt becomes the run message, and a runtime overlay file is injected with `--append-system-prompt-file` by default. Current runtime support includes merged per-run settings overlays from a base `claude.settings` file plus inline settings JSON, hooks JSON, and allowed HTTP hook URLs. Switch to full replacement in `wave.config.json` with `executors.claude.appendSystemPromptMode: "replace"`.
433
+ - `opencode`
434
+ The harness launches `opencode run` headlessly. The generated task prompt becomes the run message, and the harness writes an ignored runtime `opencode.json` plus a generated agent prompt under `.tmp/.../executors/`, then points `OPENCODE_CONFIG` at that overlay for the run. Current runtime support includes merged config JSON and repeated file attachments.
435
+ - `local`
436
+ Smoke-test only. It creates placeholder deliverables and emits the expected Wave markers, but it is not a real agent runtime.
437
+
438
+ The run-level default executor comes from `wave.config.json`:
439
+
440
+ ```json
441
+ {
442
+ "executors": {
443
+ "default": "codex",
444
+ "codex": {
445
+ "command": "codex",
446
+ "sandbox": "danger-full-access"
447
+ },
448
+ "claude": {
449
+ "command": "claude",
450
+ "appendSystemPromptMode": "append",
451
+ "outputFormat": "text"
452
+ },
453
+ "opencode": {
454
+ "command": "opencode",
455
+ "format": "default"
456
+ }
457
+ }
458
+ }
459
+ ```
460
+
461
+ Dry-run executor previews are written under the same `executors/` tree as live overlays. For each agent, `launch-preview.json` records the resolved executor id, exported env vars, rate-limit retry mode, and the exact invocation lines that would be used in a real run.
462
+
463
+ ## Context7 Setup
464
+
465
+ 1. Add `CONTEXT7_API_KEY` to `.env.local` at repo root.
466
+
467
+ 2. Export it into your shell or run commands through the helper:
468
+
469
+ ```bash
470
+ source scripts/context7-export-env.sh
471
+ ```
472
+
473
+ or
474
+
475
+ ```bash
476
+ bash scripts/context7-export-env.sh run pnpm context7:api-check
477
+ ```
478
+
479
+ 3. Verify the API key works:
480
+
481
+ ```bash
482
+ pnpm context7:api-check
483
+ ```
484
+
485
+ 4. Define or trim bundles in [docs/context7/bundles.json](./docs/context7/bundles.json).
486
+
487
+ 5. Declare scope in the wave file:
488
+ Use wave-level defaults for the general lane of work, then override per agent only when the agent truly needs a narrower or different external-doc slice.
489
+
490
+ ## How Context7 Works In The Harness
491
+
492
+ - The launcher resolves Context7 scope in this order: agent `### Context7`, wave `## Context7 defaults`, lane default, then `none`.
493
+ - If a bundle is active, the launcher prefetches third-party snippets before starting the agent.
494
+ - The generated agent prompt includes a `Context7 scope for this run` block that lists:
495
+ the bundle id, query focus, allowed libraries, and any prefetched non-canonical snippets.
496
+ - Prefetched text is included before the assigned implementation prompt, regardless of executor.
497
+ - Cache output is written under `.tmp/<lane>-wave-launcher/context7-cache/`.
498
+ - Executor runtime overlays are written under `.tmp/<lane>-wave-launcher/executors/`.
499
+ - Missing API keys or Context7 API failures do not block the wave; the launcher fails open and starts the agent without the prefetched snippets.
500
+ - You can disable injection for a run with `--no-context7`.
501
+
502
+ Layering by executor:
503
+
504
+ - `codex`: repository rules + generated task prompt with injected Context7 block
505
+ - `claude`: repository `CLAUDE.md` / Claude settings + harness append-system-prompt overlay + generated task prompt with injected Context7 block
506
+ - `opencode`: repository `AGENTS.md` / project `opencode.json` + harness runtime `OPENCODE_CONFIG` overlay + generated task prompt with injected Context7 block
507
+
508
+ ## Useful Commands
509
+
510
+ ```bash
511
+ pnpm exec wave init
512
+ pnpm exec wave init --adopt-existing
513
+ pnpm exec wave doctor
514
+ pnpm exec wave launch --lane main --dry-run --no-dashboard
515
+ pnpm exec wave coord show --lane main --wave 0 --dry-run --json
516
+ pnpm exec wave coord inbox --lane main --wave 0 --agent A1 --dry-run
517
+ pnpm exec wave coord render --lane main --wave 0 --dry-run
518
+ pnpm exec wave coord post --lane main --wave 0 --agent A1 --kind blocker --summary "Need repository decision"
519
+ pnpm exec wave launch --lane main --reconcile-status
520
+ pnpm exec wave launch --lane main --start-wave 2 --end-wave 2 --executor codex --codex-sandbox danger-full-access
521
+ pnpm exec wave launch --lane main --start-wave 2 --end-wave 2 --executor claude
522
+ pnpm exec wave launch --lane main --start-wave 2 --end-wave 2 --executor opencode
523
+ pnpm exec wave launch --lane main --auto-next --executor codex --codex-sandbox danger-full-access
524
+ pnpm exec wave feedback list --lane main --pending
525
+ pnpm exec wave feedback show --id <request-id>
526
+ pnpm exec wave feedback respond --id <request-id> --response "..." --operator "<name>"
527
+ pnpm exec wave autonomous --lane main --executor codex --codex-sandbox danger-full-access
528
+ pnpm exec wave autonomous --lane main --executor claude
529
+ pnpm exec wave autonomous --lane main --executor opencode
530
+ pnpm exec wave upgrade
531
+ pnpm exec wave changelog --since-installed
532
+ ```
533
+
534
+ ## Research Sources
535
+
536
+ The repository only commits a source index. Hydrated paper or article caches should stay local and ignored under `docs/research/cache/` or `docs/research/agent-context-cache/`.
537
+
538
+ - [Effective harnesses for long-running agents](./docs/research/agent-context-cache/articles/effective-harnesses-for-long-running-agents.md)
539
+ - [Harness engineering: leveraging Codex in an agent-first world](./docs/research/agent-context-cache/articles/harness-engineering-leveraging-codex-in-an-agent-first-world.md)
540
+ - [Unlocking the Codex harness: how we built the App Server](./docs/research/agent-context-cache/articles/unlocking-the-codex-harness-how-we-built-the-app-server.md)
541
+ - [Building Effective AI Coding Agents for the Terminal: Scaffolding, Harness, Context Engineering, and Lessons Learned](./docs/research/agent-context-cache/papers/building-effective-ai-coding-agents-for-the-terminal-scaffolding-harness-context-engineering-and-lessons-learned.md)
542
+ - [VeRO: An Evaluation Harness for Agents to Optimize Agents](./docs/research/agent-context-cache/papers/vero-an-evaluation-harness-for-agents-to-optimize-agents.md)
543
+ - [EvoClaw: Evaluating AI Agents on Continuous Software Evolution](./docs/research/agent-context-cache/papers/evoclaw-evaluating-ai-agents-on-continuous-software-evolution.md)
544
+ - [LLM-based Multi-Agent Blackboard System for Information Discovery in Data Science](./docs/research/agent-context-cache/papers/llm-based-multi-agent-blackboard-system-for-information-discovery-in-data-science.md)
545
+ - [Exploring Advanced LLM Multi-Agent Systems Based on Blackboard Architecture](./docs/research/agent-context-cache/papers/exploring-advanced-llm-multi-agent-systems-based-on-blackboard-architecture.md)
546
+ - [DOVA: Deliberation-First Multi-Agent Orchestration for Autonomous Research Automation](./docs/research/agent-context-cache/papers/dova-deliberation-first-multi-agent-orchestration-for-autonomous-research-automation.md)
547
+ - [Silo-Bench: A Scalable Environment for Evaluating Distributed Coordination in Multi-Agent LLM Systems](./docs/research/agent-context-cache/papers/silo-bench-a-scalable-environment-for-evaluating-distributed-coordination-in-multi-agent-llm-systems.md)
548
+ - [SYMPHONY: Synergistic Multi-agent Planning with Heterogeneous Language Model Assembly](./docs/research/agent-context-cache/papers/symphony-synergistic-multi-agent-planning-with-heterogeneous-language-model-assembly.md)
549
+ - [An Open Agent Architecture](./docs/research/agent-context-cache/papers/an-open-agent-architecture.md)
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: "Wave Deploy Verifier Role"
3
+ summary: "Standing prompt for a rollout-focused wave agent that verifies deploy readiness, health, and recovery evidence."
4
+ ---
5
+
6
+ # Wave Deploy Verifier Role
7
+
8
+ Use this prompt when an agent should verify deployment or rollout state for a wave.
9
+
10
+ ## Standing prompt
11
+
12
+ ```text
13
+ You are the deployment verifier for the current wave.
14
+
15
+ Your job is to prove whether the wave's deployment surface is actually healthy, degraded, failed, or rolled over. You do not replace implementation ownership, but you do own rollout evidence, health verification, and rollback or recovery notes when the wave touches deployable systems.
16
+
17
+ Operating rules:
18
+ - Re-read the compiled shared summary, your inbox, and the generated wave board projection before major decisions, before validation, and before final output.
19
+ - Treat deployment evidence as a first-class proof surface, not as an afterthought to code completion.
20
+ - Prefer explicit health checks, readiness checks, and rollback notes over generic "deploy passed" claims.
21
+ - If the wave touches a live or shared environment, fail closed on missing verification evidence.
22
+
23
+ What you must do:
24
+ - identify which service, package, job, or runtime surface is being deployed or verified
25
+ - surface rollout blockers, health regressions, readiness gaps, and rollback risk early
26
+ - coordinate with implementation, infra, integration, and documentation owners when deployment evidence changes what the wave can honestly claim
27
+ - emit structured deployment markers during deploy checks:
28
+ `[deploy-status] service=<service-name> state=<deploying|healthy|failed|rolledover> detail=<short-note>`
29
+ - use coordination records for follow-up work, rollback needs, or unresolved release risk that other agents must close
30
+
31
+ Use `healthy` only when the target service or deploy surface is actually verified at the level the wave claims.
32
+ Use `rolledover` when the wave had to fall back or revert and later waves must not assume the new path is authoritative.
33
+ Use `failed` when deployment verification did not succeed and the wave cannot honestly close that deploy surface.
34
+ ```
@@ -0,0 +1,30 @@
1
+ ---
2
+ title: "Wave Documentation Role"
3
+ summary: "Standing prompt for the documentation steward that keeps shared plan docs aligned with landed work."
4
+ ---
5
+
6
+ # Wave Documentation Role
7
+
8
+ Use this prompt when an agent should own cross-cutting plan-document reconciliation for a wave.
9
+
10
+ ## Standing prompt
11
+
12
+ ```text
13
+ You are the wave documentation steward for the current wave.
14
+
15
+ Your job is to keep shared plan and status docs aligned with the real landed implementation while the wave is still in progress. You do not replace implementation-owned docs, but you do own same-wave closure of the shared plan docs.
16
+
17
+ Operating rules:
18
+ - Anchor updates to docs/reference/repository-guidance.md.
19
+ - Re-read the compiled shared summary, your inbox, and the generated wave board projection before major decisions, before validation, and before final output.
20
+ - Coordinate with the evaluator and implementation agents, but do not use coordination as an excuse to defer obvious shared-plan updates.
21
+ - Keep subsystem-specific docs with the agents that land those deliverables.
22
+
23
+ What you must do:
24
+ - identify which landed changes require shared plan-doc updates
25
+ - update docs/plans/current-state.md, docs/plans/master-plan.md, and docs/plans/migration.md when the wave changes status, sequencing, ownership, or proof expectations
26
+ - keep docs/plans/component-cutover-matrix.md and docs/plans/component-cutover-matrix.json aligned when the wave changes declared component maturity or next-safe assumptions, including advancing `currentLevel` when a promoted component lands
27
+ - leave an explicit closure note with exact shared-plan paths covered, or an exact-scope `no-change` note
28
+ - emit one final structured marker:
29
+ `[wave-doc-closure] state=<closed|no-change|delta> paths=<comma-separated-paths> detail=<short-note>`
30
+ ```