@bridge_gpt/mcp-server 0.2.70 → 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 (134) hide show
  1. package/README.md +55 -17
  2. package/build/agent-launchers/claude-executor-adapter.js +29 -4
  3. package/build/agent-notes.js +171 -95
  4. package/build/agent-registry.js +5 -5
  5. package/build/agents.generated.js +12 -2
  6. package/build/bounded-wait.js +9 -1
  7. package/build/bridge-permissions.js +17 -5
  8. package/build/bridge-worktree-inspection.js +237 -0
  9. package/build/check-evidence.js +6 -0
  10. package/build/claude-review-workflow.js +1 -1
  11. package/build/cli-help.js +6 -0
  12. package/build/codex-auto-recovery.js +126 -0
  13. package/build/codex-skill-adapter.js +2 -0
  14. package/build/commands.generated.js +5 -5
  15. package/build/conductor/bridge-api-client.js +776 -23
  16. package/build/conductor/command-drift-production.js +7 -2
  17. package/build/conductor/doctor.js +93 -13
  18. package/build/conductor/epic-implementer-cli.js +55 -2
  19. package/build/conductor/gate-discovery.js +659 -19
  20. package/build/conductor/gate-settings-review.js +751 -0
  21. package/build/conductor/git-hooks-uninstall.js +112 -0
  22. package/build/conductor/git-hooks.js +81 -15
  23. package/build/conductor/guided-repair.js +10 -1
  24. package/build/conductor/install-doctor.js +2 -4
  25. package/build/conductor/launch-need-probes.js +16 -11
  26. package/build/conductor/launch-plan.js +185 -0
  27. package/build/conductor/local-merge.js +12 -1
  28. package/build/conductor/merge-execution-contract.js +1 -1
  29. package/build/conductor/merged-child-check.js +2 -1
  30. package/build/conductor/precheck-timings.js +14 -0
  31. package/build/conductor/prerequisite-inputs.js +379 -0
  32. package/build/conductor/preview-observations.js +10 -0
  33. package/build/conductor/readiness-assessment.js +78 -0
  34. package/build/conductor/readiness-cli.js +10 -0
  35. package/build/conductor/readiness-prerequisites.js +53 -0
  36. package/build/conductor/readiness-sections.js +25 -9
  37. package/build/conductor/readiness.js +20 -2
  38. package/build/conductor/recovery-cli.js +281 -14
  39. package/build/conductor/recovery-operations.js +78 -5
  40. package/build/conductor/repair-contract.js +33 -0
  41. package/build/conductor/tools.js +34 -3
  42. package/build/conductor/wait-run-attention.js +115 -0
  43. package/build/conductor/wait-run-cli.js +96 -3
  44. package/build/conductor/worker-database-doctor-inspector.js +1 -0
  45. package/build/credential-store.js +25 -20
  46. package/build/dependency-install-declarations.js +157 -0
  47. package/build/docs.generated.js +4 -4
  48. package/build/doctor.js +37 -5
  49. package/build/drive-epic-help.js +2 -2
  50. package/build/drive-epic.js +240 -56
  51. package/build/epic-ci-workflow-drift.js +71 -23
  52. package/build/epic-ci-workflow-install.js +83 -26
  53. package/build/epic-ci-workflow-v1.js +132 -0
  54. package/build/epic-ci-workflow.js +174 -13
  55. package/build/epic-implementer-bin.js +119 -44
  56. package/build/epic-launch-profile.js +1 -1
  57. package/build/executor/ci-rerun-job.js +220 -14
  58. package/build/executor/cli.js +2 -0
  59. package/build/executor/completion-contract.js +16 -0
  60. package/build/executor/credentials.js +1 -1
  61. package/build/executor/delivery-observations.js +113 -0
  62. package/build/executor/delivery-outcome.js +30 -0
  63. package/build/executor/dependency-refresh-runner.js +132 -0
  64. package/build/executor/dependency-refresh.js +530 -0
  65. package/build/executor/deps.js +4 -0
  66. package/build/executor/env.js +274 -5
  67. package/build/executor/gate-qualification-job.js +20 -5
  68. package/build/executor/harness-coverage.js +19 -0
  69. package/build/executor/http-client.js +35 -1
  70. package/build/executor/index.js +2 -1
  71. package/build/executor/install-preflight.js +1 -1
  72. package/build/executor/job-runner.js +355 -36
  73. package/build/executor/likely-tests.js +100 -98
  74. package/build/executor/preflight.js +5 -0
  75. package/build/executor/process-containment.js +18 -0
  76. package/build/executor/prompt-spec.js +84 -15
  77. package/build/executor/reconcile-overlap-job.js +6 -1
  78. package/build/executor/required-verification.js +28 -0
  79. package/build/executor/required-work-diagnostics.js +30 -0
  80. package/build/executor/required-work-ledger.js +19 -1
  81. package/build/executor/results.js +42 -0
  82. package/build/executor/service-discovery.js +42 -0
  83. package/build/executor/service-lifecycle.js +109 -2
  84. package/build/executor/service-uninstall.js +205 -0
  85. package/build/executor/service-unit.js +5 -3
  86. package/build/executor/test-clock.js +3 -0
  87. package/build/executor/verification-hints.js +179 -0
  88. package/build/executor/worker-command.js +188 -1
  89. package/build/executor/worker-database.js +299 -40
  90. package/build/executor/worker-finalization.js +65 -10
  91. package/build/executor/worker-guard-hook.js +10 -2
  92. package/build/executor/worker-resources.js +12 -1
  93. package/build/executor/worker-verification-guidance.js +64 -0
  94. package/build/executor/worktree-inspection.js +42 -0
  95. package/build/github-sign-in.js +1 -1
  96. package/build/index.js +767 -310
  97. package/build/init.js +3 -3
  98. package/build/install-bridge-conductor-gate.js +416 -41
  99. package/build/install-bridge-conductor-setup.js +135 -32
  100. package/build/install-bridge-conductor.js +769 -353
  101. package/build/install-bridge.js +419 -124
  102. package/build/install-maintenance.js +104 -0
  103. package/build/install-reexec.js +1 -1
  104. package/build/local-cleanup.js +59 -0
  105. package/build/mcp-install-state.js +68 -2
  106. package/build/merge-workflow-install.js +22 -2
  107. package/build/package-script-semantics.js +10 -0
  108. package/build/pipeline-utils.js +1 -1
  109. package/build/pipelines.generated.js +6 -6
  110. package/build/plan-execution-ledger.js +171 -10
  111. package/build/plane/plane-freshness.js +12 -9
  112. package/build/plane/preflight.js +19 -0
  113. package/build/plane/terminal-run-cleanup.js +5 -1
  114. package/build/plane/terminal-run-status.js +4 -0
  115. package/build/printed-remedy-commands.js +31 -4
  116. package/build/readiness-check.js +1 -78
  117. package/build/readiness-prerequisites.generated.js +199 -0
  118. package/build/readme.generated.js +1 -1
  119. package/build/repository-toolchains.js +623 -0
  120. package/build/setup-change-policy.js +32 -0
  121. package/build/setup-epic.js +26 -9
  122. package/build/setup-question.js +62 -0
  123. package/build/start-tickets.js +4 -0
  124. package/build/test-command-detection.js +61 -80
  125. package/build/test-support/notes-fs.js +40 -0
  126. package/build/ticket-delivery-artifacts.js +7 -0
  127. package/build/ticket-delivery-enrollment.js +80 -4
  128. package/build/ticket-delivery-run-scope.js +128 -0
  129. package/build/version.generated.js +3 -3
  130. package/build/worker-guard-hook-bin.js +2 -2
  131. package/build/worktrees.js +105 -0
  132. package/docs/EPIC-IMPLEMENTER.md +43 -0
  133. package/docs/epic-implementer/getting-started.md +95 -14
  134. package/package.json +2 -2
@@ -1,5 +1,37 @@
1
1
  /** Agent-neutral trusted starter context, appended after payload interpolation. */
2
2
  import { MCP_PACKAGE_NAME } from "../mcp-identity.js";
3
+ import { EPIC_WORKAROUNDS_DIR } from "../epic-workarounds-path.js";
4
+ /**
5
+ * BAPI-1552: the `preexisting_at_base` exception, shared by the launch
6
+ * instruction and the continuation test-invocation guidance so they cannot drift.
7
+ * Added only when the run allows hand-offs. SINGLE-LINE and free of semicolons,
8
+ * quote characters, and apostrophes, because it travels in the launch prompt.
9
+ * It names no repository path beyond the paired workaround record.
10
+ *
11
+ * The order matters. The paired record is committed first, so the failing step is
12
+ * rerun and the base reproduction collected at the final committed head, which is
13
+ * the head the phase result is recorded at. The base SHA is the merge-base of
14
+ * that head and the base branch, which is what the server re-checks against the
15
+ * provider. The worker owns the temporary worktree from creation to removal.
16
+ */
17
+ export function renderPreexistingAtBaseGuidance(record) {
18
+ const path = record ?? `${EPIC_WORKAROUNDS_DIR}<TICKET>.md`;
19
+ return ("One exception, for a pre-existing failure: when a required test step ran and failed, do this " +
20
+ "before recording anything. Commit the paired workaround record " + path + " first, then rerun the " +
21
+ "failing step at that final committed head. Run git merge-base HEAD origin/ joined with the base " +
22
+ "branch name, alone, and use its output as the base SHA. Run git worktree add --detach with a new " +
23
+ "directory under the system temporary directory and that base SHA. Rerun only the failing test IDs " +
24
+ "there with the same corrected runner and invocation. Then run git worktree remove --force on that " +
25
+ "directory, even when the base run failed, and run git worktree prune if the removal fails. Run one " +
26
+ "git command per call. Use the preexisting_at_base cause only when every failing test ID at the head " +
27
+ "also fails at the base. Record the step escalated, name it in verification failures, and add a " +
28
+ "base_reproduction object with base_sha, command, failing_ids_head, and failing_ids_base to the " +
29
+ "handoff, with observed_head_sha set to the final head you actually observed. This cause may cover " +
30
+ "any pre-PR step whose tests ran and failed, and a complete proof may replace the failure recorded " +
31
+ "at that same head. If any head failure passes at the base, or the base run cannot run, the failure " +
32
+ "belongs to this ticket and keeps ordinary failure handling and evidence renewal. Never invent test " +
33
+ "IDs, and never relabel an earlier observation with a later SHA.");
34
+ }
3
35
  export function renderWorkerPrBaseGuidance() {
4
36
  return "PR base contract: use the repository-provisioned create_pull_request tool to open this ticket's PR against the injected BAPI_BASE_BRANCH. " +
5
37
  "Do not infer the base from branch ancestry or the repository default. If created=false returns an existing PR, verify its base equals BAPI_BASE_BRANCH " +
@@ -36,6 +68,38 @@ export function renderWorkerTimeBudgetGuidance(timeoutSeconds) {
36
68
  "Local verification must leave room for commit, push, the single renewal pass, and `.conductor/result.json`. " +
37
69
  "Do not start a verification command that cannot finish within the remaining budget.";
38
70
  }
71
+ /**
72
+ * BAPI-1533: the compact test-invocation rule a PUSHING continuation worker gets
73
+ * beside the push and commit guidance. It mirrors the launch instruction and the
74
+ * remediate prompt, so every remaining-work lane states the same rule. Literal
75
+ * plain text with no obligation identifier, and independent of the optional
76
+ * trusted comparison context. Overlap reconciliation never gets it.
77
+ *
78
+ * Compatibility: a new server carries its `Remaining plan steps` block in
79
+ * `payload.prompt`, which the resolver already renders under `Focused context:`.
80
+ * An older server's payload (no block, and an older non-blank obligation text) is
81
+ * still accepted unchanged, with no executor-side identifier migration. AC-6 and
82
+ * AC-7 acceptance needs the second release's deployed server, published MCP
83
+ * package, and rebuilt executors. There is no runtime version gate.
84
+ */
85
+ export function renderWorkerTestInvocationGuidance(handoffEnabled) {
86
+ // BAPI-1552: the pre-existing failure exception, only when the run allows
87
+ // hand-offs. Without it the text is exactly the BAPI-1533 rule.
88
+ const preexisting = handoffEnabled === true ? " " + renderPreexistingAtBaseGuidance() : "";
89
+ return ("Test invocation rule: a requested test selector that collects zero tests is an invocation error, " +
90
+ "never a pass and never proof of a missing capability. Rerun every affected test-running step from the " +
91
+ "repository root with the repository's declared runner, and record the exact command and its output as " +
92
+ "that step's evidence. Run the repository's declared build command before a built-CLI smoke step. If no " +
93
+ "runner or build command is declared, do not invent one and do not report success. Only unit_tests, " +
94
+ "e2e_tests, and rendered_ui_review steps may be handed off, only when the persisted run policy allows " +
95
+ "hand-offs, and only when no_live_server, no_database, toolchain_unavailable, credential_unavailable, " +
96
+ "or mcp_unavailable stopped both the first invocation and the corrected attempt before either produced " +
97
+ "any result. The handoff records the first observation, the corrected invocation, and the full head " +
98
+ "SHA both ran against, and that SHA must equal the head the phase result is recorded at. A hand-off " +
99
+ "counts only at the head it observed, so a step that failed at one head can be handed off only from a " +
100
+ "new head. Failed assertions, application errors, unfinished work, and unclear failures keep their " +
101
+ "existing blocker or escalation handling." + preexisting);
102
+ }
39
103
  export function renderWorkerPushAndCommitGuidance(rebase = false) {
40
104
  return "\n\n## PUSH AND COMMIT PROCEDURE ##\n" +
41
105
  "1. Confirm git ls-files -- .bridge-commit-msg prints nothing and the message file is absent or an ordinary untracked file, never a symlink. " +
@@ -9,6 +9,48 @@
9
9
  */
10
10
  import path from "node:path";
11
11
  import { BranchMismatch, ExecutorNamedError } from "./job-errors.js";
12
+ /** Parse --porcelain -z without trimming paths or interpreting Git quoting. */
13
+ export function parseGitWorktreePorcelainZ(output) {
14
+ const result = [];
15
+ let current;
16
+ for (const field of output.split("\0")) {
17
+ if (field.startsWith("worktree ")) {
18
+ if (current)
19
+ result.push(current);
20
+ current = { path: field.slice(9), detached: false, bare: false };
21
+ }
22
+ else if (current) {
23
+ if (field.startsWith("HEAD "))
24
+ current.head = field.slice(5);
25
+ else if (field.startsWith("branch ")) {
26
+ current.branchRef = field.slice(7);
27
+ current.branch = current.branchRef.replace(/^refs\/heads\//, "");
28
+ }
29
+ else if (field === "detached")
30
+ current.detached = true;
31
+ else if (field === "bare")
32
+ current.bare = true;
33
+ else if (field === "locked" || field.startsWith("locked "))
34
+ current.locked = field.slice(7) || "locked";
35
+ else if (field === "prunable" || field.startsWith("prunable "))
36
+ current.prunable = field.slice(9) || "prunable";
37
+ }
38
+ }
39
+ if (current)
40
+ result.push(current);
41
+ return result;
42
+ }
43
+ export async function observeGitWorktrees(run, cwd) {
44
+ try {
45
+ const result = await run("git", ["worktree", "list", "--porcelain", "-z"], { cwd });
46
+ if (result.exitCode !== 0 || !result.stdout.startsWith("worktree ") || !result.stdout.endsWith("\0"))
47
+ return { state: "unavailable" };
48
+ return { state: "observed", value: parseGitWorktreePorcelainZ(result.stdout) };
49
+ }
50
+ catch {
51
+ return { state: "unavailable" };
52
+ }
53
+ }
12
54
  /** Return the Node `path` API matching a platform (`win32` vs POSIX). */
13
55
  export function pathApiForExecutorPlatform(platform) {
14
56
  return platform === "win32" ? path.win32 : path.posix;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Read-only GitHub CLI sign-in check (BAPI-1461), shared by `install conductor`
2
+ * Read-only GitHub CLI sign-in check (BAPI-1461), shared by `install epic-implementer`
3
3
  * and `doctor`.
4
4
  *
5
5
  * It runs exactly one command, `gh auth status`, bounded to ten seconds with