audit-tools 0.32.68 → 0.33.1
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 +7 -0
- package/dist/audit/cli/advanceAuditCommand.d.ts.map +1 -1
- package/dist/audit/cli/advanceAuditCommand.js +8 -3
- package/dist/audit/cli/advanceAuditCommand.js.map +1 -1
- package/dist/audit/cli/args.d.ts +9 -27
- package/dist/audit/cli/args.d.ts.map +1 -1
- package/dist/audit/cli/args.js +119 -50
- package/dist/audit/cli/args.js.map +1 -1
- package/dist/audit/cli/auditStep.d.ts +15 -1
- package/dist/audit/cli/auditStep.d.ts.map +1 -1
- package/dist/audit/cli/auditStep.js +2 -0
- package/dist/audit/cli/auditStep.js.map +1 -1
- package/dist/audit/cli/dispatch/quotaPool.d.ts +2 -1
- package/dist/audit/cli/dispatch/quotaPool.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/quotaPool.js +43 -77
- package/dist/audit/cli/dispatch/quotaPool.js.map +1 -1
- package/dist/audit/cli/dispatch.d.ts.map +1 -1
- package/dist/audit/cli/dispatch.js +14 -6
- package/dist/audit/cli/dispatch.js.map +1 -1
- package/dist/audit/cli/hybridDispatch.d.ts +3 -1
- package/dist/audit/cli/hybridDispatch.d.ts.map +1 -1
- package/dist/audit/cli/hybridDispatch.js +6 -0
- package/dist/audit/cli/hybridDispatch.js.map +1 -1
- package/dist/audit/cli/nextStepCommand.d.ts +0 -9
- package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
- package/dist/audit/cli/nextStepCommand.js +173 -92
- package/dist/audit/cli/nextStepCommand.js.map +1 -1
- package/dist/audit/cli/nextStepHelpers.d.ts +11 -2
- package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
- package/dist/audit/cli/nextStepHelpers.js +56 -8
- package/dist/audit/cli/nextStepHelpers.js.map +1 -1
- package/dist/audit/cli/prepareDispatchCommand.d.ts.map +1 -1
- package/dist/audit/cli/prepareDispatchCommand.js +15 -9
- package/dist/audit/cli/prepareDispatchCommand.js.map +1 -1
- package/dist/audit/cli/prompts.d.ts +12 -32
- package/dist/audit/cli/prompts.d.ts.map +1 -1
- package/dist/audit/cli/prompts.js +19 -33
- package/dist/audit/cli/prompts.js.map +1 -1
- package/dist/audit/cli/providerConfirmationStep.d.ts +13 -5
- package/dist/audit/cli/providerConfirmationStep.d.ts.map +1 -1
- package/dist/audit/cli/providerConfirmationStep.js +47 -8
- package/dist/audit/cli/providerConfirmationStep.js.map +1 -1
- package/dist/audit/cli/quotaCommand.d.ts.map +1 -1
- package/dist/audit/cli/quotaCommand.js +16 -10
- package/dist/audit/cli/quotaCommand.js.map +1 -1
- package/dist/audit/cli/rollingAuditDispatch.d.ts.map +1 -1
- package/dist/audit/cli/rollingAuditDispatch.js +14 -1
- package/dist/audit/cli/rollingAuditDispatch.js.map +1 -1
- package/dist/audit/cli/semanticReviewStep.d.ts +11 -1
- package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
- package/dist/audit/cli/semanticReviewStep.js +11 -15
- package/dist/audit/cli/semanticReviewStep.js.map +1 -1
- package/dist/audit/cli/validateCommand.d.ts.map +1 -1
- package/dist/audit/cli/validateCommand.js +3 -3
- package/dist/audit/cli/validateCommand.js.map +1 -1
- package/dist/audit/cli.js +3 -3
- package/dist/audit/cli.js.map +1 -1
- package/dist/audit/contracts/wrapperResponse.d.ts +6 -6
- package/dist/audit/orchestrator/advance.d.ts.map +1 -1
- package/dist/audit/orchestrator/advance.js +39 -7
- package/dist/audit/orchestrator/advance.js.map +1 -1
- package/dist/audit/orchestrator/advanceTypes.d.ts +52 -1
- package/dist/audit/orchestrator/advanceTypes.d.ts.map +1 -1
- package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
- package/dist/audit/orchestrator/executorRunners.js +9 -1
- package/dist/audit/orchestrator/executorRunners.js.map +1 -1
- package/dist/audit/orchestrator/intakeExecutors.d.ts +27 -3
- package/dist/audit/orchestrator/intakeExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/intakeExecutors.js +119 -19
- package/dist/audit/orchestrator/intakeExecutors.js.map +1 -1
- package/dist/audit/orchestrator/nextStep.d.ts +7 -0
- package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
- package/dist/audit/orchestrator/nextStep.js +3 -0
- package/dist/audit/orchestrator/nextStep.js.map +1 -1
- package/dist/audit/orchestrator/providerConfirmation.d.ts.map +1 -1
- package/dist/audit/orchestrator/providerConfirmation.js +0 -2
- package/dist/audit/orchestrator/providerConfirmation.js.map +1 -1
- package/dist/audit/orchestrator/rollingDispatch.d.ts.map +1 -1
- package/dist/audit/orchestrator/rollingDispatch.js +2 -0
- package/dist/audit/orchestrator/rollingDispatch.js.map +1 -1
- package/dist/audit/orchestrator/state.d.ts +17 -0
- package/dist/audit/orchestrator/state.d.ts.map +1 -1
- package/dist/audit/orchestrator/state.js +13 -1
- package/dist/audit/orchestrator/state.js.map +1 -1
- package/dist/audit/providers/claudeWorkerProvider.d.ts +10 -0
- package/dist/audit/providers/claudeWorkerProvider.d.ts.map +1 -0
- package/dist/audit/providers/claudeWorkerProvider.js +15 -0
- package/dist/audit/providers/claudeWorkerProvider.js.map +1 -0
- package/dist/audit/providers/index.d.ts.map +1 -1
- package/dist/audit/providers/index.js +2 -0
- package/dist/audit/providers/index.js.map +1 -1
- package/dist/audit/quota/index.d.ts +133 -128
- package/dist/audit/quota/index.d.ts.map +1 -1
- package/dist/audit/supervisor/sessionConfig.d.ts +3 -11
- package/dist/audit/supervisor/sessionConfig.d.ts.map +1 -1
- package/dist/audit/supervisor/sessionConfig.js +3 -25
- package/dist/audit/supervisor/sessionConfig.js.map +1 -1
- package/dist/audit/types/analyzerCapability.d.ts +6 -6
- package/dist/audit/types/externalAnalyzer.d.ts +10 -10
- package/dist/remediate/index.d.ts.map +1 -1
- package/dist/remediate/index.js +2 -2
- package/dist/remediate/index.js.map +1 -1
- package/dist/remediate/phases/plan.d.ts.map +1 -1
- package/dist/remediate/phases/plan.js +5 -4
- package/dist/remediate/phases/plan.js.map +1 -1
- package/dist/remediate/providers/claudeWorkerProvider.d.ts +11 -0
- package/dist/remediate/providers/claudeWorkerProvider.d.ts.map +1 -0
- package/dist/remediate/providers/claudeWorkerProvider.js +16 -0
- package/dist/remediate/providers/claudeWorkerProvider.js.map +1 -0
- package/dist/remediate/providers/index.d.ts.map +1 -1
- package/dist/remediate/providers/index.js +2 -0
- package/dist/remediate/providers/index.js.map +1 -1
- package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipeline.js +9 -3
- package/dist/remediate/steps/contractPipeline.js.map +1 -1
- package/dist/remediate/steps/dispatch/acceptNode.d.ts +1 -1
- package/dist/remediate/steps/dispatch/acceptNode.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/acceptNode.js.map +1 -1
- package/dist/remediate/steps/dispatch/marshal.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/marshal.js +5 -4
- package/dist/remediate/steps/dispatch/marshal.js.map +1 -1
- package/dist/remediate/steps/dispatch/waveScheduling.d.ts +4 -2
- package/dist/remediate/steps/dispatch/waveScheduling.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/waveScheduling.js +33 -85
- package/dist/remediate/steps/dispatch/waveScheduling.js.map +1 -1
- package/dist/remediate/steps/nextStep.d.ts +21 -10
- package/dist/remediate/steps/nextStep.d.ts.map +1 -1
- package/dist/remediate/steps/nextStep.js +45 -25
- package/dist/remediate/steps/nextStep.js.map +1 -1
- package/dist/remediate/steps/sessionConfigLoad.d.ts +46 -0
- package/dist/remediate/steps/sessionConfigLoad.d.ts.map +1 -0
- package/dist/remediate/steps/sessionConfigLoad.js +39 -0
- package/dist/remediate/steps/sessionConfigLoad.js.map +1 -0
- package/dist/shared/config/resolveSessionConfig.d.ts +75 -0
- package/dist/shared/config/resolveSessionConfig.d.ts.map +1 -0
- package/dist/shared/config/resolveSessionConfig.js +125 -0
- package/dist/shared/config/resolveSessionConfig.js.map +1 -0
- package/dist/shared/dispatch/admissionLoop.d.ts +12 -12
- package/dist/shared/dispatch/coordinator.d.ts.map +1 -1
- package/dist/shared/dispatch/coordinator.js +52 -6
- package/dist/shared/dispatch/coordinator.js.map +1 -1
- package/dist/shared/dispatch/hybridDispatch.d.ts +6 -0
- package/dist/shared/dispatch/hybridDispatch.d.ts.map +1 -1
- package/dist/shared/dispatch/hybridDispatch.js +6 -0
- package/dist/shared/dispatch/hybridDispatch.js.map +1 -1
- package/dist/shared/dispatch/providerLaunchFinalize.d.ts +2 -1
- package/dist/shared/dispatch/providerLaunchFinalize.d.ts.map +1 -1
- package/dist/shared/dispatch/providerLaunchFinalize.js +123 -68
- package/dist/shared/dispatch/providerLaunchFinalize.js.map +1 -1
- package/dist/shared/dispatch/rollingDispatch.d.ts +69 -2
- package/dist/shared/dispatch/rollingDispatch.d.ts.map +1 -1
- package/dist/shared/dispatch/rollingDispatch.js +177 -7
- package/dist/shared/dispatch/rollingDispatch.js.map +1 -1
- package/dist/shared/dispatch/unifiedRolling.d.ts +23 -0
- package/dist/shared/dispatch/unifiedRolling.d.ts.map +1 -1
- package/dist/shared/dispatch/unifiedRolling.js +2 -0
- package/dist/shared/dispatch/unifiedRolling.js.map +1 -1
- package/dist/shared/friction/stepBoundaryCapture.d.ts +52 -1
- package/dist/shared/friction/stepBoundaryCapture.d.ts.map +1 -1
- package/dist/shared/friction/stepBoundaryCapture.js +87 -0
- package/dist/shared/friction/stepBoundaryCapture.js.map +1 -1
- package/dist/shared/index.d.ts +20 -10
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +20 -6
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/io/stateDir.d.ts +27 -0
- package/dist/shared/io/stateDir.d.ts.map +1 -0
- package/dist/shared/io/stateDir.js +40 -0
- package/dist/shared/io/stateDir.js.map +1 -0
- package/dist/shared/providers/auditorSources.d.ts +169 -0
- package/dist/shared/providers/auditorSources.d.ts.map +1 -0
- package/dist/shared/providers/auditorSources.js +453 -0
- package/dist/shared/providers/auditorSources.js.map +1 -0
- package/dist/shared/providers/claudeWorkerProvider.d.ts +71 -0
- package/dist/shared/providers/claudeWorkerProvider.d.ts.map +1 -0
- package/dist/shared/providers/claudeWorkerProvider.js +133 -0
- package/dist/shared/providers/claudeWorkerProvider.js.map +1 -0
- package/dist/shared/providers/providerConfirmation.d.ts +3 -20
- package/dist/shared/providers/providerConfirmation.d.ts.map +1 -1
- package/dist/shared/providers/providerConfirmation.js +27 -40
- package/dist/shared/providers/providerConfirmation.js.map +1 -1
- package/dist/shared/providers/providerFactory.d.ts +13 -1
- package/dist/shared/providers/providerFactory.d.ts.map +1 -1
- package/dist/shared/providers/providerFactory.js +12 -0
- package/dist/shared/providers/providerFactory.js.map +1 -1
- package/dist/shared/providers/proxyCatalog.d.ts +95 -0
- package/dist/shared/providers/proxyCatalog.d.ts.map +1 -0
- package/dist/shared/providers/proxyCatalog.js +426 -0
- package/dist/shared/providers/proxyCatalog.js.map +1 -0
- package/dist/shared/providers/sharedProviderConfirmation.d.ts +264 -75
- package/dist/shared/providers/sharedProviderConfirmation.d.ts.map +1 -1
- package/dist/shared/providers/sharedProviderConfirmation.js +534 -113
- package/dist/shared/providers/sharedProviderConfirmation.js.map +1 -1
- package/dist/shared/quota/apiPool.d.ts +34 -11
- package/dist/shared/quota/apiPool.d.ts.map +1 -1
- package/dist/shared/quota/apiPool.js +52 -23
- package/dist/shared/quota/apiPool.js.map +1 -1
- package/dist/shared/quota/capacity.d.ts +79 -50
- package/dist/shared/quota/capacity.d.ts.map +1 -1
- package/dist/shared/quota/capacity.js +40 -5
- package/dist/shared/quota/capacity.js.map +1 -1
- package/dist/shared/quota/errorParsing.d.ts +39 -0
- package/dist/shared/quota/errorParsing.d.ts.map +1 -1
- package/dist/shared/quota/errorParsing.js +76 -0
- package/dist/shared/quota/errorParsing.js.map +1 -1
- package/dist/shared/quota/hostPool.d.ts +107 -0
- package/dist/shared/quota/hostPool.d.ts.map +1 -0
- package/dist/shared/quota/hostPool.js +103 -0
- package/dist/shared/quota/hostPool.js.map +1 -0
- package/dist/shared/quota/quotaSource.d.ts +2 -2
- package/dist/shared/types/auditorDescriptor.d.ts +120 -0
- package/dist/shared/types/auditorDescriptor.d.ts.map +1 -0
- package/dist/shared/types/auditorDescriptor.js +28 -0
- package/dist/shared/types/auditorDescriptor.js.map +1 -0
- package/dist/shared/types/providerConfirmation.d.ts +64 -6
- package/dist/shared/types/providerConfirmation.d.ts.map +1 -1
- package/dist/shared/types/providerConfirmation.js +1 -1
- package/dist/shared/types/rollingDispatch.d.ts +45 -1
- package/dist/shared/types/rollingDispatch.d.ts.map +1 -1
- package/dist/shared/types/sessionConfig.d.ts +149 -67
- package/dist/shared/types/sessionConfig.d.ts.map +1 -1
- package/dist/shared/types/sessionConfig.js +87 -2
- package/dist/shared/types/sessionConfig.js.map +1 -1
- package/dist/shared/validation/sessionConfig.d.ts +26 -14
- package/dist/shared/validation/sessionConfig.d.ts.map +1 -1
- package/dist/shared/validation/sessionConfig.js +95 -69
- package/dist/shared/validation/sessionConfig.js.map +1 -1
- package/docs/audit-pkg/contracts.md +4 -4
- package/docs/audit-pkg/operator-guide.md +43 -24
- package/package.json +1 -1
- package/skills/audit-code/SKILL.md +17 -14
- package/skills/audit-code/audit-code.prompt.md +17 -16
- package/wrapper/audit-code-wrapper-install-hosts.mjs +6 -10
- package/wrapper/remediate-code-wrapper-install-hosts.mjs +4 -8
- package/dist/shared/quota/repairProxyRegistry.d.ts +0 -84
- package/dist/shared/quota/repairProxyRegistry.d.ts.map +0 -1
- package/dist/shared/quota/repairProxyRegistry.js +0 -144
- package/dist/shared/quota/repairProxyRegistry.js.map +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { loadRemediateSessionConfig } from "./sessionConfigLoad.js";
|
|
1
2
|
import { existsSync, statSync } from "node:fs";
|
|
2
3
|
import { mkdir, readFile, rename } from "node:fs/promises";
|
|
3
4
|
import { dirname, join, resolve } from "node:path";
|
|
4
5
|
import { StateStore } from "../state/store.js";
|
|
5
|
-
import { readOptionalJsonFile,
|
|
6
|
+
import { readConfirmedDispatchPolicy, resolveDispatchExclusion, readOptionalJsonFile, readValidatedRepoSessionIntent, stagedAndUntracked, writeJsonFile, writeTextFile, buildAuditDeliverablePair, formatValidationIssues, isRecord, withFsRetry, RunLogger, DISPATCH_PROMPT_HANDOFF_NOTE, renderHostScratchNote, hostScratchDir, renderQuotaCoverageNudge, renderTokenBudgetView, coerceJsonObjectArg, driveRolling, resolveLedgerBudgets, setQuotaStateDir, detectHostDispatchWall, admissionBlockedOnBudget, reconcileAdmissionLeasesFromQuotaFile, buildQuotaPausedTerminal, interpretFreeFormIntent, advance, decideFrictionTriage, buildFrictionTriageBlock, planHybridDispatch, readSettledPools, addSettledPool, sourceByPoolId, classifyProvider, selectDispatchDriver, renderDispatchDriverInstruction, HostSessionQuotaSource, buildProviderModelKey, captureStepBoundaryFriction, captureCostDriftFriction, captureCreditExhaustionFriction, captureQuotaUnclassifiedFriction, captureModelUnavailableFriction, capturePacketTooLargeFriction, LENSES, SEVERITIES, resolveHostProviderName, resolveConversationHostProvider, resolveHostDispatchCapability as sharedResolveHostDispatchCapability, resolveAutonomousMode, resolveRollingEngineFlag, shouldDemotePrimaryInProcess, DEFAULT_CONTEXT_TOKENS } from "audit-tools/shared";
|
|
6
7
|
import { readRemediationAccessMemory, computeBlockContinuityScores } from "../state/accessMemory.js";
|
|
7
8
|
import { applyPlanPipeline, buildCoverageLedger } from "../phases/plan.js";
|
|
8
9
|
import { groundExtractedFindings } from "../phases/grounding.js";
|
|
@@ -51,23 +52,6 @@ export function resolveHostDispatchCapability(options) {
|
|
|
51
52
|
env: options.env,
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
|
-
/**
|
|
55
|
-
* Whether the run is unattended (autonomous). Host-agnostic — ONE flag drives
|
|
56
|
-
* the whole path. Resolution order: sessionConfig.autonomous_mode →
|
|
57
|
-
* REMEDIATE_AUTONOMOUS env → false (attended/interactive default, so the review
|
|
58
|
-
* gate halts for a human unless autonomy is explicitly requested).
|
|
59
|
-
*/
|
|
60
|
-
export function resolveAutonomousMode(options = {}) {
|
|
61
|
-
if (options.sessionConfig?.autonomous_mode !== undefined) {
|
|
62
|
-
return options.sessionConfig.autonomous_mode;
|
|
63
|
-
}
|
|
64
|
-
const envValue = (options.env ?? process.env).REMEDIATE_AUTONOMOUS;
|
|
65
|
-
if (envValue === "true")
|
|
66
|
-
return true;
|
|
67
|
-
if (envValue === "false")
|
|
68
|
-
return false;
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
55
|
/**
|
|
72
56
|
* Whether the rolling dispatch engine drives the implement phase. Defaults to TRUE:
|
|
73
57
|
* both rolling drivers on the shared `acceptNodeWorktree` core (per-node worktree →
|
|
@@ -536,6 +520,8 @@ export async function driveRollingDispatch(levels, options) {
|
|
|
536
520
|
...(options.onCostDrift ? { onCostDrift: options.onCostDrift } : {}),
|
|
537
521
|
...(options.onCreditExhausted ? { onCreditExhausted: options.onCreditExhausted } : {}),
|
|
538
522
|
...(options.onQuotaUnclassified ? { onQuotaUnclassified: options.onQuotaUnclassified } : {}),
|
|
523
|
+
...(options.onModelUnavailable ? { onModelUnavailable: options.onModelUnavailable } : {}),
|
|
524
|
+
...(options.onPacketTooLarge ? { onPacketTooLarge: options.onPacketTooLarge } : {}),
|
|
539
525
|
// Single-flight (CE-001) is enforced by the unified driver.
|
|
540
526
|
rebuildBetweenLevels: options.rebuildSharedBetweenLevels,
|
|
541
527
|
// Host-session escalation: feed recordLimit (write) at the rate_limited observation
|
|
@@ -573,6 +559,10 @@ const IN_PROCESS_DISPATCH_PROVIDERS = new Set([
|
|
|
573
559
|
"subprocess-template",
|
|
574
560
|
"worker-command",
|
|
575
561
|
"agy",
|
|
562
|
+
// The proxied isolated Claude-harness worker (commit 3b/3c) — headless in-process
|
|
563
|
+
// launch from its claude-worker source (mirrors audit's IN_PROCESS_AUDIT_PROVIDERS;
|
|
564
|
+
// both draws must classify the new worker kind or its pools confirm but never route).
|
|
565
|
+
"claude-worker",
|
|
576
566
|
]);
|
|
577
567
|
function resolvesToInProcessDispatchProvider(sessionConfig) {
|
|
578
568
|
const provider = sessionConfig?.provider;
|
|
@@ -687,6 +677,11 @@ export async function driveRollingImplementDispatch(options) {
|
|
|
687
677
|
hostModels: options.waveOptions?.hostModels,
|
|
688
678
|
hostModelId: options.waveOptions?.hostModelId,
|
|
689
679
|
hostSession,
|
|
680
|
+
// The operator's Gate-0 exclusions, applied as a set-difference over freshly
|
|
681
|
+
// gathered reach. Read here because this layer owns `root`; self-spawn-blocked is
|
|
682
|
+
// recomputed against THIS process's env rather than inherited from the auditor
|
|
683
|
+
// that wrote the confirmation.
|
|
684
|
+
excludedBackends: resolveDispatchExclusion(await readConfirmedDispatchPolicy(options.root)),
|
|
690
685
|
});
|
|
691
686
|
// The live per-node worker: the configured provider, launched with the node's
|
|
692
687
|
// worktree-rooted prompt and cwd = its worktree. Tests inject `options.dispatchNode`
|
|
@@ -820,6 +815,17 @@ export async function driveRollingImplementDispatch(options) {
|
|
|
820
815
|
onQuotaUnclassified: (info) => {
|
|
821
816
|
captureQuotaUnclassifiedFriction(artifactsDir, runId, info, "remediate-code");
|
|
822
817
|
},
|
|
818
|
+
// Model-unavailable exclusion (availability analog of cost drift): the engine
|
|
819
|
+
// has already permanently excluded the 404ing pool; surface it so the operator
|
|
820
|
+
// reconciles the stale registry row (registry rows are leads, not reach).
|
|
821
|
+
onModelUnavailable: (info) => {
|
|
822
|
+
captureModelUnavailableFriction(artifactsDir, runId, info, "remediate-code");
|
|
823
|
+
},
|
|
824
|
+
// Packet-too-large (per-packet sizing fault, HTTP 413): the engine skips THIS
|
|
825
|
+
// pool for THIS packet only — no exclusion, no cooldown; surface each pair.
|
|
826
|
+
onPacketTooLarge: (info) => {
|
|
827
|
+
capturePacketTooLargeFriction(artifactsDir, runId, info, "remediate-code");
|
|
828
|
+
},
|
|
823
829
|
});
|
|
824
830
|
// Piece D — persist the rolling engine's partial-completion terminal onto state
|
|
825
831
|
// BEFORE the merge, so the merge can SKIP-block the quota_paused stranded nodes
|
|
@@ -1175,8 +1181,13 @@ async function presentReportStep(root, artifactsDir, state) {
|
|
|
1175
1181
|
}
|
|
1176
1182
|
async function buildImplementDispatchStep(ctx) {
|
|
1177
1183
|
const { root, artifactsDir, state, options, store } = ctx;
|
|
1178
|
-
|
|
1179
|
-
|
|
1184
|
+
// The effective config comes from the single remediate loader — always resolved
|
|
1185
|
+
// against the ambient descriptor (see there for why `null` is not an option).
|
|
1186
|
+
const loadedSessionConfig = await loadRemediateSessionConfig({
|
|
1187
|
+
root,
|
|
1188
|
+
override: options.sessionConfig,
|
|
1189
|
+
artifactsFirst: true,
|
|
1190
|
+
});
|
|
1180
1191
|
// B1: fold the `--host-provider` override onto `host_provider` so every
|
|
1181
1192
|
// downstream host resolver keys the fan-out to the ACTUAL conversation host.
|
|
1182
1193
|
// "auto" is treated as unset (fall through to env auto-detection).
|
|
@@ -1326,6 +1337,9 @@ async function buildImplementDispatchStep(ctx) {
|
|
|
1326
1337
|
// skipped (attended host) — demote the configured primary backend into the
|
|
1327
1338
|
// source-pool set so the split fans across host + backend + NIM.
|
|
1328
1339
|
demotePrimaryInProcess: demoteBackendToSource,
|
|
1340
|
+
// The operator's Gate-0 exclusions, applied as a set-difference over freshly
|
|
1341
|
+
// gathered reach; self-spawn-blocked recomputed against THIS process's env.
|
|
1342
|
+
excludedBackends: resolveDispatchExclusion(await readConfirmedDispatchPolicy(root)),
|
|
1329
1343
|
});
|
|
1330
1344
|
const backendPools = confirmedPools.filter(isInProcessPool);
|
|
1331
1345
|
let rolling;
|
|
@@ -1396,6 +1410,8 @@ async function buildImplementDispatchStep(ctx) {
|
|
|
1396
1410
|
const settledOutcomeBlocks = new Set(inProcessOutcome.nodes
|
|
1397
1411
|
.filter((n) => n.outcome === "rate_limited" ||
|
|
1398
1412
|
n.outcome === "credit_exhausted" ||
|
|
1413
|
+
n.outcome === "model_unavailable" ||
|
|
1414
|
+
n.outcome === "packet_too_large" ||
|
|
1399
1415
|
n.outcome === "quota_unclassified")
|
|
1400
1416
|
.map((n) => n.block_id));
|
|
1401
1417
|
const exhaustedPools = new Set(partition.inProcess.filter((a) => settledOutcomeBlocks.has(a.nodeId)).map((a) => a.poolId));
|
|
@@ -1410,7 +1426,7 @@ async function buildImplementDispatchStep(ctx) {
|
|
|
1410
1426
|
void captureStepBoundaryFriction(artifactsDir, runId, {
|
|
1411
1427
|
eventType: "quota_escalation",
|
|
1412
1428
|
discriminator: blockId,
|
|
1413
|
-
note: "A-8 hybrid in-process node rate-limited / credit-exhausted / quota-unclassified; its backend pool was settled for this run.",
|
|
1429
|
+
note: "A-8 hybrid in-process node rate-limited / credit-exhausted / model-unavailable / packet-too-large / quota-unclassified; its backend pool was settled for this run.",
|
|
1414
1430
|
severity: "high",
|
|
1415
1431
|
category: "trap",
|
|
1416
1432
|
area: "dispatch/quota",
|
|
@@ -2347,9 +2363,11 @@ async function handleReadyIntakeContractPipeline(root, artifactsDir, options) {
|
|
|
2347
2363
|
// flag. Threaded into the contract pipeline so the adversarial 'critique' /
|
|
2348
2364
|
// 'critic' prompts MANDATE an independent sub-agent reviewer when the host can
|
|
2349
2365
|
// dispatch one (fail-safe: mandate by default).
|
|
2350
|
-
const sessionConfigForDispatch =
|
|
2351
|
-
|
|
2352
|
-
|
|
2366
|
+
const sessionConfigForDispatch = await loadRemediateSessionConfig({
|
|
2367
|
+
root,
|
|
2368
|
+
override: options?.sessionConfig,
|
|
2369
|
+
artifactsFirst: true,
|
|
2370
|
+
});
|
|
2353
2371
|
const hostCanDispatchSubagents = resolveHostDispatchCapability({
|
|
2354
2372
|
hostCanDispatchSubagents: options?.hostCanDispatchSubagents,
|
|
2355
2373
|
sessionConfig: sessionConfigForDispatch,
|
|
@@ -3087,8 +3105,10 @@ export async function decideNextStep(options = {}) {
|
|
|
3087
3105
|
// validated load (with `.remediation-artifacts/` path precedence + operator
|
|
3088
3106
|
// warning surface) happens inside the loop, so suppress warnings here to avoid
|
|
3089
3107
|
// emitting the same warning twice per invocation. Errors still throw.
|
|
3108
|
+
// Only reads `observability.run_log` (an INTENT field), so the raw intent suffices —
|
|
3109
|
+
// no descriptor resolve needed here.
|
|
3090
3110
|
const sessionConfig = normalizedOptions.sessionConfig ??
|
|
3091
|
-
(await
|
|
3111
|
+
(await readValidatedRepoSessionIntent(join(root, "session-config.json"), {
|
|
3092
3112
|
onWarnings: () => { },
|
|
3093
3113
|
}));
|
|
3094
3114
|
const runLogger = new RunLogger(join(artifactsDir, "run.log.jsonl"), {
|