@chllming/wave-orchestration 0.5.4 → 0.6.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 (126) hide show
  1. package/CHANGELOG.md +52 -3
  2. package/README.md +33 -5
  3. package/docs/README.md +18 -4
  4. package/docs/agents/wave-cont-eval-role.md +36 -0
  5. package/docs/agents/{wave-evaluator-role.md → wave-cont-qa-role.md} +14 -11
  6. package/docs/agents/wave-documentation-role.md +1 -1
  7. package/docs/agents/wave-infra-role.md +1 -1
  8. package/docs/agents/wave-integration-role.md +3 -3
  9. package/docs/agents/wave-launcher-role.md +4 -3
  10. package/docs/agents/wave-security-role.md +40 -0
  11. package/docs/concepts/context7-vs-skills.md +1 -1
  12. package/docs/concepts/what-is-a-wave.md +56 -6
  13. package/docs/evals/README.md +166 -0
  14. package/docs/evals/benchmark-catalog.json +663 -0
  15. package/docs/guides/author-and-run-waves.md +135 -0
  16. package/docs/guides/planner.md +5 -0
  17. package/docs/guides/terminal-surfaces.md +2 -0
  18. package/docs/plans/component-cutover-matrix.json +1 -1
  19. package/docs/plans/component-cutover-matrix.md +1 -1
  20. package/docs/plans/current-state.md +19 -1
  21. package/docs/plans/examples/wave-example-live-proof.md +435 -0
  22. package/docs/plans/migration.md +42 -0
  23. package/docs/plans/wave-orchestrator.md +46 -7
  24. package/docs/plans/waves/wave-0.md +4 -4
  25. package/docs/reference/live-proof-waves.md +177 -0
  26. package/docs/reference/migration-0.2-to-0.5.md +26 -19
  27. package/docs/reference/npmjs-trusted-publishing.md +6 -5
  28. package/docs/reference/runtime-config/README.md +14 -4
  29. package/docs/reference/sample-waves.md +87 -0
  30. package/docs/reference/skills.md +110 -42
  31. package/docs/research/agent-context-sources.md +130 -11
  32. package/docs/research/coordination-failure-review.md +266 -0
  33. package/docs/roadmap.md +6 -2
  34. package/package.json +2 -2
  35. package/releases/manifest.json +35 -2
  36. package/scripts/research/agent-context-archive.mjs +83 -1
  37. package/scripts/research/manifests/agent-context-expanded-2026-03-22.mjs +811 -0
  38. package/scripts/wave-orchestrator/adhoc.mjs +1331 -0
  39. package/scripts/wave-orchestrator/agent-state.mjs +358 -6
  40. package/scripts/wave-orchestrator/artifact-schemas.mjs +173 -0
  41. package/scripts/wave-orchestrator/clarification-triage.mjs +10 -3
  42. package/scripts/wave-orchestrator/config.mjs +48 -12
  43. package/scripts/wave-orchestrator/context7.mjs +2 -0
  44. package/scripts/wave-orchestrator/coord-cli.mjs +51 -19
  45. package/scripts/wave-orchestrator/coordination-store.mjs +26 -4
  46. package/scripts/wave-orchestrator/coordination.mjs +83 -9
  47. package/scripts/wave-orchestrator/dashboard-state.mjs +20 -8
  48. package/scripts/wave-orchestrator/dep-cli.mjs +5 -2
  49. package/scripts/wave-orchestrator/docs-queue.mjs +8 -2
  50. package/scripts/wave-orchestrator/evals.mjs +451 -0
  51. package/scripts/wave-orchestrator/feedback.mjs +15 -1
  52. package/scripts/wave-orchestrator/install.mjs +32 -9
  53. package/scripts/wave-orchestrator/launcher-closure.mjs +281 -0
  54. package/scripts/wave-orchestrator/launcher-runtime.mjs +334 -0
  55. package/scripts/wave-orchestrator/launcher.mjs +709 -601
  56. package/scripts/wave-orchestrator/ledger.mjs +123 -20
  57. package/scripts/wave-orchestrator/local-executor.mjs +99 -12
  58. package/scripts/wave-orchestrator/planner.mjs +177 -42
  59. package/scripts/wave-orchestrator/replay.mjs +6 -3
  60. package/scripts/wave-orchestrator/role-helpers.mjs +84 -0
  61. package/scripts/wave-orchestrator/shared.mjs +75 -11
  62. package/scripts/wave-orchestrator/skills.mjs +637 -106
  63. package/scripts/wave-orchestrator/traces.mjs +71 -48
  64. package/scripts/wave-orchestrator/wave-files.mjs +947 -101
  65. package/scripts/wave.mjs +9 -0
  66. package/skills/README.md +202 -0
  67. package/skills/provider-aws/SKILL.md +111 -0
  68. package/skills/provider-aws/adapters/claude.md +1 -0
  69. package/skills/provider-aws/adapters/codex.md +1 -0
  70. package/skills/provider-aws/references/service-verification.md +39 -0
  71. package/skills/provider-aws/skill.json +50 -1
  72. package/skills/provider-custom-deploy/SKILL.md +59 -0
  73. package/skills/provider-custom-deploy/skill.json +46 -1
  74. package/skills/provider-docker-compose/SKILL.md +90 -0
  75. package/skills/provider-docker-compose/adapters/local.md +1 -0
  76. package/skills/provider-docker-compose/skill.json +49 -1
  77. package/skills/provider-github-release/SKILL.md +116 -1
  78. package/skills/provider-github-release/adapters/claude.md +1 -0
  79. package/skills/provider-github-release/adapters/codex.md +1 -0
  80. package/skills/provider-github-release/skill.json +51 -1
  81. package/skills/provider-kubernetes/SKILL.md +137 -0
  82. package/skills/provider-kubernetes/adapters/claude.md +1 -0
  83. package/skills/provider-kubernetes/adapters/codex.md +1 -0
  84. package/skills/provider-kubernetes/references/kubectl-patterns.md +58 -0
  85. package/skills/provider-kubernetes/skill.json +48 -1
  86. package/skills/provider-railway/SKILL.md +118 -1
  87. package/skills/provider-railway/references/verification-commands.md +39 -0
  88. package/skills/provider-railway/skill.json +67 -1
  89. package/skills/provider-ssh-manual/SKILL.md +91 -0
  90. package/skills/provider-ssh-manual/skill.json +50 -1
  91. package/skills/repo-coding-rules/SKILL.md +84 -0
  92. package/skills/repo-coding-rules/skill.json +30 -1
  93. package/skills/role-cont-eval/SKILL.md +90 -0
  94. package/skills/role-cont-eval/adapters/codex.md +1 -0
  95. package/skills/role-cont-eval/skill.json +36 -0
  96. package/skills/role-cont-qa/SKILL.md +93 -0
  97. package/skills/role-cont-qa/adapters/claude.md +1 -0
  98. package/skills/role-cont-qa/skill.json +36 -0
  99. package/skills/role-deploy/SKILL.md +90 -0
  100. package/skills/role-deploy/skill.json +32 -1
  101. package/skills/role-documentation/SKILL.md +66 -0
  102. package/skills/role-documentation/skill.json +32 -1
  103. package/skills/role-implementation/SKILL.md +62 -0
  104. package/skills/role-implementation/skill.json +32 -1
  105. package/skills/role-infra/SKILL.md +74 -0
  106. package/skills/role-infra/skill.json +32 -1
  107. package/skills/role-integration/SKILL.md +79 -1
  108. package/skills/role-integration/skill.json +32 -1
  109. package/skills/role-research/SKILL.md +58 -0
  110. package/skills/role-research/skill.json +32 -1
  111. package/skills/role-security/SKILL.md +60 -0
  112. package/skills/role-security/skill.json +36 -0
  113. package/skills/runtime-claude/SKILL.md +60 -1
  114. package/skills/runtime-claude/skill.json +32 -1
  115. package/skills/runtime-codex/SKILL.md +52 -1
  116. package/skills/runtime-codex/skill.json +32 -1
  117. package/skills/runtime-local/SKILL.md +39 -0
  118. package/skills/runtime-local/skill.json +32 -1
  119. package/skills/runtime-opencode/SKILL.md +51 -0
  120. package/skills/runtime-opencode/skill.json +32 -1
  121. package/skills/wave-core/SKILL.md +107 -0
  122. package/skills/wave-core/references/marker-syntax.md +62 -0
  123. package/skills/wave-core/skill.json +31 -1
  124. package/wave.config.json +35 -6
  125. package/skills/role-evaluator/SKILL.md +0 -6
  126. package/skills/role-evaluator/skill.json +0 -5
@@ -2,6 +2,11 @@ import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import { buildAgentExecutionSummary, validateImplementationSummary } from "./agent-state.mjs";
4
4
  import { openClarificationLinkedRequests, readCoordinationLog, serializeCoordinationState } from "./coordination-store.mjs";
5
+ import {
6
+ isContEvalReportOnlyAgent,
7
+ isSecurityReviewAgent,
8
+ resolveSecurityReviewReportPath,
9
+ } from "./role-helpers.mjs";
5
10
  import {
6
11
  REPO_ROOT,
7
12
  ensureDirectory,
@@ -12,6 +17,7 @@ import {
12
17
  writeJsonAtomic,
13
18
  writeTextAtomic,
14
19
  } from "./shared.mjs";
20
+ import { summarizeResolvedSkills } from "./skills.mjs";
15
21
 
16
22
  export const TRACE_VERSION = 2;
17
23
  const LEGACY_TRACE_VERSION = 1;
@@ -109,7 +115,10 @@ function collectLaunchEventsFromMetadata(metadata) {
109
115
  }
110
116
 
111
117
  function collectEvaluatorStatusesFromMetadata(metadata) {
112
- const statusCode = metadata?.gateSnapshot?.evaluatorGate?.statusCode || null;
118
+ const statusCode =
119
+ metadata?.gateSnapshot?.contQaGate?.statusCode ||
120
+ metadata?.gateSnapshot?.evaluatorGate?.statusCode ||
121
+ null;
113
122
  if (!statusCode) {
114
123
  return [];
115
124
  }
@@ -133,7 +142,8 @@ function collectLaunchEventsFromCurrent(agentRuns, attempt) {
133
142
  }
134
143
 
135
144
  function collectEvaluatorStatusesFromCurrent(gateSnapshot, attempt) {
136
- const statusCode = gateSnapshot?.evaluatorGate?.statusCode || null;
145
+ const statusCode =
146
+ gateSnapshot?.contQaGate?.statusCode || gateSnapshot?.evaluatorGate?.statusCode || null;
137
147
  if (!statusCode) {
138
148
  return [];
139
149
  }
@@ -143,7 +153,7 @@ function collectEvaluatorStatusesFromCurrent(gateSnapshot, attempt) {
143
153
  function emptyHistorySnapshot() {
144
154
  return {
145
155
  launchEvents: [],
146
- evaluatorStatuses: [],
156
+ contQaStatuses: [],
147
157
  };
148
158
  }
149
159
 
@@ -151,6 +161,11 @@ function normalizeHistorySnapshot(snapshot) {
151
161
  if (!snapshot || typeof snapshot !== "object") {
152
162
  return emptyHistorySnapshot();
153
163
  }
164
+ const rawContQaStatuses = Array.isArray(snapshot.contQaStatuses)
165
+ ? snapshot.contQaStatuses
166
+ : Array.isArray(snapshot.evaluatorStatuses)
167
+ ? snapshot.evaluatorStatuses
168
+ : [];
154
169
  return {
155
170
  launchEvents: dedupeByKey(
156
171
  Array.isArray(snapshot.launchEvents)
@@ -166,16 +181,14 @@ function normalizeHistorySnapshot(snapshot) {
166
181
  : [],
167
182
  (event) => `${event.attempt}:${event.agentId}:${event.executorId || ""}`,
168
183
  ).sort((a, b) => a.attempt - b.attempt || a.agentId.localeCompare(b.agentId)),
169
- evaluatorStatuses: dedupeByKey(
170
- Array.isArray(snapshot.evaluatorStatuses)
171
- ? snapshot.evaluatorStatuses
172
- .filter(Boolean)
173
- .map((entry) => ({
174
- attempt: Number.parseInt(String(entry.attempt), 10),
175
- statusCode: String(entry.statusCode || "").trim() || null,
176
- }))
177
- .filter((entry) => Number.isFinite(entry.attempt) && entry.statusCode)
178
- : [],
184
+ contQaStatuses: dedupeByKey(
185
+ rawContQaStatuses
186
+ .filter(Boolean)
187
+ .map((entry) => ({
188
+ attempt: Number.parseInt(String(entry.attempt), 10),
189
+ statusCode: String(entry.statusCode || "").trim() || null,
190
+ }))
191
+ .filter((entry) => Number.isFinite(entry.attempt) && entry.statusCode),
179
192
  (entry) => `${entry.attempt}`,
180
193
  ).sort((a, b) => a.attempt - b.attempt),
181
194
  };
@@ -196,7 +209,7 @@ function buildHistorySnapshotFromPriorMetadata(priorMetadata) {
196
209
  }
197
210
  return normalizeHistorySnapshot({
198
211
  launchEvents: (priorMetadata || []).flatMap((metadata) => collectLaunchEventsFromMetadata(metadata)),
199
- evaluatorStatuses: (priorMetadata || []).flatMap((metadata) =>
212
+ contQaStatuses: (priorMetadata || []).flatMap((metadata) =>
200
213
  collectEvaluatorStatusesFromMetadata(metadata),
201
214
  ),
202
215
  });
@@ -207,7 +220,7 @@ function mergeHistorySnapshot(baseSnapshot, currentSnapshot) {
207
220
  const current = normalizeHistorySnapshot(currentSnapshot);
208
221
  return normalizeHistorySnapshot({
209
222
  launchEvents: [...base.launchEvents, ...current.launchEvents],
210
- evaluatorStatuses: [...base.evaluatorStatuses, ...current.evaluatorStatuses],
223
+ contQaStatuses: [...base.contQaStatuses, ...current.contQaStatuses],
211
224
  });
212
225
  }
213
226
 
@@ -224,7 +237,7 @@ function buildHistorySnapshot({
224
237
  const priorSnapshot = buildHistorySnapshotFromPriorMetadata(priorMetadata);
225
238
  const currentSnapshot = {
226
239
  launchEvents: collectLaunchEventsFromCurrent(agentRuns, attempt),
227
- evaluatorStatuses: collectEvaluatorStatusesFromCurrent(gateSnapshot, attempt),
240
+ contQaStatuses: collectEvaluatorStatusesFromCurrent(gateSnapshot, attempt),
228
241
  };
229
242
  return mergeHistorySnapshot(priorSnapshot, currentSnapshot);
230
243
  }
@@ -347,13 +360,16 @@ function computeAssignmentAndDependencyTimings(coordinationRecords, dependencySn
347
360
  }
348
361
 
349
362
  function computeProofCompletenessRatio(wave, summariesByAgentId) {
350
- const evaluatorAgentId = wave?.evaluatorAgentId || "A0";
363
+ const contQaAgentId = wave?.contQaAgentId || wave?.evaluatorAgentId || "A0";
364
+ const contEvalAgentId = wave?.contEvalAgentId || "E0";
351
365
  const integrationAgentId = wave?.integrationAgentId || "A8";
352
366
  const documentationAgentId = wave?.documentationAgentId || "A9";
353
367
  const implementationAgents = (wave?.agents || []).filter((agent) =>
354
- agent.agentId !== evaluatorAgentId &&
368
+ agent.agentId !== contQaAgentId &&
355
369
  agent.agentId !== integrationAgentId &&
356
- agent.agentId !== documentationAgentId,
370
+ agent.agentId !== documentationAgentId &&
371
+ !isContEvalReportOnlyAgent(agent, { contEvalAgentId }) &&
372
+ !isSecurityReviewAgent(agent),
357
373
  );
358
374
  const contractAgents = implementationAgents.filter((agent) => agent.exitContract);
359
375
  if (contractAgents.length === 0) {
@@ -374,12 +390,13 @@ function countRuntimeFallbacks(agentRuns) {
374
390
  }, 0);
375
391
  }
376
392
 
377
- function evaluatorReversalFromHistory(historySnapshot, gateSnapshot) {
378
- const currentStatus = gateSnapshot?.evaluatorGate?.statusCode || null;
393
+ function contQaReversalFromHistory(historySnapshot, gateSnapshot) {
394
+ const currentStatus =
395
+ gateSnapshot?.contQaGate?.statusCode || gateSnapshot?.evaluatorGate?.statusCode || null;
379
396
  if (!currentStatus) {
380
397
  return false;
381
398
  }
382
- const priorStatuses = normalizeHistorySnapshot(historySnapshot).evaluatorStatuses
399
+ const priorStatuses = normalizeHistorySnapshot(historySnapshot).contQaStatuses
383
400
  .map((entry) => entry.statusCode)
384
401
  .filter(Boolean)
385
402
  .filter((status) => status !== currentStatus);
@@ -479,7 +496,7 @@ export function buildQualityMetrics({
479
496
  helperTaskAssignmentCount: (capabilityAssignments || []).filter((assignment) => assignment.assignedAgentId).length,
480
497
  meanTimeToFirstAckMs: timings.meanTimeToFirstAckMs,
481
498
  meanTimeToBlockerResolutionMs: timings.meanTimeToBlockerResolutionMs,
482
- evaluatorReversal: evaluatorReversalFromHistory(effectiveHistory, gateSnapshot),
499
+ contQaReversal: contQaReversalFromHistory(effectiveHistory, gateSnapshot),
483
500
  finalRecommendation: integrationSummary?.recommendation || "unknown",
484
501
  };
485
502
  }
@@ -488,7 +505,8 @@ function buildReplayContext({ lanePaths, wave }) {
488
505
  return {
489
506
  lane: lanePaths?.lane || null,
490
507
  roles: {
491
- evaluatorAgentId: lanePaths?.evaluatorAgentId || wave.evaluatorAgentId || "A0",
508
+ contQaAgentId: lanePaths?.contQaAgentId || wave.contQaAgentId || wave.evaluatorAgentId || "A0",
509
+ contEvalAgentId: lanePaths?.contEvalAgentId || wave.contEvalAgentId || "E0",
492
510
  integrationAgentId: lanePaths?.integrationAgentId || wave.integrationAgentId || "A8",
493
511
  documentationAgentId: lanePaths?.documentationAgentId || wave.documentationAgentId || "A9",
494
512
  },
@@ -537,10 +555,13 @@ export function normalizeGateSnapshotForBundle(gateSnapshot, agentArtifacts) {
537
555
  "componentGate",
538
556
  "helperAssignmentBarrier",
539
557
  "dependencyBarrier",
558
+ "contEvalGate",
559
+ "securityGate",
540
560
  "integrationGate",
541
561
  "integrationBarrier",
542
562
  "documentationGate",
543
563
  "componentMatrixGate",
564
+ "contQaGate",
544
565
  "evaluatorGate",
545
566
  "infraGate",
546
567
  ]) {
@@ -605,9 +626,17 @@ function resolveRunSummaryPayload(wave, run) {
605
626
  return null;
606
627
  }
607
628
  const reportPath =
608
- run.agent?.agentId === (wave?.evaluatorAgentId || "A0") && wave?.evaluatorReportPath
609
- ? path.resolve(REPO_ROOT, wave.evaluatorReportPath)
610
- : null;
629
+ run.agent?.agentId === (wave?.contQaAgentId || wave?.evaluatorAgentId || "A0") &&
630
+ (wave?.contQaReportPath || wave?.evaluatorReportPath)
631
+ ? path.resolve(REPO_ROOT, wave.contQaReportPath || wave.evaluatorReportPath)
632
+ : run.agent?.agentId === (wave?.contEvalAgentId || "E0") && wave?.contEvalReportPath
633
+ ? path.resolve(REPO_ROOT, wave.contEvalReportPath)
634
+ : isSecurityReviewAgent(run.agent)
635
+ ? (() => {
636
+ const securityReportPath = resolveSecurityReviewReportPath(run.agent);
637
+ return securityReportPath ? path.resolve(REPO_ROOT, securityReportPath) : null;
638
+ })()
639
+ : null;
611
640
  return buildAgentExecutionSummary({
612
641
  agent: run.agent,
613
642
  statusRecord,
@@ -673,27 +702,7 @@ function buildAgentMetadata(dir, run, attempt, artifacts) {
673
702
  },
674
703
  skills:
675
704
  run.lastSkillProjection ||
676
- (run.agent?.skillsResolved
677
- ? {
678
- ids: run.agent.skillsResolved.ids || [],
679
- role: run.agent.skillsResolved.role || null,
680
- runtime: run.agent.skillsResolved.runtime || null,
681
- deployKind: run.agent.skillsResolved.deployKind || null,
682
- promptHash: run.agent.skillsResolved.promptHash || null,
683
- bundles: Array.isArray(run.agent.skillsResolved.bundles)
684
- ? run.agent.skillsResolved.bundles.map((bundle) => ({
685
- id: bundle.id,
686
- bundlePath: bundle.bundlePath,
687
- manifestPath: bundle.manifestPath,
688
- skillPath: bundle.skillPath,
689
- adapterPath: bundle.adapterPath || null,
690
- bundleHash: bundle.bundleHash || null,
691
- sourceFiles: Array.isArray(bundle.sourceFiles) ? bundle.sourceFiles.slice() : [],
692
- }))
693
- : [],
694
- artifacts: run.agent.skillsResolved.artifacts || null,
695
- }
696
- : null),
705
+ (run.agent?.skillsResolved ? summarizeResolvedSkills(run.agent.skillsResolved) : null),
697
706
  };
698
707
  }
699
708
 
@@ -710,6 +719,7 @@ export function writeTraceBundle({
710
719
  docsQueue,
711
720
  capabilityAssignments = [],
712
721
  dependencySnapshot = null,
722
+ securitySummary = null,
713
723
  integrationSummary,
714
724
  integrationMarkdownPath,
715
725
  clarificationTriage,
@@ -763,6 +773,13 @@ export function writeTraceBundle({
763
773
  "json",
764
774
  true,
765
775
  );
776
+ const securityArtifact = writeArtifactDescriptor(
777
+ dir,
778
+ path.join(dir, "security.json"),
779
+ securitySummary || {},
780
+ "json",
781
+ true,
782
+ );
766
783
  const integrationArtifact = writeArtifactDescriptor(
767
784
  dir,
768
785
  path.join(dir, "integration.json"),
@@ -883,9 +900,13 @@ export function writeTraceBundle({
883
900
  const metadata = {
884
901
  traceVersion: TRACE_VERSION,
885
902
  replayMode: "hermetic",
903
+ runKind: lanePaths?.runKind || "roadmap",
904
+ runId: lanePaths?.runId || null,
886
905
  wave: wave.wave,
887
906
  lane: lanePaths?.lane || null,
888
907
  waveFile: wave.file,
908
+ requestPath: lanePaths?.adhocRequestPath ? relativePathOrNull(lanePaths.adhocRequestPath, REPO_ROOT) : null,
909
+ specPath: lanePaths?.adhocSpecPath ? relativePathOrNull(lanePaths.adhocSpecPath, REPO_ROOT) : null,
889
910
  waveFileHash: fileHashOrNull(path.resolve(REPO_ROOT, wave.file || "")),
890
911
  attempt,
891
912
  cumulativeAttemptCount: attempt,
@@ -909,6 +930,7 @@ export function writeTraceBundle({
909
930
  docsQueue: docsQueueArtifact,
910
931
  capabilityAssignments: capabilityAssignmentsArtifact,
911
932
  dependencySnapshot: dependencySnapshotArtifact,
933
+ security: securityArtifact,
912
934
  integration: integrationArtifact,
913
935
  integrationMarkdown: integrationMarkdownArtifact,
914
936
  componentMatrix: componentMatrixArtifact,
@@ -949,6 +971,7 @@ export function loadTraceBundle(dir) {
949
971
  docsQueue: readJsonOrNull(path.join(dir, "docs-queue.json")),
950
972
  capabilityAssignments: readJsonOrNull(path.join(dir, "capability-assignments.json")),
951
973
  dependencySnapshot: readJsonOrNull(path.join(dir, "dependency-snapshot.json")),
974
+ securitySummary: readJsonOrNull(path.join(dir, "security.json")),
952
975
  integrationSummary: readJsonOrNull(path.join(dir, "integration.json")),
953
976
  quality: readJsonOrNull(path.join(dir, "quality.json")),
954
977
  storedOutcome: readJsonOrNull(path.join(dir, "outcome.json")),