docs(rfc): RFC 0033 drafted — cached template-map artifact - #484
Conversation
Discharges the RFC 0005 §3.7.1 deferral, now measured to matter: RFC 0031 comparative run #8 (otel-demo-v8, 4.9M records) puts the per-query audit-stream registry fold at a constant 513,862 bytes. One per-tenant advisory artifact (registry + alias map, one object), frontier-keyed freshness, RFC 0009 §3.4-style atomic publish, querier write-through. The audit stream remains the source of truth. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WQY9wfrfRggqSpMLH8Xj3Y
|
Warning Review limit reached
Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRFC 0033 documents a per-tenant ChangesCached template-map design
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Drafts RFC 0033 to introduce a per-tenant cached template_map.json artifact (template registry + alias map) stored alongside the audit parquet files, intended to eliminate the current per-query full audit-stream fold cost while remaining additive/advisory (fallback-to-fresh-fold on any non-hit).
Changes:
- Add new RFC document: RFC 0033 — Cached template-map artifact (design, alternatives, acceptance criteria, testing strategy, open questions, references).
- Register RFC 0033 in the mdBook table of contents (
docs/SUMMARY.md).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/SUMMARY.md | Adds RFC 0033 to the RFC list so it appears in the rendered docs book. |
| docs/rfcs/0033-cached-template-map.md | New RFC defining the cached template-map artifact design and associated acceptance criteria/testing strategy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@docs/rfcs/0033-cached-template-map.md`:
- Around line 171-178: Revise the “Size bound” section to remove the
unconditional “always strictly smaller” claim and present it as an expected,
measured reduction instead. Define cache abstention when the serialized artifact
exceeds the configured size threshold, while preserving the existing RFC 0023
bounds and noting that warm reads are not guaranteed to reduce bytes.
- Around line 264-268: Change the write-through publication flow described in
the querier cache-miss path so it never publishes a partially populated template
map after registry-only misses. Ensure the miss path obtains both the template
registry and alias map from the same captured scan, or defers publication until
both folds are available, without triggering a second audit scan; preserve
best-effort publication semantics and add an acceptance test covering a
body-rendering query followed by an alias-resolving query.
- Around line 327-330: Resolve the `QueryResult::registry_bytes_read` contract
before changing its accounting: either amend RFC 0031 and the `QueryResult`
documentation to define it as template-map acquisition bytes, or introduce a
separate artifact-byte field while preserving its existing audit-stream meaning.
Update the RFC 0033 cache-hit description and scenario RFC0033.6 so the selected
contract, accounting, and “no channel changes” claim are consistent.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 93eda18d-52d3-492a-8e1d-6d22373adbe7
📒 Files selected for processing (2)
docs/SUMMARY.mddocs/rfcs/0033-cached-template-map.md
…ndment, size abstention Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WQY9wfrfRggqSpMLH8Xj3Y
The §5 criteria were authored test-turnable at drafting and survived the #484 review round (which strengthened them: the no-partial- artifact rule, the registry_bytes_read contract amendment, size abstention); the RFC 0031 freeze (#502) now names this RFC as the condition for unfreezing M_L2, making the ladder advance timely. Maintainer delegated ordering and judgment 2026-07-13. Claude-Session: https://claude.ai/code/session_01WQY9wfrfRggqSpMLH8Xj3Y Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
What
Drafts RFC 0033 — cached template-map artifact, discharging the RFC 0005 §3.7.1 deferral ("a pure recovery/latency cache over this derivation", to be designed when it measurably matters).
The measured justification
RFC 0031 comparative run #8 (honest total-bytes metric) measured the registry derivation at a constant 513,862 bytes per body-rendering query: every query folds the tenant's entire audit stream (
read_all_events) before answering. The tax is per-query, grows with tenant age (append-only stream) rather than query selectivity — the inverse of the pruning thesis — and now sits inside the RFC 0031 headline metric.Design positions (all with alternatives recorded in §4)
template_map.json, registry + alias map together): same stream, same fold order, same validity domain; one frontier check, one atomic publish, no cross-frontier disagreement.audit/tenant_id=<enc>/template_map.json(object storage per §3.6, tenant-scoped per §3.7). Verified additive-by-construction: both audit-scan branches select*.parquetonly, so every existing reader is blind to it.manifest.rsprecedent (.tmp+rename locally,publish_casconditional-put on S3); a lost CAS race is discard-and-move-on since any published cache is a correct fold of some frontier, verified on every read.§5 acceptance criteria (each test-turnable)
cached≡fresh (property-tested), staleness detection both directions, crash/tear safety around the swap, additive/advisory (no artifact → byte-identical behaviour), tenant isolation, the RFC 0031 measurable (warm
registry_bytes_read== artifact size; gatewarm/cold ≤ 1/10with run #8's 513,862 B as baseline), and OTel instruments via the weaver registry.Invariants / hazards
Docs-only. Touches the §3.5/§3.6/§3.7 rule set on paper — the RFC's design is explicitly additive/advisory with the audit stream remaining the sole source of truth. Hazard 5 (template schema evolution): the artifact caches the fold, not new semantics.
Checks run
mdbook build(clean, pre-existing mermaid version warning only), Mermaid sequence diagram visually verified via mermaid-cli render,cargo fmt --all --check(trivially clean — no code).Status ladder: lands as
drafted;drafted → specifiedis the maintainer's call perdocs/rfcs/README.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01WQY9wfrfRggqSpMLH8Xj3Y
Summary by CodeRabbit