audit-tools 0.55.15 → 0.55.17
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/cli/auditStep.d.ts.map +1 -1
- package/dist/audit/cli/auditStep.js +4 -3
- package/dist/audit/cli/auditStep.js.map +1 -1
- package/dist/audit/cli/charterComparisonPrompt.d.ts.map +1 -1
- package/dist/audit/cli/charterComparisonPrompt.js +8 -1
- package/dist/audit/cli/charterComparisonPrompt.js.map +1 -1
- package/dist/audit/cli/conceptualDispatch.d.ts.map +1 -1
- package/dist/audit/cli/conceptualDispatch.js +9 -5
- package/dist/audit/cli/conceptualDispatch.js.map +1 -1
- package/dist/audit/cli/confirmIntentStep.d.ts.map +1 -1
- package/dist/audit/cli/confirmIntentStep.js +0 -1
- package/dist/audit/cli/confirmIntentStep.js.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts +86 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.js +460 -161
- package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
- package/dist/audit/cli/fanoutLanes.d.ts +1 -1
- package/dist/audit/cli/fanoutLanes.d.ts.map +1 -1
- package/dist/audit/cli/fanoutLanes.js +4 -2
- package/dist/audit/cli/fanoutLanes.js.map +1 -1
- package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
- package/dist/audit/cli/nextStepCommand.js +17 -15
- package/dist/audit/cli/nextStepCommand.js.map +1 -1
- package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
- package/dist/audit/cli/nextStepHelpers.js +4 -3
- package/dist/audit/cli/nextStepHelpers.js.map +1 -1
- package/dist/audit/cli/prompts.d.ts +2 -0
- package/dist/audit/cli/prompts.d.ts.map +1 -1
- package/dist/audit/cli/prompts.js +12 -1
- package/dist/audit/cli/prompts.js.map +1 -1
- package/dist/audit/cli/semanticReviewStep.d.ts.map +1 -1
- package/dist/audit/cli/semanticReviewStep.js +71 -6
- package/dist/audit/cli/semanticReviewStep.js.map +1 -1
- package/dist/audit/cli/submitCommand.d.ts +26 -0
- package/dist/audit/cli/submitCommand.d.ts.map +1 -0
- package/dist/audit/cli/submitCommand.js +79 -0
- package/dist/audit/cli/submitCommand.js.map +1 -0
- package/dist/audit/cli/validateResultsCommand.d.ts +11 -0
- package/dist/audit/cli/validateResultsCommand.d.ts.map +1 -1
- package/dist/audit/cli/validateResultsCommand.js +56 -4
- package/dist/audit/cli/validateResultsCommand.js.map +1 -1
- package/dist/audit/cli.d.ts.map +1 -1
- package/dist/audit/cli.js +4 -1
- package/dist/audit/cli.js.map +1 -1
- package/dist/audit/contracts/findingContractPrompt.d.ts +229 -0
- package/dist/audit/contracts/findingContractPrompt.d.ts.map +1 -1
- package/dist/audit/contracts/findingContractPrompt.js +31 -20
- package/dist/audit/contracts/findingContractPrompt.js.map +1 -1
- package/dist/audit/decompose/buildStructureDecomposition.d.ts +11 -5
- package/dist/audit/decompose/buildStructureDecomposition.d.ts.map +1 -1
- package/dist/audit/decompose/buildStructureDecomposition.js +17 -8
- package/dist/audit/decompose/buildStructureDecomposition.js.map +1 -1
- package/dist/audit/extractors/designAssessment.d.ts.map +1 -1
- package/dist/audit/extractors/designAssessment.js.map +1 -1
- package/dist/audit/extractors/graph.d.ts +1 -1
- package/dist/audit/extractors/graph.js +1 -1
- package/dist/audit/extractors/graphSignals.d.ts +8 -0
- package/dist/audit/extractors/graphSignals.d.ts.map +1 -1
- package/dist/audit/extractors/graphSignals.js +12 -1
- package/dist/audit/extractors/graphSignals.js.map +1 -1
- package/dist/audit/extractors/pathPatterns.d.ts +3 -0
- package/dist/audit/extractors/pathPatterns.d.ts.map +1 -1
- package/dist/audit/extractors/pathPatterns.js +9 -4
- package/dist/audit/extractors/pathPatterns.js.map +1 -1
- package/dist/audit/extractors/surfaces.d.ts.map +1 -1
- package/dist/audit/extractors/surfaces.js +6 -1
- package/dist/audit/extractors/surfaces.js.map +1 -1
- package/dist/audit/io/runArtifacts.d.ts +6 -0
- package/dist/audit/io/runArtifacts.d.ts.map +1 -1
- package/dist/audit/io/runArtifacts.js +9 -0
- package/dist/audit/io/runArtifacts.js.map +1 -1
- package/dist/audit/orchestrator/advance.d.ts.map +1 -1
- package/dist/audit/orchestrator/advance.js +3 -0
- package/dist/audit/orchestrator/advance.js.map +1 -1
- package/dist/audit/orchestrator/architectureDiscovery.d.ts +9 -0
- package/dist/audit/orchestrator/architectureDiscovery.d.ts.map +1 -1
- package/dist/audit/orchestrator/architectureDiscovery.js +11 -1
- package/dist/audit/orchestrator/architectureDiscovery.js.map +1 -1
- package/dist/audit/orchestrator/charterPackets.d.ts +36 -7
- package/dist/audit/orchestrator/charterPackets.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterPackets.js +88 -21
- package/dist/audit/orchestrator/charterPackets.js.map +1 -1
- package/dist/audit/orchestrator/dependencyMap.d.ts.map +1 -1
- package/dist/audit/orchestrator/dependencyMap.js +16 -13
- package/dist/audit/orchestrator/dependencyMap.js.map +1 -1
- package/dist/audit/orchestrator/dependencySlices.d.ts.map +1 -1
- package/dist/audit/orchestrator/dependencySlices.js +26 -11
- package/dist/audit/orchestrator/dependencySlices.js.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.js +38 -6
- package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointExecutor.js +3 -2
- package/dist/audit/orchestrator/intentCheckpointExecutor.js.map +1 -1
- package/dist/audit/orchestrator/state.js +1 -1
- package/dist/audit/orchestrator/state.js.map +1 -1
- package/dist/audit/orchestrator/systemicChallengeExecutor.d.ts +9 -0
- package/dist/audit/orchestrator/systemicChallengeExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/systemicChallengeExecutor.js +12 -2
- package/dist/audit/orchestrator/systemicChallengeExecutor.js.map +1 -1
- package/dist/audit/orchestrator/unitBuilder.d.ts.map +1 -1
- package/dist/audit/orchestrator/unitBuilder.js +29 -8
- package/dist/audit/orchestrator/unitBuilder.js.map +1 -1
- package/dist/audit/reporting/criticalFlowFallbackPrompt.d.ts +6 -0
- package/dist/audit/reporting/criticalFlowFallbackPrompt.d.ts.map +1 -1
- package/dist/audit/reporting/criticalFlowFallbackPrompt.js +55 -34
- package/dist/audit/reporting/criticalFlowFallbackPrompt.js.map +1 -1
- package/dist/audit/systemic/reviewFileMap.d.ts +92 -45
- package/dist/audit/systemic/reviewFileMap.d.ts.map +1 -1
- package/dist/audit/systemic/reviewFileMap.js +171 -94
- package/dist/audit/systemic/reviewFileMap.js.map +1 -1
- package/dist/audit/systemic/secondOrderAdversaryPrompt.d.ts +15 -6
- package/dist/audit/systemic/secondOrderAdversaryPrompt.d.ts.map +1 -1
- package/dist/audit/systemic/secondOrderAdversaryPrompt.js +119 -36
- package/dist/audit/systemic/secondOrderAdversaryPrompt.js.map +1 -1
- package/dist/audit/types/designAssessment.d.ts +11 -0
- package/dist/audit/types/designAssessment.d.ts.map +1 -1
- package/dist/audit/types/designAssessment.js +23 -1
- package/dist/audit/types/designAssessment.js.map +1 -1
- package/dist/remediate/index.d.ts.map +1 -1
- package/dist/remediate/index.js +44 -0
- package/dist/remediate/index.js.map +1 -1
- package/dist/remediate/steps/dispatch/hostHandoff.d.ts +29 -0
- package/dist/remediate/steps/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/hostHandoff.js +63 -4
- package/dist/remediate/steps/dispatch/hostHandoff.js.map +1 -1
- package/dist/remediate/steps/submitResult.d.ts +13 -0
- package/dist/remediate/steps/submitResult.d.ts.map +1 -0
- package/dist/remediate/steps/submitResult.js +24 -0
- package/dist/remediate/steps/submitResult.js.map +1 -0
- package/dist/shared/decompose/charterExtraction.d.ts +117 -17
- package/dist/shared/decompose/charterExtraction.d.ts.map +1 -1
- package/dist/shared/decompose/charterExtraction.js +27 -3
- package/dist/shared/decompose/charterExtraction.js.map +1 -1
- package/dist/shared/decompose/systemicChallenge.d.ts.map +1 -1
- package/dist/shared/decompose/systemicChallenge.js +4 -1
- package/dist/shared/decompose/systemicChallenge.js.map +1 -1
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +2 -2
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/mcp/submitServer.d.ts +26 -0
- package/dist/shared/mcp/submitServer.d.ts.map +1 -0
- package/dist/shared/mcp/submitServer.js +74 -0
- package/dist/shared/mcp/submitServer.js.map +1 -0
- package/dist/shared/submission/hostHandoffCore.d.ts +10 -0
- package/dist/shared/submission/hostHandoffCore.d.ts.map +1 -1
- package/dist/shared/submission/hostHandoffCore.js +19 -0
- package/dist/shared/submission/hostHandoffCore.js.map +1 -1
- package/dist/shared/submission/submissionClassifier.d.ts +7 -0
- package/dist/shared/submission/submissionClassifier.d.ts.map +1 -1
- package/dist/shared/submission/submissionClassifier.js +9 -0
- package/dist/shared/submission/submissionClassifier.js.map +1 -1
- package/dist/shared/submission/submissionScan.d.ts +7 -0
- package/dist/shared/submission/submissionScan.d.ts.map +1 -1
- package/dist/shared/submission/submissionScan.js +6 -2
- package/dist/shared/submission/submissionScan.js.map +1 -1
- package/package.json +2 -1
- package/scripts/audit/postinstall.mjs +21 -7
- package/scripts/remediate/postinstall.mjs +44 -1
- package/scripts/shared/install-host-assets.mjs +134 -1
- package/wrapper/audit-code-wrapper-lib.mjs +9 -46
|
@@ -2,7 +2,7 @@ import { compareCodeUnits } from "audit-tools/shared";
|
|
|
2
2
|
import { deriveBrowserExtensionLensesForPath, hasBrowserExtensionManifestFile, inferBrowserExtensionUnitKind, } from "../extractors/browserExtension.js";
|
|
3
3
|
import { bucketFile } from "../extractors/bucketing.js";
|
|
4
4
|
import { buildDispositionMap, isAuditExcludedStatus } from "../extractors/disposition.js";
|
|
5
|
-
import {
|
|
5
|
+
import { isTestDirectoryPath, isTestPath, isYamlPath, normalizeExtractorPath, pathTokens, } from "../extractors/pathPatterns.js";
|
|
6
6
|
import { sortLenses } from "./auditTaskUtils.js";
|
|
7
7
|
const LENS_MAP = {
|
|
8
8
|
runtime: ["correctness", "maintainability", "tests", "observability"],
|
|
@@ -34,7 +34,18 @@ function inferUnitKind(path, isBrowserExtensionProject = false) {
|
|
|
34
34
|
return "infrastructure";
|
|
35
35
|
if (normalized.startsWith("scripts/") || normalized.startsWith("bin/"))
|
|
36
36
|
return "script";
|
|
37
|
-
|
|
37
|
+
// The shared path predicates, never substrings: `vitest.config.ts` and
|
|
38
|
+
// `inspector.ts` are not tests. A file in a test directory is a test. A YAML
|
|
39
|
+
// file elsewhere is config even when its name says `test` (a CI workflow
|
|
40
|
+
// such as `audit-code-test-suite.yml`). The deployment KEYWORDS do not make
|
|
41
|
+
// a source file config: a test file named `workflow.test.ts` stays a test and
|
|
42
|
+
// a source file under a `workflow` directory stays a module.
|
|
43
|
+
const extractorPath = normalizeExtractorPath(path);
|
|
44
|
+
if (isTestDirectoryPath(extractorPath))
|
|
45
|
+
return "test";
|
|
46
|
+
if (isYamlPath(extractorPath))
|
|
47
|
+
return "config";
|
|
48
|
+
if (isTestPath(extractorPath))
|
|
38
49
|
return "test";
|
|
39
50
|
if (normalized.includes("api/") ||
|
|
40
51
|
normalized.includes("route") ||
|
|
@@ -47,25 +58,35 @@ function inferUnitKind(path, isBrowserExtensionProject = false) {
|
|
|
47
58
|
return "data";
|
|
48
59
|
return "module";
|
|
49
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* One path segment as an id part. A leading dot becomes `dot-`, so
|
|
63
|
+
* `.github` and `github` stay two different units and no id starts with `-`.
|
|
64
|
+
*/
|
|
65
|
+
function slugSegment(segment) {
|
|
66
|
+
return segment.replace(/^\./, "dot-").replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
67
|
+
}
|
|
68
|
+
function slugSegments(...segments) {
|
|
69
|
+
return segments.map(slugSegment).join("-");
|
|
70
|
+
}
|
|
50
71
|
function inferUnitId(path, kind) {
|
|
51
72
|
const parts = path.split("/");
|
|
52
73
|
const normalized = path.toLowerCase();
|
|
53
74
|
if ((parts[0] === "src" || parts[0] === "lib") && parts.length >= 3) {
|
|
54
75
|
if (["api", "routes", "controllers", "models", "db", "services"].includes(parts[1])) {
|
|
55
|
-
return
|
|
76
|
+
return slugSegments(parts[0], parts[1], parts[2]);
|
|
56
77
|
}
|
|
57
78
|
}
|
|
58
79
|
if ((parts[0] === "src" || parts[0] === "lib") && parts.length >= 2) {
|
|
59
|
-
return
|
|
80
|
+
return slugSegments(parts[0], parts[1]);
|
|
60
81
|
}
|
|
61
82
|
if ((parts[0] === "tests" || parts[0] === "test") && parts.length >= 2) {
|
|
62
|
-
return
|
|
83
|
+
return slugSegments("tests", parts[1]);
|
|
63
84
|
}
|
|
64
85
|
if (parts.length >= 3) {
|
|
65
|
-
return
|
|
86
|
+
return slugSegments(parts[0], parts[1]);
|
|
66
87
|
}
|
|
67
88
|
if (parts.length === 2) {
|
|
68
|
-
return parts[0]
|
|
89
|
+
return slugSegment(parts[0]);
|
|
69
90
|
}
|
|
70
91
|
if (normalized.endsWith(".json") ||
|
|
71
92
|
normalized.endsWith(".yaml") ||
|
|
@@ -76,7 +97,7 @@ function inferUnitId(path, kind) {
|
|
|
76
97
|
normalized.startsWith(".")) {
|
|
77
98
|
return "root-config";
|
|
78
99
|
}
|
|
79
|
-
return
|
|
100
|
+
return slugSegments(kind, path);
|
|
80
101
|
}
|
|
81
102
|
export { LENS_ORDER, sortLenses } from "./auditTaskUtils.js";
|
|
82
103
|
function applyExtensionLensGuards(path, lenses) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unitBuilder.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/unitBuilder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unitBuilder.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/unitBuilder.ts"],"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est } from "audit-tools/shared";
|
|
|
5
5
|
* low-confidence), so the host reviews the repository's ACTUAL critical user /
|
|
6
6
|
* system flows and returns an additive enrichment. It does not re-audit code or
|
|
7
7
|
* invent findings — it authors the flow map the deterministic heuristics missed.
|
|
8
|
+
*
|
|
9
|
+
* Only the low-confidence flows are the lane's work, so only they are rendered
|
|
10
|
+
* in full; every other flow is listed by id so the lane can see what already
|
|
11
|
+
* exists without re-reading it. Every flow is listed — the prompt is complete on
|
|
12
|
+
* its own, and `manifestPath` (an audit artifact, NOT a source file) is named
|
|
13
|
+
* only as the record the lane may consult.
|
|
8
14
|
*/
|
|
9
15
|
export declare function renderCriticalFlowFallbackPrompt(manifest: CriticalFlowManifest, manifestPath?: string): string;
|
|
10
16
|
//# sourceMappingURL=criticalFlowFallbackPrompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"criticalFlowFallbackPrompt.d.ts","sourceRoot":"","sources":["../../../src/audit/reporting/criticalFlowFallbackPrompt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"criticalFlowFallbackPrompt.d.ts","sourceRoot":"","sources":["../../../src/audit/reporting/criticalFlowFallbackPrompt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAuB/D;;;;;;;;;;;;GAYG;AACH,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,oBAAoB,EAC9B,YAAY,CAAC,EAAE,MAAM,GACpB,MAAM,CA6ER"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
`
|
|
9
|
-
`
|
|
1
|
+
/**
|
|
2
|
+
* A low-confidence flow is the lane's work, so it is rendered IN FULL: every
|
|
3
|
+
* entrypoint, every candidate path (the keyword heuristic's guesses are the
|
|
4
|
+
* related-file hint the executor would otherwise have to grep for), every concern.
|
|
5
|
+
*/
|
|
6
|
+
function renderLowConfidenceFlow(flow) {
|
|
7
|
+
return (`- \`${flow.id}\` — ${flow.name}\n` +
|
|
8
|
+
` entrypoints: ${flow.entrypoints.join(", ") || "(none)"}\n` +
|
|
9
|
+
` candidate paths (keyword guesses, not graph-confirmed): ${flow.paths.join(", ") || "(none)"}\n` +
|
|
10
|
+
` concerns: ${flow.concerns.join(", ") || "(none)"}`);
|
|
11
|
+
}
|
|
12
|
+
/** A graph-corroborated flow is context only: its id and name, one line each. */
|
|
13
|
+
function renderCorroboratedFlow(flow) {
|
|
14
|
+
return `- \`${flow.id}\` — ${flow.name}`;
|
|
10
15
|
}
|
|
11
16
|
/**
|
|
12
17
|
* Prompt for the critical-flow LLM fallback pass. The deterministic flow
|
|
@@ -14,27 +19,25 @@ function summarizeFlow(flow) {
|
|
|
14
19
|
* low-confidence), so the host reviews the repository's ACTUAL critical user /
|
|
15
20
|
* system flows and returns an additive enrichment. It does not re-audit code or
|
|
16
21
|
* invent findings — it authors the flow map the deterministic heuristics missed.
|
|
22
|
+
*
|
|
23
|
+
* Only the low-confidence flows are the lane's work, so only they are rendered
|
|
24
|
+
* in full; every other flow is listed by id so the lane can see what already
|
|
25
|
+
* exists without re-reading it. Every flow is listed — the prompt is complete on
|
|
26
|
+
* its own, and `manifestPath` (an audit artifact, NOT a source file) is named
|
|
27
|
+
* only as the record the lane may consult.
|
|
17
28
|
*/
|
|
18
29
|
export function renderCriticalFlowFallbackPrompt(manifest, manifestPath) {
|
|
19
30
|
const flows = manifest.flows;
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
? [
|
|
23
|
-
` ... and ${flows.length - MAX_RENDERED_FLOWS} more flows${manifestPath ? ` (read the complete artifact at \`${manifestPath}\`)` : ": all remaining flows are listed below"}.`,
|
|
24
|
-
...(manifestPath ? [] : flows.slice(MAX_RENDERED_FLOWS).map(summarizeFlow)),
|
|
25
|
-
]
|
|
26
|
-
: [];
|
|
27
|
-
const lowConfidenceIds = flows
|
|
28
|
-
.filter((flow) => flow.confidence === "low")
|
|
29
|
-
.map((flow) => flow.id);
|
|
31
|
+
const low = flows.filter((flow) => flow.confidence === "low");
|
|
32
|
+
const corroborated = flows.filter((flow) => flow.confidence !== "low");
|
|
30
33
|
return [
|
|
31
34
|
"# Critical-flow fallback",
|
|
32
35
|
"",
|
|
33
36
|
"Deterministic critical-flow inference fell below its confidence bar" +
|
|
34
37
|
(flows.length === 0
|
|
35
38
|
? " — it found NO critical flows for this repository."
|
|
36
|
-
:
|
|
37
|
-
? ` — ${
|
|
39
|
+
: low.length > 0
|
|
40
|
+
? ` — ${low.length} of ${flows.length} inferred flow(s) are low-confidence.`
|
|
38
41
|
: "."),
|
|
39
42
|
"",
|
|
40
43
|
"A critical flow is an end-to-end user or system path whose failure has outsized",
|
|
@@ -42,21 +45,39 @@ export function renderCriticalFlowFallbackPrompt(manifest, manifestPath) {
|
|
|
42
45
|
"async/queue processing, deploy/infra, or any repo-specific mission-critical path.",
|
|
43
46
|
"",
|
|
44
47
|
"Review the repository and return an ADDITIVE enrichment of the flow map:",
|
|
45
|
-
"-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
48
|
+
"- UPGRADE each low-confidence flow listed below that is a real critical flow:",
|
|
49
|
+
" re-author it with its EXACT id and `confidence: \"high\"`, and correct its",
|
|
50
|
+
" entrypoints/paths/concerns. Its candidate paths are keyword guesses: keep only",
|
|
51
|
+
" the files the flow actually runs through.",
|
|
52
|
+
"- Omit a low-confidence flow that is not a real critical flow (for example a",
|
|
53
|
+
" template or config file that nothing executes as a path). Omitting it is a",
|
|
54
|
+
" valid answer; it stays in the map at low confidence.",
|
|
55
|
+
"- ADD any genuine critical flow the deterministic pass missed, with a fresh id",
|
|
56
|
+
" like `flow:host:<short-slug>`.",
|
|
57
|
+
"- Do not resubmit any other listed flow unless you correct it; a correction",
|
|
58
|
+
" uses its exact id.",
|
|
59
|
+
"- Cite only real repository paths. Do not invent files. Return an empty `flows`",
|
|
60
|
+
" array when there is nothing to upgrade or add.",
|
|
61
|
+
"",
|
|
62
|
+
...(manifestPath
|
|
63
|
+
? [
|
|
64
|
+
`The complete flow records are in the audit artifact \`${manifestPath}\`. This file`,
|
|
65
|
+
"is an audit artifact, not repository source: read it there, not in the source tree.",
|
|
66
|
+
"Everything this task needs is listed below.",
|
|
67
|
+
"",
|
|
68
|
+
]
|
|
69
|
+
: []),
|
|
70
|
+
"## Low-confidence flows (your work)",
|
|
71
|
+
"",
|
|
72
|
+
...(low.length > 0
|
|
73
|
+
? low.map(renderLowConfidenceFlow)
|
|
74
|
+
: ["- (none — look only for missed flows)"]),
|
|
52
75
|
"",
|
|
53
|
-
|
|
54
|
-
"## Deterministic flows",
|
|
76
|
+
"## Other flows (context; not low confidence)",
|
|
55
77
|
"",
|
|
56
|
-
...(
|
|
57
|
-
?
|
|
58
|
-
: ["- (deterministic inference recorded no flows)"]),
|
|
59
|
-
...overflowNote,
|
|
78
|
+
...(corroborated.length > 0
|
|
79
|
+
? corroborated.map(renderCorroboratedFlow)
|
|
80
|
+
: ["- (deterministic inference recorded no other flows)"]),
|
|
60
81
|
"",
|
|
61
82
|
"## Output format",
|
|
62
83
|
"",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"criticalFlowFallbackPrompt.js","sourceRoot":"","sources":["../../../src/audit/reporting/criticalFlowFallbackPrompt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"criticalFlowFallbackPrompt.js","sourceRoot":"","sources":["../../../src/audit/reporting/criticalFlowFallbackPrompt.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,SAAS,uBAAuB,CAAC,IAAkB;IACjD,OAAO,CACL,OAAO,IAAI,CAAC,EAAE,QAAQ,IAAI,CAAC,IAAI,IAAI;QACnC,k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D;QACxD,gFAAgF;QAChF,kCAAkC;QAClC,6EAA6E;QAC7E,sBAAsB;QACtB,iFAAiF;QACjF,kDAAkD;QAClD,EAAE;QACF,GAAG,CAAC,YAAY;YACd,CAAC,CAAC;gBACE,yDAAyD,YAAY,eAAe;gBACpF,qFAAqF;gBACrF,6CAA6C;gBAC7C,EAAE;aACH;YACH,CAAC,CAAC,EAAE,CAAC;QACP,qCAAqC;QACrC,EAAE;QACF,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC;YAChB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,uBAAuB,CAAC;YAClC,CAAC,CAAC,CAAC,uCAAuC,CAAC,CAAC;QAC9C,EAAE;QACF,8CAA8C;QAC9C,EAAE;QACF,GAAG,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;YACzB,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,sBAAsB,CAAC;YAC1C,CAAC,CAAC,CAAC,qDAAqD,CAAC,CAAC;QAC5D,EAAE;QACF,kBAAkB;QAClB,EAAE;QACF,2CAA2C;QAC3C,EAAE;QACF,SAAS;QACT,GAAG;QACH,cAAc;QACd,OAAO;QACP,mCAAmC;QACnC,kCAAkC;QAClC,+CAA+C;QAC/C,kEAAkE;QAClE,mDAAmD;QACnD,4BAA4B;QAC5B,OAAO;QACP,KAAK;QACL,GAAG;QACH,KAAK;QACL,EAAE;QACF,iFAAiF;QACjF,6EAA6E;QAC7E,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -13,43 +13,64 @@
|
|
|
13
13
|
* So the map is derived ONCE, by the tool, from artifacts the round did not
|
|
14
14
|
* produce either (the repository manifest and the dependency graph the audit
|
|
15
15
|
* pipeline already extracted), and handed over labelled as prior verified recon.
|
|
16
|
-
* It is a lane ASSET, not a submission: the
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* only thing it hands over is its own findings. Updates
|
|
16
|
+
* It is a lane ASSET, not a submission: each slice reaches the round as a
|
|
17
|
+
* READ-ONLY context file the lane materializer writes and binds into the lane's
|
|
18
|
+
* review binding, so acceptance re-hashes it and refuses a submission made
|
|
19
|
+
* against an edited copy; the prompt carries only the index and the provenance
|
|
20
|
+
* (`reviewFileMapContext`). No file is on a path any lane's write scope covers,
|
|
21
|
+
* and no submission schema has a field for it — a round has no route by which to
|
|
22
|
+
* write back, because the only thing it hands over is its own findings. Updates
|
|
24
23
|
* go through a separate recon pass (the graph builder), which is the only thing
|
|
25
24
|
* that can change what the next round receives. Otherwise the map quietly
|
|
26
25
|
* absorbs one reviewer's assumption and reaches the next reviewer as fact.
|
|
27
26
|
*
|
|
28
|
-
* The map is SCOPED to what the reading round
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* the
|
|
27
|
+
* The map is SCOPED to what the reading round judges — which only the consumer
|
|
28
|
+
* knows: every file in that scope gets an anchor carrying its COMPLETE caller and
|
|
29
|
+
* callee lists, and nothing outside it is anchored. There is no cap. An earlier
|
|
30
|
+
* version anchored the path-sorted FIRST 60 authored files and listed at most 25
|
|
31
|
+
* call sites each — neither number measured. Whatever the map leaves out
|
|
32
|
+
* (in-scope files with no edge, files outside the scope, graph buckets that are
|
|
33
|
+
* not call sites) is STATED: a silently thin map reads as a complete one.
|
|
34
|
+
*
|
|
35
|
+
* It is SLICED by unit, not capped. The uncapped map was one file — 480 KB and
|
|
36
|
+
* 2,563 lines for the six starting-point units of the 0.55.15 dogfood run — and
|
|
37
|
+
* every lane told to read it whole fell back to grep. The prompt now carries a
|
|
38
|
+
* compact index (one row per unit: its counts and its slice file) and each unit's
|
|
39
|
+
* anchors live in their own slice, so a lane reads exactly the slices of the
|
|
40
|
+
* units it judges, each whole. Only call-site buckets feed it
|
|
41
|
+
* (`isDependencyEdgeBucket`): a co-changed file is not a caller.
|
|
38
42
|
*
|
|
39
43
|
* Deterministic and content-derived: every array is ordered by a stable key, so
|
|
40
|
-
*
|
|
44
|
+
* no file churns between emissions of an unchanged round.
|
|
41
45
|
*/
|
|
42
46
|
import type { ArtifactBundle } from "../io/artifacts.js";
|
|
47
|
+
/** A unit as the map slices by it: an id and the files it owns. */
|
|
48
|
+
export interface ReviewFileMapUnit {
|
|
49
|
+
unit_id: string;
|
|
50
|
+
files: readonly string[];
|
|
51
|
+
}
|
|
43
52
|
/**
|
|
44
|
-
* The files a reading round
|
|
45
|
-
* consumer derives it from what its own prompt names
|
|
46
|
-
*
|
|
53
|
+
* The files a reading round judges — the set the map anchors, completely. The
|
|
54
|
+
* consumer derives it from what its own prompt names (it is the only party that
|
|
55
|
+
* knows), so the map and the prompt cannot disagree about it.
|
|
47
56
|
*/
|
|
48
57
|
export interface ReviewFileMapScope {
|
|
49
58
|
/** Repo-relative paths under review. Deduplicated and path-sorted by the map. */
|
|
50
59
|
files: readonly string[];
|
|
51
60
|
/** One clause naming what this scope is, stated to the reading lane. */
|
|
52
61
|
basis: string;
|
|
62
|
+
/**
|
|
63
|
+
* The units the index lists and the slices follow, in the order the consumer
|
|
64
|
+
* names them. A file belongs to the FIRST unit that lists it; a file no unit
|
|
65
|
+
* lists lands in the `unassigned` slice. Omitted: the run's unit manifest.
|
|
66
|
+
*/
|
|
67
|
+
units?: readonly ReviewFileMapUnit[];
|
|
68
|
+
/**
|
|
69
|
+
* Per-file notes rendered under the file's anchor (the systemic round's
|
|
70
|
+
* deterministic leads). A noted file is anchored even when the graph records
|
|
71
|
+
* no edge for it — the note is the reason it is under review.
|
|
72
|
+
*/
|
|
73
|
+
notes?: ReadonlyMap<string, readonly string[]>;
|
|
53
74
|
}
|
|
54
75
|
export interface ReviewFileMapAnchor {
|
|
55
76
|
/** The repo-relative file the call sites below target. */
|
|
@@ -58,16 +79,29 @@ export interface ReviewFileMapAnchor {
|
|
|
58
79
|
callers: string[];
|
|
59
80
|
/** Every file it references, path-sorted. */
|
|
60
81
|
callees: string[];
|
|
82
|
+
/** The scope's notes for this file, in the order given. */
|
|
83
|
+
notes: string[];
|
|
84
|
+
}
|
|
85
|
+
/** One unit's share of the map: the files under review it owns and the slice file holding them. */
|
|
86
|
+
export interface ReviewFileMapSlice {
|
|
87
|
+
/** The owning unit, or `null` for in-scope files no unit lists. */
|
|
88
|
+
unit_id: string | null;
|
|
89
|
+
/** The slice file's name. Unique within one map. */
|
|
90
|
+
filename: string;
|
|
91
|
+
/** This unit's files under review, path-sorted. */
|
|
92
|
+
files: string[];
|
|
61
93
|
}
|
|
62
94
|
export interface ReviewFileMap {
|
|
63
95
|
/** What produced this map — the provenance the reading lane is told to trust. */
|
|
64
96
|
provenance: {
|
|
65
97
|
/** `tool` — the map is machine-derived, never authored by a reviewer. */
|
|
66
98
|
author: "tool";
|
|
67
|
-
/** The
|
|
99
|
+
/** The call-site buckets the edges were read from. */
|
|
68
100
|
sources: string[];
|
|
69
101
|
/** Edges consulted, so a thin map is visibly thin rather than silently so. */
|
|
70
102
|
edge_count: number;
|
|
103
|
+
/** Graph buckets present but not read, because they are not call sites. */
|
|
104
|
+
omitted_sources: string[];
|
|
71
105
|
/** Whether an edge category was present at all in the graph. */
|
|
72
106
|
graph_present: boolean;
|
|
73
107
|
};
|
|
@@ -77,21 +111,28 @@ export interface ReviewFileMap {
|
|
|
77
111
|
/** Files under review: each is anchored or counted in `files_without_edges`. */
|
|
78
112
|
file_count: number;
|
|
79
113
|
/**
|
|
80
|
-
* Authored (manifest) files outside the scope, so not anchored. Stated
|
|
81
|
-
*
|
|
114
|
+
* Authored (manifest) files outside the scope, so not anchored. Stated: an
|
|
115
|
+
* unanchored file is outside this map, not unconnected.
|
|
82
116
|
*/
|
|
83
117
|
outside_scope: number;
|
|
84
118
|
};
|
|
85
|
-
/** One anchor per in-scope file the graph connects, path-sorted. */
|
|
119
|
+
/** One anchor per in-scope file the graph connects or the scope notes, path-sorted. */
|
|
86
120
|
anchors: ReviewFileMapAnchor[];
|
|
87
121
|
/**
|
|
88
|
-
* In-scope files the graph records NO edge for
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* whose absence a round must not read as "nothing depends on it".
|
|
122
|
+
* In-scope files the graph records NO edge for. Always stated: these are
|
|
123
|
+
* exactly the files whose absence a round must not read as "nothing depends
|
|
124
|
+
* on it".
|
|
92
125
|
*/
|
|
93
126
|
files_without_edges: number;
|
|
127
|
+
/** One entry per listed unit, in scope order, then `unassigned` when any file is. */
|
|
128
|
+
slices: ReviewFileMapSlice[];
|
|
94
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Which unit owns each file: the FIRST unit, in the order given, that lists it.
|
|
132
|
+
* The one ownership rule the map's slices and any per-unit count a consumer
|
|
133
|
+
* renders beside them both read, so a file two units list is counted once.
|
|
134
|
+
*/
|
|
135
|
+
export declare function unitOwnership(units: readonly ReviewFileMapUnit[]): Map<string, string>;
|
|
95
136
|
/**
|
|
96
137
|
* Build the map from the dependency graph the audit already extracted. Edges are
|
|
97
138
|
* read in both directions per anchor — callers and callees — because the review
|
|
@@ -102,31 +143,37 @@ export interface ReviewFileMap {
|
|
|
102
143
|
*/
|
|
103
144
|
export declare function buildReviewFileMap(bundle: ArtifactBundle, scope: ReviewFileMapScope): ReviewFileMap;
|
|
104
145
|
/**
|
|
105
|
-
* Render
|
|
106
|
-
*
|
|
107
|
-
*
|
|
146
|
+
* Render one slice: a short provenance header, then every anchor of the unit with
|
|
147
|
+
* its complete caller and callee lists and its notes. Returned as text rather
|
|
148
|
+
* than JSON so a lane reads it as data-that-was-handed-over.
|
|
108
149
|
*/
|
|
109
|
-
export declare function
|
|
150
|
+
export declare function renderReviewFileMapSlice(map: ReviewFileMap, slice: ReviewFileMapSlice): string[];
|
|
110
151
|
/** A file the tool generates for a lane — the shape a lane spec's `generatedContext` carries. */
|
|
111
152
|
export interface ReviewFileMapContextFile {
|
|
112
153
|
filename: string;
|
|
113
154
|
label: string;
|
|
114
155
|
text: string;
|
|
115
156
|
}
|
|
116
|
-
/** One build of the map, split into what the prompt carries and what the
|
|
157
|
+
/** One build of the map, split into what the prompt carries and what the files carry. */
|
|
117
158
|
export interface ReviewFileMapContext {
|
|
118
|
-
/** The prompt's share: provenance, the read-only rule, scope
|
|
159
|
+
/** The prompt's share: provenance, the read-only rule, scope, counts, and the unit index. */
|
|
119
160
|
summaryLines: string[];
|
|
120
|
-
/**
|
|
121
|
-
|
|
161
|
+
/** One read-only slice per unit with an anchor, bound into the lane's review. */
|
|
162
|
+
contextFiles: ReviewFileMapContextFile[];
|
|
163
|
+
}
|
|
164
|
+
/** An extra column of the unit index, filled per unit by the consumer. */
|
|
165
|
+
export interface ReviewFileMapIndexColumn {
|
|
166
|
+
header: string;
|
|
167
|
+
cell: (unitId: string | null) => string;
|
|
122
168
|
}
|
|
123
169
|
/**
|
|
124
|
-
* Split one map into the prompt
|
|
125
|
-
* two cannot come from different builds. The
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* materializer lists under its "Read-only context files" section.
|
|
170
|
+
* Split one map into the prompt's index and the read-only slice files, so the
|
|
171
|
+
* two cannot come from different builds. The index states the provenance, the
|
|
172
|
+
* read-only rule, every count, the omitted buckets, and one row per unit naming
|
|
173
|
+
* its slice — the lane materializer lists each slice's full path under its
|
|
174
|
+
* "Read-only context files" section.
|
|
130
175
|
*/
|
|
131
|
-
export declare function reviewFileMapContext(map: ReviewFileMap
|
|
176
|
+
export declare function reviewFileMapContext(map: ReviewFileMap, options?: {
|
|
177
|
+
columns?: readonly ReviewFileMapIndexColumn[];
|
|
178
|
+
}): ReviewFileMapContext;
|
|
132
179
|
//# sourceMappingURL=reviewFileMap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reviewFileMap.d.ts","sourceRoot":"","sources":["../../../src/audit/systemic/reviewFileMap.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"reviewFileMap.d.ts","sourceRoot":"","sources":["../../../src/audit/systemic/reviewFileMap.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,mEAAmE;AACnE,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,iFAAiF;IACjF,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACrC;;;;OAIG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,mBAAmB;IAClC,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,2DAA2D;IAC3D,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,mGAAmG;AACnG,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,iFAAiF;IACjF,UAAU,EAAE;QACV,yEAAyE;QACzE,MAAM,EAAE,MAAM,CAAC;QACf,sDAAsD;QACtD,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,8EAA8E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