Skip to content

v6.3.0: Bounded scoped cache acquisitions #69

Description

@flyingrobots

Release milestone

v6.3.0

Outcome

A cache consumer can acquire a live CacheSet entry through a bounded, reference-only lookup and hold an explicit scoped anchor to the exact observed cache generation until an idempotent release. This closes the correctness and performance gap blocking git-warp's handle-first materialization path.

Current truth

  • CacheSet.get() resolves every hit target to recompute logical bytes, so a bundle target can trigger complete recursive support-graph validation instead of a bounded metadata lookup. [cite: src/domain/services/CacheSet.js#37-51@432c5d9effb12c9f66536f1386791bb4421f3cea]
  • CacheIndex.getEntry() and BundleService.getMemberReference() already provide reference-only targeted traversal, but CacheSet does not expose that bounded path to consumers. [cite: src/domain/services/CacheIndex.js#61-67@432c5d9effb12c9f66536f1386791bb4421f3cea] [cite: src/domain/services/BundleService.js#100-123@432c5d9effb12c9f66536f1386791bb4421f3cea]
  • A cache hit carries an observation witness for the cache ref/generation, but no lifetime lease; replacement or eviction can make that generation unreachable while a caller is still consuming it. [cite: src/domain/services/CacheSet.js#482-497@432c5d9effb12c9f66536f1386791bb4421f3cea]
  • RootSet generations are parentless current-generation commits, so anchoring the exact observed generation is sufficient to preserve its reachable index and targets. [cite: src/domain/services/RootSetPersistence.js#40-58@432c5d9effb12c9f66536f1386791bb4421f3cea]

Scope

  • Add a bounded CacheSet.acquire(key) contract.
  • Return a scoped acquisition containing the cache hit/target and an idempotent release().
  • Anchor the exact observed cache generation before returning.
  • Add atomic ref deletion support at the Git ref port/adapter boundary.
  • Make abandoned acquisition refs inspectable and repairable/cleanable by git-cas.
  • Prove lookup cost does not scale with the target support graph.
  • Prove replacement/eviction plus aggressive pruning cannot invalidate an active acquisition.
  • Document the lifecycle, error contract, and release obligations.

Out of scope

  • Changing ordinary CacheSet.get() compatibility semantics.
  • Application-owned pin refs or CAS object management.
  • Redefining cache TTL/LRU policy.
  • Solving git-warp's full causal-slice materialization in this repository.

Slices

  • Design the acquisition/ref lifecycle and abandoned-acquisition cleanup.
  • Write failing unit and real-Git integration tests.
  • Implement the domain value/service, ports, adapters, declarations, docs, and diagnostics.
  • Produce witness evidence, self-review, independent Code Lawyer review, and release verification.
  • Publish v6.3.0 and hand the API to git-warp.

Design doc

docs/design/0048-scoped-cache-acquisitions/scoped-cache-acquisitions.md

Required proof

  • Instrumented real-Git test showing acquisition reads remain bounded as an unrelated nested target support graph grows.
  • Race test showing an acquired generation remains reachable through replacement/eviction and aggressive prune until release.
  • Idempotent release and stale-acquisition cleanup tests.
  • Existing CacheSet compatibility suite remains green.
  • npm test, lint/type surface checks, and release verification pass.

Release gate impact

Additive public API and declarations, GitRefPort adapter extension, cache diagnostics/repair behavior, README and CHANGELOG updates, generated API surface verification, and npm v6.3.0 publication.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:runtimeRuntime portability or public API behaviorarea:storageStorage, Git objects, manifests, or persistencestatus:in-progressActively being workedtype:goalpostRelease-scale roadmap outcometype:releaseRelease evidence, gate, or packaging work

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions