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

@@ -24,14 +24,14 @@ export const javaScriptCheckpointCeilingRemediation = (
/** Caller-selected artifact identity, separate from the decoded source-text digest. */
export const javaScriptWorkerRequestSchema = z.strictObject({
id: z.uuid(),
unknown_budget: z.number().int().min(0).max(JAVASCRIPT_SEMANTIC_ITEM_MAXIMUM),
node_budget: z.number().int().min(0).max(JAVASCRIPT_SEMANTIC_ITEM_MAXIMUM),
unknown_budget: z.int().min(0).max(JAVASCRIPT_SEMANTIC_ITEM_MAXIMUM),
node_budget: z.int().min(0).max(JAVASCRIPT_SEMANTIC_ITEM_MAXIMUM),
text_sha256: digestSchema,
file: z.strictObject({
path: z.string(),
sha256: digestSchema,
container_sha256: digestSchema,
bytes: z.number().int().nonnegative(),
bytes: z.int().nonnegative(),
inventory_artifact_id: z.string(),
kind: z.literal("javascript"),
unpacked: z.boolean(),
@@ -41,7 +41,7 @@ export const javaScriptWorkerRequestSchema = z.strictObject({
/** Parent admission after validated static observations have been retained. */
export const javaScriptWorkerAdmissionSchema = z.strictObject({
id: z.uuid(),
semantic_result_budget_bytes: z.number().int().nonnegative(),
semantic_result_budget_bytes: z.int().nonnegative(),
});
const identity = { id: z.uuid() };
@@ -51,7 +51,7 @@ export const javaScriptWorkerMessageSchema = z.discriminatedUnion("kind", [
z.strictObject({
kind: z.literal("ready"),
// Null when the worker runtime (Bun) does not enforce V8 heap flags.
heap_limit_bytes: z.number().int().positive().nullable(),
heap_limit_bytes: z.int().positive().nullable(),
}),
z.strictObject({
kind: z.literal("phase"),
@@ -61,7 +61,7 @@ export const javaScriptWorkerMessageSchema = z.discriminatedUnion("kind", [
z.strictObject({
kind: z.literal("static"),
...identity,
bytes: z.number().int().nonnegative(),
bytes: z.int().nonnegative(),
sha256: digestSchema,
}),
z.strictObject({