Skip to content

docs(design): Client Diagnostics — crash reports and opt-in debug log upload (cross-repo spec) - #430

Merged
Quick104 merged 1 commit into
mainfrom
docs/client-diagnostics-spec
Jul 21, 2026
Merged

Quick104 merged 1 commit into
mainfrom
docs/client-diagnostics-spec

Conversation

@Quick104

Copy link
Copy Markdown
Contributor

What

Spec only — no code. This draft PR adds docs/design/2026-07-19-client-diagnostics.md: a cross-repo design + rollout plan for Client Diagnostics — opt-in crash reporting and debug-log upload from the Silo clients (Android phone/TV, iOS, tvOS) to the user's own Silo server, plus the server-side ingest, storage, admin, and retention work that lands in this repo.

It's opened here because the server is the hub: the payload contract (versioned JSON Schema + fixtures), the feature gate, the ingest endpoint, storage, retention, and the admin surface all live in silo-server. Matching client work in silo-android and silo-apple is phased in the spec.

Why

We currently have zero visibility into client-side failures:

  • No crash reporting exists in either client repo (no handler, no MetricKit, no SDK).
  • Diagnostics are ephemeral — logcat on Android, print()/[CMP-DIAG] console streams on Apple. Nothing survives to the moment a user reports a problem.
  • Our hardest bugs are device-specific (Shield HLG, Fire TV passthrough, HDMI mode switches, TV focus traps) and users can't report panel/audio-chain/codec facts.
  • The server already records playback_session_id in operational_logs — client bundles carrying session IDs let admins join both halves of a playback incident.

Why this route (short version — full rationale in the doc)

  • User's own server as destination, not a third-party crash service: self-hosted product, self-hosted diagnostics; the recipient is the admin who can actually act; no vendor accounts/keys.
  • Consent-first and off by default everywhere: server gate (diagnostics.uploads_enabled, storage-validated) + client settings; crash prompt asks "Send a diagnostic report to your server?" (Send / Don't send / Always send). Consent and pending reports are bound to a specific server + account so multi-server users can't leak one server's data to another.
  • Bundle-on-event, not streaming: a compressed tar.gz archive (structured JSONL logs, crash artifacts, hardware snapshot) captured at failure or via a user-driven "start capture → reproduce → stop & send" flow.
  • Hybrid storage: queryable manifest row in Postgres, payload blob in the existing S3-compatible private bucket; retention + orphan reconciliation via a taskmanager cleanup task. Raw client log lines never enter operational_logs.
  • Hardware snapshot in every bundle: device model (Shield / Fire TV / onn / phone), display + HDMI mode and HDR capabilities, audio output/passthrough path, decoder inventory — largely from capability probes both clients already have.

Platform capture summary

Platform Automatic capture Notes
Android (phone/TV) UncaughtExceptionHandler marker + ApplicationExitInfo (API 30+: ANR/native) minSdk 24; ExitInfo is an enhancement layer
iOS MetricKit crash + hang diagnostics Delivery is delayed/daily — spec is honest about timing and provenance
tvOS Abnormal-exit sentinel + breadcrumb journal (no stacks) MetricKit diagnostics are unavailable on tvOS; in-process crash reporter explicitly deferred
All Manual capture flow, opt-in verbose debug logging Primary support workflow for non-crash issues (playback stutter etc.)

Review process

The spec was adversarially reviewed before this PR: an independent fact-check of every codebase claim against all three repos, plus a design-attack pass (consent, crash-capture correctness, ingest robustness/abuse, storage consistency, UX, phasing). Material corrections were adopted — notably tvOS MetricKit unavailability, server-bound consent, storage-validated gating, streaming bounded ingest with a report state machine, collection-time typed redaction (replacing scrub-at-upload), and fingerprint-based exit-info dedupe. Details in the doc's "Review notes" section.

Feedback wanted

The doc ends with open questions; the ones that shape scope most:

  1. tvOS: is abnormal-exit detection (breadcrumbs, no stacks) acceptable for v1?
  2. Self-service deletion of uploaded reports from the client, or admin-side deletion only for v1?
  3. Quota/retention defaults (10 MiB/bundle, 20/day, 200 MiB/user, 30 days).

Rollout is 7 vertical slices (spec §Rollout plan): server foundation → contract fixtures in clients → Android end-to-end → Android coverage → Apple → web admin viewer → deferred items. Each slice is independently shippable and nothing prompts users until the full consent→capture→upload path exists on that platform.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XppCCycoaskCsW7ja1fZct

Cross-repo spec and rollout plan for opt-in client crash reporting and
debug-log upload to the user's own Silo server: silo-server ingest, storage,
admin API, and retention; silo-android and silo-apple capture, consent, and
upload. Disabled by default on both server and client.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XppCCycoaskCsW7ja1fZct
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 558d07d3-e671-4feb-84ed-9070651138bf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/client-diagnostics-spec

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

@Quick104

Copy link
Copy Markdown
Contributor Author

Server-side implementation (including this spec commit) is up in #445, verified end-to-end against dev. Contract clarifications that came out of E2E testing: standard tar end-of-archive zero padding (≤64 KiB) is accepted, and archive.uncompressed_bytes is defined as the full decompressed tar stream (headers + end-of-archive marker + padding included).

@Quick104

Copy link
Copy Markdown
Contributor Author

Apple client implementation (iOS + tvOS capture, consent flow, and upload) is up in Silo-Server/silo-apple#96 — full unit suite green (661 tests) and bundle semantics match the clarified contract. Remaining platform: silo-android.

@Quick104
Quick104 merged commit 7369d0a into main Jul 21, 2026
1 check passed
@Quick104
Quick104 deleted the docs/client-diagnostics-spec branch July 21, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant