mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 22:36:08 +00:00
Construct integer formats directly while preserving bounds, refinements, metadata and current shared schema owners. Keep Incur-dependent CLI numeric coercion declarations unchanged. Verify canonical advertisements, 126 numeric boundary cases, 974 actual CLI parser cases, broad source tests and real public-artifact SDK workflows. Record 72 normal tasks and 12 separate owned-inspector heap diagnostics with whole-family resource bounds; distinguish SDK spans and asymmetric audit overhead. Generate numerical report sections from receipts and reject stale tables through documentation conformance checks. Closes #6236. Current-head CI and Greptile pass; actionable review findings are addressed. Codex review was unavailable due repository usage limits.
40 lines
1.7 KiB
TypeScript
40 lines
1.7 KiB
TypeScript
import { z } from "zod";
|
|
import { applicationCoverageSchema } from "../javascript/javascriptApplicationEvidenceSchemas.js";
|
|
import type { JavaScriptApplicationAnalysisResult } from "../javascript/javascriptApplicationAnalysis.js";
|
|
import { javaScriptSemanticGraphInputSchema } from "../javascript/javascriptSemanticGraphSchemas.js";
|
|
import { javaScriptSourceSelectionSchema } from "../javascript/javascriptSourceSelection.js";
|
|
|
|
/** Source completeness is independent of exhausting a selected fact page. */
|
|
export const javascriptApplicationSourceCoverageSchema = z.strictObject({
|
|
source_selection: javaScriptSourceSelectionSchema.exactOptional(),
|
|
application: applicationCoverageSchema,
|
|
semantic: javaScriptSemanticGraphInputSchema.shape.coverage.omit({
|
|
families: true,
|
|
}),
|
|
application_unknown_count: z.int().nonnegative(),
|
|
semantic_unknown_count: z.int().nonnegative(),
|
|
});
|
|
|
|
export type JavaScriptApplicationSourceCoverage = z.infer<
|
|
typeof javascriptApplicationSourceCoverageSchema
|
|
>;
|
|
|
|
/** Reuse retained coverage and count its unknowns once for every view. */
|
|
export const javascriptApplicationSourceCoverage = (
|
|
analysis: JavaScriptApplicationAnalysisResult,
|
|
): JavaScriptApplicationSourceCoverage => {
|
|
const { families: _families, ...semantic } = analysis.semantic_graph.coverage;
|
|
return {
|
|
...(analysis.source_selection === undefined
|
|
? {}
|
|
: { source_selection: analysis.source_selection }),
|
|
application: analysis.graph.coverage,
|
|
semantic,
|
|
application_unknown_count: analysis.graph.nodes.reduce(
|
|
(count, node) => count + Number(node.kind === "unknown"),
|
|
0,
|
|
),
|
|
semantic_unknown_count: analysis.semantic_graph.unknowns.length,
|
|
};
|
|
};
|