@loucompanion/forge-bridge 0.1.4-dev.acacfdecaad2 → 0.1.4-dev.b33004c2b0ea
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 +9 -0
- package/dist/runtime/host-runtime-lease.d.ts +1 -1
- package/dist/runtime/host-runtime-lease.js +8 -7
- package/dist/runtime/host-runtime-promotion.d.ts +23 -0
- package/dist/runtime/host-runtime-promotion.js +36 -0
- package/dist/session/pre-publication-pass.d.ts +60 -0
- package/dist/session/pre-publication-pass.js +145 -0
- package/dist/session/pre-publication-validation.d.ts +21 -11
- package/dist/session/pre-publication-validation.js +149 -104
- package/dist/session/provider-cli/pre-publication-repair.d.ts +40 -0
- package/dist/session/provider-cli/pre-publication-repair.js +243 -0
- package/dist/session/provider-cli/provider-cli.service.d.ts +4 -7
- package/dist/session/provider-cli/provider-cli.service.js +64 -235
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
|
@@ -2,8 +2,6 @@ import fs from "node:fs/promises";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { RepositoryCoordinatorLock } from "../../sandbox/repository-lock.js";
|
|
4
4
|
import { GitClient } from "../../shared/git/git.js";
|
|
5
|
-
import { HostPortCollisionError } from "../../runtime/host-port-broker.js";
|
|
6
|
-
import { runtimeAdmissionPriority } from "../../runtime/host-runtime-lease.js";
|
|
7
5
|
import { sandboxHostLoadGateFromEnvironment } from "../sandbox-host-capacity-gate.js";
|
|
8
6
|
import { buildSpecBody, selectLaneCommand } from "../../worktree/artifact-injector.js";
|
|
9
7
|
import { defaultWorktreeCoordinatorStateRoot } from "../../worktree/worktree-paths.js";
|
|
@@ -14,12 +12,12 @@ import { diffClaimedChangedFiles, findUnpublishedWorktreePaths, normalizeChanged
|
|
|
14
12
|
import { DeterministicProviderCliService } from "./provider-cli.deterministic.js";
|
|
15
13
|
import { buildArchitectPrompt, buildConflictResolvePrompt, buildDebugCyclePrompt, buildDevelopCyclePrompt, buildDraftPrompt, buildDraftSpec, buildImplementationPrompt, buildProviderCliPrompt, buildProviderCliCommand, durableDraftInput, buildPullRequestCheckRepairPrompt, buildPullRequestCommentsPrompt, buildQaPrompt, formatProviderCliCommandForCheckpoint, isDecomposeDraftDispatch, isPullRequestCheckRepairDispatch, isPullRequestCommentsDispatch } from "./provider-cli.prompts.js";
|
|
16
14
|
import { isTransientCodexProviderNotFoundFailure, providerCompletionToolMissingFailure, recoveringProviderProcessRunner, StreamingProviderProcessRunner } from "./provider-cli.process.js";
|
|
17
|
-
import { emitProviderUsageEvent,
|
|
15
|
+
import { emitProviderUsageEvent, providerProcessEnv } from "./provider-cli.runtime.js";
|
|
18
16
|
import { clip, createProviderOutputState, parseJsonLine } from "./provider-output-state.js";
|
|
19
17
|
import { writeCiRepairReadinessManifest } from "./ci-repair-readiness.js";
|
|
20
18
|
import { assertRepairHeadEpoch } from "./provider-cli.repair-epoch.js";
|
|
21
|
-
import {
|
|
22
|
-
|
|
19
|
+
import { PrePublicationValidator } from "../pre-publication-validation.js";
|
|
20
|
+
import { prePublicationRepairTurnsFromEnvironment, validatePrePublicationWithRepair, } from "./pre-publication-repair.js";
|
|
23
21
|
const maxQaCompletionRecoveryTurns = 2;
|
|
24
22
|
function assertCommentRepairArtifactMatchesDispatch(dispatch, artifact) {
|
|
25
23
|
const pullRequest = dispatch.pullRequest;
|
|
@@ -215,22 +213,6 @@ async function pushWorktreeBranch(git, worktreePath, branchName, repoPath, coord
|
|
|
215
213
|
function providerOwnsBranchPublication(context) {
|
|
216
214
|
return context.dispatch.sandbox?.executionMode !== "docker";
|
|
217
215
|
}
|
|
218
|
-
function prePublicationExecution(context, environment, defaultRunner, baselineRevision) {
|
|
219
|
-
const hostLoadOwner = {
|
|
220
|
-
dispatchAttemptId: context.dispatch.sandbox?.dispatchAttemptId ?? null,
|
|
221
|
-
priority: runtimeAdmissionPriority(context.dispatch),
|
|
222
|
-
};
|
|
223
|
-
if (context.processRunner)
|
|
224
|
-
return { baselineRevision, environment, processRunner: context.processRunner, hostLoadOwner };
|
|
225
|
-
if (context.dispatch.sandbox?.executionMode !== "docker")
|
|
226
|
-
return { baselineRevision, environment, hostLoadOwner };
|
|
227
|
-
const expectedSandboxId = context.dispatch.sandbox.dispatchAttemptId;
|
|
228
|
-
const observedSandboxId = context.runtimeEnvironment?.FORGE_SANDBOX_ID ?? process.env.FORGE_SANDBOX_ID;
|
|
229
|
-
if (observedSandboxId !== expectedSandboxId) {
|
|
230
|
-
throw new ForgeFailureError("prepublication_execution_scope_invalid", `prepublication_execution_scope_invalid: Docker attempt ${expectedSandboxId} has no runner proven to execute inside that sandbox.`, "bridge");
|
|
231
|
-
}
|
|
232
|
-
return { baselineRevision, environment, processRunner: defaultRunner, hostLoadOwner };
|
|
233
|
-
}
|
|
234
216
|
function remoteTrackingRefspec(branchName) {
|
|
235
217
|
return `refs/heads/${branchName}:refs/remotes/origin/${branchName}`;
|
|
236
218
|
}
|
|
@@ -572,17 +554,19 @@ export class ProcessBackedProviderCliService {
|
|
|
572
554
|
providerToolHeartbeatIntervalMs;
|
|
573
555
|
publicationCoordinator;
|
|
574
556
|
prePublicationValidator;
|
|
557
|
+
prePublicationRepairTurns;
|
|
575
558
|
constructor(processRunner = new StreamingProviderProcessRunner(), git = new GitClient(), providerToolHeartbeatIntervalMs = defaultProviderToolHeartbeatIntervalMs, publicationCoordinator = new RepositoryCoordinatorLock(defaultWorktreeCoordinatorStateRoot()),
|
|
576
559
|
// The Docker sandbox worker (`forge` run-once via ForgeBridgeCliService) builds
|
|
577
560
|
// this default. A container cannot reach the host ledger, so when the host
|
|
578
561
|
// bridge enabled it, its steps ask the bridge for tokens over the sandbox
|
|
579
562
|
// channel (decision 0013); elsewhere the gate is absent and validation is ungated.
|
|
580
|
-
prePublicationValidator = new PrePublicationValidator(undefined, undefined, undefined, sandboxHostLoadGateFromEnvironment())) {
|
|
563
|
+
prePublicationValidator = new PrePublicationValidator(undefined, undefined, undefined, sandboxHostLoadGateFromEnvironment()), prePublicationRepairTurns = prePublicationRepairTurnsFromEnvironment()) {
|
|
581
564
|
this.processRunner = processRunner;
|
|
582
565
|
this.git = git;
|
|
583
566
|
this.providerToolHeartbeatIntervalMs = providerToolHeartbeatIntervalMs;
|
|
584
567
|
this.publicationCoordinator = publicationCoordinator;
|
|
585
568
|
this.prePublicationValidator = prePublicationValidator;
|
|
569
|
+
this.prePublicationRepairTurns = prePublicationRepairTurns;
|
|
586
570
|
}
|
|
587
571
|
async runDraft(context) {
|
|
588
572
|
const { dispatch } = context;
|
|
@@ -1598,232 +1582,77 @@ export class ProcessBackedProviderCliService {
|
|
|
1598
1582
|
return artifact;
|
|
1599
1583
|
}
|
|
1600
1584
|
async validatePrePublicationWithRecovery(options) {
|
|
1601
|
-
const
|
|
1585
|
+
const processRunner = recoveringProviderProcessRunner(options.context.processRunner ?? this.processRunner);
|
|
1586
|
+
await validatePrePublicationWithRepair(options, {
|
|
1587
|
+
validator: this.prePublicationValidator,
|
|
1588
|
+
defaultProcessRunner: this.processRunner,
|
|
1589
|
+
maxRepairTurns: this.prePublicationRepairTurns,
|
|
1590
|
+
runRepairTurn: async (turn) => await this.runPrePublicationRepairTurn(options, processRunner, turn),
|
|
1591
|
+
});
|
|
1592
|
+
}
|
|
1593
|
+
/** Resumes the provider thread for one in-place repair turn; the turn must leave HEAD where it was. */
|
|
1594
|
+
async runPrePublicationRepairTurn(options, processRunner, turn) {
|
|
1595
|
+
const { context, outputState, preparedHeadSha } = options;
|
|
1602
1596
|
const { dispatch, worktree } = context;
|
|
1603
|
-
const
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1597
|
+
const { prompt: focusedPrompt, repairTurn: nextRepairTurn, maxRepairTurns, repairEnvironment, environment } = turn;
|
|
1598
|
+
const repairDispatch = {
|
|
1599
|
+
...dispatch,
|
|
1600
|
+
session: { ...dispatch.session, resumeProviderThreadId: turn.providerThreadId },
|
|
1601
|
+
};
|
|
1602
|
+
const providerPrompt = buildProviderCliPrompt(repairDispatch, focusedPrompt, repairEnvironment);
|
|
1603
|
+
const pipePromptToStdin = shouldPipePromptToStdin(repairDispatch.execution.provider, providerPrompt, usesManagedWindowsHost(repairDispatch));
|
|
1604
|
+
const command = buildProviderCliCommand(repairDispatch, {
|
|
1605
|
+
worktreePath: worktree.worktreePath,
|
|
1606
|
+
prompt: focusedPrompt,
|
|
1607
|
+
promptFromStdin: pipePromptToStdin,
|
|
1608
|
+
runtimeEnvironment: repairEnvironment,
|
|
1609
|
+
});
|
|
1610
|
+
const toolHeartbeat = new ProviderToolActivityHeartbeat(outputState, context.emit, this.providerToolHeartbeatIntervalMs);
|
|
1611
|
+
let result;
|
|
1612
|
+
let providerStarted = false;
|
|
1613
|
+
try {
|
|
1614
|
+
result = await processRunner.run({
|
|
1615
|
+
command: command.command,
|
|
1616
|
+
args: command.args,
|
|
1617
|
+
cwd: worktree.worktreePath,
|
|
1618
|
+
env: environment,
|
|
1619
|
+
resumesProviderThread: Boolean(repairDispatch.session.resumeProviderThreadId),
|
|
1620
|
+
stdin: pipePromptToStdin ? providerPrompt : undefined,
|
|
1621
|
+
}, {
|
|
1622
|
+
onStarted: async () => {
|
|
1620
1623
|
await context.emit({
|
|
1621
1624
|
role: "runner",
|
|
1622
1625
|
kind: "checkpoint",
|
|
1623
|
-
content: `
|
|
1624
|
-
eventType: "
|
|
1625
|
-
data: JSON.stringify({ repairTurn, maxRepairTurns: maxPrePublicationRepairTurns }),
|
|
1626
|
-
});
|
|
1627
|
-
}
|
|
1628
|
-
return;
|
|
1629
|
-
}
|
|
1630
|
-
catch (error) {
|
|
1631
|
-
if (!(error instanceof PrePublicationValidationError))
|
|
1632
|
-
throw error;
|
|
1633
|
-
if (error.checkId === runtimeRestartCheckId) {
|
|
1634
|
-
// The restart stopped the stack and released its ports before it failed, so the URLs the
|
|
1635
|
-
// repair turn would inherit name ports another attempt may now hold. The turn runs without
|
|
1636
|
-
// them; the next pass restarts the stack and supplies fresh ones.
|
|
1637
|
-
const unavailable = withoutRuntimeStack(repairEnvironment, context.runtimeStackEnvironmentKeys ?? []);
|
|
1638
|
-
repairEnvironment = options.onRuntimeEnvironmentRefreshed
|
|
1639
|
-
? await options.onRuntimeEnvironmentRefreshed(unavailable)
|
|
1640
|
-
: unavailable;
|
|
1641
|
-
environment = providerProcessEnv(dispatch, repairEnvironment);
|
|
1642
|
-
validationEnvironment = prePublicationValidationEnv(dispatch, repairEnvironment);
|
|
1643
|
-
}
|
|
1644
|
-
if (repairTurn >= maxPrePublicationRepairTurns) {
|
|
1645
|
-
await context.emit({
|
|
1646
|
-
role: "runner",
|
|
1647
|
-
kind: "error",
|
|
1648
|
-
content: `Pre-publication validation still fails after ${maxPrePublicationRepairTurns} in-place repair turns: ${clip(error.message, 4000)}`,
|
|
1649
|
-
eventType: "prepublication_repair_exhausted",
|
|
1650
|
-
data: JSON.stringify({ checkId: error.checkId, repairTurns: repairTurn, maxRepairTurns: maxPrePublicationRepairTurns }),
|
|
1626
|
+
content: `Provider pre-publication repair turn ${nextRepairTurn}/${maxRepairTurns} is supervised and ready.`,
|
|
1627
|
+
eventType: "provider_cli_started",
|
|
1651
1628
|
});
|
|
1652
|
-
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
const providerPrompt = buildProviderCliPrompt(repairDispatch, focusedPrompt, repairEnvironment);
|
|
1665
|
-
const pipePromptToStdin = shouldPipePromptToStdin(repairDispatch.execution.provider, providerPrompt, usesManagedWindowsHost(repairDispatch));
|
|
1666
|
-
const command = buildProviderCliCommand(repairDispatch, {
|
|
1667
|
-
worktreePath: worktree.worktreePath,
|
|
1668
|
-
prompt: focusedPrompt,
|
|
1669
|
-
promptFromStdin: pipePromptToStdin,
|
|
1670
|
-
runtimeEnvironment: repairEnvironment,
|
|
1671
|
-
});
|
|
1629
|
+
providerStarted = true;
|
|
1630
|
+
},
|
|
1631
|
+
isToolCallInFlight: toolHeartbeat.isToolCallInFlight,
|
|
1632
|
+
onGenerationStart: toolHeartbeat.startGeneration,
|
|
1633
|
+
onStdoutLine: async (line) => {
|
|
1634
|
+
await toolHeartbeat.consume(line);
|
|
1635
|
+
},
|
|
1636
|
+
}, context.signal);
|
|
1637
|
+
}
|
|
1638
|
+
finally {
|
|
1639
|
+
toolHeartbeat.stop();
|
|
1640
|
+
if (providerStarted) {
|
|
1672
1641
|
await context.emit({
|
|
1673
1642
|
role: "runner",
|
|
1674
1643
|
kind: "checkpoint",
|
|
1675
|
-
content: `
|
|
1676
|
-
eventType: "
|
|
1677
|
-
data: JSON.stringify({ checkId: error.checkId, repairTurn: nextRepairTurn, maxRepairTurns: maxPrePublicationRepairTurns }),
|
|
1644
|
+
content: `Provider pre-publication repair turn ${nextRepairTurn}/${maxRepairTurns} exited.`,
|
|
1645
|
+
eventType: "provider_cli_completed",
|
|
1678
1646
|
});
|
|
1679
|
-
const toolHeartbeat = new ProviderToolActivityHeartbeat(outputState, context.emit, this.providerToolHeartbeatIntervalMs);
|
|
1680
|
-
let result;
|
|
1681
|
-
let providerStarted = false;
|
|
1682
|
-
try {
|
|
1683
|
-
result = await processRunner.run({
|
|
1684
|
-
command: command.command,
|
|
1685
|
-
args: command.args,
|
|
1686
|
-
cwd: worktree.worktreePath,
|
|
1687
|
-
env: environment,
|
|
1688
|
-
resumesProviderThread: Boolean(repairDispatch.session.resumeProviderThreadId),
|
|
1689
|
-
stdin: pipePromptToStdin ? providerPrompt : undefined,
|
|
1690
|
-
}, {
|
|
1691
|
-
onStarted: async () => {
|
|
1692
|
-
await context.emit({
|
|
1693
|
-
role: "runner",
|
|
1694
|
-
kind: "checkpoint",
|
|
1695
|
-
content: `Provider pre-publication repair turn ${nextRepairTurn}/${maxPrePublicationRepairTurns} is supervised and ready.`,
|
|
1696
|
-
eventType: "provider_cli_started",
|
|
1697
|
-
});
|
|
1698
|
-
providerStarted = true;
|
|
1699
|
-
},
|
|
1700
|
-
isToolCallInFlight: toolHeartbeat.isToolCallInFlight,
|
|
1701
|
-
onGenerationStart: toolHeartbeat.startGeneration,
|
|
1702
|
-
onStdoutLine: async (line) => {
|
|
1703
|
-
await toolHeartbeat.consume(line);
|
|
1704
|
-
},
|
|
1705
|
-
}, context.signal);
|
|
1706
|
-
}
|
|
1707
|
-
finally {
|
|
1708
|
-
toolHeartbeat.stop();
|
|
1709
|
-
if (providerStarted) {
|
|
1710
|
-
await context.emit({
|
|
1711
|
-
role: "runner",
|
|
1712
|
-
kind: "checkpoint",
|
|
1713
|
-
content: `Provider pre-publication repair turn ${nextRepairTurn}/${maxPrePublicationRepairTurns} exited.`,
|
|
1714
|
-
eventType: "provider_cli_completed",
|
|
1715
|
-
});
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
|
-
if (result.exitCode !== 0)
|
|
1719
|
-
throw providerCliExitFailure(command.command, result);
|
|
1720
|
-
const postRepairHeadSha = (await this.git.run(worktree.worktreePath, ["rev-parse", "HEAD"])).trim();
|
|
1721
|
-
if (postRepairHeadSha.toLowerCase() !== preparedHeadSha.toLowerCase()) {
|
|
1722
|
-
throw new Error(`provider_publication_boundary_violation: pre-publication repair changed HEAD from ${preparedHeadSha} to ${postRepairHeadSha}; Forge requires provider changes to remain uncommitted and unpushed until validation passes.`, { cause: error });
|
|
1723
|
-
}
|
|
1724
1647
|
}
|
|
1725
1648
|
}
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
*/
|
|
1732
|
-
async refreshPrePublicationRuntime(context, validationProfile, repairTurn) {
|
|
1733
|
-
if (!context.refreshRuntimeEnvironment)
|
|
1734
|
-
return null;
|
|
1735
|
-
let refreshed;
|
|
1736
|
-
try {
|
|
1737
|
-
refreshed = await context.refreshRuntimeEnvironment(context.signal);
|
|
1738
|
-
}
|
|
1739
|
-
catch (error) {
|
|
1740
|
-
// A restart that fails to build, start or become ready reflects the changed source, which a
|
|
1741
|
-
// bounded repair turn can fix; the next pass restarts again. Cancellation, a released lease
|
|
1742
|
-
// and a changed runtime contract still end the attempt.
|
|
1743
|
-
if (restartFailureForRepair(error)) {
|
|
1744
|
-
throw new PrePublicationValidationError(runtimeRestartCheckId, 1, "forge-host-runtime-restart", [],
|
|
1745
|
-
// The session's host_runtime_restart_started event records why it restarted.
|
|
1746
|
-
`Forge restarted the attempt runtime stack before validation, and the restart failed: ${error.message}`);
|
|
1747
|
-
}
|
|
1748
|
-
throw error;
|
|
1649
|
+
if (result.exitCode !== 0)
|
|
1650
|
+
throw providerCliExitFailure(command.command, result);
|
|
1651
|
+
const postRepairHeadSha = (await this.git.run(worktree.worktreePath, ["rev-parse", "HEAD"])).trim();
|
|
1652
|
+
if (postRepairHeadSha.toLowerCase() !== preparedHeadSha.toLowerCase()) {
|
|
1653
|
+
throw new Error(`provider_publication_boundary_violation: pre-publication repair changed HEAD from ${preparedHeadSha} to ${postRepairHeadSha}; Forge requires provider changes to remain uncommitted and unpushed until validation passes.`, { cause: turn.failure });
|
|
1749
1654
|
}
|
|
1750
|
-
if (!refreshed)
|
|
1751
|
-
return null;
|
|
1752
|
-
const { environment: restarted, reason, changes } = refreshed;
|
|
1753
|
-
const apiUrl = restarted.FORGE_E2E_API_URL ?? restarted.FORGE_API_URL ?? null;
|
|
1754
|
-
const webUrl = restarted.FORGE_E2E_WEB_URL ?? restarted.FORGE_WEB_URL ?? restarted.FORGE_PLAYWRIGHT_BASE_URL ?? null;
|
|
1755
|
-
await context.emit({
|
|
1756
|
-
role: "runner",
|
|
1757
|
-
kind: "checkpoint",
|
|
1758
|
-
content: `Restarted the attempt runtime stack before pre-publication validation because ${restartReasonText[reason]}; validation${repairTurn > 0 ? " and repair turns" : ""} now use${apiUrl ? ` API ${apiUrl}` : " the refreshed runtime URLs"}${webUrl ? ` and web ${webUrl}` : ""}.`,
|
|
1759
|
-
eventType: "prepublication_runtime_restarted",
|
|
1760
|
-
data: JSON.stringify({
|
|
1761
|
-
reason,
|
|
1762
|
-
changes,
|
|
1763
|
-
validationProfile,
|
|
1764
|
-
repairTurn,
|
|
1765
|
-
apiUrl,
|
|
1766
|
-
webUrl,
|
|
1767
|
-
}),
|
|
1768
|
-
});
|
|
1769
|
-
return restarted;
|
|
1770
|
-
}
|
|
1771
|
-
}
|
|
1772
|
-
const restartReasonText = {
|
|
1773
|
-
previous_restart_incomplete: "the previous restart did not complete",
|
|
1774
|
-
fingerprint_unavailable: "the workspace state could not be compared with the stack's",
|
|
1775
|
-
workspace_changed: "the workspace changed since it was launched",
|
|
1776
|
-
};
|
|
1777
|
-
const runtimeRestartCheckId = "host-runtime-restart";
|
|
1778
|
-
/** The environment with the runtime stack's URLs and ports withheld and the stack marked unavailable. */
|
|
1779
|
-
function withoutRuntimeStack(environment, stackKeys) {
|
|
1780
|
-
const remaining = { ...(environment ?? {}) };
|
|
1781
|
-
for (const key of stackKeys)
|
|
1782
|
-
delete remaining[key];
|
|
1783
|
-
remaining.FORGE_RUNTIME_STACK = "unavailable";
|
|
1784
|
-
return remaining;
|
|
1785
|
-
}
|
|
1786
|
-
const restartFailuresForRepair = new Set([
|
|
1787
|
-
"host_runtime_project_start_failed",
|
|
1788
|
-
"host_runtime_process_exited",
|
|
1789
|
-
"host_runtime_listener_timeout",
|
|
1790
|
-
"host_runtime_http_readiness_timeout",
|
|
1791
|
-
"host_port_collision",
|
|
1792
|
-
]);
|
|
1793
|
-
function restartFailureForRepair(error) {
|
|
1794
|
-
if (error instanceof ForgeFailureError)
|
|
1795
|
-
return restartFailuresForRepair.has(error.failureCode);
|
|
1796
|
-
// The port broker throws an untyped collision once its launch retries are exhausted.
|
|
1797
|
-
return error instanceof HostPortCollisionError;
|
|
1798
|
-
}
|
|
1799
|
-
function buildPrePublicationRepairPrompt(error, repairTurn, repairScope) {
|
|
1800
|
-
const invocation = [error.command, ...error.args].join(" ");
|
|
1801
|
-
const priorWork = repairScope === "implementation"
|
|
1802
|
-
? "Keep the completed implementation and its Forge-owned completion artifacts intact."
|
|
1803
|
-
: "Keep the existing PR-comment or CI repairs intact.";
|
|
1804
|
-
return [
|
|
1805
|
-
`Forge pre-publication validation failed after your ${repairScope === "implementation" ? "implementation" : "PR repair"} turn.`,
|
|
1806
|
-
`This is bounded in-place repair turn ${repairTurn}/${maxPrePublicationRepairTurns}.`,
|
|
1807
|
-
`Failed check: ${error.checkId}`,
|
|
1808
|
-
`Command: ${invocation}`,
|
|
1809
|
-
`Exit code: ${error.exitCode}`,
|
|
1810
|
-
"Diagnostics:",
|
|
1811
|
-
error.detail || "The validation command returned no diagnostic output.",
|
|
1812
|
-
"Fix the root cause in the current worktree and run the focused failing check.",
|
|
1813
|
-
`${priorWork} Do not commit, push, rebase, or modify Forge-owned protocol artifacts.`,
|
|
1814
|
-
"When the focused check passes, stop; Bridge will rerun the complete required pre-publication profile and owns commit/push.",
|
|
1815
|
-
].join("\n\n");
|
|
1816
|
-
}
|
|
1817
|
-
function publicationCapabilities(context, runtimeEnvironment) {
|
|
1818
|
-
const capabilities = new Set();
|
|
1819
|
-
const launchTarget = context.dispatch.qaBrowser?.launchTarget;
|
|
1820
|
-
if (runtimeEnvironment?.FORGE_PLAYWRIGHT_CONFIG
|
|
1821
|
-
|| launchTarget?.url
|
|
1822
|
-
|| launchTarget?.command
|
|
1823
|
-
|| launchTarget?.managed_runtime_port) {
|
|
1824
|
-
capabilities.add("browser_launch");
|
|
1825
1655
|
}
|
|
1826
|
-
return capabilities;
|
|
1827
1656
|
}
|
|
1828
1657
|
async function stageDraftAttachments(dispatch, metadataRoot) {
|
|
1829
1658
|
const attachments = dispatch.draft?.attachments ?? [];
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const forgeBridgeVersion = "0.1.4-dev.
|
|
1
|
+
export declare const forgeBridgeVersion = "0.1.4-dev.b33004c2b0ea";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const forgeBridgeVersion = "0.1.4-dev.
|
|
1
|
+
export const forgeBridgeVersion = "0.1.4-dev.b33004c2b0ea";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loucompanion/forge-bridge",
|
|
3
|
-
"version": "0.1.4-dev.
|
|
3
|
+
"version": "0.1.4-dev.b33004c2b0ea",
|
|
4
4
|
"description": "Forge runner bridge CLI for connecting local developer machines to Forge dispatch.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"test:residue": "node scripts/run-owned-residue-gate.mjs",
|
|
44
44
|
"test:watch": "vitest",
|
|
45
45
|
"smoke:package": "tsc -p tsconfig.json && node scripts/smoke-package.mjs",
|
|
46
|
-
"lint": "eslint \"src/**/*.ts\" \"scripts/**/*.mjs\" \"vitest.config.ts\" \"vitest.setup.ts\""
|
|
46
|
+
"lint": "eslint \"src/**/*.ts\" \"scripts/**/*.mjs\" \"vitest.config.ts\" \"vitest.setup.ts\" && node ../../scripts/class-design/check-eslint-ratchet.mjs bridge"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@microsoft/signalr": "^8.0.17",
|