This section supersedes historical transport/default and installation-gate descriptions below. Inventory, installation and verification now use libusb only; ImageCaptureCore and libmtp entry points are removed. Healthy completed upload sessions send CloseSession before host release. All helpers retain the shared DeviceLease, bounded execution/cancellation, verified exit and cross-operation fencing. Automatic install verification is limited to four reads on the sending USB registry entry; Games can be cached by sphaira, so an explicit manual read after device-side refresh can finish the batch without resending. Selected content and raw versions, not whole-library completeness, govern completion. Confirmed staged items animate out and are immediately saved out of the plan. User-authorized physical Goose Game base/update reinstall and recognition passed; package identity remains filename-derived. See release review for exact evidence and remaining public-distribution gates.
SwiftUI native macOS 26+, arm64, 03-liquid-glass.png is the selected visual reference. Sidebar and toolbar use native glass/material; content and inspector remain readable neutral surfaces. Main content 1280×820, minimum 960×640, with a fixed 320-point installation staging sidebar and an independent game-detail popover. Chinese interface, dark/light, keyboard and accessibility.
- SwitchShelfDomain: value models, evidence-based installation assessment; coordinator owns public contract.
- SwitchShelfLibrary: actor-based read-only recursive SMB/local scanning, filename candidate parsing, source bookmarks, SQLite migrations and cache. agy owns implementation and library tests.
- SwitchShelfDevice + CDBIBridge: serialized USB discovery and read-only MTP inventory access for sphaira
Gamesand DBIInstalled games; native ImageCaptureCore broker with optional libmtp fallback. Also owns sphaira-specific local installation preflight, bounded native libusb MTP streaming and the isolated, explicitly confirmed serial installation queue. Physical installation is not yet accepted. pi owns the original module; this follow-up is coordinator-owned integration. - SwitchShelfApp: SwiftUI navigation, library grid/list/search/filter, inspector, device and queue pages, root observable app model; opencode owns UI.
- Coordinator: Package.swift, shared models, app composition, build/bundle scripts, integration, review and final tests.
Existing models in Sources/SwitchShelfDomain/Models.swift are the contract. Library worker must expose:
public actor LibraryScanner: LibraryScanning {
public init()
public func scan(_ source: LibrarySource) async throws -> LibrarySnapshot
}
public actor LibraryRepository: LibraryPersisting {
public init(databaseURL: URL) throws
public func load() async throws -> LibrarySnapshot
public func save(_ snapshot: LibrarySnapshot) async throws
}
Device worker must expose:
public actor DeviceService {
public init()
public func discover() async -> DeviceDiscovery
public func readInventory() async throws -> InstalledInventory
}UI should use these services directly via a MainActor app model; independent workers may compile against temporary local stubs while implementations arrive. Domain and Package.swift changes require coordinator.
Current game source: /Volumes/switch 游戏包, SMB mounted NAS. No original-file writes. Store application state under Application Support/SwitchShelf, not NAS. Persist sources with security-scoped bookmarks when needed. Source disconnect retains previous entries and marks them offline; no wipe on failed enumeration. A complete inventory needs successful traversal of a recognized installed-content projection; missing storage or parse errors are not an empty list. MTP exposes virtual objects; do not download full NSPs for inventory. Device identity and environment remain session-scoped unless proven stable. Backend installation and MTP enumeration must never share the USB session concurrently.
SQLite is accessed through the system sqlite3 C interface in the initial dependency-free scaffold. This is a deliberate implementation choice replacing the document's candidate GRDB wrapper; keep schema migration boundaries so a wrapper can change later. Native ImageCaptureCore provides brokered PTP/MTP commands without competing with ptpcamerad for the USB interface. The coordinator verified open/GetStorageIDs/close against this Switch. If the optional libmtp route is retained, bundle its native dependencies; never require users to set up developer tooling in the final package.
- Recognized storage descriptions are exactly
Games(observed sphaira layout),Installed gamesand4: Installed games(DBI layout), ignoring case/outer whitespace. A folder named Games on an ordinary SD storage is not a source. Raw Contents, Mounts, saves, installation and DevNull are catalogued by name only, never traversed by the inventory reader. - Nested per-content objects must provide explicit Title ID, raw version and BASE/UPD/DLC tokens. Existing coverage, cancellation, depth/object/time limits and combined-projection checks also apply to Games. No human-title or parent-ID inference is introduced. A live read established that sphaira Games object info uses virtual storage
0xFFFFFFFEand the Games storage handle as top-level parent; accept that alias only within the exact Games storage, retaining strict parent checks and strict DBI/SD behavior. InstalledInventory.mtpEvidenceis an optional coordinator-owned additive contract: bounded storage descriptions, selected sources, observed game-directory/metadata-object counts and storage-only mode. Older helper JSON still decodes; helper schema remains 1. Storage labels describe capabilities, not a verified server version. Storage capacities are not used as installation evidence or console capacity.- USB candidate detection, successful MTP communication and inventory completeness are separate. A successful catalog with no game source is connected but incomplete. Rediscovery invalidates the previous inventory even if VID/PID match. The app asks the user to quit a running OpenMTP before its own inventory request; this preflight does not claim the process necessarily owns an interface. The advisory lease only coordinates SwitchShelf participants.
- ImageCaptureCore remains the default. Its ptpcamerad broker is not killed or disabled; the OpenMTP/Preview conflict observed in troubleshooting is not a system-service workaround.
The independent codex/mtp-transport-comparison branch adds an explicit libusb read-only inventory route, referencing OpenMTP's public transport architecture without copying its source or integrating libmtp. LibUSBInventoryTransport shares only the existing low-level USB link with installation; its operation allowlist contains session open/close and storage/object metadata requests, never package reads or device mutations. The isolated probe retains DeviceLease, bounded output/deadlines and positive worker-exit checks; an unverified exit fences subsequent inventory attempts even across routes. Invalid wire containers or datasets stop further requests and release the host interface.
ImageCaptureCore remains the startup default. The device page offers a session-only route selection, invalidates current-session inventory on switching, and lets the existing monitor read again. Installation is unchanged; there is no automatic route fallback, driver detach, reset or system-service stop. Prior sequential physical probes captured matching complete Games inventories (8 directories, 22 records) on both routes. This CLI evidence does not establish that the GUI's first-use macOS authorization prompt disappears. See Docs/Reports/libusb-inventory-comparison-2026-10-27.md for evidence and a manual GUI test that selects libusb before connecting the Switch.
The library's primary action is now staging games for installation. Grid cards and list rows expose two separate native buttons: the body accumulates a game into the existing persistent plan, while the top-right info control opens an independent, closable detail popover with no installation actions. That popover is anchored to the trailing edge of the opened card or row, so it sits beside that game instead of the window edge. The right-hand staging sidebar remains 320 points wide, including when empty; its start button is outside the scrolling content. Matched-geometry artwork is a derived view transition only, respecting Reduce Motion and never moving/copying source packages.
App-only defaults choose base content, all DLC and a uniquely highest explicit raw version within one update identity. Ambiguous updates require an explicit file choice or current-session omission; existing persisted selections are not rewritten. Starting from the sidebar performs existing metadata preflight and prepares the same source-fingerprinted batch review without navigating to QueueView. The left-hand “安装队列” entry is not shown; that page duplicated the staging sidebar. RootView owns the existing mandatory file/device/target confirmation sheet. Review/preparation locks plan edits and inventory monitoring. The original serial SphairaBatchInstaller and isolated helper are unchanged; USB discovery is not install readiness, device-side target selection remains authoritative, and transferred content never becomes installed without independent evidence. See Docs/Reports/install-staging-redesign-2026-10-28.md for native-event, geometry, state and safety verification.
First integrated milestone: runnable native app, real NAS scan/cache, real device detection and read-only installed inventory, conservative installation badges and a persistent editable install plan. Installation execution is a separate next wave after protocol, result semantics and an explicit test file/target are established. Maintain the original development document's remaining metadata, installation, recovery and maintenance roadmap; an attractive shell alone does not complete that scope.
The user selected sphaira MTP for both inventory and future installation; Backend is deferred, not removed. The app's local preparation now uses SphairaInstallPreflight, without importing Backend. Package.swift and existing uncommitted Backend work were preserved. The initial disabled foundation was followed by the user-requested 0.3.0 native single-file test package; the confirmation flow is enabled, not claimed as production hardware acceptance.
- Source baseline: sphaira
338348e74b6d278bc570a9be5373d25197bf6c8d, which pins R-YaTian/libhazef1c9c632b5c615eabfb29a0dab89fedf606588e4. These are reviewed upstream sources, NOT identification of the connected device's build. Install storage visibility alone does not mean installation mode is active: the user must enter MTP Install. Destination is chosen inside sphaira; local SD/NAND intent is not a host command. SphairaUploadCodecis separate from the inventory codec. The internal sender usesSendObjectPropList(0x9808, 64-bit size and filename property) then one streamingSendObject(0x100d). It never seeks, sends partial-object edits, deletes objects, formats, retries or resumes. All game records/badges remain governed by independent inventory evidence.- The sender requires same-session sphaira device-description/capability evidence and an unambiguous exact Install storage plus Games; numeric storage handles are never persisted. Its final success state means transferredAwaitingConfirmation, not installed. Lost acknowledgment, cancellation, source change and transport failure after the first write leave device state unknown. A failed release is explicit.
SphairaPackageSourcepins a read-only descriptor under an explicit source root, rejects symlinks in every component, checks inode/size/mtime/ctime and uses bounded positional reads. Preflight only inspects metadata and is not authorization. Its result must not replace execution-time source validation or reviewed file/target consent.NativeSphairaMTPuses a separate explicit-open libusb adapter, not ImageCaptureCore outData. Output header/payload are coalesced into packet-aligned bounded writes; only the final short packet or ZLP terminates the data phase. DeviceInfo, operations and storage descriptions are inspected within the same opened PTP session. There is no driver detach, reset, configuration change, fallback destination or automatic retry. Required libusb and its license ship inside the app.SphairaInstallersupervises one direct token-gatedswitchshelf-probechild; the child takes DeviceLease before physical open, validates the reviewed source fingerprint and durably records side-effect intent before sending. Parent verifies the child's actual exit after cancellation/deadline escalation; uncertain exit fences subsequent requests. A bounded progress-delivery relay cannot block the deadline loop. The child also stops if its original parent exits. An app crash leaves the attempt record unknown, not resumable or installed.- UI execution is explicitly experimental and requires a current passing preflight, a metadata-pinned review of the selected queue, a consistent target, and user confirmations of file authority/device mode/target/exclusivity/risk before any helper launch. Files are sent serially; an unconfirmed result, failed release, or unverified worker exit stops the queue. Transfer completion is not installation confirmation. Queue editing and inventory reads are blocked while sending. Raw USB access may still fail if the system broker or another client owns the interface; no service is killed. Native ownership, actual device install results and real SMB/disconnect behavior remain unverified by fixture tests.
Implementation/validation: Docs/Reports/sphaira-mtp-install-foundation-2026-10-25.md. Native follow-up: Docs/Reports/native-sphaira-mtp-2026-10-25.md. Manual test instructions: Docs/Guides/sphaira-mtp-install-test.md. The specific package/device target is still for the user to confirm; the agent ran only fixtures, packaging and app launch, not a physical installation.
The user authorized supervised Orca agents to implement USB Backend software and hardware-free tests. SwitchShelfBackend owns transport-independent framing/session logic, allowlisted range reads, preparation checks and durable transfer state; CDBIBackendUSB owns the native USB adapter. The host protocol reference is pinned to rashevskyv/dbi 22090afc64cc7b5d645a99bf3d4d8625a67b766e (dbibackend). No production UI or CLI may open a Backend transfer session in this wave. Native USB code is compiled and tested with fakes/argument checks only; actual installation requires a separately reviewed file/target test.
BackendContracts.swift is coordinator-owned for this wave. Protocol worker owns SwitchShelfBackend/Protocol; USB worker owns CDBIBackendUSB and SwitchShelfBackend/USB; UI/preflight worker owns SwitchShelfApp and SwitchShelfBackend/Preflight. A separate storage worker owns SwitchShelfBackend/FileAccess, SwitchShelfBackend/Journal and their tests. Coordinator owns the manifest, integration and final tests. Workers use separate child worktrees and must not launch further agents; the user's explicit delegation authorization applies to the coordinator.
Backend file exchange does not prove installation. Transfer outcomes are per file (notRequested, partiallyTransferred, transferredAwaitingConfirmation), and never promote a game to installed. SD/NAND selections remain local intent: the pinned host protocol does not encode a destination-setting command. Backend and MTP must not hold device sessions concurrently. No new source file reads, physical USB opens/writes, dependency installs or global settings changes are allowed in worker validation.
SwitchShelfDevice owns a separate FTP client. It is not a USB transport and does not take DeviceLease. The pinned DBI README says Run FTP server accesses SD files on port 5000 and installs files on port 6000. dbi.config at that commit sets [FTP] Port=5000 and [HTTP] Port=1234. This client opens only the file-access port, sends USER anonymous, PASS anonymous, PWD, PASV and LIST, then QUIT on disconnect. It never sends STOR, RETR or any other write. LIST text is not installed-game evidence and does not verify package identity. The first host whose session phase becomes connected is stored under SwitchShelf.wifi.firstConnectedHost and is never replaced. An absent value is not filled with a guessed address. sphaira's network menu remains the documented way to enable MTP, not this Wi-Fi path. No physical Switch FTP session has been run.
The user requested pi as the preferred development agent due to quota on 2026-10-23. The three initial Codex dispatches were explicitly stopped with their worktrees preserved. pi structured-session creation was refused by the current Orca runtime; use the documented existing-terminal supervision route if required. Agent identity and underlying model/provider are separate; do not claim a different quota pool without evidence.