# Gateless launch S1: async engine check, rail pill, auto-fire — the full flip (#151) > **Date:** 2026-11-03 > **Type:** issue > **Reference:** https://git.babylondreams.de/AlexKucera/museion/issues/151 (map #148; decisions #150 architecture, #149 UX variant A; supersedes #38's blocking-sheet half; closes #139) ## Goal One interlocking slice: every launch opens straight into the workspace. The engine check (`hermes acp --check`) runs async at app start; provisioning (×3 profiles) and the daily backup auto-fire the moment it passes. Engine state stays visible without ever interrupting — a rail-bottom pill (only while checking or failed) plus mentor-pane header states. The blocking gate sheet, the placeholder logo screen, and the ProvisioningFailureCard sheet die. ## What Was Done - `AppGateState.startLaunchCheck()` (MuseionApp.swift) — arms the auto-fire chain (`wireAutoFire`, the gate era's exact `onEnginePass` body moved verbatim: provisioning → backup) then awaits `beginAutomaticCheck()`; hosted-test no-op via `XCTestConfigurationFilePath`; `hasStarted` preserves #41's once-per-launch rule. `gateRaised`/`gateDismissed` deleted. - `ContentView` — renders `WorkspaceView` unconditionally (now 25 lines); `.task { await gate.startLaunchCheck() }`. Posts scan starts at first frame via the pane's existing `.task(id: home)` — nothing library-side waits on the gate. - `EngineStatusView.swift` (new) — `EngineStatusSurface.visibility` (pure mapping: idle/pass+healthy → hidden, checking → pulse, fail AND pass+provisioning-failed → failed), `EngineStatusPill` (44×44 rail slot above Archive: 8pt pulsing accent dot / warning glyph on accent-12% wash / nothing when healthy), `EngineStatusCard` (340pt anchored fail card at railWidth+12/bottom 14, surface + accent-0.5 border + r12 + shadow, floats never blocks; engine-fail = #40 copy with the gateless subtitle + install steps + Re-check; provisioning failure rides the same card with Retry inline), `MentorEngineStatus` (the header's mono-10 states, pure `state(phase:provisioningFailed:)` mapping inside). - `WorkspaceView` — status slot in the rail's bottom group (collapses when hidden, animated), card overlay with auto-expand `.onChange(of: statusVisibility)` (chevron collapses, slot re-opens, focus mode recesses the card with the rail while the expanded state survives). - `MentorPaneView` — `gate` param; `MentorEngineStatus` beside "Mentor Session" (checking… + mini spinner / engine missing / setup failed / `hermes ` — BASE version, handshake answer first, gate's derived string `+`-stripped; drift note kept; session chip only once ready; status wins layoutPriority); `.task(id: binaryPath)` re-seeds on nil→value; honest missing-engine body branch instead of an eternal "Starting…" spinner. - `SessionsPaneView` — `.task(id: binaryPath)` (nil binary never calls openSession — that path lands the crash card); same honest missing-engine branch in the detail column. - `EngineGateView.swift` deleted (EngineGateModel + probe untouched — empty diff); `ProvisioningFailureCard` deleted with it. - Tests: `GatelessLaunchTests.swift` (new, 9 pins — hosted no-op, chain armed, 4 pill-mapping states, 3 header-mapping states incl. the outrank rule); `EngineGateTests` byte-untouched and green; the dead `deferFailure` + its Not-Now test deleted. - Records: PRD G1 amended to #150's wording; `Museion/AGENTS.md` engine section rewritten for the gateless posture (plus provisioning/backup/Workspace/Mentor cross-references); `MuseionTests/AGENTS.md`; CHANGELOG. The #149 prototype (`prototypes/GatelessStatusPrototype.swift`) lint-fixed to 0 serious (case/token renames, still compiles standalone). ## Decisions & Rationale | Decision | Rationale | |----------|-----------| | One slice, no shims | #150's owner resolution: the interlocking deletions (gateDismissed feeds the failure card; the placeholder gates the workspace) resist mid-states — every split needed a throwaway failure-visibility shim | | onPass semantics preserved, chain moved verbatim | #150: onPass fires per passing check (Re-check included); provisioning + backup idempotent so re-fires are no-ops; the exact closure body is pinned by the ticket text | | Test seam: armed/mapping pins, chain never fired under hosted tests | A fired chain writes the REAL profile roots (`~/.hermes/profiles`) and Application Support — untestable in a hosted run; the model facts (fires-per-passing-check, once-per-model) stay pinned in the untouched EngineGateTests | | Engine failure outranks lingering provisioning failure | No engine → Retry can't run anyway; the actionable card wins in pill, header, and card content alike | | openSession skipped when binaryPath is nil | `startEngine` with a nil binary lands `.crashed` ("no engine binary path available") — the gateless first frame would show a fake crash card; the honest states own the interim | | Focus mode recesses the fail card | Chrome recedes for deep work; the pill stays hover-reachable and the expanded state survives exit-focus (finish-audit finding) | | Not-Now defer dies with the sheet | Collapse is view-state; the orange pill stays until a pass succeeds — #38's no-silent-degradation carried by the pill; `deferFailure` deleted with its test after a code+tests+docs grep | ## Gotchas & Fixes | Problem | Root Cause | Fix | |---------|------------|-----| | First-frame crash card in the panes | `openSession` → `startEngine(nil)` sets `.crashed`; pre-gateless this was unreachable (panes only mounted post-pass) | `if binaryPath != nil` guards in both panes' tasks; honest missing-engine branches where the spinner would lie | | Pulse animation never starts | `repeatForever` + constant `animation(value:)` — no change ever fires the animation | State flip on `onAppear` drives it | | `startLaunchCheck` untestable under hosted tests | The guard that makes it safe also makes it unreachable; firing the real chain in a test writes real roots | Split `wireAutoFire()` (arm-only, pinned) from the guarded entry; model facts stay in EngineGateTests | | UI-test failure "Timed out while enabling automation mode" | Documented infra flake (MuseionTests/AGENTS.md), not the diff | Re-ran the UI target alone — green | | Reviewer "suite count 580 vs 579" discrepancy | Prior logs' "574" counted unit+UI; unit-only runs show N−1 | Reconciled from xcresult executed counts (0 skipped): unit 579→581, +1 UI = 582 total | | Fuzzy patch duplicated a state block / left a stray brace | Context-aware matching on a stale boundary | Re-read the region, cleaned both; build verified | ## Files Changed | File | Change Summary | |------|---------------| | `Museion/MuseionApp.swift` | startLaunchCheck/wireAutoFire; gateRaised/gateDismissed deleted | | `Museion/ContentView.swift` | unconditional WorkspaceView + launch task; placeholder/sheets dead | | `Museion/EngineGateView.swift` | deleted (fail content reborn in the pill card) | | `Museion/EngineStatusView.swift` | new — pill, anchored card, mentor header states, visibility mappings | | `Museion/WorkspaceView.swift` | rail slot + card overlay + auto-expand + focus recess; Sessions pane gate param | | `Museion/MentorPaneView.swift` | header states, `.task(id: binaryPath)`, honest missing-engine branch | | `Museion/SessionsPaneView.swift` | `.task(id: binaryPath)`, honest missing-engine branch, gate param | | `Museion/PostsPaneView.swift` | threads gate to the mentor column | | `Museion/ProfileProvisioner.swift` | `deferFailure` deleted | | `MuseionTests/GatelessLaunchTests.swift` | new — 9 pins | | `MuseionTests/ProfileProvisionerFailureTests.swift` | dead Not-Now test deleted | | `PRD.md`, `CHANGELOG.md`, `Museion/AGENTS.md`, `MuseionTests/AGENTS.md` | G1 amendment, changelog, gateless DOX pass | | `prototypes/GatelessStatusPrototype.swift` | lint-fixed to 0 serious (this session's contract artifact) | ## Open Items & Next Steps - [ ] Owner triggers: commit, push (Closes #151, Closes #139) — done by finish-up - [ ] Live dogfood of the no-engine path on a real machine (rename-the-binary drill from the session report) - [ ] Transitional copy: "Starting the mentor engine…" during the seconds-long check (deferred — header disambiguates) --- *Log written by write-log skill* *Verification cited: full-scheme `test` on the settled tree — xcresult 582 passed / 0 failed / 0 skipped (unit + UI), swiftformat lint exit 0, swiftlint 0 errors on touched files; flip-check discriminated the header-mapping pins (2 failed on their exact weakened guards, restored, re-verified green). finish-audit fanout: ponytail/security/general — 5 accepted fixes, 1 rejected with reasoning, 1 reconciled, 1 deferred.*