Skip to content

Add managed CacheSet lifecycle#64

Merged
flyingrobots merged 11 commits into
mainfrom
feat/cache-set-lifecycle
Jul 13, 2026
Merged

Add managed CacheSet lifecycle#64
flyingrobots merged 11 commits into
mainfrom
feat/cache-set-lifecycle

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

  • add a RootSet-backed CacheSet API for open/get/put/replace/remove/touch/sweep lifecycle management
  • enforce TTL, maxEntries, maxBytes, approximate-LRU, and pinned-entry policy without materializing target graphs during index scans
  • return immutable cache hits and retention witnesses, with bounded inspect plus deep doctor/repair support
  • harden retry, guarded rejection, malformed-index, Unicode-key, and concurrent-writer behavior
  • make structured bundle member iteration incremental and add shallow reference primitives used by managed caches

Linked Issue

Design / Proof

  • Design doc: docs/design/0047-application-storage-cache-boundary/application-storage-cache-boundary.md
  • Witness: docs/design/0047-application-storage-cache-boundary/witness/cache-set.md

The witness includes source-pinned evidence for the public surface, lifecycle ordering, streaming bounds, retention behavior, concurrency, doctor/repair, self-review findings, CI root cause, and CodeRabbit follow-up.

The real-Git integration proof covers pre-anchor prunability, post-publish reachability, parentless RootSet generations, removal and eviction collectibility, pin survival, concurrent insertion, and single-winner guarded replacement.

Validation

  • pnpm lint
  • pnpm test (1,829 passed; 2 skipped)
  • GIT_STUNTS_DOCKER=1 pnpm test:integration (170 passed)
  • rebuilt Bun CI image integration suite (170 passed)
  • declaration compile with TypeScript NodeNext
  • git diff --check
  • 58 source citations mechanically verified
  • Graft structural review: no breaking changes
  • Graft export review: additive minor; no changed or removed root exports

Release Impact

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This change adds RootSet-backed managed cache sets, streaming bundle member iteration with logical-byte accounting, generation-aware root mutations, structured Git object metadata reads, public type and facade wiring, documentation, and lifecycle, concurrency, repair, and reachability tests.

Changes

Managed cache contracts and bundle inventory

Layer / File(s) Summary
Cache value objects and public API
src/domain/value-objects/*, index.d.ts
Adds validated cache keys, namespaces, refs, policies, hits, cache lifecycle types, and cache capabilities.
Streaming bundle traversal and accounting
src/domain/services/BundleService.js, test/unit/domain/services/BundleService.test.js
Adds references-only bundle construction and streaming member iteration with deterministic transitive logical-byte accounting.
Canonical cache metadata and indexed retention
src/domain/services/CacheMetadataCodec.js, src/domain/services/CacheIndex.js, src/domain/services/CacheCandidateHeap.js, src/domain/services/CachePolicyEnforcer.js
Adds canonical metadata validation, structured index reads and rewrites, bounded candidate selection, and expiry/capacity enforcement.

Cache lifecycle and publication

Layer / File(s) Summary
CacheSet lifecycle operations
src/domain/services/CacheSet.js
Adds cache get, put, replace, remove, sweep, touch, inspect, doctor, and repair operations with immutable results and retention evidence.
Registry and RootSet integration
src/domain/services/CacheSetRegistry.js, src/domain/services/RootSet.js, src/domain/services/RootSetMetadataCodec.js, src/domain/services/RootSetPersistence.js
Wires managed cache refs into RootSet persistence and passes observed generation state to mutation callbacks.
Facade exposure and lifecycle validation
index.js, test/unit/domain/services/CacheSet.test.js, test/integration/cache-set.test.js
Exposes caches.open() and validates retention, concurrency, eviction, repair, Git reachability, and generation behavior.

Git metadata inspection and supporting documentation

Layer / File(s) Summary
Structured Git object metadata reads
src/infrastructure/adapters/GitPersistenceAdapter.js, test/unit/infrastructure/adapters/GitPersistenceAdapter.readTree.test.js
Uses git cat-file --batch-check to read object type and size without materializing content, with structured missing-object handling.
API and design documentation
docs/API.md, docs/design/0047-application-storage-cache-boundary/witness/cache-set.md, README.md, CHANGELOG.md, STATUS.md
Documents managed cache behavior, bundle iteration, RootSet mutation context, Git metadata inspection, design evidence, and release status.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related issues

  • Issue 50 — Defines the application storage and cache ownership boundary implemented by the managed cache lifecycle and supporting bundle behavior.
  • Issue 55 — Covers cache usage diagnostics implemented through inspect() and doctor().

Possibly related PRs

  • git-stunts/git-cas#63 — Shares the Git persistence adapter area and structured object-size handling changes.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ContentAddressableStore
  participant CacheSetRegistry
  participant CacheSet
  participant RootSet
  Client->>ContentAddressableStore: caches.open(namespace, policy)
  ContentAddressableStore->>CacheSetRegistry: open(namespace, policy)
  CacheSetRegistry->>RootSet: construct managed cache root
  CacheSetRegistry->>CacheSet: return CacheSet
  Client->>CacheSet: put/get/sweep
  CacheSet->>RootSet: publish guarded generation
  RootSet-->>CacheSet: generation result
  CacheSet-->>Client: cache result or hit
Loading
sequenceDiagram
  participant BundleService
  participant GitPersistenceAdapter
  participant CacheIndex
  BundleService->>GitPersistenceAdapter: readObjectSize(handle)
  GitPersistenceAdapter->>GitPersistenceAdapter: cat-file --batch-check
  GitPersistenceAdapter-->>BundleService: object type and size
  BundleService->>CacheIndex: yield validated member descriptor
  CacheIndex-->>BundleService: logical-byte accounting
Loading

Poem

I’m a rabbit with caches tucked under the tree,
Keys hop in safely, deterministic and free.
Bundles stream softly, bytes counted just right,
Git checks their shapes without loading their might.
Roots guard each winner through conflict and repair—
We thump our paws proudly: managed storage is there!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR appears to satisfy #59's CacheSet lifecycle, policy, metadata, doctor/repair, and witness requirements.
Out of Scope Changes check ✅ Passed The extra bundle, Git metadata, and docs updates support the cache work, and no unrelated code changes stand out.
Title check ✅ Passed The title is concise and directly summarizes the main change: adding a managed CacheSet lifecycle.
Description check ✅ Passed The description covers the required linked issue, design/proof, validation, and release impact sections with concrete details.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@flyingrobots

Copy link
Copy Markdown
Member Author

Self-review and Code Lawyer

Reviewed the GitHub-visible 31-file diff against issue #59, the application-storage boundary in #50, the public declarations, and the real-Git lifecycle proof.

Contract audit

  • RootSet publication is the only durability boundary; CacheSet never invokes GC or deletes immutable objects.
  • Cache index scans use shallow bundle references and bounded candidate heaps; target graphs are resolved only for selected reads and deep doctor checks.
  • compare-and-swap retries discard callback-local state, and rejected guards stage no cache objects.
  • expiry, capacity eviction, removal, and replacement release roots so ordinary Git GC policy can collect unreachable support.
  • mutation results carry immutable RetentionWitness evidence.
  • malformed keys, metadata, outer indexes, entry bundles, and target accounting fail closed.

Findings resolved before PR

Ten findings were found and corrected: stale retry state, rejected-write staging, preflight bundle materialization, recursive sweep resolution, unchecked logical-byte metadata, malformed Unicode keys, malformed index shape, accidental registry export, duplicate repair authority, and shallow result immutability.

No unresolved correctness or API-contract finding remains. Graft reports an additive minor export change with no removals or changed signatures. The full source-pinned review and residual constraints are in docs/design/0047-application-storage-cache-boundary/witness/cache-set.md.

@flyingrobots

Copy link
Copy Markdown
Member Author

CI follow-up

The first Bun matrix run exposed a cross-runtime error-normalization defect in the previously landed asset-handle path: errorDetailsText() required instanceof Error, so an error-like value crossing a Vitest/runtime realm could lose its structured Git stderr and escape as a generic GitPlumbingError.

Commit aa46a808 replaces the realm-sensitive guard with structural extraction and adds a regression using a foreign-realm-shaped GitPlumbingError. The rebuilt Bun image now passes all 8 integration files and all 170 tests. Host lint and all 1,830 unit tests also pass.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@index.d.ts`:
- Line 342: Update the CacheHit.logicalBytes declaration from number | null to
number so it matches CacheHitData, the constructor parameter, and the runtime
validation contract; do not alter the surrounding CacheHit API.

In `@src/domain/services/CachePolicyEnforcer.js`:
- Around line 52-56: Update createCacheState to import and use the exported
CACHE_METADATA_VERSION and CACHE_ACCOUNTING_VERSION constants for version and
accountingVersion instead of hardcoded literals, keeping state production
aligned with CacheMetadataCodec validation.

In `@test/integration/cache-set.test.js`:
- Around line 73-80: Make the test “makes a removed target collectible while
retaining the winning index” self-contained by creating its target and cache
entry before calling cache.get('current'), using a dedicated namespace to avoid
dependence on preceding tests. Preserve the existing removal assertions and
doctor health check.

In `@test/unit/domain/services/CacheCandidateHeap.test.js`:
- Around line 5-17: Update the test “retains only the bounded oldest candidates
with deterministic ties” to include at least two candidates sharing the same
sortKey, then assert their documented deterministic digest tie-break order in
the sorted result while preserving the bounded oldest-candidate coverage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8408ede7-9b3b-481a-858f-c1568556b6e8

📥 Commits

Reviewing files that changed from the base of the PR and between cf7685b and eb0970b.

📒 Files selected for processing (31)
  • CHANGELOG.md
  • README.md
  • STATUS.md
  • docs/API.md
  • docs/design/0047-application-storage-cache-boundary/witness/cache-set.md
  • index.d.ts
  • index.js
  • src/domain/errors/Codes.js
  • src/domain/services/BundleService.js
  • src/domain/services/CacheCandidateHeap.js
  • src/domain/services/CacheIndex.js
  • src/domain/services/CacheMetadataCodec.js
  • src/domain/services/CachePolicyEnforcer.js
  • src/domain/services/CacheSet.js
  • src/domain/services/CacheSetRegistry.js
  • src/domain/services/RootSet.js
  • src/domain/services/RootSetMetadataCodec.js
  • src/domain/services/RootSetPersistence.js
  • src/domain/value-objects/CacheHit.js
  • src/domain/value-objects/CacheKey.js
  • src/domain/value-objects/CachePolicy.js
  • src/domain/value-objects/CacheSetRef.js
  • src/domain/value-objects/CollectionNamespace.js
  • test/integration/cache-set.test.js
  • test/unit/domain/services/BundleService.test.js
  • test/unit/domain/services/CacheCandidateHeap.test.js
  • test/unit/domain/services/CacheSet.test.js
  • test/unit/domain/services/RootSet.test.js
  • test/unit/domain/value-objects/CacheCollectionValues.test.js
  • test/unit/facade/ContentAddressableStore.application-storage.test.js
  • test/unit/types/declaration-accuracy.test.js
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: test-docker (deno)
  • GitHub Check: test-docker (bun)
  • GitHub Check: test-docker (node)
🧰 Additional context used
📓 Path-based instructions (4)
STATUS.md

📄 CodeRabbit inference engine (AGENTS.md)

Use STATUS.md as a compact snapshot of release and runtime truth

Files:

  • STATUS.md
CHANGELOG.md

📄 CodeRabbit inference engine (AGENTS.md)

Use CHANGELOG.md to record the historical truth of merged behavior

Files:

  • CHANGELOG.md
README.md

📄 CodeRabbit inference engine (AGENTS.md)

Use README.md as the public front door, core value prop, and quick start documentation

Files:

  • README.md
docs/design/**

📄 CodeRabbit inference engine (AGENTS.md)

Use docs/design/ directory for durable design contracts and proof plans

Files:

  • docs/design/0047-application-storage-cache-boundary/witness/cache-set.md
🧠 Learnings (2)
📚 Learning: 2026-02-28T19:21:13.982Z
Learnt from: flyingrobots
Repo: git-stunts/git-cas PR: 15
File: test/unit/domain/services/CasService.envelope.test.js:326-330
Timestamp: 2026-02-28T19:21:13.982Z
Learning: In fuzz tests for cryptographic operations, use a seeded PRNG (e.g., xorshift32) for control-flow variables such as plaintext size selection and recipient index selection to ensure reproducibility. Continue to use randomBytes() for cryptographic keys and nonces to preserve realistic randomness and avoid security anti-patterns. This guideline applies to test files that perform fuzz testing of crypto logic; implement a consistent seed setup (e.g., fixed seed in test initialization) and document the rationale to enable deterministic replays across runs.

Applied to files:

  • test/unit/domain/services/CacheCandidateHeap.test.js
  • test/unit/domain/value-objects/CacheCollectionValues.test.js
  • test/unit/types/declaration-accuracy.test.js
  • test/unit/facade/ContentAddressableStore.application-storage.test.js
  • test/integration/cache-set.test.js
  • test/unit/domain/services/BundleService.test.js
  • test/unit/domain/services/RootSet.test.js
  • test/unit/domain/services/CacheSet.test.js
📚 Learning: 2026-03-30T19:53:48.000Z
Learnt from: flyingrobots
Repo: git-stunts/git-cas PR: 29
File: docs/design/TR-010-planning-index-consistency-review.md:121-131
Timestamp: 2026-03-30T19:53:48.000Z
Learning: In this repo, CHANGELOG.md entries should be user-facing and descriptive (bullet points) rather than cycle-ID headings (e.g., use a phrase like “Planning-index consistency review” instead of a “TR-010 — …” heading). When searching the changelog, don’t rely on grepping for cycle IDs (e.g., “TR-010”) because it may cause false negatives; search for the descriptive keywords/phrases from the bullet entries instead.

Applied to files:

  • CHANGELOG.md
🪛 ast-grep (0.44.1)
test/integration/cache-set.test.js

[warning] 4-4: Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawnSync } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process)

🔇 Additional comments (32)
src/domain/errors/Codes.js (1)

14-20: LGTM!

index.js (1)

15-16: LGTM!

Also applies to: 66-66, 91-92, 179-181, 196-196, 223-224, 282-290, 346-351, 400-405, 949-949

README.md (1)

26-29: LGTM!

Also applies to: 101-101, 119-122

CHANGELOG.md (1)

41-49: LGTM!

Also applies to: 60-62

test/unit/facade/ContentAddressableStore.application-storage.test.js (1)

5-7: LGTM!

Also applies to: 31-44, 57-69

test/unit/types/declaration-accuracy.test.js (1)

93-96: LGTM!

STATUS.md (1)

91-95: LGTM!

docs/design/0047-application-storage-cache-boundary/witness/cache-set.md (1)

1-220: LGTM!

test/integration/cache-set.test.js (1)

1-71: LGTM!

Also applies to: 84-149

test/unit/domain/services/CacheSet.test.js (1)

1-387: LGTM!

test/unit/domain/services/RootSet.test.js (1)

4-5: LGTM!

Also applies to: 69-89

test/unit/domain/value-objects/CacheCollectionValues.test.js (1)

1-46: LGTM!

src/domain/services/CacheSet.js (3)

43-168: LGTM!


205-703: LGTM!


170-203: 🎯 Functional Correctness

No issue: CacheIndex.entries() already iterates in canonical path order, and entries/<64-hex-digest> paths preserve ascending keyDigest order.

src/domain/services/CacheSetRegistry.js (1)

1-89: LGTM!

src/domain/services/RootSet.js (1)

28-31: LGTM!

Also applies to: 112-112, 124-128, 201-201

src/domain/services/RootSetMetadataCodec.js (1)

17-22: LGTM!

Also applies to: 36-36, 157-157

src/domain/services/RootSetPersistence.js (1)

30-34: LGTM!

src/domain/value-objects/CacheKey.js (1)

11-62: LGTM!

src/domain/value-objects/CollectionNamespace.js (1)

12-54: LGTM!

src/domain/value-objects/CachePolicy.js (1)

13-59: LGTM!

src/domain/value-objects/CacheSetRef.js (1)

12-40: LGTM!

src/domain/value-objects/CacheHit.js (1)

13-93: LGTM!

index.d.ts (1)

306-334: LGTM!

Also applies to: 707-822, 1014-1051, 1100-1100

src/domain/services/BundleService.js (2)

88-105: LGTM!

Also applies to: 204-333, 356-375, 438-499, 548-555, 720-726, 838-848


677-689: 🗄️ Data Integrity & Integration

No action needed readObjectSize is already implemented by the in-repo persistence adapters, and the port contract requires it.

			> Likely an incorrect or invalid review comment.
test/unit/domain/services/BundleService.test.js (1)

197-264: LGTM!

docs/API.md (1)

1076-1114: LGTM!

Also applies to: 1404-1560, 2844-2850

src/domain/services/CacheMetadataCodec.js (1)

17-164: LGTM!

src/domain/services/CacheCandidateHeap.js (1)

1-71: LGTM!

src/domain/services/CacheIndex.js (1)

30-362: LGTM!

Comment thread index.d.ts Outdated
Comment thread src/domain/services/CachePolicyEnforcer.js Outdated
Comment thread test/integration/cache-set.test.js Outdated
Comment thread test/unit/domain/services/CacheCandidateHeap.test.js Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Around line 85-88: Move the “Git object metadata port” entry describing
GitPersistencePort.readObjectType() and readObjectSize() from the dated 6.1.0
section into Unreleased, preserving its wording and ensuring the 6.1.0
historical record no longer claims this change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b3b4651b-6619-477d-89e4-533d85cdb025

📥 Commits

Reviewing files that changed from the base of the PR and between aa4fdb1 and e6e07a7.

📒 Files selected for processing (9)
  • CHANGELOG.md
  • docs/API.md
  • docs/design/0047-application-storage-cache-boundary/witness/cache-set.md
  • index.d.ts
  • src/domain/services/CachePolicyEnforcer.js
  • src/infrastructure/adapters/GitPersistenceAdapter.js
  • test/integration/cache-set.test.js
  • test/unit/domain/services/CacheCandidateHeap.test.js
  • test/unit/infrastructure/adapters/GitPersistenceAdapter.readTree.test.js
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: test-docker (deno)
  • GitHub Check: test-docker (bun)
  • GitHub Check: test-docker (node)
🧰 Additional context used
📓 Path-based instructions (2)
CHANGELOG.md

📄 CodeRabbit inference engine (AGENTS.md)

Use CHANGELOG.md to record the historical truth of merged behavior

Files:

  • CHANGELOG.md
docs/design/**

📄 CodeRabbit inference engine (AGENTS.md)

Use docs/design/ directory for durable design contracts and proof plans

Files:

  • docs/design/0047-application-storage-cache-boundary/witness/cache-set.md
🧠 Learnings (2)
📚 Learning: 2026-02-28T19:21:13.982Z
Learnt from: flyingrobots
Repo: git-stunts/git-cas PR: 15
File: test/unit/domain/services/CasService.envelope.test.js:326-330
Timestamp: 2026-02-28T19:21:13.982Z
Learning: In fuzz tests for cryptographic operations, use a seeded PRNG (e.g., xorshift32) for control-flow variables such as plaintext size selection and recipient index selection to ensure reproducibility. Continue to use randomBytes() for cryptographic keys and nonces to preserve realistic randomness and avoid security anti-patterns. This guideline applies to test files that perform fuzz testing of crypto logic; implement a consistent seed setup (e.g., fixed seed in test initialization) and document the rationale to enable deterministic replays across runs.

Applied to files:

  • test/unit/domain/services/CacheCandidateHeap.test.js
  • test/unit/infrastructure/adapters/GitPersistenceAdapter.readTree.test.js
  • test/integration/cache-set.test.js
📚 Learning: 2026-03-30T19:53:48.000Z
Learnt from: flyingrobots
Repo: git-stunts/git-cas PR: 29
File: docs/design/TR-010-planning-index-consistency-review.md:121-131
Timestamp: 2026-03-30T19:53:48.000Z
Learning: In this repo, CHANGELOG.md entries should be user-facing and descriptive (bullet points) rather than cycle-ID headings (e.g., use a phrase like “Planning-index consistency review” instead of a “TR-010 — …” heading). When searching the changelog, don’t rely on grepping for cycle IDs (e.g., “TR-010”) because it may cause false negatives; search for the descriptive keywords/phrases from the bullet entries instead.

Applied to files:

  • CHANGELOG.md
🔇 Additional comments (10)
test/integration/cache-set.test.js (1)

74-83: LGTM!

test/unit/infrastructure/adapters/GitPersistenceAdapter.readTree.test.js (1)

95-110: LGTM!

Also applies to: 125-132

test/unit/domain/services/CacheCandidateHeap.test.js (1)

6-17: LGTM!

docs/API.md (1)

1349-1351: LGTM!

Also applies to: 1399-1403, 2845-2850

docs/design/0047-application-storage-cache-boundary/witness/cache-set.md (1)

11-12: LGTM!

Also applies to: 199-218

src/infrastructure/adapters/GitPersistenceAdapter.js (3)

211-238: 🎯 Functional Correctness | 💤 Low value

Doctor-comment nit: "missing" case is documented, "ambiguous" case is not called out.

Git's batch-check protocol also emits <object> ambiguous for an unresolvable short SHA (distinct from missing); the current code silently folds this into the generic fields.length !== 3GIT_ERROR path rather than a dedicated code. Given the codebase's stated fail-closed design goals, this still fails closed correctly — just with a less specific error code than missing. Low practical impact if all callers pass full-length OIDs (see the related comment on this function).


21-22: LGTM!

Also applies to: 190-201


211-238: 🎯 Functional Correctness

Potential abbreviated-OID regression

If any caller can pass a short hash here, fields[0] !== oid will reject a Git-resolvable object because %(objectname) returns the canonical full OID. The previous cat-file -t/-s path accepted abbreviated OIDs. If upstream always expands to full-length OIDs, ignore this.

index.d.ts (1)

337-359: Past comment addressed.

CacheHit.logicalBytes is now typed as number, matching CacheHitData, the constructor parameter, and the runtime non-negative-safe-integer validation in CacheHit.#assertValue.

src/domain/services/CachePolicyEnforcer.js (1)

4-7: Past comment addressed.

createCacheState() now sources version/accountingVersion from the shared CACHE_METADATA_VERSION/CACHE_ACCOUNTING_VERSION constants instead of hardcoded literals, keeping the producer in sync with CacheMetadataCodec validation.

Also applies to: 56-73

Comment thread CHANGELOG.md Outdated
@flyingrobots flyingrobots merged commit dbf7424 into main Jul 13, 2026
6 checks passed
@flyingrobots flyingrobots deleted the feat/cache-set-lifecycle branch July 13, 2026 15:52
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.

Add RootSet-backed CacheSet lifecycle management

1 participant