Remove the App Group wholesale — one sandbox, one bookmark, one flag

Phase 2 of the one-app pivot (DESIGN 12 ▸ App-side state, re-ruled
2026-07-30; reworks 566deab). AppGroup retires; what remains is
AppStateHome — ordinary sandbox Application Support as the one home for
the registry, clipboard staging and template stores, keeping the
unit-test-host redirect (the test host is the app and would sweep real
state). Scalar defaults return to UserDefaults.standard.

BoardRecord's per-edition grant slots and openNow flags collapse to one
bookmark + one isOpenNow; the legacy-key decode and adopt-in-memory
paths go (nothing shipped with group-era records), while the founding
four-keys-required / defaults-for-everything-since decode policy stays —
a bookmarkless record decodes as the born-orphan row rather than
quarantining the list. needsReopen and the pre-anchored re-grant panel
are removed whole: the only state that flow served — a record granted by
a sibling sandbox — is unrepresentable now, and a dead bookmark of our
own was already the orphan case by explicit comment. The
indexOfRecord path fallback dies with it; path is never a key again.

The cross-process freshness stamp (mtime+size re-read) and
BoardEditionPresence with its popover "Also open in…" line retire; the
clipboard prune keeps its atomic .sweeping/ claim-then-delete, reframed
for crash residue and open -n copies rather than sibling editions. The
application-groups entitlement key is gone.

1880 tests in 317 suites green (13 cross-edition tests retired with
their subject).

Claude-Session: https://claude.ai/code/session_01SR4XGjmBE16ZUYWpfFHXwY
This commit is contained in:
2026-07-30 17:46:32 -04:00
parent 092300c7d2
commit 2c6b8fe63a
27 changed files with 385 additions and 1461 deletions
+10 -11
View File
@@ -19,9 +19,8 @@ import Testing
///
/// Plus the promise that makes the copy safe to run at all: a cancelled save leaves nothing behind.
///
/// Every test drives an explicit store URL. **No test may touch the real store** which since the
/// 2026-07-29 re-homing is in the shared App Group container, so it would be the sibling edition's
/// template store too. `userStore` is named here only to prove the engine never creates it on its own.
/// Every test drives an explicit store URL. **No test may touch the real store** it is the
/// developer's own. `userStore` is named here only to prove the engine never creates it on its own.
// MARK: - Helpers
@@ -439,18 +438,18 @@ struct SaveAsTemplateAtomicityTests {
@Suite("Save as Template — the user store")
struct UserTemplateStoreTests {
@Test("The user store is named beside the registry in the shared home, and is never created by naming it")
@Test("The user store is named beside the registry in the app's state home, and is never created by naming it")
func theStoreIsNamedNotCreated() {
let store = TemplateEngine.userStore
#expect(store.lastPathComponent == TemplateEngine.storeFolderName)
// Beside the registry and the clipboard's staging store, in the App Group container
// (09-templates.md Storage, re-homed 2026-07-29 templates cross editions). Compared against
// the one shared home rather than spelled out, so the assertion follows it wherever it goes
// including the scratch redirect a test host gets (`AppGroup.isUnitTestHost`). `AppGroup` rather
// than the two stores' own defaults because those are `@MainActor` and this suite is not; that
// the three agree is `AppGroupContainerTests`' assertion.
#expect(store.deletingLastPathComponent() == AppGroup.stateDirectory)
// Beside the registry and the clipboard's staging store (09-templates.md Storage;
// 02-architecture.md § Per-board app state, "App-wide state has the same home"). Compared
// against the one home rather than spelled out, so the assertion follows it wherever it goes
// including the scratch redirect a test host gets (`AppStateHome.isUnitTestHost`).
// `AppStateHome` rather than the two stores' own defaults because those are `@MainActor` and
// this suite is not; that the three agree is `AppStateHomeTests`' assertion.
#expect(store.deletingLastPathComponent() == AppStateHome.directory)
// Nothing here creates it, and no test may: `createUserStore(at:)` is Save as Template's and
// Reveal in Finder's, and both are driven with an explicit store in this suite.
}