Skip to content

fix(review): App Store 2.1 remediation + accounts/billing plan (B0)#259

Merged
oratis merged 1 commit into
mainfrom
claude/app-store-review-login-59724a
Jul 22, 2026
Merged

fix(review): App Store 2.1 remediation + accounts/billing plan (B0)#259
oratis merged 1 commit into
mainfrom
claude/app-store-review-login-59724a

Conversation

@oratis

@oratis oratis commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Why

The 2026-07-13 rejection (Guideline 2.1, submission cb80235c) said the reviewer was unable to sign in when entering the code. Investigation found three stacked causes — all addressed here, so this can be resubmitted without waiting for the full accounts work:

  1. Settings' Cloud "Connect" was parse-only fake success — it never touched the network, so a bad/truncated token still showed "Connected to LISA Cloud." and the real 401 only surfaced in Chat.
  2. ASC's user/pass fields don't fit our paste-a-URL sign-in — the reviewer had no way to enter the "code" correctly.
  3. Bare-401 + exact-match token gate — no trim on pasted tokens, no diagnosable error.

What

  • iOS: Cloud Connect / Mac Apply-pairing / QR scan now run verifyConnection and report the real outcome (401 → actionable message; unreachable → hint). Spinner + disabled state while probing.
  • Server: cookie/query tokens are trimmed; 401 body is structured JSON (token_missing / token_mismatch / server_not_configured).
  • RELEASE.md: App Review notes rewritten — explicit "no username/password form" callout, exact paste steps, ASC field guidance (see-review-notes / token), pre-submission curl check that reproduces the reviewer's path.
  • deploy.sh: Cloud Run sizing for the account era (2 vCPU / 4 GiB, --timeout 3600 so SSE streams aren't cut). min=max=1 stays until B2.
  • docs: PLAN_ACCOUNTS_BILLING_v1.0.md (design v1.1, decisions locked) — centralized accounts as the primary flow on all surfaces, 12h $5 session quota + paid tiers, consumable IAP, inference gateway for key-free local Macs. Follow-up PRs (B1–B7) implement it.

Verification

  • npm run typecheck clean; npm test 1018 pass / 0 fail.
  • iOS simulator build (build.sh): BUILD SUCCEEDED.

Operator actions (not in this PR)

  • Re-run deploy/deploy.sh to apply the new sizing.
  • Before resubmitting: run the curl check from RELEASE.md against the live demo URL+token, update the ASC review notes + fields per the new template, and reply to the rejection in ASC.

🤖 Generated with Claude Code

…401, review-notes rewrite (B0)

The 2026-07-13 App Store rejection (Guideline 2.1, 'unable to sign in when we
entered the code') traced to three stacked causes; this lands the immediate
fixes plus the accounts/billing plan doc that the follow-up PRs implement.

- iOS Settings: Cloud 'Connect' / Mac 'Apply pairing' / QR scan now probe the
  server (verifyConnection) before declaring success — the old parse-only
  'Connected.' hid a bad token until the first Chat message.
- server: presented tokens from cookie/query are trimmed (paste artifacts);
  401 body is structured JSON (token_missing / token_mismatch /
  server_not_configured) instead of a bare 'unauthorized'.
- RELEASE.md: App Review notes rewritten — explicit 'no username/password'
  callout, exact paste steps, ASC field guidance, pre-submission curl check.
- deploy.sh: Cloud Run sizing for the account era (2 vCPU / 4Gi, timeout 3600).
- docs: PLAN_ACCOUNTS_BILLING_v1.0.md — centralized accounts as the primary
  flow, 12h session quota + paid tiers, consumable IAP, inference gateway
  (design v1.1, decisions locked).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@oratis

oratis commented Jul 22, 2026

Copy link
Copy Markdown
Owner Author

🤖 Automated review — ✅ SAFE TO MERGE

App Store 2.1 remediation (B0). Verified:

  • Removing the webToken ? … : null guard on presented is not an auth bypass: isRequestAuthorized still requires webToken && presented && timingSafeEqual for the shared-token path, and the newly-reachable verifyDeviceToken path requires a stored SHA-256 hash matched in constant time. When LISA_WEB_TOKEN is set (the demo), behavior is unchanged.
  • Structured 401 never echoes the presented token (category only). SettingsView now runs a real verifyConnection() — the actual "couldn't sign in with the code" fix. No secrets committed (placeholders).

Nits (non-blocking):

  • 401 reason (token_mismatch vs token_missing) is a mild oracle — negligible against a high-entropy LISA_WEB_TOKEN.
  • webToken isn't trimmed at load; an env token with stray whitespace becomes unmatchable (fails closed, but a config footgun) — trim at load for symmetry with the presented-token path.

@oratis
oratis merged commit d4e1771 into main Jul 22, 2026
1 check passed
oratis added a commit that referenced this pull request Jul 22, 2026
Post-merge hardening from the batch review of the accounts/billing epic
(PRs #259#272). One blocker found in review + three low-risk fixes:

- [BLOCKER, #265] Enforce StoreKit `environment` on the cloud IAP endpoint.
  Sandbox transactions are Apple-signed with the SAME cert chain as
  Production and cost the buyer $0, so /api/billing/iap accepting them =
  free real credit for anyone with a sandbox tester Apple ID. The endpoint
  now rejects any non-Production transaction in the cloud edition
  (LISA_IAP_ALLOW_SANDBOX=1 re-opts a non-prod/staging deploy back in).
  The JWS signature verification itself was already sound.
- [#263] costMicroUSD: clamp a non-finite token count (NaN/Infinity) -> 0,
  so it can't poison the usage ledger, balance.json, or the budget breaker.
- [#263] GET /api/billing/usage: on cloud, a shared-demo-token caller (no
  account) no longer reads the GLOBAL home's aggregate usage; mirrors /quota.
- [#260/#269] Session cookies gain the Secure attribute on the cloud (HTTPS)
  edition (HttpOnly + SameSite=Strict already present); local/mac http path
  is unchanged.

typecheck + full test suite (1089 pass / 0 fail) + build all green.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@oratis
oratis deleted the claude/app-store-review-login-59724a branch July 22, 2026 09:23
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