audit-tools 0.30.37 → 0.30.39
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/prompts.d.ts +2 -0
- package/dist/audit/cli/prompts.d.ts.map +1 -1
- package/dist/audit/cli/prompts.js +7 -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 +15 -0
- package/dist/audit/cli/semanticReviewStep.js.map +1 -1
- package/dist/audit/extractors/gitHistory.d.ts +8 -0
- package/dist/audit/extractors/gitHistory.d.ts.map +1 -1
- package/dist/audit/extractors/gitHistory.js +15 -4
- package/dist/audit/extractors/gitHistory.js.map +1 -1
- package/dist/audit/orchestrator/artifactMetadata.d.ts.map +1 -1
- package/dist/audit/orchestrator/artifactMetadata.js +19 -0
- package/dist/audit/orchestrator/artifactMetadata.js.map +1 -1
- package/dist/audit/orchestrator/coverageElementBaseline.d.ts +54 -0
- package/dist/audit/orchestrator/coverageElementBaseline.d.ts.map +1 -0
- package/dist/audit/orchestrator/coverageElementBaseline.js +138 -0
- package/dist/audit/orchestrator/coverageElementBaseline.js.map +1 -0
- package/dist/audit/orchestrator/gitHistoryBaseline.d.ts +33 -0
- package/dist/audit/orchestrator/gitHistoryBaseline.d.ts.map +1 -0
- package/dist/audit/orchestrator/gitHistoryBaseline.js +69 -0
- package/dist/audit/orchestrator/gitHistoryBaseline.js.map +1 -0
- package/dist/audit/orchestrator/planningExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/planningExecutors.js +14 -0
- package/dist/audit/orchestrator/planningExecutors.js.map +1 -1
- package/dist/audit/orchestrator/structureExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/structureExecutors.js +30 -3
- package/dist/audit/orchestrator/structureExecutors.js.map +1 -1
- package/dist/audit/types/artifactMetadata.d.ts +35 -0
- package/dist/audit/types/artifactMetadata.d.ts.map +1 -1
- package/dist/audit/validation/auditResults.d.ts +7 -0
- package/dist/audit/validation/auditResults.d.ts.map +1 -1
- package/dist/audit/validation/auditResults.js +43 -8
- package/dist/audit/validation/auditResults.js.map +1 -1
- package/dist/remediate/steps/nextStep.d.ts.map +1 -1
- package/dist/remediate/steps/nextStep.js +13 -1
- package/dist/remediate/steps/nextStep.js.map +1 -1
- package/dist/shared/git.d.ts +8 -0
- package/dist/shared/git.d.ts.map +1 -1
- package/dist/shared/git.js +17 -0
- package/dist/shared/git.js.map +1 -1
- package/dist/shared/index.d.ts +4 -3
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +3 -2
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/quota/dispatchDriverPrompt.d.ts +15 -0
- package/dist/shared/quota/dispatchDriverPrompt.d.ts.map +1 -0
- package/dist/shared/quota/dispatchDriverPrompt.js +40 -0
- package/dist/shared/quota/dispatchDriverPrompt.js.map +1 -0
- package/dist/shared/quota/scheduler.d.ts +50 -0
- package/dist/shared/quota/scheduler.d.ts.map +1 -1
- package/dist/shared/quota/scheduler.js +47 -0
- package/dist/shared/quota/scheduler.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@ export declare function renderDispatchReviewPrompt(params: {
|
|
|
11
11
|
dispatchQuotaPath: string | null;
|
|
12
12
|
hostCanRestrictSubagentTools: boolean;
|
|
13
13
|
hostCanSelectSubagentModel: boolean;
|
|
14
|
+
driverInstruction?: string;
|
|
14
15
|
}): string;
|
|
15
16
|
export declare function renderSingleTaskFallbackStepPrompt(params: {
|
|
16
17
|
singleTaskPromptPath: string;
|
|
@@ -44,6 +45,7 @@ export declare function renderRollingDispatchPrompt(params: {
|
|
|
44
45
|
dispatchQuotaPath: string | null;
|
|
45
46
|
hostCanRestrictSubagentTools: boolean;
|
|
46
47
|
hostCanSelectSubagentModel: boolean;
|
|
48
|
+
driverInstruction?: string;
|
|
47
49
|
}): string;
|
|
48
50
|
export declare function renderPresentReportPrompt(finalReportPath: string, triage?: FrictionTriageDecision): string;
|
|
49
51
|
export declare function renderAnalyzerInstallPrompt(params: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/audit/cli/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AA8B1E,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAS1E;AAED,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,GACZ,MAAM,CASR;
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/audit/cli/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AA8B1E,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAS1E;AAED,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,GACZ,MAAM,CASR;AAsCD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,eAAe,CAAC;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,4BAA4B,EAAE,OAAO,CAAC;IACtC,0BAA0B,EAAE,OAA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AuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAW9D"}
|
|
@@ -49,7 +49,7 @@ export function mergeAndIngestCommand(artifactsDir, runId) {
|
|
|
49
49
|
* Build the dispatch data lines (plan/quota reading instructions) shared
|
|
50
50
|
* between the dispatch-review and rolling-dispatch prompts.
|
|
51
51
|
*/
|
|
52
|
-
function buildDispatchDataLines(dispatchPlanPath, dispatchQuotaPath, sessionLimitNote) {
|
|
52
|
+
function buildDispatchDataLines(dispatchPlanPath, dispatchQuotaPath, sessionLimitNote, driverInstruction) {
|
|
53
53
|
return dispatchQuotaPath
|
|
54
54
|
? [
|
|
55
55
|
"Read these generated files:",
|
|
@@ -60,6 +60,10 @@ function buildDispatchDataLines(dispatchPlanPath, dispatchQuotaPath, sessionLimi
|
|
|
60
60
|
"Use `max_concurrent_agents` from the quota data. If `cooldown_until` is non-null, wait until that timestamp before dispatching.",
|
|
61
61
|
"",
|
|
62
62
|
"Maintain up to `max_concurrent_agents` subagents running simultaneously. As each completes and its result is captured, immediately dispatch the next pending entry. If you hit a rate limit (429/TPM/RPM), pause until the reset time clears, then continue.",
|
|
63
|
+
// S-BROKER-WIRING: the tool-chosen driver (delegate the rolling loop to a
|
|
64
|
+
// dispatcher subagent vs. drive it from the top host). Single-sourced via
|
|
65
|
+
// renderDispatchDriverInstruction so audit + remediate can't drift.
|
|
66
|
+
...(driverInstruction ? ["", driverInstruction] : []),
|
|
63
67
|
"",
|
|
64
68
|
sessionLimitNote,
|
|
65
69
|
]
|
|
@@ -83,7 +87,7 @@ export function renderDispatchReviewPrompt(params) {
|
|
|
83
87
|
const toolsLine = params.hostCanRestrictSubagentTools
|
|
84
88
|
? "Restrict review subagents to read/search plus the packet submit command named in their prompt. Do not give them source edit/write tools."
|
|
85
89
|
: "Do not ask the user about per-subagent tool restrictions; this host did not report a callable restriction facility.";
|
|
86
|
-
const dispatchDataLines = buildDispatchDataLines(params.dispatchPlanPath, params.dispatchQuotaPath, 'If a subagent reports a host session/usage limit (e.g. "hit your session limit · resets <time>") instead of submitting its result, do not immediately re-dispatch it: run merge-and-ingest with the results you did get, then wait until the stated reset time before running next-step to re-dispatch the remaining packets.');
|
|
90
|
+
const dispatchDataLines = buildDispatchDataLines(params.dispatchPlanPath, params.dispatchQuotaPath, 'If a subagent reports a host session/usage limit (e.g. "hit your session limit · resets <time>") instead of submitting its result, do not immediately re-dispatch it: run merge-and-ingest with the results you did get, then wait until the stated reset time before running next-step to re-dispatch the remaining packets.', params.driverInstruction);
|
|
87
91
|
const quotaCoverageNudge = renderQuotaCoverageNudge(params.dispatchQuotaPath, params.artifactsDir);
|
|
88
92
|
return [
|
|
89
93
|
"# audit-code dispatch review",
|
|
@@ -215,7 +219,7 @@ export function renderRollingDispatchPrompt(params) {
|
|
|
215
219
|
const toolsLine = params.hostCanRestrictSubagentTools
|
|
216
220
|
? "Restrict review subagents to read/search tools plus a Write tool scoped to their own `entry.result_path` (they write exactly that one results file and run no shell commands). Do not give them source edit tools."
|
|
217
221
|
: "Do not ask the user about per-subagent tool restrictions; this host did not report a callable restriction facility.";
|
|
218
|
-
const dispatchDataLines = buildDispatchDataLines(params.dispatchPlanPath, params.dispatchQuotaPath, 'If a subagent reports a host session/usage limit instead of emitting its result, run merge-and-ingest with the results you did get, then wait until the stated reset time before running next-step to re-dispatch the remaining packets.');
|
|
222
|
+
const dispatchDataLines = buildDispatchDataLines(params.dispatchPlanPath, params.dispatchQuotaPath, 'If a subagent reports a host session/usage limit instead of emitting its result, run merge-and-ingest with the results you did get, then wait until the stated reset time before running next-step to re-dispatch the remaining packets.', params.driverInstruction);
|
|
219
223
|
return [
|
|
220
224
|
"# audit-code rolling dispatch",
|
|
221
225
|
"",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/audit/cli/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,wBAAwB,EACxB,wBAAwB,GAEzB,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AAwC;QACxC,EAAE;QACF,MAAM;QACN,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semanticReviewStep.d.ts","sourceRoot":"","sources":["../../../src/audit/cli/semanticReviewStep.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"semanticReviewStep.d.ts","sourceRoot":"","sources":["../../../src/audit/cli/semanticReviewStep.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAuC,MAAM,oBAAoB,CAAC;AAEpG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAIxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAmB9C,wBAAsB,wBAAwB,CAAC,MAAM,EAAE;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,eAAe,CAAC;IACjC,eAAe,EAAE,OAAO,CAAC;IACzB,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,0EAA0E;IAC1E,eAAe,CAAC,EAAE,oBAAoB,EAAE,GAAG,IAAI,CAAC;IAChD,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,4BAA4B,EAAE,OAAO,CAAC;IACtC,0BAA0B,EAAE,OAAO,CAAC;IACpC,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAsIxD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
+
import { classifyProvider, selectDispatchDriver, renderDispatchDriverInstruction } from "audit-tools/shared";
|
|
2
3
|
import { loadSessionConfig } from "../supervisor/sessionConfig.js";
|
|
3
4
|
import { createFreshSessionProvider } from "../providers/index.js";
|
|
4
5
|
import { renderCommand } from "./args.js";
|
|
@@ -62,6 +63,18 @@ export async function renderSemanticReviewStep(params) {
|
|
|
62
63
|
});
|
|
63
64
|
const mergeCommand = mergeAndIngestCommand(artifactsDir, activeReviewRun.run_id);
|
|
64
65
|
const continueCommand = nextStepCommand(root, artifactsDir);
|
|
66
|
+
// S-BROKER-WIRING: choose the dispatch DRIVER off the single classification +
|
|
67
|
+
// the live packet frontier / concurrency cap, and render the matching host
|
|
68
|
+
// instruction. Only meaningful when there is a quota (a real fan-out); the
|
|
69
|
+
// no-quota path launches one subagent per entry with no rolling loop.
|
|
70
|
+
const hostProvider = sessionConfig.provider ?? "claude-code";
|
|
71
|
+
const driverInstruction = dispatch.dispatch_quota_path
|
|
72
|
+
? renderDispatchDriverInstruction(selectDispatchDriver({
|
|
73
|
+
classification: classifyProvider(hostProvider),
|
|
74
|
+
eligibleItemCount: dispatch.packet_count,
|
|
75
|
+
slots: dispatch.max_concurrent_agents,
|
|
76
|
+
}), "`max_concurrent_agents`")
|
|
77
|
+
: undefined;
|
|
65
78
|
return writeCurrentStep({
|
|
66
79
|
artifactsDir,
|
|
67
80
|
stepKind: "dispatch_review",
|
|
@@ -101,6 +114,7 @@ export async function renderSemanticReviewStep(params) {
|
|
|
101
114
|
dispatchQuotaPath: dispatch.dispatch_quota_path,
|
|
102
115
|
hostCanRestrictSubagentTools: params.hostCanRestrictSubagentTools,
|
|
103
116
|
hostCanSelectSubagentModel: params.hostCanSelectSubagentModel,
|
|
117
|
+
driverInstruction,
|
|
104
118
|
})
|
|
105
119
|
: renderDispatchReviewPrompt({
|
|
106
120
|
root,
|
|
@@ -110,6 +124,7 @@ export async function renderSemanticReviewStep(params) {
|
|
|
110
124
|
dispatchQuotaPath: dispatch.dispatch_quota_path,
|
|
111
125
|
hostCanRestrictSubagentTools: params.hostCanRestrictSubagentTools,
|
|
112
126
|
hostCanSelectSubagentModel: params.hostCanSelectSubagentModel,
|
|
127
|
+
driverInstruction,
|
|
113
128
|
}),
|
|
114
129
|
access: {
|
|
115
130
|
read_paths: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semanticReviewStep.js","sourceRoot":"","sources":["../../../src/audit/cli/semanticReviewStep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"semanticReviewStep.js","sourceRoot":"","sources":["../../../src/audit/cli/semanticReviewStep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAE7G,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,0BAA0B,EAC1B,2BAA2B,EAC3B,kCAAkC,GACnC,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,8EAA8E;AAC9E,4EAA4E;AAC5E,6EAA6E;AAC7E,+EAA+E;AAC/E,yEAAyE;AACzE,EAAE;AACF,yEAAyE;AACzE,+EAA+E;AAC/E,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,MAkB9C;IACC,MAAM,EAAE,IAAI,EAA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mBAAmB;gBAC/C,4BAA4B,EAAE,MAAM,CAAC,4BAA4B;gBACjE,0BAA0B,EAAE,MAAM,CAAC,0BAA0B;gBAC7D,iBAAiB;aAClB,CAAC;QACN,MAAM,EAAE;YACN,UAAU,EAAE;gBACV,QAAQ,CAAC,kBAAkB;gBAC3B,GAAG,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;aACxE;YACD,WAAW,EAAE,EAAE;SAChB;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -30,6 +30,14 @@ declare const GIT_CO_CHANGE_CATEGORY = "co_change";
|
|
|
30
30
|
* shared miner already sorts every list by a total order, and the in-scope
|
|
31
31
|
* filter preserves that order.
|
|
32
32
|
*/
|
|
33
|
+
/**
|
|
34
|
+
* The set of in-scope, graph-normalized path keys the git-history mine is scoped
|
|
35
|
+
* to: every manifest file that is neither file-excluded nor audit-excluded by
|
|
36
|
+
* disposition. SINGLE-SOURCED here so the mine's in-scope filter and the
|
|
37
|
+
* incremental-reuse scope key (`deriveGitHistoryScopeKey`) can never drift in
|
|
38
|
+
* what "in scope" means.
|
|
39
|
+
*/
|
|
40
|
+
export declare function gitHistoryInScopeKeys(repoManifest: RepoManifest, disposition?: FileDisposition): string[];
|
|
33
41
|
export declare function mineGitHistoryArtifact(root: string, repoManifest: RepoManifest, disposition?: FileDisposition): GitHistory;
|
|
34
42
|
/**
|
|
35
43
|
* Project mined co-change pairs into language-neutral, undirected graph edges
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitHistory.d.ts","sourceRoot":"","sources":["../../../src/audit/extractors/gitHistory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,YAAY,EACZ,QAAQ,EACT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,C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AuBvB;AAED,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,CAAC;AAC3D,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAChD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC"}
|
|
@@ -41,18 +41,29 @@ const CHURN_HOTSPOT_FLOOR = 8;
|
|
|
41
41
|
* shared miner already sorts every list by a total order, and the in-scope
|
|
42
42
|
* filter preserves that order.
|
|
43
43
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
/**
|
|
45
|
+
* The set of in-scope, graph-normalized path keys the git-history mine is scoped
|
|
46
|
+
* to: every manifest file that is neither file-excluded nor audit-excluded by
|
|
47
|
+
* disposition. SINGLE-SOURCED here so the mine's in-scope filter and the
|
|
48
|
+
* incremental-reuse scope key (`deriveGitHistoryScopeKey`) can never drift in
|
|
49
|
+
* what "in scope" means.
|
|
50
|
+
*/
|
|
51
|
+
export function gitHistoryInScopeKeys(repoManifest, disposition) {
|
|
46
52
|
const dispositionMap = buildDispositionMap(disposition);
|
|
47
|
-
const
|
|
53
|
+
const keys = [];
|
|
48
54
|
for (const file of repoManifest.files) {
|
|
49
55
|
if (file.excluded)
|
|
50
56
|
continue;
|
|
51
57
|
const status = dispositionMap.get(file.path);
|
|
52
58
|
if (status && isAuditExcludedStatus(status))
|
|
53
59
|
continue;
|
|
54
|
-
|
|
60
|
+
keys.push(graphLookupKey(file.path));
|
|
55
61
|
}
|
|
62
|
+
return keys;
|
|
63
|
+
}
|
|
64
|
+
export function mineGitHistoryArtifact(root, repoManifest, disposition) {
|
|
65
|
+
const history = mineGitHistory(root);
|
|
66
|
+
const inScope = new Set(gitHistoryInScopeKeys(repoManifest, disposition));
|
|
56
67
|
const known = (path) => inScope.has(graphLookupKey(path));
|
|
57
68
|
return {
|
|
58
69
|
co_change: history.co_change.filter((pair) => known(pair.a) && known(pair.b)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitHistory.js","sourceRoot":"","sources":["../../../src/audit/extractors/gitHistory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AASpD,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;;;;;;;;;;;;GAaG;AAEH,MAAM,uBAAuB,GAAG,eAAe,CAAC;AAChD;;;;;;GAMG;AACH,MAAM,sBAAsB,GAAG,WAAW,CAAC;AAC3C;;;;GAIG;AACH,MAAM,yBAAyB,GAAG,GAAG,CAAC;AACtC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAEtC,uEAAuE;AACvE,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACjC,qEAAqE;AACrE,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B;;;;;GAKG;AACH,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"gitHistory.js","sourceRoot":"","sources":["../../../src/audit/extractors/gitHistory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AASpD,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;;;;;;;;;;;;GAaG;AAEH,MAAM,uBAAuB,GAAG,eAAe,CAAC;AAChD;;;;;;GAMG;AACH,MAAM,sBAAsB,GAAG,WAAW,CAAC;AAC3C;;;;GAIG;AACH,MAAM,yBAAyB,GAAG,GAAG,CAAC;AACtC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAEtC,uEAAuE;AACvE,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACjC,qEAAqE;AACrE,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B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,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,mBAAmB,CAAC,EAC9E,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACjC,CAAC;QACD,IACE,IAAI,CAAC,KAAK,CAAC,IAAI,CACb,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,sBAAsB,CACnE,EACD,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACnC,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YAAE,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAGD,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifactMetadata.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/artifactMetadata.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA+CzD,wBAAgB,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAG7E;AAOD,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAO5E;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,cAAc,EACtB,QAAQ,CAAC,EAAE,wBAAwB,EACnC,gBAAgB,GAAE,QAAQ,CAAC,MAAM,CAAM,GACtC,wBAAwB,
|
|
1
|
+
{"version":3,"file":"artifactMetadata.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/artifactMetadata.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA+CzD,wBAAgB,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAG7E;AAOD,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAO5E;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,cAAc,EACtB,QAAQ,CAAC,EAAE,wBAAwB,EACnC,gBAAgB,GAAE,QAAQ,CAAC,MAAM,CAAM,GACtC,wBAAwB,CA2G1B"}
|
|
@@ -122,6 +122,25 @@ export function computeArtifactMetadata(bundle, previous, updatedArtifacts = [])
|
|
|
122
122
|
if (carriedBaselines) {
|
|
123
123
|
manifest.result_baselines = carriedBaselines;
|
|
124
124
|
}
|
|
125
|
+
// Carry the T5 #12 coverage-element baselines forward on the SAME terms as the
|
|
126
|
+
// result baselines (CE-007: only from an F1-current store; prefer the bundle's
|
|
127
|
+
// freshly-recorded set over the pre-executor `usablePrevious`). Dropping an
|
|
128
|
+
// old-shape store makes every coverage element fail safe to re-audit.
|
|
129
|
+
const carriedCoverageBaselines = (bundleIsCurrent ? bundleMetadata?.coverage_element_baselines : undefined) ??
|
|
130
|
+
usablePrevious?.coverage_element_baselines;
|
|
131
|
+
if (carriedCoverageBaselines) {
|
|
132
|
+
manifest.coverage_element_baselines = carriedCoverageBaselines;
|
|
133
|
+
}
|
|
134
|
+
// Carry the T5 #12 git-history baseline forward on the SAME terms (CE-007:
|
|
135
|
+
// only from an F1-current store; prefer the bundle's freshly-recorded baseline
|
|
136
|
+
// — the structure executor stamps it on run.updated — over the pre-executor
|
|
137
|
+
// `usablePrevious`). Dropping an old-shape baseline makes the next structure
|
|
138
|
+
// run re-mine git history (fail-safe).
|
|
139
|
+
const carriedGitHistoryBaseline = (bundleIsCurrent ? bundleMetadata?.git_history_baseline : undefined) ??
|
|
140
|
+
usablePrevious?.git_history_baseline;
|
|
141
|
+
if (carriedGitHistoryBaseline) {
|
|
142
|
+
manifest.git_history_baseline = carriedGitHistoryBaseline;
|
|
143
|
+
}
|
|
125
144
|
return manifest;
|
|
126
145
|
}
|
|
127
146
|
//# sourceMappingURL=artifactMetadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifactMetadata.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/artifactMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAKzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EACL,iBAAiB,EACjB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAEhC,+EAA+E;AAC/E,yEAAyE;AACzE,gEAAgE;AAChE,MAAM,yBAAyB,GAAqB,uBAAuB,CAAC;AAI5E,SAAS,2BAA2B,CAClC,aAA+B;IAE/B,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC;IACtC,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;IACpC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;IAEpC,MAAM,KAAK,GAAG,CAAC,YAAoB,EAAE,EAAE;QACrC,IAAI,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC;YAAE,OAAO;QACxC,IAAI,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC;YAAE,OAAO;QACxC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAE5B,MAAM,YAAY,GAAG,CAAC,yBAAyB,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;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Record, RepoManifest } from "../types.js";
|
|
3
|
+
/** Per-coverage-file baseline: file path → signature-sensitive content key. */
|
|
4
|
+
export type CoverageElementBaselineStore = Record<string, string>;
|
|
5
|
+
/**
|
|
6
|
+
* The per-file content signal that determines whether a file's audit must be
|
|
7
|
+
* redone: the repo-manifest content `hash` when present, else its `size_bytes`.
|
|
8
|
+
* Returns a map keyed by repo-manifest path. Files absent from the manifest (no
|
|
9
|
+
* signal) are simply omitted — a file with no signal gets no baseline and is
|
|
10
|
+
* never preserved (fail-safe to re-audit).
|
|
11
|
+
*/
|
|
12
|
+
export declare function coverageContentSignature(repoManifest: RepoManifest): Record<string, string>;
|
|
13
|
+
/**
|
|
14
|
+
* Derive the signature-SENSITIVE content key for one coverage file from its audit
|
|
15
|
+
* inputs: the file's content signal, its required lenses, and its unit
|
|
16
|
+
* membership. Any change to any input moves the key, forcing a re-audit; an
|
|
17
|
+
* identical set of inputs reproduces the same key, enabling preservation. Lenses
|
|
18
|
+
* and unit ids are sorted so ordering noise never moves the key.
|
|
19
|
+
*/
|
|
20
|
+
export declare function deriveCoverageElementKey(file: CoverageFileRecord, contentSig: string | undefined): string;
|
|
21
|
+
/**
|
|
22
|
+
* Build the fresh per-element baseline store for a coverage matrix: a content key
|
|
23
|
+
* for every file that carries audit work (not excluded). Excluded files are
|
|
24
|
+
* omitted — they have no work to preserve. Pure.
|
|
25
|
+
*/
|
|
26
|
+
export declare function recordCoverageElementBaselines(coverage: CoverageMatrix, contentSigByPath: Record<string, string>): CoverageElementBaselineStore;
|
|
27
|
+
/** Read the carried-forward coverage-element baselines off the artifact metadata. */
|
|
28
|
+
export declare function readCoverageElementBaselines(metadata: ArtifactMetadataManifest | undefined): CoverageElementBaselineStore | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Carry the executor's freshly-recorded coverage-element baselines onto the
|
|
31
|
+
* bundle's artifact metadata so `computeArtifactMetadata` persists them (the same
|
|
32
|
+
* carry-forward path `result_baselines` uses). Returns a new manifest; never
|
|
33
|
+
* mutates the input. Stamps the F1 schema version when seeding a fresh manifest
|
|
34
|
+
* so the CE-007 freshness gate recognizes the store on the next run.
|
|
35
|
+
*/
|
|
36
|
+
export declare function withCoverageElementBaselines(metadata: ArtifactMetadataManifest | undefined, baselines: CoverageElementBaselineStore): ArtifactMetadataManifest;
|
|
37
|
+
/**
|
|
38
|
+
* Preserve prior completion for coverage files whose audit inputs are UNCHANGED
|
|
39
|
+
* from the recorded baseline — content-addressed granular staleness. Mutates
|
|
40
|
+
* `coverage` in place and returns the number of files preserved.
|
|
41
|
+
*
|
|
42
|
+
* A file is preserved iff: it still carries pending work (not excluded), a prior
|
|
43
|
+
* baseline exists for its path, the freshly-computed live key EQUALS that
|
|
44
|
+
* baseline, AND a prior coverage record exists for the path. The prior record's
|
|
45
|
+
* `completed_lenses` / `audit_status` are carried verbatim — valid because the
|
|
46
|
+
* content key includes `required_lenses`, so an unchanged key guarantees an
|
|
47
|
+
* unchanged required-lens set (partial completion is preserved too, not only
|
|
48
|
+
* fully-complete files).
|
|
49
|
+
*
|
|
50
|
+
* No baseline, a moved key, or a missing prior record all leave the file at its
|
|
51
|
+
* freshly-built (pending) state — fail-safe to re-audit.
|
|
52
|
+
*/
|
|
53
|
+
export declare function applyContentAddressedPreservation(coverage: CoverageMatrix, priorCoverage: CoverageMatrix | undefined, priorBaselines: CoverageElementBaselineStore | undefined, contentSigByPath: Record<string, string>): number;
|
|
54
|
+
//# sourceMappingURL=coverageElementBaseline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coverageElementBaseline.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/coverageElementBaseline.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAE7E,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEpF,+EAA+E;AAC/E,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAElE;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,YAAY,GACzB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,kBAAkB,EACxB,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,MAAM,CASR;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,cAAc,EACxB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,4BAA4B,CAO9B;AAED,qFAAqF;AACrF,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,wBAAwB,GAAG,SAAS,GAC7C,4BAA4B,GAAG,SAAS,CAE1C;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,wBAAwB,GAAG,SAAS,EAC9C,SAAS,EAAE,4BAA4B,GACtC,wBAAwB,CAO1B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,cAAc,EACxB,aAAa,EAAE,cAAc,GAAG,SAAS,EACzC,cAAc,EAAE,4BAA4B,GAAG,SAAS,EACxD,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,MAAM,CAoBR"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content-addressed, GRANULAR staleness for the coverage matrix (T5 #12 — the
|
|
3
|
+
* general DAG-model extension that pairs with the per-result baseline store in
|
|
4
|
+
* `resultBaseline.ts`).
|
|
5
|
+
*
|
|
6
|
+
* Today `runPlanningExecutor` rebuilds the whole coverage matrix on every re-plan
|
|
7
|
+
* and resets every in-scope file to `pending`, so a re-plan triggered by an
|
|
8
|
+
* upstream change unrelated to a given file (e.g. an intent-checkpoint edit, a
|
|
9
|
+
* unit reassignment elsewhere, a new external-analyzer result) re-audits files
|
|
10
|
+
* whose own audit inputs never changed. This module keys staleness at the
|
|
11
|
+
* granularity of the actual unit of work — ONE coverage file — so only files
|
|
12
|
+
* whose audit inputs genuinely moved re-derive; the rest keep their prior
|
|
13
|
+
* completion by construction.
|
|
14
|
+
*
|
|
15
|
+
* Mirrors the result-baseline design exactly:
|
|
16
|
+
* - the per-element baseline (a content key per file path) lives OUTSIDE the
|
|
17
|
+
* coverage artifact, in `artifact_metadata.coverage_element_baselines`, so
|
|
18
|
+
* recording a baseline never mutates the coverage matrix;
|
|
19
|
+
* - the comparison driver is a signature-SENSITIVE content key derived from the
|
|
20
|
+
* file's audit inputs (its content signal + required lenses + unit membership);
|
|
21
|
+
* - a file with no recorded baseline is never preserved (first plan establishes
|
|
22
|
+
* the baseline; the run after a ship behaves exactly as before).
|
|
23
|
+
*
|
|
24
|
+
* Content-precision note: the per-file content signal is the repo-manifest
|
|
25
|
+
* `hash` when file hashing is enabled, else `size_bytes`. This is exactly the
|
|
26
|
+
* precision the rest of the staleness DAG already runs at — a same-size file edit
|
|
27
|
+
* with hashing off does not change the repo manifest either, so it does not
|
|
28
|
+
* re-stale coverage today and is not falsely preserved here relative to current
|
|
29
|
+
* behavior. Enabling manifest hashing tightens both at once.
|
|
30
|
+
*/
|
|
31
|
+
import { hashContent, stableStringify } from "audit-tools/shared";
|
|
32
|
+
import { METADATA_SCHEMA_VERSION } from "../types/artifactMetadata.js";
|
|
33
|
+
/**
|
|
34
|
+
* The per-file content signal that determines whether a file's audit must be
|
|
35
|
+
* redone: the repo-manifest content `hash` when present, else its `size_bytes`.
|
|
36
|
+
* Returns a map keyed by repo-manifest path. Files absent from the manifest (no
|
|
37
|
+
* signal) are simply omitted — a file with no signal gets no baseline and is
|
|
38
|
+
* never preserved (fail-safe to re-audit).
|
|
39
|
+
*/
|
|
40
|
+
export function coverageContentSignature(repoManifest) {
|
|
41
|
+
const sig = {};
|
|
42
|
+
for (const file of repoManifest.files) {
|
|
43
|
+
sig[file.path] = file.hash ?? `size:${file.size_bytes}`;
|
|
44
|
+
}
|
|
45
|
+
return sig;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Derive the signature-SENSITIVE content key for one coverage file from its audit
|
|
49
|
+
* inputs: the file's content signal, its required lenses, and its unit
|
|
50
|
+
* membership. Any change to any input moves the key, forcing a re-audit; an
|
|
51
|
+
* identical set of inputs reproduces the same key, enabling preservation. Lenses
|
|
52
|
+
* and unit ids are sorted so ordering noise never moves the key.
|
|
53
|
+
*/
|
|
54
|
+
export function deriveCoverageElementKey(file, contentSig) {
|
|
55
|
+
return hashContent(stableStringify({
|
|
56
|
+
path: file.path,
|
|
57
|
+
content_sig: contentSig ?? null,
|
|
58
|
+
required_lenses: [...file.required_lenses].sort(),
|
|
59
|
+
unit_ids: [...file.unit_ids].sort(),
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Build the fresh per-element baseline store for a coverage matrix: a content key
|
|
64
|
+
* for every file that carries audit work (not excluded). Excluded files are
|
|
65
|
+
* omitted — they have no work to preserve. Pure.
|
|
66
|
+
*/
|
|
67
|
+
export function recordCoverageElementBaselines(coverage, contentSigByPath) {
|
|
68
|
+
const store = {};
|
|
69
|
+
for (const file of coverage.files) {
|
|
70
|
+
if (file.audit_status === "excluded")
|
|
71
|
+
continue;
|
|
72
|
+
store[file.path] = deriveCoverageElementKey(file, contentSigByPath[file.path]);
|
|
73
|
+
}
|
|
74
|
+
return store;
|
|
75
|
+
}
|
|
76
|
+
/** Read the carried-forward coverage-element baselines off the artifact metadata. */
|
|
77
|
+
export function readCoverageElementBaselines(metadata) {
|
|
78
|
+
return metadata?.coverage_element_baselines;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Carry the executor's freshly-recorded coverage-element baselines onto the
|
|
82
|
+
* bundle's artifact metadata so `computeArtifactMetadata` persists them (the same
|
|
83
|
+
* carry-forward path `result_baselines` uses). Returns a new manifest; never
|
|
84
|
+
* mutates the input. Stamps the F1 schema version when seeding a fresh manifest
|
|
85
|
+
* so the CE-007 freshness gate recognizes the store on the next run.
|
|
86
|
+
*/
|
|
87
|
+
export function withCoverageElementBaselines(metadata, baselines) {
|
|
88
|
+
return {
|
|
89
|
+
metadata_schema_version: METADATA_SCHEMA_VERSION,
|
|
90
|
+
artifacts: {},
|
|
91
|
+
...(metadata ?? {}),
|
|
92
|
+
coverage_element_baselines: baselines,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Preserve prior completion for coverage files whose audit inputs are UNCHANGED
|
|
97
|
+
* from the recorded baseline — content-addressed granular staleness. Mutates
|
|
98
|
+
* `coverage` in place and returns the number of files preserved.
|
|
99
|
+
*
|
|
100
|
+
* A file is preserved iff: it still carries pending work (not excluded), a prior
|
|
101
|
+
* baseline exists for its path, the freshly-computed live key EQUALS that
|
|
102
|
+
* baseline, AND a prior coverage record exists for the path. The prior record's
|
|
103
|
+
* `completed_lenses` / `audit_status` are carried verbatim — valid because the
|
|
104
|
+
* content key includes `required_lenses`, so an unchanged key guarantees an
|
|
105
|
+
* unchanged required-lens set (partial completion is preserved too, not only
|
|
106
|
+
* fully-complete files).
|
|
107
|
+
*
|
|
108
|
+
* No baseline, a moved key, or a missing prior record all leave the file at its
|
|
109
|
+
* freshly-built (pending) state — fail-safe to re-audit.
|
|
110
|
+
*/
|
|
111
|
+
export function applyContentAddressedPreservation(coverage, priorCoverage, priorBaselines, contentSigByPath) {
|
|
112
|
+
if (!priorBaselines || !priorCoverage)
|
|
113
|
+
return 0;
|
|
114
|
+
const priorByPath = new Map(priorCoverage.files.map((f) => [f.path, f]));
|
|
115
|
+
let preserved = 0;
|
|
116
|
+
for (const file of coverage.files) {
|
|
117
|
+
if (file.audit_status === "excluded")
|
|
118
|
+
continue;
|
|
119
|
+
// Already complete (e.g. trivial-auto-complete or delta out-of-scope carry):
|
|
120
|
+
// nothing to preserve.
|
|
121
|
+
if (file.audit_status === "complete")
|
|
122
|
+
continue;
|
|
123
|
+
const baseline = priorBaselines[file.path];
|
|
124
|
+
if (baseline === undefined)
|
|
125
|
+
continue;
|
|
126
|
+
const liveKey = deriveCoverageElementKey(file, contentSigByPath[file.path]);
|
|
127
|
+
if (liveKey !== baseline)
|
|
128
|
+
continue;
|
|
129
|
+
const prior = priorByPath.get(file.path);
|
|
130
|
+
if (!prior)
|
|
131
|
+
continue;
|
|
132
|
+
file.completed_lenses = [...prior.completed_lenses];
|
|
133
|
+
file.audit_status = prior.audit_status;
|
|
134
|
+
preserved += 1;
|
|
135
|
+
}
|
|
136
|
+
return preserved;
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=coverageElementBaseline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coverageElementBaseline.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/coverageElementBaseline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAMvE;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACtC,YAA0B;IAE1B,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,IAAI,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;QACtC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,QAAQ,IAAI,CAAC,UAAU,EAAE,CAAC;IAC1D,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACtC,IAAwB,EACxB,UAA8B;IAE9B,OAAO,WAAW,CAChB,eAAe,CAAC;QACd,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,WAAW,EAAE,UAAU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I,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACzE,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;QAClC,IAAI,IAAI,CAAC,YAAY,KAAK,UAAU;YAAE,SAAS;QAC/C,6EAA6E;QAC7E,uBAAuB;QACvB,IAAI,IAAI,CAAC,YAAY,KAAK,UAAU;YAAE,SAAS;QAC/C,MAAM,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,QAAQ,KAAK,SAAS;YAAE,SAAS;QACrC,MAAM,OAAO,GAAG,wBAAwB,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5E,IAAI,OAAO,KAAK,QAAQ;YAAE,SAAS;QACnC,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK;YAAE,SAAS;QACrB,IAAI,CAAC,gBAAgB,GAAG,CAAC,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACpD,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QACvC,SAAS,IAAI,CAAC,CAAC;IACjB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ArtifactMetadataManifest, GitHistoryBaseline } from "../types/artifactMetadata.js";
|
|
2
|
+
import type { FileDisposition } from "audit-tools/shared";
|
|
3
|
+
import type { RepoManifest } from "../types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Content key of the in-scope audited path set the git-history mine is filtered
|
|
6
|
+
* to. Sorted so manifest ordering noise never moves the key; single-sourced off
|
|
7
|
+
* `gitHistoryInScopeKeys` so it can never disagree with the actual filter.
|
|
8
|
+
*/
|
|
9
|
+
export declare function deriveGitHistoryScopeKey(repoManifest: RepoManifest, disposition?: FileDisposition): string;
|
|
10
|
+
/** Read the carried-forward git-history baseline off the artifact metadata. */
|
|
11
|
+
export declare function readGitHistoryBaseline(metadata: ArtifactMetadataManifest | undefined): GitHistoryBaseline | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Carry a freshly-recorded git-history baseline onto the bundle's artifact
|
|
14
|
+
* metadata so `computeArtifactMetadata` persists it (the same carry-forward path
|
|
15
|
+
* `result_baselines` / `coverage_element_baselines` use). Returns a new manifest;
|
|
16
|
+
* never mutates the input. Stamps the F1 schema version when seeding a fresh
|
|
17
|
+
* manifest so the CE-007 freshness gate recognizes the store on the next run.
|
|
18
|
+
*/
|
|
19
|
+
export declare function withGitHistoryBaseline(metadata: ArtifactMetadataManifest | undefined, baseline: GitHistoryBaseline): ArtifactMetadataManifest;
|
|
20
|
+
/**
|
|
21
|
+
* Decide whether the prior git-history mine can be reused. Reuse iff a prior
|
|
22
|
+
* `git_history` artifact exists, a prior baseline exists, and BOTH the live HEAD
|
|
23
|
+
* and scope key equal that baseline. Returns the head/scope_key computed for this
|
|
24
|
+
* run so the caller can record a refreshed baseline when it re-mines. A `null`
|
|
25
|
+
* `head` (git unavailable) is never reusable and yields no baseline to record.
|
|
26
|
+
*/
|
|
27
|
+
export declare function canReuseGitHistory(params: {
|
|
28
|
+
head: string | null;
|
|
29
|
+
scopeKey: string;
|
|
30
|
+
priorBaseline: GitHistoryBaseline | undefined;
|
|
31
|
+
hasPriorArtifact: boolean;
|
|
32
|
+
}): boolean;
|
|
33
|
+
//# sourceMappingURL=gitHistoryBaseline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitHistoryBaseline.d.ts","sourceRoot":"","sources":["../../../src/audit/orchestrator/gitHistoryBaseline.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EACV,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,YAAY,EAC1B,WAAW,CAAC,EAAE,eAAe,GAC5B,MAAM,CAIR;AAED,+EAA+E;AAC/E,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,wBAAwB,GAAG,SAAS,GAC7C,kBAAkB,GAAG,SAAS,CAEhC;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,wBAAwB,GAAG,SAAS,EAC9C,QAAQ,EAAE,kBAAkB,GAC3B,wBAAwB,CAO1B;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IACzC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAC9C,gBAAgB,EAAE,OAAO,CAAC;CAC3B,GAAG,OAAO,CASV"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Incremental structure phase (T5 #12 — the content-addressed granular-staleness
|
|
3
|
+
* model, applied to the structure phase's single most expensive deterministic
|
|
4
|
+
* operation: the git-history mine).
|
|
5
|
+
*
|
|
6
|
+
* `runStructureExecutor` re-runs on ANY `repo_manifest` change (one edited file
|
|
7
|
+
* re-stales every structure artifact). The git-history mine — a full
|
|
8
|
+
* `git log --name-only` walk over up to 1000 commits plus O(files²) co-change
|
|
9
|
+
* aggregation per commit — is by far the costliest part, yet its OUTPUT is a
|
|
10
|
+
* pure function of just two inputs:
|
|
11
|
+
* 1. the commit graph reachable from HEAD (working-tree edits never change it —
|
|
12
|
+
* only a commit / amend / rebase moves HEAD), and
|
|
13
|
+
* 2. the in-scope audited file set the mine is filtered to.
|
|
14
|
+
* So when neither input moved, the prior `git_history.json` is byte-identical and
|
|
15
|
+
* can be reused without spawning git at all.
|
|
16
|
+
*
|
|
17
|
+
* This module records that two-part baseline (`{head, scope_key}`) in
|
|
18
|
+
* `artifact_metadata.git_history_baseline` — OUTSIDE the artifact, exactly like
|
|
19
|
+
* the result / coverage-element baselines — and the structure executor reuses the
|
|
20
|
+
* carried `git_history` iff the live HEAD and scope key both equal the baseline.
|
|
21
|
+
* Any drift (no baseline, HEAD moved, scope changed, git unavailable) re-mines:
|
|
22
|
+
* fail-safe, never falsely preserved.
|
|
23
|
+
*/
|
|
24
|
+
import { hashContent, stableStringify } from "audit-tools/shared";
|
|
25
|
+
import { METADATA_SCHEMA_VERSION } from "../types/artifactMetadata.js";
|
|
26
|
+
import { gitHistoryInScopeKeys } from "../extractors/gitHistory.js";
|
|
27
|
+
/**
|
|
28
|
+
* Content key of the in-scope audited path set the git-history mine is filtered
|
|
29
|
+
* to. Sorted so manifest ordering noise never moves the key; single-sourced off
|
|
30
|
+
* `gitHistoryInScopeKeys` so it can never disagree with the actual filter.
|
|
31
|
+
*/
|
|
32
|
+
export function deriveGitHistoryScopeKey(repoManifest, disposition) {
|
|
33
|
+
return hashContent(stableStringify([...gitHistoryInScopeKeys(repoManifest, disposition)].sort()));
|
|
34
|
+
}
|
|
35
|
+
/** Read the carried-forward git-history baseline off the artifact metadata. */
|
|
36
|
+
export function readGitHistoryBaseline(metadata) {
|
|
37
|
+
return metadata?.git_history_baseline;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Carry a freshly-recorded git-history baseline onto the bundle's artifact
|
|
41
|
+
* metadata so `computeArtifactMetadata` persists it (the same carry-forward path
|
|
42
|
+
* `result_baselines` / `coverage_element_baselines` use). Returns a new manifest;
|
|
43
|
+
* never mutates the input. Stamps the F1 schema version when seeding a fresh
|
|
44
|
+
* manifest so the CE-007 freshness gate recognizes the store on the next run.
|
|
45
|
+
*/
|
|
46
|
+
export function withGitHistoryBaseline(metadata, baseline) {
|
|
47
|
+
return {
|
|
48
|
+
metadata_schema_version: METADATA_SCHEMA_VERSION,
|
|
49
|
+
artifacts: {},
|
|
50
|
+
...(metadata ?? {}),
|
|
51
|
+
git_history_baseline: baseline,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Decide whether the prior git-history mine can be reused. Reuse iff a prior
|
|
56
|
+
* `git_history` artifact exists, a prior baseline exists, and BOTH the live HEAD
|
|
57
|
+
* and scope key equal that baseline. Returns the head/scope_key computed for this
|
|
58
|
+
* run so the caller can record a refreshed baseline when it re-mines. A `null`
|
|
59
|
+
* `head` (git unavailable) is never reusable and yields no baseline to record.
|
|
60
|
+
*/
|
|
61
|
+
export function canReuseGitHistory(params) {
|
|
62
|
+
const { head, scopeKey, priorBaseline, hasPriorArtifact } = params;
|
|
63
|
+
return (head !== null &&
|
|
64
|
+
hasPriorArtifact &&
|
|
65
|
+
priorBaseline !== undefined &&
|
|
66
|
+
priorBaseline.head === head &&
|
|
67
|
+
priorBaseline.scope_key === scopeKey);
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=gitHistoryBaseline.js.map
|