Skip to content

fix(app): stop hermetic tests depending on host timezone; harden mobile-verify evidence paths and device doctor - #14313

Merged
Git-on-my-level merged 3 commits into
mainfrom
task/msd-harness-z1-defect-classes
Sep 17, 2026
Merged

Git-on-my-level merged 3 commits into
mainfrom
task/msd-harness-z1-defect-classes

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

What changed and why

Hermetic Dart tests encoded the author's timezone (UTC same-day .single, wall-clock DateTime.now() as "today"), and the mobile-verify / device-doctor harness still treated relative evidence paths and missing adb/xcrun as unclassified failures after #14305's instance fixes. This PR closes those classes: local-day fixtures + package:clock, evidence dirs resolved against the invocation cwd, and missing binaries classified as remediable doctor results.

Product invariants affected

none

How it was verified

  • bash scripts/dev-harness/run-tests.sh — 288 passed, 7 skipped
  • Overlay of origin/main mobile_verify.py / device_runner.py / mobile_session.py against the new tests: 5 failed (relative --evidence-dir and env path → zero-execution; missing adb/xcrun → uncaught FileNotFoundError; device doctor --json → argparse exit 2)
  • TZ=Pacific/Kiritimati bash app/test.sh — 2016 passed, 5 skipped
  • TZ=Pacific/Pago_Pago bash app/test.sh — 2016 passed, 5 skipped
  • make mobile-verify ARGS="fast --all" (host UTC+7, no flags/env) — outcome passed, 20 executed / 20 passed. Receipt: /var/folders/3v/4wd8xf9s0z175zhynpxrt4g80000gn/T/mobile_verify_p2ccxezm/verify-receipt.json
  • TZ=Pacific/Kiritimati make mobile-verify ARGS="fast --all" — outcome passed, 20/20. Receipt: /var/folders/3v/4wd8xf9s0z175zhynpxrt4g80000gn/T/mobile_verify_xvd2k79f/verify-receipt.json
  • TZ=Pacific/Pago_Pago make mobile-verify ARGS="fast --all" — outcome passed, 20/20. Receipt: /var/folders/3v/4wd8xf9s0z175zhynpxrt4g80000gn/T/mobile_verify_rjp0sea1/verify-receipt.json
  • mobile-session device doctor with stripped PATH is covered by test_device_doctor_stripped_path_is_classified_not_a_traceback (exit 2, no traceback, iOS checks still run)

Did not add a second CI timezone workflow (package forbids new .github/workflows/ files). The entrypoint CI can call is documented in scripts/dev-harness/MOBILE_VERIFY.md (app/AGENTS.md is at its lean budget).

Tests

  • app/test/unit/search_rank_grouping_test.dart — same-day rank uses localCalendarDay; UTC pair keeps rank and bucket count follows distinct local days
  • app/test/providers/conversation_detail_provider_selection_test.dart — selectedDate defaults to clock.now() under withClock
  • app/test/support/local_day.dart — shared local-calendar constructor
  • scripts/dev-harness/tests/test_mobile_verify.py — empty/relative/absolute resolve_evidence_dir; relative --evidence-dir and OMI_VERIFY_EVIDENCE_DIR land next to the invocation, not under app/; bare fast --all uses a temp dir
  • scripts/dev-harness/tests/test_device_runner.py — raw FileNotFoundError from adb/xcrun is agent-remediable and the other platform still runs
  • scripts/dev-harness/tests/test_mobile_session.py — device doctor --json and stripped-PATH CLI doctor

Failure class (fixes)

Failure-Class: new

Failure-class transition narrative (only when needed)

FC-host-tz-calendar-in-hermetic-tests: hermetic tests/journeys must not encode the host calendar or timezone. The violated contract is "same local day" / "today" derived from UTC literals or DateTime.now(). Canonical prevention is localCalendarDay / conversationLocalDayKey, package:clock for "today", and proving bash app/test.sh plus make mobile-verify ARGS="fast --all" under TZ=Pacific/Kiritimati and TZ=Pacific/Pago_Pago. Evidence is this PR (evidence_prs is []). Harness evidence-dir and missing-binary classes stay instance/harden work on top of #14305; they do not add a second registry entry in this PR.


Part of the mobile self-driving program (Harness lane, package Z1). Implemented by Cursor cursor-grok-4.6-high. Coordinator verification on the head commit: bash scripts/dev-harness/run-tests.sh 288 passed / 7 skipped; bare make mobile-verify ARGS="fast --all" passed with a validated receipt on a UTC+7 host; TZ=Pacific/Kiritimati bash app/test.sh passed except one run of capture_recovery_replay_scenarios_test.dart "process kill mid-capture", which this PR does not touch and which passed 4 of 4 in isolation under both timezones — a load-sensitive flake on a host running five test suites at once, tracked separately.

🤖 Generated with Claude Code

Review in cubic

Git-on-my-level and others added 3 commits September 17, 2026 14:26
UTC same-day .single and DateTime.now() as "today" are only true in the
author's zone. Build same-day fixtures with local DateTime via
localCalendarDay, default selectedDate through package:clock, and
document the TZ=Pacific/{Kiritimati,Pago_Pago} entrypoint.

Failure-Class: new
Co-authored-by: Cursor <[email protected]>
#14305 caught empty OMI_VERIFY_EVIDENCE_DIR and the CLI default runner.
Relative --evidence-dir still wrote receipts under app/ (runner cwd)
while aggregation looked at the invocation cwd; AndroidTooling._run
still let FileNotFoundError escape past device_doctor. Resolve evidence
paths against the invocation directory, convert missing adb/xcrun to
DeviceRunnerError, and accept device doctor --json like the siblings.

Co-authored-by: Cursor <[email protected]>
app/AGENTS.md is already at its lean budget. The documented
TZ=Pacific/{Kiritimati,Pago_Pago} entrypoint lives in the harness
guide, which CI can call without growing agent context.

Co-authored-by: Cursor <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit 6dc90d7 into main Sep 17, 2026
41 checks passed
@Git-on-my-level
Git-on-my-level deleted the task/msd-harness-z1-defect-classes branch September 17, 2026 11:30
Git-on-my-level added a commit that referenced this pull request Sep 18, 2026
* ci(app): run the Dart suite under Kiritimati and Pago_Pago

Harness Z1 named these two TZ=... bash app/test.sh commands. The job
stays off the critical path and is expected red until PR #14313 merges.

Co-authored-by: Cursor <[email protected]>

* test(app): make surface_timer_after_dispose_test timezone-independent

ConversationDetailProvider.conversationOrNull() validates
conversationLocalDayKey(startedAt ?? createdAt) against
conversationLocalDayKey(selectedDate), which defaults to the clock at
construction. The pinned DateTime(2026, 9, 18, 9) only matched when the
runner's calendar day agreed with UTC, so the ActionItemDetailWidget test
threw StateError('No valid conversation found') under UTC+14/UTC-13 and
UTC-11 runners.

Derive createdAt from DateTime.now() minus two hours and set
selectedDate from the same instant via conversationLocalDayKey, mirroring
what ConversationDetailPage.initState does; the day-key comparison is
now tautological under any timezone and wall-clock time. Use DateTime.now()
for the MemoriesPage fixture too.

---------

Co-authored-by: Cursor <[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