[stack 6/8] feat(trace): cover compact and response-cache hits - #309
Draft
OnlineChef (ChefGroep) wants to merge 2 commits into
Draft
OnlineChef (ChefGroep) wants to merge 2 commits into
OnlineChef (ChefGroep) wants to merge 2 commits into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 |
This was referenced Oct 4, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked re-landing of #301 (
feat/trace-compact-cache). Position 6/8; base:stack/20261005-05-trace-reader. Merge bottom-up; each layer is a real merge of the original PR head, so the diff shows only that PR plus any conflict resolution (noted in the merge commit message).Stack
Original description:
Summary
Extends the opt-in trace store from #298 to the two remaining HTTP/cache paths that materially affect cache debugging:
/v1/responses/compactThis PR is intentionally stacked on
feat/trace-store/ #298. It does not add WebSocket/live/realtime tracing, a remote reader, Redis, or a new persistence format.Cache-hit trace model
A response-cache entry now keeps the request id that originally populated it. On a later HIT the new request trace records:
cacheHit: truecacheSourceTraceIdwhen knownThe cached response body is not copied again into trace.sqlite. In
redacted/fullmode only the hit request's own inbound body may be stored under its new trace id.The persisted cache source id is allowlisted before it can enter usage/request-log metadata.
Compact coverage
/v1/responses/compactnow uses the same trace lifecycle as the other HTTP data-plane routes:beginTrace -> runWithTrace -> response observation -> addFinalRequestLogThe compact implementation already has a 32 MiB hard response-buffer bound; the trace store still applies its own lower configurable per-body cap.
Verification
Exact clean-tree head
84f105ba56240f31ca57f8e348bcc7290c6cc7bd:bun x tsc --noEmit✅bun run privacy:scan✅git diff --check✅client-artifactbuild/guard tests ✅The earlier dirty-tree full-suite attempt hit only the repository's intentional client-artifact clean-tree guard before this lane was committed. The clean exact-head rerun passed that guard and the complete suite.
Remaining boundary
WebSocket/live/realtime traffic is intentionally not included here. That lifecycle needs per-session/frame bounds and separate finalization semantics rather than being bolted onto the HTTP trace path.
Dependency
Stacked on #298. Merge/rebase only after the trace-store parent lands.
Summary by CodeRabbit