audit-tools 0.32.46 → 0.32.48
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/remediate/phases/close.js +9 -9
- package/dist/remediate/phases/plan.d.ts +3 -46
- package/dist/remediate/phases/plan.d.ts.map +1 -1
- package/dist/remediate/phases/plan.js +5 -577
- package/dist/remediate/phases/plan.js.map +1 -1
- package/dist/remediate/state/store.d.ts +5 -6
- package/dist/remediate/state/store.d.ts.map +1 -1
- package/dist/remediate/state/store.js.map +1 -1
- package/dist/remediate/steps/nextStep.d.ts.map +1 -1
- package/dist/remediate/steps/nextStep.js +1 -2
- package/dist/remediate/steps/nextStep.js.map +1 -1
- package/package.json +1 -1
|
@@ -337,15 +337,15 @@ const AUDIT_TOOLS_EXCLUDE_PATTERN = /^\.audit-tools\//;
|
|
|
337
337
|
* RUN-START-DIRTY GUARD on source (2) ONLY: declared surfaces are plan-time
|
|
338
338
|
* DECLARATIONS (write-access grants) / audit evidence — never verified against
|
|
339
339
|
* an actual diff. A declared file that was ALREADY dirty when the run started
|
|
340
|
-
* (`state.run_start_dirty`, captured
|
|
341
|
-
* edit exists) cannot be the run's edit, so it is excluded here —
|
|
342
|
-
* resolved item declaring a file the run never actually touched
|
|
343
|
-
* pre-existing user WIP into the closing commit (the exact
|
|
344
|
-
* this manifest exists to close). Ground-truth entries
|
|
345
|
-
* NEVER excluded by the snapshot: git proved the run
|
|
346
|
-
* tool-merged edit to a file the user ALSO had dirty
|
|
347
|
-
* tool legitimately owns. A state without
|
|
348
|
-
*
|
|
340
|
+
* (`state.run_start_dirty`, captured at the extracted-plan join site before any
|
|
341
|
+
* remediation edit exists) cannot be the run's edit, so it is excluded here —
|
|
342
|
+
* otherwise a resolved item declaring a file the run never actually touched
|
|
343
|
+
* would sweep pre-existing user WIP into the closing commit (the exact
|
|
344
|
+
* over-inclusion class this manifest exists to close). Ground-truth entries
|
|
345
|
+
* from source (1) are NEVER excluded by the snapshot: git proved the run
|
|
346
|
+
* landed those paths, and a tool-merged edit to a file the user ALSO had dirty
|
|
347
|
+
* at run start is a path the tool legitimately owns. A state without
|
|
348
|
+
* `run_start_dirty` (pre-field) means no exclusions.
|
|
349
349
|
*
|
|
350
350
|
* Both sources empty is legitimate (e.g. a run that only produced
|
|
351
351
|
* `resolved_no_change` / skipped items) and correctly yields an empty
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
import { RemediationState } from "../state/store.js";
|
|
2
|
-
import { OrchestratorOptions } from "../types/options.js";
|
|
3
1
|
import { RemediationPlan, Finding, RemediationBlock, RemediationItemState, CoverageLedger } from "../state/types.js";
|
|
4
|
-
import type { AuditFindingsReport
|
|
5
|
-
import { runTracked } from "audit-tools/shared";
|
|
6
|
-
/**
|
|
7
|
-
* Parse the auditor's canonical `audit-findings.json` (the machine contract) into
|
|
8
|
-
* remediation findings, work blocks, and synthesis themes. The auditor emits this
|
|
9
|
-
* directly (Phase 6); the remediator consumes it verbatim, so there is no markdown
|
|
10
|
-
* parsing — non-auditor input still flows through the free-form LLM extractor.
|
|
11
|
-
*/
|
|
12
|
-
export declare function parseAuditFindingsReport(report: AuditFindingsReport): {
|
|
13
|
-
findings: Finding[];
|
|
14
|
-
blocks: RemediationBlock[];
|
|
15
|
-
themes: FindingTheme[];
|
|
16
|
-
};
|
|
2
|
+
import type { AuditFindingsReport } from "audit-tools/shared";
|
|
17
3
|
/**
|
|
18
4
|
* Whether a parsed JSON value is a valid audit-findings report.
|
|
19
5
|
*
|
|
@@ -22,25 +8,6 @@ export declare function parseAuditFindingsReport(report: AuditFindingsReport): {
|
|
|
22
8
|
* contract_version is rejected here rather than silently trusted.
|
|
23
9
|
*/
|
|
24
10
|
export declare function isAuditFindingsReport(value: unknown): value is AuditFindingsReport;
|
|
25
|
-
interface PlanPhaseDeps {
|
|
26
|
-
enumerateTestFiles?: (root: string) => string[];
|
|
27
|
-
runCommand?: typeof runTracked;
|
|
28
|
-
now?: () => number;
|
|
29
|
-
/** Test seam: replaces the provider-backed free-form extraction worker. */
|
|
30
|
-
extractFindings?: (content: string, options: OrchestratorOptions) => Promise<{
|
|
31
|
-
findings: Finding[];
|
|
32
|
-
blocks: RemediationBlock[];
|
|
33
|
-
}>;
|
|
34
|
-
/** Test seam: replaces the provider-backed bounded path-repair worker. */
|
|
35
|
-
repairExtractedFindingPaths?: (requests: {
|
|
36
|
-
finding: Finding;
|
|
37
|
-
phantomPaths: string[];
|
|
38
|
-
}[]) => Promise<Map<string, string[]>>;
|
|
39
|
-
}
|
|
40
|
-
export declare function deriveBlocksFromTestGraph(findings: Finding[], testFiles: string[]): {
|
|
41
|
-
blocks: RemediationBlock[];
|
|
42
|
-
useful: boolean;
|
|
43
|
-
};
|
|
44
11
|
export { ESTIMATED_PROMPT_OVERHEAD_TOKENS as ESTIMATED_BLOCK_BASE_TOKENS, ESTIMATED_ITEM_OVERHEAD_TOKENS as ESTIMATED_FINDING_OVERHEAD_TOKENS, } from "audit-tools/shared";
|
|
45
12
|
export declare function estimateGroupTokens(findingIds: string[], findings: Finding[], fileByteCounts: Map<string, number>, root?: string): number;
|
|
46
13
|
export declare function splitBlocksByContextBudget(blocks: RemediationBlock[], findings: Finding[], root: string, contextBudget: number): RemediationBlock[];
|
|
@@ -103,21 +70,11 @@ export declare function mergeBlocksSharingFiles(blocks: RemediationBlock[], find
|
|
|
103
70
|
* 2. splitBlocksByContextBudget — keeps each block within the agent context window
|
|
104
71
|
* 3. snapshotAffectedFileHashes — records baseline hashes for integrity checks
|
|
105
72
|
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
* logic and the two paths cannot drift apart.
|
|
73
|
+
* Sole caller is handlePendingExtractedPlan (LLM-extracted plans join site);
|
|
74
|
+
* kept as its own function so the post-dedup logic has one home.
|
|
109
75
|
*/
|
|
110
76
|
export declare function applyPlanPipeline(plan: RemediationPlan, options: {
|
|
111
77
|
root: string;
|
|
112
78
|
artifactsDir?: string;
|
|
113
79
|
}): Promise<RemediationPlan>;
|
|
114
|
-
/**
|
|
115
|
-
* Prune blocks so that every item reference is still in the kept-findings set,
|
|
116
|
-
* and drop blocks whose item list becomes empty after pruning.
|
|
117
|
-
* Used in runPlanPhase wherever a reduction step drops some findings.
|
|
118
|
-
* Extracted to eliminate the three formerly-duplicated inline occurrences of
|
|
119
|
-
* blocks.map(b => ({...b, items: b.items.filter(id => keptIds.has(id))})).filter(...)
|
|
120
|
-
*/
|
|
121
|
-
export declare function pruneBlocksForKeptFindings(blocks: RemediationBlock[], keptFindings: Finding[]): RemediationBlock[];
|
|
122
|
-
export declare function runPlanPhase(state: RemediationState, options: OrchestratorOptions, deps?: PlanPhaseDeps): Promise<RemediationState>;
|
|
123
80
|
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/remediate/phases/plan.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/remediate/phases/plan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EAEf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAe9D;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,mBAAmB,CAE9B;AAKD,OAAO,EACL,gCAAgC,IAAI,2BAA2B,EAC/D,8BAA8B,IAAI,iCAAiC,GACpE,MAAM,oBAAoB,CAAC;AAoH5B,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,EAAE,EACpB,QAAQ,EAAE,OAAO,EAAE,EACnB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAMnC,IAAI,CAAC,EAAE,MAAM,GACZ,MAAM,CAeR;AA2BD,wBAAgB,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