audit-tools 0.32.20 → 0.32.23
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 +10 -4
- package/dist/audit/clarification/blastRadius.d.ts +23 -0
- package/dist/audit/clarification/blastRadius.d.ts.map +1 -0
- package/dist/audit/clarification/blastRadius.js +65 -0
- package/dist/audit/clarification/blastRadius.js.map +1 -0
- package/dist/audit/clarification/dials.d.ts +28 -0
- package/dist/audit/clarification/dials.d.ts.map +1 -0
- package/dist/audit/clarification/dials.js +37 -0
- package/dist/audit/clarification/dials.js.map +1 -0
- package/dist/audit/clarification/partition.d.ts +25 -0
- package/dist/audit/clarification/partition.d.ts.map +1 -0
- package/dist/audit/clarification/partition.js +77 -0
- package/dist/audit/clarification/partition.js.map +1 -0
- package/dist/audit/clarification/riskGate.d.ts +24 -0
- package/dist/audit/clarification/riskGate.d.ts.map +1 -0
- package/dist/audit/clarification/riskGate.js +38 -0
- package/dist/audit/clarification/riskGate.js.map +1 -0
- package/dist/audit/clarification/voiQueue.d.ts +17 -0
- package/dist/audit/clarification/voiQueue.d.ts.map +1 -0
- package/dist/audit/clarification/voiQueue.js +37 -0
- package/dist/audit/clarification/voiQueue.js.map +1 -0
- package/dist/audit/cli/auditStep.d.ts +2 -0
- package/dist/audit/cli/auditStep.d.ts.map +1 -1
- package/dist/audit/cli/auditStep.js +9 -1
- package/dist/audit/cli/auditStep.js.map +1 -1
- package/dist/audit/cli/charterClarificationPrompt.d.ts +19 -0
- package/dist/audit/cli/charterClarificationPrompt.d.ts.map +1 -0
- package/dist/audit/cli/charterClarificationPrompt.js +60 -0
- package/dist/audit/cli/charterClarificationPrompt.js.map +1 -0
- package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
- package/dist/audit/cli/nextStepCommand.js +74 -0
- package/dist/audit/cli/nextStepCommand.js.map +1 -1
- package/dist/audit/cli/nextStepHelpers.d.ts +108 -0
- package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
- package/dist/audit/cli/nextStepHelpers.js +131 -1
- package/dist/audit/cli/nextStepHelpers.js.map +1 -1
- package/dist/audit/cli/steps.d.ts +4 -4
- package/dist/audit/cli/steps.d.ts.map +1 -1
- package/dist/audit/cli/steps.js +2 -0
- package/dist/audit/cli/steps.js.map +1 -1
- package/dist/audit/io/artifacts.d.ts +6 -0
- package/dist/audit/io/artifacts.d.ts.map +1 -1
- package/dist/audit/io/artifacts.js +2 -0
- package/dist/audit/io/artifacts.js.map +1 -1
- package/dist/audit/orchestrator/advance.d.ts +23 -0
- package/dist/audit/orchestrator/advance.d.ts.map +1 -1
- package/dist/audit/orchestrator/advance.js +122 -4
- package/dist/audit/orchestrator/advance.js.map +1 -1
- package/dist/audit/orchestrator/advanceTypes.d.ts +22 -1
- package/dist/audit/orchestrator/advanceTypes.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterClarificationExecutor.d.ts +28 -0
- package/dist/audit/orchestrator/charterClarificationExecutor.d.ts.map +1 -0
- package/dist/audit/orchestrator/charterClarificationExecutor.js +130 -0
- package/dist/audit/orchestrator/charterClarificationExecutor.js.map +1 -0
- package/dist/audit/orchestrator/dependencyMap.d.ts +2 -0
- package/dist/audit/orchestrator/dependencyMap.d.ts.map +1 -1
- package/dist/audit/orchestrator/dependencyMap.js +24 -0
- package/dist/audit/orchestrator/dependencyMap.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 +50 -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 +4 -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 +20 -0
- package/dist/audit/orchestrator/executors.js.map +1 -1
- package/dist/audit/orchestrator/nextStep.d.ts +11 -1
- package/dist/audit/orchestrator/nextStep.d.ts.map +1 -1
- package/dist/audit/orchestrator/nextStep.js +6 -2
- package/dist/audit/orchestrator/nextStep.js.map +1 -1
- package/dist/audit/orchestrator/staleness.d.ts +27 -1
- package/dist/audit/orchestrator/staleness.d.ts.map +1 -1
- package/dist/audit/orchestrator/staleness.js +33 -16
- package/dist/audit/orchestrator/staleness.js.map +1 -1
- package/dist/audit/orchestrator/state.d.ts +12 -1
- package/dist/audit/orchestrator/state.d.ts.map +1 -1
- package/dist/audit/orchestrator/state.js +41 -2
- package/dist/audit/orchestrator/state.js.map +1 -1
- package/dist/audit/orchestrator/synthesisExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/synthesisExecutors.js +1 -0
- package/dist/audit/orchestrator/synthesisExecutors.js.map +1 -1
- package/dist/audit/orchestrator/systemicChallengeExecutor.d.ts +25 -0
- package/dist/audit/orchestrator/systemicChallengeExecutor.d.ts.map +1 -0
- package/dist/audit/orchestrator/systemicChallengeExecutor.js +107 -0
- package/dist/audit/orchestrator/systemicChallengeExecutor.js.map +1 -0
- package/dist/audit/reporting/mergeFindings.d.ts +2 -1
- package/dist/audit/reporting/mergeFindings.d.ts.map +1 -1
- package/dist/audit/reporting/mergeFindings.js +6 -1
- package/dist/audit/reporting/mergeFindings.js.map +1 -1
- package/dist/audit/reporting/synthesis.d.ts +2 -0
- package/dist/audit/reporting/synthesis.d.ts.map +1 -1
- package/dist/audit/reporting/synthesis.js +1 -1
- package/dist/audit/reporting/synthesis.js.map +1 -1
- package/dist/audit/systemic/aggregateMetricsDigest.d.ts +11 -0
- package/dist/audit/systemic/aggregateMetricsDigest.d.ts.map +1 -0
- package/dist/audit/systemic/aggregateMetricsDigest.js +84 -0
- package/dist/audit/systemic/aggregateMetricsDigest.js.map +1 -0
- package/dist/audit/systemic/metricsDigestTypes.d.ts +35 -0
- package/dist/audit/systemic/metricsDigestTypes.d.ts.map +1 -0
- package/dist/audit/systemic/metricsDigestTypes.js +10 -0
- package/dist/audit/systemic/metricsDigestTypes.js.map +1 -0
- package/dist/audit/systemic/secondOrderAdversaryPrompt.d.ts +16 -0
- package/dist/audit/systemic/secondOrderAdversaryPrompt.d.ts.map +1 -0
- package/dist/audit/systemic/secondOrderAdversaryPrompt.js +85 -0
- package/dist/audit/systemic/secondOrderAdversaryPrompt.js.map +1 -0
- package/dist/audit/systemic/systemicChallengeLoop.d.ts +48 -0
- package/dist/audit/systemic/systemicChallengeLoop.d.ts.map +1 -0
- package/dist/audit/systemic/systemicChallengeLoop.js +107 -0
- package/dist/audit/systemic/systemicChallengeLoop.js.map +1 -0
- package/dist/audit/types/charterClarification.d.ts +52 -0
- package/dist/audit/types/charterClarification.d.ts.map +1 -0
- package/dist/audit/types/charterClarification.js +2 -0
- package/dist/audit/types/charterClarification.js.map +1 -0
- package/dist/audit/types/systemicChallenge.d.ts +69 -0
- package/dist/audit/types/systemicChallenge.d.ts.map +1 -0
- package/dist/audit/types/systemicChallenge.js +2 -0
- package/dist/audit/types/systemicChallenge.js.map +1 -0
- package/dist/remediate/steps/dispatch/acceptNode.d.ts +178 -0
- package/dist/remediate/steps/dispatch/acceptNode.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/acceptNode.js +351 -0
- package/dist/remediate/steps/dispatch/acceptNode.js.map +1 -0
- package/dist/remediate/steps/dispatch/common.d.ts +123 -0
- package/dist/remediate/steps/dispatch/common.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/common.js +236 -0
- package/dist/remediate/steps/dispatch/common.js.map +1 -0
- package/dist/remediate/steps/dispatch/dagNodeFields.d.ts +37 -0
- package/dist/remediate/steps/dispatch/dagNodeFields.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/dagNodeFields.js +19 -0
- package/dist/remediate/steps/dispatch/dagNodeFields.js.map +1 -0
- package/dist/remediate/steps/dispatch/implementPrompt.d.ts +70 -0
- package/dist/remediate/steps/dispatch/implementPrompt.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/implementPrompt.js +577 -0
- package/dist/remediate/steps/dispatch/implementPrompt.js.map +1 -0
- package/dist/remediate/steps/dispatch/marshal.d.ts +32 -0
- package/dist/remediate/steps/dispatch/marshal.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/marshal.js +935 -0
- package/dist/remediate/steps/dispatch/marshal.js.map +1 -0
- package/dist/remediate/steps/dispatch/verifyCommands.d.ts +97 -0
- package/dist/remediate/steps/dispatch/verifyCommands.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/verifyCommands.js +204 -0
- package/dist/remediate/steps/dispatch/verifyCommands.js.map +1 -0
- package/dist/remediate/steps/dispatch/waveScheduling.d.ts +90 -0
- package/dist/remediate/steps/dispatch/waveScheduling.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/waveScheduling.js +352 -0
- package/dist/remediate/steps/dispatch/waveScheduling.js.map +1 -0
- package/dist/remediate/steps/dispatch/worktreeLifecycle.d.ts +189 -0
- package/dist/remediate/steps/dispatch/worktreeLifecycle.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/worktreeLifecycle.js +643 -0
- package/dist/remediate/steps/dispatch/worktreeLifecycle.js.map +1 -0
- package/dist/remediate/steps/dispatch/writeScope.d.ts +151 -0
- package/dist/remediate/steps/dispatch/writeScope.d.ts.map +1 -0
- package/dist/remediate/steps/dispatch/writeScope.js +376 -0
- package/dist/remediate/steps/dispatch/writeScope.js.map +1 -0
- package/dist/remediate/steps/dispatch.d.ts +16 -871
- package/dist/remediate/steps/dispatch.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch.js +18 -3623
- package/dist/remediate/steps/dispatch.js.map +1 -1
- package/dist/shared/decompose/charterClarification.d.ts +80 -0
- package/dist/shared/decompose/charterClarification.d.ts.map +1 -0
- package/dist/shared/decompose/charterClarification.js +105 -0
- package/dist/shared/decompose/charterClarification.js.map +1 -0
- package/dist/shared/decompose/systemicChallenge.d.ts +326 -0
- package/dist/shared/decompose/systemicChallenge.d.ts.map +1 -0
- package/dist/shared/decompose/systemicChallenge.js +30 -0
- package/dist/shared/decompose/systemicChallenge.js.map +1 -0
- package/dist/shared/index.d.ts +10 -5
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +6 -4
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/opencodePermissions.d.ts +73 -0
- package/dist/shared/opencodePermissions.d.ts.map +1 -1
- package/dist/shared/opencodePermissions.js +172 -0
- package/dist/shared/opencodePermissions.js.map +1 -1
- package/dist/shared/tooling/exec.d.ts +10 -1
- package/dist/shared/tooling/exec.d.ts.map +1 -1
- package/dist/shared/tooling/exec.js +13 -1
- package/dist/shared/tooling/exec.js.map +1 -1
- package/dist/shared/types/charter.d.ts +89 -0
- package/dist/shared/types/charter.d.ts.map +1 -1
- package/dist/shared/types/charter.js +68 -0
- package/dist/shared/types/charter.js.map +1 -1
- package/dist/shared/types/intentCheckpoint.d.ts +15 -0
- package/dist/shared/types/intentCheckpoint.d.ts.map +1 -1
- package/dist/shared/types/intentCheckpoint.js +11 -0
- package/dist/shared/types/intentCheckpoint.js.map +1 -1
- package/dist/shared/validation/charterGate.d.ts +20 -1
- package/dist/shared/validation/charterGate.d.ts.map +1 -1
- package/dist/shared/validation/charterGate.js +23 -0
- package/dist/shared/validation/charterGate.js.map +1 -1
- package/docs/audit-pkg/operator-guide.md +84 -0
- package/opencode.json +36 -20
- package/package.json +1 -1
- package/scripts/postinstall.mjs +2 -1
- package/wrapper/audit-code-wrapper-opencode.mjs +38 -12
- package/wrapper/remediate-code-wrapper-opencode.mjs +38 -12
|
@@ -132,6 +132,17 @@ export const IntentCheckpointSchema = z
|
|
|
132
132
|
goal_graph: GoalGraphSchema.optional(),
|
|
133
133
|
charters: z.array(CharterSchema).optional(),
|
|
134
134
|
ceiling: CeilingSchema.optional(),
|
|
135
|
+
/**
|
|
136
|
+
* The ATTENTION dial (Phase D control surface, currency #3) — how much the
|
|
137
|
+
* user will converse to align the charters: how many VOI-ranked
|
|
138
|
+
* charter-clarification questions they answer this round. `0` is the
|
|
139
|
+
* autonomous mode (every charter-delta becomes a written finding, nothing
|
|
140
|
+
* interactive); a finite N takes the top-N of the VOI queue; `"all"` takes
|
|
141
|
+
* every interactive question. Attended and unattended are two settings of
|
|
142
|
+
* ONE dial, not a forked path. Optional + additive; defaults to `0`
|
|
143
|
+
* (conversation-first: no human loop unless the user opts in).
|
|
144
|
+
*/
|
|
145
|
+
attention: z.union([z.number().int().min(0), z.literal("all")]).optional(),
|
|
135
146
|
})
|
|
136
147
|
.strict()
|
|
137
148
|
.optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intentCheckpoint.js","sourceRoot":"","sources":["../../../src/shared/types/intentCheckpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,aAAa,EACb,aAAa,EACb,eAAe,GAChB,MAAM,cAAc,CAAC;AAEtB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC;KACpC,MAAM,CAAC;IACN,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC;IACjD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB;;;;OAIG;IACH,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,yDAAyD;IACzD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,wEAAwE;IACxE,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B;;;;OAIG;IACH,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,qEAAqE;IACrE,cAAc,EAAE,CAAC;SACd,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAA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AAE;QAC3C,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE;QACjC;;;;;;;;;WASG;QACH,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;KAC3E,CAAC;SACD,MAAM,EAAE;SACR,QAAQ,EAAE;CACd,CAAC;KACD,MAAM,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Charter, CharterDelta } from "../types/charter.js";
|
|
1
|
+
import type { Charter, CharterDelta, CharterClarificationRequest } from "../types/charter.js";
|
|
2
2
|
/**
|
|
3
3
|
* The True-charter gate: a `true` charter is nominatable-never-assertable and
|
|
4
4
|
* falsifiable-or-drop. It survives ONLY if it names BOTH a concrete alternative and
|
|
@@ -35,4 +35,23 @@ export declare function charterReviewDisposition(charter: Charter): "opine" | "f
|
|
|
35
35
|
* of those kinds; a low-confidence charter of a referenced kind trips the downgrade.
|
|
36
36
|
*/
|
|
37
37
|
export declare function gateCharterDelta(delta: CharterDelta, charters: Charter[]): CharterDelta;
|
|
38
|
+
/**
|
|
39
|
+
* The blast-radius RISK GATE (Phase D; design §"Blast radius — the ranking and the
|
|
40
|
+
* risk gate"). Blast radius is simultaneously priority (high-blast = high-value)
|
|
41
|
+
* AND risk: acting on a WRONG high-blast finding is catastrophic, so it must clear
|
|
42
|
+
* a MUCH higher bar of independent adversarial refutation before it is actionable.
|
|
43
|
+
* This gate is the deterministic side of that bar: a question whose blast radius is
|
|
44
|
+
* at/above `highBlastThreshold` may only reach the interactive human channel if it
|
|
45
|
+
* has cleared `requiredRefutations` rounds of independent refutation; otherwise it
|
|
46
|
+
* is downgraded to `finding_only` (written as a lead, never asked interactively).
|
|
47
|
+
* Below the threshold, a question is interactive without the extra bar.
|
|
48
|
+
*
|
|
49
|
+
* Pure + deterministic: same request + same observed refutation count always
|
|
50
|
+
* yields the same disposition. `observedRefutations` is supplied by the caller (the
|
|
51
|
+
* intensity dial's adversarial rounds); the gate never runs the refutation itself.
|
|
52
|
+
*/
|
|
53
|
+
export declare function riskGateClarification(request: CharterClarificationRequest, observedRefutations: number, opts: {
|
|
54
|
+
highBlastThreshold: number;
|
|
55
|
+
requiredRefutations: number;
|
|
56
|
+
}): CharterClarificationRequest["disposition"];
|
|
38
57
|
//# sourceMappingURL=charterGate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charterGate.d.ts","sourceRoot":"","sources":["../../../src/shared/validation/charterGate.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"charterGate.d.ts","sourceRoot":"","sources":["../../../src/shared/validation/charterGate.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,OAAO,EACP,YAAY,EACZ,2BAA2B,EAC5B,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG;IACzD,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,OAAO,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxD,CA0BA;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,GACf,OAAO,GAAG,gBAAgB,CAE5B;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,OAAO,EAAE,GAClB,YAAY,CAWd;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,2BAA2B,EACpC,mBAAmB,EAAE,MAAM,EAC3B,IAAI,EAAE;IAAE,kBAAkB,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAA;CAAE,GAChE,2BAA2B,CAAC,aAAa,CAAC,CAM5C"}
|
|
@@ -70,4 +70,27 @@ export function gateCharterDelta(delta, charters) {
|
|
|
70
70
|
}
|
|
71
71
|
return delta;
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* The blast-radius RISK GATE (Phase D; design §"Blast radius — the ranking and the
|
|
75
|
+
* risk gate"). Blast radius is simultaneously priority (high-blast = high-value)
|
|
76
|
+
* AND risk: acting on a WRONG high-blast finding is catastrophic, so it must clear
|
|
77
|
+
* a MUCH higher bar of independent adversarial refutation before it is actionable.
|
|
78
|
+
* This gate is the deterministic side of that bar: a question whose blast radius is
|
|
79
|
+
* at/above `highBlastThreshold` may only reach the interactive human channel if it
|
|
80
|
+
* has cleared `requiredRefutations` rounds of independent refutation; otherwise it
|
|
81
|
+
* is downgraded to `finding_only` (written as a lead, never asked interactively).
|
|
82
|
+
* Below the threshold, a question is interactive without the extra bar.
|
|
83
|
+
*
|
|
84
|
+
* Pure + deterministic: same request + same observed refutation count always
|
|
85
|
+
* yields the same disposition. `observedRefutations` is supplied by the caller (the
|
|
86
|
+
* intensity dial's adversarial rounds); the gate never runs the refutation itself.
|
|
87
|
+
*/
|
|
88
|
+
export function riskGateClarification(request, observedRefutations, opts) {
|
|
89
|
+
const isHighBlast = request.value.blast_radius >= opts.highBlastThreshold;
|
|
90
|
+
if (!isHighBlast)
|
|
91
|
+
return "interactive";
|
|
92
|
+
return observedRefutations >= opts.requiredRefutations
|
|
93
|
+
? "interactive"
|
|
94
|
+
: "finding_only";
|
|
95
|
+
}
|
|
73
96
|
//# sourceMappingURL=charterGate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charterGate.js","sourceRoot":"","sources":["../../../src/shared/validation/charterGate.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,mFAAmF;AACnF,mFAAmF;AACnF,oFAAoF;AACpF,gFAAgF;
|
|
1
|
+
{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;AACH,MAAM,UAAU,wBAAwB,CACtC,OAAgB;IAEhB,OAAO,OAAO,CAAC,UAAU,KAAK,KAAK,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC;AACnE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAmB,EACnB,QAAmB;IAEnB,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CACpC,CAAC,OAAO,EAAE,EAAE,CACV,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;QACjC,wBAAwB,CAAC,OAAO,CAAC,KAAK,gBAAgB,CACzD,CAAC;IACF,IAAI,gBAAgB,IAAI,KAAK,CAAC,SAAS,KAAK,OAAO,EAAE,CAAC;QACpD,OAAO,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;IAC1C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAAoC,EACpC,mBAA2B,EAC3B,IAAiE;IAEjE,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,YAAY,IAAI,IAAI,CAAC,kBAAkB,CAAC;IAC1E,IAAI,CAAC,WAAW;QAAE,OAAO,aAAa,CAAC;IACvC,OAAO,mBAAmB,IAAI,IAAI,CAAC,mBAAmB;QACpD,CAAC,CAAC,aAAa;QACf,CAAC,CAAC,cAAc,CAAC;AACrB,CAAC"}
|
|
@@ -175,6 +175,90 @@ Use `ui_mode: "visible"` when debugging provider stdout/stderr. Use
|
|
|
175
175
|
`subprocess-template` or `vscode-task` only when you have a reliable launcher
|
|
176
176
|
bridge.
|
|
177
177
|
|
|
178
|
+
## Gate-0 provider confirmation
|
|
179
|
+
|
|
180
|
+
The first thing an interactive audit run does — before it reads the repo — is
|
|
181
|
+
pause on a **provider confirmation** step (Gate-0). The tool auto-detects the
|
|
182
|
+
provider pool it can dispatch to, prices each candidate, and proposes a cost
|
|
183
|
+
ordering (cheapest capable first). You confirm, reorder, or amend it. The
|
|
184
|
+
mechanism behind the ordering is documented in
|
|
185
|
+
[`spec/cost-first-routing.md`](../../spec/cost-first-routing.md); this section is
|
|
186
|
+
only how to respond to the step.
|
|
187
|
+
|
|
188
|
+
### When it fires
|
|
189
|
+
|
|
190
|
+
- On the conversation/CLI path (`audit-code next-step`) it fires on **every** run,
|
|
191
|
+
even when only one — or zero — providers were auto-detected, so you can reorder,
|
|
192
|
+
exclude, self-report your own model roster, or add a provider that discovery missed.
|
|
193
|
+
- Headless (`audit-code advance-audit`, no interactive host) it auto-completes with
|
|
194
|
+
the tool's price-ascending suggestion and never pauses.
|
|
195
|
+
|
|
196
|
+
### How to respond
|
|
197
|
+
|
|
198
|
+
The step prints the suggested pool as a priced table and asks you to write your
|
|
199
|
+
decision to:
|
|
200
|
+
|
|
201
|
+
```text
|
|
202
|
+
.audit-tools/audit/provider-confirmation.input.json
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**Writing that file is what lets the run proceed** — its presence is the "operator
|
|
206
|
+
has acted" signal. To accept the suggestion verbatim, write just the version:
|
|
207
|
+
|
|
208
|
+
```json
|
|
209
|
+
{ "schema_version": "provider-confirmation-input/v1" }
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Every other field is optional:
|
|
213
|
+
|
|
214
|
+
```json
|
|
215
|
+
{
|
|
216
|
+
"schema_version": "provider-confirmation-input/v1",
|
|
217
|
+
"cost_order": ["<provider-or-model-key>", "..."],
|
|
218
|
+
"exclude": ["<provider-name>"],
|
|
219
|
+
"include": ["<self-spawn-blocked provider to opt back in>"],
|
|
220
|
+
"host_models": [{ "model_id": "<your model id>", "tier": "frontier|capable|fast" }]
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
- `cost_order` — the confirmed ordering, cheapest first, as a list of keys. A key
|
|
225
|
+
is either a **provider name** (as shown in the table) or a **host `model_id`** you
|
|
226
|
+
report in `host_models`. Keys you omit keep their suggested relative order,
|
|
227
|
+
appended after the ones you name; unrecognized keys are ignored. Omit it to accept
|
|
228
|
+
the suggested order.
|
|
229
|
+
- `exclude` — drops a provider from the dispatchable pool.
|
|
230
|
+
- `include` — opts a self-spawn-blocked provider back in. A CLI provider detected
|
|
231
|
+
while you are already inside a session of that same agent (`claude-code` under
|
|
232
|
+
`CLAUDECODE`, `codex` under `CODEX`) is excluded by default so the run can't
|
|
233
|
+
self-spawn a fresh agent; naming it here overrides that. Advanced — normally leave
|
|
234
|
+
it excluded.
|
|
235
|
+
- `host_models` — reports your own (the host agent's) model roster so those tiers
|
|
236
|
+
are priced from the models.dev dataset and orderable here, not just at dispatch.
|
|
237
|
+
|
|
238
|
+
You supply only ordering intent plus your model roster. The tool owns the prices,
|
|
239
|
+
the capability flags, and the roster snapshot — you never hand-author those. If a
|
|
240
|
+
provider you use isn't listed, it wasn't auto-detected: add its config to
|
|
241
|
+
`session-config.json` (an OpenAI-compatible endpoint via
|
|
242
|
+
`openai_compatible.{base_url,model,api_key_env}`, or a CLI backend via its
|
|
243
|
+
`<name>.command`) and re-run the step.
|
|
244
|
+
|
|
245
|
+
Once the input is written, re-run the continue command the step printed
|
|
246
|
+
(`audit-code next-step`). The tool consumes the input and promotes it into both
|
|
247
|
+
canonical artifacts: the per-tool `provider_confirmation.json` seam and the shared
|
|
248
|
+
`.audit-tools/provider-confirmation.json`.
|
|
249
|
+
|
|
250
|
+
### The confirmed pool persists — you aren't re-prompted
|
|
251
|
+
|
|
252
|
+
The shared `.audit-tools/provider-confirmation.json` is written once and reused for
|
|
253
|
+
the rest of the audit→remediate session. A later step, and a subsequent
|
|
254
|
+
`remediate-code` run against the same repo, read and honor that pool without
|
|
255
|
+
prompting again — `remediate-code` has no confirmation step of its own; it consumes
|
|
256
|
+
the audit-side pool. You are only re-prompted if the discovered provider roster
|
|
257
|
+
changes (a provider appears or disappears since it was confirmed), which forces a
|
|
258
|
+
fresh confirmation so a vanished provider is never pinned. If the file is absent
|
|
259
|
+
(for example a standalone remediate run with no prior audit), the run resolves its
|
|
260
|
+
provider independently — absence is never an error.
|
|
261
|
+
|
|
178
262
|
## Model selection
|
|
179
263
|
|
|
180
264
|
Conversation-level model choice belongs to the host conversation. The backend
|
package/opencode.json
CHANGED
|
@@ -25,37 +25,53 @@
|
|
|
25
25
|
},
|
|
26
26
|
"bash": {
|
|
27
27
|
"*": "allow",
|
|
28
|
-
"audit-code
|
|
29
|
-
"*dist*index.js* synthesize*": "deny",
|
|
30
|
-
"*audit-code.mjs* synthesize*": "deny",
|
|
31
|
-
"audit-code cleanup*": "deny",
|
|
32
|
-
"*dist*index.js* cleanup*": "deny",
|
|
28
|
+
"*audit-code.mjs": "allow",
|
|
33
29
|
"*audit-code.mjs* cleanup*": "deny",
|
|
34
|
-
"audit-code
|
|
35
|
-
"*
|
|
30
|
+
"*audit-code.mjs* ensure*": "allow",
|
|
31
|
+
"*audit-code.mjs* ingest-results*": "deny",
|
|
32
|
+
"*audit-code.mjs* merge-and-ingest*": "allow",
|
|
33
|
+
"*audit-code.mjs* next-step*": "allow",
|
|
34
|
+
"*audit-code.mjs* prepare-dispatch*": "allow",
|
|
36
35
|
"*audit-code.mjs* requeue*": "deny",
|
|
37
|
-
"audit-code
|
|
36
|
+
"*audit-code.mjs* submit-packet*": "allow",
|
|
37
|
+
"*audit-code.mjs* synthesize*": "deny",
|
|
38
|
+
"*audit-code.mjs* validate*": "allow",
|
|
39
|
+
"*audit-code.mjs* worker-run*": "allow",
|
|
40
|
+
"*dist*index.js* cleanup*": "deny",
|
|
38
41
|
"*dist*index.js* ingest-results*": "deny",
|
|
39
|
-
"*
|
|
42
|
+
"*dist*index.js* requeue*": "deny",
|
|
43
|
+
"*dist*index.js* synthesize*": "deny",
|
|
44
|
+
"*remediate-code.mjs": "allow",
|
|
45
|
+
"*remediate-code.mjs* ensure*": "allow",
|
|
46
|
+
"*remediate-code.mjs* merge-document-results*": "allow",
|
|
47
|
+
"*remediate-code.mjs* merge-implement-results*": "allow",
|
|
48
|
+
"*remediate-code.mjs* next-step*": "allow",
|
|
49
|
+
"*remediate-code.mjs* prepare-document-dispatch*": "allow",
|
|
50
|
+
"*remediate-code.mjs* prepare-implement-dispatch*": "allow",
|
|
51
|
+
"*remediate-code.mjs* validate-artifacts*": "allow",
|
|
52
|
+
"Select-String *": "allow",
|
|
40
53
|
"audit-code": "allow",
|
|
54
|
+
"audit-code cleanup*": "deny",
|
|
41
55
|
"audit-code ensure*": "allow",
|
|
42
|
-
"
|
|
56
|
+
"audit-code ingest-results*": "deny",
|
|
57
|
+
"audit-code merge-and-ingest*": "allow",
|
|
43
58
|
"audit-code next-step*": "allow",
|
|
44
|
-
"*audit-code.mjs* next-step*": "allow",
|
|
45
59
|
"audit-code prepare-dispatch*": "allow",
|
|
46
|
-
"
|
|
60
|
+
"audit-code requeue*": "deny",
|
|
47
61
|
"audit-code submit-packet*": "allow",
|
|
48
|
-
"
|
|
49
|
-
"audit-code merge-and-ingest*": "allow",
|
|
50
|
-
"*audit-code.mjs* merge-and-ingest*": "allow",
|
|
62
|
+
"audit-code synthesize*": "deny",
|
|
51
63
|
"audit-code validate*": "allow",
|
|
52
|
-
"*audit-code.mjs* validate*": "allow",
|
|
53
|
-
"*audit-code.mjs": "allow",
|
|
54
|
-
"*audit-code.mjs* worker-run*": "allow",
|
|
55
|
-
"git status*": "allow",
|
|
56
64
|
"git diff*": "allow",
|
|
65
|
+
"git status*": "allow",
|
|
57
66
|
"grep *": "allow",
|
|
58
|
-
"
|
|
67
|
+
"remediate-code": "allow",
|
|
68
|
+
"remediate-code ensure*": "allow",
|
|
69
|
+
"remediate-code merge-document-results*": "allow",
|
|
70
|
+
"remediate-code merge-implement-results*": "allow",
|
|
71
|
+
"remediate-code next-step*": "allow",
|
|
72
|
+
"remediate-code prepare-document-dispatch*": "allow",
|
|
73
|
+
"remediate-code prepare-implement-dispatch*": "allow",
|
|
74
|
+
"remediate-code validate-artifacts*": "allow",
|
|
59
75
|
"rm *": "deny"
|
|
60
76
|
}
|
|
61
77
|
},
|
package/package.json
CHANGED
package/scripts/postinstall.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import { fileURLToPath } from "node:url";
|
|
|
13
13
|
let failed = false;
|
|
14
14
|
for (const script of ["./audit/postinstall.mjs", "./remediate/postinstall.mjs"]) {
|
|
15
15
|
const scriptPath = fileURLToPath(new URL(script, import.meta.url));
|
|
16
|
-
const result = spawnSync(process.execPath, [scriptPath], { stdio: "inherit" });
|
|
16
|
+
const result = spawnSync(process.execPath, [scriptPath], { stdio: "inherit", windowsHide: true });
|
|
17
17
|
if (result.error) {
|
|
18
18
|
console.warn(`[audit-tools] postinstall: ${script} could not run (${result.error.message}).`);
|
|
19
19
|
failed = true;
|
|
@@ -85,6 +85,7 @@ function runGhRepoVisibility(repoRoot) {
|
|
|
85
85
|
cwd: repoRoot,
|
|
86
86
|
encoding: "utf8",
|
|
87
87
|
shell: process.platform === "win32",
|
|
88
|
+
windowsHide: true,
|
|
88
89
|
});
|
|
89
90
|
if (result.error || (result.status ?? 0) !== 0) return null;
|
|
90
91
|
return typeof result.stdout === "string" ? result.stdout : null;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
let mergeOpenCodeAgentPermissionRule;
|
|
5
5
|
let withoutOpenCodeWildcard;
|
|
6
6
|
let migrateOpenCodeGlobalExternalDirectory;
|
|
7
|
+
let composeOpenCodeBashCeiling;
|
|
7
8
|
export let sharedOpenCodePermissions = false;
|
|
8
9
|
|
|
9
10
|
try {
|
|
@@ -11,6 +12,7 @@ try {
|
|
|
11
12
|
mergeOpenCodeAgentPermissionRule = shared.mergeOpenCodeAgentPermissionRule;
|
|
12
13
|
withoutOpenCodeWildcard = shared.withoutOpenCodeWildcard;
|
|
13
14
|
migrateOpenCodeGlobalExternalDirectory = shared.migrateOpenCodeGlobalExternalDirectory;
|
|
15
|
+
composeOpenCodeBashCeiling = shared.composeOpenCodeBashCeiling;
|
|
14
16
|
sharedOpenCodePermissions = true;
|
|
15
17
|
} catch {
|
|
16
18
|
// shared not yet built — callers that need merge logic will throw below
|
|
@@ -208,6 +210,19 @@ function mergePermissionBlock(existingPermission, generatedPermission) {
|
|
|
208
210
|
};
|
|
209
211
|
}
|
|
210
212
|
|
|
213
|
+
// Collect every agent's bash rule set from a merged agent map (in stable,
|
|
214
|
+
// key-sorted order) so the top-level ceiling is a deterministic union over all
|
|
215
|
+
// present agents — auditor, remediator, or any future agent — not just the one
|
|
216
|
+
// this installer owns. This is what makes the two installers mutually
|
|
217
|
+
// key-aware: whichever one runs unions the block the other already wrote.
|
|
218
|
+
function collectAgentBashRuleSets(agentMap) {
|
|
219
|
+
const agents = objectValue(agentMap);
|
|
220
|
+
return Object.keys(agents)
|
|
221
|
+
.sort()
|
|
222
|
+
.map((name) => objectValue(objectValue(agents[name]).permission).bash)
|
|
223
|
+
.filter((bash) => bash && typeof bash === 'object' && !Array.isArray(bash));
|
|
224
|
+
}
|
|
225
|
+
|
|
211
226
|
export function buildMergedOpenCodeProjectConfig(existing, root) {
|
|
212
227
|
if (!sharedOpenCodePermissions) {
|
|
213
228
|
throw new Error(
|
|
@@ -218,22 +233,33 @@ export function buildMergedOpenCodeProjectConfig(existing, root) {
|
|
|
218
233
|
const mergedMcp = objectValue(existing.mcp);
|
|
219
234
|
delete mergedMcp.auditor;
|
|
220
235
|
const existingAuditor = objectValue(objectValue(existing.agent).auditor);
|
|
236
|
+
const mergedAgent = {
|
|
237
|
+
...objectValue(existing.agent),
|
|
238
|
+
auditor: {
|
|
239
|
+
...existingAuditor,
|
|
240
|
+
...generated.agent.auditor,
|
|
241
|
+
permission: mergePermissionBlock(
|
|
242
|
+
existingAuditor.permission,
|
|
243
|
+
generated.agent.auditor.permission,
|
|
244
|
+
),
|
|
245
|
+
},
|
|
246
|
+
};
|
|
247
|
+
// Top-level permission: non-bash rules keep the agent-scope merge. The
|
|
248
|
+
// top-level bash is the union ceiling of EVERY final agent's bash block — a
|
|
249
|
+
// true global privilege ceiling, order-stable and idempotent regardless of
|
|
250
|
+
// which installer regenerates the file. User-authored top-level bash keys the
|
|
251
|
+
// union does not manage are preserved (non-clobber).
|
|
252
|
+
const topPermission = mergePermissionBlock(existing.permission, generated.permission);
|
|
253
|
+
topPermission.bash = composeOpenCodeBashCeiling(
|
|
254
|
+
objectValue(existing.permission).bash,
|
|
255
|
+
collectAgentBashRuleSets(mergedAgent),
|
|
256
|
+
);
|
|
221
257
|
return {
|
|
222
258
|
...existing,
|
|
223
259
|
$schema: existing.$schema ?? generated.$schema,
|
|
224
260
|
command: removeManagedOpenCodeCommand(existing.command),
|
|
225
261
|
mcp: mergedMcp,
|
|
226
|
-
permission:
|
|
227
|
-
agent:
|
|
228
|
-
...objectValue(existing.agent),
|
|
229
|
-
auditor: {
|
|
230
|
-
...existingAuditor,
|
|
231
|
-
...generated.agent.auditor,
|
|
232
|
-
permission: mergePermissionBlock(
|
|
233
|
-
existingAuditor.permission,
|
|
234
|
-
generated.agent.auditor.permission,
|
|
235
|
-
),
|
|
236
|
-
},
|
|
237
|
-
},
|
|
262
|
+
permission: topPermission,
|
|
263
|
+
agent: mergedAgent,
|
|
238
264
|
};
|
|
239
265
|
}
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
// buildMergedOpenCodeProjectConfig throws a clear error in that case.
|
|
4
4
|
let mergeOpenCodeAgentPermissionRule;
|
|
5
5
|
let withoutOpenCodeWildcard;
|
|
6
|
+
let composeOpenCodeBashCeiling;
|
|
6
7
|
export let sharedOpenCodePermissions = false;
|
|
7
8
|
|
|
8
9
|
try {
|
|
9
10
|
const shared = await import('audit-tools/shared');
|
|
10
11
|
mergeOpenCodeAgentPermissionRule = shared.mergeOpenCodeAgentPermissionRule;
|
|
11
12
|
withoutOpenCodeWildcard = shared.withoutOpenCodeWildcard;
|
|
13
|
+
composeOpenCodeBashCeiling = shared.composeOpenCodeBashCeiling;
|
|
12
14
|
sharedOpenCodePermissions = true;
|
|
13
15
|
} catch {
|
|
14
16
|
// shared not yet built — callers that need merge logic will throw below
|
|
@@ -170,6 +172,19 @@ function mergePermissionBlock(existingPermission, generatedPermission) {
|
|
|
170
172
|
};
|
|
171
173
|
}
|
|
172
174
|
|
|
175
|
+
// Collect every agent's bash rule set from a merged agent map (in stable,
|
|
176
|
+
// key-sorted order) so the top-level ceiling is a deterministic union over all
|
|
177
|
+
// present agents — auditor, remediator, or any future agent — not just the one
|
|
178
|
+
// this installer owns. This is what makes the two installers mutually
|
|
179
|
+
// key-aware: whichever one runs unions the block the other already wrote.
|
|
180
|
+
function collectAgentBashRuleSets(agentMap) {
|
|
181
|
+
const agents = objectValue(agentMap);
|
|
182
|
+
return Object.keys(agents)
|
|
183
|
+
.sort()
|
|
184
|
+
.map((name) => objectValue(objectValue(agents[name]).permission).bash)
|
|
185
|
+
.filter((bash) => bash && typeof bash === 'object' && !Array.isArray(bash));
|
|
186
|
+
}
|
|
187
|
+
|
|
173
188
|
export function buildMergedOpenCodeProjectConfig(existing, root) {
|
|
174
189
|
if (!sharedOpenCodePermissions) {
|
|
175
190
|
throw new Error(
|
|
@@ -180,22 +195,33 @@ export function buildMergedOpenCodeProjectConfig(existing, root) {
|
|
|
180
195
|
const mergedMcp = objectValue(existing.mcp);
|
|
181
196
|
delete mergedMcp.remediator;
|
|
182
197
|
const existingRemediator = objectValue(objectValue(existing.agent).remediator);
|
|
198
|
+
const mergedAgent = {
|
|
199
|
+
...objectValue(existing.agent),
|
|
200
|
+
remediator: {
|
|
201
|
+
...existingRemediator,
|
|
202
|
+
...generated.agent.remediator,
|
|
203
|
+
permission: mergePermissionBlock(
|
|
204
|
+
existingRemediator.permission,
|
|
205
|
+
generated.agent.remediator.permission,
|
|
206
|
+
),
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
// Top-level permission: non-bash rules keep the agent-scope merge. The
|
|
210
|
+
// top-level bash is the union ceiling of EVERY final agent's bash block — a
|
|
211
|
+
// true global privilege ceiling, order-stable and idempotent regardless of
|
|
212
|
+
// which installer regenerates the file. User-authored top-level bash keys the
|
|
213
|
+
// union does not manage are preserved (non-clobber).
|
|
214
|
+
const topPermission = mergePermissionBlock(existing.permission, generated.permission);
|
|
215
|
+
topPermission.bash = composeOpenCodeBashCeiling(
|
|
216
|
+
objectValue(existing.permission).bash,
|
|
217
|
+
collectAgentBashRuleSets(mergedAgent),
|
|
218
|
+
);
|
|
183
219
|
return {
|
|
184
220
|
...existing,
|
|
185
221
|
$schema: existing.$schema ?? generated.$schema,
|
|
186
222
|
command: removeManagedOpenCodeCommand(existing.command),
|
|
187
223
|
mcp: mergedMcp,
|
|
188
|
-
permission:
|
|
189
|
-
agent:
|
|
190
|
-
...objectValue(existing.agent),
|
|
191
|
-
remediator: {
|
|
192
|
-
...existingRemediator,
|
|
193
|
-
...generated.agent.remediator,
|
|
194
|
-
permission: mergePermissionBlock(
|
|
195
|
-
existingRemediator.permission,
|
|
196
|
-
generated.agent.remediator.permission,
|
|
197
|
-
),
|
|
198
|
-
},
|
|
199
|
-
},
|
|
224
|
+
permission: topPermission,
|
|
225
|
+
agent: mergedAgent,
|
|
200
226
|
};
|
|
201
227
|
}
|