Skip to content

[feature] RC: preserve a QR handoff across Aether Code sign-in #225

Closed

Description

@AetherAI3

Gap

The browser redeems a QR grant only when already signed in. On a fresh phone, /rc?grant=...&device_id=... shows a sign-in link whose canonical return is plain /rc; the one-time handoff is lost before redemption. The source-candidate phone journey is therefore incomplete.

Evidence: authenticated-only redemption, plain return URL, sign-in link.

Acceptance

  • A valid fresh-browser QR scan can sign in to the same Aether account, redeem once, and arrive at the correct viewer session.
  • The grant is removed from address/history promptly and never placed in analytics, localStorage bearer state, an open redirect, or a reusable session URL.
  • Foreign, expired, consumed, malformed, and duplicate-query grants fail with one indistinguishable safe message and a fresh-QR recovery step.
  • Browser integration tests cover already-signed-in and first-sign-in flows on mobile width.

Scope

Aether Code web handoff behavior; no Agent CLI changes beyond the grant/QR ticket.

Activity

  1. added
    feature
    on Sep 30, 2026
  2. AetherAI3 commented on Oct 6, 2026

    @AetherAI3
    OwnerAuthor

    Evidence for closing. The handoff landed in AETHER-CLOUD #1909 (fragment grant, tab-scoped hold, consume-before-POST). AETHER-CLOUD #1930 closes the remaining gaps and adds the phone browser contract. This issue closes automatically when #1930 merges.

    Acceptance Evidence (#1930 @ 6a9aaf2)
    A fresh-browser QR scan signs in to the same account, redeems once, and lands on the correct viewer session site/tests/e2e/rc-observer-handoff.e2e.mjs, at 390 px with an iPhone 13 profile on the real https://app.aethersystems.net origin. First sign-in: exact canonical login URL, same-tab return, exactly one redemption POST, lands on /rc/<bound session>. Already signed in: one scan → one POST → bound session; Back and reload never redeem again. Also covered: sign-in finished in another tab, and a second QR opened in the same tab after a refusal; each redeems once.
    The grant leaves the address bar and history promptly, and never reaches analytics, localStorage bearer state, an open redirect, or a reusable session URL Checked on every journey. The grant never appears in:
    • any cross-origin request URL or header, Referer included
    • any decoded PostHog payload — at least one $pageview is observed, so this check is not vacuous
    • cookies or localStorage
    • the tab's navigation history (CDP)
    • history.state, where Next.js would otherwise keep it in its router tree

    The grant is gone from the tab before the POST is sent. The login link is the fixed canonical URL. A signed-out phone opening /rc/<session> gets only the sign-in prompt.
    Foreign, expired, consumed, malformed, and duplicate-query grants fail with one indistinguishable message and a fresh-QR recovery step Nine cases all render the identical role="alert" text: "This invitation can’t be opened. Ask the host for a fresh QR code: run aether rc link on the host computer, then scan the new code." The cases are foreign, server-expired, consumed, wrong device, malformed, duplicated key, query-only, query+fragment, and held past the tab window during sign-in. Cases the browser can detect itself never POST. Server cases POST once and get the server's single 404 grant not redeemable.
    Browser integration tests cover already-signed-in and first-sign-in flows on mobile width npm run test:e2e:rc (6 tests) runs in the required site CI job and is pinned by site-ci-build-contract.test.ts. No horizontal overflow at 390 px.

    Gaps fixed in #1930 that let an invitation be lost or left behind before:

    • An invitation that expired while the user was signing in was dropped with no message.
    • A query+fragment link redeemed the fragment copy.
    • A second QR opened in a tab already on /rc was ignored and stayed in the address bar.
    • Next.js kept the grant in its router state, which is saved in history.

    Runs (local only: every hosted Actions run for AETHER-CLOUD has died at startup since 2026-09-28, billing lock):

    • Regression tests failed first: 11 red against main; 4 more red before the review-round fixes.
    • Unit and page tests: 68/68 across the RC, analytics and CI-contract files. The full site suite ran 4252 tests: 4244 passed and 8 failed. All 8 failures are artifacts of this sparse Windows checkout (files outside it are missing, one filename-casing collision, one lint-test timeout on a slow disk); none involve RC code.
    • Phone browser contract: 6/6 passed in 119 s.
    • Mutation check: reverting either the expired-hold fix or the query-poisoning fix turns the browser contract red.
    • Lint: clean. Typecheck: 0 errors in changed files.

    Deployed state: production web (/api/version → f6068d61) already serves #1909's handoff. #1930 ships with the next approved site release. The live phone journey with a real sign-in is tracked in #229.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions