mirror of
https://github.com/morluto/rea.git
synced 2026-11-19 05:02:40 +00:00
refactor(domain): name known coverage once and derive local coverage enums from it (#11428)
* refactor(domain): name known coverage once and derive six native coverage enums from it knownCoverageStatusSchema in src/domain/coverage.ts replaces the four per-domain coverageStatusSchema.exclude(["unknown"]) copies (Android, Flutter, GPU, model) and six plain ["complete", "partial"] enums in native reports (Apple IPS, PE certificates and imports, Windows shortcuts, native call observation, NativeAOT metadata recovery). Advertised schemas are unchanged. local-completeness-enum: 91 -> 85. * refactor(domain): use the shared known coverage schema for ADB device analysis * refactor(domain): derive pcap, firmware, Apktool, JEB and WASM interface coverage from known coverage (#11430) Each producer decides coverage from what it examined (dissected-field gaps, unpublished firmware entries, string-table facts, a short JEB unit page, a WABT budget stop), so none reports unknown. Advertised schemas are unchanged. local-completeness-enum: 85 -> 79. * refactor(domain): derive eleven checked coverage enums from known coverage (#11438) * refactor(domain): derive eleven checked coverage enums from known coverage * refactor(domain): derive coverage-plus-outcome enums from the coverage owner (#11440)
This commit is contained in:
1 parent
47c252f527
commit
62d6cfac92
45 files changed
+158
-141
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { z } from "zod";
|
||||
import { knownCoverageStatusSchema } from "../coverage.js";
|
||||
|
||||
import { javascriptSourceRangeSchema } from "./javascriptSourceCoordinates.js";
|
||||
|
||||
@@ -266,7 +267,7 @@ export const javaScriptExportShapeComparisonChangeSchema = z.strictObject({
|
||||
|
||||
const inventoryPropertyCoverageSchema = z.strictObject({
|
||||
path: jsonPointerSchema,
|
||||
status: z.enum(["complete", "partial"]),
|
||||
status: knownCoverageStatusSchema,
|
||||
});
|
||||
|
||||
const propertyInventorySchema = z.strictObject({
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { z } from "zod";
|
||||
import { coverageStatusSchema } from "../coverage.js";
|
||||
|
||||
import { evidenceSchema, providerSchema } from "../evidence.js";
|
||||
import { javascriptApplicationGraphSchema } from "./javascriptApplicationGraph.js";
|
||||
@@ -170,12 +171,7 @@ export const applicationFeatureTraceResultSchema = z.strictObject({
|
||||
semantic_discovery: z
|
||||
.strictObject({
|
||||
source_graph_id: prefixedDigestSchema("jsrg"),
|
||||
source_coverage: z.enum([
|
||||
"complete",
|
||||
"partial",
|
||||
"unknown",
|
||||
"unavailable",
|
||||
]),
|
||||
source_coverage: z.enum([...coverageStatusSchema.options, "unavailable"]),
|
||||
total: z.int().nonnegative(),
|
||||
offset: z.int().nonnegative(),
|
||||
limit: z.int().positive(),
|
||||
@@ -212,9 +208,7 @@ export const applicationFeatureTraceResultSchema = z.strictObject({
|
||||
coverage: z.strictObject({
|
||||
status: z.enum(["complete-within-source", "partial", "no-match"]),
|
||||
source_graph_status: z.enum([
|
||||
"complete",
|
||||
"partial",
|
||||
"unknown",
|
||||
...coverageStatusSchema.options,
|
||||
"unavailable",
|
||||
]),
|
||||
total_seed_matches: z.int().min(0),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { z } from "zod";
|
||||
import { knownCoverageStatusSchema } from "../coverage.js";
|
||||
import { digestSchema } from "../digests.js";
|
||||
import { analyzeJavaScriptApplicationInputSchema } from "./javascriptApplicationAnalysis.js";
|
||||
import { absoluteLocalPathStringSchema } from "../localPath.js";
|
||||
@@ -65,7 +66,7 @@ export const javascriptRecoveryResultSchema = z.strictObject({
|
||||
rewrite_level:
|
||||
javascriptRecoveryInputSchema.shape.rewrite_level.removeDefault(),
|
||||
}),
|
||||
status: z.enum(["complete", "partial"]),
|
||||
status: knownCoverageStatusSchema,
|
||||
detected_formats: z.array(z.string()),
|
||||
reported_safety: z.string(),
|
||||
reported_strategy: z.string(),
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { coverageStatusSchema } from "../coverage.js";
|
||||
import {
|
||||
coverageStatusSchema,
|
||||
knownCoverageStatusSchema,
|
||||
} from "../coverage.js";
|
||||
import { javascriptSourceRangeSchema } from "./javascriptSourceCoordinates.js";
|
||||
import { digestCanonicalValue } from "../canonicalDigest.js";
|
||||
import { z } from "zod";
|
||||
@@ -104,7 +107,7 @@ const inventoryShape = z.strictObject({
|
||||
coverage: z.strictObject({
|
||||
scope: z.literal("provided-code-sources"),
|
||||
source_parsing: coverageStatusSchema,
|
||||
candidate_enumeration: z.enum(["complete", "partial"]),
|
||||
candidate_enumeration: knownCoverageStatusSchema,
|
||||
application_routes: z.literal("unknown"),
|
||||
}),
|
||||
statistics: z.strictObject({
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { z } from "zod";
|
||||
import {
|
||||
coverageStatusSchema,
|
||||
knownCoverageStatusSchema,
|
||||
} from "../coverage.js";
|
||||
|
||||
import { javascriptSourceRangeSchema } from "./javascriptSourceCoordinates.js";
|
||||
|
||||
@@ -313,7 +317,7 @@ const fingerprintComponentsSchema = z.strictObject({
|
||||
export const javaScriptSemanticFingerprintInputSchema = z.strictObject({
|
||||
function_node_id: semanticNodeIdSchema,
|
||||
algorithm: z.literal("rea.javascript-semantic-function"),
|
||||
status: z.enum(["complete", "partial", "unavailable"]),
|
||||
status: z.enum([...knownCoverageStatusSchema.options, "unavailable"]),
|
||||
components: fingerprintComponentsSchema,
|
||||
limitations: z.array(nonEmptyTextSchema),
|
||||
evidence: applicationGraphEvidenceSchema,
|
||||
@@ -329,14 +333,14 @@ export const javaScriptSemanticFingerprintSchema =
|
||||
|
||||
const familyCoverageSchema = z.strictObject({
|
||||
family: z.enum(JAVASCRIPT_SEMANTIC_RELATION_FAMILIES),
|
||||
status: z.enum(["complete", "partial", "unknown", "unsupported"]),
|
||||
status: z.enum([...coverageStatusSchema.options, "unsupported"]),
|
||||
retained_relations: z.int().min(0),
|
||||
omitted_relations: z.int().min(0).nullable(),
|
||||
unknown_ids: z.array(semanticUnknownIdSchema),
|
||||
});
|
||||
|
||||
const graphCoverageSchema = z.strictObject({
|
||||
status: z.enum(["complete", "partial", "unknown", "unavailable"]),
|
||||
status: z.enum([...coverageStatusSchema.options, "unavailable"]),
|
||||
truncated: z.boolean(),
|
||||
omitted_unknown_occurrences:
|
||||
javaScriptSemanticUnknownOmissionsSchema.exactOptional(),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { z } from "zod";
|
||||
import { knownCoverageStatusSchema } from "../coverage.js";
|
||||
|
||||
import {
|
||||
JAVASCRIPT_SEMANTIC_NODE_KINDS,
|
||||
@@ -103,7 +104,7 @@ export const javaScriptSemanticQueryResultSchema = z.strictObject({
|
||||
relevant_unknowns: z.int().min(0),
|
||||
}),
|
||||
coverage: z.strictObject({
|
||||
status: z.enum(["complete", "partial", "unavailable"]),
|
||||
status: z.enum([...knownCoverageStatusSchema.options, "unavailable"]),
|
||||
}),
|
||||
limitations: z.array(z.string().min(1)),
|
||||
});
|
||||
|
||||
@@ -115,9 +115,7 @@ export const sourceToBundleComparisonResultSchema = z.strictObject({
|
||||
),
|
||||
reference_inventory_state: coverageStatusSchema,
|
||||
application_graph_status: z.enum([
|
||||
"complete",
|
||||
"partial",
|
||||
"unknown",
|
||||
...coverageStatusSchema.options,
|
||||
"unavailable",
|
||||
]),
|
||||
retained_source_files: z.int().min(0),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { z } from "zod";
|
||||
import { coverageStatusSchema } from "../coverage.js";
|
||||
import { digestSchema, prefixedDigestSchema } from "../digests.js";
|
||||
import { ROUTE_RULES } from "../analysisView/webNetworkRouteTemplates.js";
|
||||
|
||||
@@ -80,7 +81,7 @@ export const staticObservedEndpointComparisonSchema = z.strictObject({
|
||||
}),
|
||||
source_coverage: z.strictObject({
|
||||
application: z.strictObject({
|
||||
status: z.enum(["complete", "partial", "unknown", "unavailable"]),
|
||||
status: z.enum([...coverageStatusSchema.options, "unavailable"]),
|
||||
truncated: z.boolean(),
|
||||
omitted_count: z.int().nonnegative().nullable(),
|
||||
limit_count: z.int().nonnegative(),
|
||||
|
||||
Reference in new issue
Block a user