audit-tools 0.55.14 → 0.55.16
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 +25 -11
- package/dist/audit/cli/confirmIntentStep.js.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts +65 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.js +329 -126
- 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/functionalPreflight.d.ts.map +1 -1
- package/dist/audit/cli/functionalPreflight.js +5 -1
- package/dist/audit/cli/functionalPreflight.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 +21 -3
- 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/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/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/analyzers/complexityDuplication.d.ts +50 -10
- package/dist/audit/extractors/analyzers/complexityDuplication.d.ts.map +1 -1
- package/dist/audit/extractors/analyzers/complexityDuplication.js +175 -27
- package/dist/audit/extractors/analyzers/complexityDuplication.js.map +1 -1
- package/dist/audit/extractors/designAssessment.d.ts.map +1 -1
- package/dist/audit/extractors/designAssessment.js +186 -143
- package/dist/audit/extractors/designAssessment.js.map +1 -1
- package/dist/audit/extractors/docsDigest.d.ts.map +1 -1
- package/dist/audit/extractors/docsDigest.js +6 -0
- package/dist/audit/extractors/docsDigest.js.map +1 -1
- package/dist/audit/extractors/flows.d.ts +9 -5
- package/dist/audit/extractors/flows.d.ts.map +1 -1
- package/dist/audit/extractors/flows.js +59 -9
- package/dist/audit/extractors/flows.js.map +1 -1
- package/dist/audit/extractors/graph.d.ts +8 -1
- package/dist/audit/extractors/graph.d.ts.map +1 -1
- package/dist/audit/extractors/graph.js +16 -6
- package/dist/audit/extractors/graph.js.map +1 -1
- package/dist/audit/extractors/graphSignals.d.ts +9 -1
- 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 +5 -0
- package/dist/audit/extractors/pathPatterns.d.ts.map +1 -1
- package/dist/audit/extractors/pathPatterns.js +47 -3
- package/dist/audit/extractors/pathPatterns.js.map +1 -1
- package/dist/audit/extractors/risk.d.ts.map +1 -1
- package/dist/audit/extractors/risk.js +3 -6
- package/dist/audit/extractors/risk.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/artifactMetadata.d.ts.map +1 -1
- package/dist/audit/orchestrator/artifactMetadata.js +7 -0
- package/dist/audit/orchestrator/artifactMetadata.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 +21 -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 +107 -9
- package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
- package/dist/audit/orchestrator/ingestionExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/ingestionExecutors.js +8 -4
- package/dist/audit/orchestrator/ingestionExecutors.js.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointExecutor.js +43 -24
- package/dist/audit/orchestrator/intentCheckpointExecutor.js.map +1 -1
- package/dist/audit/orchestrator/planningExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/planningExecutors.js +3 -3
- package/dist/audit/orchestrator/planningExecutors.js.map +1 -1
- package/dist/audit/orchestrator/runtimeValidation.d.ts +6 -0
- package/dist/audit/orchestrator/runtimeValidation.d.ts.map +1 -1
- package/dist/audit/orchestrator/runtimeValidation.js +26 -0
- package/dist/audit/orchestrator/runtimeValidation.js.map +1 -1
- package/dist/audit/orchestrator/state.d.ts.map +1 -1
- package/dist/audit/orchestrator/state.js +4 -2
- package/dist/audit/orchestrator/state.js.map +1 -1
- package/dist/audit/orchestrator/structureExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/structureExecutors.js +2 -1
- package/dist/audit/orchestrator/structureExecutors.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/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/artifactMetadata.d.ts +2 -0
- package/dist/audit/types/artifactMetadata.d.ts.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/shared/analyzers/acquisitionEngine.d.ts +18 -0
- package/dist/shared/analyzers/acquisitionEngine.d.ts.map +1 -1
- package/dist/shared/analyzers/acquisitionEngine.js +19 -1
- package/dist/shared/analyzers/acquisitionEngine.js.map +1 -1
- package/dist/shared/analyzers/candidates.d.ts.map +1 -1
- package/dist/shared/analyzers/candidates.js +103 -7
- package/dist/shared/analyzers/candidates.js.map +1 -1
- 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 +1 -1
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/prompts.js +1 -1
- package/dist/shared/prompts.js.map +1 -1
- package/package.json +1 -1
|
@@ -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,M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enge.test.ts, tests/audit/review-file-map-context.test.ts
|
|
1
|
+
// sites-pinned: tests/audit/systemic-challenge.test.ts, tests/audit/review-file-map-context.test.ts, tests/audit/review-evidence-right-sizing.test.ts
|
|
2
2
|
/**
|
|
3
3
|
* The VERIFIED CALL-SITE MAP a design-review round receives as a read-only,
|
|
4
4
|
* provenanced input.
|
|
@@ -14,33 +14,69 @@
|
|
|
14
14
|
* So the map is derived ONCE, by the tool, from artifacts the round did not
|
|
15
15
|
* produce either (the repository manifest and the dependency graph the audit
|
|
16
16
|
* pipeline already extracted), and handed over labelled as prior verified recon.
|
|
17
|
-
* It is a lane ASSET, not a submission: the
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* only thing it hands over is its own findings. Updates
|
|
17
|
+
* It is a lane ASSET, not a submission: each slice reaches the round as a
|
|
18
|
+
* READ-ONLY context file the lane materializer writes and binds into the lane's
|
|
19
|
+
* review binding, so acceptance re-hashes it and refuses a submission made
|
|
20
|
+
* against an edited copy; the prompt carries only the index and the provenance
|
|
21
|
+
* (`reviewFileMapContext`). No file is on a path any lane's write scope covers,
|
|
22
|
+
* and no submission schema has a field for it — a round has no route by which to
|
|
23
|
+
* write back, because the only thing it hands over is its own findings. Updates
|
|
25
24
|
* go through a separate recon pass (the graph builder), which is the only thing
|
|
26
25
|
* that can change what the next round receives. Otherwise the map quietly
|
|
27
26
|
* absorbs one reviewer's assumption and reaches the next reviewer as fact.
|
|
28
27
|
*
|
|
29
|
-
* The map is SCOPED to what the reading round
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* the
|
|
28
|
+
* The map is SCOPED to what the reading round judges — which only the consumer
|
|
29
|
+
* knows: every file in that scope gets an anchor carrying its COMPLETE caller and
|
|
30
|
+
* callee lists, and nothing outside it is anchored. There is no cap. An earlier
|
|
31
|
+
* version anchored the path-sorted FIRST 60 authored files and listed at most 25
|
|
32
|
+
* call sites each — neither number measured. Whatever the map leaves out
|
|
33
|
+
* (in-scope files with no edge, files outside the scope, graph buckets that are
|
|
34
|
+
* not call sites) is STATED: a silently thin map reads as a complete one.
|
|
35
|
+
*
|
|
36
|
+
* It is SLICED by unit, not capped. The uncapped map was one file — 480 KB and
|
|
37
|
+
* 2,563 lines for the six starting-point units of the 0.55.15 dogfood run — and
|
|
38
|
+
* every lane told to read it whole fell back to grep. The prompt now carries a
|
|
39
|
+
* compact index (one row per unit: its counts and its slice file) and each unit's
|
|
40
|
+
* anchors live in their own slice, so a lane reads exactly the slices of the
|
|
41
|
+
* units it judges, each whole. Only call-site buckets feed it
|
|
42
|
+
* (`isDependencyEdgeBucket`): a co-changed file is not a caller.
|
|
39
43
|
*
|
|
40
44
|
* Deterministic and content-derived: every array is ordered by a stable key, so
|
|
41
|
-
*
|
|
45
|
+
* no file churns between emissions of an unchanged round.
|
|
42
46
|
*/
|
|
43
47
|
import { compareCodeUnits } from "audit-tools/shared";
|
|
48
|
+
import { isDependencyEdgeBucket } from "../extractors/graphSignals.js";
|
|
49
|
+
const REVIEW_FILE_MAP_PREFIX = "review-call-site-map";
|
|
50
|
+
/**
|
|
51
|
+
* A slice file name unique within one map. Uniqueness is checked on the
|
|
52
|
+
* CASE-FOLDED name: unit ids `Unit` and `unit` would otherwise name two files
|
|
53
|
+
* that are one file on a case-insensitive filesystem (win32, default darwin),
|
|
54
|
+
* and one slice would overwrite the other.
|
|
55
|
+
*/
|
|
56
|
+
function sliceFilename(unitId, used) {
|
|
57
|
+
const slug = (unitId ?? "unassigned").replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "unit";
|
|
58
|
+
let name = `${REVIEW_FILE_MAP_PREFIX}.${slug}.md`;
|
|
59
|
+
for (let suffix = 2; used.has(name.toLowerCase()); suffix += 1) {
|
|
60
|
+
name = `${REVIEW_FILE_MAP_PREFIX}.${slug}-${suffix}.md`;
|
|
61
|
+
}
|
|
62
|
+
used.add(name.toLowerCase());
|
|
63
|
+
return name;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Which unit owns each file: the FIRST unit, in the order given, that lists it.
|
|
67
|
+
* The one ownership rule the map's slices and any per-unit count a consumer
|
|
68
|
+
* renders beside them both read, so a file two units list is counted once.
|
|
69
|
+
*/
|
|
70
|
+
export function unitOwnership(units) {
|
|
71
|
+
const owner = new Map();
|
|
72
|
+
for (const unit of units) {
|
|
73
|
+
for (const file of unit.files) {
|
|
74
|
+
if (!owner.has(file))
|
|
75
|
+
owner.set(file, unit.unit_id);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return owner;
|
|
79
|
+
}
|
|
44
80
|
/**
|
|
45
81
|
* Build the map from the dependency graph the audit already extracted. Edges are
|
|
46
82
|
* read in both directions per anchor — callers and callees — because the review
|
|
@@ -52,12 +88,18 @@ import { compareCodeUnits } from "audit-tools/shared";
|
|
|
52
88
|
export function buildReviewFileMap(bundle, scope) {
|
|
53
89
|
const graphs = bundle.graph_bundle?.graphs;
|
|
54
90
|
const sources = [];
|
|
91
|
+
const omittedSources = [];
|
|
55
92
|
const outgoing = new Map();
|
|
56
93
|
const incoming = new Map();
|
|
57
94
|
let edgeCount = 0;
|
|
58
95
|
for (const [kind, edges] of Object.entries(graphs ?? {})) {
|
|
59
96
|
if (!Array.isArray(edges))
|
|
60
97
|
continue;
|
|
98
|
+
if (!isDependencyEdgeBucket(kind)) {
|
|
99
|
+
if (edges.length > 0)
|
|
100
|
+
omittedSources.push(`${kind} (${edges.length} edge(s))`);
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
61
103
|
let kindCount = 0;
|
|
62
104
|
for (const edge of edges) {
|
|
63
105
|
if (typeof edge !== "object" ||
|
|
@@ -78,6 +120,7 @@ export function buildReviewFileMap(bundle, scope) {
|
|
|
78
120
|
edgeCount += kindCount;
|
|
79
121
|
}
|
|
80
122
|
sources.sort(compareCodeUnits);
|
|
123
|
+
omittedSources.sort(compareCodeUnits);
|
|
81
124
|
const inScope = [...new Set(scope.files)].sort(compareCodeUnits);
|
|
82
125
|
const inScopeSet = new Set(inScope);
|
|
83
126
|
const outsideScope = (bundle.repo_manifest?.files ?? []).filter((file) => !inScopeSet.has(file.path)).length;
|
|
@@ -86,17 +129,42 @@ export function buildReviewFileMap(bundle, scope) {
|
|
|
86
129
|
for (const path of inScope) {
|
|
87
130
|
const callers = [...(incoming.get(path) ?? [])].sort(compareCodeUnits);
|
|
88
131
|
const callees = [...(outgoing.get(path) ?? [])].sort(compareCodeUnits);
|
|
132
|
+
const notes = [...(scope.notes?.get(path) ?? [])];
|
|
89
133
|
if (callers.length === 0 && callees.length === 0) {
|
|
90
134
|
filesWithoutEdges += 1;
|
|
91
|
-
|
|
135
|
+
if (notes.length === 0)
|
|
136
|
+
continue;
|
|
92
137
|
}
|
|
93
|
-
anchors.push({ path, callers, callees });
|
|
138
|
+
anchors.push({ path, callers, callees, notes });
|
|
139
|
+
}
|
|
140
|
+
// Slice by unit: the consumer's units in its order, else the manifest's by id.
|
|
141
|
+
const units = scope.units ??
|
|
142
|
+
[...(bundle.unit_manifest?.units ?? [])].sort((a, b) => compareCodeUnits(a.unit_id, b.unit_id));
|
|
143
|
+
const owner = unitOwnership(units);
|
|
144
|
+
const used = new Set();
|
|
145
|
+
const slices = [];
|
|
146
|
+
const seenUnits = new Set();
|
|
147
|
+
for (const unit of units) {
|
|
148
|
+
if (seenUnits.has(unit.unit_id))
|
|
149
|
+
continue;
|
|
150
|
+
seenUnits.add(unit.unit_id);
|
|
151
|
+
const unitFiles = inScope.filter((file) => owner.get(file) === unit.unit_id);
|
|
152
|
+
// The consumer's units are all listed (they ARE its index); the manifest's
|
|
153
|
+
// only where they hold a file under review.
|
|
154
|
+
if (unitFiles.length === 0 && scope.units === undefined)
|
|
155
|
+
continue;
|
|
156
|
+
slices.push({ unit_id: unit.unit_id, filename: sliceFilename(unit.unit_id, used), files: unitFiles });
|
|
157
|
+
}
|
|
158
|
+
const unassigned = inScope.filter((file) => !owner.has(file));
|
|
159
|
+
if (unassigned.length > 0) {
|
|
160
|
+
slices.push({ unit_id: null, filename: sliceFilename(null, used), files: unassigned });
|
|
94
161
|
}
|
|
95
162
|
return {
|
|
96
163
|
provenance: {
|
|
97
164
|
author: "tool",
|
|
98
165
|
sources,
|
|
99
166
|
edge_count: edgeCount,
|
|
167
|
+
omitted_sources: omittedSources,
|
|
100
168
|
graph_present: graphs !== undefined,
|
|
101
169
|
},
|
|
102
170
|
scope: {
|
|
@@ -106,96 +174,100 @@ export function buildReviewFileMap(bundle, scope) {
|
|
|
106
174
|
},
|
|
107
175
|
anchors,
|
|
108
176
|
files_without_edges: filesWithoutEdges,
|
|
177
|
+
slices,
|
|
109
178
|
};
|
|
110
179
|
}
|
|
180
|
+
function sliceAnchors(map, slice) {
|
|
181
|
+
const files = new Set(slice.files);
|
|
182
|
+
return map.anchors.filter((anchor) => files.has(anchor.path));
|
|
183
|
+
}
|
|
184
|
+
function unitLabel(slice) {
|
|
185
|
+
return slice.unit_id ?? "(no unit)";
|
|
186
|
+
}
|
|
111
187
|
/**
|
|
112
|
-
* Render
|
|
113
|
-
*
|
|
114
|
-
*
|
|
188
|
+
* Render one slice: a short provenance header, then every anchor of the unit with
|
|
189
|
+
* its complete caller and callee lists and its notes. Returned as text rather
|
|
190
|
+
* than JSON so a lane reads it as data-that-was-handed-over.
|
|
115
191
|
*/
|
|
116
|
-
export function
|
|
192
|
+
export function renderReviewFileMapSlice(map, slice) {
|
|
193
|
+
const anchors = sliceAnchors(map, slice);
|
|
194
|
+
const edgeless = slice.files.length - anchors.filter((a) => a.callers.length + a.callees.length > 0).length;
|
|
117
195
|
const lines = [
|
|
118
|
-
|
|
196
|
+
`### Call-site map slice — unit ${unitLabel(slice)} (provenance: machine-derived prior recon — you did NOT author this)`,
|
|
119
197
|
"",
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"expected to TRUST it as a starting point, not to reproduce it.",
|
|
198
|
+
"Derived by the audit tool from this run's dependency graph (call-site buckets only). Read-only " +
|
|
199
|
+
"and bound into your review: if it disagrees with the source, say so in your finding and name the " +
|
|
200
|
+
"file and symbol that contradict it.",
|
|
124
201
|
"",
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
"recon is shared.",
|
|
131
|
-
"",
|
|
132
|
-
`Edges consulted: ${map.provenance.edge_count}` +
|
|
133
|
-
(map.provenance.sources.length > 0
|
|
134
|
-
? ` — from ${map.provenance.sources.join(", ")}.`
|
|
135
|
-
: map.provenance.graph_present
|
|
136
|
-
? " — the dependency graph carried no edges."
|
|
137
|
-
: " — no dependency graph was available."),
|
|
138
|
-
"",
|
|
139
|
-
`Scope: ${map.scope.basis} — ${map.scope.file_count} file(s) under review. Every one the graph ` +
|
|
140
|
-
"connects is listed below with its COMPLETE caller and callee lists; nothing is capped.",
|
|
202
|
+
`${slice.files.length} file(s) of this unit are under review; ${anchors.length} are listed below ` +
|
|
203
|
+
`with their COMPLETE caller and callee lists; ${edgeless} carry no graph edge` +
|
|
204
|
+
(edgeless > 0
|
|
205
|
+
? " — an absent edge is a gap in this extraction, not a finding that nothing depends on the file."
|
|
206
|
+
: "."),
|
|
141
207
|
"",
|
|
142
208
|
];
|
|
143
|
-
|
|
144
|
-
lines.push(`${map.scope.outside_scope} other authored file(s) lie outside this scope and are not ` +
|
|
145
|
-
"anchored; they still appear as callers or callees wherever an edge reaches them. An " +
|
|
146
|
-
"unanchored file is outside this map, not unconnected — derive its call sites yourself " +
|
|
147
|
-
"if your review follows the code there.", "");
|
|
148
|
-
}
|
|
149
|
-
const noEdgeLine = (count) => `${count} authored file(s) carry no graph edge and are NOT listed — their absence is a gap ` +
|
|
150
|
-
"in this extraction, not a finding that nothing depends on them.";
|
|
151
|
-
if (map.anchors.length === 0) {
|
|
152
|
-
lines.push("No call sites are mapped (no graph edges connect the authored files). Treat this as NO " +
|
|
153
|
-
"RECON rather than as a map showing everything is unconnected — the absence of an edge in " +
|
|
154
|
-
"this repository's extraction is not evidence that no caller exists.", "");
|
|
155
|
-
if (map.files_without_edges > 0) {
|
|
156
|
-
lines.push(noEdgeLine(map.files_without_edges), "");
|
|
157
|
-
}
|
|
158
|
-
return lines;
|
|
159
|
-
}
|
|
160
|
-
for (const anchor of map.anchors) {
|
|
209
|
+
for (const anchor of anchors) {
|
|
161
210
|
lines.push(`- **${anchor.path}**`);
|
|
162
211
|
lines.push(` - referenced by: ${anchor.callers.join(", ") || "(none recorded)"}`);
|
|
163
212
|
lines.push(` - references: ${anchor.callees.join(", ") || "(none recorded)"}`);
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
// In-scope files the graph has no edge for at all: a drop, so it is stated.
|
|
167
|
-
lines.push("", `⚠ ${noEdgeLine(map.files_without_edges)}`);
|
|
213
|
+
for (const note of anchor.notes)
|
|
214
|
+
lines.push(` - lead: ${note}`);
|
|
168
215
|
}
|
|
169
216
|
lines.push("");
|
|
170
217
|
return lines;
|
|
171
218
|
}
|
|
172
|
-
/** The context file's name. Its directory is content-addressed by the lane materializer. */
|
|
173
|
-
const REVIEW_FILE_MAP_FILENAME = "review-call-site-map.md";
|
|
174
219
|
/**
|
|
175
|
-
* Split one map into the prompt
|
|
176
|
-
* two cannot come from different builds. The
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
* materializer lists under its "Read-only context files" section.
|
|
220
|
+
* Split one map into the prompt's index and the read-only slice files, so the
|
|
221
|
+
* two cannot come from different builds. The index states the provenance, the
|
|
222
|
+
* read-only rule, every count, the omitted buckets, and one row per unit naming
|
|
223
|
+
* its slice — the lane materializer lists each slice's full path under its
|
|
224
|
+
* "Read-only context files" section.
|
|
181
225
|
*/
|
|
182
|
-
export function reviewFileMapContext(map) {
|
|
226
|
+
export function reviewFileMapContext(map, options = {}) {
|
|
183
227
|
const noRecon = "so the map is NO RECON — an absent edge is not evidence that no caller exists";
|
|
184
228
|
const edges = map.provenance.sources.length > 0
|
|
185
229
|
? `from ${map.provenance.sources.join(", ")}`
|
|
186
230
|
: map.provenance.graph_present
|
|
187
|
-
? `the dependency graph carried no edges, ${noRecon}`
|
|
231
|
+
? `the dependency graph carried no call-site edges, ${noRecon}`
|
|
188
232
|
: `no dependency graph was available, ${noRecon}`;
|
|
233
|
+
const contextFiles = [];
|
|
234
|
+
const sliced = new Set();
|
|
235
|
+
for (const slice of map.slices) {
|
|
236
|
+
if (sliceAnchors(map, slice).length === 0)
|
|
237
|
+
continue;
|
|
238
|
+
sliced.add(slice.filename);
|
|
239
|
+
contextFiles.push({
|
|
240
|
+
filename: slice.filename,
|
|
241
|
+
label: `Call-site map slice — unit ${unitLabel(slice)} (tool-generated prior recon)`,
|
|
242
|
+
text: renderReviewFileMapSlice(map, slice).join("\n"),
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
const columns = options.columns ?? [];
|
|
246
|
+
const header = ["unit", "files under review", "anchored", "no graph edge", ...columns.map((c) => c.header), "slice file"];
|
|
247
|
+
const rows = map.slices.map((slice) => {
|
|
248
|
+
const anchors = sliceAnchors(map, slice);
|
|
249
|
+
const edgeless = slice.files.length - anchors.filter((a) => a.callers.length + a.callees.length > 0).length;
|
|
250
|
+
return [
|
|
251
|
+
unitLabel(slice),
|
|
252
|
+
String(slice.files.length),
|
|
253
|
+
String(anchors.length),
|
|
254
|
+
String(edgeless),
|
|
255
|
+
...columns.map((column) => column.cell(slice.unit_id)),
|
|
256
|
+
sliced.has(slice.filename) ? `\`${slice.filename}\`` : "—",
|
|
257
|
+
];
|
|
258
|
+
});
|
|
189
259
|
const summaryLines = [
|
|
190
260
|
"### Verified call-site map (provenance: machine-derived prior recon — you did NOT author this)",
|
|
191
261
|
"",
|
|
192
262
|
"The audit tool derived a call-site map from the dependency graph and the repository manifest " +
|
|
193
|
-
|
|
194
|
-
'
|
|
195
|
-
"
|
|
196
|
-
"
|
|
263
|
+
"extracted earlier in this run and wrote it as one read-only SLICE file per unit, indexed below; " +
|
|
264
|
+
'each slice\'s full path is listed under "Read-only context files" at the end of this prompt. ' +
|
|
265
|
+
"Before re-deriving any call site, find the unit of the file you are judging in the index and read " +
|
|
266
|
+
"that unit's slice whole — it lists every anchored file of the unit with its complete caller and " +
|
|
267
|
+
"callee lists. Read only the slices of the units you judge. It is a factual input handed to you so " +
|
|
268
|
+
"this round spends its budget on judgment: TRUST it as a starting point, do not reproduce it.",
|
|
197
269
|
"",
|
|
198
|
-
"**You cannot write back to it.**
|
|
270
|
+
"**You cannot write back to it.** Every slice is read-only and bound into this review, so a " +
|
|
199
271
|
"submission made against an edited copy is refused, and a correction reaches the next round " +
|
|
200
272
|
"only through a fresh extraction pass. If it disagrees with what you find in the source, say " +
|
|
201
273
|
"so explicitly in your finding — name the file and the symbol that contradicts the map. Your " +
|
|
@@ -203,18 +275,23 @@ export function reviewFileMapContext(map) {
|
|
|
203
275
|
"",
|
|
204
276
|
`Scope: ${map.scope.basis} — ${map.scope.file_count} file(s) under review; ` +
|
|
205
277
|
`${map.anchors.length} anchored with their complete caller and callee lists; ` +
|
|
206
|
-
`${map.files_without_edges} carry no graph edge
|
|
207
|
-
|
|
278
|
+
`${map.files_without_edges} carry no graph edge (an absent edge is a gap in this extraction, ` +
|
|
279
|
+
"not a finding that nothing depends on the file); " +
|
|
280
|
+
`${map.scope.outside_scope} other authored file(s) lie outside this scope and are not anchored ` +
|
|
281
|
+
"(outside this map, not unconnected — they still appear as callers or callees wherever an edge " +
|
|
282
|
+
"reaches them).",
|
|
208
283
|
`Edges consulted: ${map.provenance.edge_count} — ${edges}.`,
|
|
284
|
+
...(map.provenance.omitted_sources.length > 0
|
|
285
|
+
? [
|
|
286
|
+
`Not read: ${map.provenance.omitted_sources.join(", ")} — not a call site (co_change records ` +
|
|
287
|
+
"files changed in the same commits; routes is not an edge list), so not listed.",
|
|
288
|
+
]
|
|
289
|
+
: []),
|
|
209
290
|
"",
|
|
210
291
|
];
|
|
211
|
-
|
|
212
|
-
summaryLines,
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
label: "Verified call-site map (tool-generated prior recon)",
|
|
216
|
-
text: renderReviewFileMap(map).join("\n"),
|
|
217
|
-
},
|
|
218
|
-
};
|
|
292
|
+
if (rows.length > 0) {
|
|
293
|
+
summaryLines.push(`| ${header.join(" | ")} |`, `|${header.map(() => "---").join("|")}|`, ...rows.map((row) => `| ${row.join(" | ")} |`), "");
|
|
294
|
+
}
|
|
295
|
+
return { summaryLines, contextFiles };
|
|
219
296
|
}
|
|
220
297
|
//# sourceMappingURL=reviewFileMap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reviewFileMap.js","sourceRoot":"","sources":["../../../src/audit/systemic/reviewFileMap.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"reviewFileMap.js","sourceRoot":"","sources":["../../../src/audit/systemic/reviewFileMap.ts"],"names":[],"mappings":"AAAA,sJAAsJ;AACtJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AA0FvE,MAAM,sBAAsB,GAAG,sBAAsB,CAAC;AAEtD;;;;;GAKG;AACH,SAAS,aAAa,CAAC,MAAqB,EAAE,IAAiB;IAC7D,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,YAAY,CAAC,CAAC,OAAO,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC;IAC1G,IAAI,IAAI,GAAG,GAAG,sBAAsB,IAAI,IAAI,KAAK,CAAC;IAClD,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC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wCAAwC;oBAC5F,gFAAgF;aACnF;YACH,CAAC,CAAC,EAAE,CAAC;QACP,EAAE;KACH,CAAC;IACF,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,YAAY,CAAC,IAAI,CACf,KAAK,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAC3B,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EACxC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAC9C,EAAE,CACH,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -2,16 +2,25 @@ import type { ArtifactBundle } from "../io/artifacts.js";
|
|
|
2
2
|
import type { AggregateMetricsDigest } from "./aggregateMetricsDigest.js";
|
|
3
3
|
import { type ReviewFileMapContext } from "./reviewFileMap.js";
|
|
4
4
|
/**
|
|
5
|
-
* The call-site map a systemic challenge round receives: the
|
|
6
|
-
* carries and the read-only
|
|
5
|
+
* The call-site map a systemic challenge round receives: the index its prompt
|
|
6
|
+
* carries and the read-only slice files its emission site passes to the lane
|
|
7
7
|
* materializer. The same build `renderSecondOrderAdversaryPrompt` summarizes.
|
|
8
8
|
*/
|
|
9
9
|
export declare function adversaryFileMapContext(bundle: ArtifactBundle): ReviewFileMapContext;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* The raw artifacts a systemic round is GRANTED as reference. Each is already
|
|
12
|
+
* projected into the prompt (charter register, adjudication) or into the map
|
|
13
|
+
* slices (the deterministic leads), so none is required reading.
|
|
14
|
+
* `design_assessment.json` is deliberately absent: 445 KB in the 0.55.15 dogfood
|
|
15
|
+
* run, nearly all metric leads, and every part a round needs is already in the
|
|
16
|
+
* prompt (the banked contract/conceptual findings) or in the slices (the leads
|
|
17
|
+
* on uncovered ground).
|
|
18
|
+
*/
|
|
19
|
+
export declare function systemicEvidencePaths(bundle: ArtifactBundle, artifactsDir: string): string[];
|
|
20
|
+
/**
|
|
21
|
+
* Render one systemic challenge round. `evidencePaths` are granted in the host
|
|
22
|
+
* step's read set as REFERENCE (`systemicEvidencePaths`); the prompt carries
|
|
23
|
+
* their projections, so the round opens one only to check a specific claim.
|
|
15
24
|
*/
|
|
16
25
|
export declare function renderSecondOrderAdversaryPrompt(opts: {
|
|
17
26
|
round: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secondOrderAdversaryPrompt.d.ts","sourceRoot":"","sources":["../../../src/audit/systemic/secondOrderAdversaryPrompt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"secondOrderAdversaryPrompt.d.ts","sourceRoot":"","sources":["../../../src/audit/systemic/secondOrderAdversaryPrompt.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAK1E,OAAO,EAIL,KAAK,oBAAoB,EAG1B,MAAM,oBAAoB,CAAC;AAoF5B;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,cAAc,GAAG,oBAAoB,CAGpF;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAU5F;AAwLD;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,IAAI,EAAE;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,sBAAsB,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,cAAc,CAAC;IACvB,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC,GAAG,MAAM,CAyKT"}
|