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 authored and GitHub committed 2026-10-22 05:11:08 +00:00
1 parent bd5d189a8f
commit 7590b50801
182 files changed
+9562 -1329

No files matched your search

@@ -96,8 +96,8 @@ const sourceRangeSchema = javascriptSourceRangeSchema.safeExtend({
const fileOffsetRangeSchema = z
.strictObject({
kind: z.literal("file-offset-range"),
start: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
end: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
start: z.int().min(0).max(Number.MAX_SAFE_INTEGER),
end: z.int().min(0).max(Number.MAX_SAFE_INTEGER),
})
.superRefine((location, context) => {
if (location.end < location.start)
@@ -158,7 +158,7 @@ const applicationExtractorSchema = z.strictObject({
const applicationLimitSchema = z.strictObject({
name: z.string().min(1),
value: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
value: z.int().min(0).max(Number.MAX_SAFE_INTEGER),
unit: z.enum([
"items",
"bytes",
@@ -172,7 +172,7 @@ const applicationLimitSchema = z.strictObject({
/** Bounded collection coverage without treating omission as absence. */
const coverageLimitsSchema = z.array(applicationLimitSchema);
const omittedCountSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
const omittedCountSchema = z.int().min(0).max(Number.MAX_SAFE_INTEGER);
export const applicationCoverageSchema = z.union([
z.strictObject({