@chllming/wave-orchestration 0.8.6 → 0.8.8

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 (44) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +5 -5
  3. package/docs/README.md +3 -1
  4. package/docs/guides/author-and-run-waves.md +1 -1
  5. package/docs/guides/planner.md +1 -1
  6. package/docs/guides/recommendations-0.8.8.md +133 -0
  7. package/docs/guides/terminal-surfaces.md +2 -0
  8. package/docs/plans/current-state.md +2 -1
  9. package/docs/plans/end-state-architecture.md +1 -1
  10. package/docs/plans/examples/wave-example-design-handoff.md +1 -1
  11. package/docs/plans/examples/wave-example-live-proof.md +1 -1
  12. package/docs/plans/migration.md +25 -8
  13. package/docs/plans/wave-orchestrator.md +8 -5
  14. package/docs/reference/cli-reference.md +11 -3
  15. package/docs/reference/coordination-and-closure.md +28 -5
  16. package/docs/reference/live-proof-waves.md +9 -0
  17. package/docs/reference/npmjs-trusted-publishing.md +2 -2
  18. package/docs/reference/runtime-config/README.md +10 -3
  19. package/docs/reference/sample-waves.md +5 -5
  20. package/docs/reference/skills.md +1 -1
  21. package/docs/reference/wave-control.md +16 -0
  22. package/docs/reference/wave-planning-lessons.md +7 -1
  23. package/docs/research/coordination-failure-review.md +6 -6
  24. package/package.json +1 -1
  25. package/releases/manifest.json +36 -0
  26. package/scripts/wave-orchestrator/agent-state.mjs +42 -0
  27. package/scripts/wave-orchestrator/autonomous.mjs +42 -6
  28. package/scripts/wave-orchestrator/clarification-triage.mjs +4 -3
  29. package/scripts/wave-orchestrator/control-cli.mjs +126 -11
  30. package/scripts/wave-orchestrator/control-plane.mjs +12 -1
  31. package/scripts/wave-orchestrator/coordination-store.mjs +124 -4
  32. package/scripts/wave-orchestrator/executors.mjs +11 -6
  33. package/scripts/wave-orchestrator/gate-engine.mjs +5 -5
  34. package/scripts/wave-orchestrator/launcher-runtime.mjs +1 -1
  35. package/scripts/wave-orchestrator/launcher.mjs +216 -0
  36. package/scripts/wave-orchestrator/ledger.mjs +14 -12
  37. package/scripts/wave-orchestrator/reducer-snapshot.mjs +8 -6
  38. package/scripts/wave-orchestrator/retry-engine.mjs +19 -11
  39. package/scripts/wave-orchestrator/routing-state.mjs +50 -3
  40. package/scripts/wave-orchestrator/session-supervisor.mjs +6 -10
  41. package/scripts/wave-orchestrator/task-entity.mjs +4 -4
  42. package/scripts/wave-orchestrator/terminals.mjs +14 -14
  43. package/scripts/wave-orchestrator/wave-files.mjs +15 -21
  44. package/scripts/wave-orchestrator/wave-state-reducer.mjs +72 -5
@@ -1,6 +1,9 @@
1
1
  import { materializeControlPlaneState } from "./control-plane.mjs";
2
2
  import {
3
3
  buildCoordinationResponseMetrics,
4
+ coordinationBlockerSeverity,
5
+ coordinationRecordBlocksWave,
6
+ coordinationRecordIsHardBlocker,
4
7
  isOpenCoordinationStatus,
5
8
  materializeCoordinationState,
6
9
  openClarificationLinkedRequests,
@@ -135,18 +138,18 @@ function derivePhase({
135
138
  clarificationBarrier,
136
139
  }) {
137
140
  const blockers = (coordinationState?.blockers || []).filter(
138
- (record) =>
139
- isOpenCoordinationStatus(record.status) &&
140
- ["high", "urgent"].includes(record.priority),
141
+ (record) => coordinationRecordIsHardBlocker(record),
141
142
  );
142
143
  if (blockers.length > 0) {
143
144
  return "blocked";
144
145
  }
145
146
 
146
147
  const openClarifications = (coordinationState?.clarifications || []).filter(
147
- (record) => isOpenCoordinationStatus(record.status),
148
+ (record) => coordinationRecordBlocksWave(record),
149
+ );
150
+ const openClarificationRequests = openClarificationLinkedRequests(coordinationState).filter(
151
+ (record) => coordinationRecordBlocksWave(record),
148
152
  );
149
- const openClarificationRequests = openClarificationLinkedRequests(coordinationState);
150
153
  if (openClarifications.length > 0 || openClarificationRequests.length > 0) {
151
154
  return "clarifying";
152
155
  }
@@ -228,6 +231,51 @@ function derivePhase({
228
231
  return "running";
229
232
  }
230
233
 
234
+ function gateBlockerMetadata(gateName, gate) {
235
+ if (!gate || gate.ok !== false) {
236
+ return {
237
+ blocking: false,
238
+ blockerSeverity: "advisory",
239
+ };
240
+ }
241
+ if (gateName === "componentGate" && gate.statusCode === "shared-component-sibling-pending") {
242
+ return {
243
+ blocking: true,
244
+ blockerSeverity: "soft",
245
+ };
246
+ }
247
+ if (
248
+ ["implementationGate", "contEvalGate"].includes(gateName)
249
+ ) {
250
+ return {
251
+ blocking: true,
252
+ blockerSeverity: "proof-critical",
253
+ };
254
+ }
255
+ if (
256
+ [
257
+ "designGate",
258
+ "integrationBarrier",
259
+ "documentationGate",
260
+ "contQaGate",
261
+ "clarificationBarrier",
262
+ "helperAssignmentBarrier",
263
+ "dependencyBarrier",
264
+ "componentMatrixGate",
265
+ "componentGate",
266
+ ].includes(gateName)
267
+ ) {
268
+ return {
269
+ blocking: true,
270
+ blockerSeverity: "closure-critical",
271
+ };
272
+ }
273
+ return {
274
+ blocking: true,
275
+ blockerSeverity: "hard",
276
+ };
277
+ }
278
+
231
279
  /**
232
280
  * Map waveState from phase for end-state output.
233
281
  */
@@ -338,6 +386,8 @@ function deriveOpenBlockers(coordinationState, gateSnapshot) {
338
386
  if (!isOpenCoordinationStatus(record.status)) {
339
387
  continue;
340
388
  }
389
+ const blocking = coordinationRecordBlocksWave(record);
390
+ const blockerSeverity = coordinationBlockerSeverity(record);
341
391
  blockers.push({
342
392
  kind: "coordination-blocker",
343
393
  id: record.id,
@@ -348,6 +398,8 @@ function deriveOpenBlockers(coordinationState, gateSnapshot) {
348
398
  ? record.targets
349
399
  : (record.agentId ? [record.agentId] : []),
350
400
  resolutionHint: record.resolutionHint || null,
401
+ blocking,
402
+ blockerSeverity,
351
403
  });
352
404
  }
353
405
 
@@ -355,6 +407,8 @@ function deriveOpenBlockers(coordinationState, gateSnapshot) {
355
407
  if (!isOpenCoordinationStatus(record.status)) {
356
408
  continue;
357
409
  }
410
+ const blocking = coordinationRecordBlocksWave(record);
411
+ const blockerSeverity = coordinationBlockerSeverity(record);
358
412
  blockers.push({
359
413
  kind: "clarification",
360
414
  id: record.id,
@@ -365,6 +419,8 @@ function deriveOpenBlockers(coordinationState, gateSnapshot) {
365
419
  ? record.targets
366
420
  : (record.agentId ? [record.agentId] : []),
367
421
  resolutionHint: "Resolve clarification before proceeding.",
422
+ blocking,
423
+ blockerSeverity,
368
424
  });
369
425
  }
370
426
 
@@ -372,6 +428,8 @@ function deriveOpenBlockers(coordinationState, gateSnapshot) {
372
428
  if (!isOpenCoordinationStatus(record.status)) {
373
429
  continue;
374
430
  }
431
+ const blocking = coordinationRecordBlocksWave(record);
432
+ const blockerSeverity = coordinationBlockerSeverity(record);
375
433
  blockers.push({
376
434
  kind: "human-escalation",
377
435
  id: record.id,
@@ -382,6 +440,8 @@ function deriveOpenBlockers(coordinationState, gateSnapshot) {
382
440
  ? record.targets
383
441
  : (record.agentId ? [record.agentId] : []),
384
442
  resolutionHint: "Human intervention required.",
443
+ blocking,
444
+ blockerSeverity,
385
445
  });
386
446
  }
387
447
 
@@ -389,6 +449,8 @@ function deriveOpenBlockers(coordinationState, gateSnapshot) {
389
449
  if (!isOpenCoordinationStatus(record.status)) {
390
450
  continue;
391
451
  }
452
+ const blocking = coordinationRecordBlocksWave(record);
453
+ const blockerSeverity = coordinationBlockerSeverity(record);
392
454
  blockers.push({
393
455
  kind: "human-feedback",
394
456
  id: record.id,
@@ -399,6 +461,8 @@ function deriveOpenBlockers(coordinationState, gateSnapshot) {
399
461
  ? record.targets
400
462
  : (record.agentId ? [record.agentId] : []),
401
463
  resolutionHint: "Awaiting human feedback.",
464
+ blocking,
465
+ blockerSeverity,
402
466
  });
403
467
  }
404
468
 
@@ -407,12 +471,15 @@ function deriveOpenBlockers(coordinationState, gateSnapshot) {
407
471
  if (gateName === "overall" || !gate || gate.ok !== false) {
408
472
  continue;
409
473
  }
474
+ const metadata = gateBlockerMetadata(gateName, gate);
410
475
  blockers.push({
411
476
  kind: "gate-failure",
412
477
  id: gateName,
413
478
  detail: gate.detail || gate.statusCode || "",
414
479
  blockedAgentIds: gate.agentId ? [gate.agentId] : [],
415
480
  resolutionHint: `Gate ${gateName} must pass before wave closure.`,
481
+ blocking: metadata.blocking,
482
+ blockerSeverity: metadata.blockerSeverity,
416
483
  });
417
484
  }
418
485
  }