@bridge_gpt/mcp-server 0.2.67 → 0.2.68

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 (114) hide show
  1. package/README.md +178 -15
  2. package/build/agent-launchers/claude-executor-adapter.js +27 -0
  3. package/build/agents.generated.js +22 -2
  4. package/build/bitbucket-workspace-remote.js +136 -0
  5. package/build/bootstrap-project-identity.js +24 -0
  6. package/build/bridge-permissions.js +829 -0
  7. package/build/claude-settings.js +18 -0
  8. package/build/cli-help.js +21 -0
  9. package/build/command-assets-doctor.js +24 -70
  10. package/build/command-provisioning.js +29 -5
  11. package/build/commands.generated.js +8 -8
  12. package/build/conductor/bridge-api-client.js +714 -0
  13. package/build/conductor/command-drift-production.js +92 -0
  14. package/build/conductor/command-drift.js +89 -0
  15. package/build/conductor/doctor.js +69 -26
  16. package/build/conductor/epic-branch-ci-inspection.js +1375 -0
  17. package/build/conductor/epic-implementer-cli.js +76 -22
  18. package/build/conductor/gate-discovery.js +890 -0
  19. package/build/conductor/install-doctor.js +15 -3
  20. package/build/conductor/json-output.js +63 -0
  21. package/build/conductor/readiness-cli.js +95 -10
  22. package/build/conductor/readiness-sections.js +369 -3
  23. package/build/conductor/readiness.js +211 -8
  24. package/build/conductor/recovery-cli.js +110 -4
  25. package/build/conductor/recovery-operations.js +99 -1
  26. package/build/connect-bitbucket-api.js +41 -6
  27. package/build/connect-bitbucket.js +106 -33
  28. package/build/credential-store.js +207 -47
  29. package/build/docs.generated.js +57 -3
  30. package/build/doctor.js +92 -1
  31. package/build/drive-epic.js +45 -8
  32. package/build/epic-coherence-input.test-fixtures.js +4 -3
  33. package/build/epic-implementer-bin.js +1374 -25
  34. package/build/epic-workarounds-path.js +39 -0
  35. package/build/executor/cli.js +30 -0
  36. package/build/executor/completion-contract.js +18 -5
  37. package/build/executor/deps.js +4 -1
  38. package/build/executor/gate-qualification-job.js +499 -0
  39. package/build/executor/guarded-fast-forward-push.js +129 -0
  40. package/build/executor/integration-job.js +122 -8
  41. package/build/executor/job-errors.js +8 -1
  42. package/build/executor/job-runner.js +589 -47
  43. package/build/executor/likely-tests.js +290 -0
  44. package/build/executor/live-worker-registry.js +1 -1
  45. package/build/executor/observation.js +31 -2
  46. package/build/executor/packaged-recipe.js +106 -0
  47. package/build/executor/permissions.js +115 -28
  48. package/build/executor/platform.js +1 -1
  49. package/build/executor/preflight.js +61 -12
  50. package/build/executor/process-containment.js +36 -12
  51. package/build/executor/process.js +15 -7
  52. package/build/executor/prompt-spec.js +33 -1
  53. package/build/executor/recently-failed-tests-file.js +71 -0
  54. package/build/executor/reconcile-overlap-job.js +41 -23
  55. package/build/executor/required-verification.js +1 -1
  56. package/build/executor/required-work-ledger.js +105 -17
  57. package/build/executor/retirement.js +69 -0
  58. package/build/executor/runner.js +114 -11
  59. package/build/executor/test-clock.js +15 -0
  60. package/build/executor/types.js +32 -0
  61. package/build/executor/viewer-tabs.js +58 -8
  62. package/build/executor/worker-command.js +23 -7
  63. package/build/executor/worker-diagnostics.js +37 -0
  64. package/build/executor/worker-finalization.js +31 -5
  65. package/build/executor/worker-guard-hook.js +179 -25
  66. package/build/executor/worker-log.js +4 -3
  67. package/build/executor/worker-verification-guidance.js +37 -0
  68. package/build/executor/worktree.js +88 -11
  69. package/build/first-build-advisory.js +97 -0
  70. package/build/generated-assets-advisory.js +14 -0
  71. package/build/generated-assets-catalog.js +66 -0
  72. package/build/generated-assets-context.js +46 -0
  73. package/build/generated-assets-dependencies.js +26 -0
  74. package/build/generated-assets-doctor.js +50 -0
  75. package/build/generated-assets-health.js +65 -0
  76. package/build/generated-assets-host.js +17 -0
  77. package/build/generated-assets-inventory.js +17 -0
  78. package/build/generated-assets-paths.js +60 -0
  79. package/build/generated-assets-publisher.js +133 -0
  80. package/build/generated-assets-remedy.js +25 -0
  81. package/build/generated-assets-repair.js +72 -0
  82. package/build/generated-assets-session.js +71 -0
  83. package/build/generated-assets-test-support.js +35 -0
  84. package/build/index.js +964 -768
  85. package/build/init.js +54 -177
  86. package/build/install-bridge-conductor-gate.js +1372 -0
  87. package/build/install-bridge-conductor.js +289 -36
  88. package/build/install-bridge.js +544 -37
  89. package/build/mcp-install-state.js +50 -4
  90. package/build/merge-workflow-install.js +3 -4
  91. package/build/pipeline-utils.js +6 -2
  92. package/build/pipelines.generated.js +22 -142
  93. package/build/plan-execution-ledger.js +2 -32
  94. package/build/plane/manifest.js +16 -1
  95. package/build/plane/preflight.js +54 -1
  96. package/build/printed-remedy-commands.js +16 -1
  97. package/build/readme.generated.js +1 -1
  98. package/build/repair-assets.js +93 -0
  99. package/build/run-unit-tests-launcher.js +130 -49
  100. package/build/secret-redaction.js +33 -0
  101. package/build/setup-epic.js +108 -3
  102. package/build/start-tickets-prereqs.js +70 -16
  103. package/build/start-tickets.js +29 -5
  104. package/build/tool-surface-gating.js +36 -0
  105. package/build/upgrade-cli.js +55 -1
  106. package/build/version.generated.js +3 -3
  107. package/build/worker-guard-hook-bin.js +3 -2
  108. package/build/worker-guard-hook-main.js +1 -1
  109. package/build/worktree-core.js +15 -2
  110. package/docs/EPIC-IMPLEMENTER-INSTALL.md +30 -12
  111. package/docs/EPIC-IMPLEMENTER.md +68 -2
  112. package/package.json +3 -3
  113. package/pipelines/greenfield-setup.json +4 -128
  114. package/pipelines/implement-ticket.json +3 -2
package/build/doctor.js CHANGED
@@ -1,3 +1,6 @@
1
+ import { formatGitCompatibilityDiagnostic } from "./start-tickets-prereqs.js";
2
+ import { constants as assetFsConstants } from "node:fs";
3
+ import { collectPackagedAssetDoctor } from "./generated-assets-doctor.js";
1
4
  /**
2
5
  * doctor — a strictly read-only, detect-and-instruct diagnostics subcommand for
3
6
  * the packaged `start-tickets` automation (BAPI-305).
@@ -19,7 +22,7 @@
19
22
  * reach a mutating lifecycle verb — `enable-linger`, `bootstrap`, `start` and
20
23
  * their kin exist in this file only as remediation TEXT the operator runs.
21
24
  */
22
- import { readdir, readFile, stat } from "fs/promises";
25
+ import { readdir, readFile, stat, lstat, access, realpath } from "fs/promises";
23
26
  import { spawn } from "child_process";
24
27
  import os from "os";
25
28
  import path from "path";
@@ -54,6 +57,7 @@ import { validateBranchName } from "./base-ref.js";
54
57
  import { readPlaneManifest } from "./plane/manifest.js";
55
58
  import { validateTicketKey } from "./ticket-key-utils.js";
56
59
  import { resolveBranchForTicket } from "./worktree-core.js";
60
+ import { BRIDGE_PERMISSIONS_MANIFEST_RELPATH, inspectBridgePermissions, } from "./bridge-permissions.js";
57
61
  import { diagnoseStaleWorktreeBranches, formatStaleWorktreeDiagnosticReport, } from "./stale-worktree-doctor.js";
58
62
  /**
59
63
  * The report/usage title (BAPI-669, U9b). `doctor` diagnoses the whole Bridge
@@ -76,6 +80,7 @@ export function getDoctorUsage() {
76
80
  `${DOCTOR_REPORT_TITLE}. It only checks your environment and prints manual`,
77
81
  "install instructions — it does not install anything, modify your system, or",
78
82
  "start the MCP server.",
83
+ "Git presence remains a prerequisite; Git-version compatibility is advisory-only.",
79
84
  "",
80
85
  "Flags:",
81
86
  " --agent claude|cursor-agent|codex Agent to include in the prerequisite check (default: claude)",
@@ -159,6 +164,13 @@ export function getDoctorUsage() {
159
164
  "It reads no install-state file, writes nothing, runs no launchctl/systemctl, and",
160
165
  "is advisory: missing, malformed, or credential-less units never change the exit code.",
161
166
  "",
167
+ "It also includes an advisory '/drive-epic-run permission rules' section",
168
+ "(BAPI-1398): whether the project permissions.allow rules and the optional user",
169
+ "autoMode entries that install writes are PRESENT, MISSING, or DRIFTED (for",
170
+ "example after the BAPI_MCP_CLI launcher changed). It reads .claude/settings.local.json,",
171
+ "~/.claude/settings.json, and .bridge/bridge-permissions.json, writes nothing,",
172
+ "and never changes the exit code.",
173
+ "",
162
174
  "Conductor ledger / native-module diagnostics (the SQLite ledger's native",
163
175
  "binding load status and Node-version skew) live under a separate command:",
164
176
  " epic-implementer doctor",
@@ -363,6 +375,7 @@ export async function collectDoctorResults(deps, agentName) {
363
375
  const injected = deps;
364
376
  const probeDeps = {
365
377
  ...deps,
378
+ commandAssetMetadata: injected.commandAssetMetadata ?? { lstat, access: p => access(p, assetFsConstants.R_OK) },
366
379
  readFile: injected.readFile ?? ((p) => readFile(p, "utf-8")),
367
380
  stat: injected.stat ?? ((p) => stat(p)),
368
381
  homedir: injected.homedir ?? os.homedir,
@@ -412,6 +425,10 @@ export function formatDoctorPrereqSection(platform, collection) {
412
425
  return lines.join("\n");
413
426
  }
414
427
  for (const result of collection.results) {
428
+ if (result.gitCompatibility) {
429
+ lines.push(formatGitCompatibilityDiagnostic(result.gitCompatibility));
430
+ continue;
431
+ }
415
432
  const status = result.found ? "FOUND " : "MISSING";
416
433
  // Missing-detail stays suppressed for every prerequisite EXCEPT one that has
417
434
  // been explicitly audited (BAPI-727, `renderDetailWhenMissing`). The general
@@ -1679,6 +1696,55 @@ export function formatOperationalAdvisoryReport(diagnostic) {
1679
1696
  lines.push(" runs NO command probe, repairs no scheduler, and never changes the exit code.");
1680
1697
  return lines.join("\n");
1681
1698
  }
1699
+ /** Collect the permission-rules inspection. Reads only; never writes. */
1700
+ export async function collectBridgePermissionsDiagnostic(deps) {
1701
+ return inspectBridgePermissions({ cwd: deps.cwd, homeDir: deps.homeDir, env: deps.env }, { readFile: deps.readFile });
1702
+ }
1703
+ function formatPermissionScope(label, scope, optionalNote) {
1704
+ switch (scope.state) {
1705
+ case "present":
1706
+ return [`PRESENT ${label} — all ${scope.count} Bridge entries in ${scope.path}`];
1707
+ case "missing":
1708
+ return [
1709
+ `MISSING ${label} — ${scope.missing.length} Bridge entr${scope.missing.length === 1 ? "y is" : "ies are"} absent from ${scope.path}`,
1710
+ ...(optionalNote ? [` ${optionalNote}`] : []),
1711
+ ];
1712
+ case "drifted":
1713
+ return [
1714
+ `DRIFTED ${label} — ${scope.reason} (${scope.path})`,
1715
+ ...(scope.missing.length > 0 ? [` ${scope.missing.length} current rule(s) missing.`] : []),
1716
+ ...(scope.stale.length > 0 ? [` ${scope.stale.length} rule(s) Bridge wrote earlier no longer match.`] : []),
1717
+ ];
1718
+ case "malformed":
1719
+ return [`MALFORMED ${label} — ${scope.path} is not valid JSON settings; doctor did not change it.`];
1720
+ }
1721
+ }
1722
+ /** Render the permission-rules section (pure formatting, secret-free). */
1723
+ export function formatBridgePermissionsDiagnosticReport(inspection) {
1724
+ const lines = ["", "/drive-epic-run permission rules (auto mode)", ""];
1725
+ if (inspection.launcher.ok) {
1726
+ lines.push(`Launcher prefix: ${inspection.launcher.prefix}`);
1727
+ if (inspection.recordedLauncher && inspection.recordedLauncher !== inspection.launcher.prefix) {
1728
+ lines.push(` Rules were written for a different launcher: ${inspection.recordedLauncher}`);
1729
+ }
1730
+ }
1731
+ if (inspection.project.state === "launcher-refused") {
1732
+ lines.push("REFUSED project permissions.allow — the launcher override cannot be matched by an exact rule.");
1733
+ if (!inspection.launcher.ok)
1734
+ lines.push(` ${inspection.launcher.reason}.`);
1735
+ }
1736
+ else {
1737
+ lines.push(...formatPermissionScope("project permissions.allow", inspection.project));
1738
+ }
1739
+ lines.push(...formatPermissionScope("user autoMode entries", inspection.user, "Optional: install adds them only after you say yes."));
1740
+ const healthy = inspection.project.state === "present" && inspection.user.state === "present";
1741
+ if (!healthy) {
1742
+ lines.push(` To repair: re-run \`npx -y ${MCP_PACKAGE_NAME} install\` in a terminal (it lists every rule it writes).`);
1743
+ lines.push(` To remove Bridge's entries: \`npx -y ${MCP_PACKAGE_NAME} install --remove-bridge-permissions\`.`);
1744
+ }
1745
+ lines.push(` Bridge's ownership record: ${BRIDGE_PERMISSIONS_MANIFEST_RELPATH}. Advisory only; never changes the exit code.`);
1746
+ return lines.join("\n");
1747
+ }
1682
1748
  /**
1683
1749
  * Read-only inventory of this host's epic-launch profiles and whether each
1684
1750
  * one's credential binding matches its target. It reports; it never binds or
@@ -1886,6 +1952,13 @@ export async function runDoctorCli(argv, overrides = {}) {
1886
1952
  const preference = await readModelRoutingPreference(deps.env.BAPI_REPO_NAME ?? "_doctor_unscoped_", "review_ticket", preferencePath);
1887
1953
  log(`Personal model routing preference: ${preference.warning ?? preference.source}.`);
1888
1954
  log(formatDoctorPrereqSection(deps.platform, collection));
1955
+ if (overrides.packagedAssets !== false) {
1956
+ const injected = overrides.packagedAssets ?? {};
1957
+ log(await collectPackagedAssetDoctor({ cwd: injected.cwd ?? deps.cwd,
1958
+ readFile: injected.readFile ?? deps.readFile ?? (p => readFile(p, "utf-8")),
1959
+ lstat: injected.lstat ?? lstat, access: injected.access ?? (p => access(p, assetFsConstants.R_OK)), realpath: injected.realpath ?? realpath,
1960
+ platform: deps.platform }));
1961
+ }
1889
1962
  // Executor-adapter section (BAPI-781). Advisory with respect to the EXIT CODE
1890
1963
  // — an unusable adapter is reported loudly but does not change doctor's
1891
1964
  // pass/fail, which stays driven by the start-tickets prerequisites this
@@ -1972,6 +2045,24 @@ export async function runDoctorCli(argv, overrides = {}) {
1972
2045
  /* local-launcher diagnostics are advisory; never block the doctor report */
1973
2046
  }
1974
2047
  }
2048
+ // BAPI-1398 /drive-epic-run permission-rules section. Strictly read-only (two
2049
+ // settings files and Bridge's manifest; no command, no network), and advisory:
2050
+ // it never changes the exit code.
2051
+ if (overrides.bridgePermissions !== false) {
2052
+ try {
2053
+ const injected = deps;
2054
+ const permissionDeps = {
2055
+ cwd: overrides.bridgePermissions?.cwd ?? deps.cwd,
2056
+ homeDir: overrides.bridgePermissions?.homeDir ?? (injected.homedir ?? os.homedir)(),
2057
+ env: overrides.bridgePermissions?.env ?? deps.env,
2058
+ readFile: overrides.bridgePermissions?.readFile ?? injected.readFile ?? ((p) => readFile(p, "utf-8")),
2059
+ };
2060
+ log(formatBridgePermissionsDiagnosticReport(await collectBridgePermissionsDiagnostic(permissionDeps)));
2061
+ }
2062
+ catch {
2063
+ /* permission-rule diagnostics are advisory; never block the doctor report */
2064
+ }
2065
+ }
1975
2066
  // Worker containment advisory section (BAPI-1019/A.7). Placed beside the other
1976
2067
  // advisory sections and, uniquely, issuing NO probe of any kind — no command,
1977
2068
  // no file read, no network call. That is what keeps doctor's "an unsupported
@@ -55,13 +55,14 @@
55
55
  */
56
56
  import { readdir, readFile } from "node:fs/promises";
57
57
  import path, { dirname, join } from "node:path";
58
- import { CONDUCTOR_DEFAULT_BASE_URL, ConductorBridgeApiError, resolveEpicLaunchBridgeApiAccess, fetchConductorReadiness, fetchEpicRunState, safeDiagnosticMessage, } from "./conductor/bridge-api-client.js";
58
+ import { CONDUCTOR_DEFAULT_BASE_URL, ConductorBridgeApiError, resolveEpicLaunchBridgeApiAccess, fetchConductorReadiness, fetchEpicRunState, gateProfileWaivesCiWorkflow, safeDiagnosticMessage, } from "./conductor/bridge-api-client.js";
59
59
  import { EPIC_LAUNCH_PROFILE_NAME_PATTERN, epicLaunchPolicyDigest, pinEpicLaunchPolicy, renderEpicLaunchCommand, resolveEpicLaunchSelection, shellQuote, } from "./epic-launch-profile.js";
60
60
  import { validateHttpBaseUrl, describeBaseUrlRejection } from "./base-url.js";
61
61
  import { BRING_UP_REFUSAL_MESSAGES, BRING_UP_RUNBOOK, firstBringUpRefusal, } from "./conductor/bring-up-facts.js";
62
62
  import { repositoryWorkflowRemedy } from "./conductor/repository-workflow-remedy.js";
63
- import { policyDeclaresNotifyWebhook, effectivePolicyFacts, readSetupEpicPolicyFile, runSetupEpicWorkflow, } from "./setup-epic.js";
63
+ import { policyDeclaresNotifyWebhook, policyNotifyDestinationsConflict, notifyDestinationsConflictMessage, effectivePolicyFacts, readSetupEpicPolicyFile, runSetupEpicWorkflow, } from "./setup-epic.js";
64
64
  import { EPIC_KEY_PATTERN } from "./drive-epic-key.js";
65
+ import { flushProcessStdout, writeJsonDocument } from "./conductor/json-output.js";
65
66
  import { discoverEpicPlan, } from "./plan-discovery.js";
66
67
  import { formatPlaneDiagnostic, launchPlaneControlPlane, requestPlaneScopedLanes, runDefaultPlanePreflight, runPlaneCli, } from "./plane/cli.js";
67
68
  import { PLANE_PORT_PROBE_TIMEOUT_MS, describePlanePortOccupant, } from "./plane/preflight.js";
@@ -183,7 +184,14 @@ export const V2_READINESS_REQUIREMENTS = [
183
184
  // fixed install-command sentence that stood here could never clear a missing
184
185
  // migration-guard job — no install step creates one — so it is gone from this
185
186
  // refusal.
186
- remedyFor: (r) => repositoryWorkflowRemedy(r),
187
+ //
188
+ // BAPI-1390: the server decides which files are required (the review file
189
+ // only for a `verdict_protocol` run; the CI lane file only for a repository
190
+ // with no STORED gate profile and no `no_ci_gate`), and `satisfied` reads that
191
+ // decision as given. The remedy waives the CI file the same way, so a stored
192
+ // profile is never told to add a file it does not need. Gate-profile WARNINGS
193
+ // (epic-branch rows) are not requirements and are never read here.
194
+ remedyFor: (r) => repositoryWorkflowRemedy(gateProfileWaivesCiWorkflow(r) ? { ...r, conductor_ci_workflow: null } : r),
187
195
  satisfied: (r) => r.unattended?.repository_readiness_confirmed === true,
188
196
  },
189
197
  // BAPI-1135 — merge-execution eligibility is deliberately NOT a requirement here.
@@ -1242,6 +1250,7 @@ export function createDefaultDriveEpicDeps() {
1242
1250
  // construction, so nothing has claimed stdout for the protocol transport.
1243
1251
  log: (message) => console.log(message),
1244
1252
  errorLog: (message) => console.error(message),
1253
+ flushStdout: flushProcessStdout,
1245
1254
  };
1246
1255
  }
1247
1256
  /**
@@ -1787,6 +1796,21 @@ async function checkPlaneAdmission(ctx, readiness, manifest) {
1787
1796
  */
1788
1797
  async function coldStartPlane(ctx) {
1789
1798
  const { deps, epicKey } = ctx;
1799
+ // BAPI-1397 (F1): a policy the server would reject for its notify destinations
1800
+ // is refused BEFORE the plane preflight and `plane up`, naming its file. The
1801
+ // same predicate setup-epic applies; a cold start has no live run, so the
1802
+ // selected file is the explicit one or the profile's, as in
1803
+ // `prepareSetupSelection`. An unreadable file is left to that function.
1804
+ const coldPolicyPath = ctx.options.policyFile ?? ctx.profile?.policyRef?.path;
1805
+ if (coldPolicyPath !== undefined) {
1806
+ const read = await readSetupEpicPolicyFile(coldPolicyPath, (filePath) => deps.readPolicyFile(filePath));
1807
+ if (read.ok && policyNotifyDestinationsConflict(read.policy)) {
1808
+ return refuse(deps, [
1809
+ `${epicKey}: REFUSED (policy-notify-conflict) — ` +
1810
+ notifyDestinationsConflictMessage(coldPolicyPath, ctx.options.policyFile !== undefined ? "explicit" : "profile"),
1811
+ ]);
1812
+ }
1813
+ }
1790
1814
  // The cold start leaves the readiness `catch` before the ordinary advisory
1791
1815
  // read is reached, so it surfaces the BAPI-1022 containment advisory itself —
1792
1816
  // before anything is started, exactly as every other plan-file route does.
@@ -2656,7 +2680,11 @@ async function runDriveEpicPreview(deps, options) {
2656
2680
  });
2657
2681
  }
2658
2682
  ensureRefusalExplained(preview);
2659
- emitPreview(deps, options, preview);
2683
+ const emitted = await emitPreview(deps, options, preview);
2684
+ // BAPI-1397 (F3): a `--json` document that could not reach stdout whole is a
2685
+ // failed preview, never a silently truncated one.
2686
+ if (!emitted)
2687
+ return 1;
2660
2688
  return preview.decision === "create" || preview.decision === "attach" ? 0 : 1;
2661
2689
  }
2662
2690
  /** The fixed explanation used when a refusal reached the end with none of its own. */
@@ -2986,11 +3014,19 @@ async function previewExecutorFacts(ctx, readiness, planeTarget, live, outcome)
2986
3014
  ? null
2987
3015
  : executorPreconditionRefusal(epicKey, inspected.message, outcome === "No run was created" ? "No run was created." : "No run was changed.");
2988
3016
  }
2989
- /** Print the preview: one JSON line with `--json`, short readable lines otherwise. */
2990
- function emitPreview(deps, options, preview) {
3017
+ /**
3018
+ * Print the preview: one JSON line with `--json`, short readable lines otherwise.
3019
+ *
3020
+ * BAPI-1397 (F3): the `--json` document goes through the shared CLI writer, which
3021
+ * waits for a piped stdout to drain before the exit code is returned. Resolves
3022
+ * `false` only when that document could not be written whole.
3023
+ */
3024
+ async function emitPreview(deps, options, preview) {
2991
3025
  if (options.json === true) {
2992
- deps.log(JSON.stringify(preview));
2993
- return;
3026
+ return writeJsonDocument(JSON.stringify(preview), {
3027
+ log: deps.log,
3028
+ flush: deps.flushStdout ?? (async () => true),
3029
+ });
2994
3030
  }
2995
3031
  const lines = [
2996
3032
  `${preview.epic_key}: launch preview (read-only; nothing was created or started)`,
@@ -3018,4 +3054,5 @@ function emitPreview(deps, options, preview) {
3018
3054
  lines.push(` Refusal: ${preview.refusal.reason_id} — ${preview.refusal.remedy}`);
3019
3055
  }
3020
3056
  deps.log(lines.join("\n"));
3057
+ return true;
3021
3058
  }
@@ -14,7 +14,7 @@ export function memoryRepo(files, options = {}) {
14
14
  const contents = new Map();
15
15
  for (const [rel, body] of Object.entries(files))
16
16
  contents.set(path.join(ROOT, rel), body);
17
- const dirs = new Set([path.sep, ROOT]);
17
+ const dirs = new Set([path.parse(ROOT).root, ROOT]);
18
18
  const addDirs = (abs) => {
19
19
  let dir = path.dirname(abs);
20
20
  while (!dirs.has(dir)) {
@@ -33,8 +33,9 @@ export function memoryRepo(files, options = {}) {
33
33
  const repo = { fs: undefined, files: contents, writes: [], reads: [], realpaths: [] };
34
34
  const missing = (p) => Object.assign(new Error(`ENOENT: ${p}`), { code: "ENOENT" });
35
35
  const resolveLinks = (p) => {
36
- const parts = p.split(path.sep).filter(Boolean);
37
- let current = path.sep;
36
+ const root = path.parse(p).root;
37
+ const parts = p.slice(root.length).split(path.sep).filter(Boolean);
38
+ let current = root;
38
39
  for (const part of parts) {
39
40
  current = path.join(current, part);
40
41
  const target = symlinks.get(current);