Skip to content

fix(components): align progress helpers with the new watch-progress model - #2

Merged
Quick104 merged 1 commit into
mainfrom
fix/continue-watching-rewatch-parity
Jun 10, 2026
Merged

Quick104 merged 1 commit into
mainfrom
fix/continue-watching-rewatch-parity

Conversation

@Quick104

@Quick104 Quick104 commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Context

Server PR silo-server#117 changes the watch-progress model: played/completed becomes a one-way watched latch and watched items now report position_seconds: 0 instead of position pinned to the duration. A rewatch of a watched item reports played: true with a live nonzero position, and such items now appear in the Continue Watching source, which keys on position > 0.

Audit result: client already compatible

A full sweep of progress consumers found this app position-driven throughout, so the model change is transparent:

  • Resume helpers (resumePositionSeconds in Movie/Season/Series/TV detail views) are gated on pos > 30 / pos < dur − 5, never on played — watched items (position 0) get "Play", rewatches get "Resume".
  • PlaybackSessionBridge.resolvedStartPosition consumes the stored position directly; watched items start from the beginning, rewatches resume.
  • Watched badges (MediaCard, EpisodeThumbCard, TVMediaCard, PhoneEpisodeRail) key on the played flag, never derive it from position.
  • Next-up selection prefers isInProgress then first !played — a rewatch in flight correctly becomes the season's next-up.
  • No local cache derives played from position (playedOverride is server-synced optimistic state only).
  • Top Shelf computes progress from position/duration on continue-watching items only.

Change

The one wrinkle: EpisodeThumbCard.progressValue and MediaRow.progressValue(for:) returned 0.0 (not nil) for watched items under the new model, relying on render-site > 0 guards to avoid drawing an empty progress track. This PR adds the pos > 0 guard inside the helpers themselves (matching PhoneEpisodeRail), so "no live resume point" is nil everywhere regardless of future render sites, and documents the new model invariant at both spots.

New behavior users will see (no client code drives this — it falls out of the server change): rewatching a watched item puts it back in Continue Watching with its progress bar and the watched checkmark, matching the web app, Plex, and current Jellyfin.

Testing

swiftc -parse clean on both files. A full xcodebuild of origin/main is currently blocked on this machine by an upstream binary checksum mismatch (Libuavs3d via the mpvkit dependency) — the local vendoring work addresses this but isn't pushed yet; the change here is two guard clauses on existing optionals, so type-level risk is nil. Recommend a normal build once the vendored package lands.


AI-use disclosure: implemented with Claude (Claude Code), reviewed by the maintainer.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed resume progress calculation for watched episodes and media. Resume points now display only when an actual playback position exists, preventing incorrect progress indicators when items are marked as watched without a valid resume point.

…atch model

Server PR Silo-Server/silo-server#117 changed the watch-progress model:
watched items now report position_seconds = 0 and a rewatch in flight
reports played = true WITH a live nonzero position (one-way watched
latch, Jellyfin-style).

A full audit found this client already compatible — resume helpers are
position-gated, badges key on played, next-up prefers is_in_progress —
but two progressValue helpers returned 0.0 instead of nil for watched
items, relying on render-site `> 0` guards to avoid drawing an empty
track. Add the pos > 0 guard inside the helpers (PhoneEpisodeRail
already does this) so "no live resume point" is represented as nil
everywhere, and document the model invariant at both sites.

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b9fa73c1-869a-4b1d-8107-62d691629e2b

📥 Commits

Reviewing files that changed from the base of the PR and between b03b653 and d953222.

📒 Files selected for processing (2)
  • iosApp/iosApp/Components/EpisodeThumbCard.swift
  • iosApp/iosApp/Components/MediaRow.swift

📝 Walkthrough

Walkthrough

Two related UI components tighten their resume-progress calculation logic. EpisodeThumbCard and MediaRow both now require positionSeconds/pos to be greater than zero (not just present) before computing or returning a resume value, with added comments clarifying the distinction between server-stored position 0 (watched, no resume point) and nonzero positions (live resume points).

Changes

Resume-progress validation

Layer / File(s) Summary
Resume-progress validation guards in UI components
iosApp/iosApp/Components/EpisodeThumbCard.swift, iosApp/iosApp/Components/MediaRow.swift
Both progressValue methods now enforce that position must be nonzero before reporting resume progress. Guard conditions strengthened to validate positionSeconds > 0 and pos > 0 respectively, with inline comments documenting watched vs resume-point semantics.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 accurately describes the main change: aligning progress helpers with a new watch-progress model by fixing position validation logic.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/continue-watching-rewatch-parity

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

@Quick104
Quick104 merged commit 0f002d0 into main Jun 10, 2026
1 check passed
@Quick104
Quick104 deleted the fix/continue-watching-rewatch-parity branch June 10, 2026 12:30
Quick104 added a commit that referenced this pull request Jul 21, 2026
- Clear cached/persisted status and breadcrumb consent context when purging
  a signed-out binding, so a later capture can't recreate default-Ask consent
  and resume diagnostics for the old account (#1)
- Gate persistent capture on server availability, not just consent != Never,
  so a disabled/storage-unavailable server never stores crash reports (#2)
- Persist the binding (and profile) in abnormal-exit markers and attribute the
  report to it; drop markers whose account no longer matches, keeping legacy
  markers' best-effort behavior (#3)
- Default breadcrumb capture to disabled until stored consent loads, bootstrapping
  from the last-known status so a Never account's fresh launch writes nothing (#4)
- Treat a status-refresh failure during upload as retryable instead of a
  destination mismatch (wrong message + 24h retry suppression) (#5)
- Suppress declined prompts for the report's lifetime via a per-report flag;
  declined reports stay manually sendable but never re-prompt or auto-upload (#6)

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh
Quick104 added a commit that referenced this pull request Jul 21, 2026
…sent, and upload (#96)

* feat(diagnostics): Apple client diagnostics slice (iOS + tvOS)

Implements the Apple slice of the client-diagnostics spec (silo-server
docs/design/2026-07-19-client-diagnostics.md): vendored contract models
with fixture tests, DiagLog safe-logging facade with collection-time
redaction and an always-on memory ring, breadcrumb journal, tar.gz bundle
builder + multipart upload via DiagnosticsAPI, MetricKit crash/hang capture
(iOS), abnormal-exit sentinel (tvOS) with consent gating, server+account-
bound consent and pending-report stores with sign-out purge, device
snapshot with hashed route identifiers, Diagnostics settings + consent
prompts on both platforms, and a curated cmpLog tee into the ring.

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

* feat(diagnostics): consent prompts, pending-report review, and settings UX (iOS + tvOS)

Adds the user-facing layer over the diagnostics slice: the crash/hang
pending-report prompt flow with a review sheet before anything uploads,
per-fingerprint suppression and child-profile gating via
DiagnosticsPromptPolicy, an automatic upload path for always-on consent,
report summary and detail screens, Diagnostics settings panes on both
platforms, and pending-report notifications posted from MetricKit
capture so an active session can surface the prompt.

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

* feat(debug): auto-login launch arguments for simulator E2E runs

-debugServer/-debugUsername/-debugPassword sign in through the real
checkServer -> login -> selectProfile flow and land on Home, so
simulator-driven end-to-end runs (paired with -debugPlayFirst) need no
UI input. DEBUG builds only.

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

* fix(diagnostics): redact server hosts, emails, and identity key-values in logs

A captured report leaked the server domain three ways: HTTPClient error
lines with full URLs, wss:// URLs inside NSError descriptions (the URL
regex only matched http/https), and the potential for bare hostnames
outside URL syntax. Now:

- URL normalization hashes the host to a stable [host:<sha256-12>]
  token (ws/wss included), keeping lines correlatable without exposing
  the domain; loopback hosts stay literal for playback debugging.
- Every remembered server hostname from ServerRegistry is registered
  with the redactor and replaced even when it appears as bare text —
  known-string matching avoids the false positives a generic domain
  regex would hit (bundle ids, file names).
- Email addresses are redacted, and username/login/email key-values
  join the token key-value redaction (= and : separators).

Verified on a live report: zero domain occurrences in the bundle,
hashed tokens in place, loopback URLs intact.

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

* fix(diagnostics): address PR #96 review findings

- Move DiagnosticsSHA256 into its own file so the SiloTVTopShelf target
  (which compiles the logging/redaction slice) links DiagLog.hostToken
- Refresh the stored manifest consent notice_version at upload time so a
  report captured under an older notice isn't rejected as stale_consent forever
- Classify too_large uploads as a permanent local failure (new report state)
  instead of retrying the same oversized bundle indefinitely
- Preserve crash capture when the status refresh is offline by falling back to
  the last-known-good status/binding (in-memory, then persisted per server)
- Gate persistent capture for child profiles, mirroring the prompt policy
- Filter breadcrumbs.jsonl to the crashed run's lines for abnormal-exit reports
- Snapshot logs at capture time and prefer the frozen snapshot when building an
  old crash/hang/abnormal-exit bundle (manual reports still use the live ring)
- Distinguish a token rotation from a real identity change by comparing the
  server id + account id rather than raw access-token fingerprints
- Skip reports marked needsServerUpdate/tooLarge in auto-upload and prompting
- Scope recorded playback session IDs to the active binding so another
  server/account's sessions can't leak into a report bound elsewhere
- Truncate MetricKit stack_excerpt by UTF-8 bytes, not characters
- Drop the redundant named-keys frame traversal that duplicated stack frames
- Note the MetricKit delivery-time binding limitation at the capture site
- Hold BreadcrumbJournal's lock across readAll() so reads can't race rotation
- Disable decline/delete buttons while the view model isWorking (iOS + tvOS)
- Register the legacy host for redaction during ServerRegistry migration
- Serialize ExitSentinel.captureEnabled writes with its lock via setCaptureEnabled
- Coalesce overlapping foreground refreshes in DiagnosticsViewModel
- Gate verbose 1 Hz [CMP-DIAG] player traces behind the Debug Logging toggle
- Tests: use failable String(bytes:encoding:) and XCTUnwrap in redaction tests;
  add focused tests for consent refresh, permanent-failure state, session
  scoping, and byte-safe stack truncation

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

* fix(diagnostics): address round-2 review findings on PR #96

- Clear cached/persisted status and breadcrumb consent context when purging
  a signed-out binding, so a later capture can't recreate default-Ask consent
  and resume diagnostics for the old account (#1)
- Gate persistent capture on server availability, not just consent != Never,
  so a disabled/storage-unavailable server never stores crash reports (#2)
- Persist the binding (and profile) in abnormal-exit markers and attribute the
  report to it; drop markers whose account no longer matches, keeping legacy
  markers' best-effort behavior (#3)
- Default breadcrumb capture to disabled until stored consent loads, bootstrapping
  from the last-known status so a Never account's fresh launch writes nothing (#4)
- Treat a status-refresh failure during upload as retryable instead of a
  destination mismatch (wrong message + 24h retry suppression) (#5)
- Suppress declined prompts for the report's lifetime via a per-report flag;
  declined reports stay manually sendable but never re-prompt or auto-upload (#6)

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

* fix(diagnostics): address round-3 review findings on PR #96

- DiagnosticsCoordinator: drop abnormal-exit markers captured under a
  child profile by re-checking the marker's own profile at capture, not
  just the profile active now (an unknown status keeps the marker for a
  later retry).
- DiagnosticsCoordinator: rotate the breadcrumb journal when the active
  server/account binding changes mid-run so a new binding can't bundle
  the previous one's breadcrumbs; the first establish of a launch still
  keeps the prior run's trail for abnormal-exit capture.
- DiagnosticsCoordinator: restrict the last-known-status offline fallback
  to genuine network/status failures; identityChanged (signed out / no
  token) and missing-account no longer capture against a stale binding.
- DiagnosticsCoordinator: gate breadcrumb capture on server availability
  so disabled/storage_unavailable status no longer arms capture,
  consistent with the persistent-capture gate.
- DiagnosticsCoordinator: fail closed when the active profile's child
  status can't be resolved during persistent capture (getProfiles()
  failed offline) instead of proceeding.
- PendingReportStore: refresh consent.mode as well as notice_version from
  the current consent record at upload so a demoted Always->Ask report
  can't still claim mode=always (manual reports stay manual).
- MetricKitCapture: cap crash.summary to 8192 UTF-8 bytes after prefixing
  the first frame, reusing the byte-safe truncation.
- DiagLog: redact HTTPClient's camelCase/wrapper header forms harvested
  from OSLog (profileId=, auth(...), profileToken(...), accessToken /
  refreshToken key-values).

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

* fix(diagnostics): address round-4 review findings on PR #96

- Restrict the offline capture fallback to genuinely transient failures:
  only network/offline errors and 5xx server errors fall back to the
  last-known snapshot; auth/permission (401/403), missing endpoint (404),
  other 4xx, malformed responses, and identity-level errors now fail closed
  so a capture is never queued against a signed-out or unavailable binding.
- Back-fill the tvOS exit-sentinel marker binding the moment diagnostics
  first resolves it (coordinator refresh completion), not only on a later
  foreground, so a first-run crash before any status refresh is still
  attributed to the right account instead of a legacy/unbound marker.
- Re-verify the active destination immediately before posting a diagnostics
  bundle; the bundle build (OSLog harvest + gzip) can outlast an account
  switch, and a same-server switch keeps server_instance_id, so keep the
  report retryable rather than upload it to the newly active account.
- Drop the access-token fingerprint from the view model's RuntimeIdentity so
  a transparent token refresh during load() is no longer misread as an
  identity change and reset(); the stable identity is server registry id plus
  profile id, with sign-out still detected via token presence and generation.
- Always run the registry-wide diagnostics purge on sign-out (it clears
  reports/consent under older server_instance_ids for the same URL); the
  current-binding purge only skips its own duplicate work, never the
  registry-wide purge.
- Gate uploads on the captured profile: the server rejects an upload whose
  X-Profile-Id header (the currently active profile) disagrees with the
  manifest's report.profile_id (HTTP 400 profile_mismatch). Hold a report
  captured under another profile as retryable — before the bundle build and
  again right before the POST — so it uploads next time the capturing profile
  is active, mirroring the server's resolveProfileID trim-and-compare rule.

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

* fix(diagnostics): address round-5 review findings on PR #96

- DiagnosticsCoordinator: verify a *stable* destination identity (server
  registry id + selected profile, plus a token-presence sign-out check)
  before posting a bundle, not the access-token value. A transparent token
  refresh during buildBundle no longer trips the pre-POST check and defers
  the Always-path auto-upload for 24h; a genuine same-server account switch
  still fails closed (it clears the token and lands on a different profile).
- DiagLog/LogRing: clear the process-wide log ring when the active
  diagnostics binding changes, mirroring the breadcrumb-journal purge at the
  same trigger, so a new binding's manual report or crash snapshot can't
  include the previous binding's CMP/playback log lines. Adds LogRing.clear().
- DiagnosticsCoordinator: re-evaluate the breadcrumb gate on profile change
  (and status refresh) so an adult->child profile switch disarms breadcrumb
  and exit-sentinel capture, consistent with the persistent-capture child
  gate; fails closed immediately on switch until the async child check lands.
- PlaybackSessionBridge: gate RecentSessionTracker recording on the same
  capture-enabled signal (isDiagnosticsCaptureEnabled) as breadcrumbs, so
  session IDs aren't accumulated while collection is off (Never / disabled /
  storage-unavailable) and later surfaced in a report after re-enable.
- DiagLog.replaceKnownHosts: rewrite as a single forward pass that never
  rescans replaced output, fixing an infinite loop when a registered host is
  a substring of its replacement token (e.g. "host" vs "[host:...]"). Adds a
  pathological-host regression test plus a LogRing.clear() test.

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

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Quick104 added a commit that referenced this pull request Jul 22, 2026
…98)

* feat(diagnostics): Apple client diagnostics slice (iOS + tvOS)

Implements the Apple slice of the client-diagnostics spec (silo-server
docs/design/2026-07-19-client-diagnostics.md): vendored contract models
with fixture tests, DiagLog safe-logging facade with collection-time
redaction and an always-on memory ring, breadcrumb journal, tar.gz bundle
builder + multipart upload via DiagnosticsAPI, MetricKit crash/hang capture
(iOS), abnormal-exit sentinel (tvOS) with consent gating, server+account-
bound consent and pending-report stores with sign-out purge, device
snapshot with hashed route identifiers, Diagnostics settings + consent
prompts on both platforms, and a curated cmpLog tee into the ring.

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

* feat(diagnostics): consent prompts, pending-report review, and settings UX (iOS + tvOS)

Adds the user-facing layer over the diagnostics slice: the crash/hang
pending-report prompt flow with a review sheet before anything uploads,
per-fingerprint suppression and child-profile gating via
DiagnosticsPromptPolicy, an automatic upload path for always-on consent,
report summary and detail screens, Diagnostics settings panes on both
platforms, and pending-report notifications posted from MetricKit
capture so an active session can surface the prompt.

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

* feat(debug): auto-login launch arguments for simulator E2E runs

-debugServer/-debugUsername/-debugPassword sign in through the real
checkServer -> login -> selectProfile flow and land on Home, so
simulator-driven end-to-end runs (paired with -debugPlayFirst) need no
UI input. DEBUG builds only.

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

* fix(diagnostics): redact server hosts, emails, and identity key-values in logs

A captured report leaked the server domain three ways: HTTPClient error
lines with full URLs, wss:// URLs inside NSError descriptions (the URL
regex only matched http/https), and the potential for bare hostnames
outside URL syntax. Now:

- URL normalization hashes the host to a stable [host:<sha256-12>]
  token (ws/wss included), keeping lines correlatable without exposing
  the domain; loopback hosts stay literal for playback debugging.
- Every remembered server hostname from ServerRegistry is registered
  with the redactor and replaced even when it appears as bare text —
  known-string matching avoids the false positives a generic domain
  regex would hit (bundle ids, file names).
- Email addresses are redacted, and username/login/email key-values
  join the token key-value redaction (= and : separators).

Verified on a live report: zero domain occurrences in the bundle,
hashed tokens in place, loopback URLs intact.

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

* fix(diagnostics): address PR #96 review findings

- Move DiagnosticsSHA256 into its own file so the SiloTVTopShelf target
  (which compiles the logging/redaction slice) links DiagLog.hostToken
- Refresh the stored manifest consent notice_version at upload time so a
  report captured under an older notice isn't rejected as stale_consent forever
- Classify too_large uploads as a permanent local failure (new report state)
  instead of retrying the same oversized bundle indefinitely
- Preserve crash capture when the status refresh is offline by falling back to
  the last-known-good status/binding (in-memory, then persisted per server)
- Gate persistent capture for child profiles, mirroring the prompt policy
- Filter breadcrumbs.jsonl to the crashed run's lines for abnormal-exit reports
- Snapshot logs at capture time and prefer the frozen snapshot when building an
  old crash/hang/abnormal-exit bundle (manual reports still use the live ring)
- Distinguish a token rotation from a real identity change by comparing the
  server id + account id rather than raw access-token fingerprints
- Skip reports marked needsServerUpdate/tooLarge in auto-upload and prompting
- Scope recorded playback session IDs to the active binding so another
  server/account's sessions can't leak into a report bound elsewhere
- Truncate MetricKit stack_excerpt by UTF-8 bytes, not characters
- Drop the redundant named-keys frame traversal that duplicated stack frames
- Note the MetricKit delivery-time binding limitation at the capture site
- Hold BreadcrumbJournal's lock across readAll() so reads can't race rotation
- Disable decline/delete buttons while the view model isWorking (iOS + tvOS)
- Register the legacy host for redaction during ServerRegistry migration
- Serialize ExitSentinel.captureEnabled writes with its lock via setCaptureEnabled
- Coalesce overlapping foreground refreshes in DiagnosticsViewModel
- Gate verbose 1 Hz [CMP-DIAG] player traces behind the Debug Logging toggle
- Tests: use failable String(bytes:encoding:) and XCTUnwrap in redaction tests;
  add focused tests for consent refresh, permanent-failure state, session
  scoping, and byte-safe stack truncation

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

* fix(diagnostics): address round-2 review findings on PR #96

- Clear cached/persisted status and breadcrumb consent context when purging
  a signed-out binding, so a later capture can't recreate default-Ask consent
  and resume diagnostics for the old account (#1)
- Gate persistent capture on server availability, not just consent != Never,
  so a disabled/storage-unavailable server never stores crash reports (#2)
- Persist the binding (and profile) in abnormal-exit markers and attribute the
  report to it; drop markers whose account no longer matches, keeping legacy
  markers' best-effort behavior (#3)
- Default breadcrumb capture to disabled until stored consent loads, bootstrapping
  from the last-known status so a Never account's fresh launch writes nothing (#4)
- Treat a status-refresh failure during upload as retryable instead of a
  destination mismatch (wrong message + 24h retry suppression) (#5)
- Suppress declined prompts for the report's lifetime via a per-report flag;
  declined reports stay manually sendable but never re-prompt or auto-upload (#6)

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

* fix(diagnostics): address round-3 review findings on PR #96

- DiagnosticsCoordinator: drop abnormal-exit markers captured under a
  child profile by re-checking the marker's own profile at capture, not
  just the profile active now (an unknown status keeps the marker for a
  later retry).
- DiagnosticsCoordinator: rotate the breadcrumb journal when the active
  server/account binding changes mid-run so a new binding can't bundle
  the previous one's breadcrumbs; the first establish of a launch still
  keeps the prior run's trail for abnormal-exit capture.
- DiagnosticsCoordinator: restrict the last-known-status offline fallback
  to genuine network/status failures; identityChanged (signed out / no
  token) and missing-account no longer capture against a stale binding.
- DiagnosticsCoordinator: gate breadcrumb capture on server availability
  so disabled/storage_unavailable status no longer arms capture,
  consistent with the persistent-capture gate.
- DiagnosticsCoordinator: fail closed when the active profile's child
  status can't be resolved during persistent capture (getProfiles()
  failed offline) instead of proceeding.
- PendingReportStore: refresh consent.mode as well as notice_version from
  the current consent record at upload so a demoted Always->Ask report
  can't still claim mode=always (manual reports stay manual).
- MetricKitCapture: cap crash.summary to 8192 UTF-8 bytes after prefixing
  the first frame, reusing the byte-safe truncation.
- DiagLog: redact HTTPClient's camelCase/wrapper header forms harvested
  from OSLog (profileId=, auth(...), profileToken(...), accessToken /
  refreshToken key-values).

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

* fix(diagnostics): address round-4 review findings on PR #96

- Restrict the offline capture fallback to genuinely transient failures:
  only network/offline errors and 5xx server errors fall back to the
  last-known snapshot; auth/permission (401/403), missing endpoint (404),
  other 4xx, malformed responses, and identity-level errors now fail closed
  so a capture is never queued against a signed-out or unavailable binding.
- Back-fill the tvOS exit-sentinel marker binding the moment diagnostics
  first resolves it (coordinator refresh completion), not only on a later
  foreground, so a first-run crash before any status refresh is still
  attributed to the right account instead of a legacy/unbound marker.
- Re-verify the active destination immediately before posting a diagnostics
  bundle; the bundle build (OSLog harvest + gzip) can outlast an account
  switch, and a same-server switch keeps server_instance_id, so keep the
  report retryable rather than upload it to the newly active account.
- Drop the access-token fingerprint from the view model's RuntimeIdentity so
  a transparent token refresh during load() is no longer misread as an
  identity change and reset(); the stable identity is server registry id plus
  profile id, with sign-out still detected via token presence and generation.
- Always run the registry-wide diagnostics purge on sign-out (it clears
  reports/consent under older server_instance_ids for the same URL); the
  current-binding purge only skips its own duplicate work, never the
  registry-wide purge.
- Gate uploads on the captured profile: the server rejects an upload whose
  X-Profile-Id header (the currently active profile) disagrees with the
  manifest's report.profile_id (HTTP 400 profile_mismatch). Hold a report
  captured under another profile as retryable — before the bundle build and
  again right before the POST — so it uploads next time the capturing profile
  is active, mirroring the server's resolveProfileID trim-and-compare rule.

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

* fix(diagnostics): address round-5 review findings on PR #96

- DiagnosticsCoordinator: verify a *stable* destination identity (server
  registry id + selected profile, plus a token-presence sign-out check)
  before posting a bundle, not the access-token value. A transparent token
  refresh during buildBundle no longer trips the pre-POST check and defers
  the Always-path auto-upload for 24h; a genuine same-server account switch
  still fails closed (it clears the token and lands on a different profile).
- DiagLog/LogRing: clear the process-wide log ring when the active
  diagnostics binding changes, mirroring the breadcrumb-journal purge at the
  same trigger, so a new binding's manual report or crash snapshot can't
  include the previous binding's CMP/playback log lines. Adds LogRing.clear().
- DiagnosticsCoordinator: re-evaluate the breadcrumb gate on profile change
  (and status refresh) so an adult->child profile switch disarms breadcrumb
  and exit-sentinel capture, consistent with the persistent-capture child
  gate; fails closed immediately on switch until the async child check lands.
- PlaybackSessionBridge: gate RecentSessionTracker recording on the same
  capture-enabled signal (isDiagnosticsCaptureEnabled) as breadcrumbs, so
  session IDs aren't accumulated while collection is off (Never / disabled /
  storage-unavailable) and later surfaced in a report after re-enable.
- DiagLog.replaceKnownHosts: rewrite as a single forward pass that never
  rescans replaced output, fixing an infinite loop when a registered host is
  a substring of its replacement token (e.g. "host" vs "[host:...]"). Adds a
  pathological-host regression test plus a LogRing.clear() test.

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

* fix(diagnostics): address round-6 review findings on PR #96

- AuthService: move diagnostics profile invalidation into the profileId
  setter (and the ServerRegistry switchTo/remove profile-restore paths) so
  every active-profile change fails the breadcrumb/session/exit-sentinel gate
  closed, not just the selectProfile path.
- DiagnosticsConsentStore: purge the tvOS ExitSentinel marker when Crash
  Reports is set to Never, so an armed marker can't later surface as an
  abnormal-exit report after collection was turned off.
- ExitSentinel: preserve an unclean previous run's marker in a distinct
  leftover slot before arming the current run, so a crash marker survives a
  failed captureLeftoverIfNeeded and a subsequent background/terminate;
  decode stays backward-compatible. Extracted ExitSentinelMarkerStore for
  the (now unit-tested) slot bookkeeping.
- MetricKitCapture: filter attached breadcrumbs to the payload's reporting
  window (with margin) so post-incident/relaunch and older-segment lines
  don't ride along with a crash/hang report.
- Tests: leftover-preservation round-trip and breadcrumb-window filtering.

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

* fix(diagnostics): address PR review feedback

* fix(diagnostics): address automated review follow-ups

* fix(diagnostics): close evidence isolation gaps

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Quick104 added a commit to zenjabba/silo-apple that referenced this pull request Sep 22, 2026
AetherEngine Silo-Server#2 merged as ec969b73. The merge also brings in
AetherEngine 7.13.0, which requires FFmpegBuild 3.4.0.

Package.resolved now differs from main only in those two entries. The
previous resolve had replaced swift-issue-reporting 2.1.0 with
xctest-dynamic-overlay 1.13.1; that entry is back to main's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104 added a commit that referenced this pull request Sep 22, 2026
)

* fix(playback): keep HLS playback running through token refresh

* fix(playback): start refresh backoff after completion

* fix(playback): refresh subtitle and font credentials in place

* fix(playback): pin AetherEngine sidecar decode fix

Pin AetherEngine 241dff50, which runs sidecar decoding off the cooperative pool so authorized subtitle requests cannot starve their resolvers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(playback): pin the merged AetherEngine credential refresh

AetherEngine #2 merged as ec969b73. The merge also brings in
AetherEngine 7.13.0, which requires FFmpegBuild 3.4.0.

Package.resolved now differs from main only in those two entries. The
previous resolve had replaced swift-issue-reporting 2.1.0 with
xctest-dynamic-overlay 1.13.1; that entry is back to main's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(licenses): cite the merged AetherEngine and FFmpegBuild 3.4.0

The shipped-source notices named AetherEngine 241dff50 on upstream 7.1.0
and FFmpegBuild 3.3.0. The app now links AetherEngine ec969b73, upstream
7.13.0 plus Silo patches, and FFmpegBuild 3.4.0. FFmpegBuild's component
tags (FFmpeg n8.1.2, dav1d 1.5.4, zimg 3.0.6, libzvbi 0.2.45) are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: zenjabba <[email protected]>
Co-authored-by: Quick104 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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