@bridge_gpt/mcp-server 0.2.53 → 0.2.55

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 (103) hide show
  1. package/README.md +116 -56
  2. package/build/agent-guidance.generated.js +3 -0
  3. package/build/agent-launchers/claude-executor-adapter.js +3 -0
  4. package/build/agent-launchers/claude.js +3 -3
  5. package/build/agent-launchers/prompt.js +8 -11
  6. package/build/agent-notes.js +178 -0
  7. package/build/agent-registry.js +5 -2
  8. package/build/agent-utils.js +58 -0
  9. package/build/agents.generated.js +1 -1
  10. package/build/base-ref.js +33 -9
  11. package/build/bounded-wait.js +174 -0
  12. package/build/codex-skill-adapter.js +55 -0
  13. package/build/commands.generated.js +6 -5
  14. package/build/conductor/bridge-api-client.js +235 -14
  15. package/build/conductor/bring-up-facts.js +187 -0
  16. package/build/conductor/claude-hook.js +7 -5
  17. package/build/conductor/cli.js +28 -0
  18. package/build/conductor/doctor.js +80 -9
  19. package/build/conductor/epic-implementer-cli.js +1298 -0
  20. package/build/conductor/epic-runtime.js +134 -98
  21. package/build/conductor/errors.js +2 -2
  22. package/build/conductor/git-ci-types.js +1 -1
  23. package/build/conductor/git-hooks.js +28 -14
  24. package/build/conductor/install-doctor.js +11 -5
  25. package/build/conductor/readiness-cli.js +10 -10
  26. package/build/conductor/readiness-sections.js +58 -9
  27. package/build/conductor/readiness.js +120 -4
  28. package/build/conductor/recovery-cli.js +289 -10
  29. package/build/conductor/recovery-operations.js +125 -2
  30. package/build/conductor/repair-contract.js +58 -0
  31. package/build/conductor/run-branch.js +137 -0
  32. package/build/conductor/store.js +2 -2
  33. package/build/conductor/supervisor-runtime.js +1 -1
  34. package/build/conductor/test-run-branch-vectors.js +165 -0
  35. package/build/conductor-bin.js +2 -139
  36. package/build/conductor-claude-hook-bin.js +2 -2
  37. package/build/conductor-claude-hook-removed-stub-bin.js +31 -0
  38. package/build/conductor-removed-stub-bin.js +30 -0
  39. package/build/docs.generated.js +1 -1
  40. package/build/doctor.js +145 -18
  41. package/build/drive-epic.js +752 -90
  42. package/build/epic-implementer-bin.js +145 -0
  43. package/build/epic-implementer-bundle-cli.js +264 -0
  44. package/build/epic-implementer-claude-hook-bin.js +3 -0
  45. package/build/epic-integration-pr.js +5 -3
  46. package/build/executor/claim-scope.js +104 -0
  47. package/build/executor/cli.js +14 -25
  48. package/build/executor/env-file-guard.js +82 -3
  49. package/build/executor/env.js +6 -0
  50. package/build/executor/interrupted-worktree.js +60 -0
  51. package/build/executor/job-errors.js +45 -0
  52. package/build/executor/job-runner.js +334 -9
  53. package/build/executor/job-types.js +25 -9
  54. package/build/executor/merge-tree-classifier.js +171 -0
  55. package/build/executor/reconcile-overlap-governance.js +129 -0
  56. package/build/executor/reconcile-overlap-job.js +989 -0
  57. package/build/executor/reconcile-overlap-types.js +14 -0
  58. package/build/executor/spawn-job-driver.js +1 -0
  59. package/build/executor/types.js +2 -0
  60. package/build/executor/worker-finalization.js +25 -2
  61. package/build/executor/worker-guard-hook.js +15 -7
  62. package/build/implement-epic/bridge-client.js +773 -0
  63. package/build/implement-epic/checkpoint-store.js +542 -0
  64. package/build/implement-epic/cli.js +3158 -0
  65. package/build/implement-epic/cut-protocol.js +392 -0
  66. package/build/implement-epic/lock.js +302 -0
  67. package/build/implement-epic/pr-state.js +286 -0
  68. package/build/implement-epic/spawn.js +113 -0
  69. package/build/index.js +657 -481
  70. package/build/init.js +72 -8
  71. package/build/install-bridge-conductor.js +5 -5
  72. package/build/install-bridge.js +403 -70
  73. package/build/local-artifact-storage.js +130 -0
  74. package/build/mcp-host-config.js +22 -60
  75. package/build/mcp-host-entry-adapter.js +18 -0
  76. package/build/mcp-host-targets.js +1 -21
  77. package/build/merge-pull-request.js +1 -1
  78. package/build/pipelines.generated.js +23 -16
  79. package/build/plan-epic-conductor-eligibility.js +1 -1
  80. package/build/plane/cli.js +321 -41
  81. package/build/plane/manifest.js +209 -1
  82. package/build/plane/member-roster.js +70 -0
  83. package/build/plane/preflight.js +128 -12
  84. package/build/plane/shutdown.js +18 -5
  85. package/build/plane/status.js +35 -1
  86. package/build/plane/supervisor.js +546 -164
  87. package/build/plane/types.js +25 -2
  88. package/build/polling-policy.js +72 -0
  89. package/build/readiness-check.js +3 -3
  90. package/build/readme.generated.js +1 -1
  91. package/build/review-generation.js +219 -0
  92. package/build/run-unit-tests-launcher.js +6 -1
  93. package/build/setup-epic.js +567 -38
  94. package/build/start-tickets-conductor.js +8 -7
  95. package/build/ticket-key-utils.js +4 -3
  96. package/build/ticket-review-artifact-gate.js +461 -0
  97. package/build/upgrade-cli.js +5 -26
  98. package/build/version.generated.js +3 -3
  99. package/build/worker-guard-hook-bin.js +1 -1
  100. package/docs/CONDUCTOR.md +8 -6
  101. package/docs/install/mcp-tool-integrations.md +23 -1
  102. package/package.json +5 -3
  103. package/pipelines/review-ticket.json +17 -4
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Types for the `reconcile_overlap` executor job (BAPI-1152).
3
+ *
4
+ * The server authors the payload (`api/library/epic_conductor/reconcile_overlap_payload.py`)
5
+ * and verifies the result (`reconcile_overlap_completion_contract.py`); these
6
+ * interfaces are the executor's view of both. They are deliberately plain data —
7
+ * validation lives in `reconcile-overlap-job.ts`, which refuses anything that does
8
+ * not match before a single subprocess runs.
9
+ *
10
+ * ARCHITECTURE BOUNDARY: executor-local. Imports nothing from the conductor
11
+ * runtime or the server-side reconciler graph.
12
+ */
13
+ /** The payload schema version this executor understands. */
14
+ export const RECONCILE_OVERLAP_PAYLOAD_SCHEMA_VERSION = 1;
@@ -0,0 +1 @@
1
+ export {};
@@ -17,6 +17,8 @@ export const EXECUTOR_JOB_TYPE_VALUES = [
17
17
  "ci_fix",
18
18
  "merge",
19
19
  "smoke",
20
+ // BAPI-1151 registered it server-side; BAPI-1152 lands the executor body.
21
+ "reconcile_overlap",
20
22
  ];
21
23
  /**
22
24
  * Server-authoritative completion classification (T2 `ExecutorClassification`,
@@ -56,7 +56,7 @@
56
56
  * this ticket removes. The reconciler stays the decision-maker — the executor
57
57
  * only reports the observation (R14 rule 3).
58
58
  */
59
- import { secretFreeErrorMessage, WorkerFinalizationMissingRemoteBranchAndPr, WorkerFinalizationPrBaseMismatch, WorkerFinalizationPrNotAttached, WorkerFinalizationSavedButUnfinalized, } from "./job-errors.js";
59
+ import { ReconcileOverlapPushUnfinalized, secretFreeErrorMessage, WorkerFinalizationMissingRemoteBranchAndPr, WorkerFinalizationPrBaseMismatch, WorkerFinalizationPrNotAttached, WorkerFinalizationSavedButUnfinalized, } from "./job-errors.js";
60
60
  import { isImplementationStyleJobType } from "./job-types.js";
61
61
  /** Bounded settling re-check defaults for the authoritative origin-tip lookup. */
62
62
  const DEFAULT_ORIGIN_FINALIZATION_ATTEMPTS = 3;
@@ -361,6 +361,27 @@ function savedButUnfinalizedFailure(job, branch, originSha, workerHeadSha) {
361
361
  last_commit_sha: originSha,
362
362
  };
363
363
  }
364
+ /**
365
+ * BAPI-1152: the `reconcile_overlap` counterpart of
366
+ * {@link savedButUnfinalizedFailure}. For that job the push is the WRAPPER's,
367
+ * made once and guarded by a lease on the recorded child head, and the worktree is
368
+ * reset to that head on every non-pushing exit. "Resume/finalize from the branch"
369
+ * would therefore send an operator to recover work that was deliberately
370
+ * discarded; what they need to know is that the guarded push did not land and
371
+ * which head origin actually carries.
372
+ */
373
+ function reconcilePushUnfinalizedFailure(job, branch, originSha, pushedSha) {
374
+ const label = job.ticket_key ? `${job.ticket_key} (job ${job.id})` : `job ${job.id}`;
375
+ return {
376
+ error_kind: ReconcileOverlapPushUnfinalized,
377
+ error_message: `${label}: the reconciliation's guarded push of ${pushedSha.slice(0, 12)} did not land — ` +
378
+ `origin branch '${branch}' is at ${originSha.slice(0, 12)}. Nothing was lost: the ` +
379
+ `worktree was reset to the recorded child head, and the next reconciliation attempt ` +
380
+ `starts from origin's head.`,
381
+ classification: "crashed",
382
+ last_commit_sha: originSha,
383
+ };
384
+ }
364
385
  /**
365
386
  * Validate that an implementation-style job's clean exit actually published its
366
387
  * work to origin AND left an attached pull request. Non-implementation-style jobs
@@ -451,7 +472,9 @@ export async function validateWorkerFinalization(input) {
451
472
  if (trimmedHeadSha && remoteSha !== trimmedHeadSha) {
452
473
  return {
453
474
  ok: false,
454
- failure: savedButUnfinalizedFailure(job, trimmedBranch, remoteSha, trimmedHeadSha),
475
+ failure: job.job_type === "reconcile_overlap"
476
+ ? reconcilePushUnfinalizedFailure(job, trimmedBranch, remoteSha, trimmedHeadSha)
477
+ : savedButUnfinalizedFailure(job, trimmedBranch, remoteSha, trimmedHeadSha),
455
478
  };
456
479
  }
457
480
  // BAPI-862: the work is provably ON ORIGIN. That was the whole of the success
@@ -315,10 +315,12 @@ function isOwnBranchDestination(destination, workerBranch) {
315
315
  * `git push` — allowed ONLY when every explicit destination is the worker's own
316
316
  * branch.
317
317
  *
318
- * A push with no explicit destination at all is allowed: it follows the branch's
319
- * configured upstream, which for a conductor worker is the branch it is standing
320
- * on. Everything else a tag, a deletion refspec, another branch, a destination
321
- * that cannot be resolved because the branch identity is missing — denies. The
318
+ * A worker with NO branch identity is denied every push, before anything else is
319
+ * considered (BAPI-1152 the `reconcile_overlap` worker holds no remote write
320
+ * authority; its wrapper pushes). For a worker WITH an identity, a push with no
321
+ * explicit destination is allowed: it follows the branch's configured upstream,
322
+ * which for a conductor worker is the branch it is standing on. Everything else —
323
+ * a tag, a deletion refspec, another branch — denies. The
322
324
  * per-flag globs in `permissions.ts` (`--tags`, `--delete`, `refs/tags/`, ` main`,
323
325
  * `epic/`) cover the common spellings; this is the general rule underneath them.
324
326
  */
@@ -352,12 +354,18 @@ function evaluateGitPush(args, ctx) {
352
354
  }
353
355
  positional.push(token);
354
356
  }
355
- // `git push` / `git push <remote>` with no refspec: the configured upstream.
356
- if (positional.length <= 1)
357
- return { kind: "allow" };
357
+ // BAPI-1152: branch identity is checked FIRST. A worker launched with no branch
358
+ // identity (a `reconcile_overlap` worker, which must never write to a remote)
359
+ // is denied EVERY push, including the refspec-less `git push` / `git push
360
+ // <remote>` forms below. Before this ordering those forms were allowed ahead of
361
+ // the branch check, so omitting the branch did not in fact deny a bare push.
358
362
  const workerBranch = ctx.workerBranch;
359
363
  if (typeof workerBranch !== "string" || workerBranch.length === 0)
360
364
  return deny;
365
+ // `git push` / `git push <remote>` with no refspec: the configured upstream,
366
+ // which for a worker with a branch identity is its own job branch.
367
+ if (positional.length <= 1)
368
+ return { kind: "allow" };
361
369
  const destinations = positional.slice(1);
362
370
  return destinations.every((d) => isOwnBranchDestination(d, workerBranch))
363
371
  ? { kind: "allow" }