@bridge_gpt/mcp-server 0.2.71 → 0.2.72

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 (116) hide show
  1. package/README.md +55 -17
  2. package/build/agent-launchers/claude-executor-adapter.js +19 -3
  3. package/build/agent-notes.js +171 -95
  4. package/build/agents.generated.js +4 -4
  5. package/build/bridge-permissions.js +4 -0
  6. package/build/bridge-worktree-inspection.js +237 -0
  7. package/build/check-evidence.js +6 -0
  8. package/build/claude-review-workflow.js +1 -1
  9. package/build/cli-help.js +6 -0
  10. package/build/codex-auto-recovery.js +126 -0
  11. package/build/codex-skill-adapter.js +2 -0
  12. package/build/commands.generated.js +5 -5
  13. package/build/conductor/bridge-api-client.js +518 -23
  14. package/build/conductor/doctor.js +84 -10
  15. package/build/conductor/epic-implementer-cli.js +51 -2
  16. package/build/conductor/gate-discovery.js +136 -10
  17. package/build/conductor/gate-settings-review.js +305 -5
  18. package/build/conductor/git-hooks-uninstall.js +112 -0
  19. package/build/conductor/git-hooks.js +81 -15
  20. package/build/conductor/guided-repair.js +10 -1
  21. package/build/conductor/install-doctor.js +2 -4
  22. package/build/conductor/launch-plan.js +42 -2
  23. package/build/conductor/local-merge.js +12 -1
  24. package/build/conductor/merge-execution-contract.js +1 -1
  25. package/build/conductor/merged-child-check.js +2 -1
  26. package/build/conductor/prerequisite-inputs.js +379 -0
  27. package/build/conductor/readiness-assessment.js +78 -0
  28. package/build/conductor/readiness-cli.js +10 -0
  29. package/build/conductor/readiness-prerequisites.js +53 -0
  30. package/build/conductor/readiness-sections.js +21 -8
  31. package/build/conductor/readiness.js +20 -2
  32. package/build/conductor/recovery-cli.js +223 -13
  33. package/build/conductor/recovery-operations.js +34 -4
  34. package/build/conductor/repair-contract.js +33 -0
  35. package/build/conductor/tools.js +34 -3
  36. package/build/conductor/wait-run-attention.js +115 -0
  37. package/build/conductor/wait-run-cli.js +96 -3
  38. package/build/conductor/worker-database-doctor-inspector.js +1 -0
  39. package/build/credential-store.js +25 -20
  40. package/build/dependency-install-declarations.js +157 -0
  41. package/build/docs.generated.js +4 -4
  42. package/build/doctor.js +37 -5
  43. package/build/drive-epic-help.js +2 -2
  44. package/build/drive-epic.js +52 -11
  45. package/build/epic-implementer-bin.js +118 -43
  46. package/build/epic-launch-profile.js +1 -1
  47. package/build/executor/cli.js +2 -0
  48. package/build/executor/completion-contract.js +16 -0
  49. package/build/executor/credentials.js +1 -1
  50. package/build/executor/delivery-observations.js +113 -0
  51. package/build/executor/delivery-outcome.js +30 -0
  52. package/build/executor/dependency-refresh-runner.js +132 -0
  53. package/build/executor/dependency-refresh.js +530 -0
  54. package/build/executor/deps.js +4 -0
  55. package/build/executor/env.js +67 -2
  56. package/build/executor/harness-coverage.js +19 -0
  57. package/build/executor/http-client.js +35 -1
  58. package/build/executor/index.js +2 -1
  59. package/build/executor/install-preflight.js +1 -1
  60. package/build/executor/job-runner.js +246 -28
  61. package/build/executor/likely-tests.js +94 -97
  62. package/build/executor/prompt-spec.js +13 -3
  63. package/build/executor/required-verification.js +28 -0
  64. package/build/executor/required-work-diagnostics.js +30 -0
  65. package/build/executor/required-work-ledger.js +19 -1
  66. package/build/executor/results.js +42 -0
  67. package/build/executor/service-discovery.js +42 -0
  68. package/build/executor/service-lifecycle.js +109 -2
  69. package/build/executor/service-uninstall.js +205 -0
  70. package/build/executor/service-unit.js +5 -3
  71. package/build/executor/test-clock.js +3 -0
  72. package/build/executor/verification-hints.js +179 -0
  73. package/build/executor/worker-command.js +54 -2
  74. package/build/executor/worker-database.js +271 -31
  75. package/build/executor/worker-finalization.js +65 -10
  76. package/build/executor/worker-guard-hook.js +10 -2
  77. package/build/executor/worker-verification-guidance.js +37 -2
  78. package/build/executor/worktree-inspection.js +42 -0
  79. package/build/github-sign-in.js +1 -1
  80. package/build/index.js +679 -278
  81. package/build/init.js +3 -3
  82. package/build/install-bridge-conductor-gate.js +236 -42
  83. package/build/install-bridge-conductor-setup.js +115 -26
  84. package/build/install-bridge-conductor.js +448 -350
  85. package/build/install-bridge.js +418 -123
  86. package/build/install-maintenance.js +104 -0
  87. package/build/install-reexec.js +1 -1
  88. package/build/local-cleanup.js +59 -0
  89. package/build/mcp-install-state.js +68 -2
  90. package/build/merge-workflow-install.js +2 -2
  91. package/build/package-script-semantics.js +10 -0
  92. package/build/pipeline-utils.js +1 -1
  93. package/build/pipelines.generated.js +5 -5
  94. package/build/plan-execution-ledger.js +148 -2
  95. package/build/plane/plane-freshness.js +6 -7
  96. package/build/plane/terminal-run-cleanup.js +5 -1
  97. package/build/plane/terminal-run-status.js +4 -0
  98. package/build/printed-remedy-commands.js +24 -4
  99. package/build/readiness-check.js +1 -78
  100. package/build/readiness-prerequisites.generated.js +199 -0
  101. package/build/readme.generated.js +1 -1
  102. package/build/repository-toolchains.js +50 -8
  103. package/build/setup-change-policy.js +32 -0
  104. package/build/setup-epic.js +2 -2
  105. package/build/setup-question.js +62 -0
  106. package/build/start-tickets.js +4 -0
  107. package/build/test-command-detection.js +32 -88
  108. package/build/test-support/notes-fs.js +40 -0
  109. package/build/ticket-delivery-enrollment.js +21 -8
  110. package/build/ticket-delivery-run-scope.js +128 -0
  111. package/build/version.generated.js +3 -3
  112. package/build/worker-guard-hook-bin.js +2 -2
  113. package/build/worktrees.js +105 -0
  114. package/docs/EPIC-IMPLEMENTER.md +5 -0
  115. package/docs/epic-implementer/getting-started.md +40 -15
  116. package/package.json +1 -1
package/build/doctor.js CHANGED
@@ -52,6 +52,7 @@ import { BRIDGE_PACKAGE_NAME, describeLauncherReason, DUPLICATE_REGISTRATION_GUI
52
52
  import { MCP_SERVER_NAME, MCP_PACKAGE_NAME, } from "./mcp-identity.js";
53
53
  import { DEFAULT_AGENT_NAME, resolveAgentSpec, isAgentName, formatValidAgentNames, } from "./agent-registry.js";
54
54
  import { getDoctorPrereqDescriptors, probePrerequisite, } from "./start-tickets-prereqs.js";
55
+ import { posixShellQuote } from "./platform-escaping.js";
55
56
  import { resolveProfiles } from "./mcp-profile.js";
56
57
  import { executorLaunchdDirForHome, executorSystemdDirForHome, executorIdFromLaunchdFilename, executorIdFromSystemdFilename, inspectExecutorServiceArtifact, inspectExecutorServiceDurability, EXECUTOR_SERVICE_BASE_URL_ENV, } from "./executor/index.js";
57
58
  import { DEFAULT_BAPI_BASE_URL } from "./executor/credentials.js";
@@ -123,6 +124,9 @@ export function getDoctorUsage() {
123
124
  "prints the key value and never writes the credential store. To persist or",
124
125
  "migrate a credential, use /install-bridge or the `credentials` subcommand —",
125
126
  "doctor stays strictly read-only.",
127
+ "Managed git hooks and Bridge worktrees are advisory cleanup observations;",
128
+ "they show installed/unknown hooks, sizes and prune eligibility without fetching",
129
+ "or changing the exit code. Removal commands require separate consent.",
126
130
  "",
127
131
  "It includes an advisory 'Worker containment' section reporting the DECLARED",
128
132
  "posture an Epic Implementer worker runs under: that the executor strips this",
@@ -1356,7 +1360,7 @@ export async function collectExecutorServiceDiagnostics(deps) {
1356
1360
  noStandingGithubWriteCredential: "unverifiable",
1357
1361
  warnings: [
1358
1362
  "unit could not be read; its configuration cannot be verified.",
1359
- "regenerate it through durable-host mode (`install conductor`) if this persists.",
1363
+ "regenerate it through durable-host mode (`install epic-implementer`) if this persists.",
1360
1364
  ],
1361
1365
  });
1362
1366
  continue;
@@ -1371,12 +1375,12 @@ export async function collectExecutorServiceDiagnostics(deps) {
1371
1375
  unitWarnings.push(...inspection.credentialDeclarationProblems);
1372
1376
  if (credentialDeclaration === "present") {
1373
1377
  unitWarnings.push("this unit declares something outside the closed durable-host contract — regenerate it " +
1374
- "through durable-host mode (`install conductor`) and remove the hand edit.");
1378
+ "through durable-host mode (`install epic-implementer`) and remove the hand edit.");
1375
1379
  }
1376
1380
  else if (credentialDeclaration === "unverifiable") {
1377
1381
  unitWarnings.push("this unit could only be parsed partially, so the no-standing-GitHub-write-credential " +
1378
1382
  "property could not be established — regenerate it through durable-host mode " +
1379
- "(`install conductor`).");
1383
+ "(`install epic-implementer`).");
1380
1384
  }
1381
1385
  let baseUrlClass;
1382
1386
  if (!inspection.baseUrl) {
@@ -1443,6 +1447,7 @@ export function formatExecutorServiceDiagnosticsReport(diagnostics) {
1443
1447
  for (const unit of diagnostics.units) {
1444
1448
  lines.push(`found ${unit.path}`);
1445
1449
  lines.push(` executor id: ${unit.executorId}`);
1450
+ lines.push(` cleanup: npx -y ${MCP_PACKAGE_NAME} executor uninstall-service --executor-id ${posixShellQuote(unit.executorId)}`);
1446
1451
  lines.push(` ${EXECUTOR_SERVICE_BASE_URL_ENV}: ${unit.baseUrl ?? "(absent)"} [${unit.baseUrlClass}]`);
1447
1452
  lines.push(` repos: ${unit.repos.length > 0 ? unit.repos.join(", ") : "(none parsed)"}`);
1448
1453
  lines.push(formatCredentialDeclarationLine(unit.noStandingGithubWriteCredential));
@@ -1794,7 +1799,7 @@ export function formatOperationalAdvisoryReport(diagnostic) {
1794
1799
  lines.push(` ${helper}`);
1795
1800
  }
1796
1801
  lines.push(" These predate the scoped two-phase bring-up and are retired. The supported\n" +
1797
- " replacement is DURABLE-HOST MODE: run `install conductor` to plan, write, and\n" +
1802
+ " replacement is DURABLE-HOST MODE: run `install epic-implementer` to plan, write, and\n" +
1798
1803
  " start the executor as a persistent service, then confirm\n" +
1799
1804
  " `drive-epic <EPIC> --plan-file <dag>` works for you, and remove them.\n" +
1800
1805
  " doctor performed a PATH-PRESENCE check only: it did not run, read, or\n" +
@@ -1966,7 +1971,7 @@ export function formatEpicLaunchProfileDiagnosticReport(diagnostic) {
1966
1971
  lines.push(" (none)");
1967
1972
  for (const p of diagnostic.profiles) {
1968
1973
  if (p.problem !== undefined) {
1969
- lines.push(` [fail] ${p.name}: ${p.problem} — re-run \`install conductor --launch-profile ${p.name}\`.`);
1974
+ lines.push(` [fail] ${p.name}: ${p.problem} — re-run \`install epic-implementer --launch-profile ${p.name}\`.`);
1970
1975
  continue;
1971
1976
  }
1972
1977
  const tag = p.usable ? "[ok] " : "[fail]";
@@ -2336,6 +2341,33 @@ export async function runDoctorCli(argv, overrides = {}) {
2336
2341
  }));
2337
2342
  }
2338
2343
  }
2344
+ if (overrides.localCleanup !== false) {
2345
+ try {
2346
+ const { inspectConductorGitHooks } = await import("./conductor/git-hooks.js");
2347
+ const { inspectBridgeWorktrees, formatBridgeWorktreeSummary } = await import("./bridge-worktree-inspection.js");
2348
+ log("\nManaged git hooks (advisory)");
2349
+ try {
2350
+ const hooks = inspectConductorGitHooks({ cwd: deps.cwd, presenceOnly: true });
2351
+ if (!hooks.is_worktree)
2352
+ log("unavailable: outside a Git repository");
2353
+ for (const hook of hooks.hooks)
2354
+ log(`${hook.path}: ${hook.managed_block_observation === "unknown" ? "unknown" : hook.managed_block_observation === "present" ? "installed" : "not installed"}`);
2355
+ log("Remove: epic-implementer uninstall-git-hooks [--dry-run]");
2356
+ }
2357
+ catch {
2358
+ log("unavailable: outside a repository or Git hooks could not be inspected");
2359
+ }
2360
+ const worktrees = await inspectBridgeWorktrees({ cwd: deps.cwd, budgetMs: 1000 });
2361
+ log("\nBridge worktrees (advisory)");
2362
+ log(formatBridgeWorktreeSummary(worktrees));
2363
+ for (const wt of worktrees.worktrees.filter(wt => wt.evidence.length))
2364
+ log(`${wt.path}: ${wt.status}; ${wt.retained.join("; ")}`);
2365
+ log(`Inspect local refs and git status before cleanup: npx -y ${MCP_PACKAGE_NAME} worktrees --prune`);
2366
+ }
2367
+ catch {
2368
+ log("Local cleanup observations unavailable (advisory).");
2369
+ }
2370
+ }
2339
2371
  // Advisory conductor-plane credential section (BAPI-756). Read-only and, like
2340
2372
  // every section above, never affects the exit code: `plane up` enforces these
2341
2373
  // same invariants at the point where they actually block, and an ordinary MCP
@@ -172,13 +172,13 @@ export function getDriveEpicAdvancedUsage() {
172
172
  "repo-wide executor; a plane already bound to the run needs none. An epic with",
173
173
  "several active runs, or a run that cannot be read, is refused by name.",
174
174
  "",
175
- "Repository-wide executors: `install conductor --executor-id <id> --repo-wide`",
175
+ "Repository-wide executors: `install epic-implementer --executor-id <id> --repo-wide`",
176
176
  "provisions a persistent executor that claims jobs for every run in the",
177
177
  "repository. A durable host needs one before it can launch.",
178
178
  "",
179
179
  "Launch target — decided BEFORE any authenticated request:",
180
180
  " --launch-profile <name> Select the host-local launch profile guided setup",
181
- " approved (`install conductor --launch-profile <name>`):",
181
+ " approved (`install epic-implementer --launch-profile <name>`):",
182
182
  " target, repository, mode, runtime, and policy and",
183
183
  " credential references. Useful for a local or other",
184
184
  " non-production server and for durable hosts.",
@@ -1,3 +1,5 @@
1
+ import { sanitizeHarnessCoverage } from "./executor/harness-coverage.js";
2
+ import { isTerminalRunCleanupStatus } from "./plane/terminal-run-status.js";
1
3
  import { monotonicNow, elapsedMs, measurePrecheck } from "./conductor/precheck-timings.js";
2
4
  import { buildLaunchPlan } from "./conductor/launch-plan.js";
3
5
  import { ticketReviewSummary } from "./ticket-review-summary.js";
@@ -73,7 +75,7 @@ import { V2_READINESS_REQUIREMENTS, buildLaunchReadinessChecks, firstLaunchEvide
73
75
  import { classifyLocalGhPreflight, probeLocalMergeCapability, } from "./conductor/local-merge.js";
74
76
  import { nodeGithubMergeCredentialReadDeps, resolveMergeCredentialAtAction, } from "./conductor/stored-merge-credential.js";
75
77
  import { resolveWorktreeSettingsExclude, } from "./executor/permissions.js";
76
- import { collectWorkerDatabaseDoctorSection, WORKER_DATABASE_DOCTOR_TIMEOUT_MS, } from "./conductor/doctor.js";
78
+ import { collectWorkerDatabaseDoctorSection, sanitizeOwnerRoles, sanitizeOwnerRoleTotal, WORKER_DATABASE_DOCTOR_TIMEOUT_MS, } from "./conductor/doctor.js";
77
79
  import { buildEpicBranchBehindBaseLaunchRow, buildHostPowerLaunchRow, buildSelfHostedRunnerLaunchRow, buildUsageResetAfterRunLaunchRow, buildWorkerDbRoleLaunchRow, hostPowerFactFromReport, workerDatabaseReadinessChecks, } from "./conductor/readiness-sections.js";
78
80
  import { createWorkflowSource, inspectEpicBranchBehindBase, inspectRequiredSelfHostedRunners, } from "./conductor/launch-need-probes.js";
79
81
  import { createWorkerDatabaseDoctorInspector } from "./conductor/worker-database-doctor-inspector.js";
@@ -1257,6 +1259,10 @@ export async function runDriveEpicCli(argv, overrides = {}) {
1257
1259
  return 1;
1258
1260
  }
1259
1261
  const { epicKey, planFile, repo, featureBranch, intoBase } = parsed.options;
1262
+ const { bridgeWorktreeCleanupAdvisory } = await import("./bridge-worktree-inspection.js");
1263
+ const cleanupAdvisory = await bridgeWorktreeCleanupAdvisory(deps.cwd());
1264
+ if (cleanupAdvisory)
1265
+ deps.errorLog(cleanupAdvisory);
1260
1266
  const launch = launchSelectionOf(parsed.options);
1261
1267
  // BAPI-1285 — the read-only preview is its own path from here. It shares the
1262
1268
  // classification and refusal builders below and none of the launch code.
@@ -1534,7 +1540,7 @@ export async function runDriveEpicCli(argv, overrides = {}) {
1534
1540
  "",
1535
1541
  "This is not something starting the runtime can fix, so nothing was started.",
1536
1542
  // The requirement's OWN remedy when it has one. Telling an operator to
1537
- // run `install-bridge conductor` for a missing consent flag sends them
1543
+ // run `install epic-implementer` for a missing consent flag sends them
1538
1544
  // to a command that cannot set it.
1539
1545
  operatorBlockedRemedy(classification),
1540
1546
  ].join("\n");
@@ -1648,7 +1654,7 @@ export async function runDriveEpicCli(argv, overrides = {}) {
1648
1654
  `${epicKey}: ${selection.reason}.`,
1649
1655
  "",
1650
1656
  "The v2 engine is not ready to drive this epic, and there is no alternative",
1651
- "engine to fall back to. Resolve Epic Implementer readiness (`install conductor`,",
1657
+ "engine to fall back to. Resolve Epic Implementer readiness (`install epic-implementer`,",
1652
1658
  "then `doctor`) and run drive-epic again.",
1653
1659
  `See ${CONSUMER_GUIDE_POINTER}.`,
1654
1660
  ].join("\n");
@@ -1965,6 +1971,15 @@ async function runSelectedSetupEpic(ctx) {
1965
1971
  const pr = skippedChildPr(evaluation.state, key);
1966
1972
  deps.log(`${epicKey}: ${confirmed ? "skipping (confirmed by you)" : "skipping already-merged child"} ${key}` +
1967
1973
  `${pr !== null ? ` (#${pr})` : ""}`);
1974
+ if (!confirmed) {
1975
+ deps.log(`already merged, will skip: ${key}${pr !== null ? ` (#${pr})` : ""}`);
1976
+ }
1977
+ }
1978
+ for (const child of evaluation.state.children) {
1979
+ if (child.classification === "probably_done" && !evaluation.skipKeys.has(child.ticket_key)) {
1980
+ const pr = skippedChildPr(evaluation.state, child.ticket_key);
1981
+ deps.log(`may already be merged; kept: ${child.ticket_key}${pr !== null ? ` (#${pr})` : ""}`);
1982
+ }
1968
1983
  }
1969
1984
  const trimmed = trimDonePlanNodes(evaluation.plan, evaluation.skipKeys);
1970
1985
  const withPath = deps.withPlanPath ?? withPlanPath;
@@ -2360,7 +2375,7 @@ function assessPlaneFreshness(reports, sleep, mode, allowStalePlane,
2360
2375
  * remedy, which never advises `plane down` for a run that is not finished.
2361
2376
  * Absent keeps `PLANE_SNAPSHOT_STALE_REMEDY` byte for byte.
2362
2377
  */
2363
- boundRun) {
2378
+ boundRun, cleanupPreview = false) {
2364
2379
  const rows = [];
2365
2380
  const blockers = [];
2366
2381
  let overridden = false;
@@ -2394,6 +2409,14 @@ boundRun) {
2394
2409
  remedy: refusal.remedy,
2395
2410
  });
2396
2411
  }
2412
+ else if (verdict === "refuse" && mode === "create" && !allowStalePlane && cleanupPreview &&
2413
+ id === PLANE_SNAPSHOT_FRESHNESS_ID && isTerminalRunCleanupStatus(boundRun?.status)) {
2414
+ rows.push({
2415
+ duration_ms, id, label, status: "warn", blocking: false,
2416
+ detail: `This create will attempt guarded cleanup — ${detail}. Create rechecks ownership and run status before teardown.`,
2417
+ remedy: refusal.remedy,
2418
+ });
2419
+ }
2397
2420
  else if (verdict === "refuse" && allowStalePlane) {
2398
2421
  overridden = true;
2399
2422
  rows.push({
@@ -3105,7 +3128,7 @@ function remoteRuntimeRefusal(epicKey, access, readiness) {
3105
3128
  function durableCoverageRefusal(epicKey, access, profile, coverage, outcome) {
3106
3129
  const remedy = [
3107
3130
  "Start the durable host's executor with --repo-wide",
3108
- " (`install conductor --execution-mode durable --executor-id <id> --repo-wide`; see `drive-epic --help-advanced`),",
3131
+ " (`install epic-implementer --execution-mode durable --executor-id <id> --repo-wide`; see `drive-epic --help-advanced`),",
3109
3132
  "or launch without the durable profile.",
3110
3133
  ].join("\n");
3111
3134
  return {
@@ -3507,7 +3530,7 @@ function nonBridgeRows(ids) {
3507
3530
  });
3508
3531
  }
3509
3532
  /** BAPI-1452 — project launch rows into the stable preview shape. */
3510
- function previewLaunchRows(checks) {
3533
+ export function previewLaunchRows(checks) {
3511
3534
  return checks.map((check) => {
3512
3535
  const started = monotonicNow();
3513
3536
  return {
@@ -3518,9 +3541,21 @@ function previewLaunchRows(checks) {
3518
3541
  blocking: check.blocking,
3519
3542
  ...(check.detail ? { detail: check.detail } : {}),
3520
3543
  ...(check.remediation ? { remedy: check.remediation } : {}),
3544
+ ...harnessOwnerMetadata(check),
3521
3545
  };
3522
3546
  });
3523
3547
  }
3548
+ /** BAPI-1558 — carry typed owner roles through the allowlist, for the harness row only, revalidated. */
3549
+ function harnessOwnerMetadata(check) {
3550
+ if (check.id !== "worker-db-harness")
3551
+ return {};
3552
+ const roles = sanitizeOwnerRoles(check.owner_roles);
3553
+ const coverage = sanitizeHarnessCoverage(check.harness_coverage);
3554
+ return {
3555
+ ...(roles.length > 0 ? { owner_roles: roles, owner_role_total: sanitizeOwnerRoleTotal(check.owner_role_total, roles.length) } : {}),
3556
+ ...(coverage ? { harness_coverage: coverage } : {}),
3557
+ };
3558
+ }
3524
3559
  /** The readiness reason a preview reports for a generic not-ready engine. */
3525
3560
  const ENGINE_NOT_READY_REASON_ID = "engine-not-ready";
3526
3561
  const ENGINE_NOT_READY_REMEDY = `Resolve Epic Implementer readiness (\`${PRINTED_CONDUCTOR_INSTALL_COMMAND}\`, then \`${PRINTED_DOCTOR_COMMAND}\`) and run drive-epic again. ${PRINTED_CHECK_NAME_INSTRUCTION} See ${CONSUMER_GUIDE_POINTER}.`;
@@ -4400,7 +4435,7 @@ async function applyPreviewFreshness(ctx, preview, topology, coldStart) {
4400
4435
  const sleep = preview.decision === "attach" ? await collectHostSleep(ctx, own.repoRoot) : null;
4401
4436
  // Read-only: one run-state read, local plane only, and only for a bound plane.
4402
4437
  const boundRun = await boundRunForStaleRemedy(ctx, own, reports);
4403
- const assessment = assessPlaneFreshness(reports, sleep, preview.decision === "create" ? "create" : "attach", ctx.options.allowStalePlane === true, boundRun);
4438
+ const assessment = assessPlaneFreshness(reports, sleep, preview.decision === "create" ? "create" : "attach", ctx.options.allowStalePlane === true, boundRun, true);
4404
4439
  if (assessment.rows.length > 0) {
4405
4440
  preview.launch_checks = [...(preview.launch_checks ?? []), ...assessment.rows];
4406
4441
  }
@@ -4516,7 +4551,7 @@ const UNKNOWN_REASON_TEXT = {
4516
4551
  const NOT_CHECKED_TEXT = {
4517
4552
  disabled: "Merged check: turned off (--no-merged-check). Every child will run.",
4518
4553
  attach: "Merged check: not applied; existing runs are unchanged.",
4519
- cold_start: "Merged check: will be checked at create.",
4554
+ cold_start: "Merged check: will be checked at create. Already-merged children will be skipped; pass --keep-child <KEY> to keep one.",
4520
4555
  cut_commit_unavailable: "Merged check: the indexed commit could not be read. Every child will run.",
4521
4556
  check_failed: "Merged check: could not complete. Every child will run.",
4522
4557
  no_plan: null,
@@ -4526,7 +4561,7 @@ const NOT_CHECKED_TEXT = {
4526
4561
  * children to run and skipped, then the groups in a fixed order. Meaning is carried
4527
4562
  * by words, never colour; only customer ticket keys and validated PR numbers appear.
4528
4563
  */
4529
- function alreadyDoneLines(preview) {
4564
+ export function alreadyDoneLines(preview) {
4530
4565
  const s = preview.summary;
4531
4566
  const state = preview.already_done_children ?? { status: "not_checked", reason: "no_plan", children: [] };
4532
4567
  const lines = [];
@@ -4552,8 +4587,14 @@ function alreadyDoneLines(preview) {
4552
4587
  : "";
4553
4588
  if (skipped.length > 0) {
4554
4589
  lines.push(" Skipped (already merged):");
4555
- for (const child of skipped) {
4556
- lines.push(` ${child.ticket_key}${pr(child)} — ${child.classification === "done" ? "already merged" : "confirmed skip"}`);
4590
+ const confirmedMerged = skipped.filter((child) => child.classification === "done");
4591
+ for (const child of confirmedMerged) {
4592
+ lines.push(` already merged, will skip: ${child.ticket_key}${pr(child)}`);
4593
+ }
4594
+ if (confirmedMerged.length > 0)
4595
+ lines.push(" To keep one, pass --keep-child <KEY>.");
4596
+ for (const child of skipped.filter((entry) => entry.classification !== "done")) {
4597
+ lines.push(` ${child.ticket_key}${pr(child)} — confirmed skip`);
4557
4598
  }
4558
4599
  }
4559
4600
  const probably = state.children.filter((child) => child.classification === "probably_done" && !child.will_skip);