@bridge_gpt/mcp-server 0.2.75 → 0.2.77
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.
- package/README.md +8 -6
- package/build/agents.generated.js +5 -5
- package/build/cli-dispatch.js +333 -0
- package/build/codex-auto-recovery.js +25 -7
- package/build/commands.generated.js +8 -8
- package/build/conductor/bridge-api-client.js +193 -13
- package/build/conductor/declare-blocked.js +146 -7
- package/build/conductor/driver-pass.js +8 -0
- package/build/conductor/driver-register.js +8 -2
- package/build/conductor/epic-implementer-cli.js +15 -10
- package/build/conductor/epic-server-journal.js +52 -22
- package/build/conductor/epic-server-recipe.js +15 -5
- package/build/conductor/epic-server-runtime.js +163 -45
- package/build/conductor/epic-server.js +13 -6
- package/build/conductor/install-doctor.js +30 -2
- package/build/conductor/launch-plan.js +28 -7
- package/build/conductor/local-merge.js +55 -13
- package/build/conductor/pr-ci-producer.js +12 -3
- package/build/conductor/readiness-prerequisites.js +89 -2
- package/build/conductor/readiness-sections.js +46 -13
- package/build/conductor/readiness.js +3 -40
- package/build/conductor/recovery-cli.js +14 -12
- package/build/conductor/repository-workflow-remedy.js +147 -7
- package/build/conductor/ui-readiness.js +224 -0
- package/build/conductor/wait-run-attention.js +9 -4
- package/build/conductor/wait-run-cli.js +9 -2
- package/build/docs.generated.js +67 -4
- package/build/doctor.js +97 -1
- package/build/drive-epic.js +625 -33
- package/build/engine-paths.js +10 -0
- package/build/epic-coherence-input-cli.js +105 -10
- package/build/epic-coherence-input.js +877 -4
- package/build/epic-coherence-input.test-fixtures.js +117 -0
- package/build/epic-implementer-bin.js +947 -120
- package/build/epic-implementer-env.js +2 -2
- package/build/epic-launch-context.js +8 -1
- package/build/epic-shared/cut-protocol.js +55 -3
- package/build/executor/completion-contract.js +14 -1
- package/build/executor/failure-reason-codes.js +2 -0
- package/build/executor/guarded-fast-forward-push.js +25 -2
- package/build/executor/integration-job.js +56 -2
- package/build/executor/job-runner.js +87 -28
- package/build/executor/likely-tests.js +78 -6
- package/build/executor/merge-job.js +45 -1
- package/build/executor/permissions.js +187 -2
- package/build/executor/provider-checks.js +101 -5
- package/build/executor/rebase-finalization.js +29 -27
- package/build/executor/reconcile-overlap-job.js +70 -17
- package/build/executor/rename-aside.js +265 -0
- package/build/executor/required-work-ledger.js +89 -6
- package/build/executor/resume-pre-spawn.js +32 -8
- package/build/executor/runner.js +26 -4
- package/build/executor/types.js +121 -0
- package/build/executor/worktree.js +39 -2
- package/build/index.js +2500 -495
- package/build/init.js +16 -0
- package/build/install-bridge-conductor-answers.js +4 -0
- package/build/install-bridge-conductor-apply.js +10 -0
- package/build/install-bridge-conductor-assessment.js +84 -0
- package/build/install-bridge-conductor-contracts.js +9 -1
- package/build/install-bridge-conductor-setup.js +103 -3
- package/build/install-bridge-conductor.js +440 -812
- package/build/install-bridge.js +4 -11
- package/build/language-catalog.generated.js +2649 -0
- package/build/mcp-host-config.js +54 -37
- package/build/phase-context-git-probe.js +16 -0
- package/build/pipelines.generated.js +47 -19
- package/build/plan-execution-ledger.js +35 -0
- package/build/plan-generation.js +34 -0
- package/build/plane/build-freshness.js +6 -0
- package/build/plane/cli.js +12 -5
- package/build/plane/plane-freshness.js +43 -26
- package/build/printed-remedy-commands.js +17 -0
- package/build/readiness-prerequisites.generated.js +28 -0
- package/build/readme.generated.js +1 -1
- package/build/run-unit-tests-launcher.js +3 -1
- package/build/secret-redaction.js +3 -0
- package/build/server.js +7946 -0
- package/build/setup-epic.js +41 -8
- package/build/start-tickets-prereqs.js +3 -6
- package/build/test-support/console-guard.js +30 -0
- package/build/test-support/create-preview-world.js +232 -0
- package/build/test-support/module-imports.js +155 -0
- package/build/test-support/server-client.js +96 -0
- package/build/test-support/stdio-server.js +146 -0
- package/build/ticket-delivery.js +65 -0
- package/build/v2-readiness-requirements.js +39 -5
- package/build/version.generated.js +3 -3
- package/build/worktree-core.js +51 -7
- package/docs/EPIC-IMPLEMENTER.md +150 -2
- package/docs/epic-implementer/getting-started.md +5 -1
- package/package.json +3 -3
- package/pipelines/implement-ticket.json +2 -2
- package/pipelines/learn-repository.json +19 -1
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
* module answers only the first.
|
|
55
55
|
*/
|
|
56
56
|
import { spawn } from "child_process";
|
|
57
|
-
import { pollCiChecksForCommit, ConductorBridgeApiError, safeDiagnosticMessage, } from "./bridge-api-client.js";
|
|
57
|
+
import { pollCiChecksForCommit, classifyCiPollAvailability, isFallbackWithNoObservedChecks, CiPollTransientUnavailableError, ConductorBridgeApiError, safeDiagnosticMessage, } from "./bridge-api-client.js";
|
|
58
58
|
import { isLikelyGhMergeConflictOutput, isPrMergeConflict, parseGhPrMergeabilityFields, } from "./github-mergeability.js";
|
|
59
59
|
import { normalizeSelectorCheckName, selectLatestChecksByName } from "./latest-check-selector.js";
|
|
60
60
|
const MERGE_METHODS = new Set(["squash", "merge", "rebase"]);
|
|
@@ -250,7 +250,7 @@ export function sanitizeLocalMergeOutput(text, credentials = []) {
|
|
|
250
250
|
* child when the injected abort signal fires. Never builds a shell string and
|
|
251
251
|
* never logs raw stdout/stderr.
|
|
252
252
|
*/
|
|
253
|
-
async function defaultRunCommand(cmd, args, env, signal) {
|
|
253
|
+
export async function defaultRunCommand(cmd, args, env, signal) {
|
|
254
254
|
// BAPI-1136: `env` arrives ALREADY built by `buildLocalMergeChildEnv` and is
|
|
255
255
|
// the complete child environment. The former `{ ...process.env, ...env }`
|
|
256
256
|
// merge is gone — it re-inherited the ambient identity the caller had just
|
|
@@ -594,6 +594,20 @@ function isAmbiguousCiPollFailureReason(reason) {
|
|
|
594
594
|
* detail on the result. `ci_not_green` is returned only after the budget is exhausted.
|
|
595
595
|
* Never polls the branch name or PR head alias — only `expectedSha`.
|
|
596
596
|
*
|
|
597
|
+
* BAPI-1527: every poll carries `requiredChecks`, so a repository whose CI check
|
|
598
|
+
* configuration was never resolved is judged on live provider evidence. Two named
|
|
599
|
+
* outcomes keep that evidence honest, and both are reported only at the budget
|
|
600
|
+
* boundary, exactly when `ci_not_green` would be. `ci_checks_unavailable` replaces
|
|
601
|
+
* `ci_not_green` when the latest poll said the check configuration or provider
|
|
602
|
+
* access could not be read. An unavailable poll is never green evidence: the loop
|
|
603
|
+
* skips the green test for it and keeps waiting, so a read that recovers inside the
|
|
604
|
+
* budget is judged on the evidence it then returns. The server retries a
|
|
605
|
+
* `ci_checks_unavailable` merge through the same re-fire and retry budget as
|
|
606
|
+
* `ci_not_green`, and parks only once that budget is spent.
|
|
607
|
+
* `ci_no_checks_observed` replaces `ci_not_green` at the budget boundary only when
|
|
608
|
+
* the latest poll was a fallback over an empty required list that saw no check at
|
|
609
|
+
* all; failing, pending, or missing named checks still end as `ci_not_green`.
|
|
610
|
+
*
|
|
597
611
|
* BAPI-572 abort-awareness: the CI-wait loop is the longest-running,
|
|
598
612
|
* non-`gh`-subprocess phase of a merge. It must short-circuit with `merge_aborted`
|
|
599
613
|
* as soon as the injected abort signal fires — otherwise a merge job the executor
|
|
@@ -602,24 +616,44 @@ function isAmbiguousCiPollFailureReason(reason) {
|
|
|
602
616
|
*/
|
|
603
617
|
async function waitForRequiredChecksGreen(pollCi, access, expectedSha, requiredChecks, timeoutMs, pollIntervalMs, sleep, now, signal) {
|
|
604
618
|
const start = now();
|
|
619
|
+
let lastPollSawNoChecks = false;
|
|
620
|
+
let lastPollUnavailable = false;
|
|
605
621
|
for (;;) {
|
|
606
622
|
if (signal?.aborted)
|
|
607
623
|
return { ok: false, reason: "merge_aborted" };
|
|
608
624
|
let pollResponse;
|
|
609
625
|
try {
|
|
610
|
-
pollResponse = await pollCi(access, expectedSha);
|
|
626
|
+
pollResponse = await pollCi(access, expectedSha, requiredChecks);
|
|
611
627
|
}
|
|
612
628
|
catch (err) {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
629
|
+
if (err instanceof CiPollTransientUnavailableError) {
|
|
630
|
+
// BAPI-1527 decision A: the route's transient envelope is the same
|
|
631
|
+
// provider exception that, before the opt-in, came back as a plain
|
|
632
|
+
// not-green envelope. Keep waiting exactly as before: a null response is
|
|
633
|
+
// never green and ends as `ci_not_green` at the budget boundary.
|
|
634
|
+
pollResponse = null;
|
|
635
|
+
}
|
|
636
|
+
else {
|
|
637
|
+
// Preserve the caught bridge poll error's coarse kind/status instead of
|
|
638
|
+
// flattening every failure to an opaque `ci_poll_failed` (BAPI-577 Part A).
|
|
639
|
+
// Unknown/non-bridge throws yield `undefined` detail → legacy `ci_poll_failed`.
|
|
640
|
+
const pollFailure = ciPollFailureDetailFromError(err);
|
|
641
|
+
return { ok: false, reason: ciPollFailureReasonFromDetail(pollFailure), pollFailure };
|
|
642
|
+
}
|
|
618
643
|
}
|
|
619
|
-
|
|
644
|
+
// Unreadable configuration is not a failed check and never green evidence:
|
|
645
|
+
// skip the green test (it could read `detail: null` as red CI) and keep waiting
|
|
646
|
+
// like any other not-green poll. The name is reported at the budget boundary.
|
|
647
|
+
lastPollUnavailable = classifyCiPollAvailability(pollResponse) === "configuration_unavailable";
|
|
648
|
+
if (!lastPollUnavailable && allRequiredChecksGreen(pollResponse, requiredChecks))
|
|
620
649
|
return { ok: true };
|
|
621
|
-
|
|
622
|
-
|
|
650
|
+
lastPollSawNoChecks =
|
|
651
|
+
!lastPollUnavailable && requiredChecks.length === 0 && isFallbackWithNoObservedChecks(pollResponse);
|
|
652
|
+
if (now() - start >= timeoutMs) {
|
|
653
|
+
if (lastPollUnavailable)
|
|
654
|
+
return { ok: false, reason: "ci_checks_unavailable" };
|
|
655
|
+
return { ok: false, reason: lastPollSawNoChecks ? "ci_no_checks_observed" : "ci_not_green" };
|
|
656
|
+
}
|
|
623
657
|
await sleep(pollIntervalMs);
|
|
624
658
|
// Re-check after the sleep so an abort during the interval stops the loop
|
|
625
659
|
// before the next poll (and, critically, before any provider merge).
|
|
@@ -643,7 +677,8 @@ export function makeLocalMergeExecutor(options = {}, deps = {}) {
|
|
|
643
677
|
// signal is threaded to the default runner so an overall merge timeout can
|
|
644
678
|
// cancel in-flight subprocess work.
|
|
645
679
|
const run = (cmd, args, env) => Promise.resolve(rawRun(cmd, args, env, deps.signal));
|
|
646
|
-
const pollCi = deps.pollCi ??
|
|
680
|
+
const pollCi = deps.pollCi ??
|
|
681
|
+
((pollAccess, commitRef, checks) => pollCiChecksForCommit(pollAccess, commitRef, undefined, checks));
|
|
647
682
|
const sleep = deps.sleep ?? defaultSleep;
|
|
648
683
|
const now = deps.now ?? (() => Date.now());
|
|
649
684
|
const signal = deps.signal;
|
|
@@ -760,7 +795,10 @@ export function makeLocalMergeExecutor(options = {}, deps = {}) {
|
|
|
760
795
|
// for transient post-remediation CI to turn green before failing ci_not_green.
|
|
761
796
|
// Skipped under `skipCiWait` (BAPI-832), where the server's approval tail
|
|
762
797
|
// revalidated these same checks for this same head moments ago.
|
|
763
|
-
|
|
798
|
+
// Also skipped (BAPI-1724) for a run that declared no CI gate, with an
|
|
799
|
+
// empty check list; a non-empty list always waits.
|
|
800
|
+
const noCiGateSkip = options.noCiGateDeclared === true && requiredChecks.length === 0;
|
|
801
|
+
if (!options.skipCiWait && !noCiGateSkip) {
|
|
764
802
|
const ciWait = await waitForRequiredChecksGreen(pollCi, access, expectedSha, requiredChecks, ciWaitTimeoutMs, ciWaitPollIntervalMs, sleep, now, signal);
|
|
765
803
|
if (!ciWait.ok) {
|
|
766
804
|
// Any `ci_poll_*` reason (the legacy `ci_poll_failed` plus the distinct
|
|
@@ -776,6 +814,8 @@ export function makeLocalMergeExecutor(options = {}, deps = {}) {
|
|
|
776
814
|
}
|
|
777
815
|
return fail(ciWait.reason, ciWait.pollFailure);
|
|
778
816
|
}
|
|
817
|
+
// 3b/3c rereads protect the CI-wait INTERVAL. A no-wait merge has no such
|
|
818
|
+
// interval: the first PR read above and `--match-head-commit` protect it.
|
|
779
819
|
// 3b. Re-read PR head/state after the CI wait — the head can drift, the PR can
|
|
780
820
|
// close, or the merge can already have landed while we waited for CI.
|
|
781
821
|
const secondRead = await readPrMergeState(run, ghEnv, pr);
|
|
@@ -876,6 +916,8 @@ export function makeLocalMergeExecutor(options = {}, deps = {}) {
|
|
|
876
916
|
}
|
|
877
917
|
const succeededDetails = {
|
|
878
918
|
...baseDetails,
|
|
919
|
+
// BAPI-1724: success-only. A refusal or failure keeps the plain details.
|
|
920
|
+
...(noCiGateSkip && !options.skipCiWait ? { ci_wait: "skipped_no_ci_gate_declared" } : {}),
|
|
879
921
|
...(mergeCommitSha ? { merge_commit_sha: mergeCommitSha } : {}),
|
|
880
922
|
};
|
|
881
923
|
return buildResponse(request, "succeeded", null, true, [
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { GIT_CI_PRODUCER, REVIEW_STATE, } from "./git-ci-types.js";
|
|
13
13
|
import { evaluateDoneGate, normalizeCiSnapshot, parseDoneGateConfig } from "./done-gate.js";
|
|
14
14
|
import { observeReviewWithResolved } from "./pr-review-producer.js";
|
|
15
|
-
import { fetchEffectiveSupervisorSetup, fetchActiveEpicRuns, fetchEpicRunState, pollCiChecksForCommit, resolveConductorBridgeApiAccess, } from "./bridge-api-client.js";
|
|
15
|
+
import { fetchEffectiveSupervisorSetup, fetchActiveEpicRuns, fetchEpicRunState, pollCiChecksForCommit, classifyCiPollAvailability, resolveConductorBridgeApiAccess, } from "./bridge-api-client.js";
|
|
16
16
|
/** Default gate-config fetcher: reads done_gate_config from the supervisor setup. */
|
|
17
17
|
async function _fetchGateConfigDefault(access) {
|
|
18
18
|
const setup = await fetchEffectiveSupervisorSetup(access);
|
|
@@ -138,7 +138,8 @@ async function observeWithResolved(binding, access, gateConfig, deps, expectedBa
|
|
|
138
138
|
((input, dimensions) => emitConductorEventIfNew(input, dimensions, {
|
|
139
139
|
emitEvent: emitConductorEventFn,
|
|
140
140
|
}));
|
|
141
|
-
const pollCi = deps.pollCi ??
|
|
141
|
+
const pollCi = deps.pollCi ??
|
|
142
|
+
((pollAccess, commitRef, requiredChecks) => pollCiChecksForCommit(pollAccess, commitRef, undefined, requiredChecks));
|
|
142
143
|
const now = deps.now ?? (() => new Date().toISOString());
|
|
143
144
|
// Resolve run_id/worker_id for attribution. Env takes precedence; fall back
|
|
144
145
|
// to the injected resolution seam when the env identity is absent.
|
|
@@ -191,13 +192,21 @@ async function observeWithResolved(binding, access, gateConfig, deps, expectedBa
|
|
|
191
192
|
// 2. Poll CI for the bound head SHA. A poll failure is NOT a CI failure event.
|
|
192
193
|
let rawPoll;
|
|
193
194
|
try {
|
|
194
|
-
rawPoll = await pollCi(access, binding.head_sha);
|
|
195
|
+
rawPoll = await pollCi(access, binding.head_sha, []);
|
|
195
196
|
}
|
|
196
197
|
catch {
|
|
197
198
|
result.ci_status = "unavailable";
|
|
198
199
|
result.reason = "ci-poll-failed";
|
|
199
200
|
return result;
|
|
200
201
|
}
|
|
202
|
+
// BAPI-1527: unreadable check configuration or provider access is a missing
|
|
203
|
+
// capability, not a CI result. Report it as unavailable BEFORE snapshot
|
|
204
|
+
// normalization, so no CI-failure telemetry and no `gate.met` can follow.
|
|
205
|
+
if (classifyCiPollAvailability(rawPoll) === "configuration_unavailable") {
|
|
206
|
+
result.ci_status = "unavailable";
|
|
207
|
+
result.reason = "ci-checks-unavailable: required-check configuration or provider access could not be read";
|
|
208
|
+
return result;
|
|
209
|
+
}
|
|
201
210
|
const snapshot = normalizeCiSnapshot(rawPoll);
|
|
202
211
|
// 3. CI observation telemetry (only for terminal states).
|
|
203
212
|
const ciEvent = buildCiObservationEventInput(binding, snapshot, run_id, worker_id);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { READINESS_PREREQUISITE_BY_ID, READINESS_LEGACY_IDS, READINESS_PREREQUISITE_CATALOG } from '../readiness-prerequisites.generated.js';
|
|
3
3
|
import { resolveReadinessRemedy } from '../printed-remedy-commands.js';
|
|
4
4
|
import { createReadinessCheckSafely } from '../readiness-check.js';
|
|
5
|
+
import { profileMergeNeededFrom } from '../mcp-host-config.js';
|
|
5
6
|
export function mergeReadinessPrerequisites(checks, server = []) {
|
|
6
7
|
const rows = new Map();
|
|
7
8
|
for (const check of checks) {
|
|
@@ -40,8 +41,85 @@ export function mergeReadinessPrerequisites(checks, server = []) {
|
|
|
40
41
|
...[...rows.values()].filter(row => !known.has(row.id)),
|
|
41
42
|
];
|
|
42
43
|
}
|
|
44
|
+
/** BAPI-1747 — the install.run-tools-visible row: the one row only this host can observe. */
|
|
45
|
+
export const RUN_TOOLS_VISIBLE_ID = 'install.run-tools-visible';
|
|
46
|
+
/**
|
|
47
|
+
* BAPI-1719/1747 — project one read-only profile inspection onto the tool-visibility
|
|
48
|
+
* state. The single owner of that mapping: install's setup item and the readiness
|
|
49
|
+
* overlay both use it, so `local.tool-visibility` and the contract row cannot disagree.
|
|
50
|
+
* A config that registers Bridge twice comes first (the writer refuses it); an
|
|
51
|
+
* unreadable config is never read as satisfied.
|
|
52
|
+
*/
|
|
53
|
+
export function toolVisibilityStateFromInspection(inspection) {
|
|
54
|
+
const duplicates = inspection.configs.filter((c) => c.duplicateRegistration === true).map((c) => c.path);
|
|
55
|
+
if (duplicates.length > 0)
|
|
56
|
+
return { state: 'duplicate_registration', configPaths: duplicates };
|
|
57
|
+
if (profileMergeNeededFrom(inspection)) {
|
|
58
|
+
return { state: 'needs_merge', configPaths: inspection.configs.filter((c) => c.state === 'token-absent').map((c) => c.path) };
|
|
59
|
+
}
|
|
60
|
+
if (inspection.configs.some((c) => c.state === 'unreadable'))
|
|
61
|
+
return { state: 'unknown', reason: 'inspection' };
|
|
62
|
+
return inspection.bridgeEntryPresent ? { state: 'met' } : { state: 'no_entry' };
|
|
63
|
+
}
|
|
64
|
+
const SAFE_FINDING_NAME = /^[A-Za-z0-9 _./:()[\]@#+-]{1,100}$/;
|
|
65
|
+
/**
|
|
66
|
+
* The run-tools-visible row for a local observation. Never blocking and never
|
|
67
|
+
* authorization evidence: a confirmed hidden group is a warning, and no observation
|
|
68
|
+
* (a server-only caller, or an unreadable config) is `unknown`.
|
|
69
|
+
*/
|
|
70
|
+
export function toolVisibilityPrerequisite(state) {
|
|
71
|
+
const descriptor = READINESS_PREREQUISITE_BY_ID.get(RUN_TOOLS_VISIBLE_ID);
|
|
72
|
+
const base = { id: descriptor.id, label: descriptor.label, scope: descriptor.scope };
|
|
73
|
+
if (state?.state === 'met')
|
|
74
|
+
return { ...base, check_status: 'met', impact: 'info', fix: '' };
|
|
75
|
+
if (state === undefined || state.state === 'unknown') {
|
|
76
|
+
return { ...base, check_status: 'unknown', impact: 'warning',
|
|
77
|
+
fix: resolveReadinessRemedy({ id: descriptor.id, state: 'unknown', scope: descriptor.scope }),
|
|
78
|
+
findings: [{ reason: 'tools_unobserved', status: 'unknown', names: [] }] };
|
|
79
|
+
}
|
|
80
|
+
const paths = state.state === 'no_entry' ? [] : state.configPaths.filter(p => SAFE_FINDING_NAME.test(p)).slice(0, 20);
|
|
81
|
+
return { ...base, check_status: 'not_met', impact: 'warning',
|
|
82
|
+
fix: resolveReadinessRemedy({ id: descriptor.id, state: 'not_met', scope: descriptor.scope, impact: 'warning' }),
|
|
83
|
+
findings: [{ reason: 'tools_hidden', status: 'not_met', names: paths }] };
|
|
84
|
+
}
|
|
85
|
+
const CATALOG_ORDER = new Map(READINESS_PREREQUISITE_CATALOG.map((d, i) => [d.id, i]));
|
|
86
|
+
/**
|
|
87
|
+
* BAPI-1747 — the one client overlay every readiness surface (launch preview, install's
|
|
88
|
+
* final verdict, doctor) composes its rows with. It merges the server rows exactly as
|
|
89
|
+
* {@link mergeReadinessPrerequisites} does, then replaces ONLY the run-tools-visible row
|
|
90
|
+
* with this invocation's local observation. With no server row and no local observation
|
|
91
|
+
* the row is left out, so a caller that knows nothing about tool visibility is unchanged.
|
|
92
|
+
* Inputs are never mutated; catalog rows stay before rows this build does not know.
|
|
93
|
+
*/
|
|
94
|
+
export function overlayReadinessPrerequisites(checks, server = [], toolVisibility) {
|
|
95
|
+
const merged = mergeReadinessPrerequisites(checks, server);
|
|
96
|
+
const present = merged.some(p => p.id === RUN_TOOLS_VISIBLE_ID);
|
|
97
|
+
if (!present && toolVisibility === undefined)
|
|
98
|
+
return merged;
|
|
99
|
+
const local = toolVisibilityPrerequisite(toolVisibility);
|
|
100
|
+
const rows = present ? merged.map(p => p.id === RUN_TOOLS_VISIBLE_ID ? local : p) : [...merged, local];
|
|
101
|
+
const rank = (id) => CATALOG_ORDER.get(id) ?? Number.MAX_SAFE_INTEGER;
|
|
102
|
+
// A stable sort keeps unknown server rows in their arrival order after the catalog.
|
|
103
|
+
return rows.map((row, i) => ({ row, i })).sort((a, b) => rank(a.row.id) - rank(b.row.id) || a.i - b.i).map(x => x.row);
|
|
104
|
+
}
|
|
105
|
+
function findingNames(f) {
|
|
106
|
+
const names = f.names.join(', ');
|
|
107
|
+
const extra = typeof f.count === 'number' && f.count > f.names.length ? ` (+${f.count - f.names.length} more)` : '';
|
|
108
|
+
return names ? `${names}${extra}` : extra.trim();
|
|
109
|
+
}
|
|
110
|
+
/** One line per finding, gaps first: the reason token and the names it concerns. */
|
|
111
|
+
export function formatReadinessFindings(findings, indent = ' ') {
|
|
112
|
+
if (!findings?.length)
|
|
113
|
+
return [];
|
|
114
|
+
const ordered = [...findings.filter(f => f.status === 'not_met'), ...findings.filter(f => f.status === 'unknown')];
|
|
115
|
+
return ordered.map(f => {
|
|
116
|
+
const kind = f.status === 'not_met' ? 'Gap' : "Couldn't check";
|
|
117
|
+
const names = findingNames(f);
|
|
118
|
+
return `${indent}${kind} (${f.reason})${names ? `: ${names}` : ''}`;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
43
121
|
export function prerequisiteChecks(items) {
|
|
44
|
-
return items.map(p => createReadinessCheckSafely({ id: p.id, source: 'server', label: p.label,
|
|
122
|
+
return items.map(p => createReadinessCheckSafely({ id: p.id, source: 'server', label: p.label || p.id,
|
|
45
123
|
status: p.check_status === 'met' ? 'pass' : p.check_status === 'not_applicable' ? 'skip' : p.check_status === 'unknown' || p.impact !== 'blocking' ? 'warn' : 'fail',
|
|
46
124
|
blocking: p.impact === 'blocking', detail: p.check_status,
|
|
47
125
|
...(p.fix ? { remediation: p.fix } : {}) }));
|
|
@@ -53,7 +131,16 @@ export function formatReadinessPrerequisites(items, options = {}) {
|
|
|
53
131
|
const verdict = blockers.length ? `Not ready: ${blockers.length} blocking` : warnings.length ? `Ready, with ${warnings.length} warnings` : 'Ready to launch';
|
|
54
132
|
const selected = options.all ? visible : [...blockers, ...warnings];
|
|
55
133
|
const state = { met: 'Met', not_met: 'Not met', unknown: "Couldn't check", not_applicable: 'Not applicable' };
|
|
56
|
-
|
|
134
|
+
const severity = (p) => p.check_status === 'not_met' ? (p.impact === 'blocking' ? ' (blocking)' : ' (warning)') : '';
|
|
135
|
+
// A row with named findings, or one this build does not know, prints its ID after
|
|
136
|
+
// the state so every surface names the same row (BAPI-1747); other rows keep their
|
|
137
|
+
// label-only line. Findings follow their row, gaps before unreadable observations.
|
|
138
|
+
const showId = (p) => (p.findings?.length ?? 0) > 0 || !READINESS_PREREQUISITE_BY_ID.has(p.id);
|
|
139
|
+
return [verdict, ...selected.flatMap(p => [
|
|
140
|
+
` ${p.label || p.id}: ${state[p.check_status]}${severity(p)}${showId(p) ? ` [${p.id}]` : ''}`,
|
|
141
|
+
...formatReadinessFindings(['not_met', 'unknown'].includes(p.check_status) ? p.findings : undefined),
|
|
142
|
+
...(p.fix && ['not_met', 'unknown'].includes(p.check_status) ? [` ${p.fix}`] : []),
|
|
143
|
+
])];
|
|
57
144
|
}
|
|
58
145
|
/** The explicit assessment path never derives policy from legacy text. */
|
|
59
146
|
export { composeReadinessAssessment, deriveAdvisoryVerdict } from './readiness-assessment.js';
|
|
@@ -34,9 +34,11 @@ import { READINESS_PREREQUISITE_BY_ID } from "../readiness-prerequisites.generat
|
|
|
34
34
|
* The one exception is {@link inspectWorkflowPresence}, which awaits the
|
|
35
35
|
* READ-ONLY reader seams its caller injects and never opens a path of its own.
|
|
36
36
|
*/
|
|
37
|
-
import { CONSUMER_GUIDE_POINTER, PRINTED_CONNECT_GITHUB_COMMAND } from "../printed-remedy-commands.js";
|
|
37
|
+
import { CONSUMER_GUIDE_POINTER, PRINTED_CONNECT_GITHUB_COMMAND, PRINTED_CONDUCTOR_INSTALL_COMMAND } from "../printed-remedy-commands.js";
|
|
38
38
|
import { MANAGED_HOOK_NAMES } from "./git-hooks.js";
|
|
39
39
|
import { posixShellQuote } from "../platform-escaping.js";
|
|
40
|
+
import { profileMergeNeededFrom } from "../mcp-host-config.js";
|
|
41
|
+
import { DUPLICATE_REGISTRATION_GUIDANCE } from "../launcher-config-inspection.js";
|
|
40
42
|
import { MCP_PACKAGE_NAME } from "../mcp-identity.js";
|
|
41
43
|
import { CLAUDE_REVIEW_WORKFLOW_DRIFT_REMEDIATION, summarizeClaudeReviewWorkflowDrift, } from "../claude-review-workflow-drift.js";
|
|
42
44
|
import { describeNativeLedgerAvailability, GH_ACTIONS_MERGE_AUTH_REMEDIATION, GH_ACTIONS_MERGE_SKIPPED_DETAIL, GH_ACTIONS_MERGE_UNOBSERVABLE_REMEDIATION, WORKER_DATABASE_DOCTOR_OWNER, WORKER_DATABASE_DOCTOR_RUNBOOK_SECTION, } from "./doctor.js";
|
|
@@ -67,9 +69,16 @@ export const EPIC_IMPLEMENTER_PROFILE_TOKEN = "epic_implementer";
|
|
|
67
69
|
/** Remediation for a host MCP config that carries no Bridge entry at all. */
|
|
68
70
|
export const CONDUCTOR_PROFILE_TOKEN_NO_ENTRY_REMEDIATION = "no supported host MCP config carries a Bridge entry — run " +
|
|
69
71
|
`\`npx ${MCP_PACKAGE_NAME} install\` to register one, then re-run \`install epic-implementer\`.`;
|
|
70
|
-
/**
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Remediation for an entry that exists but lacks the conductor group (BAPI-1719).
|
|
74
|
+
* Names the supported installer command and the manual edit. Either way the group
|
|
75
|
+
* is ADDED to the existing Bridge entry (the other comma-separated groups stay), and
|
|
76
|
+
* the Epic Implementer tools appear only after the MCP client is restarted.
|
|
77
|
+
*/
|
|
78
|
+
export const CONDUCTOR_PROFILE_TOKEN_REMEDIATION = `run \`${PRINTED_CONDUCTOR_INSTALL_COMMAND}\` and approve the tool-visibility choice, or add ` +
|
|
79
|
+
"`epic_implementer` to BRIDGE_MCP_PROFILE in the existing Bridge entry of your MCP configuration " +
|
|
80
|
+
"(keep the other comma-separated groups, for example `sfcc,epic_implementer`); " +
|
|
81
|
+
"then restart your MCP client so the Epic Implementer tools become visible.";
|
|
73
82
|
/** Remediation surfaced whenever the managed git hooks are not usable. */
|
|
74
83
|
export const CONDUCTOR_HOOK_TARGET_REMEDIATION = "re-run `install epic-implementer` and accept the local-observability consent, or run " +
|
|
75
84
|
"`epic-implementer install-git-hooks` directly.";
|
|
@@ -1221,23 +1230,47 @@ export function conductorProfileTokenSection(profile, conductorContext) {
|
|
|
1221
1230
|
const carrying = profile.configs
|
|
1222
1231
|
.filter((c) => c.state === "token-present")
|
|
1223
1232
|
.map((c) => c.path);
|
|
1233
|
+
const unreadable = profile.configs.filter((c) => c.state === "unreadable").map((c) => c.path);
|
|
1224
1234
|
const scope = "inspected .mcp.json, .vscode/mcp.json, .cursor/mcp.json only " +
|
|
1225
1235
|
"(Codex and Copilot host configuration is not inspected)";
|
|
1236
|
+
const unreadableNote = unreadable.length > 0 ? `; could not read ${unreadable.join(", ")}` : "";
|
|
1237
|
+
// BAPI-1719: overall satisfaction is the shared decision setup uses, never "one config has
|
|
1238
|
+
// it". A satisfied registration does not hide a missing group in another config, nor a
|
|
1239
|
+
// config that registers Bridge under both names.
|
|
1240
|
+
if (profileMergeNeededFrom(profile)) {
|
|
1241
|
+
const missing = profile.configs.filter((c) => c.state === "token-absent").map((c) => c.path);
|
|
1242
|
+
const duplicates = profile.configs.filter((c) => c.duplicateRegistration === true).map((c) => c.path);
|
|
1243
|
+
const parts = [];
|
|
1244
|
+
if (missing.length > 0)
|
|
1245
|
+
parts.push(`the \`${profile.token}\` group is not loaded by the Bridge entry in ${missing.join(", ")}`);
|
|
1246
|
+
if (duplicates.length > 0)
|
|
1247
|
+
parts.push(`${duplicates.join(", ")} registers Bridge under two names`);
|
|
1248
|
+
const detail = `${parts.join("; ")}; ${scope}${unreadableNote}`;
|
|
1249
|
+
const remediation = missing.length > 0
|
|
1250
|
+
? CONDUCTOR_PROFILE_TOKEN_REMEDIATION
|
|
1251
|
+
: DUPLICATE_REGISTRATION_GUIDANCE;
|
|
1252
|
+
return conductorContext
|
|
1253
|
+
? { ...base, status: "degraded", detail, remediation }
|
|
1254
|
+
: { ...base, status: "ok", detail: `advisory — ${detail}`, remediation };
|
|
1255
|
+
}
|
|
1226
1256
|
if (carrying.length > 0) {
|
|
1227
1257
|
return {
|
|
1228
1258
|
...base,
|
|
1229
1259
|
status: "ok",
|
|
1230
|
-
detail: `\`${profile.token}\`
|
|
1260
|
+
detail: `\`${profile.token}\` loaded by every Bridge entry in ${carrying.join(", ")}; ${scope}${unreadableNote}`,
|
|
1231
1261
|
};
|
|
1232
1262
|
}
|
|
1233
|
-
//
|
|
1234
|
-
//
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1263
|
+
// Unreadable evidence is not confirmed absence, and "no entry anywhere" is a third finding.
|
|
1264
|
+
// Each has its own next step, so they never collapse into one remediation.
|
|
1265
|
+
if (unreadable.length > 0 && !profile.bridgeEntryPresent) {
|
|
1266
|
+
const detail = `could not read ${unreadable.join(", ")}, so the \`${profile.token}\` group could not be confirmed; ${scope}`;
|
|
1267
|
+
const remediation = "fix or restore the unreadable MCP configuration, then re-run `doctor`.";
|
|
1268
|
+
return conductorContext
|
|
1269
|
+
? { ...base, status: "degraded", detail, remediation }
|
|
1270
|
+
: { ...base, status: "ok", detail: `advisory — ${detail}`, remediation };
|
|
1271
|
+
}
|
|
1272
|
+
const detail = `no supported host config carries a Bridge entry; ${scope}`;
|
|
1273
|
+
const remediation = CONDUCTOR_PROFILE_TOKEN_NO_ENTRY_REMEDIATION;
|
|
1241
1274
|
return conductorContext
|
|
1242
1275
|
? { ...base, status: "degraded", detail, remediation }
|
|
1243
1276
|
: { ...base, status: "ok", detail: `advisory — ${detail}`, remediation };
|
|
@@ -97,15 +97,15 @@ import { mergeReadinessPrerequisites, formatReadinessPrerequisites } from "./rea
|
|
|
97
97
|
* unrelated additive change look like a breaking one here, or worse, hide a real
|
|
98
98
|
* one.
|
|
99
99
|
*/
|
|
100
|
-
import { CONSUMER_GUIDE_POINTER, PRINTED_CHECK_NAME_INSTRUCTION, PRINTED_CONDUCTOR_EXECUTOR_INSTALL_COMMAND, PRINTED_CONDUCTOR_INSTALL_COMMAND, PRINTED_CONNECT_GITHUB_COMMAND, PRINTED_EXECUTOR_ID_INSTRUCTION,
|
|
100
|
+
import { CONSUMER_GUIDE_POINTER, PRINTED_CHECK_NAME_INSTRUCTION, PRINTED_CONDUCTOR_EXECUTOR_INSTALL_COMMAND, PRINTED_CONDUCTOR_INSTALL_COMMAND, PRINTED_CONNECT_GITHUB_COMMAND, PRINTED_EXECUTOR_ID_INSTRUCTION, } from "../printed-remedy-commands.js";
|
|
101
101
|
import { mapConductorDoctorReportToReadinessChecks, } from "./doctor.js";
|
|
102
102
|
import { mapInstallStatusChecksToReadinessChecks, } from "../install-doctor.js";
|
|
103
103
|
import { mapPlanePreflightToReadinessChecks, } from "../plane/preflight.js";
|
|
104
104
|
import { runConductorInstallDoctor, } from "./install-doctor.js";
|
|
105
|
-
import { BRING_UP_SECTION_LABELS, describeGateProfile, describeGateProfileWarning, effectiveReviewModeIsRepositoryPolicy, EPIC_BRANCH_CI_SECTION_IDS, epicBranchCiSections, presentRequiredChecks,
|
|
105
|
+
import { BRING_UP_SECTION_LABELS, describeGateProfile, describeGateProfileWarning, effectiveReviewModeIsRepositoryPolicy, EPIC_BRANCH_CI_SECTION_IDS, epicBranchCiSections, presentRequiredChecks, } from "./readiness-sections.js";
|
|
106
106
|
import { classifyBringUpFacts } from "./bring-up-facts.js";
|
|
107
107
|
import { projectReadinessRowBlocking, providerRepositoryCheck, resolvedMergeModeCheck, } from "../v2-readiness-requirements.js";
|
|
108
|
-
import { CI_WORKFLOW_PATH, REVIEW_WORKFLOW_PATH, ciWorkflowRemedy, repositoryWorkflowRemedy, } from "./repository-workflow-remedy.js";
|
|
108
|
+
import { CI_WORKFLOW_PATH, REVIEW_WORKFLOW_PATH, ciWorkflowRemedy, gateProfileReasonRemedy, repositoryWorkflowRemedy, } from "./repository-workflow-remedy.js";
|
|
109
109
|
import { classifyMergeExecutionEligibility, MERGE_EXECUTION_INELIGIBLE_REMEDIATION, MERGE_EXECUTION_UNVERIFIABLE_REMEDIATION, } from "./merge-execution-eligibility.js";
|
|
110
110
|
import { createReadinessCheck, createReadinessCheckSafely, summarizeReadinessChecks, validateReadinessChecks, } from "../readiness-check.js";
|
|
111
111
|
import { ADMISSION_EVIDENCE_SCHEMA_VERSION, gateProfileWaivesCiWorkflow, } from "./bridge-api-client.js";
|
|
@@ -481,43 +481,6 @@ function admissionReasonRemedy(record, readiness) {
|
|
|
481
481
|
return gateProfileReasonRemedy(record.reason, record.verdict, record.subject ?? null);
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
-
/** The provider-evidence window the server searches, spelled once for the remedies. */
|
|
485
|
-
const PROVIDER_EVIDENCE_WINDOW = "the last 12 default-branch commits or 8 merged pull-request heads from the last 90 days";
|
|
486
|
-
/**
|
|
487
|
-
* BAPI-1390 — fixed remedies for the four gate-profile reasons. Everything is a
|
|
488
|
-
* literal except the validated `subject`. `null` for any other reason, so an
|
|
489
|
-
* unknown reason falls back to the owner's generic remedy.
|
|
490
|
-
*/
|
|
491
|
-
function gateProfileReasonRemedy(reason, verdict, subject) {
|
|
492
|
-
switch (reason) {
|
|
493
|
-
case "provider_check_unseen":
|
|
494
|
-
return (`a repository administrator confirms that the check ${quotedSubject(subject, "named in the gate profile")} ` +
|
|
495
|
-
`reports on the default branch — it was not seen on ${PROVIDER_EVIDENCE_WINDOW} — or edits the gate ` +
|
|
496
|
-
"profile; setup never grants it.");
|
|
497
|
-
case "provider_evidence_unavailable":
|
|
498
|
-
return (`Bridge could not read the provider's check history for ${quotedSubject(subject, "a gate-profile check")} ` +
|
|
499
|
-
`(${PROVIDER_EVIDENCE_WINDOW}), so it is unknown, not absent. Re-run readiness; if it persists, ` +
|
|
500
|
-
"email info@bridgegpt.ai.");
|
|
501
|
-
case "local_command_unqualified":
|
|
502
|
-
return verdict === "unable_to_verify"
|
|
503
|
-
? `the qualification of the local gate command ${quotedSubject(subject, "in the gate profile")} could not ` +
|
|
504
|
-
"be read, so it is unknown, not qualified. Re-run readiness; if it persists, email info@bridgegpt.ai."
|
|
505
|
-
: `the local gate command ${quotedSubject(subject, "in the gate profile")} is not qualified for the current ` +
|
|
506
|
-
"gate-profile revision (unqualified or stale). Qualify it with " +
|
|
507
|
-
`\`${PRINTED_QUALIFY_GATE_COMMAND}\`, or have a repository administrator ` +
|
|
508
|
-
"edit the gate profile.";
|
|
509
|
-
case "migration_guard_unset":
|
|
510
|
-
return verdict === "unable_to_verify"
|
|
511
|
-
? "Bridge could not confirm whether this repository has alembic.ini on its default branch, so it could " +
|
|
512
|
-
"not decide whether the gate profile needs a migration guard. Re-run readiness, or have a repository " +
|
|
513
|
-
"administrator set a migration guard in the gate profile."
|
|
514
|
-
: "this repository has alembic.ini on its default branch, so its gate profile must name a migration " +
|
|
515
|
-
"guard (a provider check or a local command). A repository administrator sets it in the gate " +
|
|
516
|
-
"profile; setup never grants it.";
|
|
517
|
-
default:
|
|
518
|
-
return null;
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
484
|
const GATE_PROFILE_WARNING_REMEDIATION = "no action is needed to launch; confirm the check reports once an epic branch runs CI.";
|
|
522
485
|
/**
|
|
523
486
|
* BAPI-1390 — the gate-profile row plus one warn row per warning. Appended
|
|
@@ -215,6 +215,8 @@ const STOP_RUN_USAGE = [
|
|
|
215
215
|
"Stop an epic run: block new dispatch and cancel its queued work. The run",
|
|
216
216
|
"record is preserved (never deleted) so its history stays inspectable.",
|
|
217
217
|
"Idempotent — repeating it once stopped is a safe no-op.",
|
|
218
|
+
"A stopped run is paused, not ended. To end an active or stopped run in one",
|
|
219
|
+
"step, use: epic-implementer abandon-run --epic-run-id <id>",
|
|
218
220
|
].join("\n");
|
|
219
221
|
function renderStopRunResult(result, json) {
|
|
220
222
|
if (json) {
|
|
@@ -977,7 +979,7 @@ export function parseRerunCiArgs(argv) {
|
|
|
977
979
|
const RERUN_CI_STATUS_TEXT = {
|
|
978
980
|
enqueued: "re-run requested",
|
|
979
981
|
deduplicated: "already requested",
|
|
980
|
-
deferred: "deferred (not requested; run the verb again after a fresh
|
|
982
|
+
deferred: "deferred (not requested; run the verb again after a fresh read with the explain_run MCP tool)",
|
|
981
983
|
not_re_runnable: "not re-runnable",
|
|
982
984
|
};
|
|
983
985
|
const RERUN_CI_REASON_TEXT = {
|
|
@@ -991,11 +993,11 @@ const RERUN_CI_OUTCOME_TEXT = {
|
|
|
991
993
|
nothing_to_enqueue: "nothing to enqueue (no failed check could be re-run)",
|
|
992
994
|
};
|
|
993
995
|
const RERUN_CI_NEXT_ACTION = {
|
|
994
|
-
enqueued: "Wait for the re-runs to finish, then
|
|
996
|
+
enqueued: "Wait for the re-runs to finish, then call the `explain_run` MCP tool (input `epic_run_id`). When CI is " +
|
|
995
997
|
"green use `epic-implementer resume-ci` (a parked ticket); this verb did not mark CI passed.",
|
|
996
|
-
partial: "Some runs were not requested.
|
|
998
|
+
partial: "Some runs were not requested. Call the `explain_run` MCP tool and, if still " +
|
|
997
999
|
"offered, re-run the command it renders with its fresh binding.",
|
|
998
|
-
nothing_to_enqueue: "No re-run was possible.
|
|
1000
|
+
nothing_to_enqueue: "No re-run was possible. Call the `explain_run` MCP tool; for a code defect use " +
|
|
999
1001
|
"`dispatch-remediation --context-file`.",
|
|
1000
1002
|
};
|
|
1001
1003
|
function rerunCiCheckLine(check) {
|
|
@@ -1040,7 +1042,7 @@ export function renderRerunCiOutcome(outcome, parsed, json) {
|
|
|
1040
1042
|
` outcome: ${RERUN_CI_OUTCOME_TEXT[result.outcome] ?? result.outcome}`,
|
|
1041
1043
|
" failed checks:",
|
|
1042
1044
|
...result.checks.map(rerunCiCheckLine),
|
|
1043
|
-
` next action: ${RERUN_CI_NEXT_ACTION[result.outcome] ?? "
|
|
1045
|
+
` next action: ${RERUN_CI_NEXT_ACTION[result.outcome] ?? "Call the `explain_run` MCP tool (input `epic_run_id`)."}`,
|
|
1044
1046
|
` request: ${outcome.requestId}${outcome.referenceReused ? " (re-sent from the local reference)" : ""}`,
|
|
1045
1047
|
` event recorded: ${result.event_recorded}`,
|
|
1046
1048
|
];
|
|
@@ -1279,7 +1281,7 @@ export function renderResolveHandoffOutcome(outcome, parsed, json) {
|
|
|
1279
1281
|
}
|
|
1280
1282
|
else {
|
|
1281
1283
|
console.error(`Failed: resolve-handoff for ${label} — ${outcome.message}. Whether the decision was ` +
|
|
1282
|
-
"recorded is unconfirmed;
|
|
1284
|
+
"recorded is unconfirmed; call the `explain_run` MCP tool (input `epic_run_id`) before retrying.");
|
|
1283
1285
|
}
|
|
1284
1286
|
return RESOLVE_HANDOFF_EXIT_FAILED;
|
|
1285
1287
|
}
|
|
@@ -1328,7 +1330,7 @@ const ACKNOWLEDGE_GAPS_USAGE = [
|
|
|
1328
1330
|
"gap, driver merge and out-of-engine merge the run carried forward. The integration PR",
|
|
1329
1331
|
"stays in draft until the owner acknowledges the list's CURRENT digest; a new entry",
|
|
1330
1332
|
"changes the digest and holds it again. Read the list on the integration PR report or",
|
|
1331
|
-
"with `
|
|
1333
|
+
"with the `explain_run` MCP tool (input `epic_run_id`; see carried_gap_list) and pass its digest exactly.",
|
|
1332
1334
|
"",
|
|
1333
1335
|
"This is the OWNER's step. The /drive-epic-run driver never runs it and workers",
|
|
1334
1336
|
"cannot. The server records your verified API-key identity as the actor; you cannot",
|
|
@@ -1346,7 +1348,7 @@ export function parseAcknowledgeGapsArgs(argv) {
|
|
|
1346
1348
|
}
|
|
1347
1349
|
const digest = requireFlag(values, "--digest");
|
|
1348
1350
|
if (!/^[0-9a-f]{64}$/.test(digest)) {
|
|
1349
|
-
throw new ConductorValidationError("--digest must be the 64-character lowercase hex list digest from the report or
|
|
1351
|
+
throw new ConductorValidationError("--digest must be the 64-character lowercase hex list digest from the report or the explain_run MCP tool.");
|
|
1350
1352
|
}
|
|
1351
1353
|
const reason = boundedText(values, "--reason", GAP_ACKNOWLEDGEMENT_REASON_MAX_CHARS);
|
|
1352
1354
|
if (!reason.trim()) {
|
|
@@ -1400,7 +1402,7 @@ export function renderAcknowledgeGapsOutcome(outcome, parsed, json) {
|
|
|
1400
1402
|
else if (outcome.code === "GAP_DIGEST_STALE") {
|
|
1401
1403
|
console.error(`Refused: acknowledge-gaps for ${label} — GAP_DIGEST_STALE: the list changed since ` +
|
|
1402
1404
|
"you read it. Nothing was written. Re-read the integration PR report or " +
|
|
1403
|
-
"`
|
|
1405
|
+
"the `explain_run` MCP tool (input `epic_run_id`; see carried_gap_list) and acknowledge the new digest.");
|
|
1404
1406
|
}
|
|
1405
1407
|
else {
|
|
1406
1408
|
console.error(`Refused: acknowledge-gaps for ${label} — ${outcome.code}: ${outcome.message} ` +
|
|
@@ -1947,7 +1949,7 @@ const CI_ROUTE_GUIDANCE = {
|
|
|
1947
1949
|
ci_route_rerun: "This is an infrastructure CI failure; the server's infrastructure re-run path owns it " +
|
|
1948
1950
|
"(rerun-ci). No repair was dispatched.",
|
|
1949
1951
|
ci_route_hold: "CI routing is holding; no widened repair was dispatched. Re-read the run state " +
|
|
1950
|
-
"(
|
|
1952
|
+
"(the `explain_run` MCP tool) before choosing another action.",
|
|
1951
1953
|
driver_context_not_supported: "This continuation cannot carry --context-file into a worker prompt. Drop --context-file " +
|
|
1952
1954
|
"and re-run with --reason only. Nothing was written.",
|
|
1953
1955
|
};
|
|
@@ -2304,7 +2306,7 @@ const RESUME_CI_REFUSAL_GUIDANCE = {
|
|
|
2304
2306
|
CI_STOP_NOT_ELIGIBLE: "The existing explicit path is `epic-implementer unpark`, which RESETS the CI gate's " +
|
|
2305
2307
|
"clock and repair allowance. If the park's origin is unclear, ask the run operator " +
|
|
2306
2308
|
"to assess it first.",
|
|
2307
|
-
CI_RESUME_STALE_OPERATION: "
|
|
2309
|
+
CI_RESUME_STALE_OPERATION: "Call the `explain_run` MCP tool (inputs `epic_run_id`, `ticket_key`); start a new resume-ci only if " +
|
|
2308
2310
|
"its current stop independently qualifies.",
|
|
2309
2311
|
CI_RESUME_CHECKS_NOT_GREEN: "Wait for the required checks to finish green, then retry.",
|
|
2310
2312
|
CI_RESUME_VERDICT_UNAVAILABLE: "Retry later. If the provider stays unavailable, escalate to the CI-platform operator.",
|
|
@@ -2561,7 +2563,7 @@ const REGENERATE_PLAN_REFUSAL_SENTENCES = {
|
|
|
2561
2563
|
SPEC_SNAPSHOT_UNAVAILABLE: "the ticket's current specification could not be read",
|
|
2562
2564
|
CONFLICT: "the ticket kept changing while the request was being applied",
|
|
2563
2565
|
};
|
|
2564
|
-
const REGENERATE_PLAN_GUIDANCE = "
|
|
2566
|
+
const REGENERATE_PLAN_GUIDANCE = "Call the `explain_run` MCP tool (inputs `epic_run_id`, `ticket_key`) for the ticket's current park and next action.";
|
|
2565
2567
|
const REGENERATE_PLAN_NOT_ELIGIBLE_TEXT = {
|
|
2566
2568
|
ticket_not_found: "the ticket is not part of this run",
|
|
2567
2569
|
not_parked: "the ticket is not parked",
|