@bridge_gpt/mcp-server 0.2.71 → 0.2.73
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 +55 -17
- package/build/agent-launchers/claude-executor-adapter.js +22 -3
- package/build/agent-notes.js +171 -95
- package/build/agents.generated.js +7 -7
- package/build/bridge-permissions.js +31 -0
- package/build/bridge-worktree-inspection.js +237 -0
- package/build/check-evidence.js +6 -0
- package/build/ci-system-detection.js +50 -0
- package/build/ci-trigger-adapters.js +631 -0
- package/build/ci-trigger-install.js +106 -0
- package/build/claude-review-workflow.js +1 -1
- package/build/cli-help.js +6 -0
- package/build/codex-auto-recovery.js +126 -0
- package/build/codex-launcher-pin.js +33 -2
- package/build/codex-skill-adapter.js +5 -1
- package/build/command-host.js +33 -0
- package/build/commands.generated.js +7 -6
- package/build/conductor/bridge-api-client.js +1352 -50
- package/build/conductor/bring-up-facts.js +18 -5
- package/build/conductor/command-drift-production.js +42 -17
- package/build/conductor/command-drift.js +47 -0
- package/build/conductor/declare-blocked.js +554 -0
- package/build/conductor/doctor.js +187 -28
- package/build/conductor/driver-commands.js +141 -0
- package/build/conductor/driver-guard.js +277 -0
- package/build/conductor/driver-lapse.js +321 -0
- package/build/conductor/driver-register.js +176 -0
- package/build/conductor/driver-release.js +174 -0
- package/build/conductor/driver-session-state.js +315 -0
- package/build/conductor/epic-branch-ci-inspection.js +222 -29
- package/build/conductor/epic-implementer-cli.js +213 -13
- package/build/conductor/epic-server-database.js +162 -0
- package/build/conductor/epic-server-guidance.js +278 -0
- package/build/conductor/epic-server-journal.js +239 -0
- package/build/conductor/epic-server-processes.js +324 -0
- package/build/conductor/epic-server-recipe.js +397 -0
- package/build/conductor/epic-server-runtime.js +1207 -0
- package/build/conductor/epic-server-sfcc.js +107 -0
- package/build/conductor/epic-server-state.js +427 -0
- package/build/conductor/epic-server.js +594 -0
- package/build/conductor/gate-discovery.js +281 -10
- package/build/conductor/gate-settings-review.js +525 -5
- package/build/conductor/git-hooks-uninstall.js +112 -0
- package/build/conductor/git-hooks.js +81 -15
- package/build/conductor/guided-repair.js +10 -1
- package/build/conductor/install-doctor.js +2 -4
- package/build/conductor/launch-need-probes.js +6 -53
- package/build/conductor/launch-plan.js +318 -121
- package/build/conductor/local-merge.js +12 -1
- package/build/conductor/merge-execution-contract.js +1 -1
- package/build/conductor/merged-child-check.js +2 -1
- package/build/conductor/prerequisite-inputs.js +1213 -0
- package/build/conductor/readiness-assessment.js +93 -0
- package/build/conductor/readiness-cli.js +30 -9
- package/build/conductor/readiness-prerequisites.js +77 -5
- package/build/conductor/readiness-sections.js +146 -126
- package/build/conductor/readiness.js +21 -3
- package/build/conductor/recovery-cli.js +236 -15
- package/build/conductor/recovery-operations.js +34 -4
- package/build/conductor/repair-contract.js +33 -0
- package/build/conductor/tools.js +36 -4
- package/build/conductor/wait-run-attention.js +115 -0
- package/build/conductor/wait-run-cli.js +300 -21
- package/build/conductor/worker-database-doctor-inspector.js +34 -2
- package/build/conductor/worker-setup-tally.js +27 -0
- package/build/credential-store.js +96 -21
- package/build/dependency-install-declarations.js +212 -0
- package/build/docs.generated.js +4 -4
- package/build/doctor.js +91 -8
- package/build/drive-epic-help.js +23 -4
- package/build/drive-epic.js +1841 -340
- package/build/engine-paths.js +20 -0
- package/build/epic-branch-ci-summary.js +140 -0
- package/build/epic-capability-statement.js +107 -0
- package/build/epic-ci-workflow-drift.js +30 -15
- package/build/epic-ci-workflow-install.js +110 -42
- package/build/epic-ci-workflow-v2.js +274 -0
- package/build/epic-ci-workflow.js +38 -12
- package/build/epic-implementer-bin.js +2184 -52
- package/build/epic-launch-context.js +607 -0
- package/build/epic-launch-profile.js +1 -1
- package/build/epic-server-record.js +273 -0
- package/build/epic-shared/bridge-client.js +11 -3
- package/build/escalation-reachability.js +43 -0
- package/build/executor/ci-fix-test-runs.js +334 -0
- package/build/executor/cli.js +2 -0
- package/build/executor/completion-contract.js +24 -1
- package/build/executor/credentials.js +1 -1
- package/build/executor/delivery-observations.js +113 -0
- package/build/executor/delivery-outcome.js +30 -0
- package/build/executor/dependency-refresh-runner.js +132 -0
- package/build/executor/dependency-refresh.js +530 -0
- package/build/executor/deps.js +4 -0
- package/build/executor/env.js +119 -17
- package/build/executor/epic-server-context.js +141 -0
- package/build/executor/gate-qualification-job.js +127 -26
- package/build/executor/harness-coverage.js +19 -0
- package/build/executor/http-client.js +87 -6
- package/build/executor/index.js +2 -1
- package/build/executor/install-preflight.js +1 -1
- package/build/executor/job-runner.js +659 -87
- package/build/executor/likely-tests.js +94 -97
- package/build/executor/observation.js +8 -0
- package/build/executor/pre-pr-checks.js +363 -0
- package/build/executor/prompt-spec.js +127 -5
- package/build/executor/reconcile-overlap-job.js +5 -3
- package/build/executor/required-verification.js +28 -0
- package/build/executor/required-work-diagnostics.js +32 -0
- package/build/executor/required-work-ledger.js +955 -39
- package/build/executor/results.js +100 -0
- package/build/executor/service-discovery.js +42 -0
- package/build/executor/service-lifecycle.js +109 -2
- package/build/executor/service-uninstall.js +205 -0
- package/build/executor/service-unit.js +5 -3
- package/build/executor/terminal-mutation.js +8 -0
- package/build/executor/test-clock.js +3 -0
- package/build/executor/verification-hints.js +179 -0
- package/build/executor/worker-command.js +126 -5
- package/build/executor/worker-database-config.js +281 -0
- package/build/executor/worker-database-target.js +16 -12
- package/build/executor/worker-database.js +575 -116
- package/build/executor/worker-finalization.js +71 -10
- package/build/executor/worker-guard-hook.js +10 -2
- package/build/executor/worker-resources.js +25 -3
- package/build/executor/worker-verification-guidance.js +55 -5
- package/build/executor/worktree-inspection.js +42 -0
- package/build/executor/worktree.js +20 -1
- package/build/executor-launch.js +54 -2
- package/build/generated-assets-catalog.js +2 -2
- package/build/github-sign-in.js +1 -1
- package/build/index.js +1111 -381
- package/build/init.js +29 -14
- package/build/install-bridge-conductor-answers.js +465 -0
- package/build/install-bridge-conductor-apply.js +259 -0
- package/build/install-bridge-conductor-assessment.js +895 -0
- package/build/install-bridge-conductor-compact.js +161 -0
- package/build/install-bridge-conductor-contracts.js +63 -0
- package/build/install-bridge-conductor-gate.js +1383 -188
- package/build/install-bridge-conductor-setup.js +637 -92
- package/build/install-bridge-conductor.js +3163 -740
- package/build/install-bridge.js +601 -128
- package/build/install-maintenance.js +127 -0
- package/build/install-reexec.js +1 -1
- package/build/launcher-config-inspection.js +162 -1
- package/build/local-cleanup.js +59 -0
- package/build/mcp-grant-candidates.js +767 -0
- package/build/mcp-grant-doctor.js +63 -0
- package/build/mcp-grant.js +288 -0
- package/build/mcp-host-targets.js +8 -0
- package/build/mcp-identity.js +23 -0
- package/build/mcp-install-state.js +68 -2
- package/build/mcp-invoke.js +126 -13
- package/build/mcp-presets.js +107 -0
- package/build/mcp-provisioning.js +134 -2
- package/build/mcp-registration-doctor.js +31 -2
- package/build/mcp-server-invocation.js +6 -1
- package/build/merge-workflow-install.js +236 -111
- package/build/package-script-semantics.js +10 -0
- package/build/pipeline-utils.js +1 -1
- package/build/pipelines.generated.js +6 -6
- package/build/plan-discovery.js +97 -4
- package/build/plan-execution-ledger.js +248 -9
- package/build/plan-generation-io.js +262 -0
- package/build/plan-generation.js +424 -0
- package/build/plane/build-freshness.js +6 -1
- package/build/plane/cli.js +75 -9
- package/build/plane/plane-freshness.js +23 -7
- package/build/plane/preflight.js +50 -10
- package/build/plane/shutdown.js +19 -0
- package/build/plane/terminal-run-cleanup.js +23 -5
- package/build/plane/terminal-run-status.js +4 -0
- package/build/printed-remedy-commands.js +229 -15
- package/build/readiness-check.js +1 -1
- package/build/readiness-prerequisites.generated.js +311 -4
- package/build/readme.generated.js +1 -1
- package/build/repository-state-paths.js +38 -0
- package/build/repository-toolchains.js +50 -8
- package/build/run-unit-tests-launcher.js +8 -1
- package/build/setup-change-policy.js +32 -0
- package/build/setup-epic.js +1192 -198
- package/build/setup-progress.js +44 -0
- package/build/setup-question.js +180 -0
- package/build/start-tickets.js +4 -0
- package/build/test-command-detection.js +32 -88
- package/build/test-support/notes-fs.js +40 -0
- package/build/third-party-mcp-targets.js +30 -0
- package/build/ticket-delivery-enrollment.js +30 -8
- package/build/ticket-delivery-run-scope.js +128 -0
- package/build/upgrade-cli.js +85 -2
- package/build/v2-readiness-requirements.js +28 -1
- package/build/version.generated.js +3 -3
- package/build/worker-guard-hook-bin.js +2 -2
- package/build/worktrees.js +105 -0
- package/docs/EPIC-IMPLEMENTER-INSTALL.md +9 -1
- package/docs/EPIC-IMPLEMENTER.md +5 -0
- package/docs/epic-implementer/getting-started.md +42 -15
- package/docs/epic-implementer/self-hosting.md +14 -1
- package/package.json +2 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BAPI-1594 — the engine's own paths. A local launch runs engine code from this
|
|
3
|
+
* checkout, so an uncommitted change under any of them is code CI has not seen;
|
|
4
|
+
* a clean status here means the checkout is what CI verified.
|
|
5
|
+
*/
|
|
6
|
+
export const ENGINE_PATHS = [
|
|
7
|
+
"mcp_server/src/",
|
|
8
|
+
"mcp_server/tsconfig.json",
|
|
9
|
+
"mcp_server/package.json",
|
|
10
|
+
"mcp_server/package-lock.json",
|
|
11
|
+
"api/library/epic_implementer/",
|
|
12
|
+
"api/library/db/epic_runs.py",
|
|
13
|
+
"api/library/github/merge_execution_eligibility.py",
|
|
14
|
+
"api/routes/epic_runs.py",
|
|
15
|
+
"db/alembic/",
|
|
16
|
+
"requirements.txt",
|
|
17
|
+
"scripts/conductor_health_check.py",
|
|
18
|
+
"tests/integration/conductor_harness/",
|
|
19
|
+
"tests/pytest/db/test_executor_protocol_contract_fidelity.py",
|
|
20
|
+
];
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BAPI-1654 — the owner-facing words about checks on epic branches.
|
|
3
|
+
*
|
|
4
|
+
* Pure. It turns the collected evidence (coverage, the CI change on offer, the
|
|
5
|
+
* detected CI systems, and whether CI runs on the final integration pull
|
|
6
|
+
* request) into plain sentences, one distinct text per state:
|
|
7
|
+
*
|
|
8
|
+
* - confirmed coverage;
|
|
9
|
+
* - confirmed exclusion, naming the workflow and its filter;
|
|
10
|
+
* - unknown;
|
|
11
|
+
* - a CI change on offer (a trigger edit, or Bridge's managed workflow);
|
|
12
|
+
* - a proposed but unmerged change: proposed, not coverage;
|
|
13
|
+
* - no offer, or a declined one: child pull requests merge without checks;
|
|
14
|
+
* - a CI system Bridge has no adapter for, named.
|
|
15
|
+
*
|
|
16
|
+
* Two rules hold everywhere:
|
|
17
|
+
* - "child pull requests merge into the epic branch without checks" is said
|
|
18
|
+
* only when no check is confirmed to run there and no managed workflow is on
|
|
19
|
+
* offer; for unreadable coverage the words are "could not be confirmed".
|
|
20
|
+
* - "CI runs on the final integration pull request" is said only when the
|
|
21
|
+
* workflows were confirmed to run on pull requests into that base branch.
|
|
22
|
+
*
|
|
23
|
+
* No internal key, id, reason token, or stage name appears in the text.
|
|
24
|
+
*/
|
|
25
|
+
const GITHUB_ACTIONS = "GitHub Actions";
|
|
26
|
+
/** At most this many excluded workflows are named one by one. */
|
|
27
|
+
const MAX_NAMED_WORKFLOWS = 5;
|
|
28
|
+
function quoteList(branches) {
|
|
29
|
+
return branches.map((b) => `'${b}'`).join(", ");
|
|
30
|
+
}
|
|
31
|
+
/** "A", "A and B", "A, B, and C". */
|
|
32
|
+
export function joinNames(names) {
|
|
33
|
+
if (names.length <= 1)
|
|
34
|
+
return names[0] ?? "";
|
|
35
|
+
if (names.length === 2)
|
|
36
|
+
return `${names[0]} and ${names[1]}`;
|
|
37
|
+
return `${names.slice(0, -1).join(", ")}, and ${names[names.length - 1]}`;
|
|
38
|
+
}
|
|
39
|
+
/** The sentence about the final integration pull request, by what was confirmed. */
|
|
40
|
+
export function finalIntegrationSentence(target) {
|
|
41
|
+
if (target !== null && target !== undefined && target.coverage === "covers") {
|
|
42
|
+
return `CI runs on the final integration pull request into ${target.branch}.`;
|
|
43
|
+
}
|
|
44
|
+
return "Bridge could not confirm that CI runs on the final integration pull request either.";
|
|
45
|
+
}
|
|
46
|
+
/** The sentence naming detected CI systems Bridge cannot change, or "". */
|
|
47
|
+
export function unsupportedSystemsSentence(systems) {
|
|
48
|
+
const names = (systems ?? []).map((s) => s.name).filter((n) => n !== GITHUB_ACTIONS);
|
|
49
|
+
const unique = [...new Set(names)];
|
|
50
|
+
if (unique.length === 0)
|
|
51
|
+
return "";
|
|
52
|
+
return `This repository also uses ${joinNames(unique)}. Bridge can't safely change ${unique.length === 1 ? "its" : "their"} config yet.`;
|
|
53
|
+
}
|
|
54
|
+
function onlyUnsupportedSystems(systems) {
|
|
55
|
+
const all = systems ?? [];
|
|
56
|
+
if (all.some((s) => s.name === GITHUB_ACTIONS))
|
|
57
|
+
return [];
|
|
58
|
+
return [...new Set(all.map((s) => s.name))];
|
|
59
|
+
}
|
|
60
|
+
function exclusionSentence(excluded) {
|
|
61
|
+
const named = (excluded ?? []).filter((w) => w.branches !== null && w.branches.length > 0);
|
|
62
|
+
if (named.length === 0)
|
|
63
|
+
return "No workflow runs on pull requests into epic branches.";
|
|
64
|
+
if (named.length === 1) {
|
|
65
|
+
return `${named[0].path} runs only on pull requests into ${quoteList(named[0].branches)}, not into epic branches.`;
|
|
66
|
+
}
|
|
67
|
+
// Each workflow with its own filter, bounded so a large repository stays readable.
|
|
68
|
+
const shown = named.slice(0, MAX_NAMED_WORKFLOWS).map((w) => `${w.path} runs only on pull requests into ${quoteList(w.branches)}`);
|
|
69
|
+
const more = named.length - shown.length;
|
|
70
|
+
return `${shown.join("; ")}${more > 0 ? `; and ${more} more workflow${more === 1 ? "" : "s"} like them` : ""}. None of them runs on pull requests into epic branches.`;
|
|
71
|
+
}
|
|
72
|
+
/** The plain text for the current state, before any apply. */
|
|
73
|
+
export function describeEpicBranchCi(input) {
|
|
74
|
+
const parts = [];
|
|
75
|
+
const unsupported = unsupportedSystemsSentence(input.ciSystems);
|
|
76
|
+
if (input.coverage === "covers") {
|
|
77
|
+
parts.push("A workflow already runs on pull requests into epic branches, so each child can wait for its checks before it merges.");
|
|
78
|
+
if (unsupported)
|
|
79
|
+
parts.push(unsupported);
|
|
80
|
+
return parts.join(" ");
|
|
81
|
+
}
|
|
82
|
+
const offer = input.offer ?? null;
|
|
83
|
+
if (offer !== null && offer.actionClass === "trigger_edit") {
|
|
84
|
+
const filter = offer.branchesBefore !== undefined && offer.branchesBefore.length > 0 ? ` (today: ${quoteList(offer.branchesBefore)})` : "";
|
|
85
|
+
parts.push(`${offer.path} does not run on pull requests into epic branches${filter}. Adding 'epic/**' to its pull_request branch list would fix that, and only that list would change.`);
|
|
86
|
+
parts.push("Until that change is merged, child pull requests merge into the epic branch without checks.");
|
|
87
|
+
parts.push(finalIntegrationSentence(input.integrationTarget));
|
|
88
|
+
if (unsupported)
|
|
89
|
+
parts.push(unsupported);
|
|
90
|
+
return parts.join(" ");
|
|
91
|
+
}
|
|
92
|
+
if (offer !== null && offer.actionClass === "managed_workflow") {
|
|
93
|
+
parts.push(`No workflow can be changed safely to run on pull requests into epic branches. Bridge's epic workflow (${offer.path}) would run your test command on each child pull request once it is merged.`);
|
|
94
|
+
if (unsupported)
|
|
95
|
+
parts.push(unsupported);
|
|
96
|
+
return parts.join(" ");
|
|
97
|
+
}
|
|
98
|
+
const only = onlyUnsupportedSystems(input.ciSystems);
|
|
99
|
+
if (input.coverage === null && only.length > 0) {
|
|
100
|
+
parts.push(`This repository uses ${joinNames(only)}. Bridge can't safely change ${only.length === 1 ? "its" : "their"} config yet, so child pull requests merge into the epic branch without checks.`);
|
|
101
|
+
parts.push(finalIntegrationSentence(input.integrationTarget));
|
|
102
|
+
return parts.join(" ");
|
|
103
|
+
}
|
|
104
|
+
if (input.coverage === "does_not_cover") {
|
|
105
|
+
parts.push(exclusionSentence(input.excluded));
|
|
106
|
+
parts.push("Child pull requests merge into the epic branch without checks.");
|
|
107
|
+
parts.push(finalIntegrationSentence(input.integrationTarget));
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
parts.push("Bridge could not confirm that checks run on pull requests into epic branches, so child pull requests may merge into the epic branch without checks.");
|
|
111
|
+
parts.push(finalIntegrationSentence(input.integrationTarget));
|
|
112
|
+
}
|
|
113
|
+
if (unsupported)
|
|
114
|
+
parts.push(unsupported);
|
|
115
|
+
return parts.join(" ");
|
|
116
|
+
}
|
|
117
|
+
/** The text for a declined CI change: honest about what stays without checks. */
|
|
118
|
+
export function describeDeclinedCiChange(input) {
|
|
119
|
+
if (input.coverageViaApprovedSetup === true) {
|
|
120
|
+
// The setup pull request you approved adds the same workflow, so declining this one loses nothing.
|
|
121
|
+
return [
|
|
122
|
+
"You declined this CI pull request, but the setup pull request you approved also adds Bridge's epic workflow.",
|
|
123
|
+
"Its checks start on child pull requests once you merge it. Until then, child pull requests merge into the epic branch without checks.",
|
|
124
|
+
finalIntegrationSentence(input.integrationTarget),
|
|
125
|
+
].join(" ");
|
|
126
|
+
}
|
|
127
|
+
return [
|
|
128
|
+
"You declined the CI change, so child pull requests merge into the epic branch without checks.",
|
|
129
|
+
finalIntegrationSentence(input.integrationTarget),
|
|
130
|
+
].join(" ");
|
|
131
|
+
}
|
|
132
|
+
/** The text for an opened or reused CI pull request: proposed, not coverage. */
|
|
133
|
+
export function describeProposedCiChange(actionClass, path, url) {
|
|
134
|
+
const where = url !== null ? ` in ${url}` : "";
|
|
135
|
+
return actionClass === "trigger_edit"
|
|
136
|
+
? `The CI change to ${path} is proposed${where} and not merged yet. Until you merge it, child pull requests ` +
|
|
137
|
+
"merge into the epic branch without checks. Nothing waits for it."
|
|
138
|
+
: `Bridge's epic workflow (${path}) is proposed${where} and not merged yet. Its checks start on child pull ` +
|
|
139
|
+
"requests once you merge it. Nothing waits for it.";
|
|
140
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The advisory capability statement (BAPI-1545).
|
|
3
|
+
*
|
|
4
|
+
* Every non-dry-run `install epic-implementer` builds this short, non-secret
|
|
5
|
+
* summary from the current MCP grant and the epic-server record and writes it to
|
|
6
|
+
* the server (`PUT /jira/epic-runs/capability-statement`). Plan generation and
|
|
7
|
+
* the implement-worker prompt include it, so the planner stops writing tests
|
|
8
|
+
* nobody can run.
|
|
9
|
+
*
|
|
10
|
+
* It is ADVISORY and NEVER an authorization source: nothing may read it to
|
|
11
|
+
* decide what a worker can load. It says what the owner configured, not that
|
|
12
|
+
* any of it works at runtime.
|
|
13
|
+
*
|
|
14
|
+
* Version 1 holds names and closed-vocabulary values only — no commands,
|
|
15
|
+
* arguments, paths, environment values, or credential references. The Python
|
|
16
|
+
* twin (`src/python/llms/agents/epic_capability_statement.py`) applies the same
|
|
17
|
+
* rules; keep the two in step.
|
|
18
|
+
*
|
|
19
|
+
* BAPI-1546: `recipe` says whether repository epic-server GUIDANCE was found at
|
|
20
|
+
* setup. It never means a run recipe was proven or that an epic server is live:
|
|
21
|
+
* the driver proves its recipe per run, and a missing server is a hand-off.
|
|
22
|
+
*/
|
|
23
|
+
import { isGrantableServerName, MCP_GRANT_MAX_SERVERS } from "./mcp-grant.js";
|
|
24
|
+
export const EPIC_CAPABILITY_STATEMENT_VERSION = 1;
|
|
25
|
+
const MODES = ["none", "local", "sfcc_shared_active", "unknown"];
|
|
26
|
+
const RECIPES = ["present", "absent", "unknown"];
|
|
27
|
+
const GRANT_STATES = ["present", "absent", "unusable"];
|
|
28
|
+
const KEYS = ["version", "approved_servers", "epic_server_mode", "recipe", "grant_state", "written_at"];
|
|
29
|
+
/**
|
|
30
|
+
* Build the statement from what was read. A usable grant is `present` even when
|
|
31
|
+
* it approves no extra server; an absent or unusable grant lists no servers.
|
|
32
|
+
*/
|
|
33
|
+
export function buildEpicCapabilityStatement(grant, epicServer, now) {
|
|
34
|
+
const approved = grant.state === "ok"
|
|
35
|
+
? [...new Set(grant.grant.servers.map((s) => s.name).filter((n) => isGrantableServerName(n)))]
|
|
36
|
+
.sort()
|
|
37
|
+
.slice(0, MCP_GRANT_MAX_SERVERS)
|
|
38
|
+
: [];
|
|
39
|
+
const grantState = grant.state === "ok" ? "present" : grant.state === "absent" ? "absent" : "unusable";
|
|
40
|
+
let mode;
|
|
41
|
+
let recipe;
|
|
42
|
+
if (epicServer.state === "absent") {
|
|
43
|
+
mode = "none";
|
|
44
|
+
recipe = "unknown";
|
|
45
|
+
}
|
|
46
|
+
else if (epicServer.state === "unusable") {
|
|
47
|
+
mode = "unknown";
|
|
48
|
+
recipe = "unknown";
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
mode = epicServer.record.mode;
|
|
52
|
+
recipe = epicServer.record.recipe ?? "unknown";
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
version: EPIC_CAPABILITY_STATEMENT_VERSION,
|
|
56
|
+
approved_servers: approved,
|
|
57
|
+
epic_server_mode: mode,
|
|
58
|
+
recipe,
|
|
59
|
+
grant_state: grantState,
|
|
60
|
+
written_at: now.toISOString(),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Strictly validate a statement (unknown keys, an unsupported version, a bad
|
|
65
|
+
* timestamp, an unknown vocabulary value, an unsafe or Bridge name, or an
|
|
66
|
+
* unsorted or duplicated list are all rejected). Returns null when invalid.
|
|
67
|
+
*/
|
|
68
|
+
export function validateEpicCapabilityStatement(raw) {
|
|
69
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw))
|
|
70
|
+
return null;
|
|
71
|
+
const doc = raw;
|
|
72
|
+
for (const key of Object.keys(doc))
|
|
73
|
+
if (!KEYS.includes(key))
|
|
74
|
+
return null;
|
|
75
|
+
if (doc.version !== EPIC_CAPABILITY_STATEMENT_VERSION)
|
|
76
|
+
return null;
|
|
77
|
+
const servers = doc.approved_servers;
|
|
78
|
+
if (!Array.isArray(servers) || servers.length > MCP_GRANT_MAX_SERVERS)
|
|
79
|
+
return null;
|
|
80
|
+
for (let i = 0; i < servers.length; i++) {
|
|
81
|
+
if (!isGrantableServerName(servers[i]))
|
|
82
|
+
return null;
|
|
83
|
+
if (i > 0 && !(servers[i - 1] < servers[i]))
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
if (typeof doc.epic_server_mode !== "string" || !MODES.includes(doc.epic_server_mode))
|
|
87
|
+
return null;
|
|
88
|
+
if (typeof doc.recipe !== "string" || !RECIPES.includes(doc.recipe))
|
|
89
|
+
return null;
|
|
90
|
+
if (typeof doc.grant_state !== "string" || !GRANT_STATES.includes(doc.grant_state))
|
|
91
|
+
return null;
|
|
92
|
+
const writtenAt = doc.written_at;
|
|
93
|
+
if (typeof writtenAt !== "string" ||
|
|
94
|
+
writtenAt.length > 64 ||
|
|
95
|
+
!/^\d{4}-\d{2}-\d{2}T.*(Z|[+-]\d{2}:\d{2})$/.test(writtenAt) ||
|
|
96
|
+
Number.isNaN(Date.parse(writtenAt))) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
version: EPIC_CAPABILITY_STATEMENT_VERSION,
|
|
101
|
+
approved_servers: [...servers],
|
|
102
|
+
epic_server_mode: doc.epic_server_mode,
|
|
103
|
+
recipe: doc.recipe,
|
|
104
|
+
grant_state: doc.grant_state,
|
|
105
|
+
written_at: writtenAt,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
* recognition cannot be a fixed SHA list. Instead a file is recognized as
|
|
7
7
|
* Bridge-rendered only when its ENTIRE bytes equal a re-render: of the current
|
|
8
8
|
* proposal, of the command extracted from the file's own fixed stored-command
|
|
9
|
-
* step by a renderer version Bridge actually published
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* step by a renderer version Bridge actually published (with the toolchain set
|
|
10
|
+
* from the file's own header, for the versions that wrote one), or of the command
|
|
11
|
+
* AND the toolchain set extracted from a current-version file's own header. A
|
|
12
|
+
* version marker alone proves nothing; a hand-edited or hostile file can claim any
|
|
12
13
|
* version it likes, and a marker that does not reproduce the whole file is
|
|
13
14
|
* refused.
|
|
14
15
|
*
|
|
@@ -17,20 +18,26 @@
|
|
|
17
18
|
*/
|
|
18
19
|
import { EPIC_CI_COMMAND_LINE_PREFIX, EPIC_CI_COMMAND_STEP_NAME, EPIC_CI_WORKFLOW_PATH, EPIC_CI_WORKFLOW_TOOLCHAINS_MARKER_KEY, renderEpicImplementerCiWorkflow, } from "./epic-ci-workflow.js";
|
|
19
20
|
import { renderEpicCiWorkflowV1 } from "./epic-ci-workflow-v1.js";
|
|
21
|
+
import { renderEpicCiWorkflowV2 } from "./epic-ci-workflow-v2.js";
|
|
20
22
|
import { parseRepositoryToolchains, } from "./repository-toolchains.js";
|
|
21
23
|
import { TestCommandValidationError, validateTestCommand } from "./test-command-validation.js";
|
|
22
24
|
/**
|
|
23
25
|
* Renderers for every OLDER published version, keyed by version.
|
|
24
26
|
*
|
|
25
|
-
* Version 1 is frozen in `epic-ci-workflow-v1.ts
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
27
|
+
* Version 1 is frozen in `epic-ci-workflow-v1.ts` and version 2 in
|
|
28
|
+
* `epic-ci-workflow-v2.ts`, each unchanged, so their exact bytes stay
|
|
29
|
+
* recognizable. Version 1 uses only a command, because it provisioned no
|
|
30
|
+
* toolchain; version 2 also needs the toolchain set its header records. This map
|
|
31
|
+
* is the published-version preservation contract: a version is added here only
|
|
32
|
+
* by freezing the renderer that shipped, and an entry is never edited or removed,
|
|
33
|
+
* or customers' installed files would stop being recognized as upgradeable.
|
|
34
|
+
* Inventing an entry for a version that never shipped would let a file Bridge
|
|
35
|
+
* never wrote be "upgraded".
|
|
32
36
|
*/
|
|
33
|
-
export const EPIC_CI_WORKFLOW_HISTORICAL_RENDERERS = new Map([
|
|
37
|
+
export const EPIC_CI_WORKFLOW_HISTORICAL_RENDERERS = new Map([
|
|
38
|
+
[1, (command) => renderEpicCiWorkflowV1(command)],
|
|
39
|
+
[2, (command, toolchains) => (toolchains === null ? null : renderEpicCiWorkflowV2(command, toolchains))],
|
|
40
|
+
]);
|
|
34
41
|
/**
|
|
35
42
|
* Extract and validate the command from the fixed stored-command step; `null`
|
|
36
43
|
* if the step is absent, duplicated, malformed, or its command is invalid.
|
|
@@ -103,13 +110,21 @@ export function classifyEpicCiWorkflowContent(existing, proposedCommand, propose
|
|
|
103
110
|
const extracted = extractEpicCiWorkflowCommand(existing);
|
|
104
111
|
if (extracted === null)
|
|
105
112
|
return "modified_or_unrecognized";
|
|
113
|
+
// Both inputs of a rendering come from the file itself, and the whole file must
|
|
114
|
+
// reproduce from them. The header marker is untrusted until that is true.
|
|
115
|
+
const toolchains = extractEpicCiWorkflowToolchains(existing);
|
|
106
116
|
for (const render of EPIC_CI_WORKFLOW_HISTORICAL_RENDERERS.values()) {
|
|
107
|
-
|
|
117
|
+
let rendered;
|
|
118
|
+
try {
|
|
119
|
+
rendered = render(extracted, toolchains);
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (rendered !== null && existing === rendered)
|
|
108
125
|
return "managed_version_older";
|
|
109
126
|
}
|
|
110
|
-
// Another version
|
|
111
|
-
// whole file must reproduce from them.
|
|
112
|
-
const toolchains = extractEpicCiWorkflowToolchains(existing);
|
|
127
|
+
// Another current-version rendering of a different command or toolchain set.
|
|
113
128
|
if (toolchains !== null && existing === renderEpicImplementerCiWorkflow(extracted, toolchains)) {
|
|
114
129
|
return "managed_command_differs";
|
|
115
130
|
}
|
|
@@ -6,26 +6,27 @@
|
|
|
6
6
|
* {@link installArtifactSet} engine: read-only preflight, consent, a temporary
|
|
7
7
|
* worktree, a managed branch, and one pull request into the default branch.
|
|
8
8
|
*
|
|
9
|
-
* ## The setup caller's sequence (BAPI-
|
|
9
|
+
* ## The setup caller's sequence (BAPI-1603)
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
* explicit `--test-command` value is its own write consent and skips this
|
|
13
|
-
* question; it is still validated, saved, and read back.
|
|
14
|
-
* 2. Get consent to save the command (interactive selection only), then save it
|
|
15
|
-
* with `PUT /setup/testing-config` (`writeStoredTestCommand`).
|
|
16
|
-
* 3. Read the authoritative command back with `GET /setup/testing-config`
|
|
17
|
-
* (`readStoredTestCommand`) and build the descriptor from THAT value, plus the
|
|
18
|
-
* toolchain set resolved from the local working tree
|
|
19
|
-
* (`resolveRepositoryToolchains`), with {@link buildEpicCiWorkflowArtifactSet}
|
|
20
|
-
* — never from the typed answer.
|
|
21
|
-
* 4. Get separate consent for the pull request and call {@link installEpicCiWorkflow}.
|
|
22
|
-
* Saving a command and opening the workflow pull request are two consents:
|
|
23
|
-
* the flag or the prompt covers the command, never the pull request.
|
|
11
|
+
* The workflow is an OPTION on a proven local plan, never a barrier.
|
|
24
12
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
13
|
+
* 1. Setup asks the server for the repository's learned test command, proves it
|
|
14
|
+
* by running it once (gate qualification), and the server stores it as the
|
|
15
|
+
* gate's local member. Nobody is asked for a command. An explicit
|
|
16
|
+
* `--test-command` goes through the same trial as the owner's command.
|
|
17
|
+
* 2. When the repository has no reporting CI and a proven command, setup offers
|
|
18
|
+
* this workflow as one default-No yes/no.
|
|
19
|
+
* 3. On yes, the toolchains are resolved from the remote default branch at the
|
|
20
|
+
* installer's captured snapshot (`captureDefaultBranchSnapshot`), and the
|
|
21
|
+
* descriptor is built from the server-validated command plus that set with
|
|
22
|
+
* {@link buildEpicCiWorkflowArtifactSet}. The same snapshot is passed to
|
|
23
|
+
* {@link installEpicCiWorkflow}, so the rendered proposal and the detached
|
|
24
|
+
* worktree share one head. Uncommitted or unpushed local files never reach it.
|
|
25
|
+
* 4. Only after the installer opens or reuses the setup pull request does setup
|
|
26
|
+
* add `epic-implementer-ci / gate` to the gate.
|
|
27
|
+
*
|
|
28
|
+
* Installing the workflow never undoes a stored command, and a refused or failed
|
|
29
|
+
* install leaves the proven local plan in place ({@link describeEpicCiSetupStatus}).
|
|
29
30
|
*
|
|
30
31
|
* The backend integration point for readiness (BAPI-1459) is
|
|
31
32
|
* `get_test_command(repo_name)` in `api/library/db/postgres_functions.py`. A
|
|
@@ -51,9 +52,13 @@ export const EPIC_CI_WORKFLOW_UPGRADE_BRANCH = "bridge/epic-implementer-ci-upgra
|
|
|
51
52
|
* force-pushes it). Never edit or remove an entry: it names a branch customers
|
|
52
53
|
* may already have.
|
|
53
54
|
*/
|
|
54
|
-
export const EPIC_CI_WORKFLOW_HISTORICAL_INSTALL_BRANCHES = [
|
|
55
|
+
export const EPIC_CI_WORKFLOW_HISTORICAL_INSTALL_BRANCHES = [
|
|
56
|
+
"bridge/epic-implementer-ci-v1",
|
|
57
|
+
"bridge/epic-implementer-ci-v2",
|
|
58
|
+
];
|
|
55
59
|
export const EPIC_CI_WORKFLOW_HISTORICAL_UPGRADE_BRANCHES = [
|
|
56
60
|
"bridge/epic-implementer-ci-upgrade-v1",
|
|
61
|
+
"bridge/epic-implementer-ci-upgrade-v2",
|
|
57
62
|
];
|
|
58
63
|
export const EPIC_CI_WORKFLOW_HISTORICAL_BRANCHES = [
|
|
59
64
|
...EPIC_CI_WORKFLOW_HISTORICAL_INSTALL_BRANCHES,
|
|
@@ -68,34 +73,72 @@ export const EPIC_CI_WORKFLOW_ALL_MANAGED_BRANCHES = [
|
|
|
68
73
|
export const EPIC_CI_WORKFLOW_INSTALL_COMMIT_SUBJECT = "Add the Bridge Epic Implementer CI workflow";
|
|
69
74
|
export const EPIC_CI_WORKFLOW_UPGRADE_COMMIT_SUBJECT = "Update the Bridge Epic Implementer CI workflow";
|
|
70
75
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
|
|
76
|
+
* The stop-and-exit table the setup change carries (BAPI-1603): what setup stops
|
|
77
|
+
* on, what it no longer stops on, and what it leaves alone. Fixed text.
|
|
78
|
+
*/
|
|
79
|
+
export const EPIC_CI_SETUP_STOP_AND_EXIT_TABLE = [
|
|
80
|
+
"| Stop or exit | Before | After |",
|
|
81
|
+
"|---|---|---|",
|
|
82
|
+
"| Repository not learned | Not checked | **Added:** setup stops before any write (owner-approved exception) |",
|
|
83
|
+
"| Test-command question and blocking item, every repository | Asked and blocking | Removed. The command is learned and proven, or there is none |",
|
|
84
|
+
"| Setup PR, repository with reporting CI | Always opened | Not opened |",
|
|
85
|
+
"| Setup PR, repository with no CI | Always opened | Opened only if the person says yes to Bridge's workflow |",
|
|
86
|
+
"| Found CI checks as gate members | Required (would block until green, could stall) | Watched: red blocks, missing warns |",
|
|
87
|
+
"| Unqualified local gate at admission (`local_command_unqualified`) | Possible | Never stored: removed before setup ends |",
|
|
88
|
+
"| `worktree_not_clean` refusal of the setup PR | Blocks setup when the folder is dirty | Removed |",
|
|
89
|
+
"| Quiet `precondition` workflow state | Hides a local precondition | Removed; `not_repository_root` prints its remedy as the blocker |",
|
|
90
|
+
"| Push target, default-branch push refusal, credential checks | Unchanged | Unchanged |",
|
|
91
|
+
];
|
|
92
|
+
/** A fenced block whose fence is longer than any backtick run inside `text`. */
|
|
93
|
+
function markdownFence(text) {
|
|
94
|
+
const longest = Math.max(0, ...(text.match(/`+/g) ?? []).map((run) => run.length));
|
|
95
|
+
const fence = "`".repeat(Math.max(3, longest + 1));
|
|
96
|
+
return [fence, text, fence];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Render the CI pull request body. Deterministic and secret-free: the same inputs
|
|
100
|
+
* always give the same text. It names the server-validated command and how to
|
|
101
|
+
* change it, and carries the stop-and-exit table. It accepts nothing but the
|
|
102
|
+
* validated command and the resolved toolchains, so a raw server response,
|
|
103
|
+
* executor output, or a qualification log has no way in.
|
|
74
104
|
*/
|
|
75
|
-
export function renderEpicCiWorkflowPrBody(upgrade, toolchains) {
|
|
105
|
+
export function renderEpicCiWorkflowPrBody(upgrade, toolchains, testCommand) {
|
|
106
|
+
const command = validateTestCommand(testCommand);
|
|
76
107
|
const setup = describeToolchainSet(toolchains);
|
|
77
108
|
return [
|
|
78
109
|
upgrade
|
|
79
110
|
? "This pull request updates the Bridge Epic Implementer CI workflow to renderer version " +
|
|
80
|
-
String(EPIC_CI_WORKFLOW_RENDERER_VERSION) + ", the repository's current
|
|
111
|
+
String(EPIC_CI_WORKFLOW_RENDERER_VERSION) + ", the repository's current test command, and its dependency setup."
|
|
81
112
|
: "This pull request adds the Bridge Epic Implementer CI workflow, renderer version " +
|
|
82
113
|
String(EPIC_CI_WORKFLOW_RENDERER_VERSION) + ".",
|
|
83
114
|
"",
|
|
84
|
-
"The workflow publishes one
|
|
85
|
-
"Epic Implementer reads it before it merges a child pull request.",
|
|
115
|
+
"The workflow publishes one check, `" + EPIC_IMPLEMENTER_CI_CHECK_NAME + "`. The Bridge",
|
|
116
|
+
"Epic Implementer reads it before it merges a child pull request into an epic branch.",
|
|
117
|
+
"",
|
|
118
|
+
"## The test command",
|
|
119
|
+
"",
|
|
120
|
+
"Bridge learned this command from your repository and proved it by running it once on",
|
|
121
|
+
"your executor before it was stored:",
|
|
122
|
+
"",
|
|
123
|
+
...markdownFence(command),
|
|
124
|
+
"",
|
|
125
|
+
"To change it, run Bridge setup again with `--test-command \"<your command>\"`. Bridge proves",
|
|
126
|
+
"the new command the same way before it replaces this one. Do not edit the workflow file by hand.",
|
|
86
127
|
"",
|
|
87
128
|
"## How it runs",
|
|
88
129
|
"",
|
|
89
|
-
"-
|
|
90
|
-
"
|
|
91
|
-
" " + String(EPIC_CI_TEST_JOB_TIMEOUT_MINUTES) + "-minute limit.",
|
|
130
|
+
"- Only on pull requests that target an `epic/**` branch: the child pull requests the Epic",
|
|
131
|
+
" Implementer merges. It installs dependencies (below), then runs the test command with bash",
|
|
132
|
+
" from the repository root, on `ubuntu-latest`, with a " + String(EPIC_CI_TEST_JOB_TIMEOUT_MINUTES) + "-minute limit.",
|
|
133
|
+
"- It does not run for other pull requests. The final pull request into your default branch is",
|
|
134
|
+
" one of them, so do not require `" + EPIC_IMPLEMENTER_CI_CHECK_NAME + "` in a default-branch rule.",
|
|
92
135
|
"- It requests only `contents: read` and uses no secrets.",
|
|
93
136
|
"- A pull request from a fork never checks out or runs repository code. The gate passes for",
|
|
94
137
|
" it immediately and says so. The gate job itself has a " + String(EPIC_CI_GATE_JOB_TIMEOUT_MINUTES) + "-minute limit.",
|
|
95
138
|
"",
|
|
96
139
|
"## Dependency setup",
|
|
97
140
|
"",
|
|
98
|
-
"Chosen from the lockfiles in the
|
|
141
|
+
"Chosen from the lockfiles in the root of your default branch when this file was generated:",
|
|
99
142
|
"",
|
|
100
143
|
...(setup.length > 0
|
|
101
144
|
? setup.map((line) => "- " + line)
|
|
@@ -109,21 +152,36 @@ export function renderEpicCiWorkflowPrBody(upgrade, toolchains) {
|
|
|
109
152
|
"",
|
|
110
153
|
"- `" + EPIC_CI_WORKFLOW_PATH + "`",
|
|
111
154
|
"",
|
|
155
|
+
"## What setup stops on, and what it no longer does",
|
|
156
|
+
"",
|
|
157
|
+
...EPIC_CI_SETUP_STOP_AND_EXIT_TABLE,
|
|
158
|
+
"",
|
|
159
|
+
"Stops added: one, \"repository not learned\", the owner-approved exception.",
|
|
160
|
+
"",
|
|
112
161
|
"## What you must do",
|
|
113
162
|
"",
|
|
114
|
-
"Review the command in the diff, then merge this pull request yourself.
|
|
115
|
-
"it. The branch, the commit, and this pull request were created locally
|
|
116
|
-
"and `gh
|
|
163
|
+
"Review the command above and the workflow in the diff, then merge this pull request yourself.",
|
|
164
|
+
"Bridge never merges it. The branch, the commit, and this pull request were created locally",
|
|
165
|
+
"with your own git and `gh`, from a temporary copy of your default branch; Bridge performed no",
|
|
166
|
+
"write to this repository and your own folder was not touched.",
|
|
117
167
|
"",
|
|
118
168
|
].join("\n");
|
|
119
169
|
}
|
|
120
170
|
/**
|
|
121
|
-
* The CI artifact set for one
|
|
122
|
-
* Build it from the command
|
|
123
|
-
*
|
|
124
|
-
*
|
|
171
|
+
* The CI artifact set for one server-validated command and one resolved toolchain
|
|
172
|
+
* set. Build it from the command the server's qualification trial promoted, never
|
|
173
|
+
* from unproven input, and from the set resolved against the same remote
|
|
174
|
+
* default-branch snapshot the installer will build from.
|
|
175
|
+
*/
|
|
176
|
+
export function buildEpicCiWorkflowArtifactSet(testCommand, toolchains,
|
|
177
|
+
/**
|
|
178
|
+
* BAPI-1654 — the setup CI fallback adds the workflow as a NEW file only. A
|
|
179
|
+
* matching file is still `identical` and an open matching pull request is
|
|
180
|
+
* still reused, but any other existing file is a conflict left untouched: it
|
|
181
|
+
* never takes the upgrade path. Absent keeps every existing caller's upgrade
|
|
182
|
+
* behavior.
|
|
125
183
|
*/
|
|
126
|
-
|
|
184
|
+
build = {}) {
|
|
127
185
|
return {
|
|
128
186
|
setName: "epic-ci-workflow",
|
|
129
187
|
installBranch: EPIC_CI_WORKFLOW_INSTALL_BRANCH,
|
|
@@ -133,7 +191,7 @@ export function buildEpicCiWorkflowArtifactSet(testCommand, toolchains) {
|
|
|
133
191
|
installPrTitle: EPIC_CI_WORKFLOW_INSTALL_COMMIT_SUBJECT,
|
|
134
192
|
upgradePrTitle: EPIC_CI_WORKFLOW_UPGRADE_COMMIT_SUBJECT,
|
|
135
193
|
historicalBranches: EPIC_CI_WORKFLOW_HISTORICAL_BRANCHES,
|
|
136
|
-
renderPrBody: (upgrade) => renderEpicCiWorkflowPrBody(upgrade, toolchains),
|
|
194
|
+
renderPrBody: (upgrade) => renderEpicCiWorkflowPrBody(upgrade, toolchains, testCommand),
|
|
137
195
|
validateOptions: () => {
|
|
138
196
|
try {
|
|
139
197
|
validateTestCommand(testCommand);
|
|
@@ -169,6 +227,9 @@ export function buildEpicCiWorkflowArtifactSet(testCommand, toolchains) {
|
|
|
169
227
|
// changed. Replace it through the same reviewed update PR as an older
|
|
170
228
|
// renderer version, so the workflow header's "save a new command and
|
|
171
229
|
// re-run the installer" holds.
|
|
230
|
+
if (build.createOnly === true && classification !== "not_installed" && classification !== "identical") {
|
|
231
|
+
return { state: "conflict", reason: "workflow_modified_or_unrecognized", text };
|
|
232
|
+
}
|
|
172
233
|
if (classification === "managed_command_differs")
|
|
173
234
|
return { state: "managed_version_older", text };
|
|
174
235
|
return { state: classification, text };
|
|
@@ -177,14 +238,21 @@ export function buildEpicCiWorkflowArtifactSet(testCommand, toolchains) {
|
|
|
177
238
|
],
|
|
178
239
|
};
|
|
179
240
|
}
|
|
180
|
-
/**
|
|
241
|
+
/**
|
|
242
|
+
* Install the CI workflow for `testCommand` and `toolchains`. Returns the typed result; prints progress only.
|
|
243
|
+
*
|
|
244
|
+
* BAPI-1654: `options.createOnly` is the setup CI fallback's mode (see
|
|
245
|
+
* {@link buildEpicCiWorkflowArtifactSet}). The pull request it opens is a
|
|
246
|
+
* proposed workflow, not coverage: checks start only after the owner merges it,
|
|
247
|
+
* and opening it changes no gate.
|
|
248
|
+
*/
|
|
181
249
|
export async function installEpicCiWorkflow(testCommand, toolchains, options, deps) {
|
|
182
|
-
|
|
250
|
+
const { createOnly, ...engineOptions } = options;
|
|
251
|
+
return await installArtifactSet(buildEpicCiWorkflowArtifactSet(testCommand, toolchains, createOnly === true ? { createOnly: true } : {}), engineOptions, deps);
|
|
183
252
|
}
|
|
184
253
|
const REFUSALS = new Set([
|
|
185
254
|
"workflow_modified_or_unrecognized",
|
|
186
255
|
"consent_declined",
|
|
187
|
-
"worktree_not_clean",
|
|
188
256
|
"test_command_invalid",
|
|
189
257
|
"toolchains_invalid",
|
|
190
258
|
"historical_managed_pr_open",
|