Skip to content

perf(registry): compile component parameter schemas - #1557

Merged
ricardo-devis-agullo merged 2 commits into
masterfrom
advisor/007-compiled-parameter-schema
Aug 24, 2026
Merged

perf(registry): compile component parameter schemas#1557
ricardo-devis-agullo merged 2 commits into
masterfrom
advisor/007-compiled-parameter-schema

Conversation

@ricardo-devis-agullo

Copy link
Copy Markdown
Collaborator

Implements plan 007.

  • Compile immutable parameter metadata (defaults, mandatory, types, enums) once per component.oc.parameters identity via WeakMap (empty schema uses shared singleton).
  • Fuse request-time defaulting + sanitization + validation into single scan with lazy error allocation and no array callback chains.
  • Empty-schema fast lane preserves undeclared params, drops __ocAcceptLanguage, bypasses validation machinery.
  • Preserves defaults/mutation, coercion, enum, reserved-param and error-ordering semantics; verified by table-driven parity vs original three-stage pipeline.
  • Hot-reload creates new identity → recompiles; WeakMap preserves Plan 005 cache bound.
  • Adds characterization + instrumentation tests for defaults, coercion, mandatory/type/enum errors, reserved params, identity/mutation, compilation caching (same identity once, different identities independently, hot-reload, no request retain, fresh output/error objects).

Test: npm --workspace packages/oc run build and npm --workspace packages/oc run test-silent (1091 passing).

Plan: plans/007-compiled-parameter-schema.md
Depends on: #1556 (006 synchronous render lane)

ricardo-devis-agullo and others added 2 commits August 23, 2026 18:38
Compile immutable component-version parameter metadata once per
schema identity and fuse request-time defaulting, sanitization and
validation into a single scan with an empty-schema fast lane.
Cache compiled schemas in a WeakMap keyed by component.oc.parameters
identity so hot reload (new manifest object) recompiles naturally and
evicted manifests do not stay alive, preserving the Plan 005 cache
bound. Preserve defaults/mutation, coercion, enum, reserved-param
removal and error ordering semantics with table-driven and identity
characterization tests.
Keep sanitization case-sensitive while retaining normalized validation,
reject malformed descriptors instead of forwarding them, and preserve
array-shaped request handling from the original pipeline.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@ricardo-devis-agullo
ricardo-devis-agullo merged commit 2928e81 into master Aug 24, 2026
3 checks passed
@ricardo-devis-agullo
ricardo-devis-agullo deleted the advisor/007-compiled-parameter-schema branch August 24, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant