Skip to content

test(ios): fix Phase 6 suite failures and add Live Activity state coverage - #119

Closed
sambitcreate wants to merge 2 commits into
mainfrom
fix/ios-phase-6-test-acceptance
Closed

sambitcreate wants to merge 2 commits into
mainfrom
fix/ios-phase-6-test-acceptance

Conversation

@sambitcreate

Copy link
Copy Markdown
Owner

Summary

  • Fixes five stale test assumptions surfaced by the bot-first Phase 6 acceptance re-run on physical device — all test-side, no app or contract changes:
    • AidenRemotePhase0Tests: assert contractRevision == 10 to match the canonical fixture
    • AidenScheduledTaskTests: normalize U+202F/NBSP so cadence assertions compare semantic labels, not locale separator glyphs
    • AidenBotPrototypeSnapshotTests: fall back to foregroundInactive/any UIWindowScene during test-launch transition instead of failing a legitimate render
    • AidenNativeIntegrationTests: use a canonical avatar_revision_… so the avatar test reaches the network-layer Cache-Control contract instead of failing closed early
    • AidenRemoteClientTests: pin the childrenLatestMessages rejection at direct decode, accept the wrapped invalidResponse at the client boundary, and wrap summaries.reversed() in Array(...) so the ordering check reaches the decoder
  • Adds AidenBotLiveActivityStateTests — 8 tests covering Live Activity identity/stale/revoked state-machine semantics without requiring a physical ActivityKit device; registered in the Xcode project and shipping allowlist
  • Records the signed physical-device acceptance evidence in docs/testing/aiden-on-the-go/bot-first-phase-6-suite-acceptance.md

Test plan

  • node --test scripts/check-ios-shipping-target.test.mjs — 13/13 pass
  • Full signed physical-device suite re-run green (evidence in the acceptance doc)
  • CI

…erage

Re-run of the bot-first Phase 6 acceptance surfaced five stale test
assumptions rather than contract regressions: the shared fixture moved
to contractRevision 10, en_US cadence labels emit U+202F before AM/PM,
the app-hosted snapshot harness required a foregroundActive scene during
launch transition, the avatar diagnostic test used a revision rejected
before the network layer, and the legacy chat-list boundary now surfaces
invalidResponse after recording the contract diagnostic. A JSON
serialization crash on ReversedCollection is also fixed.

Adds AidenBotLiveActivityStateTests covering the Live Activity
identity/stale/revoked state machine without a physical ActivityKit
device, registered in the Xcode project and shipping allowlist.
Acceptance evidence recorded in docs/testing/aiden-on-the-go.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No critical issues — small documentation fixes in the new acceptance record, plus one nitpick.

Reviewed changes

  • Live Activity state coverage — adds AidenBotLiveActivityStateTests.swift with 8 pure state-machine tests over AgentRunActivityStateReducer, AgentLiveActivityReusePolicy, AgentRunActivitySanitizer, and AgentRunElapsedTimeFormatter, registered in the Xcode test target and the shipping allowlist.
  • Phase 6 stale-test corrections — fixture revision 9 → 10, locale-whitespace normalization for cadence labels, window-scene fallback for the snapshot harness, a canonical avatar_revision_… so the avatar diagnostics contract is actually reached, and the two AidenRemoteClientTests assertion fixes (direct-decode field pin plus Array(reversed())).
  • Acceptance evidence — records the signed physical-device re-run and guard results in docs/testing/aiden-on-the-go/bot-first-phase-6-suite-acceptance.md.

I traced the new tests against the production reducer/sanitizer and checked each corrected assumption against the tree: the fixture is contractRevision: 10, the client boundary wraps decode rejections as invalidResponse (ios/AidenOnTheGo/Networking/AidenRemoteClient.swift:1817), and AidenChatSummaryPage.init(from:) enforces canonical ordering. Running node --test over the five test:ios-release scripts passes 31/31 here (shipping guard 13/13), and the Ruby policy test reports 20 runs / 42 assertions.

ℹ️ Nitpicks

  • Both new files end without a trailing newline (the diff shows \ No newline at end of file), while every sibling Swift test file and phase doc ends with one.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash | 𝕏


## Known failures fixed (test-only; security contracts preserved)

All five failures were test-side encoding of now-changed, valid semantics. No app, scene, widget, or shared source was modified.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The numbered list below has six entries (items 5 and 6 are both in AidenRemoteClientTests.swift), while this sentence and the PR description say five. Either count can be correct, but the two should agree.

Suggested change
All five failures were test-side encoding of now-changed, valid semantics. No app, scene, widget, or shared source was modified.
All six failures were test-side encoding of now-changed, valid semantics. No app, scene, widget, or shared source was modified.


```text
npm run test:ios-release
PASS — 20 Ruby runs / 42 assertions, 30 Node release-policy tests, 0 failures

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The five scripts run by test:ios-release currently register 31 tests (3 + 5 + 13 + 6 + 4 = 31), not 30 — reproduced at this head with node --test.

Suggested change
PASS — 20 Ruby runs / 42 assertions, 30 Node release-policy tests, 0 failures
PASS — 20 Ruby runs / 42 assertions, 31 Node release-policy tests, 0 failures

@sambitcreate

Copy link
Copy Markdown
Owner Author

Closing as stale during PR triage (2026-09-29). Reopen if still wanted.

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