Skip to content

Add Inspector boot mode - #158

Merged
kyleve merged 21 commits into
mainfrom
codex/inspector-boot-mode
Aug 2, 2026
Merged

Add Inspector boot mode#158
kyleve merged 21 commits into
mainfrom
codex/inspector-boot-mode

Conversation

@kyleve

@kyleve kyleve commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a class-bound WhereApplicationRuntime boundary and select exactly one process runtime in AppDelegate
  • move the regular launch stack into RegularApplicationRuntime and add a standalone debug-only Inspector runtime that does not start normal app systems
  • replace SwiftDataInspector with the app-agnostic Inspector module for filesystem containers, persistent UserDefaults domains, and SwiftData stores
  • add protected recursive file deletion, type-preserving defaults editing/deletion, actor-isolated SwiftData row/entity deletion, and supported whole-store erase/reopen
  • add next-launch Inspector controls to Developer Tools using a dedicated defaults suite, plus updated tests, snapshots, localization, manifests, and architecture documentation

Impact

Developers can latch Inspector mode from the in-app developer menu, relaunch into a completely separate UI/runtime, inspect or remove persisted app data, and select the regular application for the following launch. Release builds always construct the regular runtime and never read the Inspector boot preference.

Filesystem deletion protects configured roots and live SwiftData store families. SwiftData contexts and models remain confined to one actor; UI state receives only sendable snapshots and persistent identifiers.

Unreadable SwiftData sources remain visible in a degraded state and can be erased through a confirmed recovery action. Recovery removes the complete configured SQLite family plus exact app-declared auxiliary storage. Where declares Periscope's crash-journal directory, preventing deleted logs from being replayed into or delaying publication of the replacement store. The request is repeated before the next runtime is constructed, and legacy pending requests remain decodable.

Device-backed diagnosis

A read-only inspection of the connected device found a healthy active Periscope database in the app-group Application Support directory (PRAGMA quick_check returned ok, with 176 sessions and 4,056 events). That exposed two separate integration bugs:

  • Inspector declared Periscope's containment root as app-private Application Support even though SwiftData resolved the exact store into the app group. Recovery now derives its root from the adapter's live store URL and includes SwiftData's hidden configuration-named support family (for example .Periscope_SUPPORT).
  • the developer menu hid Logs until an asynchronously opened store appeared through nested computed state. WhereModel now publishes explicit opening, ready, unavailable, and failed states for the active scope. Logs is always present and shows the exact opening failure instead of disappearing.

The publication path also handles a fast open/failure that completes before the scope is installed, and ignores late callbacks from a scope shadowed by demo mode.

Main integration

Merged the latest origin/main, including the new Flyover developer browser. Flyover remains available from Developer Tools and retains its catalog/world architecture. Its embedded live-session SwiftData destination was intentionally omitted because this change moves SwiftData inspection behind the separate boot runtime and removes the live WhereSession container seam.

Validation

  • ./sync-agents
  • ./ide --no-open
  • ./swiftformat --lint
  • ./xcstrings --lint
  • ./test InspectorTests — 63 passed
  • ./test WhereTests — 12 passed
  • ./test WhereUITests — passed
  • ./test PeriscopeCoreTests — 308 passed
  • ./test --all — 1,575 passed
  • changed Inspector and Developer Tools snapshot suites pass
  • swift run bumper config .
  • swift run bumper test . — 15 passed
  • swift run bumper lint . --timings
  • ./attribution --check
  • git diff --check

Snapshot notes: all changed references pass. The untouched ResolutionView iPhone/iPad accessibility references and the newly merged, otherwise untouched Flyover canvas references mismatch under the local Xcode 27 simulator; those unrelated references were not rewritten.

@kyleve
kyleve marked this pull request as ready for review July 30, 2026 22:35
kyleve added 9 commits July 30, 2026 16:01
…mode

# Conflicts:
#	Package.swift
#	Project.swift
#	Where/WhereUI/AGENTS.md
#	Where/WhereUI/README.md
#	Where/WhereUI/SnapshotTests/__Snapshots__/DeveloperToolsViewSnapshotTests/developerTools.Default_iPhone.png
#	Where/WhereUI/SnapshotTests/__Snapshots__/DeveloperToolsViewSnapshotTests/developerTools.Default_iPhone_dark.png
#	Where/WhereUI/Sources/Developer/DeveloperToolsView.swift
…mode

# Conflicts:
#	Where/TODOs.md
#	Where/WhereUI/SnapshotTests/__Snapshots__/DeveloperToolsViewSnapshotTests/developerTools.Default_iPhone.png
#	Where/WhereUI/SnapshotTests/__Snapshots__/DeveloperToolsViewSnapshotTests/developerTools.Default_iPhone_dark.png
#	Where/WhereUI/Sources/Developer/DeveloperToolsView.swift
#	Where/WhereUI/Sources/Resources/Localizable.xcstrings
…mode

# Conflicts:
#	Shared/SwiftDataInspector/SnapshotTests/__Snapshots__/SwiftDataInspectorSnapshotTests/swiftDataInspector.SwiftDataInspector_iPhone.png
application _: UIApplication,
options _: [UIApplication.LaunchOptionsKey: Any]?,
) -> Bool {
AppDependencyManager.shared

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Verify this is exactly the same as before.

@kyleve
kyleve merged commit a483479 into main Aug 2, 2026
3 of 4 checks passed
cursor Bot pushed a commit that referenced this pull request Aug 9, 2026
…026)

The report was six weeks stale in every measured claim: 14 SPM targets (now
20), ~359/198 files (now 623/337), a SwiftDataInspector module that has been
called Inspector since #158, 'eight TODOs.md' (now 13), and seven modules it
never mentioned at all -- Inspector, Flyover, LifecycleKitUI, CreditKit,
SnapshotKit, SnapshotKitTesting, and both Ledger targets.

Rewritten from what the TODOs.md files now say, after this pass re-verified
them. Header records that this is a two-week diff, because the August 2 pass
was closed unmerged and nothing it found reached main.

Removed two stale high findings the source contradicts: the tracking-toggle
race (closed 2026-08-03, serialized behind a monotonic intent sequence) and the
LifecycleKit terminal-phase race (gone with the typed-engine rewrite).

Dropped the severity and category count tables rather than re-estimating them.
They could not be reconciled against the backlog, and the Limitations section
now says so instead of implying a census.

Rewrote the themes so none of them prescribes a fix -- the previous version
embedded 'widen the rule', 'add it to the fan-out', 'extract a ReportLoadGate'
inline, which contradicts the file's own no-actionable-items contract. The
themes now carry only synthesis no single item shows, including two findings
that only appear across items: a lint rule and its mutation test can fail
together, and re-recording a reference does not fix what it pins.

Added a Verified OK section per module, including first-audit entries for Ledger
and Flyover -- negative space has no home in a backlog, and it is the part of
this report a TODOs.md cannot carry.

Limitations now state that this VM has no Swift toolchain at all, so bumper lint
and xcstrings --lint are as unavailable as tuist, and that where the pass judged
a reference re-recorded it read the LFS pointer size rather than any pixel.

Validation: docs only. swiftformat --lint (0/1007) and attribution --check pass.
Verified root AGENTS.md's description of this file is still accurate after the
rewrite.
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