@bridge_gpt/mcp-server 0.2.74 → 0.2.76

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 (102) hide show
  1. package/README.md +14 -7
  2. package/build/agent-launchers/prompt.js +9 -21
  3. package/build/agents.generated.js +6 -6
  4. package/build/authored-plan.js +542 -0
  5. package/build/bridge-permissions.js +8 -0
  6. package/build/codex-auto-recovery.js +25 -7
  7. package/build/commands.generated.js +7 -7
  8. package/build/conductor/bridge-api-client.js +807 -52
  9. package/build/conductor/declare-blocked.js +4 -0
  10. package/build/conductor/driver-pass.js +8 -0
  11. package/build/conductor/epic-implementer-cli.js +341 -96
  12. package/build/conductor/epic-server-journal.js +13 -0
  13. package/build/conductor/epic-server-recipe.js +15 -5
  14. package/build/conductor/epic-server-runtime.js +163 -45
  15. package/build/conductor/epic-server.js +13 -6
  16. package/build/conductor/gate-discovery.js +209 -9
  17. package/build/conductor/gate-settings-review.js +7 -11
  18. package/build/conductor/install-doctor.js +30 -2
  19. package/build/conductor/launch-plan.js +58 -12
  20. package/build/conductor/local-merge.js +54 -12
  21. package/build/conductor/open-decision-phrases.js +50 -0
  22. package/build/conductor/pr-ci-producer.js +12 -3
  23. package/build/conductor/prerequisite-inputs.js +181 -14
  24. package/build/conductor/readiness-sections.js +46 -13
  25. package/build/conductor/readiness.js +3 -40
  26. package/build/conductor/recovery-cli.js +12 -12
  27. package/build/conductor/repository-workflow-remedy.js +147 -7
  28. package/build/conductor/ui-readiness.js +224 -0
  29. package/build/conductor/wait-run-attention.js +9 -4
  30. package/build/conductor/wait-run-cli.js +9 -2
  31. package/build/connect-github-api.js +18 -0
  32. package/build/connect-github.js +35 -18
  33. package/build/docs.generated.js +3 -3
  34. package/build/drive-epic.js +787 -37
  35. package/build/epic-ci-workflow.js +3 -2
  36. package/build/epic-implementer-bin.js +200 -66
  37. package/build/epic-implementer-bundle-cli.js +61 -0
  38. package/build/epic-implementer-claude-hook-bin.js +1 -1
  39. package/build/epic-implementer-env.js +3 -4
  40. package/build/epic-integration-pr.js +5 -2
  41. package/build/epic-launch-context.js +8 -1
  42. package/build/epic-shared/cut-protocol.js +55 -3
  43. package/build/executor/completion-contract.js +24 -1
  44. package/build/executor/failure-reason-codes.js +2 -0
  45. package/build/executor/gate-qualification-job.js +193 -23
  46. package/build/executor/gate-qualification-tests-ran.js +232 -0
  47. package/build/executor/integration-job.js +56 -2
  48. package/build/executor/job-runner.js +13 -723
  49. package/build/executor/job-type-wrappers.js +734 -0
  50. package/build/executor/merge-job.js +45 -1
  51. package/build/executor/permissions.js +187 -2
  52. package/build/executor/preflight.js +6 -2
  53. package/build/executor/process-containment.js +8 -1
  54. package/build/executor/provider-checks.js +28 -5
  55. package/build/executor/reconcile-overlap-job.js +70 -17
  56. package/build/executor/required-verification.js +28 -2
  57. package/build/executor/required-work-ledger.js +7 -2
  58. package/build/executor/resume-pre-spawn.js +32 -8
  59. package/build/executor/runner.js +30 -5
  60. package/build/executor/types.js +9 -0
  61. package/build/executor/worker-database.js +6 -1
  62. package/build/executor/worker-guard-hook.js +24 -2
  63. package/build/executor/worktree.js +12 -1
  64. package/build/generated/ticket-status.js +20 -0
  65. package/build/index.js +627 -551
  66. package/build/init.js +16 -0
  67. package/build/install-bridge-conductor-answers.js +32 -1
  68. package/build/install-bridge-conductor-apply.js +21 -3
  69. package/build/install-bridge-conductor-assessment.js +185 -12
  70. package/build/install-bridge-conductor-compact.js +2 -0
  71. package/build/install-bridge-conductor-contracts.js +9 -1
  72. package/build/install-bridge-conductor-gate.js +257 -80
  73. package/build/install-bridge-conductor-setup.js +106 -6
  74. package/build/install-bridge-conductor-trial-report.js +170 -0
  75. package/build/install-bridge-conductor.js +740 -124
  76. package/build/mcp-host-config.js +54 -37
  77. package/build/phase-context-git-probe.js +16 -0
  78. package/build/pipelines.generated.js +15 -15
  79. package/build/plan-execution-ledger.js +27 -0
  80. package/build/plan-generation.js +17 -0
  81. package/build/plane/plane-freshness.js +43 -26
  82. package/build/printed-remedy-commands.js +62 -0
  83. package/build/readme.generated.js +1 -1
  84. package/build/repository-toolchains.js +11 -5
  85. package/build/scripts/saved-commands-config-field-driver.js +65 -0
  86. package/build/secret-redaction.js +3 -0
  87. package/build/setup-epic.js +51 -9
  88. package/build/test-support/create-preview-world.js +232 -0
  89. package/build/test-support/executor-source-files.js +1 -1
  90. package/build/ticket-delivery.js +65 -0
  91. package/build/v2-readiness-requirements.js +13 -4
  92. package/build/version.generated.js +3 -3
  93. package/build/worker-guard-hook-bin.js +2 -2
  94. package/build/worktree-core.js +51 -7
  95. package/docs/EPIC-IMPLEMENTER.md +83 -4
  96. package/docs/epic-implementer/getting-started.md +1 -1
  97. package/docs/install/github-app.md +79 -92
  98. package/package.json +1 -1
  99. package/pipelines/implement-ticket.json +2 -2
  100. package/build/conductor/epic-reconcile.js +0 -603
  101. package/build/conductor/epic-runtime.js +0 -2020
  102. package/build/conductor/epic-state.js +0 -774
@@ -66,6 +66,7 @@ import { buildLocalMergeChildEnv, sanitizeLocalMergeOutput, } from "../conductor
66
66
  import { resolveMergeCredentialAtAction } from "../conductor/stored-merge-credential.js";
67
67
  import { EPIC_INTEGRATION_PR_READ_TIMEOUT_MS, createProductionEpicIntegrationGhRunner, ensureEpicIntegrationPullRequest, } from "../epic-integration-pr.js";
68
68
  import { EPIC_WORKAROUNDS_DIR_PATH } from "../epic-workarounds-path.js";
69
+ import { captureExecutorMergeIndex, stageExecutorAllowedTree, unstageExecutorExcludedPaths, } from "./permissions.js";
69
70
  import { HANDOFF_REPORT_DETAIL_CODES, HANDOFF_REPORT_PAYLOAD_VERSION, HANDOFF_REPORT_SHAPES, INTEGRATION_ACTION_OPERATIONS, INTEGRATION_ACTION_OUTCOMES, INTEGRATION_ACTION_PROTOCOL_VERSION, MAX_HANDOFF_REPORT_COMMENT_CHARS, } from "./types.js";
70
71
  /** The route prefix, mirrored from `api/routes/__init__.py`. */
71
72
  export const INTEGRATION_ACTION_ROUTE_PREFIX = "/epic-integration-actions";
@@ -918,6 +919,9 @@ export function createIntegrationCorrectionDriver(action, deps) {
918
919
  const baseSha = action.expected_base_sha;
919
920
  const remoteUrl = `https://github.com/${action.provider_repository}.git`;
920
921
  const destination = `refs/heads/${action.epic_branch}`;
922
+ // BAPI-1732: the protected-path index state of THIS action's conflicted merge.
923
+ // `null` is "not captured", distinct from a captured empty snapshot.
924
+ let mergeSnapshot = null;
921
925
  const git = async (ctx, args, timeoutMs = GIT_TIMEOUT_MS, env) => {
922
926
  try {
923
927
  const r = await deps.runCommand("git", args, {
@@ -1025,6 +1029,21 @@ export function createIntegrationCorrectionDriver(action, deps) {
1025
1029
  await restore(ctx);
1026
1030
  return finish(complete({ outcome: "failed", detailCode: "merge_start_failed" }));
1027
1031
  }
1032
+ // The merge's own protected-path index entries, kept so the worker's
1033
+ // staging of host files can be undone without losing them.
1034
+ mergeSnapshot = null;
1035
+ let captured = null;
1036
+ try {
1037
+ captured = await captureExecutorMergeIndex((args) => git(ctx, args));
1038
+ }
1039
+ catch {
1040
+ captured = null;
1041
+ }
1042
+ if (captured === null) {
1043
+ await restore(ctx);
1044
+ return finish(complete({ outcome: "failed", detailCode: "merge_start_failed" }));
1045
+ }
1046
+ mergeSnapshot = captured;
1028
1047
  }
1029
1048
  return {
1030
1049
  kind: "spawn_worker",
@@ -1043,11 +1062,44 @@ export function createIntegrationCorrectionDriver(action, deps) {
1043
1062
  await restore(ctx);
1044
1063
  return complete({ outcome: "failed", detailCode: "worker_rewrote_history" });
1045
1064
  }
1046
- await git(ctx, ["add", "-A", "--", "."]);
1065
+ const commitFailed = async () => {
1066
+ await restore(ctx);
1067
+ return complete({ outcome: "failed", detailCode: "commit_failed" });
1068
+ };
1069
+ const snapshot = mergeSnapshot;
1070
+ if (isConflict && snapshot === null)
1071
+ return commitFailed();
1072
+ // Stage the allowed tree only; protected host paths never enter the commit.
1073
+ try {
1074
+ await stageExecutorAllowedTree((args) => git(ctx, args));
1075
+ }
1076
+ catch {
1077
+ return commitFailed();
1078
+ }
1079
+ // Conflicted protected paths belong to the worker's resolution: stage exactly
1080
+ // those, in a call of their own.
1081
+ if (snapshot !== null && snapshot.conflicted.size > 0) {
1082
+ const literal = Array.from(snapshot.conflicted, (p) => `:(top,literal)${p}`);
1083
+ // `-f`: these paths are tracked and unmerged, but `info/exclude` also names
1084
+ // them, and Git refuses an ignored path without it.
1085
+ const resolved = await git(ctx, ["add", "-f", "--", ...literal]);
1086
+ if (resolved.exitCode !== 0)
1087
+ return commitFailed();
1088
+ }
1089
+ try {
1090
+ await unstageExecutorExcludedPaths((args) => git(ctx, args), isConflict ? (snapshot ?? undefined) : undefined);
1091
+ }
1092
+ catch {
1093
+ return commitFailed();
1094
+ }
1047
1095
  if (isConflict) {
1048
1096
  const unmerged = await git(ctx, ["ls-files", "-u"]);
1097
+ if (unmerged.exitCode !== 0)
1098
+ return commitFailed();
1049
1099
  const markers = await git(ctx, ["grep", "--cached", "-n", "-I", "-E", "^(<{7}|>{7})( |$)"]);
1050
- if (unmerged.exitCode !== 0 || unmerged.stdout.trim().length > 0 || markers.exitCode === 0) {
1100
+ if (markers.exitCode !== 0 && markers.exitCode !== 1)
1101
+ return commitFailed();
1102
+ if (unmerged.stdout.trim().length > 0 || markers.exitCode === 0) {
1051
1103
  await restore(ctx);
1052
1104
  return complete({ outcome: "failed", detailCode: "conflicts_unresolved" });
1053
1105
  }
@@ -1058,6 +1110,8 @@ export function createIntegrationCorrectionDriver(action, deps) {
1058
1110
  await restore(ctx);
1059
1111
  return complete({ outcome: "failed", detailCode: "correction_no_change" });
1060
1112
  }
1113
+ if (staged.exitCode !== 1)
1114
+ return commitFailed();
1061
1115
  }
1062
1116
  const message = isConflict
1063
1117
  ? `Merge ${action.base_branch} into ${action.epic_branch}`