Skip to content

perf(registry): scope and bound render artifact caching - #1552

Merged
ricardo-devis-agullo merged 2 commits into
masterfrom
advisor/004-registry-artifact-cache
Aug 17, 2026
Merged

perf(registry): scope and bound render artifact caching#1552
ricardo-devis-agullo merged 2 commits into
masterfrom
advisor/004-registry-artifact-cache

Conversation

@ricardo-devis-agullo

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

Copy link
Copy Markdown
Collaborator

Summary

  • replace the process-wide nice-cache artifact store with a registry-scoped, 1000-entry namespaced wrapper around the battle-tested lru-cache@10.4.3
  • share one render helper across GET and batch routes while preserving single-flight, hot reload, and env caching behavior
  • add focused coverage for LRU semantics, registry isolation, retry after rejected loads, and mixed-route cold-load coalescing

Test plan

  • Mend transitive dependency scan for lru-cache@10.4.3 (no vulnerabilities)
  • npm --workspace packages/oc run build
  • npm --workspace packages/oc run test-silent (1016 passing)
  • npm --workspace packages/oc run bench:burst
  • npm --workspace packages/oc run bench:quick -- --baseline-file=/tmp/oc-plan004-before.json --max-rps-regression-percent=5 --max-p95-regression-percent=5 --expect-success-rate=1

Generated with Devin

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

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

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

Replaces global artifact caching with bounded, registry-scoped caching while sharing render state across GET and batch routes.

Changes:

  • Adds a 1000-entry namespaced LRU cache.
  • Shares one render helper per registry.
  • Adds cache isolation, eviction, retry, and coalescing tests.

Reviewed changes

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

Show a summary per file
File Description
plans/README.md Marks Plan 004 complete.
packages/oc/test/unit/utils-bounded-cache.js Tests LRU behavior.
packages/oc/test/unit/registry-routes-helpers-get-component-artifact-cache.js Tests isolation and reload behavior.
packages/oc/test/unit/registry-router-artifact-cache.js Tests cross-route coalescing.
packages/oc/src/utils/bounded-cache.ts Implements the bounded cache.
packages/oc/src/registry/routes/helpers/get-component.ts Adopts registry-scoped caching.
packages/oc/src/registry/routes/components.ts Accepts an injected renderer.
packages/oc/src/registry/routes/component.ts Accepts an injected renderer.
packages/oc/src/registry/router.ts Shares one renderer between routes.
packages/oc/src/globals.d.ts Removes obsolete cache declarations.
packages/oc/package.json Removes the direct dependency.
package-lock.json Updates dependency metadata.

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

Use the established implementation instead of maintaining custom LRU
invariants while preserving the registry-scoped namespaced API.

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 db98b5c into master Aug 17, 2026
6 checks passed
@ricardo-devis-agullo
ricardo-devis-agullo deleted the advisor/004-registry-artifact-cache branch August 17, 2026 18:08
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