audit-tools 0.30.0 → 0.30.2
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/dist/audit/adapters/astGrep.d.ts +30 -0
- package/dist/audit/adapters/astGrep.d.ts.map +1 -0
- package/dist/audit/adapters/astGrep.js +46 -0
- package/dist/audit/adapters/astGrep.js.map +1 -0
- package/dist/audit/adapters/codeql.d.ts +47 -0
- package/dist/audit/adapters/codeql.d.ts.map +1 -0
- package/dist/audit/adapters/codeql.js +52 -0
- package/dist/audit/adapters/codeql.js.map +1 -0
- package/dist/audit/adapters/normalizeExternal.d.ts +24 -1
- package/dist/audit/adapters/normalizeExternal.d.ts.map +1 -1
- package/dist/audit/adapters/normalizeExternal.js +50 -0
- package/dist/audit/adapters/normalizeExternal.js.map +1 -1
- package/dist/audit/adapters/semgrep.d.ts +34 -15
- package/dist/audit/adapters/semgrep.d.ts.map +1 -1
- package/dist/audit/adapters/semgrep.js +54 -1
- package/dist/audit/adapters/semgrep.js.map +1 -1
- package/dist/audit/cli/mergeAndIngestCommand.d.ts +29 -1
- package/dist/audit/cli/mergeAndIngestCommand.d.ts.map +1 -1
- package/dist/audit/cli/mergeAndIngestCommand.js +71 -5
- package/dist/audit/cli/mergeAndIngestCommand.js.map +1 -1
- package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
- package/dist/audit/cli/nextStepHelpers.js +7 -6
- package/dist/audit/cli/nextStepHelpers.js.map +1 -1
- package/dist/audit/cli/resynthesizeCommand.d.ts.map +1 -1
- package/dist/audit/cli/resynthesizeCommand.js +3 -3
- package/dist/audit/cli/resynthesizeCommand.js.map +1 -1
- package/dist/audit/cli/submitPacketCommand.d.ts.map +1 -1
- package/dist/audit/cli/submitPacketCommand.js +6 -1
- package/dist/audit/cli/submitPacketCommand.js.map +1 -1
- package/dist/audit/contracts/workerSchemas.d.ts +13 -13
- package/dist/audit/contracts/workerSchemas.d.ts.map +1 -1
- package/dist/audit/contracts/workerSchemas.js +1 -1
- package/dist/audit/contracts/workerSchemas.js.map +1 -1
- package/dist/audit/contracts/wrapperResponse.d.ts +7 -0
- package/dist/audit/contracts/wrapperResponse.d.ts.map +1 -1
- package/dist/audit/contracts/wrapperResponse.js +1 -0
- package/dist/audit/contracts/wrapperResponse.js.map +1 -1
- package/dist/audit/extractors/graph.d.ts.map +1 -1
- package/dist/audit/extractors/graph.js +47 -0
- package/dist/audit/extractors/graph.js.map +1 -1
- package/dist/audit/io/artifacts.d.ts +2 -2
- package/dist/audit/io/artifacts.d.ts.map +1 -1
- package/dist/audit/io/artifacts.js +14 -11
- package/dist/audit/io/artifacts.js.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.d.ts +17 -0
- package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.js +26 -0
- package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
- package/dist/audit/orchestrator/executorRunners.d.ts.map +1 -1
- package/dist/audit/orchestrator/executorRunners.js +20 -0
- package/dist/audit/orchestrator/executorRunners.js.map +1 -1
- package/dist/audit/orchestrator/executors.d.ts.map +1 -1
- package/dist/audit/orchestrator/executors.js +5 -0
- package/dist/audit/orchestrator/executors.js.map +1 -1
- package/dist/audit/orchestrator/nextStep.d.ts +37 -0
- package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
- package/dist/audit/orchestrator/nextStep.js +45 -0
- package/dist/audit/orchestrator/nextStep.js.map +1 -1
- package/dist/audit/supervisor/operatorHandoff.d.ts +12 -0
- package/dist/audit/supervisor/operatorHandoff.d.ts.map +1 -1
- package/dist/audit/supervisor/operatorHandoff.js +3 -1
- package/dist/audit/supervisor/operatorHandoff.js.map +1 -1
- package/dist/audit/types/externalAnalyzer.d.ts +68 -2
- package/dist/audit/types/externalAnalyzer.d.ts.map +1 -1
- package/dist/audit/types/externalAnalyzer.js +23 -0
- package/dist/audit/types/externalAnalyzer.js.map +1 -1
- package/dist/audit/types/reviewPlanning.d.ts +14 -14
- package/dist/audit/validation/auditResults.d.ts +17 -0
- package/dist/audit/validation/auditResults.d.ts.map +1 -1
- package/dist/audit/validation/auditResults.js +39 -0
- package/dist/audit/validation/auditResults.js.map +1 -1
- package/dist/audit/validation/sessionConfig.d.ts.map +1 -1
- package/dist/audit/validation/sessionConfig.js +4 -0
- package/dist/audit/validation/sessionConfig.js.map +1 -1
- package/dist/remediate/review/autonomousGate.d.ts +74 -0
- package/dist/remediate/review/autonomousGate.d.ts.map +1 -0
- package/dist/remediate/review/autonomousGate.js +179 -0
- package/dist/remediate/review/autonomousGate.js.map +1 -0
- package/dist/remediate/steps/contractPipeline.d.ts +8 -0
- package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipeline.js +1 -0
- package/dist/remediate/steps/contractPipeline.js.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.d.ts +10 -0
- package/dist/remediate/steps/contractPipelinePrompts.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipelinePrompts.js +32 -1
- package/dist/remediate/steps/contractPipelinePrompts.js.map +1 -1
- package/dist/remediate/steps/nextStep.d.ts +34 -0
- package/dist/remediate/steps/nextStep.d.ts.map +1 -1
- package/dist/remediate/steps/nextStep.js +144 -8
- package/dist/remediate/steps/nextStep.js.map +1 -1
- package/dist/shared/index.d.ts +11 -2
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +6 -2
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/io/auditToolsPaths.d.ts +35 -0
- package/dist/shared/io/auditToolsPaths.d.ts.map +1 -1
- package/dist/shared/io/auditToolsPaths.js +46 -1
- package/dist/shared/io/auditToolsPaths.js.map +1 -1
- package/dist/shared/io/frictionCapture.d.ts +83 -0
- package/dist/shared/io/frictionCapture.d.ts.map +1 -0
- package/dist/shared/io/frictionCapture.js +79 -0
- package/dist/shared/io/frictionCapture.js.map +1 -0
- package/dist/shared/io/gitignoreArtifacts.d.ts +94 -0
- package/dist/shared/io/gitignoreArtifacts.d.ts.map +1 -0
- package/dist/shared/io/gitignoreArtifacts.js +147 -0
- package/dist/shared/io/gitignoreArtifacts.js.map +1 -0
- package/dist/shared/quota/antigravityQuotaSource.d.ts.map +1 -1
- package/dist/shared/quota/antigravityQuotaSource.js +2 -0
- package/dist/shared/quota/antigravityQuotaSource.js.map +1 -1
- package/dist/shared/quota/claudeOAuthQuotaSource.d.ts +35 -2
- package/dist/shared/quota/claudeOAuthQuotaSource.d.ts.map +1 -1
- package/dist/shared/quota/claudeOAuthQuotaSource.js +157 -17
- package/dist/shared/quota/claudeOAuthQuotaSource.js.map +1 -1
- package/dist/shared/quota/codexQuotaSource.d.ts.map +1 -1
- package/dist/shared/quota/codexQuotaSource.js +2 -0
- package/dist/shared/quota/codexQuotaSource.js.map +1 -1
- package/dist/shared/quota/copilotQuotaSource.d.ts.map +1 -1
- package/dist/shared/quota/copilotQuotaSource.js +2 -0
- package/dist/shared/quota/copilotQuotaSource.js.map +1 -1
- package/dist/shared/quota/errorParsing.d.ts +19 -0
- package/dist/shared/quota/errorParsing.d.ts.map +1 -1
- package/dist/shared/quota/errorParsing.js +14 -1
- package/dist/shared/quota/errorParsing.js.map +1 -1
- package/dist/shared/quota/hostSessionQuotaSource.d.ts +138 -0
- package/dist/shared/quota/hostSessionQuotaSource.d.ts.map +1 -0
- package/dist/shared/quota/hostSessionQuotaSource.js +213 -0
- package/dist/shared/quota/hostSessionQuotaSource.js.map +1 -0
- package/dist/shared/quota/httpQuotaSource.d.ts +7 -3
- package/dist/shared/quota/httpQuotaSource.d.ts.map +1 -1
- package/dist/shared/quota/httpQuotaSource.js.map +1 -1
- package/dist/shared/reporting/auditDeliverable.d.ts +36 -0
- package/dist/shared/reporting/auditDeliverable.d.ts.map +1 -0
- package/dist/shared/reporting/auditDeliverable.js +85 -0
- package/dist/shared/reporting/auditDeliverable.js.map +1 -0
- package/dist/shared/types/sessionConfig.d.ts +13 -0
- package/dist/shared/types/sessionConfig.d.ts.map +1 -1
- package/package.json +1 -1
- package/schemas/audit_result.schema.json +2 -2
- package/schemas/audit_results.schema.json +2 -2
- package/schemas/finding.schema.json +2 -2
- package/scripts/postinstall.mjs +64 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nextStep.d.ts","sourceRoot":"","sources":["../../../src/remediate/steps/nextStep.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAGV,gBAAgB,EAGjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,
|
|
1
|
+
{"version":3,"file":"nextStep.d.ts","sourceRoot":"","sources":["../../../src/remediate/steps/nextStep.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAGV,gBAAgB,EAGjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA8Y,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,KAAK,oBAAoB,EAAE,KAAK,YAAY,EAA8B,KAAK,qBAAqB,EAAE,KAAK,YAAY,EAAqB,KAAK,sBAAsB,EAAE,KAAK,cAAc,EAAwE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAOzvB,OAAO,EASL,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAC;AAKvB,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE3E,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EAEzB,MAAM,wBAAwB,CAAC;AAoChC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAY3D,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,wBAAwB,CAAC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AmB,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,gBAAgB,EACvB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,KAAK,GAAE,MAA6B,GACnC,qBAAqB,CA4BvB;AAyoBD,+EAA+E;AAC/E,MAAM,WAAW,iCAAiC;IAChD;;;;;OAKG;IACH,MAAM,EAAE,cAAc,GAAG,UAAU,CAAC;IACpC,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,+BAA+B,CACnD,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAC7B,OAAO,CAAC,iCAAiC,CAAC,CAa5C;AA6zCD,wBAAsB,cAAc,CAClC,OAAO,GAAE,eAAe,GAAG,MAAW,GACrC,OAAO,CAAC,eAAe,CAAC,CAmC1B;AA+OD,uFAAuF;AACvF,eAAO,MAAM,8BAA8B,+BAA+B,CAAC;AAC3E,eAAO,MAAM,oCAAoC,kDACA,CAAC;AAElD,MAAM,WAAW,6BAA6B;IAC5C,cAAc,EAAE,OAAO,oCAAoC,CAAC;IAC5D,6EAA6E;IAC7E,WAAW,EAAE,iBAAiB,CAAC;IAC/B;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAsB,kCAAkC,CACtD,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,gBAAgB,GAAG,SAAS,GACvC,OAAO,CAAC,6BAA6B,GAAG,IAAI,CAAC,CA6B/C"}
|
|
@@ -2,7 +2,7 @@ import { existsSync } from "node:fs";
|
|
|
2
2
|
import { mkdir, readFile, rename } from "node:fs/promises";
|
|
3
3
|
import { dirname, join, resolve } from "node:path";
|
|
4
4
|
import { StateStore } from "../state/store.js";
|
|
5
|
-
import { readOptionalJsonFile, writeJsonFile, formatValidationIssues, isRecord, withFsRetry, RunLogger, DO_NOT_TOKEN_WRAP_NOTE, DISPATCH_PROMPT_HANDOFF_NOTE, coerceJsonObjectArg, createRollingDispatcher, setQuotaStateDir, interpretFreeFormIntent, advance, planHybridDispatch, readSettledPools, addSettledPool, sourceByPoolId } from "audit-tools/shared";
|
|
5
|
+
import { readOptionalJsonFile, writeJsonFile, writeTextFile, buildAuditDeliverablePair, formatValidationIssues, isRecord, withFsRetry, RunLogger, DO_NOT_TOKEN_WRAP_NOTE, DISPATCH_PROMPT_HANDOFF_NOTE, coerceJsonObjectArg, createRollingDispatcher, setQuotaStateDir, interpretFreeFormIntent, advance, frictionCaptured, persistFrictionCapture, frictionCapturePath, planHybridDispatch, readSettledPools, addSettledPool, sourceByPoolId } from "audit-tools/shared";
|
|
6
6
|
import { applyPlanPipeline, buildCoverageLedger } from "../phases/plan.js";
|
|
7
7
|
import { groundExtractedFindings } from "../phases/grounding.js";
|
|
8
8
|
import { runTriagePhase } from "../phases/triage.js";
|
|
@@ -22,6 +22,7 @@ import { buildNextContractPipelineStep, shouldEnterContractPipeline, writePathAS
|
|
|
22
22
|
import { evaluateFastPath, buildLeanExtractedPlan, } from "./leanFastPath.js";
|
|
23
23
|
import { contractArtifactExists, contractPipelineDir, } from "../contractPipeline/artifactStore.js";
|
|
24
24
|
import { buildReviewRequest, applyReviewResolution, } from "../review/reviewGate.js";
|
|
25
|
+
import { buildAutonomousReviewDecision } from "../review/autonomousGate.js";
|
|
25
26
|
import { runFindingFilterPass } from "../findingFilter.js";
|
|
26
27
|
import { intakePaths, isIntakeReady, readIntakeArtifacts, resolveManifestSources, } from "../intake.js";
|
|
27
28
|
import { ambiguityReviewPrompt, clarificationPrompt, collectIntakeClarificationsPrompt, collectStartingPointPrompt, loaderCommand, reviewApprovalPrompt, synthesizeIntakePrompt, triagePrompt, } from "./prompts.js";
|
|
@@ -43,6 +44,23 @@ export function resolveHostDispatchCapability(options) {
|
|
|
43
44
|
// REMEDIATE_HOST_CAN_DISPATCH=false, or --host-can-dispatch-subagents=false.
|
|
44
45
|
return true;
|
|
45
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Whether the run is unattended (autonomous). Host-agnostic — ONE flag drives
|
|
49
|
+
* the whole path. Resolution order: sessionConfig.autonomous_mode →
|
|
50
|
+
* REMEDIATE_AUTONOMOUS env → false (attended/interactive default, so the review
|
|
51
|
+
* gate halts for a human unless autonomy is explicitly requested).
|
|
52
|
+
*/
|
|
53
|
+
export function resolveAutonomousMode(options = {}) {
|
|
54
|
+
if (options.sessionConfig?.autonomous_mode !== undefined) {
|
|
55
|
+
return options.sessionConfig.autonomous_mode;
|
|
56
|
+
}
|
|
57
|
+
const envValue = (options.env ?? process.env).REMEDIATE_AUTONOMOUS;
|
|
58
|
+
if (envValue === "true")
|
|
59
|
+
return true;
|
|
60
|
+
if (envValue === "false")
|
|
61
|
+
return false;
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
46
64
|
/**
|
|
47
65
|
* Whether the rolling dispatch engine drives the implement phase. Defaults to TRUE:
|
|
48
66
|
* both rolling drivers on the shared `acceptNodeWorktree` core (per-node worktree →
|
|
@@ -978,6 +996,12 @@ async function forceReplanFromExistingIntake(root, artifactsDir, previous, store
|
|
|
978
996
|
}
|
|
979
997
|
async function presentReportStep(root, artifactsDir, state) {
|
|
980
998
|
const reportPath = join(dirname(artifactsDir), "remediation-report.md");
|
|
999
|
+
// Tool-emitted terminal friction-capture close-out, FOLDED into present_report so it
|
|
1000
|
+
// is one bounded step (parity with audit-code's `decideAuditFrictionCloseout`; same
|
|
1001
|
+
// single-sourced shared shape + persist helper). Degrade-clean (persists a
|
|
1002
|
+
// zero-friction record so it never blocks completion) and never-re-loop (idempotent
|
|
1003
|
+
// on the run_id-keyed record). Never couples to any repo's backlog doc.
|
|
1004
|
+
const closeout = await decideRemediateFrictionCloseout(artifactsDir, state);
|
|
981
1005
|
return writeCurrentStep({
|
|
982
1006
|
stepKind: "present_report",
|
|
983
1007
|
status: "complete",
|
|
@@ -989,12 +1013,26 @@ async function presentReportStep(root, artifactsDir, state) {
|
|
|
989
1013
|
|
|
990
1014
|
Read \`${reportPath}\` and summarize the remediation outcome for the user.
|
|
991
1015
|
Mention the resolved, ignored, and deemed-inappropriate counts plus the closing action.
|
|
992
|
-
|
|
1016
|
+
|
|
1017
|
+
## Record run friction (close-out)
|
|
1018
|
+
|
|
1019
|
+
A friction record for this run exists at \`${closeout.recordPath}\` (currently empty).
|
|
1020
|
+
If you hit any friction this run — non-obvious traps, misbehaving tools, missing
|
|
1021
|
+
affordances, shell/env quirks, unclear instructions — overwrite that file with the same
|
|
1022
|
+
JSON shape, filling \`frictions\` with one entry per item (each
|
|
1023
|
+
\`{ "note": "...", optional "severity", "category", "area" }\`), keeping
|
|
1024
|
+
\`schema_version\`, \`tool\`, \`run_id\`, and \`captured_at\` as written. Hit none → leave
|
|
1025
|
+
it empty. This is the run's own record under its artifacts dir — do NOT edit any
|
|
1026
|
+
repository's tracking/backlog doc.
|
|
1027
|
+
|
|
1028
|
+
Stop after presenting the summary (and recording friction, or confirming none).
|
|
993
1029
|
`,
|
|
994
1030
|
allowedCommands: [],
|
|
995
|
-
stopCondition: "Stop after presenting the remediation report summary.",
|
|
1031
|
+
stopCondition: "Stop after presenting the remediation report summary and recording run friction (or confirming none).",
|
|
996
1032
|
artifactPaths: {
|
|
997
1033
|
final_report: reportPath,
|
|
1034
|
+
// Surface the run's friction record (resolved through the shared path module).
|
|
1035
|
+
friction_record: closeout.recordPath,
|
|
998
1036
|
},
|
|
999
1037
|
});
|
|
1000
1038
|
}
|
|
@@ -1318,6 +1356,31 @@ Then run:
|
|
|
1318
1356
|
async function handleComplete(root, artifactsDir, state) {
|
|
1319
1357
|
return presentReportStep(root, artifactsDir, state);
|
|
1320
1358
|
}
|
|
1359
|
+
/**
|
|
1360
|
+
* The terminal friction-capture close-out for the remediate half — the exact analog
|
|
1361
|
+
* of audit-code's `decideAuditFrictionCloseout`, sharing the SAME single-sourced shape
|
|
1362
|
+
* + persist helper (`audit-tools/shared`) so the two halves cannot drift. It fires at
|
|
1363
|
+
* the terminal (folded INTO present_report, so it is one bounded step, never an extra
|
|
1364
|
+
* round-trip): on the first terminal pass it persists a degrade-clean zero-friction
|
|
1365
|
+
* record (so it can NEVER block completion); thereafter it is a no-op read returning
|
|
1366
|
+
* "captured" (never re-loops). Deterministic — keyed only off the on-disk record at
|
|
1367
|
+
* `(artifactsDir, runId)`, never host discretion — and never coupled to any repo's
|
|
1368
|
+
* backlog doc.
|
|
1369
|
+
*/
|
|
1370
|
+
export async function decideRemediateFrictionCloseout(artifactsDir, state) {
|
|
1371
|
+
const runId = stateRunId(state);
|
|
1372
|
+
const recordPath = frictionCapturePath(artifactsDir, runId);
|
|
1373
|
+
if (await frictionCaptured(artifactsDir, runId)) {
|
|
1374
|
+
return { action: "captured", recordPath };
|
|
1375
|
+
}
|
|
1376
|
+
await persistFrictionCapture({
|
|
1377
|
+
artifactsDir,
|
|
1378
|
+
runId,
|
|
1379
|
+
tool: "remediate-code",
|
|
1380
|
+
frictions: [],
|
|
1381
|
+
});
|
|
1382
|
+
return { action: "captured_now", recordPath };
|
|
1383
|
+
}
|
|
1321
1384
|
async function handlePendingExtractedPlan(root, artifactsDir, existing, extractedPlan) {
|
|
1322
1385
|
try {
|
|
1323
1386
|
const { plan, sourceFindings, mergeMap } = normalizeExtractedPlan(extractedPlan);
|
|
@@ -1469,12 +1532,42 @@ async function handleWaitingForReviewApproval(root, artifactsDir, request) {
|
|
|
1469
1532
|
* exists the gate consumes it directly and proceeds, so it fires (and halts) at
|
|
1470
1533
|
* most once per run. Empty survivors → nothing to review → approve-none/proceed.
|
|
1471
1534
|
*/
|
|
1472
|
-
async function runReviewApprovalGate(root, artifactsDir, survivors) {
|
|
1535
|
+
async function runReviewApprovalGate(root, artifactsDir, survivors, autonomous = false) {
|
|
1473
1536
|
const decisionPath = reviewDecisionPath(artifactsDir);
|
|
1474
1537
|
// First crossing only: no decision yet AND the pipeline has not started.
|
|
1475
1538
|
const gateOpen = survivors.length > 0 &&
|
|
1476
1539
|
!existsSync(decisionPath) &&
|
|
1477
1540
|
!contractArtifactExists(artifactsDir, "goal_spec");
|
|
1541
|
+
// Autonomous (unattended) mode: the gate NEVER halts. It re-evaluates the
|
|
1542
|
+
// survivors FRESH (no prior-run memory) and auto-approves only tier-safe +
|
|
1543
|
+
// allowlisted-change-kind findings; everything else is left LIVE. Leftovers
|
|
1544
|
+
// are re-emitted as a re-consumable audit deliverable pair (NO durable
|
|
1545
|
+
// rejection — leftovers carry no declined disposition). Idempotent: once
|
|
1546
|
+
// review_decision.json exists it is consumed directly below.
|
|
1547
|
+
if (gateOpen && autonomous) {
|
|
1548
|
+
const auto = buildAutonomousReviewDecision(survivors);
|
|
1549
|
+
const approvedSet = new Set(auto.approved_ids);
|
|
1550
|
+
// Leftovers stay LIVE: declined is EMPTY (no durable rejection). The split
|
|
1551
|
+
// below excludes nothing, so every leftover remains a live finding.
|
|
1552
|
+
const record = {
|
|
1553
|
+
schema_version: REVIEW_DECISION_SCHEMA_VERSION,
|
|
1554
|
+
plan_id: REVIEW_GATE_PLAN_ID,
|
|
1555
|
+
approved_ids: auto.approved_ids,
|
|
1556
|
+
declined: [],
|
|
1557
|
+
created_at: new Date().toISOString(),
|
|
1558
|
+
};
|
|
1559
|
+
await writeJsonFile(decisionPath, record);
|
|
1560
|
+
// Re-emit the leftovers as a standard, re-consumable audit deliverable pair
|
|
1561
|
+
// so the next nightly run picks them up via defaultInputCandidates. Always
|
|
1562
|
+
// on disk regardless of whether a git remote / PR is available.
|
|
1563
|
+
const leftovers = survivors.filter((f) => !approvedSet.has(f.id));
|
|
1564
|
+
await emitAutonomousLeftoverDeliverable(root, artifactsDir, leftovers);
|
|
1565
|
+
return {
|
|
1566
|
+
kind: "proceed",
|
|
1567
|
+
approved: survivors.filter((f) => approvedSet.has(f.id)),
|
|
1568
|
+
declined: [],
|
|
1569
|
+
};
|
|
1570
|
+
}
|
|
1478
1571
|
if (gateOpen) {
|
|
1479
1572
|
const resolutionPath = reviewResolutionPath(artifactsDir);
|
|
1480
1573
|
const requestPath = reviewRequestPath(artifactsDir);
|
|
@@ -1517,6 +1610,35 @@ async function runReviewApprovalGate(root, artifactsDir, survivors) {
|
|
|
1517
1610
|
declined,
|
|
1518
1611
|
};
|
|
1519
1612
|
}
|
|
1613
|
+
/**
|
|
1614
|
+
* Re-emit the autonomous-run leftovers (findings left LIVE, neither auto-fixed
|
|
1615
|
+
* nor durably rejected) as a standard, re-consumable audit deliverable pair:
|
|
1616
|
+
* `audit-findings.json` (machine contract, source of truth) + `audit-report.md`
|
|
1617
|
+
* (human render), built by the SHARED emitter. Written to `<repo>/.audit-tools/`
|
|
1618
|
+
* — exactly where the remediator's `defaultInputCandidates` looks first — so the
|
|
1619
|
+
* next nightly run round-trips them straight back through intake and re-evaluates
|
|
1620
|
+
* the allowlist FRESH. Always on disk regardless of any git remote / PR.
|
|
1621
|
+
*
|
|
1622
|
+
* Empty leftovers still emit an (empty) pair so a downstream "is there work?"
|
|
1623
|
+
* probe sees a deterministic deliverable rather than a stale one.
|
|
1624
|
+
*/
|
|
1625
|
+
async function emitAutonomousLeftoverDeliverable(root, artifactsDir, leftovers) {
|
|
1626
|
+
const pair = buildAuditDeliverablePair(leftovers, {
|
|
1627
|
+
title: "Audit Report — Autonomous Leftovers",
|
|
1628
|
+
intro: "Findings left LIVE by an unattended (autonomous) remediation run: not on the " +
|
|
1629
|
+
"fail-closed non-destructiveness allowlist (or not tier-safe), so not auto-fixed. " +
|
|
1630
|
+
"They carry NO declined disposition — re-run remediation to re-evaluate them.",
|
|
1631
|
+
});
|
|
1632
|
+
// Prefer the canonical `.audit-tools/` location (defaultInputCandidates[0]);
|
|
1633
|
+
// fall back to the artifacts dir's parent when artifactsDir is non-standard.
|
|
1634
|
+
const auditToolsDir = join(root, ".audit-tools");
|
|
1635
|
+
const outDir = existsSync(auditToolsDir) ? auditToolsDir : dirname(artifactsDir);
|
|
1636
|
+
await mkdir(outDir, { recursive: true });
|
|
1637
|
+
await Promise.all([
|
|
1638
|
+
writeJsonFile(join(outDir, "audit-findings.json"), pair.findings_report),
|
|
1639
|
+
writeTextFile(join(outDir, "audit-report.md"), pair.report_markdown),
|
|
1640
|
+
]);
|
|
1641
|
+
}
|
|
1520
1642
|
// ── Path-A filter dispositions (persisted for the coverage ledger) ──────────────
|
|
1521
1643
|
// The single filter pass runs at intake over the ORIGINAL findings; its
|
|
1522
1644
|
// dispositions are persisted here so handlePendingExtractedPlan can build the
|
|
@@ -1538,7 +1660,7 @@ async function persistReviewFilterDispositions(artifactsDir, originals, filter)
|
|
|
1538
1660
|
};
|
|
1539
1661
|
await writeJsonFile(reviewFilterDispositionsPath(artifactsDir), payload);
|
|
1540
1662
|
}
|
|
1541
|
-
async function handleReadyIntakeContractPipeline(root, artifactsDir) {
|
|
1663
|
+
async function handleReadyIntakeContractPipeline(root, artifactsDir, options) {
|
|
1542
1664
|
// Fast path: if an extracted-plan.json already exists (pipeline complete or
|
|
1543
1665
|
// promoted from a previous contract pipeline run), consume it directly without
|
|
1544
1666
|
// requiring intake artifacts. This handles both "plan promoted, ready to
|
|
@@ -1580,7 +1702,7 @@ async function handleReadyIntakeContractPipeline(root, artifactsDir) {
|
|
|
1580
1702
|
checkpoint: checkpoint ?? undefined,
|
|
1581
1703
|
evidenceGrounding: true,
|
|
1582
1704
|
});
|
|
1583
|
-
const gate = await runReviewApprovalGate(root, artifactsDir, filter.survivors);
|
|
1705
|
+
const gate = await runReviewApprovalGate(root, artifactsDir, filter.survivors, resolveAutonomousMode(options ?? {}));
|
|
1584
1706
|
if (gate.kind === "halt") {
|
|
1585
1707
|
return gate.step;
|
|
1586
1708
|
}
|
|
@@ -1646,11 +1768,25 @@ async function handleReadyIntakeContractPipeline(root, artifactsDir) {
|
|
|
1646
1768
|
: source.path);
|
|
1647
1769
|
}
|
|
1648
1770
|
}
|
|
1771
|
+
// Resolve the independent-critic dispatch capability from the SAME handshake
|
|
1772
|
+
// (`resolveHostDispatchCapability`) implement dispatch uses — never a manual
|
|
1773
|
+
// flag. Threaded into the contract pipeline so the adversarial 'critique' /
|
|
1774
|
+
// 'critic' prompts MANDATE an independent sub-agent reviewer when the host can
|
|
1775
|
+
// dispatch one (fail-safe: mandate by default).
|
|
1776
|
+
const sessionConfigForDispatch = options?.sessionConfig ??
|
|
1777
|
+
(await readOptionalJsonFile(join(root, ".remediation-artifacts", "session-config.json"))) ??
|
|
1778
|
+
(await readOptionalJsonFile(join(root, "session-config.json")));
|
|
1779
|
+
const hostCanDispatchSubagents = resolveHostDispatchCapability({
|
|
1780
|
+
hostCanDispatchSubagents: options?.hostCanDispatchSubagents,
|
|
1781
|
+
sessionConfig: sessionConfigForDispatch,
|
|
1782
|
+
});
|
|
1649
1783
|
const step = await buildNextContractPipelineStep({
|
|
1650
1784
|
root,
|
|
1651
1785
|
artifactsDir,
|
|
1652
1786
|
runId: randomRunId("CONTRACT"),
|
|
1653
1787
|
sourcePaths: [...sourcePaths],
|
|
1788
|
+
sessionConfig: sessionConfigForDispatch,
|
|
1789
|
+
hostCanDispatchSubagents,
|
|
1654
1790
|
});
|
|
1655
1791
|
if (step) {
|
|
1656
1792
|
return step;
|
|
@@ -1668,7 +1804,7 @@ async function handlePendingIntake(root, artifactsDir, options) {
|
|
|
1668
1804
|
// full intake artifact set is no longer present.
|
|
1669
1805
|
const earlyExtractedPlan = await readExtractedPlanIfPresent(artifactsDir);
|
|
1670
1806
|
if (earlyExtractedPlan) {
|
|
1671
|
-
return handleReadyIntakeContractPipeline(root, artifactsDir);
|
|
1807
|
+
return handleReadyIntakeContractPipeline(root, artifactsDir, options);
|
|
1672
1808
|
}
|
|
1673
1809
|
const inputResolution = resolveInputPaths(root, options.input);
|
|
1674
1810
|
const intakeResult = await resolveIntakeStep({
|
|
@@ -1686,7 +1822,7 @@ async function handlePendingIntake(root, artifactsDir, options) {
|
|
|
1686
1822
|
return intakeResult.step;
|
|
1687
1823
|
}
|
|
1688
1824
|
// Intake is complete — route both paths through the contract pipeline.
|
|
1689
|
-
return handleReadyIntakeContractPipeline(root, artifactsDir);
|
|
1825
|
+
return handleReadyIntakeContractPipeline(root, artifactsDir, options);
|
|
1690
1826
|
}
|
|
1691
1827
|
async function handleNoState(root, artifactsDir) {
|
|
1692
1828
|
const paths = intakePaths(artifactsDir);
|