mirror of
https://github.com/morluto/rea
synced 2026-10-27 06:33:32 -04:00
perf(schema): reduce retained integer validator allocations (#4360)
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.
This commit is contained in:
@@ -106,7 +106,7 @@ const projectedPropertyCoverageSchema = z.discriminatedUnion("status", [
|
||||
z.strictObject({
|
||||
path: jsonPointerSchema,
|
||||
status: z.literal("partial"),
|
||||
omitted: z.union([z.number().int().positive(), z.null()]),
|
||||
omitted: z.union([z.int().positive(), z.null()]),
|
||||
}),
|
||||
]);
|
||||
export type ProjectedPropertyCoverage = z.infer<
|
||||
@@ -156,10 +156,10 @@ export const projectedExportReturnShapesSchema = z
|
||||
static_return_shapes: z.array(projectedReturnShapeSchema),
|
||||
return_shape_coverage: z.strictObject({
|
||||
status: z.enum(["complete", "partial", "truncated"]),
|
||||
retained_return_sites: z.number().int().min(0),
|
||||
omitted_return_sites: z.number().int().min(0).nullable(),
|
||||
omitted_fields: z.number().int().min(0),
|
||||
omitted_property_coverage: z.number().int().min(0),
|
||||
retained_return_sites: z.int().min(0),
|
||||
omitted_return_sites: z.int().min(0).nullable(),
|
||||
omitted_fields: z.int().min(0),
|
||||
omitted_property_coverage: z.int().min(0),
|
||||
projection_complete: z.boolean(),
|
||||
}),
|
||||
})
|
||||
@@ -189,7 +189,7 @@ const selectorResultShape = {
|
||||
requested_module_path: textSchema,
|
||||
requested_export_name: exportNameSchema,
|
||||
candidates: z.array(exportCandidateSchema),
|
||||
omitted_candidates: z.number().int().min(0),
|
||||
omitted_candidates: z.int().min(0),
|
||||
};
|
||||
const selectorResultSchema = z.union([
|
||||
z.strictObject({
|
||||
@@ -261,7 +261,7 @@ const inventoryPropertyCoverageSchema = z.strictObject({
|
||||
|
||||
const propertyInventorySchema = z.strictObject({
|
||||
side: z.enum(["left", "right"]),
|
||||
variant_index: z.number().int().nonnegative(),
|
||||
variant_index: z.int().nonnegative(),
|
||||
discriminant: discriminantSchema.nullable(),
|
||||
paired: z.boolean(),
|
||||
source_range: javascriptSourceRangeSchema,
|
||||
@@ -276,10 +276,10 @@ export const javaScriptExportShapeComparisonResultSchema = z.strictObject({
|
||||
right: selectorResultSchema,
|
||||
property_inventories: z.array(propertyInventorySchema),
|
||||
summary: z.strictObject({
|
||||
added: z.number().int().min(0),
|
||||
removed: z.number().int().min(0),
|
||||
changed: z.number().int().min(0),
|
||||
unknown: z.number().int().min(0),
|
||||
added: z.int().min(0),
|
||||
removed: z.int().min(0),
|
||||
changed: z.int().min(0),
|
||||
unknown: z.int().min(0),
|
||||
}),
|
||||
changes: z.array(javaScriptExportShapeComparisonChangeSchema),
|
||||
coverage: z.strictObject({
|
||||
@@ -296,19 +296,19 @@ export const javaScriptExportShapeComparisonResultSchema = z.strictObject({
|
||||
"unknown",
|
||||
"unavailable",
|
||||
]),
|
||||
paired_variants: z.number().int().min(0),
|
||||
unpaired_left_variants: z.number().int().min(0),
|
||||
unpaired_right_variants: z.number().int().min(0),
|
||||
omitted_left_variants: z.number().int().min(0),
|
||||
omitted_right_variants: z.number().int().min(0),
|
||||
left_source_omitted_variants: z.number().int().min(0).nullable(),
|
||||
right_source_omitted_variants: z.number().int().min(0).nullable(),
|
||||
left_omitted_fields: z.number().int().min(0),
|
||||
right_omitted_fields: z.number().int().min(0),
|
||||
left_omitted_property_coverage: z.number().int().min(0),
|
||||
right_omitted_property_coverage: z.number().int().min(0),
|
||||
omitted_candidates: z.number().int().min(0),
|
||||
omitted_changes: z.number().int().min(0),
|
||||
paired_variants: z.int().min(0),
|
||||
unpaired_left_variants: z.int().min(0),
|
||||
unpaired_right_variants: z.int().min(0),
|
||||
omitted_left_variants: z.int().min(0),
|
||||
omitted_right_variants: z.int().min(0),
|
||||
left_source_omitted_variants: z.int().min(0).nullable(),
|
||||
right_source_omitted_variants: z.int().min(0).nullable(),
|
||||
left_omitted_fields: z.int().min(0),
|
||||
right_omitted_fields: z.int().min(0),
|
||||
left_omitted_property_coverage: z.int().min(0),
|
||||
right_omitted_property_coverage: z.int().min(0),
|
||||
omitted_candidates: z.int().min(0),
|
||||
omitted_changes: z.int().min(0),
|
||||
}),
|
||||
evidence_links: z.array(evidenceIdSchema).length(2),
|
||||
limitations: z.array(textSchema),
|
||||
|
||||
Reference in New Issue
Block a user