[PR #1093] [MERGED] feat(server): add disabled cache proof model #1090

Closed
opened 2026-05-06 13:11:55 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/1093
Author: @NathanDrake2406
Created: 5/6/2026
Status: Merged
Merged: 5/6/2026
Merged by: @james-elicx

Base: mainHead: nathan/726-cache-proof-model


📝 Commits (3)

  • b677c91 feat(server): add disabled cache proof model
  • 834fde2 fix(server): use distinct invalid cache budget code
  • 365878a fix(server): harden disabled cache proof invariants

📊 Changes

3 files changed (+1102 additions, -0 deletions)

View changed files

📝 knip.ts (+3 -0)
packages/vinext/src/server/cache-proof.ts (+727 -0)
tests/cache-proof.test.ts (+372 -0)

📄 Description

What this changes

Implements #726-CACHE-01/04 from #726 by adding an intentionally disabled cache proof model for future route graph driven cache work.

The new model defines RenderObservation v0, CacheVariant v0, BoundaryOutcomeCompatibility v0, CacheVariantBudget, breaker fallback decisions, canonical redacted dimension representation, and a disabled decision that always returns canReuse false.

Why

Issue #726 calls out the core invariant: no proof, no reuse, no skip, no visible commit. Runtime cache hits are not semantic proof, so this PR creates the proof vocabulary and breaker shape before any observation recording or runtime cache reuse is enabled.

Approach

  • Add packages/vinext/src/server/cache-proof.ts as a pure functional model with no runtime cache path imports.
  • Tie cache proof route scope input to AppRouteSemanticIds so future cache facts stay anchored in the route graph boundary.
  • Canonicalize dimensions by source/privacy/name, hash values before persistence or trace output, enforce dimension and variant budgets, and emit breaker fallbacks on uncertainty or unsafe public dimensions.
  • Model boundary outcome compatibility as exact match only, with unknown outcomes falling back to fresh render.
  • Register the disabled model as a Knip entry because this slice deliberately exports the v0 contract before later #726 slices wire runtime consumers.

Non-goals for this PR:

  • no real render observation recording
  • no cache hit enablement
  • no public/private cacheability enforcement

Bonk: please read issue #726 to see the big picture before reviewing the cache proof boundary.

Validation

  • vp check --fix packages/vinext/src/server/cache-proof.ts tests/cache-proof.test.ts
  • vp check --fix knip.ts packages/vinext/src/server/cache-proof.ts tests/cache-proof.test.ts
  • vp run knip --no-progress
  • vp test run tests/cache-proof.test.ts
  • vp test run tests/cache-proof.test.ts tests/app-route-graph.test.ts tests/app-page-cache.test.ts tests/app-route-handler-cache.test.ts tests/isr-cache.test.ts
  • vp run vinext#build

Full vp check note: formatting passed, but the existing repository check still reports unrelated issues in packages/vinext/src/server/request-pipeline.ts and benchmarks/vinext/vite.config.ts. The touched files pass targeted check, and Knip passes after registering this disabled boundary.

Risks / follow-ups

This is intentionally authority-free scaffolding. Later #726 cache slices still need to record real observations, classify private/dynamic downgrade behavior, and keep cache hit authority behind proof checks rather than runtime cache presence.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/1093 **Author:** [@NathanDrake2406](https://github.com/NathanDrake2406) **Created:** 5/6/2026 **Status:** ✅ Merged **Merged:** 5/6/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `nathan/726-cache-proof-model` --- ### 📝 Commits (3) - [`b677c91`](https://github.com/cloudflare/vinext/commit/b677c9116fd016dc75ba0b40e9bec88015793d7d) feat(server): add disabled cache proof model - [`834fde2`](https://github.com/cloudflare/vinext/commit/834fde2d584cdb44f8a51592e958d2eb3eedc26e) fix(server): use distinct invalid cache budget code - [`365878a`](https://github.com/cloudflare/vinext/commit/365878a0590aec1422bda32a433433a8f986e431) fix(server): harden disabled cache proof invariants ### 📊 Changes **3 files changed** (+1102 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `knip.ts` (+3 -0) ➕ `packages/vinext/src/server/cache-proof.ts` (+727 -0) ➕ `tests/cache-proof.test.ts` (+372 -0) </details> ### 📄 Description ## What this changes Implements #726-CACHE-01/04 from #726 by adding an intentionally disabled cache proof model for future route graph driven cache work. The new model defines RenderObservation v0, CacheVariant v0, BoundaryOutcomeCompatibility v0, CacheVariantBudget, breaker fallback decisions, canonical redacted dimension representation, and a disabled decision that always returns canReuse false. ## Why Issue #726 calls out the core invariant: no proof, no reuse, no skip, no visible commit. Runtime cache hits are not semantic proof, so this PR creates the proof vocabulary and breaker shape before any observation recording or runtime cache reuse is enabled. ## Approach - Add packages/vinext/src/server/cache-proof.ts as a pure functional model with no runtime cache path imports. - Tie cache proof route scope input to AppRouteSemanticIds so future cache facts stay anchored in the route graph boundary. - Canonicalize dimensions by source/privacy/name, hash values before persistence or trace output, enforce dimension and variant budgets, and emit breaker fallbacks on uncertainty or unsafe public dimensions. - Model boundary outcome compatibility as exact match only, with unknown outcomes falling back to fresh render. - Register the disabled model as a Knip entry because this slice deliberately exports the v0 contract before later #726 slices wire runtime consumers. Non-goals for this PR: - no real render observation recording - no cache hit enablement - no public/private cacheability enforcement Bonk: please read issue #726 to see the big picture before reviewing the cache proof boundary. ## Validation - vp check --fix packages/vinext/src/server/cache-proof.ts tests/cache-proof.test.ts - vp check --fix knip.ts packages/vinext/src/server/cache-proof.ts tests/cache-proof.test.ts - vp run knip --no-progress - vp test run tests/cache-proof.test.ts - vp test run tests/cache-proof.test.ts tests/app-route-graph.test.ts tests/app-page-cache.test.ts tests/app-route-handler-cache.test.ts tests/isr-cache.test.ts - vp run vinext#build Full vp check note: formatting passed, but the existing repository check still reports unrelated issues in packages/vinext/src/server/request-pipeline.ts and benchmarks/vinext/vite.config.ts. The touched files pass targeted check, and Knip passes after registering this disabled boundary. ## Risks / follow-ups This is intentionally authority-free scaffolding. Later #726 cache slices still need to record real observations, classify private/dynamic downgrade behavior, and keep cache hit authority behind proof checks rather than runtime cache presence. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:11:55 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#1090
No description provided.