Skip to content

SCA-486 follow-ups: cross-machine robustness and fail-closed fixes - #14305

Merged
Git-on-my-level merged 5 commits into
mainfrom
fix/sca-486-cross-machine-robustness
Sep 17, 2026
Merged

Git-on-my-level merged 5 commits into
mainfrom
fix/sca-486-cross-machine-robustness

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Summary

Cross-machine robustness follow-ups to SCA-486 (#14213), found by exercising the merged suites on a second machine (macOS, UTC+7, no Android SDK, Xcode license initially unaccepted):

  • j1 seeded journey was date-pinned. The seed fixes createdAt to 2026-09-16 while ConversationDetailProvider.selectedDate defaults to DateTime.now() and conversationOrNull validates the same local day key (conversation_detail_provider_selection_test fails on main — the different-days guard is red #10976 contract), so j1 passed only while the runner's local calendar date matched the seed and failed everywhere — hosted lane included — from 2026-09-17 UTC. Pin selectedDate to the seed's conversationLocalDayKey; the exact-identity assertion is unchanged.
  • mobile-verify fast default evidence dir was unusable. An unset/empty OMI_VERIFY_EVIDENCE_DIR resolved through Path(""), which is a truthy Path("."): the documented bare make mobile-verify ARGS="fast --all" wrote logs to the process cwd while the journey runner (cwd app/) wrote receipts to app/, so aggregation found zero receipts and every journey fail-closed as zero-execution. The temp-dir fallback is now reachable; CI survived only because it always passed --evidence-dir explicitly.
  • smoke lane timeout crashed instead of blocking. A journey hitting the timeout cap raised an unhandled TimeoutExpired after a full simulator run with no receipt; it now mirrors the fast lane (blocked, exit 2, receipt written).
  • Missing tooling binaries crashed fail-closed surfaces. A missing adb/xcrun escaped as FileNotFoundError past the DeviceRunnerError/SessionError handlers: device doctor died with a traceback before reaching its iOS checks, and simulator stop/release could abort mid-cleanup, leaking the session dir and port claim. The default runner seams now convert missing-binary to exit 127 + message; session_evidence._run_git raises EvidenceError for missing/failing git.
  • device heartbeat was documented but not wired. device_lease.heartbeat() existed with no CLI entry; added the subcommand.
  • devicectl's dashed separator row parsed as a device. The UDID/UUID regex also matched the all-dashes table separator, so device doctor offered to register a pseudo-device ------; identifiers must contain a hex digit.
  • Doc drift. PHYSICAL_DEVICES.md: acquire-before-start (the shown start <id> --platform could not parse), --json placement (after device), bundle-id typo (with-wearable). MOBILE_SESSIONS.md: quick-start omitted the required acquire.

Product invariants affected

none

Failure class (fixes)

Failure-Class: none

Test plan

  • dev-harness unit lane (run-tests.sh): 279 passed, 6 skipped — includes new regressions for the default evidence dir, missing adb/xcrun (127 + message), device heartbeat wiring, and the devicectl separator row
  • Bare make mobile-verify ARGS="fast --all --json": outcome passed, 20/20 tests, all five journeys receipted, worktree stays clean (previously: guaranteed zero-execution failure)
  • j1 direct run passes on 2026-09-17 local time (previously failed the same day)
  • mobile-session device doctor on a host without adb: agent-remediable android check + real iOS devices listed (previously a FileNotFoundError traceback)
  • iOS ruby lifecycle replay (ruby ios/test/phone_mic_lifecycle_replay_test.rb): 1 run, 7 assertions, 0 failures
  • Hosted journeys-hermetic and dev-harness lanes on this head

Review in cubic

The j1 seed pins createdAt to a fixed calendar day while
ConversationDetailProvider.selectedDate defaults to DateTime.now() and
conversationOrNull validates the same local day key (#10976 contract),
so the journey passed only while the runner's local date matched the
seed. Pin selectedDate to the seed's conversationLocalDayKey so the
journey is independent of calendar day and timezone; the exact-identity
assertion is unchanged.
…oute

fast: an unset or empty OMI_VERIFY_EVIDENCE_DIR resolved to Path("")
which is a truthy Path("."), so the documented bare 'mobile-verify
fast' entrypoint wrote logs to the process cwd while the journey runner
(cwd app/) wrote receipts to app/ — aggregation then found zero
receipts and every journey fail-closed as zero-execution. Treat an
empty env value as unset so the temp-dir fallback is reachable again.

smoke: a journey hitting the timeout cap raised an unhandled
TimeoutExpired traceback after a full simulator run with no receipt;
mirror the fast lane's handling so a timeout is a blocked outcome
(exit 2) with a written receipt.
…e missing

A missing adb/xcrun escaped as FileNotFoundError past the
DeviceRunnerError/SessionError handlers: 'device doctor' crashed with a
traceback before reaching its iOS checks (violating the fail-closed
contract that names the exact smallest step), and simulator stop/
release could abort mid-cleanup, leaking the session dir and port
claim. Convert missing-binary to exit 127 + message at the default
runner seams so tooling shims classify it as a remediable failure and
detach stays best-effort. session_evidence._run_git similarly raises
EvidenceError for missing/failing git instead of a traceback. Also wire
the documented 'device heartbeat' subcommand to device_lease.heartbeat,
which existed but had no CLI entry.
- PHYSICAL_DEVICES.md: 'start <id> --platform' is not a valid command
  and skips the mandatory acquire; show acquire-then-start. --json goes
  right after 'device'. heartbeat is now a real subcommand. Fix the
  iOS harness bundle-id typo (with-wearable, not withearable).
- MOBILE_SESSIONS.md: the quick-start omits the required 'acquire'
  before 'start'.
The UDID/UUID regex also matches devicectl's all-dashes table separator,
so 'device doctor' reported a pseudo-device named '------' and offered
to register it. Require at least one hex digit in the identifier —
every real UDID/UUID has one, the separator has none.
@Git-on-my-level
Git-on-my-level merged commit a234f6d into main Sep 17, 2026
41 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/sca-486-cross-machine-robustness branch September 17, 2026 05:25
Git-on-my-level added a commit that referenced this pull request Sep 17, 2026
…le-verify evidence paths and device doctor (#14313)

* fix(app): stop hermetic calendar tests depending on host timezone

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]>

* harden(dev-harness): classify missing device binaries and evidence paths

#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]>

* docs(app): keep the TZ second-pass contract in MOBILE_VERIFY.md

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]>

---------

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