Skip to content

perf(registry): cache resolved component info - #1553

Merged
ricardo-devis-agullo merged 1 commit into
masterfrom
advisor/005-component-manifest-cache
Aug 18, 2026
Merged

perf(registry): cache resolved component info#1553
ricardo-devis-agullo merged 1 commit into
masterfrom
advisor/005-component-manifest-cache

Conversation

@ricardo-devis-agullo

@ricardo-devis-agullo ricardo-devis-agullo commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • cache resolved component info from each version's package.json in a repository-scoped 1000-entry LRU with per-key single-flight loading
  • recursively freeze cached component info and remove route/repository mutations while keeping allVersions request-current
  • cache local version metadata outside hot reload and invalidate exact component-info keys safely after successful publication
  • add deterministic mutation, LRU, retry, repository-isolation, and publish-race coverage
  • update burst assertions and mark Plan 005 complete

Verification

  • npm --workspace packages/oc run build
  • npx mocha "test/unit/**/*.js" --reporter dot --timeout 20000 (936 passing)
  • npm --workspace packages/oc run bench:burst (one package.json, env, provider, and template read for N=50 and N=200)
  • storage-simulated benchmark: package reads 1,0,0, 100% success, RPS +172%, p95 -62% against the same-machine baseline
  • batch-storage benchmark: package reads 0,0,0, 100% success, RPS +282%, p95 -73% against the same-machine baseline

The full test-silent command reached 939 passing tests, but six integration lifecycle hooks could not bind ports 3030/3031 because a pre-existing oc dev process from another workspace owns those ports. All unit tests pass independently.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Caches immutable component manifests to reduce registry storage reads while preserving request-specific metadata and publication consistency.

Changes:

  • Adds repository-scoped LRU caching, single-flight loading, freezing, and invalidation.
  • Removes route-level manifest mutation and strengthens burst assertions.
  • Adds comprehensive cache, race, isolation, and mutation tests.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
plans/README.md Marks Plan 005 complete.
packages/oc/src/registry/domain/repository.ts Implements manifest and local-version caching.
packages/oc/src/registry/routes/index.ts Avoids mutating manifests during view mapping.
packages/oc/src/registry/routes/component-info.ts Builds JSON responses immutably.
packages/oc/src/registry/routes/component-preview.ts Builds preview responses immutably.
packages/oc/tasks/benchmarks/single-flight-burst.js Requires exactly one manifest read per burst.
packages/oc/test/unit/registry-domain-repository-manifest-cache.js Covers cache and publication behavior.
packages/oc/test/unit/registry-routes-manifest-mutation.js Verifies frozen manifests work across routes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ricardo-devis-agullo
ricardo-devis-agullo force-pushed the advisor/005-component-manifest-cache branch from 329aa57 to f40fd59 Compare August 18, 2026 14:35
@ricardo-devis-agullo ricardo-devis-agullo changed the title perf(registry): cache immutable component manifests perf(registry): cache resolved component info Aug 18, 2026
@ricardo-devis-agullo
ricardo-devis-agullo merged commit b4737fa into master Aug 18, 2026
3 checks passed
@ricardo-devis-agullo
ricardo-devis-agullo deleted the advisor/005-component-manifest-cache branch August 18, 2026 15:12
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.

2 participants