cool-workflow 0.1.79 → 0.1.81

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 (131) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/README.md +51 -3
  4. package/apps/architecture-review/app.json +1 -1
  5. package/apps/architecture-review-fast/app.json +64 -0
  6. package/apps/architecture-review-fast/workflow.js +153 -0
  7. package/apps/end-to-end-golden-path/app.json +1 -1
  8. package/apps/pr-review-fix-ci/app.json +1 -1
  9. package/apps/release-cut/app.json +1 -1
  10. package/apps/research-synthesis/app.json +1 -1
  11. package/dist/agent-config.js +21 -7
  12. package/dist/candidate-scoring.js +42 -22
  13. package/dist/capability-core.js +132 -17
  14. package/dist/capability-registry.js +138 -168
  15. package/dist/cli.js +97 -98
  16. package/dist/collaboration.js +5 -6
  17. package/dist/commit.js +20 -6
  18. package/dist/compare.js +18 -0
  19. package/dist/coordinator/classify.js +45 -0
  20. package/dist/coordinator/paths.js +42 -0
  21. package/dist/coordinator/util.js +129 -0
  22. package/dist/coordinator.js +127 -300
  23. package/dist/dispatch.js +35 -0
  24. package/dist/drive.js +79 -6
  25. package/dist/error-feedback.js +8 -4
  26. package/dist/evidence-reasoning.js +3 -3
  27. package/dist/execution-backend/agent.js +331 -0
  28. package/dist/execution-backend/probes.js +96 -0
  29. package/dist/execution-backend/util.js +47 -0
  30. package/dist/execution-backend.js +73 -421
  31. package/dist/mcp-server.js +79 -183
  32. package/dist/multi-agent/graph.js +84 -0
  33. package/dist/multi-agent/helpers.js +145 -0
  34. package/dist/multi-agent/paths.js +22 -0
  35. package/dist/multi-agent-eval/format.js +194 -0
  36. package/dist/multi-agent-eval/normalize.js +51 -0
  37. package/dist/multi-agent-eval.js +39 -244
  38. package/dist/multi-agent-host.js +0 -19
  39. package/dist/multi-agent.js +125 -314
  40. package/dist/node-snapshot.js +3 -3
  41. package/dist/observability/format.js +61 -0
  42. package/dist/observability/intake.js +98 -0
  43. package/dist/observability.js +14 -160
  44. package/dist/operator-ux/format.js +364 -0
  45. package/dist/operator-ux.js +22 -363
  46. package/dist/orchestrator/lifecycle-operations.js +2 -1
  47. package/dist/orchestrator/report.js +8 -0
  48. package/dist/orchestrator.js +26 -9
  49. package/dist/reclamation.js +26 -21
  50. package/dist/run-export.js +494 -25
  51. package/dist/run-registry/derive.js +172 -0
  52. package/dist/run-registry/format.js +124 -0
  53. package/dist/run-registry/gc.js +251 -0
  54. package/dist/run-registry/policy.js +16 -0
  55. package/dist/run-registry/queue.js +116 -0
  56. package/dist/run-registry.js +89 -597
  57. package/dist/run-state-schema.js +1 -0
  58. package/dist/sandbox-profile.js +43 -2
  59. package/dist/state-explosion/format.js +159 -0
  60. package/dist/state-explosion/helpers.js +82 -0
  61. package/dist/state-explosion.js +165 -304
  62. package/dist/state-node.js +19 -4
  63. package/dist/telemetry-attestation.js +55 -0
  64. package/dist/telemetry-demo.js +15 -3
  65. package/dist/telemetry-ledger.js +60 -15
  66. package/dist/topology.js +25 -8
  67. package/dist/triggers.js +33 -14
  68. package/dist/trust-audit.js +145 -33
  69. package/dist/version.js +1 -1
  70. package/dist/worker-isolation/helpers.js +51 -0
  71. package/dist/worker-isolation/paths.js +46 -0
  72. package/dist/worker-isolation.js +39 -115
  73. package/docs/agent-delegation-drive.7.md +71 -0
  74. package/docs/canonical-workflow-apps.7.md +37 -0
  75. package/docs/cli-mcp-parity.7.md +16 -0
  76. package/docs/contract-migration-tooling.7.md +6 -0
  77. package/docs/control-plane-scheduling.7.md +6 -0
  78. package/docs/dogfood/resume-drive-real-agent-2026-06-14.md +40 -0
  79. package/docs/durable-state-and-locking.7.md +8 -0
  80. package/docs/evidence-adoption-reasoning-chain.7.md +6 -0
  81. package/docs/execution-backends.7.md +6 -0
  82. package/docs/index.md +2 -0
  83. package/docs/launch/demo.tape +28 -0
  84. package/docs/launch/launch-kit.md +96 -17
  85. package/docs/launch/pre-launch-checklist.md +53 -0
  86. package/docs/multi-agent-cli-mcp-surface.7.md +8 -0
  87. package/docs/multi-agent-eval-replay-harness.7.md +6 -0
  88. package/docs/multi-agent-operator-ux.7.md +6 -0
  89. package/docs/multi-agent-trust-policy-audit.7.md +27 -0
  90. package/docs/node-snapshot-diff-replay.7.md +6 -0
  91. package/docs/observability-cost-accounting.7.md +6 -0
  92. package/docs/project-index.md +27 -6
  93. package/docs/real-execution-backends.7.md +6 -0
  94. package/docs/release-and-migration.7.md +8 -0
  95. package/docs/release-tooling.7.md +6 -0
  96. package/docs/routines.md +23 -0
  97. package/docs/run-registry-control-plane.7.md +89 -2
  98. package/docs/run-retention-reclamation.7.md +8 -0
  99. package/docs/source-context-profiles.7.md +119 -0
  100. package/docs/state-explosion-management.7.md +13 -0
  101. package/docs/team-collaboration.7.md +6 -0
  102. package/docs/trust-model.md +267 -0
  103. package/docs/unix-principles.md +49 -1
  104. package/docs/vendor-manifest-loadability.7.md +43 -0
  105. package/docs/web-desktop-workbench.7.md +6 -0
  106. package/manifest/plugin.manifest.json +1 -1
  107. package/manifest/source-context-profiles.json +142 -0
  108. package/package.json +4 -1
  109. package/scripts/agents/builtin-templates.json +7 -0
  110. package/scripts/agents/claude-p-agent.js +129 -43
  111. package/scripts/architecture-review-fast.js +362 -0
  112. package/scripts/bump-version.js +5 -10
  113. package/scripts/canonical-apps-list.js +64 -0
  114. package/scripts/canonical-apps.js +36 -4
  115. package/scripts/coverage-gate.js +211 -0
  116. package/scripts/dogfood-release.js +1 -1
  117. package/scripts/golden-path.js +4 -4
  118. package/scripts/parity-check.js +5 -0
  119. package/scripts/release-check.js +5 -1
  120. package/scripts/source-context.js +291 -0
  121. package/scripts/version-sync-check.js +5 -7
  122. package/skills/ci-triage/SKILL.md +50 -0
  123. package/skills/ci-triage/agents/openai.yaml +4 -0
  124. package/skills/cool-workflow/SKILL.md +4 -1
  125. package/skills/deploy-check/SKILL.md +55 -0
  126. package/skills/deploy-check/agents/openai.yaml +4 -0
  127. package/skills/design-qa/SKILL.md +49 -0
  128. package/skills/design-qa/agents/openai.yaml +4 -0
  129. package/skills/pr-review/SKILL.md +45 -0
  130. package/skills/pr-review/agents/openai.yaml +4 -0
  131. package/dist/capability-dispatcher.js +0 -86
@@ -29,7 +29,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
29
29
  return (mod && mod.__esModule) ? mod : { "default": mod };
30
30
  };
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.ReclamationError = exports.ReclamationAbort = exports.SKELETON_REQUIRED_KEYS = exports.RECLAMATION_SCHEMA_VERSION = void 0;
32
+ exports.ReclamationError = exports.ReclamationAbort = exports.SKELETON_REQUIRED_KEYS = void 0;
33
33
  exports.sha256OfString = sha256OfString;
34
34
  exports.sha256OfFile = sha256OfFile;
35
35
  exports.dirBytes = dirBytes;
@@ -56,7 +56,7 @@ const multi_agent_eval_1 = require("./multi-agent-eval");
56
56
  const node_snapshot_1 = require("./node-snapshot");
57
57
  const state_1 = require("./state");
58
58
  const trust_audit_1 = require("./trust-audit");
59
- exports.RECLAMATION_SCHEMA_VERSION = 1;
59
+ const compare_1 = require("./compare");
60
60
  /** The skeleton schema is the contract for what MUST survive every reclamation.
61
61
  * Machine-checkable via validateSkeleton(). If extraction can't produce all of
62
62
  * these, reclamation fails closed and frees nothing. */
@@ -135,7 +135,7 @@ function contentDigest(p) {
135
135
  return sha256OfFile(p);
136
136
  const parts = [];
137
137
  const walk = (dir, rel) => {
138
- for (const entry of node_fs_1.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
138
+ for (const entry of node_fs_1.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => (0, compare_1.compareBytes)(a.name, b.name))) {
139
139
  const abs = node_path_1.default.join(dir, entry.name);
140
140
  const r = node_path_1.default.join(rel, entry.name);
141
141
  if (entry.isDirectory())
@@ -261,7 +261,7 @@ function extractSkeleton(run) {
261
261
  }
262
262
  const evidenceDigests = [...evidenceMap.entries()]
263
263
  .map(([ref, digest]) => ({ ref, digest }))
264
- .sort((a, b) => a.ref.localeCompare(b.ref));
264
+ .sort((a, b) => (0, compare_1.compareBytes)(a.ref, b.ref));
265
265
  const eventLog = auditEventLogPath(run);
266
266
  const auditLogDigest = node_fs_1.default.existsSync(eventLog) ? sha256OfFile(eventLog) : sha256OfString("");
267
267
  const events = node_fs_1.default.existsSync(eventLog)
@@ -287,7 +287,7 @@ function extractSkeleton(run) {
287
287
  };
288
288
  const collaboration = run.collaboration;
289
289
  const collaborationLog = {
290
- digest: sha256OfString((0, multi_agent_eval_1.stableStringify)(collaboration || {})),
290
+ digest: sha256OfString((0, multi_agent_eval_1.replayStableStringify)(collaboration || {})),
291
291
  approvals: collaboration?.approvals?.length || 0,
292
292
  comments: collaboration?.comments?.length || 0,
293
293
  handoffs: collaboration?.handoffs?.length || 0
@@ -414,12 +414,12 @@ function snapshotProjectionDigest(node) {
414
414
  contractId: node.contractId,
415
415
  metadata: node.metadata
416
416
  });
417
- return sha256OfString((0, multi_agent_eval_1.stableStringify)(body));
417
+ return sha256OfString((0, multi_agent_eval_1.replayStableStringify)(body));
418
418
  }
419
419
  /** Body digest of the RETAINED node (lives in state.json). The reconstruction
420
420
  * verifier re-derives the projection from this retained input. */
421
421
  function nodeBodyDigest(node) {
422
- return sha256OfString((0, multi_agent_eval_1.stableStringify)(rawNodeBody(node)));
422
+ return sha256OfString((0, multi_agent_eval_1.replayStableStringify)(rawNodeBody(node)));
423
423
  }
424
424
  function rawNodeBody(node) {
425
425
  return {
@@ -449,7 +449,6 @@ function planReclamation(run, policy = {}) {
449
449
  // freeable once the result node's worker-result artifact is re-pointed.
450
450
  let reclaimedScratch = false;
451
451
  if (!policy.keepScratch) {
452
- const workersDir = run.paths.workersDir || node_path_1.default.join(runDir, "workers");
453
452
  for (const scope of run.workers || []) {
454
453
  const workerDir = scope.workerDir;
455
454
  if (!workerDir || !node_fs_1.default.existsSync(workerDir))
@@ -472,7 +471,6 @@ function planReclamation(run, policy = {}) {
472
471
  });
473
472
  reclaimedScratch = true;
474
473
  }
475
- void workersDir;
476
474
  }
477
475
  // A node whose scratch is being re-pointed THIS pass must NOT also have its
478
476
  // snapshot freed in the same pass — re-pointing mutates the node body, which
@@ -515,7 +513,7 @@ function planReclamation(run, policy = {}) {
515
513
  const recipe = {
516
514
  recipeKind: "node-snapshot-projection",
517
515
  inputDigests: [inputDigest],
518
- inputsDigest: sha256OfString((0, multi_agent_eval_1.stableStringify)([inputDigest])),
516
+ inputsDigest: sha256OfString((0, multi_agent_eval_1.replayStableStringify)([inputDigest])),
519
517
  expectDigest: snapshotProjectionDigest(node),
520
518
  sourceRef: node.id
521
519
  };
@@ -531,6 +529,13 @@ function planReclamation(run, policy = {}) {
531
529
  // retention, and we do not yet auto-capture reconstruction recipes for them.
532
530
  // The reference graph is consulted so the door is closed, not merely unbuilt.
533
531
  void buildReferenceGraph;
532
+ // Determinism (HARD constraint): the snapshot candidates above are gathered in
533
+ // fs.readdirSync order, which is filesystem-dependent. freeable feeds the freed
534
+ // manifest that buildTombstone binds into tombstoneHash (and the prevTombstoneHash
535
+ // chain), so an unsorted order makes the tombstone hash irreproducible across
536
+ // hosts. Sort by path — the same compareBytes discipline the directory reads at
537
+ // :128 and the reference list at :243 already use — before anything hashes it.
538
+ freeable.sort((a, b) => (0, compare_1.compareBytes)(a.path, b.path));
534
539
  const byKind = {};
535
540
  let bytesToFree = 0;
536
541
  for (const entry of freeable) {
@@ -557,16 +562,16 @@ function planReclamation(run, policy = {}) {
557
562
  return { freeable, bytesToFree, byKind, capability, capabilityReason };
558
563
  }
559
564
  function policyDigestOf(policy) {
560
- return sha256OfString((0, multi_agent_eval_1.stableStringify)(policy));
565
+ return sha256OfString((0, multi_agent_eval_1.replayStableStringify)(policy));
561
566
  }
562
567
  /** genesis prevTombstoneHash = sha256 of the sealed skeleton. */
563
568
  function genesisPrevHash(skeleton) {
564
- return sha256OfString((0, multi_agent_eval_1.stableStringify)(skeleton));
569
+ return sha256OfString((0, multi_agent_eval_1.replayStableStringify)(skeleton));
565
570
  }
566
571
  /** The canonical bytes a tombstoneHash binds: freed-manifest + sealed skeleton +
567
572
  * prevTombstoneHash + capability. Recomputed independently by `gc verify`. */
568
573
  function tombstoneHashInput(t) {
569
- return (0, multi_agent_eval_1.stableStringify)({
574
+ return (0, multi_agent_eval_1.replayStableStringify)({
570
575
  runId: t.runId,
571
576
  tombstoneId: t.tombstoneId,
572
577
  reclaimedAt: t.reclaimedAt,
@@ -574,7 +579,7 @@ function tombstoneHashInput(t) {
574
579
  policyDigest: t.policyDigest,
575
580
  freed: t.freed.map((f) => ({ path: f.path, kind: f.kind, bytes: f.bytes, sha256: f.sha256, recipe: f.recipe || null })),
576
581
  bytesFreed: t.bytesFreed,
577
- skeletonDigest: sha256OfString((0, multi_agent_eval_1.stableStringify)(t.skeleton)),
582
+ skeletonDigest: sha256OfString((0, multi_agent_eval_1.replayStableStringify)(t.skeleton)),
578
583
  capability: t.capability,
579
584
  capabilityReason: t.capabilityReason,
580
585
  prevTombstoneHash: t.prevTombstoneHash
@@ -583,11 +588,11 @@ function tombstoneHashInput(t) {
583
588
  function computeTombstoneHash(t) {
584
589
  return sha256OfString(tombstoneHashInput(t));
585
590
  }
586
- let tombstoneCounter = 0;
587
- function tombstoneId(run, now) {
588
- tombstoneCounter += 1;
589
- const stamp = now.replace(/[-:.TZ]/g, "").slice(0, 14);
590
- return `tomb-${stamp}-${String(tombstoneCounter).padStart(3, "0")}`;
591
+ function tombstoneId(seq) {
592
+ // Deterministic (FreeBSD-audit L13): the chain POSITION, not a process-global
593
+ // counter or wall-clock stamp — tombstoneId is bound into the tombstoneHash
594
+ // chain that `gc verify` recomputes, so it must be reproducible.
595
+ return `tomb-${String(seq).padStart(3, "0")}`;
591
596
  }
592
597
  /** STEP 2: build the FULL tombstone (pre-deletion sha256 per freed path + the
593
598
  * hash chain). Reads the freed files (still present); mutates nothing on disk. */
@@ -605,7 +610,7 @@ function buildTombstone(run, skeleton, plan, options = {}) {
605
610
  const base = {
606
611
  schemaVersion: 1,
607
612
  runId: run.id,
608
- tombstoneId: tombstoneId(run, now),
613
+ tombstoneId: tombstoneId(prior.length + 1),
609
614
  reclaimedAt: now,
610
615
  actor: options.actor,
611
616
  policyDigest: policyDigestOf(options.policy || {}),
@@ -800,7 +805,7 @@ function reconstructArtifact(run, recipe) {
800
805
  return { inputsDigest: sha256OfString("absent"), expectDigest: sha256OfString("absent") };
801
806
  }
802
807
  const inputDigest = nodeBodyDigest(node);
803
- const inputsDigest = sha256OfString((0, multi_agent_eval_1.stableStringify)([inputDigest]));
808
+ const inputsDigest = sha256OfString((0, multi_agent_eval_1.replayStableStringify)([inputDigest]));
804
809
  const expectDigest = snapshotProjectionDigest(node);
805
810
  return { inputsDigest, expectDigest };
806
811
  }