feat: add the authenticated runtime seam - #179
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟢 Approval recommended
The session-generation gating, session-expiry behavior, and runtime snapshot/redaction goals are covered by focused tests and the integration updates are consistent with the new runtime seam.
Pull request overview
This PR introduces an authenticated runtime seam (PutioRuntime) that owns the shared authenticated PutioSDK, while converting SDK models into immutable, Sendable snapshots and hardening session correctness via authentication-generation gating and 401/403 session expiry. It composes the iOS shell around the runtime so downstream browser/playback layers can depend on a safe authenticated boundary.
Changes:
- Added
PutioRuntime+ runtime snapshot models (PutioAccountSnapshot,PutioFileItem, etc.) and mapped first-page root/nested listings without exposing token-bearing URLs. - Updated
PutioSessionStoreto gate restore/sign-in/sign-out via anauthenticationGeneration, add.signingOut, and expire the session on auth rejection. - Added targeted runtime/session race tests (including gated URLProtocol fixtures) and wired the iOS shell + harness factory to construct and use
PutioRuntime.
File summaries
| File | Description |
|---|---|
| Packages/PutioCore/Tests/PutioCoreTests/PutioSessionStoreTests.swift | Updates assertions for the new account snapshot and adds coverage for restore vs. in-flight sign-in ordering. |
| Packages/PutioCore/Tests/PutioCoreTests/PutioRuntimeTests.swift | Adds comprehensive tests for request sharing, snapshot redaction, error classification, cancellation, and auth-generation races. |
| Packages/PutioCore/Sources/PutioCore/Session/PutioSessionStore.swift | Introduces authentication-generation gating, .signingOut, session expiry behavior, and snapshotting of account info. |
| Packages/PutioCore/Sources/PutioCore/Runtime/PutioRuntimeModels.swift | Adds immutable Sendable runtime-facing models for accounts, files, folder contents, and runtime errors. |
| Packages/PutioCore/Sources/PutioCore/Runtime/PutioRuntime.swift | Implements the authenticated runtime boundary, list operation, cancellation behavior, and SDK error classification + session expiry. |
| Apps/Shared/Sources/PutioRuntimeFactory.swift | Switches harness/runtime construction from a raw session store to the new PutioRuntime. |
| Apps/iOS/Sources/PutioApp.swift | Composes the iOS shell around PutioRuntime and updates UI plumbing to use session state + account snapshot. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b7375a528
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A callback without a live transaction previously advanced the authentication generation and forced signed-out state from any session state. While signed in it kicked a valid session to the sign-in screen with the keychain token left behind, and during sign-out it made the post-logout guard bail so neither path cleared the SDK token. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Second-pass review follow-up; fixes pushed to the branch. Fixed in c5b7f4e — Flagged upstream in putdotio/putio-sdk-swift#52 — the session store mutates Recorded as intentional — Verified: 42 PutioCore tests on |
Part of #123
Refs #130
Preserves #129
Summary
PutioRuntimethat privately owns the shared authenticatedPutioSDKused by session and file operations.Sendableaccount and file snapshots; expose root and nested first-page listing without credentials, cursors, or token-bearing URLs.This gives the rollout one safe authenticated boundary before file-browser UI and playback land.
Reviewer Guide
PutioRuntime.swift, thenPutioSessionStore.swiftand the gated race tests inPutioRuntimeTests.swift.Visual Aids
Validation
mise run verifysigned-inrecording scenariomise run harness -- record --platform ios --scenario signed-in --record-seconds 7ffb51a7650ec7071e1c3d3a6bd7ff3e1fa5800c5; app stdout/stderr are empty.90959c0...ffb51a7branch diff and returned clean with 0 findings.Sanity Checks
Benchmarks
N/A — this layer adds runtime contracts, not a performance-sensitive UI path.
Notes