cool-workflow 0.1.96 → 0.1.98

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 (74) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/apps/architecture-review/app.json +1 -1
  4. package/apps/architecture-review-fast/app.json +1 -1
  5. package/apps/end-to-end-golden-path/app.json +1 -1
  6. package/apps/pr-review-fix-ci/app.json +1 -1
  7. package/apps/release-cut/app.json +1 -1
  8. package/apps/research-synthesis/app.json +1 -1
  9. package/dist/candidate-scoring.js +3 -3
  10. package/dist/capability-core.js +9 -1
  11. package/dist/capability-registry.js +7 -1
  12. package/dist/cli/command-surface.js +4 -0
  13. package/dist/cli/handlers/ledger.js +169 -0
  14. package/dist/cli/handlers/scheduling.js +7 -1
  15. package/dist/drive.js +108 -61
  16. package/dist/execution-backend/agent.js +84 -24
  17. package/dist/execution-backend.js +25 -5
  18. package/dist/ledger.js +313 -0
  19. package/dist/mcp/tool-call.js +36 -0
  20. package/dist/mcp/tool-definitions.js +26 -0
  21. package/dist/mcp-server.js +4 -0
  22. package/dist/onramp.js +2 -0
  23. package/dist/orchestrator/app-operations.js +6 -0
  24. package/dist/orchestrator/cli-options.js +8 -2
  25. package/dist/orchestrator/lifecycle-operations.js +40 -13
  26. package/dist/orchestrator/migration-operations.js +1 -1
  27. package/dist/orchestrator.js +11 -3
  28. package/dist/remote-source.js +10 -3
  29. package/dist/run-export.js +45 -5
  30. package/dist/sandbox-profile.js +6 -1
  31. package/dist/triggers.js +7 -1
  32. package/dist/version.js +1 -1
  33. package/dist/workbench-host.js +18 -2
  34. package/docs/agent-delegation-drive.7.md +4 -0
  35. package/docs/cli-mcp-parity.7.md +16 -2
  36. package/docs/contract-migration-tooling.7.md +4 -0
  37. package/docs/control-plane-scheduling.7.md +4 -0
  38. package/docs/cross-agent-ledger.7.md +217 -0
  39. package/docs/demo.7.md +80 -0
  40. package/docs/designs/handoff-ledger.md +145 -0
  41. package/docs/doctor.7.md +97 -0
  42. package/docs/durable-state-and-locking.7.md +4 -0
  43. package/docs/evidence-adoption-reasoning-chain.7.md +4 -0
  44. package/docs/execution-backends.7.md +4 -0
  45. package/docs/fix.7.md +44 -0
  46. package/docs/handoff-setup.md +120 -0
  47. package/docs/init.7.md +62 -0
  48. package/docs/multi-agent-cli-mcp-surface.7.md +4 -0
  49. package/docs/multi-agent-eval-replay-harness.7.md +4 -0
  50. package/docs/multi-agent-operator-ux.7.md +4 -0
  51. package/docs/node-snapshot-diff-replay.7.md +4 -0
  52. package/docs/observability-cost-accounting.7.md +4 -0
  53. package/docs/pipeline-verbs.7.md +93 -0
  54. package/docs/project-index.md +28 -5
  55. package/docs/real-execution-backends.7.md +4 -0
  56. package/docs/release-and-migration.7.md +4 -0
  57. package/docs/release-tooling.7.md +4 -0
  58. package/docs/routine.7.md +73 -0
  59. package/docs/run-registry-control-plane.7.md +4 -0
  60. package/docs/run-retention-reclamation.7.md +4 -0
  61. package/docs/state-explosion-management.7.md +4 -0
  62. package/docs/team-collaboration.7.md +4 -0
  63. package/docs/web-desktop-workbench.7.md +4 -0
  64. package/manifest/README.md +16 -10
  65. package/manifest/plugin.manifest.json +1 -1
  66. package/package.json +1 -1
  67. package/scripts/agents/agent-adapter-core.js +4 -1
  68. package/scripts/agents/codex-agent.js +34 -4
  69. package/scripts/canonical-apps.js +4 -4
  70. package/scripts/children/batch-delegate-child.js +40 -13
  71. package/scripts/children/http-delegate-child.js +2 -1
  72. package/scripts/dogfood-release.js +1 -1
  73. package/scripts/golden-path.js +4 -4
  74. package/scripts/release-flow.js +31 -17
@@ -154,6 +154,11 @@ function runVendorPreflight() {
154
154
  }
155
155
 
156
156
  // ---- 2. independent reviewer, delegated to the configured agent -------------
157
+ // Default reviewer deadline. The zero-trust reviewer re-runs release-gate.sh,
158
+ // whose sequential test suite alone is ~12 min, then reads + reasons over the
159
+ // diff — so a 10-min default guaranteed a timeout on a real release. 30 min gives
160
+ // headroom; override with CW_AGENT_TIMEOUT_MS (or --agent-timeout-ms).
161
+ const REVIEWER_TIMEOUT_MS = 1800000;
157
162
  function reviewerPromptBody() {
158
163
  // Reuse the committed reviewer spec as the prompt; strip YAML frontmatter.
159
164
  const specPath = path.join(pluginRoot, "agents", "release-reviewer.md");
@@ -278,9 +283,15 @@ function delegateReview(resultPath, inputPath) {
278
283
  // the file takes precedence. stderr goes to the terminal for live output.
279
284
  const r = spawnSync(bin, args, {
280
285
  cwd: repoRoot,
281
- env: { ...process.env },
286
+ // CW_RELEASE_REVIEW=1 is a vendor-agnostic signal that THIS spawn is a
287
+ // release verdict, not a fast worker turn. Wrappers that can re-run the gate
288
+ // (e.g. codex-agent.js) read it to raise reasoning effort and open an
289
+ // exec-capable sandbox — a read-only/low-effort reviewer can't execute the
290
+ // gate it judges and degrades to fabricated verdicts. Preflight liveness
291
+ // probes never set it, so they stay fast and read-only.
292
+ env: { ...process.env, CW_RELEASE_REVIEW: "1" },
282
293
  encoding: "utf8",
283
- timeout: cfg.timeoutMs || 600000,
294
+ timeout: cfg.timeoutMs || REVIEWER_TIMEOUT_MS,
284
295
  shell: false,
285
296
  stdio: ["ignore", "pipe", "inherit"],
286
297
  maxBuffer: 32 * 1024 * 1024
@@ -310,7 +321,7 @@ function delegateReview(resultPath, inputPath) {
310
321
  say(`[2/3] reviewer — POSTing to endpoint ${cfg.endpoint} (model: ${cfg.model || "unreported"})`);
311
322
  const body = JSON.stringify({ prompt: subMap.prompt, model: cfg.model, sha: HEAD });
312
323
  const lib = cfg.endpoint.startsWith("https:") ? https : http;
313
- const text = postSync(lib, cfg.endpoint, body, cfg.timeoutMs || 600000);
324
+ const text = postSync(lib, cfg.endpoint, body, cfg.timeoutMs || REVIEWER_TIMEOUT_MS);
314
325
  if (text === null) die("reviewer endpoint call failed — no verdict trusted.");
315
326
  fs.writeFileSync(resultPath, text.endsWith("\n") ? text : `${text}\n`);
316
327
  }
@@ -502,25 +513,28 @@ function cut(resultPath, capability) {
502
513
  const bump = spawnSync("npm", ["run", "bump:version", "--", cutVersion], { cwd: pluginRoot, encoding: "utf8", stdio: "inherit" });
503
514
  if (bump.status !== 0) die("bump:version failed");
504
515
  // Regenerate the gated project index after the version bump (PR #87 gate).
505
- spawnSync("npm", ["run", "sync:project-index", "--", "--repo-only"], { cwd: pluginRoot, stdio: "inherit" });
506
- // Belt-and-suspenders: the reviewer agent writes a narration transcript into
507
- // .cw-release/ that may carry local paths (the operator's home dir). It is
508
- // .gitignored, but `git add -A` would still stage it if it were ever tracked,
509
- // and a tracked transcript leaks PII into the immutable tag commit (it tripped
510
- // pii-redaction-smoke and red-failed release-gate for v0.1.96). Remove any
511
- // transcript before staging so it can never ride into the tag.
512
- const releaseDir = path.join(repoRoot, ".cw-release");
513
- for (const f of fs.existsSync(releaseDir) ? fs.readdirSync(releaseDir) : []) {
514
- if (/^transcript.*\.md$/.test(f)) fs.rmSync(path.join(releaseDir, f), { force: true });
515
- }
516
- git(["add", "-A"]);
516
+ // Fail closed: a failed regen must not bake a stale index into the immutable tag.
517
+ const sync = spawnSync("npm", ["run", "sync:project-index", "--", "--repo-only"], { cwd: pluginRoot, encoding: "utf8", stdio: "inherit" });
518
+ if (sync.status !== 0) die("sync:project-index failed refusing to cut with a stale project index");
519
+ // Stage ONLY tracked-file modifications (the bump surfaces, project-index, dist)
520
+ // plus the ONE intended new file: the reviewer verdict. NEVER `git add -A` — an
521
+ // untracked stray (e.g. the reviewer's narration transcript, which carries the
522
+ // operator's local home path) must never ride into the immutable tag commit
523
+ // (that tripped pii-redaction-smoke and red-failed release-gate for v0.1.96).
524
+ // `git add -u` touches tracked files only, so no untracked file can be swept in;
525
+ // the verdict is the single new path the cut is allowed to add.
526
+ git(["add", "-u"]);
527
+ git(["add", "--", path.relative(repoRoot, resultPath)]);
517
528
  const commit = git(["commit", "-m", `chore(release): record APPROVED reviewer verdict for v${cutVersion}`]);
518
529
  if (commit.code !== 0) die("verdict commit failed", commit.err);
519
530
  const tag = git(["tag", "-a", `v${cutVersion}`, "-m", `v${cutVersion}: ${capability || "release"}`]);
520
531
  if (tag.code !== 0) die("git tag failed", tag.err);
521
532
  if (PUSH) {
522
- git(["push", "origin", "HEAD"]);
523
- git(["push", "origin", `v${cutVersion}`]);
533
+ // Atomic: the verdict commit on HEAD and the tag land together or not at all.
534
+ // A non-atomic two-push could leave main advanced with no tag, so CI's
535
+ // release-gate (which fires on the tag) never runs and the release silently stalls.
536
+ const push = git(["push", "--atomic", "origin", "HEAD", `v${cutVersion}`]);
537
+ if (push.code !== 0) die("atomic push of HEAD + tag failed (nothing partially pushed)", push.err);
524
538
  }
525
539
  say(`tagged v${cutVersion}${PUSH ? " and pushed" : " (local only; push when ready)"}`);
526
540
  // Finishing step: create the GitHub Release for the just-pushed tag. Only when