Skip to content

fix(playback): expose conditional range outcomes - #594

Merged
Quick104 merged 3 commits into
mainfrom
fix/direct-stream-conditional-ranges
Aug 11, 2026
Merged

Quick104 merged 3 commits into
mainfrom
fix/direct-stream-conditional-ranges

Conversation

@Quick104

@Quick104 Quick104 commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Part of #443

The Apple client incident in Silo-Server/silo-apple#138 exposed an important distinction in the direct-stream contract: stale If-Range correctly falls back to a full 200, while bounded random-access clients need Range + If-Match so a stale entity fails without sending the representation body. Existing completion logs did not distinguish those conditional outcomes or provide privacy-safe validator correlation.

Companion client fix: Silo-Server/silo-apple#139.

Approach

  • Document the bounded Range + If-Match contract: a match returns the exact 206 interval and a stale validator returns a bodyless 412.
  • Preserve standard If-Range behavior: a mismatch still returns the current full entity as 200.
  • Add low-cardinality conditional-result fields and short SHA-256 fingerprints for emitted/request validators to the direct-stream completion log.
  • Never log raw validators or media paths.
  • Keep the existing dsr1 strong validator unchanged, including device/volume identity.

Testing

  • GOWORK=off go test -count=1 ./internal/playback: passed.
  • Matching/stale conditional-range tests repeated 20 times: passed.
  • Focused go test -race: passed.
  • GOWORK=off go vet ./internal/playback: passed.
  • CI-equivalent changed-line golangci-lint: 0 issues.
  • pnpm run lint: passed with 0 errors and existing warnings; pnpm run format:check: passed.
  • GOWORK=off make build: passed.
  • make verify-local-paths and git diff --check: passed.
  • GOWORK=off make test-go: every package except two existing macOS Jellycompat process-lock tests passed; both failures reproduce unchanged on untouched origin/main. internal/playback passed in the final full run.

AI Disclosure

  • Tool(s): Codex harness
  • Model(s): gpt-5.6-sol
  • Involvement: fully AI-generated, human-directed
  • Adversarial review: independent review rejected an initial proposal that weakened strong-validator identity across filesystems. That change was removed completely; the final diff keeps dsr1 and limits server changes to compatible contracts, tests, and privacy-safe diagnostics.

Checklist

  • I ran an adversarial AI review of the diff and summarized findings above.
  • I ran the repo verify commands: make lint, cd web && pnpm run lint, cd web && pnpm run format:check, and relevant go test ./....

Summary by CodeRabbit

  • New Features

    • Added bounded direct-stream requests using If-Match and range conditions.
    • Matching validators return partial content, while stale validators return 412 Precondition Failed without a response body.
    • Preserved existing If-Range behavior, including full responses when validators do not match.
  • Documentation

    • Documented conditional direct-stream requests and their response behavior.
  • Diagnostics

    • Improved completion logging with conditional-result details and privacy-preserving validator fingerprints.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 7 seconds

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c7817e4a-8744-44a5-897e-3810a68a5751

📥 Commits

Reviewing files that changed from the base of the PR and between 76754c6 and e30f2f1.

📒 Files selected for processing (2)
  • internal/playback/directplay.go
  • internal/playback/directplay_test.go
📝 Walkthrough

Walkthrough

The direct-stream handler now supports If-Match-guarded range responses. Matching validators return 206; stale validators return bodyless 412. Completion logs record conditional outcomes and short validator fingerprints without raw validator values or media paths.

Changes

Direct-stream conditional handling

Layer / File(s) Summary
Conditional range serving
internal/playback/directplay.go, internal/playback/directplay_test.go, docs/architecture/direct-stream-resume.md
ServeDirectPlay evaluates If-Match for bounded reads. Tests cover matching 206 responses, stale bodyless 412 responses, and changed entities. Documentation records the updated contract.
Conditional completion diagnostics
internal/playback/directplay.go, docs/architecture/direct-stream-resume.md
Completion logs use structured attributes for conditional results, header presence, and eight-byte SHA-256 validator fingerprints.
Diagnostics and regression coverage
internal/playback/directplay_test.go
Tests validate result classification, fingerprint stability and omission rules, structured JSON diagnostics, redaction, and existing If-Range behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ServeDirectPlay
  participant ConditionalResult
  participant CompletionLogger
  Client->>ServeDirectPlay: Bounded request with Range and If-Match
  ServeDirectPlay->>ConditionalResult: Classify conditional outcome
  ConditionalResult-->>ServeDirectPlay: Matching or stale result
  ServeDirectPlay-->>Client: 206 partial response or bodyless 412 response
  ServeDirectPlay->>CompletionLogger: Record result and validator fingerprints
Loading

Possibly related issues

Possibly related PRs

  • Silo-Server/silo-server#464 — This PR extends its range and validator handling with bounded If-Match semantics and diagnostics.
  • Silo-Server/silo-server#361 — Both modify internal/playback/directplay.go, but this PR addresses conditional validators instead of write deadlines.

Suggested labels: v1

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The changes cover server-side conditional outcomes and diagnostics, but they do not implement the linked issue's client-side bounded-fetch requirements. Implement or link the client-side bounded-fetch changes, or link the companion server issue that defines this server-side scope.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: exposing conditional range outcomes in playback.
Out of Scope Changes check ✅ Passed The documentation, playback code, and tests all relate to conditional direct-stream range handling and diagnostics.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/direct-stream-conditional-ranges

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

@coderabbitai coderabbitai Bot added the v1.0 Silo v1 scope - auto-adds to the Silo v1 project label Aug 11, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 76754c6d86

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/playback/directplay.go Resolved
@Quick104

Quick104 commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor Author

CI baseline note for current head e30f2f160: Docs hygiene passes, and Go passes on retry in run 31499121394. The first Go attempt hit an unrelated scanner fixture race (ffprobe: text file busy) that did not reproduce in 100 consecutive local runs. Web fails only NotificationsAdminSettings.test.tsx > shows the Silo Push Relay channel status (1 failed, 1,867 passed), because it cannot find /Silo renews automatically/. The exact same Web test and assertion fail on current main at SHA 881c96864 in run 31437482563; this PR changes no web files.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9627b49a21

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/playback/directplay.go Resolved
@Quick104
Quick104 merged commit 90bdbfe into main Aug 11, 2026
6 of 9 checks passed
@Quick104
Quick104 deleted the fix/direct-stream-conditional-ranges branch August 11, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v1.0 Silo v1 scope - auto-adds to the Silo v1 project

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant