@chllming/wave-orchestration 0.6.3 → 0.7.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 (118) hide show
  1. package/CHANGELOG.md +82 -1
  2. package/README.md +40 -7
  3. package/docs/agents/wave-orchestrator-role.md +50 -0
  4. package/docs/agents/wave-planner-role.md +39 -0
  5. package/docs/context7/bundles.json +9 -0
  6. package/docs/context7/planner-agent/README.md +25 -0
  7. package/docs/context7/planner-agent/manifest.json +83 -0
  8. package/docs/context7/planner-agent/papers/cooperbench-why-coding-agents-cannot-be-your-teammates-yet.md +3283 -0
  9. package/docs/context7/planner-agent/papers/dova-deliberation-first-multi-agent-orchestration-for-autonomous-research-automation.md +1699 -0
  10. package/docs/context7/planner-agent/papers/dpbench-large-language-models-struggle-with-simultaneous-coordination.md +2251 -0
  11. package/docs/context7/planner-agent/papers/incremental-planning-to-control-a-blackboard-based-problem-solver.md +1729 -0
  12. package/docs/context7/planner-agent/papers/silo-bench-a-scalable-environment-for-evaluating-distributed-coordination-in-multi-agent-llm-systems.md +3747 -0
  13. package/docs/context7/planner-agent/papers/todoevolve-learning-to-architect-agent-planning-systems.md +1675 -0
  14. package/docs/context7/planner-agent/papers/verified-multi-agent-orchestration-a-plan-execute-verify-replan-framework-for-complex-query-resolution.md +1173 -0
  15. package/docs/context7/planner-agent/papers/why-do-multi-agent-llm-systems-fail.md +5211 -0
  16. package/docs/context7/planner-agent/topics/planning-and-orchestration.md +24 -0
  17. package/docs/evals/README.md +96 -1
  18. package/docs/evals/arm-templates/README.md +13 -0
  19. package/docs/evals/arm-templates/full-wave.json +15 -0
  20. package/docs/evals/arm-templates/single-agent.json +15 -0
  21. package/docs/evals/benchmark-catalog.json +7 -0
  22. package/docs/evals/cases/README.md +47 -0
  23. package/docs/evals/cases/wave-blackboard-inbox-targeting.json +73 -0
  24. package/docs/evals/cases/wave-contradiction-conflict.json +104 -0
  25. package/docs/evals/cases/wave-expert-routing-preservation.json +69 -0
  26. package/docs/evals/cases/wave-hidden-profile-private-evidence.json +81 -0
  27. package/docs/evals/cases/wave-premature-closure-guard.json +71 -0
  28. package/docs/evals/cases/wave-silo-cross-agent-state.json +77 -0
  29. package/docs/evals/cases/wave-simultaneous-lockstep.json +92 -0
  30. package/docs/evals/cooperbench/real-world-mitigation.md +341 -0
  31. package/docs/evals/external-benchmarks.json +85 -0
  32. package/docs/evals/external-command-config.sample.json +9 -0
  33. package/docs/evals/external-command-config.swe-bench-pro.json +8 -0
  34. package/docs/evals/pilots/README.md +47 -0
  35. package/docs/evals/pilots/swe-bench-pro-public-full-wave-review-10.json +64 -0
  36. package/docs/evals/pilots/swe-bench-pro-public-pilot.json +111 -0
  37. package/docs/evals/wave-benchmark-program.md +302 -0
  38. package/docs/guides/planner.md +67 -11
  39. package/docs/guides/terminal-surfaces.md +12 -0
  40. package/docs/plans/context7-wave-orchestrator.md +20 -0
  41. package/docs/plans/current-state.md +8 -1
  42. package/docs/plans/examples/wave-benchmark-improvement.md +108 -0
  43. package/docs/plans/examples/wave-example-live-proof.md +1 -1
  44. package/docs/plans/examples/wave-example-rollout-fidelity.md +340 -0
  45. package/docs/plans/migration.md +26 -0
  46. package/docs/plans/wave-orchestrator.md +60 -12
  47. package/docs/plans/waves/reviews/wave-1-benchmark-operator.md +118 -0
  48. package/docs/reference/cli-reference.md +547 -0
  49. package/docs/reference/coordination-and-closure.md +436 -0
  50. package/docs/reference/live-proof-waves.md +25 -3
  51. package/docs/reference/npmjs-trusted-publishing.md +3 -3
  52. package/docs/reference/proof-metrics.md +90 -0
  53. package/docs/reference/runtime-config/README.md +63 -2
  54. package/docs/reference/runtime-config/codex.md +2 -1
  55. package/docs/reference/sample-waves.md +29 -18
  56. package/docs/reference/wave-control.md +164 -0
  57. package/docs/reference/wave-planning-lessons.md +131 -0
  58. package/package.json +5 -4
  59. package/releases/manifest.json +40 -0
  60. package/scripts/research/agent-context-archive.mjs +18 -0
  61. package/scripts/research/manifests/agent-context-expanded-2026-03-22.mjs +17 -0
  62. package/scripts/research/sync-planner-context7-bundle.mjs +133 -0
  63. package/scripts/wave-orchestrator/agent-state.mjs +11 -2
  64. package/scripts/wave-orchestrator/artifact-schemas.mjs +232 -0
  65. package/scripts/wave-orchestrator/autonomous.mjs +7 -0
  66. package/scripts/wave-orchestrator/benchmark-cases.mjs +374 -0
  67. package/scripts/wave-orchestrator/benchmark-external.mjs +1384 -0
  68. package/scripts/wave-orchestrator/benchmark.mjs +972 -0
  69. package/scripts/wave-orchestrator/clarification-triage.mjs +78 -12
  70. package/scripts/wave-orchestrator/config.mjs +175 -0
  71. package/scripts/wave-orchestrator/control-cli.mjs +1216 -0
  72. package/scripts/wave-orchestrator/control-plane.mjs +697 -0
  73. package/scripts/wave-orchestrator/coord-cli.mjs +360 -2
  74. package/scripts/wave-orchestrator/coordination-store.mjs +211 -9
  75. package/scripts/wave-orchestrator/coordination.mjs +84 -0
  76. package/scripts/wave-orchestrator/dashboard-renderer.mjs +120 -5
  77. package/scripts/wave-orchestrator/dashboard-state.mjs +22 -0
  78. package/scripts/wave-orchestrator/evals.mjs +23 -0
  79. package/scripts/wave-orchestrator/executors.mjs +3 -2
  80. package/scripts/wave-orchestrator/feedback.mjs +55 -0
  81. package/scripts/wave-orchestrator/install.mjs +151 -2
  82. package/scripts/wave-orchestrator/launcher-closure.mjs +4 -1
  83. package/scripts/wave-orchestrator/launcher-runtime.mjs +33 -30
  84. package/scripts/wave-orchestrator/launcher.mjs +884 -36
  85. package/scripts/wave-orchestrator/planner-context.mjs +75 -0
  86. package/scripts/wave-orchestrator/planner.mjs +2270 -136
  87. package/scripts/wave-orchestrator/proof-cli.mjs +195 -0
  88. package/scripts/wave-orchestrator/proof-registry.mjs +317 -0
  89. package/scripts/wave-orchestrator/replay.mjs +10 -4
  90. package/scripts/wave-orchestrator/retry-cli.mjs +184 -0
  91. package/scripts/wave-orchestrator/retry-control.mjs +225 -0
  92. package/scripts/wave-orchestrator/shared.mjs +26 -0
  93. package/scripts/wave-orchestrator/swe-bench-pro-task.mjs +1004 -0
  94. package/scripts/wave-orchestrator/terminals.mjs +1 -1
  95. package/scripts/wave-orchestrator/traces.mjs +157 -2
  96. package/scripts/wave-orchestrator/wave-control-client.mjs +532 -0
  97. package/scripts/wave-orchestrator/wave-control-schema.mjs +309 -0
  98. package/scripts/wave-orchestrator/wave-files.mjs +144 -23
  99. package/scripts/wave.mjs +27 -0
  100. package/skills/repo-coding-rules/SKILL.md +1 -0
  101. package/skills/role-cont-eval/SKILL.md +1 -0
  102. package/skills/role-cont-qa/SKILL.md +13 -6
  103. package/skills/role-deploy/SKILL.md +1 -0
  104. package/skills/role-documentation/SKILL.md +4 -0
  105. package/skills/role-implementation/SKILL.md +4 -0
  106. package/skills/role-infra/SKILL.md +2 -1
  107. package/skills/role-integration/SKILL.md +15 -8
  108. package/skills/role-planner/SKILL.md +39 -0
  109. package/skills/role-planner/skill.json +21 -0
  110. package/skills/role-research/SKILL.md +1 -0
  111. package/skills/role-security/SKILL.md +2 -2
  112. package/skills/runtime-claude/SKILL.md +2 -1
  113. package/skills/runtime-codex/SKILL.md +1 -0
  114. package/skills/runtime-local/SKILL.md +2 -0
  115. package/skills/runtime-opencode/SKILL.md +1 -0
  116. package/skills/wave-core/SKILL.md +25 -6
  117. package/skills/wave-core/references/marker-syntax.md +16 -8
  118. package/wave.config.json +45 -0
@@ -129,7 +129,7 @@ export function createTemporaryTerminalEntries(
129
129
  }
130
130
 
131
131
  export function createGlobalDashboardTerminalEntry(lanePaths, runTag) {
132
- const sessionName = `${lanePaths.tmuxGlobalDashboardSessionPrefix}_${runTag}`.replace(
132
+ const sessionName = `${lanePaths.tmuxGlobalDashboardSessionPrefix}_current`.replace(
133
133
  /[^a-zA-Z0-9:_-]/g,
134
134
  "_",
135
135
  );
@@ -1,7 +1,13 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import { buildAgentExecutionSummary, validateImplementationSummary } from "./agent-state.mjs";
4
- import { openClarificationLinkedRequests, readCoordinationLog, serializeCoordinationState } from "./coordination-store.mjs";
4
+ import {
5
+ buildCoordinationResponseMetrics,
6
+ openClarificationLinkedRequests,
7
+ readCoordinationLog,
8
+ serializeCoordinationState,
9
+ } from "./coordination-store.mjs";
10
+ import { readControlPlaneEvents } from "./control-plane.mjs";
5
11
  import {
6
12
  isContEvalReportOnlyAgent,
7
13
  isSecurityReviewAgent,
@@ -18,6 +24,10 @@ import {
18
24
  writeTextAtomic,
19
25
  } from "./shared.mjs";
20
26
  import { summarizeResolvedSkills } from "./skills.mjs";
27
+ import {
28
+ buildWaveControlArtifactFromPath,
29
+ safeQueueWaveControlEvent,
30
+ } from "./wave-control-client.mjs";
21
31
 
22
32
  export const TRACE_VERSION = 2;
23
33
  const LEGACY_TRACE_VERSION = 1;
@@ -287,6 +297,7 @@ function computeAckAndBlockerTimings(coordinationRecords) {
287
297
  const resolvedStatuses = new Set(["resolved", "closed", "superseded", "cancelled"]);
288
298
  const ackDurations = [];
289
299
  const blockerDurations = [];
300
+ const resolutionDurations = [];
290
301
  for (const history of grouped.values()) {
291
302
  const first = history[0];
292
303
  const startMs = Date.parse(first.createdAt || first.updatedAt || "");
@@ -300,6 +311,13 @@ function computeAckAndBlockerTimings(coordinationRecords) {
300
311
  ackDurations.push(ackMs - startMs);
301
312
  }
302
313
  }
314
+ if (["request", "clarification-request", "human-feedback", "human-escalation"].includes(first.kind)) {
315
+ const resolved = history.find((record) => resolvedStatuses.has(record.status));
316
+ const resolvedMs = Date.parse(resolved?.updatedAt || "");
317
+ if (Number.isFinite(resolvedMs) && resolvedMs >= startMs) {
318
+ resolutionDurations.push(resolvedMs - startMs);
319
+ }
320
+ }
303
321
  if (first.kind === "blocker") {
304
322
  const resolved = history.find((record) => resolvedStatuses.has(record.status));
305
323
  const resolvedMs = Date.parse(resolved?.updatedAt || "");
@@ -310,10 +328,39 @@ function computeAckAndBlockerTimings(coordinationRecords) {
310
328
  }
311
329
  return {
312
330
  meanTimeToFirstAckMs: averageOrNull(ackDurations),
331
+ meanTimeToResolutionMs: averageOrNull(resolutionDurations),
313
332
  meanTimeToBlockerResolutionMs: averageOrNull(blockerDurations),
314
333
  };
315
334
  }
316
335
 
336
+ function latestRecordTimestampMs(record) {
337
+ const updatedAtMs = Date.parse(record?.updatedAt || "");
338
+ if (Number.isFinite(updatedAtMs)) {
339
+ return updatedAtMs;
340
+ }
341
+ const createdAtMs = Date.parse(record?.createdAt || "");
342
+ return Number.isFinite(createdAtMs) ? createdAtMs : null;
343
+ }
344
+
345
+ function resolveCoordinationSnapshotNowMs(coordinationRecords, coordinationState) {
346
+ const records = Array.isArray(coordinationRecords) && coordinationRecords.length > 0
347
+ ? coordinationRecords
348
+ : Array.isArray(coordinationState?.records) && coordinationState.records.length > 0
349
+ ? coordinationState.records
350
+ : Array.isArray(coordinationState?.latestRecords)
351
+ ? coordinationState.latestRecords
352
+ : [];
353
+ let latestMs = null;
354
+ for (const record of records) {
355
+ const recordMs = latestRecordTimestampMs(record);
356
+ if (!Number.isFinite(recordMs)) {
357
+ continue;
358
+ }
359
+ latestMs = latestMs === null ? recordMs : Math.max(latestMs, recordMs);
360
+ }
361
+ return latestMs;
362
+ }
363
+
317
364
  function computeAssignmentAndDependencyTimings(coordinationRecords, dependencySnapshot = null) {
318
365
  const grouped = groupCoordinationHistory(coordinationRecords);
319
366
  const requestStartById = new Map();
@@ -455,6 +502,15 @@ export function buildQualityMetrics({
455
502
  coordinationRecords,
456
503
  dependencySnapshot,
457
504
  );
505
+ const coordinationSnapshotNowMs = resolveCoordinationSnapshotNowMs(
506
+ coordinationRecords,
507
+ coordinationState,
508
+ );
509
+ const responseMetrics = buildCoordinationResponseMetrics(coordinationState, {
510
+ ...(Number.isFinite(coordinationSnapshotNowMs)
511
+ ? { nowMs: coordinationSnapshotNowMs }
512
+ : {}),
513
+ });
458
514
  const documentationItems = Array.isArray(docsQueue?.items) ? docsQueue.items : [];
459
515
  const unresolvedClarificationCount = (coordinationState?.clarifications || []).filter((record) =>
460
516
  ["open", "acknowledged", "in_progress"].includes(record.status),
@@ -494,7 +550,13 @@ export function buildQualityMetrics({
494
550
  meanTimeToCapabilityAssignmentMs: assignmentTimings.meanTimeToCapabilityAssignmentMs,
495
551
  meanTimeToDependencyResolutionMs: assignmentTimings.meanTimeToDependencyResolutionMs,
496
552
  helperTaskAssignmentCount: (capabilityAssignments || []).filter((assignment) => assignment.assignedAgentId).length,
553
+ oldestOpenCoordinationAgeMs: responseMetrics.oldestOpenCoordinationAgeMs,
554
+ oldestUnackedRequestAgeMs: responseMetrics.oldestUnackedRequestAgeMs,
555
+ overdueAckCount: responseMetrics.overdueAckCount,
556
+ overdueClarificationCount: responseMetrics.overdueClarificationCount,
557
+ openHumanEscalationCount: responseMetrics.openHumanEscalationCount,
497
558
  meanTimeToFirstAckMs: timings.meanTimeToFirstAckMs,
559
+ meanTimeToResolutionMs: timings.meanTimeToResolutionMs,
498
560
  meanTimeToBlockerResolutionMs: timings.meanTimeToBlockerResolutionMs,
499
561
  contQaReversal: contQaReversalFromHistory(effectiveHistory, gateSnapshot),
500
562
  finalRecommendation: integrationSummary?.recommendation || "unknown",
@@ -722,6 +784,8 @@ export function writeTraceBundle({
722
784
  securitySummary = null,
723
785
  integrationSummary,
724
786
  integrationMarkdownPath,
787
+ proofRegistryPath = null,
788
+ controlPlanePath = null,
725
789
  clarificationTriage,
726
790
  agentRuns,
727
791
  quality,
@@ -793,6 +857,18 @@ export function writeTraceBundle({
793
857
  path.join(dir, "integration.md"),
794
858
  false,
795
859
  );
860
+ const proofRegistryArtifact = copyArtifactDescriptor(
861
+ dir,
862
+ proofRegistryPath,
863
+ path.join(dir, "proof-registry.json"),
864
+ false,
865
+ );
866
+ const controlPlaneArtifact = copyArtifactDescriptor(
867
+ dir,
868
+ controlPlanePath,
869
+ path.join(dir, "control-plane.raw.jsonl"),
870
+ false,
871
+ );
796
872
  const qualityArtifact = writeArtifactDescriptor(
797
873
  dir,
798
874
  path.join(dir, "quality.json"),
@@ -933,6 +1009,8 @@ export function writeTraceBundle({
933
1009
  security: securityArtifact,
934
1010
  integration: integrationArtifact,
935
1011
  integrationMarkdown: integrationMarkdownArtifact,
1012
+ proofRegistry: proofRegistryArtifact,
1013
+ controlPlane: controlPlaneArtifact,
936
1014
  componentMatrix: componentMatrixArtifact,
937
1015
  componentMatrixMarkdown: componentMatrixMarkdownArtifact,
938
1016
  outcome: outcomeArtifact,
@@ -952,7 +1030,82 @@ export function writeTraceBundle({
952
1030
  present: true,
953
1031
  sha256: null,
954
1032
  };
955
- writeJsonAtomic(path.join(dir, "run-metadata.json"), metadata);
1033
+ const runMetadataPath = path.join(dir, "run-metadata.json");
1034
+ writeJsonAtomic(runMetadataPath, metadata);
1035
+ if (lanePaths?.waveControl?.captureTraceBundles !== false) {
1036
+ safeQueueWaveControlEvent(lanePaths, {
1037
+ category: "trace",
1038
+ entityType: "artifact",
1039
+ entityId: `wave-${wave.wave}-attempt-${attempt}-trace-bundle`,
1040
+ action: "bundle-written",
1041
+ source: "launcher",
1042
+ actor: "launcher",
1043
+ recordedAt: metadata.capturedAt,
1044
+ identity: {
1045
+ lane: lanePaths?.lane || null,
1046
+ wave: wave.wave,
1047
+ attempt,
1048
+ runKind: lanePaths?.runKind || "roadmap",
1049
+ runId: lanePaths?.runId || null,
1050
+ },
1051
+ tags: ["trace", "attempt-bundle"],
1052
+ data: {
1053
+ traceDir: relativePathOrNull(dir, REPO_ROOT),
1054
+ finalRecommendation: quality?.finalRecommendation || null,
1055
+ gate: normalizedGateSnapshot?.overall?.gate || null,
1056
+ },
1057
+ artifacts: [
1058
+ {
1059
+ ...buildWaveControlArtifactFromPath(runMetadataPath, {
1060
+ kind: "trace-run-metadata",
1061
+ required: true,
1062
+ uploadPolicy: "selected",
1063
+ }),
1064
+ sourcePath: runMetadataPath,
1065
+ },
1066
+ {
1067
+ ...buildWaveControlArtifactFromPath(path.join(dir, "quality.json"), {
1068
+ kind: "trace-quality",
1069
+ required: true,
1070
+ uploadPolicy: "selected",
1071
+ }),
1072
+ sourcePath: path.join(dir, "quality.json"),
1073
+ },
1074
+ {
1075
+ ...buildWaveControlArtifactFromPath(path.join(dir, "outcome.json"), {
1076
+ kind: "trace-outcome",
1077
+ required: true,
1078
+ uploadPolicy: "selected",
1079
+ }),
1080
+ sourcePath: path.join(dir, "outcome.json"),
1081
+ },
1082
+ {
1083
+ ...buildWaveControlArtifactFromPath(path.join(dir, "integration.json"), {
1084
+ kind: "integration-summary",
1085
+ required: true,
1086
+ uploadPolicy: "selected",
1087
+ }),
1088
+ sourcePath: path.join(dir, "integration.json"),
1089
+ },
1090
+ {
1091
+ ...buildWaveControlArtifactFromPath(path.join(dir, "proof-registry.json"), {
1092
+ kind: "proof-registry",
1093
+ required: false,
1094
+ uploadPolicy: "selected",
1095
+ }),
1096
+ sourcePath: path.join(dir, "proof-registry.json"),
1097
+ },
1098
+ {
1099
+ ...buildWaveControlArtifactFromPath(path.join(dir, "control-plane.raw.jsonl"), {
1100
+ kind: "control-plane-log",
1101
+ required: false,
1102
+ uploadPolicy: "metadata-only",
1103
+ }),
1104
+ sourcePath: path.join(dir, "control-plane.raw.jsonl"),
1105
+ },
1106
+ ],
1107
+ });
1108
+ }
956
1109
  return dir;
957
1110
  }
958
1111
 
@@ -967,12 +1120,14 @@ export function loadTraceBundle(dir) {
967
1120
  manifest,
968
1121
  coordinationState,
969
1122
  coordinationRecords,
1123
+ controlPlaneEvents: readControlPlaneEvents(path.join(dir, "control-plane.raw.jsonl")),
970
1124
  ledger: readJsonOrNull(path.join(dir, "ledger.json")),
971
1125
  docsQueue: readJsonOrNull(path.join(dir, "docs-queue.json")),
972
1126
  capabilityAssignments: readJsonOrNull(path.join(dir, "capability-assignments.json")),
973
1127
  dependencySnapshot: readJsonOrNull(path.join(dir, "dependency-snapshot.json")),
974
1128
  securitySummary: readJsonOrNull(path.join(dir, "security.json")),
975
1129
  integrationSummary: readJsonOrNull(path.join(dir, "integration.json")),
1130
+ proofRegistry: readJsonOrNull(path.join(dir, "proof-registry.json")),
976
1131
  quality: readJsonOrNull(path.join(dir, "quality.json")),
977
1132
  storedOutcome: readJsonOrNull(path.join(dir, "outcome.json")),
978
1133
  structuredSignals: readJsonOrNull(path.join(dir, "structured-signals.json")),