Skip to content

fix(app): floor catch-up display math at a plausible recording time - #23494

Merged
Git-on-my-level merged 2 commits into
mainfrom
lane/catchup-1985
Oct 24, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
lane/catchup-1985

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

What changed and why

A pendant that recorded before its clock was ever set stamps audio with a decades-old epoch. The upload gate already refuses filenames before 2024-01-01, but the device Settings "Catching up" card and the On the Way page accepted any positive timer_start, so one never-set clock stretched the card's span to "Thu, Sep 5, 1985 · … – Oct 24, 2026 now" and pinned a 1985 day header on On the Way.

This applies the gate's floor to display and range math: a start before 2024-01-01 is dropped from the card's span (local WAL times and the server-provided starts it merges alike), and On the Way lists such recordings undated instead of on a bogus day. The row, its seconds and its conversation target all still count; only the bogus time is refused. Each drop logs once per source (implausible_recording_time) so a never-set device clock is diagnosable from the debug log.

Product invariants affected

none

How it was verified

  • flutter test test/widgets/device_catching_up_test.dart test/widgets/on_the_way_days_test.dart — 21 passing, including three new regression tests (1985 WAL alone keeps the card with no span; 1985 among real WALs leaves the span on the real times; pre-2024 server work keeps its card and targets without a span; no 1985 day header and the recording lists undated).
  • flutter test test/widgets/home_pending_row_test.dart — 41 passing after moving its fixtures from 1970 placeholder epochs to a pinned 2026 instant (the page now correctly reads those placeholders as never-set clocks).
  • flutter analyze on the changed files — clean.
  • Full hermetic suite via app/test.sh (CI parity) — run before push; result recorded on the PR.

Tests

  • app/test/widgets/device_catching_up_test.dart: never-set clock cannot stretch the span; alone it keeps the card without a span; pre-2024 server started_at keeps the card and its targets.
  • app/test/widgets/on_the_way_days_test.dart: a pre-2024 recording lists without a time instead of on a bogus 1985 day.

These would have caught the reported card.

UI evidence

UI-Evidence: none -- display-only clamp of text that already ships; no new surface or layout, behavior pinned by the widget tests above.

Failure class (fixes)

Failure-Class: new

Failure-class transition narrative

Declaring new: .github/failure-classes/FC-unset-device-clock-shown-as-recording-time.json is added in this PR, alongside the fix.

  • Violated contract: a surface turning a device clock value into a person-visible time must enforce the plausibility floor the boundary already enforces — the upload gate refuses pre-2024 filenames, but the Catching up card's range math and On the Way's day grouping accepted any positive value, so a never-set pendant clock rendered as "1985".
  • Canonical guard: mirror the ingestion gate's product-era floor as one named constant and apply it at every display/range computation; drop the value (row stays, seconds stay) and log once per source. A product-era floor cannot invert as time passes, unlike the recency bounds FC-hardcoded-absolute-date-bound guards against.
  • Supporting evidence: the widget tests listed above fail without the clamp.

New guards

none — the guard is a shared primitive (walTimerStartPlausible / recordingStartPlausible in offline_sync_amounts.dart), not a check or ratchet.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

Git-on-my-level and others added 2 commits October 24, 2026 15:34
A pendant that recorded before its clock was ever set reports clock
values decades in the past. Every intake path forwards them (ring
records accept any ts>0 under rtc_valid, storage listings use
file.timestamp verbatim), the upload gate already refuses filenames
before 2024-01-01, but the device's Catching up card and the On the
Way page accepted any positive timer_start — so one never-set clock
stretched the card's span to "Sep 5, 1985 - now" and pinned its own
1985 day header.

Apply the same 2024-01-01 floor in display and range math: the card's
local span, the server-provided starts it merges, and On the Way's day
grouping. Dropped times keep their row and their seconds — the range
just refuses the bogus value — and each drop logs once per source so a
never-set device clock is diagnosable from the debug log.

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

Registry definition for the class fixed in the previous commit: display
math over device clock values must enforce the same product-era floor
the upload gate enforces, or a never-set pendant clock renders as 1985.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T09:30:46.788414Z e4227cb PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: e4227cb698

ℹ️ 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 on lines +119 to +121
// A time before the plausibility floor is a device clock that was never set:
// the recording still counts, listed without a time rather than on a bogus day.
(item.start == null ? undated : items).add(item);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep undated recordings in the page totals

When a pre-2024 WAL is moved into undated, it also disappears from _Summary, which still receives only items. For example, the new regression fixture containing a valid four-minute recording and an implausibly dated three-minute recording now reports only one recording and four minutes; with only implausibly dated recordings, the summary disappears entirely. _Group also hides durations for undated rows, so their audio length is no longer visible anywhere on this page. Keep these recordings in the aggregate counts and durations while excluding only their timestamps from day grouping.

Useful? React with 👍 / 👎.

}
// A time before the plausibility floor is a device clock that was never set:
// the recording still counts, listed without a time rather than on a bogus day.
(item.start == null ? undated : items).add(item);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the recovery action for undated refused recordings

For a pre-2024 recording in an attention state, this now routes the row into the undated _Group, whose construction omits onAttentionTap. Unlike the dated group, it therefore renders the refusal chevron and button semantics with a null InkWell.onTap; a failed recording can even say “Failed — tap Retry” while tapping does nothing. Pass the same openDetails callback to the undated group so dropping an untrustworthy timestamp does not disable the recording's recovery action.

Useful? React with 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit 1c4e5dd into main Oct 24, 2026
50 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/catchup-1985 branch October 24, 2026 10:50
Git-on-my-level added a commit that referenced this pull request Oct 24, 2026
Merging origin/main brought #23494's catch-up display floor: a WAL with a
never-set device clock no longer stretches the catch-up range, so the
device_page fixture (timerStart: 1) now renders the no-range card path and
measures 3869 rebuilds / 2405 layouts, deterministically over the old
3449/2050 baseline. Verified locally: reverting only #23494's card restores
3449/2050, and plausible fixture timestamps also restore it, so the delta
is exactly that intentional production rendering, not added per-frame work
in this branch.

Re-baseline only device_page with the same initial-calibration formula
(ceil(baseline*1.1)+10): rebuilds 3804->4266, layouts 2265->2656. The
ratchet still passes (main carries no _gate caps; these remain initial
values), and the other seven scenarios measure identical to their
pre-merge baselines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Oct 24, 2026
…3419)

* test(perf): gate mobile scenarios through production app wrappers

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

* docs(perf): bind admission to INV-PERF-1

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

* test(perf): label work-count evidence and semantics rate explicitly

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

* test(perf): align the host platform and keep run evidence local

Repair the historical source link exposed by agent-doc-reference preflight.

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

* test(perf): make source adapter imports explicit

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

* test(perf): repeat release-admission scenarios in existing CI

Use three seeded CI trials per compile and three fresh processes locally.

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

* test(perf): isolate production globals and settle iOS scroll physics

Write host scorecards without a VM-service-only trace call.

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

* test(perf): settle live scrolling and reset trial input identities

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

* test(perf): keep rendering and process failures in admission evidence

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

* test(perf): use virtual host frames with real fixture I/O

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

* test(perf): cover iOS transitions with explicit virtual frame budgets

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

* test(perf): drain real fixture I/O across virtual frame boundaries

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

* test(perf): calibrate unchanged-main work-count admission caps

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

* test(perf): document measured admission floors and preserve analyzer checks

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

* docs(perf): retain the upstream historical hot-reload reference

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

* docs(perf): preserve the device guide append boundary

Keep the original budget provenance while the companion device PR appends its route.

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

* test(perf): fingerprint only the extracted production shell

--check embedded a SHA256 of all of main.dart, so any main.dart edit failed
mobile-perf-shell-fidelity and app/test.sh until the shell was regenerated.
Hash the mirrored content only (copied imports, telemetry field, builder
chain): a reintroduced app-wide wrapper such as a held ensureSemantics()
holder still turns the gate red, while unrelated main.dart edits stay
green. The drift failure still names the regenerate command.

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

* test(perf): recalibrate device_page caps after the main merge

Merging origin/main brought #23494's catch-up display floor: a WAL with a
never-set device clock no longer stretches the catch-up range, so the
device_page fixture (timerStart: 1) now renders the no-range card path and
measures 3869 rebuilds / 2405 layouts, deterministically over the old
3449/2050 baseline. Verified locally: reverting only #23494's card restores
3449/2050, and plausible fixture timestamps also restore it, so the delta
is exactly that intentional production rendering, not added per-frame work
in this branch.

Re-baseline only device_page with the same initial-calibration formula
(ceil(baseline*1.1)+10): rebuilds 3804->4266, layouts 2265->2656. The
ratchet still passes (main carries no _gate caps; these remain initial
values), and the other seven scenarios measure identical to their
pre-merge baselines.

Co-Authored-By: Claude Opus 5.5 <[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