audit-tools 0.28.7 → 0.28.9
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/audit-code-wrapper-install-hosts.mjs +133 -27
- package/dist/audit/cli/confirmIntentStep.d.ts +1 -0
- package/dist/audit/cli/confirmIntentStep.d.ts.map +1 -1
- package/dist/audit/cli/confirmIntentStep.js +14 -10
- package/dist/audit/cli/confirmIntentStep.js.map +1 -1
- package/dist/audit/cli/dispatch/quotaPool.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/quotaPool.js +4 -3
- package/dist/audit/cli/dispatch/quotaPool.js.map +1 -1
- package/dist/audit/cli/dispatch.d.ts +15 -1
- package/dist/audit/cli/dispatch.d.ts.map +1 -1
- package/dist/audit/cli/dispatch.js +54 -19
- package/dist/audit/cli/dispatch.js.map +1 -1
- package/dist/audit/cli/hybridDispatch.d.ts +46 -0
- package/dist/audit/cli/hybridDispatch.d.ts.map +1 -0
- package/dist/audit/cli/hybridDispatch.js +77 -0
- package/dist/audit/cli/hybridDispatch.js.map +1 -0
- package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
- package/dist/audit/cli/nextStepHelpers.js +111 -2
- package/dist/audit/cli/nextStepHelpers.js.map +1 -1
- package/dist/audit/cli/quotaCommand.d.ts.map +1 -1
- package/dist/audit/cli/quotaCommand.js +20 -10
- package/dist/audit/cli/quotaCommand.js.map +1 -1
- package/dist/audit/cli/reviewRun.d.ts +8 -0
- package/dist/audit/cli/reviewRun.d.ts.map +1 -1
- package/dist/audit/cli/reviewRun.js +1 -1
- package/dist/audit/cli/reviewRun.js.map +1 -1
- package/dist/audit/cli/rollingAuditDispatch.d.ts +57 -4
- package/dist/audit/cli/rollingAuditDispatch.d.ts.map +1 -1
- package/dist/audit/cli/rollingAuditDispatch.js +137 -10
- package/dist/audit/cli/rollingAuditDispatch.js.map +1 -1
- package/dist/audit/cli/scoreAuditCommand.d.ts +16 -0
- package/dist/audit/cli/scoreAuditCommand.d.ts.map +1 -0
- package/dist/audit/cli/scoreAuditCommand.js +82 -0
- package/dist/audit/cli/scoreAuditCommand.js.map +1 -0
- package/dist/audit/cli/submitPacketCommand.d.ts.map +1 -1
- package/dist/audit/cli/submitPacketCommand.js +8 -1
- package/dist/audit/cli/submitPacketCommand.js.map +1 -1
- package/dist/audit/cli.d.ts.map +1 -1
- package/dist/audit/cli.js +5 -1
- package/dist/audit/cli.js.map +1 -1
- package/dist/audit/orchestrator/designReviewProjection.d.ts +9 -1
- package/dist/audit/orchestrator/designReviewProjection.d.ts.map +1 -1
- package/dist/audit/orchestrator/designReviewProjection.js +19 -1
- package/dist/audit/orchestrator/designReviewProjection.js.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.d.ts +2 -0
- package/dist/audit/orchestrator/designReviewPrompt.d.ts.map +1 -1
- package/dist/audit/orchestrator/designReviewPrompt.js +11 -1
- package/dist/audit/orchestrator/designReviewPrompt.js.map +1 -1
- package/dist/audit/orchestrator/executorRunners.js +1 -1
- package/dist/audit/orchestrator/executorRunners.js.map +1 -1
- package/dist/audit/orchestrator/intakeExecutors.d.ts +9 -1
- package/dist/audit/orchestrator/intakeExecutors.d.ts.map +1 -1
- package/dist/audit/orchestrator/intakeExecutors.js +16 -3
- package/dist/audit/orchestrator/intakeExecutors.js.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/intentCheckpointExecutor.js +3 -0
- package/dist/audit/orchestrator/intentCheckpointExecutor.js.map +1 -1
- package/dist/audit/orchestrator/intentInterpreter.d.ts +21 -7
- package/dist/audit/orchestrator/intentInterpreter.d.ts.map +1 -1
- package/dist/audit/orchestrator/intentInterpreter.js +30 -11
- package/dist/audit/orchestrator/intentInterpreter.js.map +1 -1
- package/dist/audit/orchestrator/intentScopeDisposition.d.ts +49 -0
- package/dist/audit/orchestrator/intentScopeDisposition.d.ts.map +1 -0
- package/dist/audit/orchestrator/intentScopeDisposition.js +57 -0
- package/dist/audit/orchestrator/intentScopeDisposition.js.map +1 -0
- package/dist/audit/orchestrator/rollingDispatch.d.ts +9 -0
- package/dist/audit/orchestrator/rollingDispatch.d.ts.map +1 -1
- package/dist/audit/orchestrator/rollingDispatch.js +10 -0
- package/dist/audit/orchestrator/rollingDispatch.js.map +1 -1
- package/dist/audit/orchestrator/scope.d.ts +1 -0
- package/dist/audit/orchestrator/scope.d.ts.map +1 -1
- package/dist/audit/orchestrator/scope.js +2 -7
- package/dist/audit/orchestrator/scope.js.map +1 -1
- package/dist/audit/quota/index.d.ts +5 -0
- package/dist/audit/quota/index.d.ts.map +1 -1
- package/dist/audit/reporting/scoreAudit.d.ts +161 -0
- package/dist/audit/reporting/scoreAudit.d.ts.map +1 -0
- package/dist/audit/reporting/scoreAudit.js +224 -0
- package/dist/audit/reporting/scoreAudit.js.map +1 -0
- package/dist/audit/types/activeDispatch.d.ts +29 -1
- package/dist/audit/types/activeDispatch.d.ts.map +1 -1
- package/dist/audit/types/activeDispatch.js.map +1 -1
- package/dist/audit/types/analyzerCapability.d.ts +6 -6
- package/dist/audit/validation/auditResults.d.ts +13 -0
- package/dist/audit/validation/auditResults.d.ts.map +1 -1
- package/dist/audit/validation/auditResults.js +35 -12
- package/dist/audit/validation/auditResults.js.map +1 -1
- package/dist/remediate/contractPipeline/changeClassification.d.ts +146 -0
- package/dist/remediate/contractPipeline/changeClassification.d.ts.map +1 -0
- package/dist/remediate/contractPipeline/changeClassification.js +398 -0
- package/dist/remediate/contractPipeline/changeClassification.js.map +1 -0
- package/dist/remediate/contractPipeline/derive.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/derive.js +9 -0
- package/dist/remediate/contractPipeline/derive.js.map +1 -1
- package/dist/remediate/intent/intentOrdering.d.ts +51 -0
- package/dist/remediate/intent/intentOrdering.d.ts.map +1 -0
- package/dist/remediate/intent/intentOrdering.js +150 -0
- package/dist/remediate/intent/intentOrdering.js.map +1 -0
- package/dist/remediate/phases/plan.d.ts.map +1 -1
- package/dist/remediate/phases/plan.js +14 -1
- package/dist/remediate/phases/plan.js.map +1 -1
- package/dist/remediate/providers/index.d.ts +32 -0
- package/dist/remediate/providers/index.d.ts.map +1 -1
- package/dist/remediate/providers/index.js +28 -1
- package/dist/remediate/providers/index.js.map +1 -1
- package/dist/remediate/steps/contractPipeline.d.ts +15 -1
- package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipeline.js +282 -14
- package/dist/remediate/steps/contractPipeline.js.map +1 -1
- package/dist/remediate/steps/dispatch.d.ts +56 -1
- package/dist/remediate/steps/dispatch.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch.js +120 -29
- package/dist/remediate/steps/dispatch.js.map +1 -1
- package/dist/remediate/steps/nextStep.d.ts +53 -2
- package/dist/remediate/steps/nextStep.d.ts.map +1 -1
- package/dist/remediate/steps/nextStep.js +253 -81
- package/dist/remediate/steps/nextStep.js.map +1 -1
- package/dist/remediate/steps/providerNodeDispatch.d.ts +8 -1
- package/dist/remediate/steps/providerNodeDispatch.d.ts.map +1 -1
- package/dist/remediate/steps/providerNodeDispatch.js +7 -2
- package/dist/remediate/steps/providerNodeDispatch.js.map +1 -1
- package/dist/remediate/steps/rollingSession.d.ts +55 -1
- package/dist/remediate/steps/rollingSession.d.ts.map +1 -1
- package/dist/remediate/steps/rollingSession.js +128 -19
- package/dist/remediate/steps/rollingSession.js.map +1 -1
- package/dist/remediate/validation/contractPipelineGates.d.ts +23 -8
- package/dist/remediate/validation/contractPipelineGates.d.ts.map +1 -1
- package/dist/remediate/validation/contractPipelineGates.js +43 -38
- package/dist/remediate/validation/contractPipelineGates.js.map +1 -1
- package/dist/shared/dispatch/coordinator.d.ts +170 -0
- package/dist/shared/dispatch/coordinator.d.ts.map +1 -0
- package/dist/shared/dispatch/coordinator.js +177 -0
- package/dist/shared/dispatch/coordinator.js.map +1 -0
- package/dist/shared/dispatch/hybridDispatch.d.ts +74 -0
- package/dist/shared/dispatch/hybridDispatch.d.ts.map +1 -0
- package/dist/shared/dispatch/hybridDispatch.js +54 -0
- package/dist/shared/dispatch/hybridDispatch.js.map +1 -0
- package/dist/shared/dispatch/settledPools.d.ts +21 -0
- package/dist/shared/dispatch/settledPools.d.ts.map +1 -0
- package/dist/shared/dispatch/settledPools.js +34 -0
- package/dist/shared/dispatch/settledPools.js.map +1 -0
- package/dist/shared/index.d.ts +16 -6
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +15 -3
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/intent/clauseInterpreter.d.ts +19 -0
- package/dist/shared/intent/clauseInterpreter.d.ts.map +1 -1
- package/dist/shared/intent/clauseInterpreter.js +19 -0
- package/dist/shared/intent/clauseInterpreter.js.map +1 -1
- package/dist/shared/io/json.d.ts +25 -0
- package/dist/shared/io/json.d.ts.map +1 -1
- package/dist/shared/io/json.js +67 -0
- package/dist/shared/io/json.js.map +1 -1
- package/dist/shared/providers/opencodeProvider.d.ts.map +1 -1
- package/dist/shared/providers/opencodeProvider.js +12 -0
- package/dist/shared/providers/opencodeProvider.js.map +1 -1
- package/dist/shared/providers/providerConfirmation.d.ts.map +1 -1
- package/dist/shared/providers/providerConfirmation.js +9 -1
- package/dist/shared/providers/providerConfirmation.js.map +1 -1
- package/dist/shared/providers/providerFactory.d.ts +1 -0
- package/dist/shared/providers/providerFactory.d.ts.map +1 -1
- package/dist/shared/providers/providerFactory.js +10 -8
- package/dist/shared/providers/providerFactory.js.map +1 -1
- package/dist/shared/providers/sharedProviderConfirmation.d.ts +134 -0
- package/dist/shared/providers/sharedProviderConfirmation.d.ts.map +1 -0
- package/dist/shared/providers/sharedProviderConfirmation.js +244 -0
- package/dist/shared/providers/sharedProviderConfirmation.js.map +1 -0
- package/dist/shared/quota/apiPool.d.ts +67 -0
- package/dist/shared/quota/apiPool.d.ts.map +1 -0
- package/dist/shared/quota/apiPool.js +139 -0
- package/dist/shared/quota/apiPool.js.map +1 -0
- package/dist/shared/quota/capacity.d.ts +29 -1
- package/dist/shared/quota/capacity.d.ts.map +1 -1
- package/dist/shared/quota/capacity.js +5 -0
- package/dist/shared/quota/capacity.js.map +1 -1
- package/dist/shared/quota/claimRegistry.d.ts +64 -0
- package/dist/shared/quota/claimRegistry.d.ts.map +1 -0
- package/dist/shared/quota/claimRegistry.js +157 -0
- package/dist/shared/quota/claimRegistry.js.map +1 -0
- package/dist/shared/quota/compositeQuotaSource.d.ts +10 -1
- package/dist/shared/quota/compositeQuotaSource.d.ts.map +1 -1
- package/dist/shared/quota/compositeQuotaSource.js +34 -6
- package/dist/shared/quota/compositeQuotaSource.js.map +1 -1
- package/dist/shared/quota/httpQuotaSource.d.ts +9 -1
- package/dist/shared/quota/httpQuotaSource.d.ts.map +1 -1
- package/dist/shared/quota/httpQuotaSource.js +33 -8
- package/dist/shared/quota/httpQuotaSource.js.map +1 -1
- package/dist/shared/quota/learnedQuotaSource.d.ts +7 -1
- package/dist/shared/quota/learnedQuotaSource.d.ts.map +1 -1
- package/dist/shared/quota/learnedQuotaSource.js +18 -7
- package/dist/shared/quota/learnedQuotaSource.js.map +1 -1
- package/dist/shared/quota/quotaSource.d.ts +41 -0
- package/dist/shared/quota/quotaSource.d.ts.map +1 -1
- package/dist/shared/quota/quotaSource.js +19 -0
- package/dist/shared/quota/quotaSource.js.map +1 -1
- package/dist/shared/types/contractPipeline/obligations.d.ts +42 -0
- package/dist/shared/types/contractPipeline/obligations.d.ts.map +1 -1
- package/dist/shared/types/contractPipeline.d.ts +1 -1
- package/dist/shared/types/contractPipeline.d.ts.map +1 -1
- package/dist/shared/types/contractPipeline.js.map +1 -1
- package/dist/shared/types/intentCheckpoint.d.ts +14 -0
- package/dist/shared/types/intentCheckpoint.d.ts.map +1 -1
- package/dist/shared/types/intentCheckpoint.js +10 -0
- package/dist/shared/types/intentCheckpoint.js.map +1 -1
- package/dist/shared/types/sessionConfig.d.ts +60 -0
- package/dist/shared/types/sessionConfig.d.ts.map +1 -1
- package/dist/shared/types/sessionConfig.js +13 -0
- package/dist/shared/types/sessionConfig.js.map +1 -1
- package/package.json +3 -2
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { changedFiles, gitRefExists, isGitRepo } from "audit-tools/shared";
|
|
2
2
|
import { buildDispositionMap } from "../extractors/disposition.js";
|
|
3
3
|
import { buildPathLookup } from "../extractors/graph.js";
|
|
4
|
+
import { pathMatchesExclusion } from "./intentScopeDisposition.js";
|
|
4
5
|
import { HIGH_FAN_DEGREE_THRESHOLD, buildGraphDegreeIndex, collectGraphEdges, graphEdgeConfidence, normalizeGraphPath, } from "./reviewPacketGraph.js";
|
|
6
|
+
export { pathMatchesExclusion } from "./intentScopeDisposition.js";
|
|
5
7
|
/** Default cap on in-scope files (seeds + expanded) before expansion stops. */
|
|
6
8
|
export const DEFAULT_SCOPE_MAX_FILES = 200;
|
|
7
9
|
/** Graph edges below this confidence are never traversed during expansion. */
|
|
@@ -232,13 +234,6 @@ export function applyScopeToCoverage(coverage, scope, priorCoverage) {
|
|
|
232
234
|
}
|
|
233
235
|
return coverage;
|
|
234
236
|
}
|
|
235
|
-
function pathMatchesExclusion(filePath, entryPath) {
|
|
236
|
-
const f = filePath.replace(/\\/g, "/");
|
|
237
|
-
const p = entryPath.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
238
|
-
if (!p)
|
|
239
|
-
return false;
|
|
240
|
-
return f === p || f.startsWith(`${p}/`);
|
|
241
|
-
}
|
|
242
237
|
/**
|
|
243
238
|
* Apply the intent checkpoint's `excluded_scope` to a coverage matrix: any file
|
|
244
239
|
* whose path matches an exclusion (exact or directory-prefix) is marked excluded
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../src/audit/orchestrator/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAK3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,C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AAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAC5D,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;QAClC,IAAI,IAAI,CAAC,YAAY,KAAK,UAAU;YAAE,SAAS;QAC/C,IACE,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,EAC1E,CAAC;YACD,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;YAC1B,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;YAC3B,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;YACnB,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC;YAC/B,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;YACnD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -119,6 +119,7 @@ export declare const DispatchQuotaSchema: z.ZodObject<{
|
|
|
119
119
|
captured_at: string;
|
|
120
120
|
source: string;
|
|
121
121
|
}>>>;
|
|
122
|
+
quota_signal_degraded: z.ZodOptional<z.ZodBoolean>;
|
|
122
123
|
}, "strict", z.ZodTypeAny, {
|
|
123
124
|
confidence: "high" | "low" | "medium";
|
|
124
125
|
source: "default" | "explicit_config" | "discovered_capability" | "cli_flags" | "provider_default" | "learned";
|
|
@@ -149,6 +150,7 @@ export declare const DispatchQuotaSchema: z.ZodObject<{
|
|
|
149
150
|
captured_at: string;
|
|
150
151
|
source: string;
|
|
151
152
|
} | null | undefined;
|
|
153
|
+
quota_signal_degraded?: boolean | undefined;
|
|
152
154
|
}, {
|
|
153
155
|
confidence: "high" | "low" | "medium";
|
|
154
156
|
source: "default" | "explicit_config" | "discovered_capability" | "cli_flags" | "provider_default" | "learned";
|
|
@@ -179,6 +181,7 @@ export declare const DispatchQuotaSchema: z.ZodObject<{
|
|
|
179
181
|
captured_at: string;
|
|
180
182
|
source: string;
|
|
181
183
|
} | null | undefined;
|
|
184
|
+
quota_signal_degraded?: boolean | undefined;
|
|
182
185
|
}>, "many">>;
|
|
183
186
|
/** Echo of the host-reported model roster (lowest rank first), when given. */
|
|
184
187
|
host_model_roster: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -293,6 +296,7 @@ export declare const DispatchQuotaSchema: z.ZodObject<{
|
|
|
293
296
|
captured_at: string;
|
|
294
297
|
source: string;
|
|
295
298
|
} | null | undefined;
|
|
299
|
+
quota_signal_degraded?: boolean | undefined;
|
|
296
300
|
}[] | undefined;
|
|
297
301
|
host_model_roster?: {
|
|
298
302
|
context_tokens: number;
|
|
@@ -365,6 +369,7 @@ export declare const DispatchQuotaSchema: z.ZodObject<{
|
|
|
365
369
|
captured_at: string;
|
|
366
370
|
source: string;
|
|
367
371
|
} | null | undefined;
|
|
372
|
+
quota_signal_degraded?: boolean | undefined;
|
|
368
373
|
}[] | undefined;
|
|
369
374
|
host_model_roster?: {
|
|
370
375
|
context_tokens: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/audit/quota/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,wBAAwB,EACxB,2BAA2B,EAC3B,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,E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CAA6C,CAAC;AAErF,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/audit/quota/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,wBAAwB,EACxB,2BAA2B,EAC3B,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,yBAAyB,EACzB,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,0BAA0B,EAC1B,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3F,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAK9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,YAAY,EACV,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,sBAAsB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of (a fresh audit's findings, a corpus's
|
|
5
|
+
* human-applied labels). It is the falsifiable measure of audit output quality:
|
|
6
|
+
* precision (are emitted findings real?), recall_against_known (did this run
|
|
7
|
+
* re-find the labeled true-positives?), and hallucination_rate (how many emitted
|
|
8
|
+
* findings are labeled `hallucinated` — cited code that doesn't exist / says
|
|
9
|
+
* otherwise, exactly what the grounding pass should have caught).
|
|
10
|
+
*
|
|
11
|
+
* Two design rules, both load-bearing:
|
|
12
|
+
*
|
|
13
|
+
* 1. **Match ONLY by `findingIdentitySignature`** — the one shared "is this the
|
|
14
|
+
* same finding?" authority. Volatile fields (line numbers, pass ordinals,
|
|
15
|
+
* reworded titles) never reach the signature, so a reworded re-emission of a
|
|
16
|
+
* labeled finding still matches its label across runs.
|
|
17
|
+
* 2. **No silent scoring.** Every emitted finding and every label that cannot be
|
|
18
|
+
* cleanly matched is surfaced in `unmatched[]` with an explicit reason — it is
|
|
19
|
+
* never folded into a verdict it doesn't belong to. In particular the CE-010
|
|
20
|
+
* case (`findingIdentitySignature` is non-injective: two DISTINCT findings can
|
|
21
|
+
* share `affected_files[0].path + symbol`, e.g. tier-2 lens+category fileless
|
|
22
|
+
* collisions) is surfaced as an `ambiguous_signature_collision` group rather
|
|
23
|
+
* than scoring multiple distinct findings/labels under one verdict.
|
|
24
|
+
*
|
|
25
|
+
* The exit code (the CI gate) is wired SOLELY to a hallucination-rate
|
|
26
|
+
* REGRESSION — see {@link hallucinationRegressed}. Precision and recall are
|
|
27
|
+
* tracked and emitted but never gate the build (the A-2 "track, don't gate"
|
|
28
|
+
* decision: precision/recall thresholds are flaky on legitimate finding-set
|
|
29
|
+
* changes until a baseline is established; hallucination-rate is the one
|
|
30
|
+
* unambiguous metric, already half-enforced by grounding).
|
|
31
|
+
*
|
|
32
|
+
* Pure module: no IO, no clock, no model identity — the same (findings, labels)
|
|
33
|
+
* always yields a byte-identical scorecard.
|
|
34
|
+
*/
|
|
35
|
+
import { type Finding } from "audit-tools/shared";
|
|
36
|
+
/** The label a human applies to one finding of a labeled corpus run. */
|
|
37
|
+
export type FindingLabel = "true_positive" | "false_positive" | "hallucinated";
|
|
38
|
+
/**
|
|
39
|
+
* One human-applied label, keyed on a finding-identity SIGNATURE (not a finding
|
|
40
|
+
* id — ids are run-local and content-addressed; the signature is the stable
|
|
41
|
+
* cross-run identity). `note` is optional human context, ignored by scoring.
|
|
42
|
+
*/
|
|
43
|
+
export interface CorpusLabel {
|
|
44
|
+
/** The `findingIdentitySignature` of the labeled finding. */
|
|
45
|
+
signature: string;
|
|
46
|
+
label: FindingLabel;
|
|
47
|
+
/** Optional human note (e.g. why it was deemed hallucinated). Not scored. */
|
|
48
|
+
note?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A versioned corpus labels file (`corpus/<run-id>.labels.json`). Decoupled from
|
|
52
|
+
* the raw run so a re-run of the auditor can be scored against the SAME labels.
|
|
53
|
+
*/
|
|
54
|
+
export interface CorpusLabels {
|
|
55
|
+
schema_version: "score-audit-corpus-labels/v1";
|
|
56
|
+
/** The run these labels were applied to (provenance only; not scored). */
|
|
57
|
+
run_id: string;
|
|
58
|
+
labels: CorpusLabel[];
|
|
59
|
+
}
|
|
60
|
+
/** Why a finding or a label could not be cleanly scored. */
|
|
61
|
+
export type UnmatchedReason =
|
|
62
|
+
/** An emitted finding whose signature has no label in the corpus. */
|
|
63
|
+
"finding_unlabeled"
|
|
64
|
+
/** A label whose signature was not emitted by this run (recall miss bucket). */
|
|
65
|
+
| "label_unmatched"
|
|
66
|
+
/**
|
|
67
|
+
* CE-010: a signature shared by MORE THAN ONE distinct emitted finding and/or
|
|
68
|
+
* more than one label — non-injective identity. Surfaced, never scored under a
|
|
69
|
+
* single verdict.
|
|
70
|
+
*/
|
|
71
|
+
| "ambiguous_signature_collision";
|
|
72
|
+
/** One entry in the explicit, no-silent-scoring `unmatched[]` accounting. */
|
|
73
|
+
export interface UnmatchedEntry {
|
|
74
|
+
signature: string;
|
|
75
|
+
reason: UnmatchedReason;
|
|
76
|
+
/** Ids of the emitted finding(s) at this signature (stable order). */
|
|
77
|
+
finding_ids: string[];
|
|
78
|
+
/** Labels recorded at this signature (stable order). */
|
|
79
|
+
labels: FindingLabel[];
|
|
80
|
+
}
|
|
81
|
+
/** The deterministic scorecard `scoreAudit` emits. */
|
|
82
|
+
export interface Scorecard {
|
|
83
|
+
schema_version: "score-audit-scorecard/v1";
|
|
84
|
+
run_id: string;
|
|
85
|
+
counts: {
|
|
86
|
+
/** Findings emitted by the run (the scorer's input finding set). */
|
|
87
|
+
findings_emitted: number;
|
|
88
|
+
/** Labels in the corpus. */
|
|
89
|
+
labels_total: number;
|
|
90
|
+
/** Findings cleanly matched 1:1 to a label by signature. */
|
|
91
|
+
matched: number;
|
|
92
|
+
/** Of matched, labeled `true_positive`. */
|
|
93
|
+
true_positives: number;
|
|
94
|
+
/** Of matched, labeled `false_positive`. */
|
|
95
|
+
false_positives: number;
|
|
96
|
+
/** Of matched, labeled `hallucinated`. */
|
|
97
|
+
hallucinated: number;
|
|
98
|
+
/** Labeled true_positives NOT re-found by this run (recall misses). */
|
|
99
|
+
known_true_positives_missed: number;
|
|
100
|
+
/** Total entries in `unmatched[]` (collisions + unlabeled + label misses). */
|
|
101
|
+
unmatched: number;
|
|
102
|
+
/** Of `unmatched`, the CE-010 collision groups. */
|
|
103
|
+
collisions: number;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* precision = TP / (TP + FP + hallucinated) over CLEANLY-MATCHED findings.
|
|
107
|
+
* `null` when there are no matched findings (undefined, never silently 0).
|
|
108
|
+
*/
|
|
109
|
+
precision: number | null;
|
|
110
|
+
/**
|
|
111
|
+
* recall_against_known = (labeled TP re-found) / (all labeled TP). `null` when
|
|
112
|
+
* the corpus labels no true_positives. Recall-against-KNOWN, not absolute.
|
|
113
|
+
*/
|
|
114
|
+
recall_against_known: number | null;
|
|
115
|
+
/**
|
|
116
|
+
* hallucination_rate = hallucinated / findings_emitted. The gated metric.
|
|
117
|
+
* `null` when the run emitted no findings (undefined, never silently 0).
|
|
118
|
+
*/
|
|
119
|
+
hallucination_rate: number | null;
|
|
120
|
+
/** Explicit accounting of everything not cleanly scored (no silent scoring). */
|
|
121
|
+
unmatched: UnmatchedEntry[];
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The signature of a finding — the single match key (CE-010 axis). Delegates to
|
|
125
|
+
* the pipeline's one finding-identity authority (`findingIdentityKey`); it is NOT
|
|
126
|
+
* re-derived here, so the scorer can never drift from the auditor's own
|
|
127
|
+
* "is this the same finding?" rule.
|
|
128
|
+
*/
|
|
129
|
+
export declare function findingSignature(finding: Finding): string;
|
|
130
|
+
/**
|
|
131
|
+
* Score a fresh audit's findings against a corpus's labels — the pure A-2 oracle.
|
|
132
|
+
*
|
|
133
|
+
* Matching is by `findingIdentitySignature` ONLY. A signature carrying more than
|
|
134
|
+
* one distinct emitted finding OR more than one label is non-injective (CE-010);
|
|
135
|
+
* it is surfaced as an `ambiguous_signature_collision` and excluded from every
|
|
136
|
+
* verdict — neither finding nor label at a colliding signature is scored.
|
|
137
|
+
*
|
|
138
|
+
* Cleanly matched (exactly one finding ↔ exactly one label) drives precision /
|
|
139
|
+
* hallucination_rate; the labeled true_positive set drives recall_against_known.
|
|
140
|
+
* Emitted findings with no label, and labels not re-found by the run, are each
|
|
141
|
+
* surfaced in `unmatched[]` (no silent scoring).
|
|
142
|
+
*/
|
|
143
|
+
export declare function scoreAudit(findings: Finding[], corpus: CorpusLabels): Scorecard;
|
|
144
|
+
/**
|
|
145
|
+
* The SOLE gate predicate: did the hallucination rate REGRESS against a baseline?
|
|
146
|
+
*
|
|
147
|
+
* The CI exit code is wired to this and nothing else (A-2 track-don't-gate).
|
|
148
|
+
* Precision/recall are emitted for tracking but never gate the build.
|
|
149
|
+
*
|
|
150
|
+
* - With no baseline, nothing has regressed (the first run establishes the
|
|
151
|
+
* baseline — it cannot regress against itself).
|
|
152
|
+
* - A `null` current rate (the run emitted no findings) cannot regress.
|
|
153
|
+
* - A `null` baseline rate (the baseline emitted no findings) is treated as 0 —
|
|
154
|
+
* any positive current rate is then a regression.
|
|
155
|
+
*
|
|
156
|
+
* `epsilon` absorbs floating-point noise so a byte-identical re-run never trips.
|
|
157
|
+
*/
|
|
158
|
+
export declare function hallucinationRegressed(current: Scorecard, baseline: Scorecard | null | undefined, epsilon?: number): boolean;
|
|
159
|
+
/** A compact, deterministic human summary of a {@link Scorecard}. */
|
|
160
|
+
export declare function renderScorecardMarkdown(scorecard: Scorecard): string;
|
|
161
|
+
//# sourceMappingURL=scoreAudit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoreAudit.d.ts","sourceRoot":"","sources":["../../../src/audit/reporting/scoreAudit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAsB,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAEtE,wEAAwE;AACxE,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,gBAAgB,GAAG,cAAc,CAAC;AAE/E;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;IACpB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,8BAA8B,CAAC;IAC/C,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,4DAA4D;AAC5D,MAAM,MAAM,eAAe;AACzB,qEAAqE;AACnE,mBAAmB;AACrB,gFAAgF;GAC9E,iBAAiB;AACnB;;;;GAIG;GACD,+BAA+B,CAAC;AAEpC,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,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SAAO,GACb,OAAO,CAMT;AAED,qEAAqE;AACrE,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CA2BpE"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A-2 — the deterministic finding-quality oracle (`score-audit`).
|
|
3
|
+
*
|
|
4
|
+
* `scoreAudit` is a PURE function of (a fresh audit's findings, a corpus's
|
|
5
|
+
* human-applied labels). It is the falsifiable measure of audit output quality:
|
|
6
|
+
* precision (are emitted findings real?), recall_against_known (did this run
|
|
7
|
+
* re-find the labeled true-positives?), and hallucination_rate (how many emitted
|
|
8
|
+
* findings are labeled `hallucinated` — cited code that doesn't exist / says
|
|
9
|
+
* otherwise, exactly what the grounding pass should have caught).
|
|
10
|
+
*
|
|
11
|
+
* Two design rules, both load-bearing:
|
|
12
|
+
*
|
|
13
|
+
* 1. **Match ONLY by `findingIdentitySignature`** — the one shared "is this the
|
|
14
|
+
* same finding?" authority. Volatile fields (line numbers, pass ordinals,
|
|
15
|
+
* reworded titles) never reach the signature, so a reworded re-emission of a
|
|
16
|
+
* labeled finding still matches its label across runs.
|
|
17
|
+
* 2. **No silent scoring.** Every emitted finding and every label that cannot be
|
|
18
|
+
* cleanly matched is surfaced in `unmatched[]` with an explicit reason — it is
|
|
19
|
+
* never folded into a verdict it doesn't belong to. In particular the CE-010
|
|
20
|
+
* case (`findingIdentitySignature` is non-injective: two DISTINCT findings can
|
|
21
|
+
* share `affected_files[0].path + symbol`, e.g. tier-2 lens+category fileless
|
|
22
|
+
* collisions) is surfaced as an `ambiguous_signature_collision` group rather
|
|
23
|
+
* than scoring multiple distinct findings/labels under one verdict.
|
|
24
|
+
*
|
|
25
|
+
* The exit code (the CI gate) is wired SOLELY to a hallucination-rate
|
|
26
|
+
* REGRESSION — see {@link hallucinationRegressed}. Precision and recall are
|
|
27
|
+
* tracked and emitted but never gate the build (the A-2 "track, don't gate"
|
|
28
|
+
* decision: precision/recall thresholds are flaky on legitimate finding-set
|
|
29
|
+
* changes until a baseline is established; hallucination-rate is the one
|
|
30
|
+
* unambiguous metric, already half-enforced by grounding).
|
|
31
|
+
*
|
|
32
|
+
* Pure module: no IO, no clock, no model identity — the same (findings, labels)
|
|
33
|
+
* always yields a byte-identical scorecard.
|
|
34
|
+
*/
|
|
35
|
+
import { findingIdentityKey } from "audit-tools/shared";
|
|
36
|
+
/**
|
|
37
|
+
* The signature of a finding — the single match key (CE-010 axis). Delegates to
|
|
38
|
+
* the pipeline's one finding-identity authority (`findingIdentityKey`); it is NOT
|
|
39
|
+
* re-derived here, so the scorer can never drift from the auditor's own
|
|
40
|
+
* "is this the same finding?" rule.
|
|
41
|
+
*/
|
|
42
|
+
export function findingSignature(finding) {
|
|
43
|
+
return findingIdentityKey(finding);
|
|
44
|
+
}
|
|
45
|
+
function ratio(numerator, denominator) {
|
|
46
|
+
return denominator === 0 ? null : numerator / denominator;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Score a fresh audit's findings against a corpus's labels — the pure A-2 oracle.
|
|
50
|
+
*
|
|
51
|
+
* Matching is by `findingIdentitySignature` ONLY. A signature carrying more than
|
|
52
|
+
* one distinct emitted finding OR more than one label is non-injective (CE-010);
|
|
53
|
+
* it is surfaced as an `ambiguous_signature_collision` and excluded from every
|
|
54
|
+
* verdict — neither finding nor label at a colliding signature is scored.
|
|
55
|
+
*
|
|
56
|
+
* Cleanly matched (exactly one finding ↔ exactly one label) drives precision /
|
|
57
|
+
* hallucination_rate; the labeled true_positive set drives recall_against_known.
|
|
58
|
+
* Emitted findings with no label, and labels not re-found by the run, are each
|
|
59
|
+
* surfaced in `unmatched[]` (no silent scoring).
|
|
60
|
+
*/
|
|
61
|
+
export function scoreAudit(findings, corpus) {
|
|
62
|
+
// Group emitted findings by signature (stable id order within a group).
|
|
63
|
+
const findingsBySig = new Map();
|
|
64
|
+
for (const finding of findings) {
|
|
65
|
+
const sig = findingSignature(finding);
|
|
66
|
+
const ids = findingsBySig.get(sig) ?? [];
|
|
67
|
+
ids.push(finding.id);
|
|
68
|
+
findingsBySig.set(sig, ids);
|
|
69
|
+
}
|
|
70
|
+
for (const ids of findingsBySig.values())
|
|
71
|
+
ids.sort();
|
|
72
|
+
// Group labels by signature (stable label order within a group).
|
|
73
|
+
const labelsBySig = new Map();
|
|
74
|
+
for (const entry of corpus.labels) {
|
|
75
|
+
const labels = labelsBySig.get(entry.signature) ?? [];
|
|
76
|
+
labels.push(entry.label);
|
|
77
|
+
labelsBySig.set(entry.signature, labels);
|
|
78
|
+
}
|
|
79
|
+
for (const labels of labelsBySig.values())
|
|
80
|
+
labels.sort();
|
|
81
|
+
// The universe of signatures, iterated in a deterministic (sorted) order so
|
|
82
|
+
// the scorecard is byte-identical across runs regardless of input ordering.
|
|
83
|
+
const allSignatures = [
|
|
84
|
+
...new Set([...findingsBySig.keys(), ...labelsBySig.keys()]),
|
|
85
|
+
].sort();
|
|
86
|
+
let truePositives = 0;
|
|
87
|
+
let falsePositives = 0;
|
|
88
|
+
let hallucinated = 0;
|
|
89
|
+
let matched = 0;
|
|
90
|
+
let knownTpMissed = 0;
|
|
91
|
+
const unmatched = [];
|
|
92
|
+
// Recall denominator: every labeled true_positive in the corpus. A signature
|
|
93
|
+
// is only counted as RE-FOUND when it cleanly matches (no collision).
|
|
94
|
+
let knownTpTotal = 0;
|
|
95
|
+
for (const labels of labelsBySig.values()) {
|
|
96
|
+
knownTpTotal += labels.filter((l) => l === "true_positive").length;
|
|
97
|
+
}
|
|
98
|
+
for (const sig of allSignatures) {
|
|
99
|
+
const findingIds = findingsBySig.get(sig) ?? [];
|
|
100
|
+
const labels = labelsBySig.get(sig) ?? [];
|
|
101
|
+
// CE-010: non-injective signature. More than one distinct finding OR more
|
|
102
|
+
// than one label at this signature → cannot attribute a single verdict.
|
|
103
|
+
// Surface as a collision; score NOTHING here.
|
|
104
|
+
if (findingIds.length > 1 || labels.length > 1) {
|
|
105
|
+
unmatched.push({
|
|
106
|
+
signature: sig,
|
|
107
|
+
reason: "ambiguous_signature_collision",
|
|
108
|
+
finding_ids: findingIds,
|
|
109
|
+
labels,
|
|
110
|
+
});
|
|
111
|
+
// A colliding signature whose labels include true_positives is NOT counted
|
|
112
|
+
// as re-found (we cannot prove which finding satisfied which label).
|
|
113
|
+
knownTpMissed += labels.filter((l) => l === "true_positive").length;
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
// Exactly one finding and exactly one label → a clean 1:1 match.
|
|
117
|
+
if (findingIds.length === 1 && labels.length === 1) {
|
|
118
|
+
matched += 1;
|
|
119
|
+
const label = labels[0];
|
|
120
|
+
if (label === "true_positive")
|
|
121
|
+
truePositives += 1;
|
|
122
|
+
else if (label === "false_positive")
|
|
123
|
+
falsePositives += 1;
|
|
124
|
+
else
|
|
125
|
+
hallucinated += 1;
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
// A finding with no label — surfaced, never scored.
|
|
129
|
+
if (findingIds.length === 1 && labels.length === 0) {
|
|
130
|
+
unmatched.push({
|
|
131
|
+
signature: sig,
|
|
132
|
+
reason: "finding_unlabeled",
|
|
133
|
+
finding_ids: findingIds,
|
|
134
|
+
labels: [],
|
|
135
|
+
});
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
// A label not re-found by this run — a recall miss bucket, surfaced.
|
|
139
|
+
if (findingIds.length === 0 && labels.length === 1) {
|
|
140
|
+
unmatched.push({
|
|
141
|
+
signature: sig,
|
|
142
|
+
reason: "label_unmatched",
|
|
143
|
+
finding_ids: [],
|
|
144
|
+
labels,
|
|
145
|
+
});
|
|
146
|
+
knownTpMissed += labels.filter((l) => l === "true_positive").length;
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const findingsEmitted = findings.length;
|
|
151
|
+
const collisions = unmatched.filter((u) => u.reason === "ambiguous_signature_collision").length;
|
|
152
|
+
return {
|
|
153
|
+
schema_version: "score-audit-scorecard/v1",
|
|
154
|
+
run_id: corpus.run_id,
|
|
155
|
+
counts: {
|
|
156
|
+
findings_emitted: findingsEmitted,
|
|
157
|
+
labels_total: corpus.labels.length,
|
|
158
|
+
matched,
|
|
159
|
+
true_positives: truePositives,
|
|
160
|
+
false_positives: falsePositives,
|
|
161
|
+
hallucinated,
|
|
162
|
+
known_true_positives_missed: knownTpMissed,
|
|
163
|
+
unmatched: unmatched.length,
|
|
164
|
+
collisions,
|
|
165
|
+
},
|
|
166
|
+
// precision over cleanly-matched findings only.
|
|
167
|
+
precision: ratio(truePositives, truePositives + falsePositives + hallucinated),
|
|
168
|
+
recall_against_known: ratio(knownTpTotal - knownTpMissed, knownTpTotal),
|
|
169
|
+
hallucination_rate: ratio(hallucinated, findingsEmitted),
|
|
170
|
+
unmatched,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The SOLE gate predicate: did the hallucination rate REGRESS against a baseline?
|
|
175
|
+
*
|
|
176
|
+
* The CI exit code is wired to this and nothing else (A-2 track-don't-gate).
|
|
177
|
+
* Precision/recall are emitted for tracking but never gate the build.
|
|
178
|
+
*
|
|
179
|
+
* - With no baseline, nothing has regressed (the first run establishes the
|
|
180
|
+
* baseline — it cannot regress against itself).
|
|
181
|
+
* - A `null` current rate (the run emitted no findings) cannot regress.
|
|
182
|
+
* - A `null` baseline rate (the baseline emitted no findings) is treated as 0 —
|
|
183
|
+
* any positive current rate is then a regression.
|
|
184
|
+
*
|
|
185
|
+
* `epsilon` absorbs floating-point noise so a byte-identical re-run never trips.
|
|
186
|
+
*/
|
|
187
|
+
export function hallucinationRegressed(current, baseline, epsilon = 1e-9) {
|
|
188
|
+
if (!baseline)
|
|
189
|
+
return false;
|
|
190
|
+
const currentRate = current.hallucination_rate;
|
|
191
|
+
if (currentRate === null)
|
|
192
|
+
return false;
|
|
193
|
+
const baselineRate = baseline.hallucination_rate ?? 0;
|
|
194
|
+
return currentRate > baselineRate + epsilon;
|
|
195
|
+
}
|
|
196
|
+
/** A compact, deterministic human summary of a {@link Scorecard}. */
|
|
197
|
+
export function renderScorecardMarkdown(scorecard) {
|
|
198
|
+
const pct = (value) => value === null ? "n/a" : `${(value * 100).toFixed(1)}%`;
|
|
199
|
+
const c = scorecard.counts;
|
|
200
|
+
const lines = [
|
|
201
|
+
`# Audit scorecard — ${scorecard.run_id}`,
|
|
202
|
+
"",
|
|
203
|
+
`- Findings emitted: ${c.findings_emitted}`,
|
|
204
|
+
`- Labels: ${c.labels_total}`,
|
|
205
|
+
`- Matched (1:1 by signature): ${c.matched} ` +
|
|
206
|
+
`(TP ${c.true_positives}, FP ${c.false_positives}, hallucinated ${c.hallucinated})`,
|
|
207
|
+
`- Precision: ${pct(scorecard.precision)}`,
|
|
208
|
+
`- Recall against known: ${pct(scorecard.recall_against_known)} ` +
|
|
209
|
+
`(${c.known_true_positives_missed} known TP missed)`,
|
|
210
|
+
`- Hallucination rate (gated): ${pct(scorecard.hallucination_rate)}`,
|
|
211
|
+
`- Unmatched: ${c.unmatched} ` +
|
|
212
|
+
`(of which ${c.collisions} ambiguous signature collision(s))`,
|
|
213
|
+
];
|
|
214
|
+
if (scorecard.unmatched.length > 0) {
|
|
215
|
+
lines.push("", "## Unmatched (not scored)");
|
|
216
|
+
for (const entry of scorecard.unmatched) {
|
|
217
|
+
const ids = entry.finding_ids.length > 0 ? entry.finding_ids.join(", ") : "—";
|
|
218
|
+
const labels = entry.labels.length > 0 ? entry.labels.join(", ") : "—";
|
|
219
|
+
lines.push(`- \`${entry.signature}\` — ${entry.reason}: findings [${ids}], labels [${labels}]`);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return lines.join("\n") + "\n";
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=scoreAudit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoreAudit.js","sourceRoot":"","sources":["../../../src/audit/reporting/scoreAudit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;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,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;YACvE,KAAK,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,SAAS,QAAQ,KAAK,CAAC,MAAM,eAAe,GAAG,cAAc,MAAM,GAAG,CAAC,CAAC;QAClG,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AACjC,CAAC"}
|
|
@@ -1,6 +1,26 @@
|
|
|
1
|
-
import type { PartialCompletionTerminal } from "audit-tools/shared";
|
|
1
|
+
import type { PartialCompletionTerminal, RollingEngineLifecycleState } from "audit-tools/shared";
|
|
2
2
|
export declare const DISPATCH_RESULT_MAP_FILENAME = "dispatch-result-map.json";
|
|
3
3
|
export declare const ACTIVE_DISPATCH_FILENAME = "active-dispatch.json";
|
|
4
|
+
/**
|
|
5
|
+
* The resumable `waiting_for_provider` paused state of an audit rolling-dispatch
|
|
6
|
+
* run, persisted on the active-dispatch artifact so a quota-exhausted run pauses
|
|
7
|
+
* across `next-step` invocations instead of stranding packets (DC-4 fix 1). It
|
|
8
|
+
* carries the rolling-engine lifecycle state (`waiting_for_provider` →
|
|
9
|
+
* `terminal/livelock` per `advancePausedState`) PLUS the accumulated
|
|
10
|
+
* `SettledExclusionSet` — the pool ids that have been spilled-then-exhausted. The
|
|
11
|
+
* set is serialized as a sorted array (JSON has no Set) and rehydrated to a
|
|
12
|
+
* `ReadonlySet` before `advancePausedState`, so a settled pool is never re-offered
|
|
13
|
+
* as net-new on re-discovery (INV-S03 / CE-001). a8's cross-pool coordinator reads
|
|
14
|
+
* and co-derives the SAME field — this is the shared exclusion set, not a private
|
|
15
|
+
* one — so a pool a8 spilled off is already accounted for when the pause engages.
|
|
16
|
+
*/
|
|
17
|
+
export interface DispatchPausedState {
|
|
18
|
+
lifecycle: Extract<RollingEngineLifecycleState, {
|
|
19
|
+
kind: "waiting_for_provider";
|
|
20
|
+
}>;
|
|
21
|
+
/** Sorted pool ids that have been exhausted (the shared SettledExclusionSet). */
|
|
22
|
+
settled_exclusions: string[];
|
|
23
|
+
}
|
|
4
24
|
export interface ActiveDispatchState {
|
|
5
25
|
run_id: string;
|
|
6
26
|
created_at: string;
|
|
@@ -22,6 +42,14 @@ export interface ActiveDispatchState {
|
|
|
22
42
|
* on partial coverage, without blocking on tasks that can never be dispatched.
|
|
23
43
|
*/
|
|
24
44
|
partial_completion_terminal?: PartialCompletionTerminal;
|
|
45
|
+
/**
|
|
46
|
+
* Set when the rolling audit run is paused on an exhausted provider pool and is
|
|
47
|
+
* resumable (DC-4). Cleared once it resumes (capacity returned) or is promoted to
|
|
48
|
+
* a `partial_completion_terminal` (livelock after the pause limit). Mutually
|
|
49
|
+
* exclusive with a "done" state — a run is either paused here or terminal there,
|
|
50
|
+
* never both.
|
|
51
|
+
*/
|
|
52
|
+
paused_state?: DispatchPausedState;
|
|
25
53
|
}
|
|
26
54
|
export interface DispatchResultMapEntry {
|
|
27
55
|
packet_id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activeDispatch.d.ts","sourceRoot":"","sources":["../../../src/audit/types/activeDispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"activeDispatch.d.ts","sourceRoot":"","sources":["../../../src/audit/types/activeDispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,4BAA4B,6BAA6B,CAAC;AACvE,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,OAAO,CAChB,2BAA2B,EAC3B;QAAE,IAAI,EAAE,sBAAsB,CAAA;KAAE,CACjC,CAAC;IACF,iFAAiF;IACjF,kBAAkB,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,YAAY,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,iGAAiG;IACjG,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oDAAoD;IACpD,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,kDAAkD;IAClD,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B;;;;;OAKG;IACH,2BAA2B,CAAC,EAAE,yBAAyB,CAAC;IACxD;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;CACpC;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,EAAE,sCAAsC,CAAC;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,sBAAsB,EAAE,CAAC;CACnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activeDispatch.js","sourceRoot":"","sources":["../../../src/audit/types/activeDispatch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"activeDispatch.js","sourceRoot":"","sources":["../../../src/audit/types/activeDispatch.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,4BAA4B,GAAG,0BAA0B,CAAC;AACvE,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC"}
|
|
@@ -10,14 +10,14 @@ export declare const AnalyzerCapabilityEntrySchema: z.ZodObject<{
|
|
|
10
10
|
note: z.ZodOptional<z.ZodString>;
|
|
11
11
|
}, "strict", z.ZodTypeAny, {
|
|
12
12
|
id: string;
|
|
13
|
-
resolution: "repo" | "skip" | "cache" | "absent" | "
|
|
13
|
+
resolution: "repo" | "skip" | "cache" | "absent" | "not_applicable" | "installed";
|
|
14
14
|
setting: "auto" | "repo" | "ephemeral" | "permanent" | "skip";
|
|
15
15
|
edges_added: number;
|
|
16
16
|
routes_added: number;
|
|
17
17
|
note?: string | undefined;
|
|
18
18
|
}, {
|
|
19
19
|
id: string;
|
|
20
|
-
resolution: "repo" | "skip" | "cache" | "absent" | "
|
|
20
|
+
resolution: "repo" | "skip" | "cache" | "absent" | "not_applicable" | "installed";
|
|
21
21
|
setting: "auto" | "repo" | "ephemeral" | "permanent" | "skip";
|
|
22
22
|
edges_added: number;
|
|
23
23
|
routes_added: number;
|
|
@@ -36,14 +36,14 @@ export declare const AnalyzerCapabilityRecordSchema: z.ZodObject<{
|
|
|
36
36
|
note: z.ZodOptional<z.ZodString>;
|
|
37
37
|
}, "strict", z.ZodTypeAny, {
|
|
38
38
|
id: string;
|
|
39
|
-
resolution: "repo" | "skip" | "cache" | "absent" | "
|
|
39
|
+
resolution: "repo" | "skip" | "cache" | "absent" | "not_applicable" | "installed";
|
|
40
40
|
setting: "auto" | "repo" | "ephemeral" | "permanent" | "skip";
|
|
41
41
|
edges_added: number;
|
|
42
42
|
routes_added: number;
|
|
43
43
|
note?: string | undefined;
|
|
44
44
|
}, {
|
|
45
45
|
id: string;
|
|
46
|
-
resolution: "repo" | "skip" | "cache" | "absent" | "
|
|
46
|
+
resolution: "repo" | "skip" | "cache" | "absent" | "not_applicable" | "installed";
|
|
47
47
|
setting: "auto" | "repo" | "ephemeral" | "permanent" | "skip";
|
|
48
48
|
edges_added: number;
|
|
49
49
|
routes_added: number;
|
|
@@ -53,7 +53,7 @@ export declare const AnalyzerCapabilityRecordSchema: z.ZodObject<{
|
|
|
53
53
|
status: "applied" | "omitted";
|
|
54
54
|
analyzers: {
|
|
55
55
|
id: string;
|
|
56
|
-
resolution: "repo" | "skip" | "cache" | "absent" | "
|
|
56
|
+
resolution: "repo" | "skip" | "cache" | "absent" | "not_applicable" | "installed";
|
|
57
57
|
setting: "auto" | "repo" | "ephemeral" | "permanent" | "skip";
|
|
58
58
|
edges_added: number;
|
|
59
59
|
routes_added: number;
|
|
@@ -63,7 +63,7 @@ export declare const AnalyzerCapabilityRecordSchema: z.ZodObject<{
|
|
|
63
63
|
status: "applied" | "omitted";
|
|
64
64
|
analyzers: {
|
|
65
65
|
id: string;
|
|
66
|
-
resolution: "repo" | "skip" | "cache" | "absent" | "
|
|
66
|
+
resolution: "repo" | "skip" | "cache" | "absent" | "not_applicable" | "installed";
|
|
67
67
|
setting: "auto" | "repo" | "ephemeral" | "permanent" | "skip";
|
|
68
68
|
edges_added: number;
|
|
69
69
|
routes_added: number;
|