@loucompanion/forge-bridge 0.1.3-dev.fbe15023cdfe → 0.1.4-dev.03584818ede5
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 +146 -5
- package/dist/bridge/bridge-chat-provider-command.d.ts +16 -0
- package/dist/bridge/bridge-chat-provider-command.js +137 -0
- package/dist/bridge/bridge-chat.types.d.ts +121 -0
- package/dist/bridge/bridge-chat.types.js +416 -0
- package/dist/bridge/bridge.base.d.ts +13 -1
- package/dist/bridge/bridge.service.d.ts +155 -4
- package/dist/bridge/bridge.service.js +1805 -155
- package/dist/bridge/bridge.types.d.ts +68 -1
- package/dist/bridge/dispatch-result-outbox.d.ts +35 -0
- package/dist/bridge/dispatch-result-outbox.js +87 -0
- package/dist/bridge/dispatch-result-worker.d.ts +2 -0
- package/dist/bridge/dispatch-result-worker.js +122 -0
- package/dist/bridge/internals.d.ts +2 -0
- package/dist/bridge/internals.js +1 -0
- package/dist/bridge/local-yield-flag.d.ts +6 -0
- package/dist/bridge/local-yield-flag.js +34 -0
- package/dist/bridge/readiness-result-outbox.d.ts +21 -0
- package/dist/bridge/readiness-result-outbox.js +54 -0
- package/dist/bridge/readiness-result-worker.d.ts +2 -0
- package/dist/bridge/readiness-result-worker.js +121 -0
- package/dist/bridge/runner-host-capabilities.d.ts +20 -0
- package/dist/bridge/runner-host-capabilities.js +110 -0
- package/dist/bridge/test-postgres-capability.d.ts +14 -0
- package/dist/bridge/test-postgres-capability.js +120 -0
- package/dist/cleanup/cleanup.service.d.ts +10 -0
- package/dist/cleanup/cleanup.service.js +128 -104
- package/dist/cleanup/cleanup.types.d.ts +4 -0
- package/dist/cleanup/forge-owned-paths.d.ts +9 -0
- package/dist/cleanup/forge-owned-paths.js +53 -0
- package/dist/cleanup/host-runtime-ledger.d.ts +5 -0
- package/dist/cleanup/host-runtime-ledger.js +109 -0
- package/dist/cleanup/managed-branch-sweep.d.ts +27 -0
- package/dist/cleanup/managed-branch-sweep.js +111 -0
- package/dist/cli/cli.help.js +22 -4
- package/dist/cli/cli.service.d.ts +30 -6
- package/dist/cli/cli.service.js +216 -31
- package/dist/cli/local-config.d.ts +5 -0
- package/dist/cli/local-config.js +30 -4
- package/dist/runtime/aspnet-runtime-prebuild.d.ts +36 -0
- package/dist/runtime/aspnet-runtime-prebuild.js +429 -0
- package/dist/runtime/attempt-database-broker.d.ts +89 -0
- package/dist/runtime/attempt-database-broker.js +390 -0
- package/dist/runtime/attempt-node-runtime-launcher.d.ts +2 -1
- package/dist/runtime/attempt-node-runtime-launcher.js +57 -18
- package/dist/runtime/attempt-path-operation.d.ts +21 -0
- package/dist/runtime/attempt-path-operation.js +94 -0
- package/dist/runtime/attempt-private-directory.d.ts +6 -0
- package/dist/runtime/attempt-private-directory.js +54 -0
- package/dist/runtime/attempt-process-supervisor.d.ts +35 -0
- package/dist/runtime/attempt-process-supervisor.js +144 -23
- package/dist/runtime/canonical-source-file.d.ts +3 -0
- package/dist/runtime/canonical-source-file.js +54 -0
- package/dist/runtime/docker-engine-probe.d.ts +90 -0
- package/dist/runtime/docker-engine-probe.js +333 -0
- package/dist/runtime/generated-output-reset.d.ts +10 -0
- package/dist/runtime/generated-output-reset.js +62 -8
- package/dist/runtime/host-database-capability-boundary.d.ts +16 -0
- package/dist/runtime/host-database-capability-boundary.js +63 -0
- package/dist/runtime/host-diagnostics.d.ts +11 -0
- package/dist/runtime/host-diagnostics.js +192 -0
- package/dist/runtime/host-execution-root.d.ts +4 -0
- package/dist/runtime/host-execution-root.js +39 -0
- package/dist/runtime/host-facts.d.ts +36 -0
- package/dist/runtime/host-facts.js +95 -0
- package/dist/runtime/host-listener-inspector.d.ts +8 -1
- package/dist/runtime/host-listener-inspector.js +121 -60
- package/dist/runtime/host-load-admission.d.ts +67 -0
- package/dist/runtime/host-load-admission.js +99 -0
- package/dist/runtime/host-load-child-environment.d.ts +27 -0
- package/dist/runtime/host-load-child-environment.js +76 -0
- package/dist/runtime/host-load-forge-cgroups.d.ts +49 -0
- package/dist/runtime/host-load-forge-cgroups.js +140 -0
- package/dist/runtime/host-load-governor-config.d.ts +52 -0
- package/dist/runtime/host-load-governor-config.js +83 -0
- package/dist/runtime/host-load-governor.d.ts +184 -0
- package/dist/runtime/host-load-governor.js +632 -0
- package/dist/runtime/host-load-ledger-lock.d.ts +69 -0
- package/dist/runtime/host-load-ledger-lock.js +185 -0
- package/dist/runtime/host-load-runtime-settings.d.ts +25 -0
- package/dist/runtime/host-load-runtime-settings.js +78 -0
- package/dist/runtime/host-load-sampler.d.ts +149 -0
- package/dist/runtime/host-load-sampler.js +291 -0
- package/dist/runtime/host-load-step-class.d.ts +70 -0
- package/dist/runtime/host-load-step-class.js +161 -0
- package/dist/runtime/host-load-step-reaper.d.ts +27 -0
- package/dist/runtime/host-load-step-reaper.js +95 -0
- package/dist/runtime/host-load-step-run.d.ts +73 -0
- package/dist/runtime/host-load-step-run.js +102 -0
- package/dist/runtime/host-load-test-slot.d.ts +43 -0
- package/dist/runtime/host-load-test-slot.js +81 -0
- package/dist/runtime/host-load-token-ledger.d.ts +200 -0
- package/dist/runtime/host-load-token-ledger.js +453 -0
- package/dist/runtime/host-load-windows-cpu.d.ts +34 -0
- package/dist/runtime/host-load-windows-cpu.js +85 -0
- package/dist/runtime/host-pressure-stall.d.ts +61 -0
- package/dist/runtime/host-pressure-stall.js +168 -0
- package/dist/runtime/host-runtime-contract.d.ts +16 -1
- package/dist/runtime/host-runtime-contract.js +174 -56
- package/dist/runtime/host-runtime-lease.d.ts +163 -9
- package/dist/runtime/host-runtime-lease.js +1464 -121
- package/dist/runtime/host-runtime-promotion.d.ts +35 -3
- package/dist/runtime/host-runtime-promotion.js +107 -12
- package/dist/runtime/host-runtime-requirements-check.d.ts +17 -0
- package/dist/runtime/host-runtime-requirements-check.js +29 -0
- package/dist/runtime/host-runtime-requirements.d.ts +36 -0
- package/dist/runtime/host-runtime-requirements.js +117 -0
- package/dist/runtime/managed-command-teardown.d.ts +62 -0
- package/dist/runtime/managed-command-teardown.js +607 -0
- package/dist/runtime/memory-capacity.d.ts +70 -0
- package/dist/runtime/memory-capacity.js +123 -0
- package/dist/runtime/native-test-postgres-fallback.d.ts +25 -0
- package/dist/runtime/native-test-postgres-fallback.js +91 -0
- package/dist/runtime/node-host-runtime-adapter.d.ts +3 -0
- package/dist/runtime/node-host-runtime-adapter.js +29 -11
- package/dist/runtime/pinned-directory-process.d.ts +9 -0
- package/dist/runtime/pinned-directory-process.js +61 -0
- package/dist/runtime/pinned-source-directory.d.ts +17 -0
- package/dist/runtime/pinned-source-directory.js +94 -0
- package/dist/runtime/playwright-browser-cache.d.ts +39 -0
- package/dist/runtime/playwright-browser-cache.js +227 -0
- package/dist/runtime/playwright-host-runtime-adapter.d.ts +19 -0
- package/dist/runtime/playwright-host-runtime-adapter.js +113 -59
- package/dist/runtime/prepared-runtime-identity.d.ts +6 -0
- package/dist/runtime/prepared-runtime-identity.js +218 -0
- package/dist/runtime/prepared-runtime-readiness.d.ts +30 -0
- package/dist/runtime/prepared-runtime-readiness.js +285 -0
- package/dist/runtime/runner-settings.d.ts +100 -0
- package/dist/runtime/runner-settings.js +214 -0
- package/dist/runtime/runtime-isolation-lease.js +4 -1
- package/dist/runtime/workspace-resource-estimator.d.ts +17 -0
- package/dist/runtime/workspace-resource-estimator.js +174 -0
- package/dist/sandbox/host-capacity-broker.d.ts +113 -0
- package/dist/sandbox/host-capacity-broker.js +334 -0
- package/dist/sandbox/preflight.d.ts +31 -1
- package/dist/sandbox/preflight.js +237 -51
- package/dist/sandbox/repository-lock.d.ts +2 -1
- package/dist/sandbox/repository-lock.js +19 -9
- package/dist/sandbox/runtime.d.ts +16 -2
- package/dist/sandbox/runtime.js +182 -109
- package/dist/sandbox/sandbox-cgroups.d.ts +14 -0
- package/dist/sandbox/sandbox-cgroups.js +42 -0
- package/dist/sandbox/sandbox.types.d.ts +7 -0
- package/dist/sandbox/workspace.service.js +2 -0
- package/dist/session/architect-waits.d.ts +2 -0
- package/dist/session/architect-waits.js +138 -0
- package/dist/session/managed-attempt-tools.d.ts +44 -1
- package/dist/session/managed-attempt-tools.js +816 -46
- package/dist/session/managed-build-coordinator.d.ts +5 -0
- package/dist/session/managed-build-coordinator.js +109 -0
- package/dist/session/managed-build-receipt.d.ts +21 -0
- package/dist/session/managed-build-receipt.js +337 -0
- package/dist/session/managed-command-host-load.d.ts +47 -0
- package/dist/session/managed-command-host-load.js +83 -0
- package/dist/session/managed-verification-timeouts.d.ts +8 -0
- package/dist/session/managed-verification-timeouts.js +17 -0
- package/dist/session/mcp-argument-coercion.d.ts +23 -0
- package/dist/session/mcp-argument-coercion.js +121 -0
- package/dist/session/phase-completion.artifacts.d.ts +24 -0
- package/dist/session/phase-completion.artifacts.js +319 -44
- package/dist/session/phase-completion.command-validation.d.ts +7 -0
- package/dist/session/phase-completion.command-validation.js +77 -0
- package/dist/session/phase-completion.d.ts +15 -1
- package/dist/session/phase-completion.helpers.d.ts +5 -0
- package/dist/session/phase-completion.helpers.js +43 -19
- package/dist/session/phase-completion.js +18 -3
- package/dist/session/phase-completion.prompts.js +22 -18
- package/dist/session/phase-completion.runtime.d.ts +6 -2
- package/dist/session/phase-completion.runtime.js +191 -47
- package/dist/session/phase-completion.schema-parts.d.ts +19 -0
- package/dist/session/phase-completion.schema-parts.js +188 -0
- package/dist/session/phase-completion.schemas.d.ts +3 -3
- package/dist/session/phase-completion.schemas.js +250 -226
- package/dist/session/phase-completion.validation.d.ts +3 -3
- package/dist/session/phase-completion.validation.js +135 -89
- package/dist/session/pre-publication-host-load.d.ts +27 -0
- package/dist/session/pre-publication-host-load.js +111 -0
- package/dist/session/pre-publication-pass.d.ts +61 -0
- package/dist/session/pre-publication-pass.js +148 -0
- package/dist/session/pre-publication-process.d.ts +23 -0
- package/dist/session/pre-publication-process.js +109 -0
- package/dist/session/pre-publication-skipped-tests.d.ts +21 -0
- package/dist/session/pre-publication-skipped-tests.js +109 -0
- package/dist/session/pre-publication-step-execution.d.ts +11 -0
- package/dist/session/pre-publication-step-execution.js +49 -0
- package/dist/session/pre-publication-validation.d.ts +87 -0
- package/dist/session/pre-publication-validation.js +668 -0
- package/dist/session/provider-cli/bridge-cli.conformance-fixtures.d.ts +72 -0
- package/dist/session/provider-cli/bridge-cli.conformance-fixtures.js +462 -0
- package/dist/session/provider-cli/ci-repair-readiness.d.ts +8 -0
- package/dist/session/provider-cli/ci-repair-readiness.js +23 -3
- package/dist/session/provider-cli/claude-background-work.d.ts +66 -0
- package/dist/session/provider-cli/claude-background-work.js +180 -0
- 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.artifacts.d.ts +6 -3
- package/dist/session/provider-cli/provider-cli.artifacts.js +62 -22
- package/dist/session/provider-cli/provider-cli.child-environment.d.ts +7 -0
- package/dist/session/provider-cli/provider-cli.child-environment.js +73 -0
- package/dist/session/provider-cli/provider-cli.codex-models-cache.d.ts +3 -0
- package/dist/session/provider-cli/provider-cli.codex-models-cache.js +37 -0
- package/dist/session/provider-cli/provider-cli.deterministic.js +34 -2
- package/dist/session/provider-cli/provider-cli.merge-integrity.d.ts +89 -0
- package/dist/session/provider-cli/provider-cli.merge-integrity.js +310 -0
- package/dist/session/provider-cli/provider-cli.process.d.ts +92 -14
- package/dist/session/provider-cli/provider-cli.process.js +583 -210
- package/dist/session/provider-cli/provider-cli.prompts.d.ts +12 -0
- package/dist/session/provider-cli/provider-cli.prompts.js +200 -25
- package/dist/session/provider-cli/provider-cli.repair-epoch.d.ts +6 -0
- package/dist/session/provider-cli/provider-cli.repair-epoch.js +11 -0
- package/dist/session/provider-cli/provider-cli.runtime.d.ts +14 -1
- package/dist/session/provider-cli/provider-cli.runtime.js +61 -3
- package/dist/session/provider-cli/provider-cli.service.d.ts +33 -5
- package/dist/session/provider-cli/provider-cli.service.js +819 -84
- package/dist/session/provider-cli/provider-cli.types.d.ts +32 -0
- package/dist/session/provider-cli/provider-cli.windows-environment.d.ts +10 -0
- package/dist/session/provider-cli/provider-cli.windows-environment.js +151 -0
- package/dist/session/provider-cli/provider-in-flight-work.d.ts +10 -0
- package/dist/session/provider-cli/provider-in-flight-work.js +92 -0
- package/dist/session/provider-cli/provider-output-pipes.d.ts +30 -0
- package/dist/session/provider-cli/provider-output-pipes.js +67 -0
- package/dist/session/provider-cli/provider-output-state.d.ts +18 -0
- package/dist/session/provider-cli/provider-output-state.js +376 -17
- package/dist/session/provider-cli/provider-usage.d.ts +9 -1
- package/dist/session/provider-cli/provider-usage.js +28 -5
- package/dist/session/publishable-worktree-changes.d.ts +54 -0
- package/dist/session/publishable-worktree-changes.js +193 -0
- package/dist/session/sandbox-host-capacity-gate.d.ts +30 -0
- package/dist/session/sandbox-host-capacity-gate.js +238 -0
- package/dist/session/session-redaction.js +434 -9
- package/dist/session/session.base.d.ts +9 -1
- package/dist/session/session.service.d.ts +9 -2
- package/dist/session/session.service.js +264 -27
- package/dist/session/session.types.d.ts +150 -2
- package/dist/session/session.types.js +599 -7
- package/dist/session/unreferenced-exports.d.ts +12 -0
- package/dist/session/unreferenced-exports.js +59 -0
- package/dist/session/workspace-runtime-fingerprint.d.ts +32 -0
- package/dist/session/workspace-runtime-fingerprint.js +138 -0
- package/dist/shared/format/format-bytes.d.ts +1 -0
- package/dist/shared/format/format-bytes.js +9 -0
- package/dist/shared/git/git.js +2 -1
- package/dist/shared/path/path.d.ts +1 -0
- package/dist/shared/path/path.js +18 -0
- package/dist/shared/process/dotnet-toolchain.d.ts +17 -0
- package/dist/shared/process/dotnet-toolchain.js +307 -0
- package/dist/shared/process/host-process-recovery.js +3 -2
- package/dist/shared/process/host-process-supervisor.d.ts +3 -0
- package/dist/shared/process/host-process-supervisor.js +61 -12
- package/dist/shared/process/process-tree.d.ts +52 -0
- package/dist/shared/process/process-tree.js +144 -0
- package/dist/shared/process/process.d.ts +69 -0
- package/dist/shared/process/process.js +223 -16
- package/dist/shared/process/windows-app-execution-alias.d.ts +19 -0
- package/dist/shared/process/windows-app-execution-alias.js +45 -0
- package/dist/shared/process/windows-launch.d.ts +18 -0
- package/dist/shared/process/windows-launch.js +68 -0
- package/dist/shared/provider-capabilities.d.ts +3 -0
- package/dist/shared/provider-capabilities.js +84 -0
- package/dist/shared/redaction/redaction.d.ts +1 -0
- package/dist/shared/redaction/redaction.js +39 -3
- package/dist/shared/time/monotonic.d.ts +1 -0
- package/dist/shared/time/monotonic.js +8 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worktree/dependency-warmer.d.ts +66 -9
- package/dist/worktree/dependency-warmer.js +609 -24
- package/dist/worktree/index.d.ts +1 -1
- package/dist/worktree/story-qa-reference-hydrator.d.ts +4 -0
- package/dist/worktree/story-qa-reference-hydrator.js +253 -0
- package/dist/worktree/worktree.service.d.ts +17 -1
- package/dist/worktree/worktree.service.js +293 -21
- package/dist/worktree/worktree.types.d.ts +14 -1
- package/package.json +8 -6
- package/runtime/windows-job-supervisor.ps1 +380 -14
|
@@ -2,10 +2,14 @@ import fs from "node:fs/promises";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { artifactRootFor, artifactRootForOwner, debugCompletionPhaseOrder, draftCompletionGateOrder, qaCompletionGateOrder, readCompletionArtifact } from "../phase-completion.js";
|
|
4
4
|
import { ensureNoSymbolicLinkPathSegments, isPathUnderRoot, sha256File } from "../qa-sidecar-validation.js";
|
|
5
|
+
import { isRuntimeOnlyPath, stagePublishableWorktreeChangeSet } from "../publishable-worktree-changes.js";
|
|
6
|
+
import { providerCompletionToolMissingFailure } from "./provider-cli.process.js";
|
|
5
7
|
import { hasLaunchTarget } from "./provider-cli.qa-sidecars.js";
|
|
6
8
|
import { clip, isNodeError, messageFromError, normalizedString, parseJsonLine, stringField } from "./provider-output-state.js";
|
|
9
|
+
import { assertMergeResolutionPreservesUpstreamChanges, isMergeInProgress, mergeResolutionCommitNotes } from "./provider-cli.merge-integrity.js";
|
|
10
|
+
const maxTransportedQaSidecarBytes = 8 * 1024 * 1024;
|
|
11
|
+
const maxTransportedQaSidecarsTotalBytes = 16 * 1024 * 1024;
|
|
7
12
|
const developCyclePhaseOrder = ["implementation", "self_review", "validation"];
|
|
8
|
-
const nonPublishableWorktreePaths = [".forge", ".local"];
|
|
9
13
|
export async function emitDraftGateArtifacts(emit, worktreePath, workItemId) {
|
|
10
14
|
const draftArtifactFiles = {
|
|
11
15
|
draft_intent: "draft.intent.json",
|
|
@@ -146,24 +150,28 @@ export async function cleanupCompletionTools(completionTools, emit) {
|
|
|
146
150
|
}).catch(() => undefined);
|
|
147
151
|
}
|
|
148
152
|
}
|
|
149
|
-
export async function commitWorktreeChanges(git, worktreePath, workItemId) {
|
|
150
|
-
await git
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
.
|
|
157
|
-
.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
153
|
+
export async function commitWorktreeChanges(git, worktreePath, workItemId, alreadyStagedChangedFiles) {
|
|
154
|
+
const changedFiles = alreadyStagedChangedFiles ?? await stagePublishableWorktreeChanges(git, worktreePath);
|
|
155
|
+
const mergeReport = await assertMergeResolutionPreservesUpstreamChanges(git, worktreePath, { ignorePath: isRuntimeOnlyPath });
|
|
156
|
+
// A merge is always finalized, even when every change it brought is unpublishable
|
|
157
|
+
// runtime output; skipping the commit would leave MERGE_HEAD dangling.
|
|
158
|
+
const merging = await isMergeInProgress(git, worktreePath);
|
|
159
|
+
if (changedFiles.length > 0 || merging) {
|
|
160
|
+
const notes = mergeResolutionCommitNotes(mergeReport).flatMap(note => ["-m", note]);
|
|
161
|
+
await git.run(worktreePath, [
|
|
162
|
+
"commit",
|
|
163
|
+
...(changedFiles.length === 0 ? ["--allow-empty"] : []),
|
|
164
|
+
"-m",
|
|
165
|
+
`provider cli changeset for ${workItemId.slice(0, 8)}`,
|
|
166
|
+
...notes,
|
|
167
|
+
]);
|
|
163
168
|
}
|
|
164
169
|
const commitSha = (await git.run(worktreePath, ["rev-parse", "HEAD"])).trim();
|
|
165
170
|
return { commitSha, changedFiles };
|
|
166
171
|
}
|
|
172
|
+
export async function stagePublishableWorktreeChanges(git, worktreePath) {
|
|
173
|
+
return (await stagePublishableWorktreeChangeSet(git, worktreePath)).publishable;
|
|
174
|
+
}
|
|
167
175
|
export function phaseCompleteEventType(phase) {
|
|
168
176
|
return phase === "implementation" ? "implementation_complete" : `${phase}_complete`;
|
|
169
177
|
}
|
|
@@ -212,12 +220,13 @@ export async function readQaCompletionArtifactBundle(worktreePath, workItemId, o
|
|
|
212
220
|
const planJson = await fs.readFile(path.join(artifactRoot, qaArtifactFileNames.plan), "utf8");
|
|
213
221
|
const evidenceJson = await fs.readFile(path.join(artifactRoot, qaArtifactFileNames.evidence), "utf8");
|
|
214
222
|
const findingsJson = await fs.readFile(path.join(artifactRoot, qaArtifactFileNames.findings), "utf8");
|
|
215
|
-
await
|
|
223
|
+
const sidecars = await readQaBundleSidecars(worktreePath, workItemId, ownerType, ownerId);
|
|
216
224
|
return {
|
|
217
225
|
...artifact,
|
|
218
226
|
planJson,
|
|
219
227
|
evidenceJson,
|
|
220
|
-
findingsJson
|
|
228
|
+
findingsJson,
|
|
229
|
+
sidecars
|
|
221
230
|
};
|
|
222
231
|
}
|
|
223
232
|
export async function hasCompleteQaArtifactBundle(worktreePath, workItemId, ownerType, ownerId) {
|
|
@@ -274,15 +283,21 @@ function hasPassingRepositoryPlaywrightEvidence(evidence) {
|
|
|
274
283
|
});
|
|
275
284
|
}
|
|
276
285
|
export async function validateQaBundleSidecarReferences(worktreePath, workItemId, ownerType, ownerId) {
|
|
286
|
+
await readQaBundleSidecars(worktreePath, workItemId, ownerType, ownerId);
|
|
287
|
+
}
|
|
288
|
+
export async function readQaBundleSidecars(worktreePath, workItemId, ownerType, ownerId) {
|
|
277
289
|
const artifactRoot = ownerType && ownerId
|
|
278
290
|
? artifactRootForOwner(worktreePath, ownerType, ownerId)
|
|
279
291
|
: artifactRootFor(worktreePath, workItemId);
|
|
280
292
|
const evidence = await readJsonObjectFile(path.join(artifactRoot, qaArtifactFileNames.evidence));
|
|
281
293
|
const sidecars = arrayField(evidence, "sidecars");
|
|
282
294
|
if (sidecars.length === 0) {
|
|
283
|
-
return;
|
|
295
|
+
return [];
|
|
284
296
|
}
|
|
285
297
|
const qaSidecarRoot = path.resolve(artifactRoot, "qa");
|
|
298
|
+
const transported = [];
|
|
299
|
+
const transportedByPath = new Map();
|
|
300
|
+
let totalBytes = 0;
|
|
286
301
|
for (const [index, sidecar] of sidecars.entries()) {
|
|
287
302
|
const sidecarPath = stringField(sidecar, "path");
|
|
288
303
|
const expectedHash = stringField(sidecar, "content_hash");
|
|
@@ -312,11 +327,36 @@ export async function validateQaBundleSidecarReferences(worktreePath, workItemId
|
|
|
312
327
|
if (stat.size !== expectedBytes) {
|
|
313
328
|
throw new Error(`QA sidecar ${index} bytes do not match the referenced file.`);
|
|
314
329
|
}
|
|
330
|
+
if (stat.size > maxTransportedQaSidecarBytes) {
|
|
331
|
+
throw new Error(`QA sidecar ${index} exceeds the ${maxTransportedQaSidecarBytes}-byte transport limit.`);
|
|
332
|
+
}
|
|
315
333
|
const actualHash = await sha256File(fullPath);
|
|
316
334
|
if (actualHash !== expectedHash.trim().toLowerCase()) {
|
|
317
335
|
throw new Error(`QA sidecar ${index} content_hash does not match the referenced file.`);
|
|
318
336
|
}
|
|
337
|
+
const canonicalPath = path.relative(worktreePath, fullPath).split(path.sep).join("/");
|
|
338
|
+
const duplicateKey = canonicalPath.toLowerCase();
|
|
339
|
+
const existing = transportedByPath.get(duplicateKey);
|
|
340
|
+
if (existing) {
|
|
341
|
+
if (existing.contentHash !== actualHash || existing.bytes !== stat.size) {
|
|
342
|
+
throw new Error(`QA sidecar ${index} conflicts with another payload for ${canonicalPath}.`);
|
|
343
|
+
}
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
totalBytes += stat.size;
|
|
347
|
+
if (totalBytes > maxTransportedQaSidecarsTotalBytes) {
|
|
348
|
+
throw new Error(`QA sidecars exceed the ${maxTransportedQaSidecarsTotalBytes}-byte total transport limit.`);
|
|
349
|
+
}
|
|
350
|
+
const content = await fs.readFile(fullPath);
|
|
351
|
+
transportedByPath.set(duplicateKey, { contentHash: actualHash, bytes: stat.size });
|
|
352
|
+
transported.push({
|
|
353
|
+
path: canonicalPath,
|
|
354
|
+
contentBase64: content.toString("base64"),
|
|
355
|
+
contentHash: actualHash,
|
|
356
|
+
bytes: stat.size
|
|
357
|
+
});
|
|
319
358
|
}
|
|
359
|
+
return transported;
|
|
320
360
|
}
|
|
321
361
|
export async function emitQaStructuredEvents(emit, artifact) {
|
|
322
362
|
const artifactRoot = path.dirname(artifact.path);
|
|
@@ -745,11 +785,11 @@ export class LiveCompletionArtifactEmitter {
|
|
|
745
785
|
}
|
|
746
786
|
}
|
|
747
787
|
}
|
|
748
|
-
export async function readCompletionArtifactsForRun(worktreePath, workItemId, phase, developCycle, debugCycle) {
|
|
788
|
+
export async function readCompletionArtifactsForRun(worktreePath, workItemId, phase, developCycle, debugCycle, providerResult) {
|
|
749
789
|
if (!developCycle && !debugCycle) {
|
|
750
790
|
const artifact = await readCompletionArtifact(worktreePath, workItemId, phase);
|
|
751
791
|
if (!artifact) {
|
|
752
|
-
throw
|
|
792
|
+
throw providerCompletionToolMissingFailure(`Provider CLI completed but did not call the Forge ${phase} completion tool.`, providerResult);
|
|
753
793
|
}
|
|
754
794
|
return [artifact];
|
|
755
795
|
}
|
|
@@ -761,11 +801,11 @@ export async function readCompletionArtifactsForRun(worktreePath, workItemId, ph
|
|
|
761
801
|
const artifact = await readCompletionArtifact(worktreePath, workItemId, expectedPhase);
|
|
762
802
|
if (!artifact) {
|
|
763
803
|
if (artifacts.length === 0) {
|
|
764
|
-
throw
|
|
804
|
+
throw providerCompletionToolMissingFailure(`Provider CLI completed but did not call the Forge ${expectedPhase} completion tool.`, providerResult);
|
|
765
805
|
}
|
|
766
806
|
const previous = artifacts[artifacts.length - 1];
|
|
767
807
|
if ((previous.status ?? "").trim().toLowerCase() === "pass") {
|
|
768
|
-
throw
|
|
808
|
+
throw providerCompletionToolMissingFailure(`Provider CLI completed after ${previous.phase} passed but did not call the Forge ${expectedPhase} completion tool.`, providerResult);
|
|
769
809
|
}
|
|
770
810
|
return artifacts;
|
|
771
811
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ProviderChildEnvironmentOptions {
|
|
2
|
+
readonly parentEnv?: NodeJS.ProcessEnv;
|
|
3
|
+
readonly platform?: NodeJS.Platform;
|
|
4
|
+
readonly homeDir?: string;
|
|
5
|
+
readonly arch?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function buildProviderChildEnvironment(requestEnv?: Readonly<Record<string, string>>, options?: ProviderChildEnvironmentOptions): NodeJS.ProcessEnv;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import os from "node:os";
|
|
2
|
+
import { normalizeWindowsProviderEnvironment, windowsAllowedProviderParentEnvNames } from "./provider-cli.windows-environment.js";
|
|
3
|
+
// The environment a provider child process starts with: an allowlist of the Bridge's own
|
|
4
|
+
// variables, the request's values, the Windows defaults, then the .NET build-server settings.
|
|
5
|
+
const allowedProviderParentEnvNames = [
|
|
6
|
+
"PATH",
|
|
7
|
+
"HOME",
|
|
8
|
+
"USERPROFILE",
|
|
9
|
+
"TMPDIR",
|
|
10
|
+
"TEMP",
|
|
11
|
+
"TMP",
|
|
12
|
+
"LANG",
|
|
13
|
+
"CLAUDE_CONFIG_DIR"
|
|
14
|
+
];
|
|
15
|
+
export function buildProviderChildEnvironment(requestEnv, options = {}) {
|
|
16
|
+
const parentEnv = options.parentEnv ?? process.env;
|
|
17
|
+
const platform = options.platform ?? process.platform;
|
|
18
|
+
const env = {};
|
|
19
|
+
for (const [key, value] of Object.entries(parentEnv)) {
|
|
20
|
+
if (typeof value === "string" && isAllowedProviderParentEnv(key, platform)) {
|
|
21
|
+
env[key] = value;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (requestEnv) {
|
|
25
|
+
for (const [key, value] of Object.entries(requestEnv)) {
|
|
26
|
+
const trimmedKey = key.trim();
|
|
27
|
+
if (trimmedKey.length > 0) {
|
|
28
|
+
env[trimmedKey] = value;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (platform === "win32") {
|
|
33
|
+
normalizeWindowsProviderEnvironment(env, parentEnv, options.homeDir ?? os.homedir(), options.arch ?? os.arch());
|
|
34
|
+
}
|
|
35
|
+
normalizeProviderBuildEnvironment(env);
|
|
36
|
+
return env;
|
|
37
|
+
}
|
|
38
|
+
function normalizeProviderBuildEnvironment(env) {
|
|
39
|
+
// Provider sessions are long lived and commonly run many dotnet builds. Persistent
|
|
40
|
+
// MSBuild and Roslyn compiler servers otherwise survive individual commands and can
|
|
41
|
+
// retain more memory than the active Forge lane. Keep those caches process-scoped by
|
|
42
|
+
// default on every runner OS; an explicitly supplied request value still wins.
|
|
43
|
+
setCanonicalProviderBuildEnvironmentValue(env, "DOTNET_CLI_USE_MSBUILD_SERVER", "0");
|
|
44
|
+
setCanonicalProviderBuildEnvironmentValue(env, "MSBUILDDISABLENODEREUSE", "1");
|
|
45
|
+
setCanonicalProviderBuildEnvironmentValue(env, "UseSharedCompilation", "false");
|
|
46
|
+
}
|
|
47
|
+
function setCanonicalProviderBuildEnvironmentValue(env, name, value) {
|
|
48
|
+
// The dotnet CLI uses case-sensitive environment lookup on POSIX, while MSBuild
|
|
49
|
+
// property names are case-insensitive on every OS. Collapse request aliases to
|
|
50
|
+
// one canonical key so the explicit value wins without producing ambiguity.
|
|
51
|
+
const exact = env[name];
|
|
52
|
+
const alias = Object.entries(env).find(([key, candidate]) => key !== name
|
|
53
|
+
&& key.toLowerCase() === name.toLowerCase()
|
|
54
|
+
&& typeof candidate === "string"
|
|
55
|
+
&& candidate.trim().length > 0)?.[1];
|
|
56
|
+
const resolved = typeof exact === "string" && exact.trim().length > 0
|
|
57
|
+
? exact
|
|
58
|
+
: alias ?? value;
|
|
59
|
+
for (const key of Object.keys(env)) {
|
|
60
|
+
if (key !== name && key.toLowerCase() === name.toLowerCase()) {
|
|
61
|
+
delete env[key];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
env[name] = resolved;
|
|
65
|
+
}
|
|
66
|
+
function isAllowedProviderParentEnv(key, platform = process.platform) {
|
|
67
|
+
return isAllowedProviderParentEnvName(key, allowedProviderParentEnvNames)
|
|
68
|
+
|| key.toUpperCase().startsWith("LC_")
|
|
69
|
+
|| (platform === "win32" && isAllowedProviderParentEnvName(key, windowsAllowedProviderParentEnvNames));
|
|
70
|
+
}
|
|
71
|
+
function isAllowedProviderParentEnvName(key, allowedNames) {
|
|
72
|
+
return allowedNames.some((allowed) => allowed.toLowerCase() === key.toLowerCase());
|
|
73
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ProviderProcessRunResult } from "./provider-cli.process.js";
|
|
2
|
+
export declare function isCodexModelsCacheSchemaFailure(result: ProviderProcessRunResult): boolean;
|
|
3
|
+
export declare function quarantineIncompatibleCodexModelsCache(requestEnv?: Readonly<Record<string, string>>): Promise<boolean>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { readEnvironmentValue } from "./provider-cli.windows-environment.js";
|
|
6
|
+
const maximumRecoverableCodexModelsCacheBytes = 16 * 1024 * 1024;
|
|
7
|
+
export function isCodexModelsCacheSchemaFailure(result) {
|
|
8
|
+
const output = `${result.stderr}\n${result.stdout}`.toLowerCase();
|
|
9
|
+
return output.includes("base_instructions")
|
|
10
|
+
&& output.includes("missing field")
|
|
11
|
+
&& (output.includes("models_cache") || output.includes("models cache") || output.includes("model cache"));
|
|
12
|
+
}
|
|
13
|
+
export async function quarantineIncompatibleCodexModelsCache(requestEnv) {
|
|
14
|
+
const configuredHome = readEnvironmentValue(requestEnv ?? {}, "CODEX_HOME")
|
|
15
|
+
?? readEnvironmentValue(process.env, "CODEX_HOME")
|
|
16
|
+
?? readEnvironmentValue(process.env, "FORGE_CODEX_HOME");
|
|
17
|
+
const codexHome = path.resolve(configuredHome ?? path.join(os.homedir(), ".codex"));
|
|
18
|
+
if (!path.isAbsolute(codexHome) || codexHome === path.parse(codexHome).root)
|
|
19
|
+
return false;
|
|
20
|
+
const cachePath = path.join(codexHome, "models_cache.json");
|
|
21
|
+
const cacheStat = await fs.promises.lstat(cachePath).catch(error => {
|
|
22
|
+
if (error.code === "ENOENT")
|
|
23
|
+
return null;
|
|
24
|
+
throw error;
|
|
25
|
+
});
|
|
26
|
+
if (!cacheStat
|
|
27
|
+
|| !cacheStat.isFile()
|
|
28
|
+
|| cacheStat.isSymbolicLink()
|
|
29
|
+
|| cacheStat.nlink !== 1
|
|
30
|
+
|| cacheStat.size <= 0
|
|
31
|
+
|| cacheStat.size > maximumRecoverableCodexModelsCacheBytes) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
const quarantinePath = path.join(codexHome, `models_cache.forge-incompatible-${Date.now()}-${randomUUID()}.json`);
|
|
35
|
+
await fs.promises.rename(cachePath, quarantinePath);
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
@@ -3,12 +3,13 @@ import path from "node:path";
|
|
|
3
3
|
import { GitClient } from "../../shared/git/git.js";
|
|
4
4
|
import { buildSpecBody, selectLaneCommand } from "../../worktree/artifact-injector.js";
|
|
5
5
|
import { completionPhaseFromDispatch, debugCompletionPhaseOrder, expectedCompletionToolName, expectedDebugCompletionToolName, expectedQaCompletionToolName, qaCompletionGateOrder, readCompletionArtifact, usesDebugCycleCompletion, usesDevelopCycleCompletion, writeCompletionArtifact } from "../phase-completion.js";
|
|
6
|
-
import { emitArchitectStructuredEvents, emitCompletionArtifactRecorded, emitQaArtifactRecorded, emitQaGateAccepted, emitQaStructuredEvents, isDebugCompletionPhaseForProvider, nextQaGate, phaseCompleteEventType, qaArtifactRootForDispatch, readQaCompletionArtifactBundle, readQaGateArtifact } from "./provider-cli.artifacts.js";
|
|
6
|
+
import { commitWorktreeChanges, emitArchitectStructuredEvents, emitCompletionArtifactRecorded, emitQaArtifactRecorded, emitQaGateAccepted, emitQaStructuredEvents, isDebugCompletionPhaseForProvider, nextQaGate, phaseCompleteEventType, qaArtifactRootForDispatch, readQaCompletionArtifactBundle, readQaGateArtifact } from "./provider-cli.artifacts.js";
|
|
7
7
|
import { deterministicBrowserCheck, deterministicBrowserSidecar, hasLaunchTarget, writeQaSidecarFiles } from "./provider-cli.qa-sidecars.js";
|
|
8
8
|
import { buildProviderCliCommand, formatProviderCliCommand, isPullRequestCheckRepairDispatch, isPullRequestCommentsDispatch, singleLine } from "./provider-cli.prompts.js";
|
|
9
9
|
import { estimatedDeterministicUsage, exactRedactionSecrets } from "./provider-cli.runtime.js";
|
|
10
10
|
import { buildProviderUsageEvent } from "./provider-usage.js";
|
|
11
11
|
import { writeCiRepairReadinessManifest } from "./ci-repair-readiness.js";
|
|
12
|
+
import { assertRepairHeadEpoch } from "./provider-cli.repair-epoch.js";
|
|
12
13
|
import { deterministicArchitectPayload, deterministicCompletionPayload, deterministicQaGatePayload } from "./provider-cli.deterministic-payloads.js";
|
|
13
14
|
export class DeterministicProviderCliService {
|
|
14
15
|
git;
|
|
@@ -211,6 +212,7 @@ export class DeterministicProviderCliService {
|
|
|
211
212
|
}
|
|
212
213
|
async runPullRequestRepair(context, route) {
|
|
213
214
|
const { dispatch, worktree } = context;
|
|
215
|
+
await assertRepairHeadEpoch(context, this.git);
|
|
214
216
|
const repairChecks = route === "ci_repair" || isPullRequestCheckRepairDispatch(dispatch);
|
|
215
217
|
const addressComments = isPullRequestCommentsDispatch(dispatch);
|
|
216
218
|
let repairArtifact = null;
|
|
@@ -238,7 +240,37 @@ export class DeterministicProviderCliService {
|
|
|
238
240
|
throw new Error(`Deterministic CI repair did not produce ${reference.path}.`);
|
|
239
241
|
await emitCompletionArtifactRecorded(context.emit, worktree.worktreePath, repairArtifact);
|
|
240
242
|
}
|
|
241
|
-
|
|
243
|
+
if (addressComments) {
|
|
244
|
+
const actionable = dispatch.pullRequest?.reviewFindings.filter(finding => finding.actionable) ?? [];
|
|
245
|
+
if (actionable.length === 0 || !dispatch.pullRequest?.reviewIssueKey || !dispatch.pullRequest.headSha) {
|
|
246
|
+
throw new Error("Deterministic comment repair requires a durable actionable finding snapshot.");
|
|
247
|
+
}
|
|
248
|
+
await writeCompletionArtifact({
|
|
249
|
+
worktreePath: worktree.worktreePath,
|
|
250
|
+
workItemId: dispatch.workItem.id,
|
|
251
|
+
phase: "comment_repair",
|
|
252
|
+
producedBy: "forge-deterministic-provider",
|
|
253
|
+
}, expectedCompletionToolName("comment_repair"), {
|
|
254
|
+
status: "pass",
|
|
255
|
+
summary: "Recorded deterministic decision-required outcomes without changing source.",
|
|
256
|
+
repair_head_sha: dispatch.pullRequest.headSha,
|
|
257
|
+
repair_issue_key: dispatch.pullRequest.reviewIssueKey,
|
|
258
|
+
dispositions: actionable.map(finding => ({
|
|
259
|
+
claim_id: finding.claimId,
|
|
260
|
+
kind: finding.kind,
|
|
261
|
+
body_sha256: finding.bodySha256,
|
|
262
|
+
disposition: "needs_decision",
|
|
263
|
+
evidence: "The deterministic provider cannot evaluate semantic review feedback."
|
|
264
|
+
})),
|
|
265
|
+
changed_files: [],
|
|
266
|
+
validation: []
|
|
267
|
+
});
|
|
268
|
+
repairArtifact = await readCompletionArtifact(worktree.worktreePath, dispatch.workItem.id, "comment_repair");
|
|
269
|
+
if (!repairArtifact)
|
|
270
|
+
throw new Error("Deterministic comment repair did not produce its completion artifact.");
|
|
271
|
+
await emitCompletionArtifactRecorded(context.emit, worktree.worktreePath, repairArtifact);
|
|
272
|
+
}
|
|
273
|
+
await commitWorktreeChanges(this.git, worktree.worktreePath, dispatch.workItem.id);
|
|
242
274
|
await context.emit(buildProviderUsageEvent(dispatch, estimatedDeterministicUsage()));
|
|
243
275
|
await context.emit({
|
|
244
276
|
role: "assistant",
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { GitClient } from "../../shared/git/git.js";
|
|
2
|
+
import { ForgeFailureError } from "../session.types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Publication guards for a provider-run `git merge --no-commit` that Forge Bridge
|
|
5
|
+
* turns into the final merge commit (the conflict-resolve lane, and any repair
|
|
6
|
+
* lane that merges the target branch).
|
|
7
|
+
*
|
|
8
|
+
* Forge stages with `git add -A` and then unstages worktree-local runtime paths
|
|
9
|
+
* such as `.forge` and `.local`. Unstaging resets those paths to HEAD, which is
|
|
10
|
+
* the story side of the merge. Without these guards that silently reverted every
|
|
11
|
+
* upstream change under those paths and re-added files the target branch had
|
|
12
|
+
* deleted (issue #491: 253 files on story/829e1219ee16 and story/6ac8c6c6e704).
|
|
13
|
+
*/
|
|
14
|
+
type GitRunner = Pick<GitClient, "run">;
|
|
15
|
+
export interface InProgressMerge {
|
|
16
|
+
readonly headSha: string;
|
|
17
|
+
readonly mergeHeadSha: string;
|
|
18
|
+
readonly mergeBaseSha: string;
|
|
19
|
+
}
|
|
20
|
+
export interface MergeResolutionReport {
|
|
21
|
+
/**
|
|
22
|
+
* Paths the target branch deleted that the story had changed and that the
|
|
23
|
+
* resolution keeps. These are deliberate modify/delete decisions, recorded in
|
|
24
|
+
* the merge commit message so reviewers see them.
|
|
25
|
+
*/
|
|
26
|
+
readonly keptOverUpstreamDeletion: readonly string[];
|
|
27
|
+
}
|
|
28
|
+
export type UnresolvedMergeConflictKind = "deleted_by_upstream" | "deleted_by_story" | "missing_while_unmerged" | "unresolved_binary" | "conflict_markers";
|
|
29
|
+
export interface UnresolvedMergeConflict {
|
|
30
|
+
readonly path: string;
|
|
31
|
+
readonly kind: UnresolvedMergeConflictKind;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The publication would re-add files that the target branch deleted, or revert
|
|
35
|
+
* target-branch edits, on paths the story never changed. Forge refuses to commit
|
|
36
|
+
* or push such a merge.
|
|
37
|
+
*/
|
|
38
|
+
export declare class MergeResolutionRevertsUpstreamChangesError extends ForgeFailureError {
|
|
39
|
+
readonly merge: InProgressMerge;
|
|
40
|
+
readonly resurrectedPaths: readonly string[];
|
|
41
|
+
readonly revertedPaths: readonly string[];
|
|
42
|
+
readonly code = "merge_resolution_reverts_upstream_changes";
|
|
43
|
+
constructor(merge: InProgressMerge, resurrectedPaths: readonly string[], revertedPaths: readonly string[]);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A conflict is still unresolved when Forge would stage the merge: a
|
|
47
|
+
* modify/delete conflict nobody decided (`git add -A` would silently keep the
|
|
48
|
+
* modified side), or a content conflict whose file still has conflict markers
|
|
49
|
+
* (`git add -A` would commit them).
|
|
50
|
+
*/
|
|
51
|
+
export declare class MergeResolutionUnresolvedConflictError extends ForgeFailureError {
|
|
52
|
+
readonly conflicts: readonly UnresolvedMergeConflict[];
|
|
53
|
+
readonly code = "merge_resolution_unresolved_conflict";
|
|
54
|
+
constructor(conflicts: readonly UnresolvedMergeConflict[]);
|
|
55
|
+
}
|
|
56
|
+
/** True while MERGE_HEAD exists, whether or not the histories share a merge base. */
|
|
57
|
+
export declare function isMergeInProgress(git: GitRunner, worktreePath: string): Promise<boolean>;
|
|
58
|
+
export declare function readInProgressMerge(git: GitRunner, worktreePath: string): Promise<InProgressMerge | null>;
|
|
59
|
+
/**
|
|
60
|
+
* Fails before `git add -A` can silently resolve a conflict:
|
|
61
|
+
* - a modify/delete conflict, by keeping whatever is on disk;
|
|
62
|
+
* - a binary (or other marker-less) conflict, by staging whichever side is on disk;
|
|
63
|
+
* - a content conflict, by staging its conflict markers. This includes markers
|
|
64
|
+
* the provider already staged, which clears the unmerged stages, so every path
|
|
65
|
+
* both sides changed is checked too.
|
|
66
|
+
* A text conflict the agent resolved in the working tree without `git add` is
|
|
67
|
+
* still unmerged here and is accepted once its markers are gone.
|
|
68
|
+
*/
|
|
69
|
+
export declare function assertNoUnresolvedMergeConflicts(git: GitRunner, worktreePath: string): Promise<void>;
|
|
70
|
+
export declare function readUnresolvedMergeConflicts(git: GitRunner, worktreePath: string, merge: InProgressMerge): Promise<readonly UnresolvedMergeConflict[]>;
|
|
71
|
+
/**
|
|
72
|
+
* Staging excludes some worktree changes (Forge runtime output) by unstaging them
|
|
73
|
+
* back to HEAD. During a merge HEAD is the story side, so an excluded path the merge
|
|
74
|
+
* itself changed would lose the target's change. Given the excluded candidate
|
|
75
|
+
* paths, put the merge-owned ones back into the index: the target branch's version
|
|
76
|
+
* where the story never touched the path, and the agent's working-tree resolution
|
|
77
|
+
* where both sides changed it. Returns the restored paths; the rest stay excluded.
|
|
78
|
+
*/
|
|
79
|
+
export declare function restoreMergeOwnedPaths(git: GitRunner, worktreePath: string, candidatePaths: readonly string[]): Promise<readonly string[]>;
|
|
80
|
+
/**
|
|
81
|
+
* Final check on the index Forge is about to commit. Throws when the merge
|
|
82
|
+
* resolution re-adds a path the target branch deleted, or drops a target-branch
|
|
83
|
+
* edit, on a path the story never changed.
|
|
84
|
+
*/
|
|
85
|
+
export declare function assertMergeResolutionPreservesUpstreamChanges(git: GitRunner, worktreePath: string, options?: {
|
|
86
|
+
readonly ignorePath?: (filePath: string) => boolean;
|
|
87
|
+
}): Promise<MergeResolutionReport>;
|
|
88
|
+
export declare function mergeResolutionCommitNotes(report: MergeResolutionReport): readonly string[];
|
|
89
|
+
export {};
|