# Provisioning failure alert & retry UX (#48) > **Date:** 2026-09-05 > **Type:** issue > **Reference:** https://git.babylondreams.de/AlexKucera/museion/issues/48 ## Goal Ship #48 — the failure path of S2.1 provisioning on top of #47's uncommitted success path: when a provisioning pass fails (profile-create error, copy error, missing manifest entry), Museion shows a separate phase-named alert; the gate never re-raises. Retry re-runs the whole idempotent pass; Not Now defers to the next launch's silent retry. ## What Was Done - `ProvisioningModel` gained `hasFailure` + `deferFailure()` (Not Now) — ProfileProvisioner.swift. - `ProvisioningFailureCard` (EngineGateView.swift) — separate sheet: phase rawValue as title, excerpt behind Technical details, Retry + Not Now, `interactiveDismissDisabled`. - `ContentView.failurePresented` — second sheet bound to `hasFailure && gateDismissed`; `AppGateState.gateDismissed` set in the gate sheet's `onDismiss` so the failure sheet presents only after the gate sheet's dismissal *completes* (macOS can drop a sheet presented during another's dismissal animation). - Card snapshots the failure into `@State`, refreshed only on new failures — a successful Retry nils `model.lastFailure` without blanking the card mid-dismiss. - Tests (+7): stderr-fallback create excerpt, config.yaml byte-identity (pre-existing + fresh-profile), state.json engine-gate-only, copy-phase catch branch, Not-Now defer + re-fail, path-traversal rejection, orphaned-temp sweep. 30/30 green. - Audit fixes: kebab-case guard on manifest entries at the trust boundary (`isKebabCaseDirectoryName`); orphaned `.name-UUID` temp dirs swept at pass start (`sweepOrphanedTemps`); deleted the unreachable `firstAvailableBinary()` fallback; `SeedSkill` memberwise init; test suite split at SwiftLint's file-length cap into `ProfileProvisionerFailureTests.swift` with shared internal helpers (`provTempDir` avoids EngineGateTests' `tempDir` collision). - Docs: frontmatter `email` restored in fiction-craft + serif-writing; stale #13 ref fixed; pbxproj folder-reference exception documented in Museion/AGENTS.md; DOX contracts updated for the card, the guard, and the sweep. ## Decisions & Rationale | Decision | Rationale | |----------|-----------| | Failure card keyed on `gateDismissed`, not `!gateRaised` | Sheet-level `onDismiss` fires at dismissal completion; `!gateRaised` flips at start and can race a second sheet into being dropped | | Snapshot failure in card `@State` | Live read of `lastFailure` blanks the card during Retry's dismiss animation | | Kebab-case guard vs. regex blocklist | One `allSatisfy` at the trust boundary enforces the documented payload contract and kills `/`, `..`, absolute escapes in one line | | Declined: manifest → directory scan | Closed #46/#47 resolutions pin the manifest file; #48 AC5 names it | | Declined: stderr-preference excerpt | #43 documents create errors print on stdout; current order is the spec | | Declined: symlink hardening | ADR-0009 accepted same-user posture; no privilege boundary crossed | ## Gotchas & Fixes | Problem | Root Cause | Fix | |---------|------------|-----| | mcp-servers test expected `copied: 2` on retry | Failed pass copies skills *before* hitting the missing entry — partial progress is the idempotence design | Expect `copied: 0, present: 2` | | SwiftFormat/SwiftLint closure-parameter fight in ContentView | Inline `Binding(get:set:)` reflows differently per tool | Extract `failurePresented` computed property | | `defaultSkills`/helpers invisible after test-file split | `private` file scope; EngineGateTests owns `tempDir` already | Internal + `provTempDir` rename | | Subagent summaries truncated at ~400 chars in transcripts | Transcript line cap | Full outputs live in `subagent-summary-*.txt`; read those | | One reviewer died at iteration cap (API timeout on final call) | 90 s non-streaming timeout | Re-dispatched with tight scope + word cap; recovered findings from live log | ## Files Changed | File | Change Summary | |------|---------------| | `Museion/ProfileProvisioner.swift` | `hasFailure`/`deferFailure`; kebab guard; orphan sweep; fallback deleted | | `Museion/EngineGateView.swift` | `ProvisioningFailureCard` + snapshot state | | `Museion/ContentView.swift` | `failurePresented` binding + second sheet | | `Museion/MuseionApp.swift` | `gateDismissed` flag | | `MuseionTests/ProfileProvisionerTests.swift` | +5 tests; shared helpers; memberwise init | | `MuseionTests/ProfileProvisionerFailureTests.swift` | New file — failure-path suite (5 tests) | | `Museion/AGENTS.md`, `MuseionTests/AGENTS.md` | Contracts updated for #48 | | `ref/writing skills/{fiction-craft,serif-writing}/SKILL.md` | `email` frontmatter restored | ## Open Items & Next Steps - [ ] Verify the failure card by hand on a machine where `hermes profile create` errors (retry + Not Now paths) - [ ] Empty-dir create edge (crashed create leaves `museion/` dir) — declined this session; revisit if hermes documents empty-dir healing - [ ] `#23` registers museion-tools via `hermes mcp add` once the mode serves — never in provisioning (#44) --- *Log written by write-log skill*