@loucompanion/forge-bridge 0.1.4-dev.fb770705136a → 0.2.1-dev.0f07274d438b
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 +183 -4
- package/dist/bridge/bridge-chat-giphy-look.d.ts +48 -0
- package/dist/bridge/bridge-chat-giphy-look.js +55 -0
- package/dist/bridge/bridge-chat-provider-command.d.ts +40 -0
- package/dist/bridge/bridge-chat-provider-command.js +230 -0
- package/dist/bridge/bridge-chat.types.d.ts +20 -0
- package/dist/bridge/bridge-chat.types.js +28 -1
- package/dist/bridge/bridge-state-file.d.ts +161 -0
- package/dist/bridge/bridge-state-file.js +376 -0
- package/dist/bridge/bridge-state-io.d.ts +15 -0
- package/dist/bridge/bridge-state-io.js +68 -0
- package/dist/bridge/bridge-state-lock.d.ts +11 -0
- package/dist/bridge/bridge-state-lock.js +102 -0
- package/dist/bridge/bridge-state-unpublished.d.ts +17 -0
- package/dist/bridge/bridge-state-unpublished.js +111 -0
- package/dist/bridge/bridge.base.d.ts +9 -0
- package/dist/bridge/bridge.service.d.ts +102 -14
- package/dist/bridge/bridge.service.js +499 -471
- package/dist/bridge/bridge.types.d.ts +37 -0
- package/dist/bridge/bridge.types.js +2 -1
- package/dist/bridge/default-session-service.d.ts +13 -0
- package/dist/bridge/default-session-service.js +22 -0
- package/dist/bridge/dispatch-offer-policy.d.ts +22 -0
- package/dist/bridge/dispatch-offer-policy.js +58 -0
- package/dist/bridge/in-flight-registry.d.ts +62 -0
- package/dist/bridge/in-flight-registry.js +207 -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 +5 -1
- package/dist/bridge/readiness-result-outbox.js +20 -0
- package/dist/bridge/runner-host-capabilities.d.ts +5 -0
- package/dist/bridge/runner-host-capabilities.js +31 -1
- package/dist/bridge/sandbox-resource-accounting.d.ts +16 -0
- package/dist/bridge/sandbox-resource-accounting.js +150 -0
- package/dist/bridge/test-postgres-capability.d.ts +14 -0
- package/dist/bridge/test-postgres-capability.js +120 -0
- package/dist/bridge/windows-bash-resolution.d.ts +31 -0
- package/dist/bridge/windows-bash-resolution.js +153 -0
- package/dist/cleanup/cleanup-wip.d.ts +12 -0
- package/dist/cleanup/cleanup-wip.js +66 -0
- package/dist/cleanup/cleanup.service.d.ts +20 -1
- package/dist/cleanup/cleanup.service.js +150 -169
- package/dist/cleanup/cleanup.types.d.ts +6 -0
- package/dist/cleanup/forge-owned-paths.d.ts +11 -0
- package/dist/cleanup/forge-owned-paths.js +62 -0
- package/dist/cleanup/host-runtime-ledger.d.ts +7 -0
- package/dist/cleanup/host-runtime-ledger.js +130 -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 +75 -13
- package/dist/cli/cli.service.d.ts +19 -10
- package/dist/cli/cli.service.js +161 -228
- package/dist/cli/idle-status.d.ts +84 -0
- package/dist/cli/idle-status.js +181 -0
- package/dist/cli/local-config.d.ts +18 -1
- package/dist/cli/local-config.js +67 -5
- package/dist/cli/provider-cli-advertising.d.ts +24 -0
- package/dist/cli/provider-cli-advertising.js +88 -0
- package/dist/cli/provider-cli-detection.d.ts +10 -0
- package/dist/cli/provider-cli-detection.js +160 -0
- package/dist/runtime/aspnet-runtime-prebuild.d.ts +20 -0
- package/dist/runtime/aspnet-runtime-prebuild.js +184 -18
- package/dist/runtime/attempt-database-broker.d.ts +1 -1
- package/dist/runtime/attempt-node-runtime-launcher.d.ts +36 -0
- package/dist/runtime/attempt-node-runtime-launcher.js +169 -0
- package/dist/runtime/attempt-process-supervisor.d.ts +2 -0
- package/dist/runtime/attempt-process-supervisor.js +12 -6
- package/dist/runtime/docker-engine-probe.d.ts +5 -0
- package/dist/runtime/docker-engine-probe.js +7 -0
- package/dist/runtime/dotnet-build-outputs.d.ts +107 -0
- package/dist/runtime/dotnet-build-outputs.js +402 -0
- package/dist/runtime/ephemeral-test-postgres-grant.d.ts +37 -0
- package/dist/runtime/ephemeral-test-postgres-grant.js +85 -0
- package/dist/runtime/ephemeral-test-postgres.d.ts +57 -0
- package/dist/runtime/ephemeral-test-postgres.js +303 -0
- package/dist/runtime/host-facts.d.ts +2 -1
- package/dist/runtime/host-listener-inspector.d.ts +26 -0
- package/dist/runtime/host-listener-inspector.js +84 -3
- package/dist/runtime/host-load-admission.d.ts +72 -0
- package/dist/runtime/host-load-admission.js +99 -0
- package/dist/runtime/host-load-capacity.d.ts +198 -0
- package/dist/runtime/host-load-capacity.js +353 -0
- package/dist/runtime/host-load-child-environment.d.ts +40 -0
- package/dist/runtime/host-load-child-environment.js +110 -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 +82 -0
- package/dist/runtime/host-load-governor-config.js +104 -0
- package/dist/runtime/host-load-governor.d.ts +273 -0
- package/dist/runtime/host-load-governor.js +831 -0
- package/dist/runtime/host-load-ledger-lock.d.ts +69 -0
- package/dist/runtime/host-load-ledger-lock.js +187 -0
- package/dist/runtime/host-load-live-test-slots.d.ts +61 -0
- package/dist/runtime/host-load-live-test-slots.js +193 -0
- package/dist/runtime/host-load-runtime-settings.d.ts +25 -0
- package/dist/runtime/host-load-runtime-settings.js +80 -0
- package/dist/runtime/host-load-sampler.d.ts +92 -2
- package/dist/runtime/host-load-sampler.js +166 -8
- 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 +107 -0
- package/dist/runtime/host-load-step-run.js +158 -0
- package/dist/runtime/host-load-test-slot.d.ts +46 -0
- package/dist/runtime/host-load-test-slot.js +100 -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 +21 -1
- package/dist/runtime/host-pressure-stall.js +48 -1
- package/dist/runtime/host-runtime-contract.d.ts +15 -0
- package/dist/runtime/host-runtime-contract.js +39 -6
- package/dist/runtime/host-runtime-lease.d.ts +101 -6
- package/dist/runtime/host-runtime-lease.js +408 -294
- package/dist/runtime/host-runtime-ledger-recovery.d.ts +20 -0
- package/dist/runtime/host-runtime-ledger-recovery.js +134 -0
- package/dist/runtime/host-runtime-promotion.d.ts +101 -2
- package/dist/runtime/host-runtime-promotion.js +355 -14
- 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.js +5 -16
- package/dist/runtime/native-test-postgres-fallback.d.ts +51 -7
- package/dist/runtime/native-test-postgres-fallback.js +60 -8
- package/dist/runtime/playwright-host-runtime-adapter.d.ts +7 -0
- package/dist/runtime/playwright-host-runtime-adapter.js +13 -1
- package/dist/runtime/prepared-runtime-identity.d.ts +4 -0
- package/dist/runtime/prepared-runtime-identity.js +130 -9
- package/dist/runtime/prepared-runtime-readiness.d.ts +23 -1
- package/dist/runtime/prepared-runtime-readiness.js +89 -18
- package/dist/runtime/runner-settings.d.ts +104 -0
- package/dist/runtime/runner-settings.js +236 -0
- package/dist/runtime/supervised-runtime-build-guard.d.ts +45 -0
- package/dist/runtime/supervised-runtime-build-guard.js +112 -0
- package/dist/sandbox/host-capacity-broker.d.ts +115 -0
- package/dist/sandbox/host-capacity-broker.js +336 -0
- package/dist/sandbox/managed-branch.d.ts +13 -0
- package/dist/sandbox/managed-branch.js +90 -0
- package/dist/sandbox/provider-auth/codex.js +11 -11
- package/dist/sandbox/runtime.d.ts +11 -3
- package/dist/sandbox/runtime.js +53 -20
- package/dist/sandbox/sandbox-cgroups.d.ts +14 -0
- package/dist/sandbox/sandbox-cgroups.js +42 -0
- package/dist/sandbox/sandbox-input.d.ts +22 -0
- package/dist/sandbox/sandbox-input.js +49 -0
- package/dist/sandbox/workspace.service.js +15 -2
- 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 +2 -7
- package/dist/session/managed-attempt-tools.js +204 -141
- package/dist/session/managed-build-coordinator.d.ts +16 -0
- package/dist/session/managed-build-coordinator.js +10 -0
- package/dist/session/managed-build-receipt.d.ts +7 -0
- package/dist/session/managed-build-receipt.js +11 -3
- package/dist/session/managed-command-environment.d.ts +8 -0
- package/dist/session/managed-command-environment.js +28 -0
- package/dist/session/managed-command-host-load.d.ts +52 -0
- package/dist/session/managed-command-host-load.js +87 -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.artifact-bundle.d.ts +20 -0
- package/dist/session/phase-completion.artifact-bundle.js +167 -0
- package/dist/session/phase-completion.artifacts.d.ts +9 -17
- package/dist/session/phase-completion.artifacts.js +158 -190
- 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 +31 -2
- package/dist/session/phase-completion.helpers.js +18 -65
- package/dist/session/phase-completion.js +19 -32
- package/dist/session/phase-completion.mcp-args.d.ts +9 -0
- package/dist/session/phase-completion.mcp-args.js +195 -0
- package/dist/session/phase-completion.phase-aliases.d.ts +5 -0
- package/dist/session/phase-completion.phase-aliases.js +43 -0
- package/dist/session/phase-completion.pr-review-schema.d.ts +1 -0
- package/dist/session/phase-completion.pr-review-schema.js +75 -0
- package/dist/session/phase-completion.pr-review-validation.d.ts +11 -0
- package/dist/session/phase-completion.pr-review-validation.js +212 -0
- package/dist/session/phase-completion.pr-review.d.ts +36 -0
- package/dist/session/phase-completion.pr-review.js +294 -0
- package/dist/session/phase-completion.prompts.d.ts +1 -1
- package/dist/session/phase-completion.prompts.js +20 -1
- package/dist/session/phase-completion.runtime.d.ts +13 -12
- package/dist/session/phase-completion.runtime.js +113 -214
- 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 +219 -232
- package/dist/session/phase-completion.validation.d.ts +3 -3
- package/dist/session/phase-completion.validation.js +58 -94
- package/dist/session/pr-review-diff-base.d.ts +18 -0
- package/dist/session/pr-review-diff-base.js +44 -0
- package/dist/session/pr-review-placement.d.ts +50 -0
- package/dist/session/pr-review-placement.js +91 -0
- package/dist/session/pre-publication-change-set.d.ts +62 -0
- package/dist/session/pre-publication-change-set.js +166 -0
- package/dist/session/pre-publication-host-load.d.ts +27 -0
- package/dist/session/pre-publication-host-load.js +112 -0
- package/dist/session/pre-publication-native-postgres.d.ts +30 -0
- package/dist/session/pre-publication-native-postgres.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 +3 -0
- package/dist/session/pre-publication-process.js +32 -19
- package/dist/session/pre-publication-step-execution.d.ts +12 -0
- package/dist/session/pre-publication-step-execution.js +50 -0
- package/dist/session/pre-publication-validation.d.ts +39 -22
- package/dist/session/pre-publication-validation.js +241 -207
- package/dist/session/provider-cli/claude-background-work.d.ts +67 -0
- package/dist/session/provider-cli/claude-background-work.js +181 -0
- package/dist/session/provider-cli/dispatch-target-branch.d.ts +7 -0
- package/dist/session/provider-cli/dispatch-target-branch.js +8 -0
- package/dist/session/provider-cli/host-build-lock.d.ts +18 -0
- package/dist/session/provider-cli/host-build-lock.js +30 -0
- package/dist/session/provider-cli/pr-review-credential-isolation.d.ts +83 -0
- package/dist/session/provider-cli/pr-review-credential-isolation.js +144 -0
- package/dist/session/provider-cli/pr-review-guardrails.d.ts +70 -0
- package/dist/session/provider-cli/pr-review-guardrails.js +360 -0
- package/dist/session/provider-cli/pr-review-prompt.d.ts +2 -0
- package/dist/session/provider-cli/pr-review-prompt.js +119 -0
- package/dist/session/provider-cli/pre-publication-repair.d.ts +56 -0
- package/dist/session/provider-cli/pre-publication-repair.js +281 -0
- package/dist/session/provider-cli/provider-cli.base.d.ts +1 -0
- package/dist/session/provider-cli/provider-cli.child-environment.d.ts +7 -0
- package/dist/session/provider-cli/provider-cli.child-environment.js +75 -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.d.ts +1 -0
- package/dist/session/provider-cli/provider-cli.deterministic.js +5 -0
- package/dist/session/provider-cli/provider-cli.merge-integrity.d.ts +6 -3
- package/dist/session/provider-cli/provider-cli.merge-integrity.js +29 -10
- package/dist/session/provider-cli/provider-cli.pr-review.d.ts +23 -0
- package/dist/session/provider-cli/provider-cli.pr-review.js +213 -0
- package/dist/session/provider-cli/provider-cli.process.d.ts +15 -36
- package/dist/session/provider-cli/provider-cli.process.js +41 -432
- package/dist/session/provider-cli/provider-cli.prompts.d.ts +15 -3
- package/dist/session/provider-cli/provider-cli.prompts.js +183 -90
- package/dist/session/provider-cli/provider-cli.reapply-conflicts.d.ts +10 -0
- package/dist/session/provider-cli/provider-cli.reapply-conflicts.js +37 -0
- package/dist/session/provider-cli/provider-cli.runtime.d.ts +15 -0
- package/dist/session/provider-cli/provider-cli.runtime.js +43 -1
- package/dist/session/provider-cli/provider-cli.service-support.d.ts +37 -0
- package/dist/session/provider-cli/provider-cli.service-support.js +146 -0
- package/dist/session/provider-cli/provider-cli.service.d.ts +18 -18
- package/dist/session/provider-cli/provider-cli.service.js +127 -317
- package/dist/session/provider-cli/provider-cli.types.d.ts +35 -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-cli.windows-launch.d.ts +23 -0
- package/dist/session/provider-cli/provider-cli.windows-launch.js +131 -0
- package/dist/session/provider-cli/provider-in-flight-work.d.ts +4 -0
- package/dist/session/provider-cli/provider-in-flight-work.js +45 -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 +2 -0
- package/dist/session/provider-cli/provider-output-state.js +6 -0
- package/dist/session/provider-cli/provider-user-config-isolation.d.ts +69 -0
- package/dist/session/provider-cli/provider-user-config-isolation.js +164 -0
- package/dist/session/qa-sidecar-validation.d.ts +6 -0
- package/dist/session/qa-sidecar-validation.js +28 -0
- package/dist/session/sandbox-host-capacity-gate.d.ts +51 -0
- package/dist/session/sandbox-host-capacity-gate.js +279 -0
- package/dist/session/session-host-project.d.ts +22 -0
- package/dist/session/session-host-project.js +98 -0
- package/dist/session/session-redaction.js +31 -181
- package/dist/session/session.base.d.ts +9 -1
- package/dist/session/session.parse-helpers.d.ts +10 -0
- package/dist/session/session.parse-helpers.js +84 -0
- package/dist/session/session.runtime-refresh.d.ts +46 -0
- package/dist/session/session.runtime-refresh.js +116 -0
- package/dist/session/session.service.d.ts +16 -2
- package/dist/session/session.service.js +208 -155
- package/dist/session/session.types.d.ts +8 -0
- package/dist/session/session.types.js +13 -83
- package/dist/session/session.types.pr-review.d.ts +48 -0
- package/dist/session/session.types.pr-review.js +51 -0
- package/dist/session/sidecar-json-shape.d.ts +31 -0
- package/dist/session/sidecar-json-shape.js +217 -0
- package/dist/session/workspace-runtime-fingerprint.d.ts +32 -0
- package/dist/session/workspace-runtime-fingerprint.js +138 -0
- package/dist/shared/fs/file-identity.d.ts +10 -0
- package/dist/shared/fs/file-identity.js +15 -0
- package/dist/shared/fs/replace-file.d.ts +7 -0
- package/dist/shared/fs/replace-file.js +33 -0
- package/dist/shared/process/host-process-recovery.d.ts +14 -3
- package/dist/shared/process/host-process-recovery.js +23 -3
- package/dist/shared/process/host-process-supervisor.d.ts +14 -1
- package/dist/shared/process/host-process-supervisor.js +67 -15
- 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 +67 -0
- package/dist/shared/process/process.js +213 -11
- 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 +2 -0
- package/dist/shared/provider-capabilities.js +23 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worktree/artifact-injector.js +24 -0
- package/dist/worktree/dependency-warmer.d.ts +25 -0
- package/dist/worktree/dependency-warmer.js +46 -10
- package/dist/worktree/orphan-relink.d.ts +19 -0
- package/dist/worktree/orphan-relink.js +106 -0
- package/dist/worktree/wip-git.d.ts +58 -0
- package/dist/worktree/wip-git.js +182 -0
- package/dist/worktree/wip-refs.d.ts +85 -0
- package/dist/worktree/wip-refs.js +169 -0
- package/dist/worktree/wip-restore.d.ts +51 -0
- package/dist/worktree/wip-restore.js +324 -0
- package/dist/worktree/wip-snapshot.d.ts +53 -0
- package/dist/worktree/wip-snapshot.js +270 -0
- package/dist/worktree/worktree-inputs.d.ts +8 -0
- package/dist/worktree/worktree-inputs.js +134 -0
- package/dist/worktree/worktree-origin-sync.d.ts +35 -0
- package/dist/worktree/worktree-origin-sync.js +128 -0
- package/dist/worktree/worktree-wip-events.d.ts +20 -0
- package/dist/worktree/worktree-wip-events.js +148 -0
- package/dist/worktree/worktree-wip.d.ts +57 -0
- package/dist/worktree/worktree-wip.js +200 -0
- package/dist/worktree/worktree.base.d.ts +7 -1
- package/dist/worktree/worktree.service.d.ts +58 -5
- package/dist/worktree/worktree.service.js +237 -161
- package/dist/worktree/worktree.types.d.ts +54 -0
- package/package.json +2 -2
- package/runtime/windows-listener-owner.ps1 +12 -1
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { normalizedString, optionalString, requireArray, requireArrayRecord, requireEvidenceRecord, requireKnownStringRecord, requireNonEmptyStringArrayRecord, requireNonEmptyStringRecord, requireObject, requiredRecord } from "./phase-completion.helpers.js";
|
|
2
|
+
const prReviewVerdicts = new Set(["changes_recommended", "needs_closer_look", "approval_recommended"]);
|
|
3
|
+
const prReviewEfforts = new Set(["lite", "standard", "deep"]);
|
|
4
|
+
const prReviewSeverities = new Set(["high", "medium", "low"]);
|
|
5
|
+
const prReviewCategories = new Set(["correctness", "security", "contract", "tests", "data", "docs"]);
|
|
6
|
+
const prReviewThreadStatuses = new Set(["resolved_since_last_review", "still_open", "reintroduced"]);
|
|
7
|
+
const prReviewShaPattern = /^[0-9a-f]{7,64}$/iu;
|
|
8
|
+
/** Per-finding limits; Forge's API applies the same ones (PrReviewArtifactValidator.MaximumFindingTextCharacters). */
|
|
9
|
+
export const prReviewMaximumFindingTextCharacters = 8 * 1024;
|
|
10
|
+
/**
|
|
11
|
+
* Shape and consistency rules for `forge.complete_pr_review`. Anything that needs the
|
|
12
|
+
* repository (the worktree head, the diff lines) is checked separately, after this passes.
|
|
13
|
+
*
|
|
14
|
+
* `stale_head` and `blocked` are terminal outcomes, not reviews: they need only enough
|
|
15
|
+
* evidence to explain themselves. A `reviewed` payload is held to the skill's full contract.
|
|
16
|
+
*/
|
|
17
|
+
export function validatePrReviewPayloadShape(payload, status, context = undefined) {
|
|
18
|
+
if (status === "blocked") {
|
|
19
|
+
validateBlockedPrReview(payload);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const headSha = requirePrReviewHeadSha(payload);
|
|
23
|
+
const expectedHead = context?.headSha?.trim().toLowerCase();
|
|
24
|
+
if (status === "stale_head") {
|
|
25
|
+
if (expectedHead && headSha.toLowerCase() === expectedHead) {
|
|
26
|
+
throw new Error(`head_sha ${headSha} is the dispatched head, so the worktree is not stale. Review that commit and complete with status "reviewed", or set head_sha to the different commit you found.`);
|
|
27
|
+
}
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (expectedHead && headSha.toLowerCase() !== expectedHead) {
|
|
31
|
+
throw new Error(`head_sha ${headSha} is not the head Forge dispatched (${context.headSha}). A review is bound to the dispatched head: review that commit, or complete with status "stale_head" and head_sha set to the commit you found if the worktree is on a different one.`);
|
|
32
|
+
}
|
|
33
|
+
validateReviewedPrReviewHeader(payload);
|
|
34
|
+
validatePrReviewChanges(payload);
|
|
35
|
+
validatePrReviewRecords(payload, "files", ["path", "description"]);
|
|
36
|
+
validatePrReviewRecords(payload, "skipped_files", ["path", "reason"], false);
|
|
37
|
+
validatePrReviewRecords(payload, "tests_checked", ["test", "assertion", "produced_at"], false);
|
|
38
|
+
requireArray(payload, "findings");
|
|
39
|
+
const findings = payload.findings;
|
|
40
|
+
for (const [index, finding] of findings.entries()) {
|
|
41
|
+
validatePrReviewFinding(finding, `findings[${index}]`);
|
|
42
|
+
}
|
|
43
|
+
const openThreads = validatePrReviewPriorThreads(payload, context);
|
|
44
|
+
validatePrReviewVerdictConsistency(payload, findings.length, openThreads);
|
|
45
|
+
validatePrReviewSecurity(payload, findings);
|
|
46
|
+
validatePrReviewTestsChecked(payload, findings);
|
|
47
|
+
}
|
|
48
|
+
function validateBlockedPrReview(payload) {
|
|
49
|
+
const hasReason = ["reason", "summary", "verdict_reason"].some((key) => optionalString(payload, key))
|
|
50
|
+
|| (Array.isArray(payload.blockers) && payload.blockers.length > 0);
|
|
51
|
+
if (!hasReason) {
|
|
52
|
+
throw new Error("A blocked pr_review needs a reason: set reason (or summary) to say why the diff could not be read.");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function requirePrReviewHeadSha(payload) {
|
|
56
|
+
requireNonEmptyStringRecord(payload, "head_sha", "");
|
|
57
|
+
const headSha = optionalString(payload, "head_sha").trim();
|
|
58
|
+
if (!prReviewShaPattern.test(headSha)) {
|
|
59
|
+
throw new Error("head_sha must be a commit sha (7-64 hex characters); copy it from `git rev-parse HEAD`.");
|
|
60
|
+
}
|
|
61
|
+
return headSha;
|
|
62
|
+
}
|
|
63
|
+
function validateReviewedPrReviewHeader(payload) {
|
|
64
|
+
requireNonEmptyStringRecord(payload, "base_sha", "");
|
|
65
|
+
if (!prReviewShaPattern.test(optionalString(payload, "base_sha").trim())) {
|
|
66
|
+
throw new Error("base_sha must be a commit sha (7-64 hex characters).");
|
|
67
|
+
}
|
|
68
|
+
requireKnownStringRecord(payload, "review_effort", prReviewEfforts);
|
|
69
|
+
requireKnownStringRecord(payload, "verdict", prReviewVerdicts);
|
|
70
|
+
requireNonEmptyStringRecord(payload, "verdict_reason", "");
|
|
71
|
+
requireNonEmptyStringRecord(payload, "summary", "");
|
|
72
|
+
}
|
|
73
|
+
function validatePrReviewChanges(payload) {
|
|
74
|
+
requireArray(payload, "changes");
|
|
75
|
+
for (const [index, change] of payload.changes.entries()) {
|
|
76
|
+
if (typeof change !== "string" || change.trim().length === 0) {
|
|
77
|
+
throw new Error(`changes[${index}] must be a non-empty string.`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** Validates prior_threads and returns how many are still_open or reintroduced. */
|
|
82
|
+
function validatePrReviewPriorThreads(payload, context) {
|
|
83
|
+
const priorThreads = payload.prior_threads === undefined || payload.prior_threads === null ? [] : payload.prior_threads;
|
|
84
|
+
if (!Array.isArray(priorThreads)) {
|
|
85
|
+
throw new Error("prior_threads must be an array.");
|
|
86
|
+
}
|
|
87
|
+
const knownThreadIds = context?.threadIds && context.threadIds.length > 0 ? new Set(context.threadIds) : null;
|
|
88
|
+
const seenThreads = new Set();
|
|
89
|
+
let openThreads = 0;
|
|
90
|
+
for (const [index, thread] of priorThreads.entries()) {
|
|
91
|
+
requireEvidenceRecord(thread, `prior_threads[${index}]`);
|
|
92
|
+
const record = thread;
|
|
93
|
+
requireNonEmptyStringRecord(record, "thread_id", `prior_threads[${index}].`);
|
|
94
|
+
requireKnownStringRecord(record, "status", prReviewThreadStatuses, `prior_threads[${index}].`);
|
|
95
|
+
const threadId = optionalString(record, "thread_id");
|
|
96
|
+
if (knownThreadIds && !knownThreadIds.has(threadId)) {
|
|
97
|
+
throw new Error(`prior_threads[${index}].thread_id ${threadId} is not a thread in the dispatch. Use only thread ids from the dispatch's prior_threads (${[...knownThreadIds].slice(0, 10).join(", ")}${knownThreadIds.size > 10 ? ", ..." : ""}) and drop the entry if the thread is not one of them.`);
|
|
98
|
+
}
|
|
99
|
+
if (seenThreads.has(threadId)) {
|
|
100
|
+
throw new Error(`prior_threads[${index}] repeats thread ${threadId}; report each thread once.`);
|
|
101
|
+
}
|
|
102
|
+
seenThreads.add(threadId);
|
|
103
|
+
const threadStatus = normalizedString(optionalString(record, "status"));
|
|
104
|
+
if (threadStatus === "still_open" || threadStatus === "reintroduced")
|
|
105
|
+
openThreads += 1;
|
|
106
|
+
}
|
|
107
|
+
return openThreads;
|
|
108
|
+
}
|
|
109
|
+
function validatePrReviewVerdictConsistency(payload, findingCount, openThreads) {
|
|
110
|
+
const openIssues = findingCount + openThreads;
|
|
111
|
+
const verdict = normalizedString(optionalString(payload, "verdict"));
|
|
112
|
+
if (openIssues > 0 && verdict !== "changes_recommended") {
|
|
113
|
+
throw new Error(`verdict ${verdict} contradicts ${openIssues} open issue(s) (${findingCount} new finding(s), ${openThreads} still_open or reintroduced prior thread(s)). Set verdict to changes_recommended, or remove findings you cannot prove.`);
|
|
114
|
+
}
|
|
115
|
+
if (openIssues === 0 && verdict === "changes_recommended") {
|
|
116
|
+
throw new Error("verdict changes_recommended needs at least one open issue: a finding, or a prior thread that is still_open or reintroduced. Use approval_recommended, or needs_closer_look when you could not verify a risky surface.");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function hasFindingCategory(findings, category) {
|
|
120
|
+
return findings.some((finding) => normalizedString(finding.category) === category);
|
|
121
|
+
}
|
|
122
|
+
function validatePrReviewSecurity(payload, findings) {
|
|
123
|
+
requireObject(payload, "security_review");
|
|
124
|
+
const security = requiredRecord(payload, "security_review");
|
|
125
|
+
requireKnownStringRecord(security, "status", new Set(["findings", "no_findings"]), "security_review.");
|
|
126
|
+
requireNonEmptyStringArrayRecord(security, "checked", "security_review.");
|
|
127
|
+
requireNonEmptyStringRecord(security, "notes", "security_review.");
|
|
128
|
+
requireArrayRecord(security, "keys_checked", "security_review.");
|
|
129
|
+
const hasSecurityFinding = hasFindingCategory(findings, "security");
|
|
130
|
+
const securityStatus = normalizedString(optionalString(security, "status"));
|
|
131
|
+
if (hasSecurityFinding && securityStatus !== "findings") {
|
|
132
|
+
throw new Error('security_review.status must be "findings" when any finding has category "security".');
|
|
133
|
+
}
|
|
134
|
+
if (!hasSecurityFinding && securityStatus === "findings") {
|
|
135
|
+
throw new Error('security_review.status is "findings" but no finding has category "security". Add the finding or set status to "no_findings".');
|
|
136
|
+
}
|
|
137
|
+
for (const [index, key] of security.keys_checked.entries()) {
|
|
138
|
+
requireEvidenceRecord(key, `security_review.keys_checked[${index}]`);
|
|
139
|
+
const record = key;
|
|
140
|
+
requireNonEmptyStringRecord(record, "key", `security_review.keys_checked[${index}].`);
|
|
141
|
+
if (typeof record.per_user_data !== "boolean" || typeof record.includes_user !== "boolean") {
|
|
142
|
+
throw new Error(`security_review.keys_checked[${index}] needs boolean per_user_data and includes_user.`);
|
|
143
|
+
}
|
|
144
|
+
if (record.per_user_data === true && record.includes_user === false && !hasSecurityFinding) {
|
|
145
|
+
throw new Error(`security_review.keys_checked[${index}] holds per-user data under a key without the user, which must have a matching security finding. Add the finding.`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function validatePrReviewTestsChecked(payload, findings) {
|
|
150
|
+
const hasTestsFinding = hasFindingCategory(findings, "tests");
|
|
151
|
+
for (const [index, entry] of (payload.tests_checked ?? []).entries()) {
|
|
152
|
+
const produced = normalizedString(optionalString(entry, "produced_at")).replace(/_/gu, " ");
|
|
153
|
+
if (produced === "not produced" && !hasTestsFinding) {
|
|
154
|
+
throw new Error(`tests_checked[${index}] was not produced by production code, so the test cannot pass; it must have a matching finding with category "tests". Add the finding.`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function validatePrReviewRecords(payload, key, fields, required = true) {
|
|
159
|
+
if ((payload[key] === undefined || payload[key] === null) && !required)
|
|
160
|
+
return;
|
|
161
|
+
requireArray(payload, key);
|
|
162
|
+
for (const [index, entry] of payload[key].entries()) {
|
|
163
|
+
requireEvidenceRecord(entry, `${key}[${index}]`);
|
|
164
|
+
for (const field of fields) {
|
|
165
|
+
requireNonEmptyStringRecord(entry, field, `${key}[${index}].`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function validatePrReviewFinding(finding, label) {
|
|
170
|
+
requireEvidenceRecord(finding, label);
|
|
171
|
+
const record = finding;
|
|
172
|
+
for (const key of ["path", "title", "body"]) {
|
|
173
|
+
requireNonEmptyStringRecord(record, key, `${label}.`);
|
|
174
|
+
}
|
|
175
|
+
if (!Number.isInteger(record.line) || record.line < 1) {
|
|
176
|
+
throw new Error(`${label}.line must be a positive integer line number on the new side of the diff.`);
|
|
177
|
+
}
|
|
178
|
+
if (record.start_line !== undefined && record.start_line !== null) {
|
|
179
|
+
if (!Number.isInteger(record.start_line) || record.start_line < 1 || record.start_line >= record.line) {
|
|
180
|
+
throw new Error(`${label}.start_line must be null (single-line comment) or a positive integer strictly less than line.`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (record.side !== "RIGHT") {
|
|
184
|
+
throw new Error(`${label}.side must be "RIGHT": inline comments anchor on the new side of the diff. Re-anchor the comment at the changed line on the new side, and name any unchanged location in the body as path:line.`);
|
|
185
|
+
}
|
|
186
|
+
requireKnownStringRecord(record, "severity", prReviewSeverities, `${label}.`);
|
|
187
|
+
requireKnownStringRecord(record, "category", prReviewCategories, `${label}.`);
|
|
188
|
+
if (record.also_at !== undefined && record.also_at !== null) {
|
|
189
|
+
if (!Array.isArray(record.also_at))
|
|
190
|
+
throw new Error(`${label}.also_at must be an array.`);
|
|
191
|
+
for (const [index, place] of record.also_at.entries()) {
|
|
192
|
+
requireEvidenceRecord(place, `${label}.also_at[${index}]`);
|
|
193
|
+
requireNonEmptyStringRecord(place, "path", `${label}.also_at[${index}].`);
|
|
194
|
+
if (!Number.isInteger(place.line) || place.line < 1) {
|
|
195
|
+
throw new Error(`${label}.also_at[${index}].line must be a positive integer.`);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (record.suggestion !== undefined && record.suggestion !== null && typeof record.suggestion !== "string") {
|
|
200
|
+
throw new Error(`${label}.suggestion must be null or a string.`);
|
|
201
|
+
}
|
|
202
|
+
requireFindingTextWithinCap(record, label);
|
|
203
|
+
}
|
|
204
|
+
/** Each finding's body and suggestion becomes one inline comment, which the review body's cap does not cover. */
|
|
205
|
+
function requireFindingTextWithinCap(record, label) {
|
|
206
|
+
for (const key of ["body", "suggestion"]) {
|
|
207
|
+
const value = record[key];
|
|
208
|
+
if (typeof value === "string" && value.length > prReviewMaximumFindingTextCharacters) {
|
|
209
|
+
throw new Error(`${label}.${key} is ${value.length} characters; an inline comment's ${key} may be at most ${prReviewMaximumFindingTextCharacters}. Shorten it to the input, the path and the wrong result.`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ProcessRunner } from "../shared/process/process.js";
|
|
2
|
+
import type { PrReviewCompletionContext } from "./phase-completion.js";
|
|
3
|
+
/** Inclusive new-side line range that sits inside one hunk of the pull request diff. */
|
|
4
|
+
export interface DiffLineRange {
|
|
5
|
+
readonly start: number;
|
|
6
|
+
readonly end: number;
|
|
7
|
+
}
|
|
8
|
+
/** New-side (RIGHT) lines GitHub accepts inline comments on, per changed path. */
|
|
9
|
+
export type NewSideDiffLines = ReadonlyMap<string, readonly DiffLineRange[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Parses `git diff --unified=3` output into the new-side line ranges of every hunk.
|
|
12
|
+
* Added and context lines both count: GitHub lets a review comment land on either.
|
|
13
|
+
* Hunk header counts drive the walk, so a content line that starts with `+++` is not mistaken for a file header.
|
|
14
|
+
*/
|
|
15
|
+
export declare function parseNewSideDiffLines(diff: string): NewSideDiffLines;
|
|
16
|
+
export declare function isLineInRanges(ranges: readonly DiffLineRange[] | undefined, line: number): boolean;
|
|
17
|
+
/** Messages for every finding whose anchor GitHub would reject, each with how to re-anchor. */
|
|
18
|
+
export declare function offDiffAnchorProblems(findings: readonly Record<string, unknown>[], diffLines: NewSideDiffLines, range: string): string[];
|
|
19
|
+
export declare function normalizeFindingPath(value: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Checks what a `reviewed` payload claims against the worktree: the review must be bound to the
|
|
22
|
+
* commit that is checked out (and to the dispatched head when Forge supplied one), `base_sha`
|
|
23
|
+
* must be a real commit, and every inline comment must land on a line of the PR diff.
|
|
24
|
+
* Throws an error that tells the agent how to repair the payload.
|
|
25
|
+
*/
|
|
26
|
+
export declare function assertPrReviewMatchesRepository(worktreePath: string, payload: Record<string, unknown>, context: PrReviewCompletionContext | undefined, processRunner?: ProcessRunner): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Re-checks the recorded pr-review.result.json as if it had just been submitted. The completion tool
|
|
29
|
+
* validates what it writes, but the session can also write that file itself (the post-run worktree
|
|
30
|
+
* check skips Forge's artifact directory), so the file Forge hands on must pass the same shape,
|
|
31
|
+
* head, base and diff-anchor rules, name this work item and phase, and carry the content hash the tool
|
|
32
|
+
* computes. Returns the reason it is rejected, or null.
|
|
33
|
+
*/
|
|
34
|
+
export declare function recordedPrReviewArtifactProblem(worktreePath: string, workItemId: string, verdictJson: string, context: PrReviewCompletionContext | undefined, processRunner?: ProcessRunner): Promise<string | null>;
|
|
35
|
+
/** Renders the pr-review.report.md that sits next to pr-review.result.json. */
|
|
36
|
+
export declare function prReviewReportMarkdown(artifact: Record<string, unknown>, contentHash: string): string;
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { NodeProcessRunner } from "../shared/process/process.js";
|
|
3
|
+
import { normalizedString, optionalString, sha256, stableStringify } from "./phase-completion.helpers.js";
|
|
4
|
+
import { validatePrReviewPayloadShape } from "./phase-completion.pr-review-validation.js";
|
|
5
|
+
const maxListedRanges = 8;
|
|
6
|
+
const maxListedFiles = 20;
|
|
7
|
+
/**
|
|
8
|
+
* Parses `git diff --unified=3` output into the new-side line ranges of every hunk.
|
|
9
|
+
* Added and context lines both count: GitHub lets a review comment land on either.
|
|
10
|
+
* Hunk header counts drive the walk, so a content line that starts with `+++` is not mistaken for a file header.
|
|
11
|
+
*/
|
|
12
|
+
export function parseNewSideDiffLines(diff) {
|
|
13
|
+
const files = new Map();
|
|
14
|
+
const lines = diff.split("\n");
|
|
15
|
+
let currentFile = null;
|
|
16
|
+
let index = 0;
|
|
17
|
+
while (index < lines.length) {
|
|
18
|
+
const line = lines[index];
|
|
19
|
+
if (line.startsWith("diff --git ")) {
|
|
20
|
+
currentFile = null;
|
|
21
|
+
index += 1;
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (line.startsWith("+++ ")) {
|
|
25
|
+
const target = line.slice(4).replace(/\t.*$/u, "").replace(/\r$/u, "");
|
|
26
|
+
currentFile = target === "/dev/null" ? null : target.replace(/^b\//u, "");
|
|
27
|
+
index += 1;
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
const header = /^@@ -\d+(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/u.exec(line);
|
|
31
|
+
if (!header || currentFile === null) {
|
|
32
|
+
index += 1;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
let oldRemaining = header[1] === undefined ? 1 : Number(header[1]);
|
|
36
|
+
let newRemaining = header[3] === undefined ? 1 : Number(header[3]);
|
|
37
|
+
let newLine = Number(header[2]);
|
|
38
|
+
const hunkStart = newLine;
|
|
39
|
+
index += 1;
|
|
40
|
+
while (index < lines.length && (oldRemaining > 0 || newRemaining > 0)) {
|
|
41
|
+
const body = lines[index];
|
|
42
|
+
const marker = body[0];
|
|
43
|
+
if (marker === "\\") {
|
|
44
|
+
index += 1;
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (marker === "+") {
|
|
48
|
+
newRemaining -= 1;
|
|
49
|
+
newLine += 1;
|
|
50
|
+
}
|
|
51
|
+
else if (marker === "-") {
|
|
52
|
+
oldRemaining -= 1;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
// A context line, or a blank one whose leading space was stripped.
|
|
56
|
+
oldRemaining -= 1;
|
|
57
|
+
newRemaining -= 1;
|
|
58
|
+
newLine += 1;
|
|
59
|
+
}
|
|
60
|
+
index += 1;
|
|
61
|
+
}
|
|
62
|
+
if (newLine > hunkStart) {
|
|
63
|
+
const ranges = files.get(currentFile) ?? [];
|
|
64
|
+
ranges.push({ start: hunkStart, end: newLine - 1 });
|
|
65
|
+
files.set(currentFile, ranges);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return files;
|
|
69
|
+
}
|
|
70
|
+
export function isLineInRanges(ranges, line) {
|
|
71
|
+
return Boolean(ranges?.some((range) => line >= range.start && line <= range.end));
|
|
72
|
+
}
|
|
73
|
+
/** Messages for every finding whose anchor GitHub would reject, each with how to re-anchor. */
|
|
74
|
+
export function offDiffAnchorProblems(findings, diffLines, range) {
|
|
75
|
+
const problems = [];
|
|
76
|
+
for (const [index, finding] of findings.entries()) {
|
|
77
|
+
const findingPath = normalizeFindingPath(optionalString(finding, "path") ?? "");
|
|
78
|
+
const line = finding.line;
|
|
79
|
+
const startLine = typeof finding.start_line === "number" ? finding.start_line : null;
|
|
80
|
+
const ranges = diffLines.get(findingPath);
|
|
81
|
+
const label = `findings[${index}] (${findingPath}:${line})`;
|
|
82
|
+
if (!ranges || ranges.length === 0) {
|
|
83
|
+
const changed = [...diffLines.keys()];
|
|
84
|
+
const listed = changed.slice(0, maxListedFiles).join(", ");
|
|
85
|
+
problems.push(`${label}: ${findingPath} has no changed lines in ${range}. Re-anchor at the changed line that introduces the problem, and name the unchanged location in the body as path:line. Files in the diff: ${listed || "none"}${changed.length > maxListedFiles ? `, and ${changed.length - maxListedFiles} more` : ""}.`);
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const containing = ranges.find((candidate) => line >= candidate.start && line <= candidate.end);
|
|
89
|
+
if (!containing) {
|
|
90
|
+
problems.push(`${label}: line ${line} is not on the new side of the diff. Re-anchor at a changed line (side RIGHT); ${describeRanges(findingPath, ranges)}`);
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (startLine !== null && (startLine < containing.start || startLine > containing.end)) {
|
|
94
|
+
problems.push(`${label}: start_line ${startLine} is outside the hunk that contains line ${line} (${containing.start}-${containing.end}). A multi-line comment must stay inside one hunk; move start_line into ${containing.start}-${containing.end} or set it to null.`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return problems;
|
|
98
|
+
}
|
|
99
|
+
function describeRanges(filePath, ranges) {
|
|
100
|
+
const listed = ranges.slice(0, maxListedRanges).map((range) => range.start === range.end ? `${range.start}` : `${range.start}-${range.end}`);
|
|
101
|
+
return `lines you can anchor to in ${filePath}: ${listed.join(", ")}${ranges.length > maxListedRanges ? `, and ${ranges.length - maxListedRanges} more ranges` : ""}.`;
|
|
102
|
+
}
|
|
103
|
+
export function normalizeFindingPath(value) {
|
|
104
|
+
return value.trim().replaceAll("\\", "/").replace(/^\.\//u, "");
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Checks what a `reviewed` payload claims against the worktree: the review must be bound to the
|
|
108
|
+
* commit that is checked out (and to the dispatched head when Forge supplied one), `base_sha`
|
|
109
|
+
* must be a real commit, and every inline comment must land on a line of the PR diff.
|
|
110
|
+
* Throws an error that tells the agent how to repair the payload.
|
|
111
|
+
*/
|
|
112
|
+
export async function assertPrReviewMatchesRepository(worktreePath, payload, context, processRunner = new NodeProcessRunner()) {
|
|
113
|
+
const git = gitRunner(worktreePath, processRunner);
|
|
114
|
+
const headSha = (optionalString(payload, "head_sha") ?? "").trim().toLowerCase();
|
|
115
|
+
const baseSha = (optionalString(payload, "base_sha") ?? "").trim().toLowerCase();
|
|
116
|
+
const worktreeHead = await git(["rev-parse", "--verify", "--quiet", "HEAD^{commit}"]);
|
|
117
|
+
const checkedOut = worktreeHead.ok ? worktreeHead.out.trim().toLowerCase() : null;
|
|
118
|
+
assertHeadBinding(headSha, checkedOut, context);
|
|
119
|
+
if (checkedOut === null) {
|
|
120
|
+
// Nothing to diff against without a checkout; the dispatched-head comparison above is all that can be proven.
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const resolvedBase = await resolveReviewBase(git, baseSha, context);
|
|
124
|
+
const findings = (payload.findings ?? []);
|
|
125
|
+
if (findings.length === 0)
|
|
126
|
+
return;
|
|
127
|
+
await assertFindingsOnDiff(git, findings, resolvedBase, checkedOut);
|
|
128
|
+
}
|
|
129
|
+
function gitRunner(worktreePath, processRunner) {
|
|
130
|
+
return async (args) => {
|
|
131
|
+
try {
|
|
132
|
+
const result = await processRunner.run({ command: "git", args: ["-c", "core.quotepath=off", ...args], cwd: path.resolve(worktreePath), rawOutput: true });
|
|
133
|
+
return { ok: result.exitCode === 0, out: result.stdout, error: result.stderr.trim() };
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
return { ok: false, out: "", error: error instanceof Error ? error.message : String(error) };
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function assertHeadBinding(headSha, checkedOut, context) {
|
|
141
|
+
if (checkedOut === null && !context?.headSha) {
|
|
142
|
+
throw new Error("Forge could not read HEAD in the review worktree, so it cannot confirm which commit you reviewed. Complete with status \"blocked\" and a reason if the repository is unreadable.");
|
|
143
|
+
}
|
|
144
|
+
if (checkedOut === null) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (!sameCommit(headSha, checkedOut)) {
|
|
148
|
+
throw new Error(`head_sha ${headSha} is not the commit checked out in the review worktree (${checkedOut}). A review is bound to the head you read: set head_sha to the output of \`git rev-parse HEAD\` after reviewing that commit. If the worktree is not at the dispatched head, complete with status "stale_head" and head_sha set to ${checkedOut} instead of reviewing it.`);
|
|
149
|
+
}
|
|
150
|
+
if (context?.headSha && !sameCommit(context.headSha.trim().toLowerCase(), checkedOut)) {
|
|
151
|
+
throw new Error(`The review worktree is at ${checkedOut}, not the dispatched head ${context.headSha}. Complete with status "stale_head" and head_sha ${checkedOut}; a review of the wrong commit is worse than none.`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
async function resolveReviewBase(git, baseSha, context) {
|
|
155
|
+
const base = await git(["rev-parse", "--verify", "--quiet", `${baseSha}^{commit}`]);
|
|
156
|
+
if (!base.ok) {
|
|
157
|
+
throw new Error(`base_sha ${baseSha} is not a commit in the review worktree${base.error ? ` (${base.error})` : ""}. Use the dispatch's base_sha exactly, or complete with status "blocked" and a reason if the base commit is missing from the worktree.`);
|
|
158
|
+
}
|
|
159
|
+
const resolvedBase = base.out.trim().toLowerCase();
|
|
160
|
+
if (context?.baseSha && !sameCommit(context.baseSha.trim().toLowerCase(), resolvedBase)) {
|
|
161
|
+
throw new Error(`base_sha ${baseSha} is not the dispatched base ${context.baseSha}. Diff and review against the dispatched base.`);
|
|
162
|
+
}
|
|
163
|
+
return resolvedBase;
|
|
164
|
+
}
|
|
165
|
+
async function assertFindingsOnDiff(git, findings, resolvedBase, checkedOut) {
|
|
166
|
+
const diff = await git(["diff", "--no-color", "--no-ext-diff", "--no-renames", "--unified=3", "--src-prefix=a/", "--dst-prefix=b/", `${resolvedBase}...${checkedOut}`]);
|
|
167
|
+
if (!diff.ok) {
|
|
168
|
+
throw new Error(`Forge could not read the diff ${resolvedBase}...${checkedOut} to check your inline comments${diff.error ? ` (${diff.error})` : ""}. Complete with status "blocked" and a reason if the diff cannot be read.`);
|
|
169
|
+
}
|
|
170
|
+
const problems = offDiffAnchorProblems(findings, parseNewSideDiffLines(diff.out), `${resolvedBase.slice(0, 12)}...${checkedOut.slice(0, 12)}`);
|
|
171
|
+
if (problems.length > 0) {
|
|
172
|
+
throw new Error(`Inline comments must land on a line of the pull request diff, on the new side (side RIGHT), or GitHub rejects them. Re-anchor these and call forge.complete_pr_review again:\n- ${problems.join("\n- ")}`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function sameCommit(claimed, actual) {
|
|
176
|
+
return claimed === actual;
|
|
177
|
+
}
|
|
178
|
+
const recordedPrReviewStatuses = new Set(["reviewed", "stale_head", "blocked"]);
|
|
179
|
+
/**
|
|
180
|
+
* Re-checks the recorded pr-review.result.json as if it had just been submitted. The completion tool
|
|
181
|
+
* validates what it writes, but the session can also write that file itself (the post-run worktree
|
|
182
|
+
* check skips Forge's artifact directory), so the file Forge hands on must pass the same shape,
|
|
183
|
+
* head, base and diff-anchor rules, name this work item and phase, and carry the content hash the tool
|
|
184
|
+
* computes. Returns the reason it is rejected, or null.
|
|
185
|
+
*/
|
|
186
|
+
export async function recordedPrReviewArtifactProblem(worktreePath, workItemId, verdictJson, context, processRunner = new NodeProcessRunner()) {
|
|
187
|
+
let payload;
|
|
188
|
+
try {
|
|
189
|
+
const parsed = JSON.parse(verdictJson);
|
|
190
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
191
|
+
return "the recorded review is not a JSON object";
|
|
192
|
+
payload = parsed;
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
return "the recorded review is not valid JSON";
|
|
196
|
+
}
|
|
197
|
+
const status = optionalString(payload, "status")?.trim() ?? "";
|
|
198
|
+
if (!recordedPrReviewStatuses.has(status))
|
|
199
|
+
return `the recorded review has status '${status}', not reviewed, stale_head or blocked`;
|
|
200
|
+
if (optionalString(payload, "phase") !== "pr_review")
|
|
201
|
+
return "the recorded review is not a pr_review artifact";
|
|
202
|
+
if (optionalString(payload, "work_item_id") !== workItemId)
|
|
203
|
+
return `the recorded review names work item '${optionalString(payload, "work_item_id") ?? ""}', not ${workItemId}`;
|
|
204
|
+
const { content_hash: contentHash, ...withoutHash } = payload;
|
|
205
|
+
if (typeof contentHash !== "string" || contentHash !== sha256(stableStringify(withoutHash))) {
|
|
206
|
+
return "the recorded review's content_hash does not match its content, so forge.complete_pr_review did not write it";
|
|
207
|
+
}
|
|
208
|
+
try {
|
|
209
|
+
validatePrReviewPayloadShape(payload, status, context);
|
|
210
|
+
if (status === "reviewed") {
|
|
211
|
+
await assertPrReviewMatchesRepository(worktreePath, payload, context, processRunner);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
return error instanceof Error ? error.message : String(error);
|
|
216
|
+
}
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
/** Renders the pr-review.report.md that sits next to pr-review.result.json. */
|
|
220
|
+
export function prReviewReportMarkdown(artifact, contentHash) {
|
|
221
|
+
const status = normalizedString(optionalString(artifact, "status"));
|
|
222
|
+
const lines = ["# Forge PR review", ""];
|
|
223
|
+
lines.push(`Status: ${status}`);
|
|
224
|
+
const head = optionalString(artifact, "head_sha");
|
|
225
|
+
if (head)
|
|
226
|
+
lines.push(`Head: ${head}`);
|
|
227
|
+
const base = optionalString(artifact, "base_sha");
|
|
228
|
+
if (base)
|
|
229
|
+
lines.push(`Base: ${base}`);
|
|
230
|
+
lines.push(`Produced by: ${optionalString(artifact, "produced_by") ?? "forge-completion-tool"}`);
|
|
231
|
+
lines.push(`Content hash: ${contentHash}`, "");
|
|
232
|
+
if (status !== "reviewed") {
|
|
233
|
+
const reason = optionalString(artifact, "reason") ?? optionalString(artifact, "summary") ?? optionalString(artifact, "verdict_reason");
|
|
234
|
+
lines.push(status === "stale_head" ? "## Stale head" : "## Blocked", "", reason ?? "No reason recorded.", "");
|
|
235
|
+
return `${lines.join("\n")}\n`;
|
|
236
|
+
}
|
|
237
|
+
appendReviewedOverview(lines, artifact);
|
|
238
|
+
appendFindingsSection(lines, recordList(artifact.findings));
|
|
239
|
+
appendPriorThreadsSection(lines, recordList(artifact.prior_threads));
|
|
240
|
+
appendSecuritySection(lines, (artifact.security_review ?? {}));
|
|
241
|
+
const skipped = recordList(artifact.skipped_files);
|
|
242
|
+
if (skipped.length > 0) {
|
|
243
|
+
lines.push("## Skipped files", "");
|
|
244
|
+
lines.push(...skipped.map((file) => `- ${optionalString(file, "path")}: ${optionalString(file, "reason")}`), "");
|
|
245
|
+
}
|
|
246
|
+
return `${lines.join("\n").replace(/\n{3,}/gu, "\n\n")}\n`;
|
|
247
|
+
}
|
|
248
|
+
function appendReviewedOverview(lines, artifact) {
|
|
249
|
+
lines.push(`Verdict: ${optionalString(artifact, "verdict") ?? "unknown"}${optionalString(artifact, "review_effort") ? ` (${optionalString(artifact, "review_effort")} review)` : ""}`, "");
|
|
250
|
+
lines.push(optionalString(artifact, "verdict_reason") ?? "", "");
|
|
251
|
+
lines.push("## Overview", "", optionalString(artifact, "summary") ?? "", "");
|
|
252
|
+
const changes = stringList(artifact.changes);
|
|
253
|
+
if (changes.length > 0)
|
|
254
|
+
lines.push(...changes.map((change) => `- ${change}`), "");
|
|
255
|
+
const files = recordList(artifact.files);
|
|
256
|
+
if (files.length > 0) {
|
|
257
|
+
lines.push("| File | Description |", "| --- | --- |");
|
|
258
|
+
lines.push(...files.map((file) => `| ${tableCell(optionalString(file, "path"))} | ${tableCell(optionalString(file, "description"))} |`), "");
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
function appendFindingsSection(lines, findings) {
|
|
262
|
+
lines.push(`## Findings (${findings.length})`, "");
|
|
263
|
+
if (findings.length === 0)
|
|
264
|
+
lines.push("No new findings.", "");
|
|
265
|
+
for (const finding of findings) {
|
|
266
|
+
lines.push(`### ${optionalString(finding, "title") ?? "Finding"}`, "");
|
|
267
|
+
lines.push(`${String(finding.severity)} ${String(finding.category)} at \`${optionalString(finding, "path")}:${String(finding.line)}\``, "");
|
|
268
|
+
lines.push(optionalString(finding, "body") ?? "", "");
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
function appendPriorThreadsSection(lines, threads) {
|
|
272
|
+
if (threads.length === 0)
|
|
273
|
+
return;
|
|
274
|
+
lines.push("## Prior threads", "");
|
|
275
|
+
lines.push(...threads.map((thread) => `- ${optionalString(thread, "thread_id")}: ${optionalString(thread, "status")}`), "");
|
|
276
|
+
}
|
|
277
|
+
function appendSecuritySection(lines, security) {
|
|
278
|
+
lines.push("## Security review", "", `Status: ${optionalString(security, "status") ?? "unknown"}`, "");
|
|
279
|
+
const checked = stringList(security.checked);
|
|
280
|
+
if (checked.length > 0)
|
|
281
|
+
lines.push(`Checked: ${checked.join(", ")}`, "");
|
|
282
|
+
lines.push(optionalString(security, "notes") ?? "", "");
|
|
283
|
+
}
|
|
284
|
+
function stringList(value) {
|
|
285
|
+
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string" && entry.trim().length > 0) : [];
|
|
286
|
+
}
|
|
287
|
+
function recordList(value) {
|
|
288
|
+
return Array.isArray(value)
|
|
289
|
+
? value.filter((entry) => Boolean(entry) && typeof entry === "object" && !Array.isArray(entry))
|
|
290
|
+
: [];
|
|
291
|
+
}
|
|
292
|
+
function tableCell(value) {
|
|
293
|
+
return (value ?? "").replace(/\|/gu, "\\|").replace(/\r?\n/gu, " ");
|
|
294
|
+
}
|
|
@@ -7,7 +7,7 @@ export declare function completionPromptForDecomposeCycle(currentGate?: Decompos
|
|
|
7
7
|
export declare function completionPromptForDebugCycle(currentGate?: DebugCompletionPhase): string;
|
|
8
8
|
export declare function nextPhaseAfter(phase: CompletionPhase): DevelopCompletionPhase | null;
|
|
9
9
|
export declare function nextDebugPhaseAfter(phase: DebugCompletionPhase): DebugCompletionPhase | null;
|
|
10
|
-
export declare function completionToolNextInstruction(completedPhase: CompletionPhase, status: string, nextPhase: CompletionPhase | "dev_test_ready" | "qa_ready" | "sign_off_ready" | "provider_checks_ready"): string;
|
|
10
|
+
export declare function completionToolNextInstruction(completedPhase: CompletionPhase, status: string, nextPhase: CompletionPhase | "dev_test_ready" | "qa_ready" | "sign_off_ready" | "provider_checks_ready" | "pr_review_complete"): string;
|
|
11
11
|
export declare function completionToolNextInstructionForDraftGate(completedGate: DraftCompletionGate, status: string, nextGate: DraftCompletionGate | null): string;
|
|
12
12
|
export declare function completionToolNextInstructionForQaGate(completedGate: QaCompletionGate, status: string, nextGate: QaCompletionGate | null): string;
|
|
13
13
|
export declare function completionToolNextInstructionForDecomposeGate(completedGate: DecomposeCompletionGate, status: string, nextGate: DecomposeCompletionGate | null): string;
|
|
@@ -23,6 +23,13 @@ When a task's implementation or validation starts containers or otherwise needs
|
|
|
23
23
|
Dependency entries use canonical \`before\` and \`after\` task ids, for example \`{ "before": "task-1", "after": "task-2" }\`. Forge accepts \`from\`/\`to\` only as aliases and normalizes them before writing artifacts.
|
|
24
24
|
Use \`status: "pass"\` for a valid pending-approval plan, \`needs_revision\` when story/design input must change, or \`blocked\` with a concrete blocker.
|
|
25
25
|
Forge will mirror only the tool-written Architect artifacts; reporting the plan in prose is not enough.`;
|
|
26
|
+
}
|
|
27
|
+
if (phase === "pr_review") {
|
|
28
|
+
return `Forge completion tools are available through the MCP server named \`${toolServerName}\`.
|
|
29
|
+
Review only: do not edit, commit, push, or post to GitHub, and do not write the review artifact by hand. When the review is complete, call \`${toolName}(...)\`${alias ? ` (or \`${alias}\` if your client shows unqualified MCP tool names)` : ""} with the review payload from the pr-review skill, bound to the head you reviewed.
|
|
30
|
+
That tool writes \`${artifactRoot}/${artifactName}\` and \`${phaseFiles[phase].reportFileName}\`. Forge posts the review afterwards; the tool itself publishes nothing.
|
|
31
|
+
Use \`status: "reviewed"\` for a completed review, \`status: "stale_head"\` (with head_sha set to the commit you found) when HEAD differs from the dispatched head, and \`status: "blocked"\` with a reason when the diff cannot be read.
|
|
32
|
+
If the tool rejects the payload, it names the fields to correct: a head_sha that is not the checked-out head, a side other than RIGHT, a line that is not in the diff (re-anchor at a changed line), a verdict that contradicts the open issues, or an unknown prior thread id. Fix them and call again. Ending your turn without an accepted call records no review.`;
|
|
26
33
|
}
|
|
27
34
|
if (phase === "ci_repair") {
|
|
28
35
|
return `Forge completion tools are available through the MCP server named \`${toolServerName}\`.
|
|
@@ -76,6 +83,7 @@ Complete the Draft cycle in order inside this same provider session:
|
|
|
76
83
|
5. Follow the returned draft-plan instruction, draft the requested final JSON shape for the current Draft kind, then call \`forge.complete_draft_work_order_plan(...)\`.
|
|
77
84
|
6. Follow the returned critic instruction, critique literalism, wrong-project scope, and decomposition quality, then call \`forge.complete_draft_critic(...)\`.
|
|
78
85
|
7. Follow the returned proposal instruction, then call \`forge.complete_draft_proposal(...)\` with the final Draft JSON payload in \`draft_json\`.
|
|
86
|
+
Every gate before the proposal needs a \`summary\` of what it checked or decided.
|
|
79
87
|
The final proposal tool writes \`draft.proposal.json\` under \`.forge/work-items/{workItemId}/artifacts/\`. Reporting Draft completion in prose is not enough.`;
|
|
80
88
|
}
|
|
81
89
|
export function completionPromptForDecomposeCycle(currentGate = "decompose_subject_intake") {
|
|
@@ -92,6 +100,7 @@ Required order:
|
|
|
92
100
|
5. Follow the returned dependency-graph instruction, validate keys/dependencies/order, then call \`forge.complete_decompose_dependency_graph(...)\`.
|
|
93
101
|
6. Follow the returned critic instruction, critique scope, DAG safety, manual reconciliation risk, and missing acceptance detail, then call \`forge.complete_decompose_critic(...)\`.
|
|
94
102
|
7. Follow the returned proposal instruction, then call \`forge.complete_decompose_proposal(...)\` with final JSON in \`proposal_json\`.
|
|
103
|
+
Every gate before the proposal needs a \`summary\` of what it checked or decided.
|
|
95
104
|
The final proposal tool writes \`decompose.proposal.json\` under \`.forge/work-items/{workItemId}/artifacts/\`. The proposal_json object must contain summary, optional blockedReason, and candidates. Work Order-to-Feature candidates may include \`estimated_qa_scope\`; Feature-to-Story candidates should include \`qa_scope\` with schema_version 1 plus scheduleIndex, waveIndex, expectedOutput, handoffSummary, and dependencyReason for dependency handoff. Set \`qa_scope.required_capabilities\` to \`["docker_engine"]\` when implementation or validation starts containers or needs a Docker daemon; repository-specific service and image versions do not belong in the runner capability name.`;
|
|
96
105
|
}
|
|
97
106
|
export function completionPromptForDebugCycle(currentGate = "debug_repro") {
|
|
@@ -125,6 +134,13 @@ export function completionToolNextInstruction(completedPhase, status, nextPhase)
|
|
|
125
134
|
? "CI repair handoff accepted. Forge Bridge may now commit, push, and return the PR to provider checks."
|
|
126
135
|
: "Stay in CI repair, address the exact missing evidence returned by this gate, then call forge.complete_ci_repair again.";
|
|
127
136
|
}
|
|
137
|
+
if (completedPhase === "pr_review") {
|
|
138
|
+
return status === "stale_head"
|
|
139
|
+
? "Stale head recorded. Forge will re-dispatch the review at the current head. Do not post anything to GitHub; end your turn with a one-line summary."
|
|
140
|
+
: status === "blocked"
|
|
141
|
+
? "Blocked review recorded. Do not post anything to GitHub; end your turn with a one-line summary naming the blocker."
|
|
142
|
+
: "Review recorded. Forge will post it as one comment-only review on the reviewed head; do not post anything to GitHub yourself. End your turn with a concise summary of the verdict, the number of findings, and the completion status.";
|
|
143
|
+
}
|
|
128
144
|
if (status !== "pass") {
|
|
129
145
|
return `Stay in ${completedPhase}, address the recorded blockers, then call ${expectedCompletionToolName(completedPhase)} again.`;
|
|
130
146
|
}
|
|
@@ -144,6 +160,9 @@ export function completionToolNextInstructionForDraftGate(completedGate, status,
|
|
|
144
160
|
if (status === "blocked") {
|
|
145
161
|
return `Stay in ${completedGate}; record the blocker and retry the same Draft gate when unblocked.`;
|
|
146
162
|
}
|
|
163
|
+
if (status !== "pass") {
|
|
164
|
+
return `Stay in ${completedGate}; revise the work and call the same Draft gate again with status pass when it is complete.`;
|
|
165
|
+
}
|
|
147
166
|
if (!nextGate) {
|
|
148
167
|
return "Draft proposal accepted. Forge has the structured Work Order draft JSON needed to populate the form.";
|
|
149
168
|
}
|
|
@@ -216,7 +235,7 @@ export function completionToolNextInstructionForDebugGate(completedGate, status,
|
|
|
216
235
|
function qaGateInstruction(gate) {
|
|
217
236
|
switch (gate) {
|
|
218
237
|
case "qa_regression":
|
|
219
|
-
return "Run or explicitly skip applicable regression/build/lint/typecheck/e2e checks, then call forge.complete_qa_regression. For normal Story QA, prefer focused checks and runner-authored forge.start_managed_verification tier profiles; reserve dotnet_solution for shared infrastructure, Feature/PR integration, or an explicit plan requirement. Use forge.start_managed_command only for other commands expected to exceed two minutes, continue independent QA, then call forge.wait_managed_command and include its terminal managed_command_id in command evidence. If the wait returns command_continues=true, continue useful work or wait again after retry_after_ms; do not poll get_managed_command. Normalize negative assertions so an expected no-match exits 0. A reproduced failure outside the current diff and acceptance criteria may remain non-blocking only when the current item has independent passing evidence: preserve it as an out_of_scope_failure with candidate_bug_id, scope_evidence, acceptance_criteria_independent: true, and a failing focused repro command/exit code. Never classify an unexplained, in-scope, or infrastructure failure this way.";
|
|
238
|
+
return "Run or explicitly skip applicable regression/build/lint/typecheck/e2e checks, then call forge.complete_qa_regression. For normal Story QA, prefer focused checks and runner-authored forge.start_managed_verification .NET tier profiles (run_all_shards needs shard_count of at least 2 and no no_build); run Playwright e2e through forge.start_managed_command with the attempt's FORGE_PLAYWRIGHT_CONFIG and the spec files you need; reserve dotnet_solution for shared infrastructure, Feature/PR integration, or an explicit plan requirement. Use forge.start_managed_command only for other commands expected to exceed two minutes, continue independent QA, then call forge.wait_managed_command and include its terminal managed_command_id in command evidence. If the wait returns command_continues=true, continue useful work or wait again after retry_after_ms; do not poll get_managed_command. Normalize negative assertions so an expected no-match exits 0. A reproduced failure outside the current diff and acceptance criteria may remain non-blocking only when the current item has independent passing evidence: preserve it as an out_of_scope_failure with candidate_bug_id, scope_evidence, acceptance_criteria_independent: true, and a failing focused repro command/exit code. Never classify an unexplained, in-scope, or infrastructure failure this way.";
|
|
220
239
|
case "qa_api":
|
|
221
240
|
return "Run or explicitly skip applicable API/backend contract checks, then call forge.complete_qa_api.";
|
|
222
241
|
case "qa_manual_web":
|