cool-workflow 0.1.96 → 0.1.97

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 (62) 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 +6 -1
  11. package/dist/cli/handlers/scheduling.js +7 -1
  12. package/dist/drive.js +10 -0
  13. package/dist/execution-backend/agent.js +1 -1
  14. package/dist/execution-backend.js +25 -5
  15. package/dist/mcp-server.js +4 -0
  16. package/dist/onramp.js +2 -0
  17. package/dist/orchestrator/app-operations.js +6 -0
  18. package/dist/orchestrator/cli-options.js +8 -2
  19. package/dist/orchestrator/lifecycle-operations.js +3 -0
  20. package/dist/orchestrator/migration-operations.js +1 -1
  21. package/dist/run-export.js +10 -1
  22. package/dist/sandbox-profile.js +6 -1
  23. package/dist/triggers.js +7 -1
  24. package/dist/version.js +1 -1
  25. package/dist/workbench-host.js +7 -1
  26. package/docs/agent-delegation-drive.7.md +2 -0
  27. package/docs/cli-mcp-parity.7.md +2 -0
  28. package/docs/contract-migration-tooling.7.md +2 -0
  29. package/docs/control-plane-scheduling.7.md +2 -0
  30. package/docs/demo.7.md +80 -0
  31. package/docs/doctor.7.md +97 -0
  32. package/docs/durable-state-and-locking.7.md +2 -0
  33. package/docs/evidence-adoption-reasoning-chain.7.md +2 -0
  34. package/docs/execution-backends.7.md +2 -0
  35. package/docs/fix.7.md +44 -0
  36. package/docs/init.7.md +62 -0
  37. package/docs/multi-agent-cli-mcp-surface.7.md +2 -0
  38. package/docs/multi-agent-eval-replay-harness.7.md +2 -0
  39. package/docs/multi-agent-operator-ux.7.md +2 -0
  40. package/docs/node-snapshot-diff-replay.7.md +2 -0
  41. package/docs/observability-cost-accounting.7.md +2 -0
  42. package/docs/pipeline-verbs.7.md +93 -0
  43. package/docs/project-index.md +16 -4
  44. package/docs/real-execution-backends.7.md +2 -0
  45. package/docs/release-and-migration.7.md +2 -0
  46. package/docs/release-tooling.7.md +2 -0
  47. package/docs/routine.7.md +73 -0
  48. package/docs/run-registry-control-plane.7.md +2 -0
  49. package/docs/run-retention-reclamation.7.md +2 -0
  50. package/docs/state-explosion-management.7.md +2 -0
  51. package/docs/team-collaboration.7.md +2 -0
  52. package/docs/web-desktop-workbench.7.md +2 -0
  53. package/manifest/README.md +16 -10
  54. package/manifest/plugin.manifest.json +1 -1
  55. package/package.json +1 -1
  56. package/scripts/agents/agent-adapter-core.js +4 -1
  57. package/scripts/canonical-apps.js +4 -4
  58. package/scripts/children/batch-delegate-child.js +10 -3
  59. package/scripts/children/http-delegate-child.js +2 -1
  60. package/scripts/dogfood-release.js +1 -1
  61. package/scripts/golden-path.js +4 -4
  62. package/scripts/release-flow.js +24 -16
@@ -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");
@@ -280,7 +285,7 @@ function delegateReview(resultPath, inputPath) {
280
285
  cwd: repoRoot,
281
286
  env: { ...process.env },
282
287
  encoding: "utf8",
283
- timeout: cfg.timeoutMs || 600000,
288
+ timeout: cfg.timeoutMs || REVIEWER_TIMEOUT_MS,
284
289
  shell: false,
285
290
  stdio: ["ignore", "pipe", "inherit"],
286
291
  maxBuffer: 32 * 1024 * 1024
@@ -310,7 +315,7 @@ function delegateReview(resultPath, inputPath) {
310
315
  say(`[2/3] reviewer — POSTing to endpoint ${cfg.endpoint} (model: ${cfg.model || "unreported"})`);
311
316
  const body = JSON.stringify({ prompt: subMap.prompt, model: cfg.model, sha: HEAD });
312
317
  const lib = cfg.endpoint.startsWith("https:") ? https : http;
313
- const text = postSync(lib, cfg.endpoint, body, cfg.timeoutMs || 600000);
318
+ const text = postSync(lib, cfg.endpoint, body, cfg.timeoutMs || REVIEWER_TIMEOUT_MS);
314
319
  if (text === null) die("reviewer endpoint call failed — no verdict trusted.");
315
320
  fs.writeFileSync(resultPath, text.endsWith("\n") ? text : `${text}\n`);
316
321
  }
@@ -502,25 +507,28 @@ function cut(resultPath, capability) {
502
507
  const bump = spawnSync("npm", ["run", "bump:version", "--", cutVersion], { cwd: pluginRoot, encoding: "utf8", stdio: "inherit" });
503
508
  if (bump.status !== 0) die("bump:version failed");
504
509
  // 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"]);
510
+ // Fail closed: a failed regen must not bake a stale index into the immutable tag.
511
+ const sync = spawnSync("npm", ["run", "sync:project-index", "--", "--repo-only"], { cwd: pluginRoot, encoding: "utf8", stdio: "inherit" });
512
+ if (sync.status !== 0) die("sync:project-index failed refusing to cut with a stale project index");
513
+ // Stage ONLY tracked-file modifications (the bump surfaces, project-index, dist)
514
+ // plus the ONE intended new file: the reviewer verdict. NEVER `git add -A` — an
515
+ // untracked stray (e.g. the reviewer's narration transcript, which carries the
516
+ // operator's local home path) must never ride into the immutable tag commit
517
+ // (that tripped pii-redaction-smoke and red-failed release-gate for v0.1.96).
518
+ // `git add -u` touches tracked files only, so no untracked file can be swept in;
519
+ // the verdict is the single new path the cut is allowed to add.
520
+ git(["add", "-u"]);
521
+ git(["add", "--", path.relative(repoRoot, resultPath)]);
517
522
  const commit = git(["commit", "-m", `chore(release): record APPROVED reviewer verdict for v${cutVersion}`]);
518
523
  if (commit.code !== 0) die("verdict commit failed", commit.err);
519
524
  const tag = git(["tag", "-a", `v${cutVersion}`, "-m", `v${cutVersion}: ${capability || "release"}`]);
520
525
  if (tag.code !== 0) die("git tag failed", tag.err);
521
526
  if (PUSH) {
522
- git(["push", "origin", "HEAD"]);
523
- git(["push", "origin", `v${cutVersion}`]);
527
+ // Atomic: the verdict commit on HEAD and the tag land together or not at all.
528
+ // A non-atomic two-push could leave main advanced with no tag, so CI's
529
+ // release-gate (which fires on the tag) never runs and the release silently stalls.
530
+ const push = git(["push", "--atomic", "origin", "HEAD", `v${cutVersion}`]);
531
+ if (push.code !== 0) die("atomic push of HEAD + tag failed (nothing partially pushed)", push.err);
524
532
  }
525
533
  say(`tagged v${cutVersion}${PUSH ? " and pushed" : " (local only; push when ready)"}`);
526
534
  // Finishing step: create the GitHub Release for the just-pushed tag. Only when