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:
郭立 Guo Li
2026-10-22 13:11:08 +08:00
committed by GitHub
parent bd5d189a8f
commit 7590b50801
182 changed files with 9562 additions and 1329 deletions
@@ -257,7 +257,7 @@ export const JAVASCRIPT_SEMANTIC_UNKNOWN_REASONS = [
export const javaScriptSemanticUnknownOmissionSchema = z.strictObject({
family: z.enum(JAVASCRIPT_SEMANTIC_RELATION_FAMILIES),
reason: z.enum(JAVASCRIPT_SEMANTIC_UNKNOWN_REASONS),
occurrences: z.number().int().positive(),
occurrences: z.int().positive(),
});
/** At most one summary row for each finite family/reason pair. */
export const javaScriptSemanticUnknownOmissionsSchema = z
@@ -290,7 +290,7 @@ export const javaScriptSemanticUnknownSchema =
});
const fingerprintComponentsSchema = z.strictObject({
parameter_arity: z.number().int().min(0),
parameter_arity: z.int().min(0),
normalized_ast_sha256: digestSchema,
control_flow_sha256: digestSchema,
relation_shape_sha256: digestSchema,
@@ -329,8 +329,8 @@ export const javaScriptSemanticFingerprintSchema =
const familyCoverageSchema = z.strictObject({
family: z.enum(JAVASCRIPT_SEMANTIC_RELATION_FAMILIES),
status: z.enum(["complete", "partial", "unknown", "unsupported"]),
retained_relations: z.number().int().min(0),
omitted_relations: z.number().int().min(0).nullable(),
retained_relations: z.int().min(0),
omitted_relations: z.int().min(0).nullable(),
unknown_ids: z.array(semanticUnknownIdSchema),
});
@@ -339,12 +339,12 @@ const graphCoverageSchema = z.strictObject({
truncated: z.boolean(),
omitted_unknown_occurrences:
javaScriptSemanticUnknownOmissionsSchema.exactOptional(),
omitted_nodes: z.number().int().min(0).nullable(),
omitted_relations: z.number().int().min(0).nullable(),
omitted_nodes: z.int().min(0).nullable(),
omitted_relations: z.int().min(0).nullable(),
limits: z.array(
z.strictObject({
name: z.string().min(1),
value: z.number().int().min(0),
value: z.int().min(0),
unit: z.enum(["items", "bytes", "milliseconds", "depth", "other"]),
}),
),