audit-tools 0.42.1 → 0.44.0
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/dispatch/merge-results.mjs +229 -140
- package/dispatch/validate-result.mjs +98 -40
- package/dist/audit/cli/conceptualDispatch.d.ts.map +1 -1
- package/dist/audit/cli/conceptualDispatch.js +35 -3
- package/dist/audit/cli/conceptualDispatch.js.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts +9 -1
- package/dist/audit/cli/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/audit/cli/dispatch/hostHandoff.js +94 -38
- package/dist/audit/cli/dispatch/hostHandoff.js.map +1 -1
- package/dist/audit/cli/laneSubmissions.d.ts +2 -2
- package/dist/audit/cli/laneSubmissions.js +2 -2
- package/dist/audit/cli/nextStepCommand.d.ts +64 -0
- package/dist/audit/cli/nextStepCommand.d.ts.map +1 -1
- package/dist/audit/cli/nextStepCommand.js +877 -783
- package/dist/audit/cli/nextStepCommand.js.map +1 -1
- package/dist/audit/cli/nextStepHelpers.d.ts +12 -36
- package/dist/audit/cli/nextStepHelpers.d.ts.map +1 -1
- package/dist/audit/cli/nextStepHelpers.js +34 -77
- package/dist/audit/cli/nextStepHelpers.js.map +1 -1
- package/dist/audit/cli/steps.d.ts +2 -2
- package/dist/audit/extractors/graph.d.ts +28 -2
- package/dist/audit/extractors/graph.d.ts.map +1 -1
- package/dist/audit/extractors/graph.js +122 -11
- package/dist/audit/extractors/graph.js.map +1 -1
- package/dist/audit/extractors/graphRoutes.d.ts +8 -0
- package/dist/audit/extractors/graphRoutes.d.ts.map +1 -1
- package/dist/audit/extractors/graphRoutes.js +71 -4
- package/dist/audit/extractors/graphRoutes.js.map +1 -1
- package/dist/audit/io/artifacts.d.ts +55 -0
- package/dist/audit/io/artifacts.d.ts.map +1 -1
- package/dist/audit/io/artifacts.js +189 -12
- package/dist/audit/io/artifacts.js.map +1 -1
- package/dist/audit/io/toolingManifest.d.ts +11 -0
- package/dist/audit/io/toolingManifest.d.ts.map +1 -1
- package/dist/audit/io/toolingManifest.js +13 -3
- package/dist/audit/io/toolingManifest.js.map +1 -1
- package/dist/audit/orchestrator/advance.d.ts +64 -0
- package/dist/audit/orchestrator/advance.d.ts.map +1 -1
- package/dist/audit/orchestrator/advance.js +191 -57
- package/dist/audit/orchestrator/advance.js.map +1 -1
- package/dist/audit/orchestrator/charterClarificationExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/charterClarificationExecutor.js +55 -21
- package/dist/audit/orchestrator/charterClarificationExecutor.js.map +1 -1
- package/dist/audit/orchestrator/flowCoverage.d.ts.map +1 -1
- package/dist/audit/orchestrator/flowCoverage.js +7 -10
- package/dist/audit/orchestrator/flowCoverage.js.map +1 -1
- package/dist/audit/orchestrator/flowPlanning.d.ts +54 -1
- package/dist/audit/orchestrator/flowPlanning.d.ts.map +1 -1
- package/dist/audit/orchestrator/flowPlanning.js +77 -18
- package/dist/audit/orchestrator/flowPlanning.js.map +1 -1
- package/dist/audit/orchestrator/flowRequeue.d.ts.map +1 -1
- package/dist/audit/orchestrator/flowRequeue.js +6 -10
- package/dist/audit/orchestrator/flowRequeue.js.map +1 -1
- package/dist/audit/orchestrator/requeueFold.d.ts.map +1 -1
- package/dist/audit/orchestrator/requeueFold.js +18 -5
- package/dist/audit/orchestrator/requeueFold.js.map +1 -1
- package/dist/audit/orchestrator/staleness.d.ts +24 -1
- package/dist/audit/orchestrator/staleness.d.ts.map +1 -1
- package/dist/audit/orchestrator/staleness.js +147 -16
- package/dist/audit/orchestrator/staleness.js.map +1 -1
- package/dist/audit/orchestrator/syntaxResolutionExecutor.d.ts +26 -0
- package/dist/audit/orchestrator/syntaxResolutionExecutor.d.ts.map +1 -1
- package/dist/audit/orchestrator/syntaxResolutionExecutor.js +97 -12
- package/dist/audit/orchestrator/syntaxResolutionExecutor.js.map +1 -1
- package/dist/audit/orchestrator/taskBuilder.d.ts.map +1 -1
- package/dist/audit/orchestrator/taskBuilder.js +111 -21
- package/dist/audit/orchestrator/taskBuilder.js.map +1 -1
- package/dist/audit/orchestrator/trivialAudit.d.ts +17 -1
- package/dist/audit/orchestrator/trivialAudit.d.ts.map +1 -1
- package/dist/audit/orchestrator/trivialAudit.js +31 -4
- package/dist/audit/orchestrator/trivialAudit.js.map +1 -1
- package/dist/audit/types/analyzerCapability.d.ts +6 -6
- package/dist/audit/types/charterRegister.d.ts +30 -12
- package/dist/audit/types/charterRegister.d.ts.map +1 -1
- package/dist/audit/types/charterRegister.js +22 -9
- package/dist/audit/types/charterRegister.js.map +1 -1
- package/dist/audit/validation/anchorGrounding.d.ts.map +1 -1
- package/dist/audit/validation/anchorGrounding.js +17 -0
- package/dist/audit/validation/anchorGrounding.js.map +1 -1
- package/dist/audit/validation/auditResults.d.ts +17 -0
- package/dist/audit/validation/auditResults.d.ts.map +1 -1
- package/dist/audit/validation/auditResults.js +50 -17
- package/dist/audit/validation/auditResults.js.map +1 -1
- package/dist/remediate/contractPipeline/cyclicSeamResolution.d.ts +48 -0
- package/dist/remediate/contractPipeline/cyclicSeamResolution.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/cyclicSeamResolution.js +128 -0
- package/dist/remediate/contractPipeline/cyclicSeamResolution.js.map +1 -1
- package/dist/remediate/contractPipeline/derive.d.ts +8 -5
- package/dist/remediate/contractPipeline/derive.d.ts.map +1 -1
- package/dist/remediate/contractPipeline/derive.js +8 -16
- package/dist/remediate/contractPipeline/derive.js.map +1 -1
- package/dist/remediate/index.d.ts.map +1 -1
- package/dist/remediate/index.js +43 -2
- package/dist/remediate/index.js.map +1 -1
- package/dist/remediate/intent/intentOrdering.d.ts +13 -5
- package/dist/remediate/intent/intentOrdering.d.ts.map +1 -1
- package/dist/remediate/intent/intentOrdering.js +56 -25
- package/dist/remediate/intent/intentOrdering.js.map +1 -1
- package/dist/remediate/phases/close.d.ts +57 -2
- package/dist/remediate/phases/close.d.ts.map +1 -1
- package/dist/remediate/phases/close.js +260 -36
- package/dist/remediate/phases/close.js.map +1 -1
- package/dist/remediate/phases/triage.d.ts.map +1 -1
- package/dist/remediate/phases/triage.js +14 -2
- package/dist/remediate/phases/triage.js.map +1 -1
- package/dist/remediate/state/disposition.d.ts +26 -4
- package/dist/remediate/state/disposition.d.ts.map +1 -1
- package/dist/remediate/state/itemStatus.d.ts +33 -6
- package/dist/remediate/state/itemStatus.d.ts.map +1 -1
- package/dist/remediate/state/itemStatus.js +154 -39
- package/dist/remediate/state/itemStatus.js.map +1 -1
- package/dist/remediate/state/types.d.ts +41 -2
- package/dist/remediate/state/types.d.ts.map +1 -1
- package/dist/remediate/state/types.js.map +1 -1
- package/dist/remediate/steps/contractPipeline.d.ts +296 -15
- package/dist/remediate/steps/contractPipeline.d.ts.map +1 -1
- package/dist/remediate/steps/contractPipeline.js +1783 -1001
- package/dist/remediate/steps/contractPipeline.js.map +1 -1
- package/dist/remediate/steps/dispatch/hostHandoff.d.ts +137 -2
- package/dist/remediate/steps/dispatch/hostHandoff.d.ts.map +1 -1
- package/dist/remediate/steps/dispatch/hostHandoff.js +657 -59
- package/dist/remediate/steps/dispatch/hostHandoff.js.map +1 -1
- package/dist/remediate/steps/finalGate.d.ts +136 -37
- package/dist/remediate/steps/finalGate.d.ts.map +1 -1
- package/dist/remediate/steps/finalGate.js +120 -86
- package/dist/remediate/steps/finalGate.js.map +1 -1
- package/dist/remediate/steps/gateCommands.d.ts +8 -0
- package/dist/remediate/steps/gateCommands.d.ts.map +1 -1
- package/dist/remediate/steps/gateCommands.js +40 -11
- package/dist/remediate/steps/gateCommands.js.map +1 -1
- package/dist/remediate/steps/nextStep.d.ts +96 -5
- package/dist/remediate/steps/nextStep.d.ts.map +1 -1
- package/dist/remediate/steps/nextStep.js +668 -147
- package/dist/remediate/steps/nextStep.js.map +1 -1
- package/dist/remediate/steps/types.d.ts +4 -3
- package/dist/remediate/steps/types.d.ts.map +1 -1
- package/dist/remediate/steps/types.js +10 -2
- package/dist/remediate/steps/types.js.map +1 -1
- package/dist/remediate/validation/artifacts.d.ts +20 -2
- package/dist/remediate/validation/artifacts.d.ts.map +1 -1
- package/dist/remediate/validation/artifacts.js +224 -130
- package/dist/remediate/validation/artifacts.js.map +1 -1
- package/dist/remediate/validation/contractPipelineGates.d.ts +58 -0
- package/dist/remediate/validation/contractPipelineGates.d.ts.map +1 -1
- package/dist/remediate/validation/contractPipelineGates.js +143 -27
- package/dist/remediate/validation/contractPipelineGates.js.map +1 -1
- package/dist/shared/analyzers/acquisitionEngine.d.ts +72 -25
- package/dist/shared/analyzers/acquisitionEngine.d.ts.map +1 -1
- package/dist/shared/analyzers/acquisitionEngine.js +149 -15
- package/dist/shared/analyzers/acquisitionEngine.js.map +1 -1
- package/dist/shared/analyzers/binaryAcquisition.d.ts +27 -2
- package/dist/shared/analyzers/binaryAcquisition.d.ts.map +1 -1
- package/dist/shared/analyzers/binaryAcquisition.js +149 -43
- package/dist/shared/analyzers/binaryAcquisition.js.map +1 -1
- package/dist/shared/analyzers/candidates.d.ts +9 -8
- package/dist/shared/analyzers/candidates.d.ts.map +1 -1
- package/dist/shared/analyzers/candidates.js +96 -64
- package/dist/shared/analyzers/candidates.js.map +1 -1
- package/dist/shared/analyzers/normalizeExternal.d.ts +40 -12
- package/dist/shared/analyzers/normalizeExternal.d.ts.map +1 -1
- package/dist/shared/analyzers/normalizeExternal.js +74 -18
- package/dist/shared/analyzers/normalizeExternal.js.map +1 -1
- package/dist/shared/analyzers/rubocop.d.ts +14 -13
- package/dist/shared/analyzers/rubocop.d.ts.map +1 -1
- package/dist/shared/analyzers/rubocop.js +29 -6
- package/dist/shared/analyzers/rubocop.js.map +1 -1
- package/dist/shared/analyzers/types.d.ts +196 -13
- package/dist/shared/analyzers/types.d.ts.map +1 -1
- package/dist/shared/analyzers/types.js +122 -9
- package/dist/shared/analyzers/types.js.map +1 -1
- package/dist/shared/decompose/charterClarification.d.ts +12 -1
- package/dist/shared/decompose/charterClarification.d.ts.map +1 -1
- package/dist/shared/decompose/charterClarification.js +11 -4
- package/dist/shared/decompose/charterClarification.js.map +1 -1
- package/dist/shared/decompose/charterExtraction.d.ts +20 -10
- package/dist/shared/decompose/charterExtraction.d.ts.map +1 -1
- package/dist/shared/decompose/charterExtraction.js +52 -23
- package/dist/shared/decompose/charterExtraction.js.map +1 -1
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +5 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/intent/freeFormIntentInterpreter.d.ts +12 -2
- package/dist/shared/intent/freeFormIntentInterpreter.d.ts.map +1 -1
- package/dist/shared/intent/freeFormIntentInterpreter.js +27 -22
- package/dist/shared/intent/freeFormIntentInterpreter.js.map +1 -1
- package/dist/shared/intent/pathScope.d.ts +12 -1
- package/dist/shared/intent/pathScope.d.ts.map +1 -1
- package/dist/shared/intent/pathScope.js +56 -19
- package/dist/shared/intent/pathScope.js.map +1 -1
- package/dist/shared/intent/sharedIntentData.d.ts +19 -1
- package/dist/shared/intent/sharedIntentData.d.ts.map +1 -1
- package/dist/shared/intent/sharedIntentData.js +33 -8
- package/dist/shared/intent/sharedIntentData.js.map +1 -1
- package/dist/shared/io/fileLock.d.ts +12 -0
- package/dist/shared/io/fileLock.d.ts.map +1 -1
- package/dist/shared/io/fileLock.js +48 -5
- package/dist/shared/io/fileLock.js.map +1 -1
- package/dist/shared/io/json.d.ts +13 -0
- package/dist/shared/io/json.d.ts.map +1 -1
- package/dist/shared/io/json.js +19 -1
- package/dist/shared/io/json.js.map +1 -1
- package/dist/shared/steps/stepEmissionScaffold.d.ts +69 -0
- package/dist/shared/steps/stepEmissionScaffold.d.ts.map +1 -0
- package/dist/shared/steps/stepEmissionScaffold.js +83 -0
- package/dist/shared/steps/stepEmissionScaffold.js.map +1 -0
- package/dist/shared/submission/handRecovery.d.ts.map +1 -1
- package/dist/shared/submission/handRecovery.js +69 -4
- package/dist/shared/submission/handRecovery.js.map +1 -1
- package/dist/shared/submission/submissionIdentity.d.ts +10 -1
- package/dist/shared/submission/submissionIdentity.d.ts.map +1 -1
- package/dist/shared/submission/submissionIdentity.js +12 -3
- package/dist/shared/submission/submissionIdentity.js.map +1 -1
- package/dist/shared/submission/submissionLedger.d.ts +43 -2
- package/dist/shared/submission/submissionLedger.d.ts.map +1 -1
- package/dist/shared/submission/submissionLedger.js +50 -7
- package/dist/shared/submission/submissionLedger.js.map +1 -1
- package/dist/shared/tooling/allowlistedExec.d.ts +9 -0
- package/dist/shared/tooling/allowlistedExec.d.ts.map +1 -1
- package/dist/shared/tooling/allowlistedExec.js +19 -2
- package/dist/shared/tooling/allowlistedExec.js.map +1 -1
- package/dist/shared/tooling/commandShape.d.ts +21 -0
- package/dist/shared/tooling/commandShape.d.ts.map +1 -0
- package/dist/shared/tooling/commandShape.js +120 -0
- package/dist/shared/tooling/commandShape.js.map +1 -0
- package/dist/shared/types/charter.d.ts +24 -0
- package/dist/shared/types/charter.d.ts.map +1 -1
- package/dist/shared/types/charter.js +9 -0
- package/dist/shared/types/charter.js.map +1 -1
- package/dist/shared/types/remediationOutcome.d.ts +282 -9
- package/dist/shared/types/remediationOutcome.d.ts.map +1 -1
- package/dist/shared/types/remediationOutcome.js +174 -1
- package/dist/shared/types/remediationOutcome.js.map +1 -1
- package/package.json +2 -1
- package/remediate-code.mjs +15 -0
- package/wrapper/remediate-code-wrapper-install-hosts.mjs +45 -4
- package/wrapper/remediate-code-wrapper-install-renderers.mjs +12 -2
|
@@ -111,17 +111,93 @@ export declare const ExternalAnalyzerOwnershipRootSchema: z.ZodObject<{
|
|
|
111
111
|
confidence?: number | undefined;
|
|
112
112
|
kind?: string | undefined;
|
|
113
113
|
}>;
|
|
114
|
+
/**
|
|
115
|
+
* The analyzer status vocabulary, single-sourced (artifact:analyzer-status-vocabulary).
|
|
116
|
+
* The zod enum below is BUILT from this tuple, so there is exactly one place a member
|
|
117
|
+
* is added — and {@link EXTERNAL_ANALYZER_STATUS_CLASSIFICATION} below is an exhaustive
|
|
118
|
+
* `Record` over it, so widening the tuple without classifying the new member is a
|
|
119
|
+
* COMPILE error rather than a silent fall-through to "the run was fine".
|
|
120
|
+
*/
|
|
121
|
+
export declare const EXTERNAL_ANALYZER_TOOL_STATUSES: readonly ["skipped", "success", "findings", "not_resolved", "spawn_error", "parse_error", "failed", "checksum_mismatch"];
|
|
122
|
+
export type ExternalAnalyzerToolStatusValue = (typeof EXTERNAL_ANALYZER_TOOL_STATUSES)[number];
|
|
123
|
+
/**
|
|
124
|
+
* What each status says about COVERAGE — the question every consumer of a status
|
|
125
|
+
* record is really asking. `clean` is the ONLY value that may be read as "this tool
|
|
126
|
+
* ran and found nothing"; `degraded` means the tool ran but its output cannot be
|
|
127
|
+
* trusted as coverage; `not_run` means no coverage was produced at all.
|
|
128
|
+
*
|
|
129
|
+
* Exhaustive by construction: adding a member to
|
|
130
|
+
* {@link EXTERNAL_ANALYZER_TOOL_STATUSES} without adding its row here fails
|
|
131
|
+
* `npm run check`, so a new status can never default into `clean`.
|
|
132
|
+
*/
|
|
133
|
+
/**
|
|
134
|
+
* What a status says about coverage. Named as a type so the vocabulary has ONE
|
|
135
|
+
* home and every consumer of the classification speaks it by name.
|
|
136
|
+
*/
|
|
137
|
+
export type ExternalAnalyzerCoverage = "clean" | "findings" | "degraded" | "not_run";
|
|
138
|
+
/**
|
|
139
|
+
* True when a coverage class means NO trustworthy coverage was produced — the
|
|
140
|
+
* single member-level answer. Both consumers ask it here rather than each
|
|
141
|
+
* re-typing `=== "degraded" || === "not_run"`, so widening the coverage
|
|
142
|
+
* vocabulary is one edit guarded by a compile error, never a silent divergence
|
|
143
|
+
* between two copies of the same comparison.
|
|
144
|
+
*/
|
|
145
|
+
export declare function isNonCleanAnalyzerCoverage(coverage: ExternalAnalyzerCoverage): boolean;
|
|
146
|
+
export declare const EXTERNAL_ANALYZER_STATUS_CLASSIFICATION: Record<ExternalAnalyzerToolStatusValue, ExternalAnalyzerCoverage>;
|
|
147
|
+
/**
|
|
148
|
+
* True when a RECORD means "this tool did not produce trustworthy coverage".
|
|
149
|
+
*
|
|
150
|
+
* The status member alone cannot answer this, because degradation is not always
|
|
151
|
+
* terminal: a run can exit non-zero, fail to parse, or drop rows and STILL surface
|
|
152
|
+
* some items, which lands it on `findings` — an affirmative member describing a
|
|
153
|
+
* partially-crashed run. Asking the member in isolation reports such a run as
|
|
154
|
+
* trustworthy, which is the same success-shaped-empty mistake one level up.
|
|
155
|
+
*
|
|
156
|
+
* So the question is asked of the whole record: degraded when the member says so, OR
|
|
157
|
+
* when the record carries a marker that findings were LOST —
|
|
158
|
+
* - a non-zero exit, or a NULL exit (killed by a signal, never exited on its own);
|
|
159
|
+
* - `dropped_rows` (parser rows plus normalizer items the run failed to report).
|
|
160
|
+
*
|
|
161
|
+
* `source_read_failures` is deliberately NOT in that set. Provenance is optional
|
|
162
|
+
* everywhere on this contract: an item whose anchor could not be resolved is still a
|
|
163
|
+
* fully reported lead, so an unresolved anchor is a weaker join key, not lost
|
|
164
|
+
* coverage. It stays on the record because it is worth surfacing; it just does not
|
|
165
|
+
* make the run untrustworthy.
|
|
166
|
+
*
|
|
167
|
+
* {@link EXTERNAL_ANALYZER_STATUS_CLASSIFICATION} remains the status-MEMBER map and
|
|
168
|
+
* the compile gate; this is the consumer-facing answer.
|
|
169
|
+
*/
|
|
170
|
+
export declare function isDegradedExternalAnalyzerStatus(record: Pick<ExternalAnalyzerToolStatus, "status" | "exit_code" | "dropped_rows">): boolean;
|
|
114
171
|
export declare const ExternalAnalyzerToolStatusSchema: z.ZodObject<{
|
|
115
172
|
tool: z.ZodString;
|
|
116
173
|
command: z.ZodOptional<z.ZodString>;
|
|
117
174
|
resolved: z.ZodBoolean;
|
|
118
|
-
status: z.ZodEnum<["skipped", "success", "findings", "not_resolved", "spawn_error", "parse_error", "failed"]>;
|
|
175
|
+
status: z.ZodEnum<["skipped", "success", "findings", "not_resolved", "spawn_error", "parse_error", "failed", "checksum_mismatch"]>;
|
|
119
176
|
exit_code: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
120
177
|
error: z.ZodOptional<z.ZodString>;
|
|
121
178
|
output_snippet: z.ZodOptional<z.ZodString>;
|
|
179
|
+
/**
|
|
180
|
+
* The tool's own stderr, bounded. Present whenever stderr carried text — it is
|
|
181
|
+
* the only post-run evidence of WHY a non-zero exit or a stderr-only run failed.
|
|
182
|
+
*/
|
|
183
|
+
stderr_snippet: z.ZodOptional<z.ZodString>;
|
|
184
|
+
/**
|
|
185
|
+
* Everything this run failed to report, as ONE count: rows the parser understood
|
|
186
|
+
* the shape of but could not use (malformed CSV/JSON rows), PLUS items the
|
|
187
|
+
* normalizer discarded for a missing path or summary. The engine merges the two
|
|
188
|
+
* because they are the same question to a consumer — how much did this run lose?
|
|
189
|
+
* A non-zero count means the run under-reports; it is never a clean scan.
|
|
190
|
+
*/
|
|
191
|
+
dropped_rows: z.ZodOptional<z.ZodNumber>;
|
|
192
|
+
/**
|
|
193
|
+
* Items that named a path + line but whose source could not be read, so their
|
|
194
|
+
* content-anchored provenance was dropped. Distinguishes a broken read seam from
|
|
195
|
+
* a tool that legitimately reports no line numbers.
|
|
196
|
+
*/
|
|
197
|
+
source_read_failures: z.ZodOptional<z.ZodNumber>;
|
|
122
198
|
duration_ms: z.ZodOptional<z.ZodNumber>;
|
|
123
199
|
}, "strict", z.ZodTypeAny, {
|
|
124
|
-
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error";
|
|
200
|
+
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch";
|
|
125
201
|
resolved: boolean;
|
|
126
202
|
tool: string;
|
|
127
203
|
error?: string | undefined;
|
|
@@ -129,8 +205,11 @@ export declare const ExternalAnalyzerToolStatusSchema: z.ZodObject<{
|
|
|
129
205
|
duration_ms?: number | undefined;
|
|
130
206
|
exit_code?: number | null | undefined;
|
|
131
207
|
output_snippet?: string | undefined;
|
|
208
|
+
stderr_snippet?: string | undefined;
|
|
209
|
+
dropped_rows?: number | undefined;
|
|
210
|
+
source_read_failures?: number | undefined;
|
|
132
211
|
}, {
|
|
133
|
-
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error";
|
|
212
|
+
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch";
|
|
134
213
|
resolved: boolean;
|
|
135
214
|
tool: string;
|
|
136
215
|
error?: string | undefined;
|
|
@@ -138,8 +217,50 @@ export declare const ExternalAnalyzerToolStatusSchema: z.ZodObject<{
|
|
|
138
217
|
duration_ms?: number | undefined;
|
|
139
218
|
exit_code?: number | null | undefined;
|
|
140
219
|
output_snippet?: string | undefined;
|
|
220
|
+
stderr_snippet?: string | undefined;
|
|
221
|
+
dropped_rows?: number | undefined;
|
|
222
|
+
source_read_failures?: number | undefined;
|
|
141
223
|
}>;
|
|
142
224
|
export type ExternalAnalyzerToolStatus = z.infer<typeof ExternalAnalyzerToolStatusSchema>;
|
|
225
|
+
/**
|
|
226
|
+
* The generic pre-normalization item shape every analyzer parser emits. `from`/`to`
|
|
227
|
+
* are the optional dataflow-edge endpoints `normalizeGenericExternalEdges` reads.
|
|
228
|
+
*/
|
|
229
|
+
export interface ExternalAnalyzerParsedItem {
|
|
230
|
+
id?: string;
|
|
231
|
+
category?: string;
|
|
232
|
+
severity?: string;
|
|
233
|
+
path?: string;
|
|
234
|
+
line_start?: number;
|
|
235
|
+
line_end?: number;
|
|
236
|
+
summary?: string;
|
|
237
|
+
rule?: string;
|
|
238
|
+
raw?: unknown;
|
|
239
|
+
from?: unknown;
|
|
240
|
+
to?: unknown;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* A parse that can SAY it degraded. A bare `[]` cannot distinguish "the tool found
|
|
244
|
+
* nothing" from "the payload was unparseable" or "half the rows were malformed", and
|
|
245
|
+
* that ambiguity is what makes a broken analyzer read as a clean scan downstream.
|
|
246
|
+
*/
|
|
247
|
+
export interface ExternalAnalyzerParseReport {
|
|
248
|
+
items: ExternalAnalyzerParsedItem[];
|
|
249
|
+
/** The payload could not be parsed at all (bad JSON/CSV, or the wrong top-level shape). */
|
|
250
|
+
parse_failed?: boolean;
|
|
251
|
+
/** Rows recognised but unusable — counted, never silently dropped. */
|
|
252
|
+
dropped_rows?: number;
|
|
253
|
+
/** Human-readable cause, carried onto the status record. */
|
|
254
|
+
note?: string;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* What `ExternalAnalyzerCandidate.parse` returns. A plain array is the "nothing to
|
|
258
|
+
* report beyond the items" form; the report form is how a parser reports degradation.
|
|
259
|
+
* Read both through {@link readParseOutcome} so no consumer has to branch.
|
|
260
|
+
*/
|
|
261
|
+
export type ExternalAnalyzerParseOutcome = ExternalAnalyzerParsedItem[] | ExternalAnalyzerParseReport;
|
|
262
|
+
/** Normalize either parse-outcome form into the report form. */
|
|
263
|
+
export declare function readParseOutcome(outcome: ExternalAnalyzerParseOutcome | undefined | null): Required<Pick<ExternalAnalyzerParseReport, "items">> & Omit<ExternalAnalyzerParseReport, "items">;
|
|
143
264
|
/** Imported analyzer output captured at a single generation time. */
|
|
144
265
|
export declare const ExternalAnalyzerResultsSchema: z.ZodObject<{
|
|
145
266
|
tool: z.ZodString;
|
|
@@ -190,13 +311,32 @@ export declare const ExternalAnalyzerResultsSchema: z.ZodObject<{
|
|
|
190
311
|
tool: z.ZodString;
|
|
191
312
|
command: z.ZodOptional<z.ZodString>;
|
|
192
313
|
resolved: z.ZodBoolean;
|
|
193
|
-
status: z.ZodEnum<["skipped", "success", "findings", "not_resolved", "spawn_error", "parse_error", "failed"]>;
|
|
314
|
+
status: z.ZodEnum<["skipped", "success", "findings", "not_resolved", "spawn_error", "parse_error", "failed", "checksum_mismatch"]>;
|
|
194
315
|
exit_code: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
195
316
|
error: z.ZodOptional<z.ZodString>;
|
|
196
317
|
output_snippet: z.ZodOptional<z.ZodString>;
|
|
318
|
+
/**
|
|
319
|
+
* The tool's own stderr, bounded. Present whenever stderr carried text — it is
|
|
320
|
+
* the only post-run evidence of WHY a non-zero exit or a stderr-only run failed.
|
|
321
|
+
*/
|
|
322
|
+
stderr_snippet: z.ZodOptional<z.ZodString>;
|
|
323
|
+
/**
|
|
324
|
+
* Everything this run failed to report, as ONE count: rows the parser understood
|
|
325
|
+
* the shape of but could not use (malformed CSV/JSON rows), PLUS items the
|
|
326
|
+
* normalizer discarded for a missing path or summary. The engine merges the two
|
|
327
|
+
* because they are the same question to a consumer — how much did this run lose?
|
|
328
|
+
* A non-zero count means the run under-reports; it is never a clean scan.
|
|
329
|
+
*/
|
|
330
|
+
dropped_rows: z.ZodOptional<z.ZodNumber>;
|
|
331
|
+
/**
|
|
332
|
+
* Items that named a path + line but whose source could not be read, so their
|
|
333
|
+
* content-anchored provenance was dropped. Distinguishes a broken read seam from
|
|
334
|
+
* a tool that legitimately reports no line numbers.
|
|
335
|
+
*/
|
|
336
|
+
source_read_failures: z.ZodOptional<z.ZodNumber>;
|
|
197
337
|
duration_ms: z.ZodOptional<z.ZodNumber>;
|
|
198
338
|
}, "strict", z.ZodTypeAny, {
|
|
199
|
-
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error";
|
|
339
|
+
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch";
|
|
200
340
|
resolved: boolean;
|
|
201
341
|
tool: string;
|
|
202
342
|
error?: string | undefined;
|
|
@@ -204,8 +344,11 @@ export declare const ExternalAnalyzerResultsSchema: z.ZodObject<{
|
|
|
204
344
|
duration_ms?: number | undefined;
|
|
205
345
|
exit_code?: number | null | undefined;
|
|
206
346
|
output_snippet?: string | undefined;
|
|
347
|
+
stderr_snippet?: string | undefined;
|
|
348
|
+
dropped_rows?: number | undefined;
|
|
349
|
+
source_read_failures?: number | undefined;
|
|
207
350
|
}, {
|
|
208
|
-
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error";
|
|
351
|
+
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch";
|
|
209
352
|
resolved: boolean;
|
|
210
353
|
tool: string;
|
|
211
354
|
error?: string | undefined;
|
|
@@ -213,6 +356,9 @@ export declare const ExternalAnalyzerResultsSchema: z.ZodObject<{
|
|
|
213
356
|
duration_ms?: number | undefined;
|
|
214
357
|
exit_code?: number | null | undefined;
|
|
215
358
|
output_snippet?: string | undefined;
|
|
359
|
+
stderr_snippet?: string | undefined;
|
|
360
|
+
dropped_rows?: number | undefined;
|
|
361
|
+
source_read_failures?: number | undefined;
|
|
216
362
|
}>, "many">>;
|
|
217
363
|
results: z.ZodArray<z.ZodObject<{
|
|
218
364
|
id: z.ZodString;
|
|
@@ -310,7 +456,7 @@ export declare const ExternalAnalyzerResultsSchema: z.ZodObject<{
|
|
|
310
456
|
kind?: string | undefined;
|
|
311
457
|
}[] | undefined;
|
|
312
458
|
tool_statuses?: {
|
|
313
|
-
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error";
|
|
459
|
+
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch";
|
|
314
460
|
resolved: boolean;
|
|
315
461
|
tool: string;
|
|
316
462
|
error?: string | undefined;
|
|
@@ -318,6 +464,9 @@ export declare const ExternalAnalyzerResultsSchema: z.ZodObject<{
|
|
|
318
464
|
duration_ms?: number | undefined;
|
|
319
465
|
exit_code?: number | null | undefined;
|
|
320
466
|
output_snippet?: string | undefined;
|
|
467
|
+
stderr_snippet?: string | undefined;
|
|
468
|
+
dropped_rows?: number | undefined;
|
|
469
|
+
source_read_failures?: number | undefined;
|
|
321
470
|
}[] | undefined;
|
|
322
471
|
}, {
|
|
323
472
|
tool: string;
|
|
@@ -354,7 +503,7 @@ export declare const ExternalAnalyzerResultsSchema: z.ZodObject<{
|
|
|
354
503
|
kind?: string | undefined;
|
|
355
504
|
}[] | undefined;
|
|
356
505
|
tool_statuses?: {
|
|
357
|
-
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error";
|
|
506
|
+
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch";
|
|
358
507
|
resolved: boolean;
|
|
359
508
|
tool: string;
|
|
360
509
|
error?: string | undefined;
|
|
@@ -362,6 +511,9 @@ export declare const ExternalAnalyzerResultsSchema: z.ZodObject<{
|
|
|
362
511
|
duration_ms?: number | undefined;
|
|
363
512
|
exit_code?: number | null | undefined;
|
|
364
513
|
output_snippet?: string | undefined;
|
|
514
|
+
stderr_snippet?: string | undefined;
|
|
515
|
+
dropped_rows?: number | undefined;
|
|
516
|
+
source_read_failures?: number | undefined;
|
|
365
517
|
}[] | undefined;
|
|
366
518
|
}>;
|
|
367
519
|
export type ExternalAnalyzerResults = z.infer<typeof ExternalAnalyzerResultsSchema>;
|
|
@@ -384,13 +536,32 @@ export declare const ExternalAnalyzerAcquisitionMarkerSchema: z.ZodObject<{
|
|
|
384
536
|
tool: z.ZodString;
|
|
385
537
|
command: z.ZodOptional<z.ZodString>;
|
|
386
538
|
resolved: z.ZodBoolean;
|
|
387
|
-
status: z.ZodEnum<["skipped", "success", "findings", "not_resolved", "spawn_error", "parse_error", "failed"]>;
|
|
539
|
+
status: z.ZodEnum<["skipped", "success", "findings", "not_resolved", "spawn_error", "parse_error", "failed", "checksum_mismatch"]>;
|
|
388
540
|
exit_code: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
389
541
|
error: z.ZodOptional<z.ZodString>;
|
|
390
542
|
output_snippet: z.ZodOptional<z.ZodString>;
|
|
543
|
+
/**
|
|
544
|
+
* The tool's own stderr, bounded. Present whenever stderr carried text — it is
|
|
545
|
+
* the only post-run evidence of WHY a non-zero exit or a stderr-only run failed.
|
|
546
|
+
*/
|
|
547
|
+
stderr_snippet: z.ZodOptional<z.ZodString>;
|
|
548
|
+
/**
|
|
549
|
+
* Everything this run failed to report, as ONE count: rows the parser understood
|
|
550
|
+
* the shape of but could not use (malformed CSV/JSON rows), PLUS items the
|
|
551
|
+
* normalizer discarded for a missing path or summary. The engine merges the two
|
|
552
|
+
* because they are the same question to a consumer — how much did this run lose?
|
|
553
|
+
* A non-zero count means the run under-reports; it is never a clean scan.
|
|
554
|
+
*/
|
|
555
|
+
dropped_rows: z.ZodOptional<z.ZodNumber>;
|
|
556
|
+
/**
|
|
557
|
+
* Items that named a path + line but whose source could not be read, so their
|
|
558
|
+
* content-anchored provenance was dropped. Distinguishes a broken read seam from
|
|
559
|
+
* a tool that legitimately reports no line numbers.
|
|
560
|
+
*/
|
|
561
|
+
source_read_failures: z.ZodOptional<z.ZodNumber>;
|
|
391
562
|
duration_ms: z.ZodOptional<z.ZodNumber>;
|
|
392
563
|
}, "strict", z.ZodTypeAny, {
|
|
393
|
-
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error";
|
|
564
|
+
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch";
|
|
394
565
|
resolved: boolean;
|
|
395
566
|
tool: string;
|
|
396
567
|
error?: string | undefined;
|
|
@@ -398,8 +569,11 @@ export declare const ExternalAnalyzerAcquisitionMarkerSchema: z.ZodObject<{
|
|
|
398
569
|
duration_ms?: number | undefined;
|
|
399
570
|
exit_code?: number | null | undefined;
|
|
400
571
|
output_snippet?: string | undefined;
|
|
572
|
+
stderr_snippet?: string | undefined;
|
|
573
|
+
dropped_rows?: number | undefined;
|
|
574
|
+
source_read_failures?: number | undefined;
|
|
401
575
|
}, {
|
|
402
|
-
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error";
|
|
576
|
+
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch";
|
|
403
577
|
resolved: boolean;
|
|
404
578
|
tool: string;
|
|
405
579
|
error?: string | undefined;
|
|
@@ -407,11 +581,14 @@ export declare const ExternalAnalyzerAcquisitionMarkerSchema: z.ZodObject<{
|
|
|
407
581
|
duration_ms?: number | undefined;
|
|
408
582
|
exit_code?: number | null | undefined;
|
|
409
583
|
output_snippet?: string | undefined;
|
|
584
|
+
stderr_snippet?: string | undefined;
|
|
585
|
+
dropped_rows?: number | undefined;
|
|
586
|
+
source_read_failures?: number | undefined;
|
|
410
587
|
}>, "many">;
|
|
411
588
|
}, "strict", z.ZodTypeAny, {
|
|
412
589
|
enabled: boolean;
|
|
413
590
|
tool_statuses: {
|
|
414
|
-
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error";
|
|
591
|
+
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch";
|
|
415
592
|
resolved: boolean;
|
|
416
593
|
tool: string;
|
|
417
594
|
error?: string | undefined;
|
|
@@ -419,12 +596,15 @@ export declare const ExternalAnalyzerAcquisitionMarkerSchema: z.ZodObject<{
|
|
|
419
596
|
duration_ms?: number | undefined;
|
|
420
597
|
exit_code?: number | null | undefined;
|
|
421
598
|
output_snippet?: string | undefined;
|
|
599
|
+
stderr_snippet?: string | undefined;
|
|
600
|
+
dropped_rows?: number | undefined;
|
|
601
|
+
source_read_failures?: number | undefined;
|
|
422
602
|
}[];
|
|
423
603
|
generated_at?: string | undefined;
|
|
424
604
|
}, {
|
|
425
605
|
enabled: boolean;
|
|
426
606
|
tool_statuses: {
|
|
427
|
-
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error";
|
|
607
|
+
status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch";
|
|
428
608
|
resolved: boolean;
|
|
429
609
|
tool: string;
|
|
430
610
|
error?: string | undefined;
|
|
@@ -432,6 +612,9 @@ export declare const ExternalAnalyzerAcquisitionMarkerSchema: z.ZodObject<{
|
|
|
432
612
|
duration_ms?: number | undefined;
|
|
433
613
|
exit_code?: number | null | undefined;
|
|
434
614
|
output_snippet?: string | undefined;
|
|
615
|
+
stderr_snippet?: string | undefined;
|
|
616
|
+
dropped_rows?: number | undefined;
|
|
617
|
+
source_read_failures?: number | undefined;
|
|
435
618
|
}[];
|
|
436
619
|
generated_at?: string | undefined;
|
|
437
620
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/shared/analyzers/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,sFAAsF;AACtF,eAAO,MAAM,gCAAgC;;;;;;;;;IAUzC,iFAAiF;;IAEjF,yEAAyE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGlE,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,gCAAgC,CACxC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;EAQjC,CAAC;AACZ,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;EAQrC,CAAC;AAEZ,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/shared/analyzers/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,sFAAsF;AACtF,eAAO,MAAM,gCAAgC;;;;;;;;;IAUzC,iFAAiF;;IAEjF,yEAAyE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGlE,CAAC;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsQlE,CAAC;AACZ,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uCAAuC;;;;;;;;;;;QAxHhD;;;WAGG;;QAEH;;;;;;WAMG;;QAEH;;;;WAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6GI,CAAC;AACZ,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,uCAAuC,CAC/C,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,uBAAuB,EAAE,GAAG,SAAS,EAC/C,QAAQ,EAAE,uBAAuB,GAChC,uBAAuB,EAAE,CAI3B"}
|
|
@@ -45,26 +45,139 @@ export const ExternalAnalyzerOwnershipRootSchema = z
|
|
|
45
45
|
reason: z.string().optional(),
|
|
46
46
|
})
|
|
47
47
|
.strict();
|
|
48
|
+
/**
|
|
49
|
+
* The analyzer status vocabulary, single-sourced (artifact:analyzer-status-vocabulary).
|
|
50
|
+
* The zod enum below is BUILT from this tuple, so there is exactly one place a member
|
|
51
|
+
* is added — and {@link EXTERNAL_ANALYZER_STATUS_CLASSIFICATION} below is an exhaustive
|
|
52
|
+
* `Record` over it, so widening the tuple without classifying the new member is a
|
|
53
|
+
* COMPILE error rather than a silent fall-through to "the run was fine".
|
|
54
|
+
*/
|
|
55
|
+
export const EXTERNAL_ANALYZER_TOOL_STATUSES = [
|
|
56
|
+
"skipped",
|
|
57
|
+
"success",
|
|
58
|
+
"findings",
|
|
59
|
+
"not_resolved",
|
|
60
|
+
"spawn_error",
|
|
61
|
+
"parse_error",
|
|
62
|
+
"failed",
|
|
63
|
+
/** The downloaded release asset did not match the pinned release checksums. */
|
|
64
|
+
"checksum_mismatch",
|
|
65
|
+
];
|
|
66
|
+
/**
|
|
67
|
+
* Which coverage classes may be read as "this tool produced trustworthy
|
|
68
|
+
* coverage". Exhaustive by construction: a new coverage class without a row here
|
|
69
|
+
* fails `npm run check` rather than defaulting into either answer.
|
|
70
|
+
*/
|
|
71
|
+
const COVERAGE_IS_TRUSTWORTHY = {
|
|
72
|
+
clean: true,
|
|
73
|
+
findings: true,
|
|
74
|
+
degraded: false,
|
|
75
|
+
not_run: false,
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* True when a coverage class means NO trustworthy coverage was produced — the
|
|
79
|
+
* single member-level answer. Both consumers ask it here rather than each
|
|
80
|
+
* re-typing `=== "degraded" || === "not_run"`, so widening the coverage
|
|
81
|
+
* vocabulary is one edit guarded by a compile error, never a silent divergence
|
|
82
|
+
* between two copies of the same comparison.
|
|
83
|
+
*/
|
|
84
|
+
export function isNonCleanAnalyzerCoverage(coverage) {
|
|
85
|
+
return !COVERAGE_IS_TRUSTWORTHY[coverage];
|
|
86
|
+
}
|
|
87
|
+
export const EXTERNAL_ANALYZER_STATUS_CLASSIFICATION = {
|
|
88
|
+
skipped: "not_run",
|
|
89
|
+
success: "clean",
|
|
90
|
+
findings: "findings",
|
|
91
|
+
not_resolved: "not_run",
|
|
92
|
+
spawn_error: "degraded",
|
|
93
|
+
parse_error: "degraded",
|
|
94
|
+
failed: "degraded",
|
|
95
|
+
checksum_mismatch: "degraded",
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* True when a RECORD means "this tool did not produce trustworthy coverage".
|
|
99
|
+
*
|
|
100
|
+
* The status member alone cannot answer this, because degradation is not always
|
|
101
|
+
* terminal: a run can exit non-zero, fail to parse, or drop rows and STILL surface
|
|
102
|
+
* some items, which lands it on `findings` — an affirmative member describing a
|
|
103
|
+
* partially-crashed run. Asking the member in isolation reports such a run as
|
|
104
|
+
* trustworthy, which is the same success-shaped-empty mistake one level up.
|
|
105
|
+
*
|
|
106
|
+
* So the question is asked of the whole record: degraded when the member says so, OR
|
|
107
|
+
* when the record carries a marker that findings were LOST —
|
|
108
|
+
* - a non-zero exit, or a NULL exit (killed by a signal, never exited on its own);
|
|
109
|
+
* - `dropped_rows` (parser rows plus normalizer items the run failed to report).
|
|
110
|
+
*
|
|
111
|
+
* `source_read_failures` is deliberately NOT in that set. Provenance is optional
|
|
112
|
+
* everywhere on this contract: an item whose anchor could not be resolved is still a
|
|
113
|
+
* fully reported lead, so an unresolved anchor is a weaker join key, not lost
|
|
114
|
+
* coverage. It stays on the record because it is worth surfacing; it just does not
|
|
115
|
+
* make the run untrustworthy.
|
|
116
|
+
*
|
|
117
|
+
* {@link EXTERNAL_ANALYZER_STATUS_CLASSIFICATION} remains the status-MEMBER map and
|
|
118
|
+
* the compile gate; this is the consumer-facing answer.
|
|
119
|
+
*/
|
|
120
|
+
export function isDegradedExternalAnalyzerStatus(record) {
|
|
121
|
+
const classification = EXTERNAL_ANALYZER_STATUS_CLASSIFICATION[record.status];
|
|
122
|
+
if (isNonCleanAnalyzerCoverage(classification))
|
|
123
|
+
return true;
|
|
124
|
+
if (record.exit_code === null)
|
|
125
|
+
return true;
|
|
126
|
+
if (typeof record.exit_code === "number" && record.exit_code !== 0)
|
|
127
|
+
return true;
|
|
128
|
+
if ((record.dropped_rows ?? 0) > 0)
|
|
129
|
+
return true;
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
48
132
|
export const ExternalAnalyzerToolStatusSchema = z
|
|
49
133
|
.object({
|
|
50
134
|
tool: z.string(),
|
|
51
135
|
command: z.string().optional(),
|
|
52
136
|
resolved: z.boolean(),
|
|
53
|
-
status: z.enum(
|
|
54
|
-
"skipped",
|
|
55
|
-
"success",
|
|
56
|
-
"findings",
|
|
57
|
-
"not_resolved",
|
|
58
|
-
"spawn_error",
|
|
59
|
-
"parse_error",
|
|
60
|
-
"failed",
|
|
61
|
-
]),
|
|
137
|
+
status: z.enum(EXTERNAL_ANALYZER_TOOL_STATUSES),
|
|
62
138
|
exit_code: z.number().nullable().optional(),
|
|
63
139
|
error: z.string().optional(),
|
|
64
140
|
output_snippet: z.string().optional(),
|
|
141
|
+
/**
|
|
142
|
+
* The tool's own stderr, bounded. Present whenever stderr carried text — it is
|
|
143
|
+
* the only post-run evidence of WHY a non-zero exit or a stderr-only run failed.
|
|
144
|
+
*/
|
|
145
|
+
stderr_snippet: z.string().optional(),
|
|
146
|
+
/**
|
|
147
|
+
* Everything this run failed to report, as ONE count: rows the parser understood
|
|
148
|
+
* the shape of but could not use (malformed CSV/JSON rows), PLUS items the
|
|
149
|
+
* normalizer discarded for a missing path or summary. The engine merges the two
|
|
150
|
+
* because they are the same question to a consumer — how much did this run lose?
|
|
151
|
+
* A non-zero count means the run under-reports; it is never a clean scan.
|
|
152
|
+
*/
|
|
153
|
+
dropped_rows: z.number().optional(),
|
|
154
|
+
/**
|
|
155
|
+
* Items that named a path + line but whose source could not be read, so their
|
|
156
|
+
* content-anchored provenance was dropped. Distinguishes a broken read seam from
|
|
157
|
+
* a tool that legitimately reports no line numbers.
|
|
158
|
+
*/
|
|
159
|
+
source_read_failures: z.number().optional(),
|
|
65
160
|
duration_ms: z.number().optional(),
|
|
66
161
|
})
|
|
67
162
|
.strict();
|
|
163
|
+
/** Normalize either parse-outcome form into the report form. */
|
|
164
|
+
export function readParseOutcome(outcome) {
|
|
165
|
+
if (Array.isArray(outcome))
|
|
166
|
+
return { items: outcome };
|
|
167
|
+
if (!outcome || typeof outcome !== "object" || !Array.isArray(outcome.items)) {
|
|
168
|
+
return {
|
|
169
|
+
items: [],
|
|
170
|
+
parse_failed: true,
|
|
171
|
+
note: "parser returned no usable outcome",
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
items: outcome.items,
|
|
176
|
+
...(outcome.parse_failed !== undefined ? { parse_failed: outcome.parse_failed } : {}),
|
|
177
|
+
...(outcome.dropped_rows !== undefined ? { dropped_rows: outcome.dropped_rows } : {}),
|
|
178
|
+
...(outcome.note !== undefined ? { note: outcome.note } : {}),
|
|
179
|
+
};
|
|
180
|
+
}
|
|
68
181
|
/** Imported analyzer output captured at a single generation time. */
|
|
69
182
|
export const ExternalAnalyzerResultsSchema = z
|
|
70
183
|
.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/shared/analyzers/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAE/D,sFAAsF;AACtF,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,iFAAiF;IACjF,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC3B,yEAAyE;IACzE,UAAU,EAAE,4BAA4B,CAAC,QAAQ,EAAE;CACpD,CAAC;KACD,MAAM,EAAE,CAAC;AAKZ;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC;KAC7C,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,UAAU,EAAE,CAAC,CAAC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C,QAA+C,EAC/C,QAAiC;IAEjC,MAAM,IAAI,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC9E,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -31,7 +31,18 @@ export declare const ClarificationAnswersSubmissionSchema: z.ZodObject<{
|
|
|
31
31
|
}[] | undefined;
|
|
32
32
|
}>;
|
|
33
33
|
export type ClarificationAnswersSubmission = z.infer<typeof ClarificationAnswersSubmissionSchema>;
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* A routed delta joined to its subsystem + (optional) goal node — the loop input.
|
|
36
|
+
*
|
|
37
|
+
* `node_id` is the delta's OWN node identity as Phase C stamped it, supplied by the
|
|
38
|
+
* caller that performed the join: `delta.delta_id` is an OPAQUE identity here and is
|
|
39
|
+
* never split to recover a node. Phase C mints it with a content-derived
|
|
40
|
+
* discriminator when one subsystem carries two deltas on the same channel pair, so
|
|
41
|
+
* its segment structure carries no recoverable node id — anything keyed on parsing
|
|
42
|
+
* it silently misjoins the delta to the wrong subsystem's `members`. Both joins this
|
|
43
|
+
* module performs (`members` here, and the goal graph via `goal_node_id`) stay keyed
|
|
44
|
+
* on that same node_id space.
|
|
45
|
+
*/
|
|
35
46
|
export interface ClarificationDeltaInput {
|
|
36
47
|
delta: CharterDelta;
|
|
37
48
|
node_id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charterClarification.d.ts","sourceRoot":"","sources":["../../../src/shared/decompose/charterClarification.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,2BAA2B,EAChC,KAAK,SAAS,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;EAatC,CAAC;AACZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"charterClarification.d.ts","sourceRoot":"","sources":["../../../src/shared/decompose/charterClarification.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,2BAA2B,EAChC,KAAK,SAAS,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;EAatC,CAAC;AACZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,oFAAoF;AACpF,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,KAAK,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,0BAA0B,EAAE,CAC1B,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,YAAY,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAC9E,SAAS,EAAE,SAAS,KACjB,2BAA2B,EAAE,CAAC;IACnC,aAAa,EAAE,CACb,QAAQ,EAAE,2BAA2B,EAAE,KACpC,2BAA2B,EAAE,CAAC;IACnC,gBAAgB,EAAE,CAChB,QAAQ,EAAE,2BAA2B,EAAE,EACvC,QAAQ,EAAE,sBAAsB,KAC7B;QAAE,KAAK,EAAE,2BAA2B,EAAE,CAAC;QAAC,MAAM,EAAE,2BAA2B,EAAE,CAAA;KAAE,CAAC;CACtF;AAED,iFAAiF;AACjF,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,2BAA2B,EAAE,CAAC;IACrC,MAAM,EAAE,2BAA2B,EAAE,CAAC;IACtC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,uBAAuB,EAAE,EACjC,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,sBAAsB,EACjC,IAAI,EAAE,qBAAqB,EAC3B,YAAY,GAAE,GAAG,CAAC,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAa,GAC3E,uBAAuB,CAkDzB"}
|
|
@@ -64,10 +64,17 @@ export function assembleClarificationRegister(deltas, goalGraph, attention, deps
|
|
|
64
64
|
})), goalGraph);
|
|
65
65
|
const gated = deps.applyRiskGate(questions);
|
|
66
66
|
const split = deps.splitByAttention(gated, attention);
|
|
67
|
-
// Carry any prior answers onto the re-derived questions
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
// the
|
|
67
|
+
// Carry any prior answers onto the re-derived questions, matched by `request_id`
|
|
68
|
+
// — an answered question keeps its `answer` across re-assembly, so a round never
|
|
69
|
+
// loses a decision already recorded. Applied to BOTH sides of the split: a
|
|
70
|
+
// question the attention dial moves from `asked` to `banked` (or back) between
|
|
71
|
+
// rounds must not drop its answer for having changed buckets.
|
|
72
|
+
//
|
|
73
|
+
// A user who taps out mid-loop leaves the rest unanswered. Nothing is synthesized
|
|
74
|
+
// here: the caller decides when a submission exists at all, and on that submission
|
|
75
|
+
// defaults every still-unanswered question it previously asked to `leave_open`
|
|
76
|
+
// (a first-class decision) so the queue drains and the loop terminates in one
|
|
77
|
+
// round-trip. Absent a submission the map is empty and every question stays open.
|
|
71
78
|
const applyAnswer = (r) => {
|
|
72
79
|
const answer = priorAnswers.get(r.request_id);
|
|
73
80
|
return answer ? { ...r, answer } : r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charterClarification.js","sourceRoot":"","sources":["../../../src/shared/decompose/charterClarification.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,EAAE;AACF,iFAAiF;AACjF,gFAAgF;AAChF,8EAA8E;AAC9E,qEAAqE;AACrE,gFAAgF;AAChF,kFAAkF;AAClF,mFAAmF;AACnF,mFAAmF;AACnF,iFAAiF;AACjF,4DAA4D;AAC5D,EAAE;AACF,mFAAmF;AACnF,6EAA6E;AAC7E,4DAA4D;AAE5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,gCAAgC,GAIjC,MAAM,qBAAqB,CAAC;AAG7B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC;KAClD,MAAM,CAAC;IACN,OAAO,EAAE,CAAC;SACP,KAAK,CACJ,CAAC;SACE,MAAM,CAAC;QACN,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,MAAM,EAAE,gCAAgC;KACzC,CAAC;SACD,MAAM,EAAE,CACZ;SACA,OAAO,CAAC,EAAE,CAAC;CACf,CAAC;KACD,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"charterClarification.js","sourceRoot":"","sources":["../../../src/shared/decompose/charterClarification.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,EAAE;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AE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAElD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC;AACxD,CAAC;AAED;;;;;GAKG;AACH,SAAS,iBAAiB,CACxB,OAAoC,EACpC,OAAiB;IAEjB,MAAM,QAAQ,GACZ,OAAO,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC;QAC7B,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC;YAC/B,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,KAAK,CAAC;IACd,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,UAAU;QACtB,KAAK,EAAE,4CAA4C,OAAO,CAAC,OAAO,EAAE;QACpE,QAAQ,EAAE,uBAAuB;QACjC,QAAQ;QACR,UAAU,EAAE,QAAQ;QACpB,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,OAAO,CAAC,QAAQ;QACzB,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QACjD,QAAQ,EAAE,IAAI;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -405,6 +405,25 @@ export interface AssembledCharters {
|
|
|
405
405
|
subsystems: CharterSubsystem[];
|
|
406
406
|
validation_issues: string[];
|
|
407
407
|
}
|
|
408
|
+
/**
|
|
409
|
+
* A CharterDelta with its subsystem identity carried as EXPLICIT fields
|
|
410
|
+
* (INV-CDI-EXPLICIT-NODE-FIELDS) — `delta_id` is therefore an OPAQUE identity,
|
|
411
|
+
* free to gain a per-delta discriminator (see `assembleDeltas` below) without
|
|
412
|
+
* any consumer, INCLUDING this module's own disagreement-density computation,
|
|
413
|
+
* needing to parse it apart. Declared here as an extension of `CharterDelta`
|
|
414
|
+
* rather than by widening `CharterDeltaSchema` itself
|
|
415
|
+
* (src/shared/types/charter.ts, outside this module's write scope) — this is
|
|
416
|
+
* the assembler's own return shape; the wire schema's `.strict()` boundary is
|
|
417
|
+
* a separate, differently-owned concern (the seam
|
|
418
|
+
* charter-clarification-ingestion--charter-delta-identity--node-id-recovery
|
|
419
|
+
* names charter-clarification-ingestion as the consumer that reads these
|
|
420
|
+
* fields once it stops parsing delta_id).
|
|
421
|
+
*/
|
|
422
|
+
export interface CharterDeltaWithIdentity extends CharterDelta {
|
|
423
|
+
node_id: string;
|
|
424
|
+
/** Present when `node_id` is linked into the mined goal graph. */
|
|
425
|
+
goal_node_id?: string;
|
|
426
|
+
}
|
|
408
427
|
/**
|
|
409
428
|
* The assembled delta layer (Phase C.2): the routed+gated deltas across all
|
|
410
429
|
* units, the deltas surfaced as Finding leads, the triangulated teloses, the
|
|
@@ -413,7 +432,7 @@ export interface AssembledCharters {
|
|
|
413
432
|
*/
|
|
414
433
|
export interface AssembledDeltas {
|
|
415
434
|
subsystems: CharterSubsystem[];
|
|
416
|
-
deltas:
|
|
435
|
+
deltas: CharterDeltaWithIdentity[];
|
|
417
436
|
findings: Finding[];
|
|
418
437
|
triangulated: TriangulatedTelos[];
|
|
419
438
|
disagreement: ChannelDisagreement[];
|
|
@@ -459,14 +478,5 @@ export interface AssembleDeltasParams {
|
|
|
459
478
|
*/
|
|
460
479
|
allowTrueNominations: boolean;
|
|
461
480
|
}
|
|
462
|
-
/**
|
|
463
|
-
* Assemble the routed+gated deltas, triangulated teloses, and disagreement
|
|
464
|
-
* density (Phase C.2) from the independent miner's submission, given the
|
|
465
|
-
* already-joined charters. The miner never picks routing — `kind`/`routed_to`
|
|
466
|
-
* derive from the channel pair (the design's fixed table). A delta whose
|
|
467
|
-
* `node_id` has no joined charters, or that references a missing/dropped
|
|
468
|
-
* charter kind, is dropped with an issue; so is a triangulated telos or True
|
|
469
|
-
* nomination naming an unknown unit.
|
|
470
|
-
*/
|
|
471
481
|
export declare function assembleDeltas(submission: CharterDeltaSubmission, subsystems: CharterSubsystem[], params: AssembleDeltasParams): AssembledDeltas;
|
|
472
482
|
//# sourceMappingURL=charterExtraction.d.ts.map
|