Launch chain re-architecture — async check, auto-fire, no unlock gate #150

Closed
opened 2026-11-03 15:18:24 +01:00 by AlexKucera · 1 comment
Owner

Part of #148

Question

How does the launch chain re-architect so nothing waits on the engine check? Today ContentView renders a placeholder until currentBinaryPath exists, a blocking sheet (EngineGateView) runs the check, onEnginePass fires provisioning ×3 + backup, Start Writing dismisses, and ProvisioningFailureCard sheets afterwards. Decide:

  • the app-start check trigger and EngineGateModel's repurposing — does its phase machine become the pill's state source, and who starts the async run;
  • ContentView always rendering WorkspaceView (what the first frame shows while the check and the posts scan run);
  • the auto-fire seam replacing onEnginePass (provisioning + backup on pass, chain otherwise unchanged);
  • EngineGateView's fate — the fail-card content reborn as the pill's expanded state; AppGateState slimming (gateRaised/gateDismissed die);
  • state.json write semantics and #41's one-check-per-app-launch, first-window-only rule without a sheet;
  • mentor-pane binaryPath seeding when no gate hands it over (WorkspaceView renders before the check finishes);
  • map #12 AC amendments + the PRD G1 line ("First run gates on hermes acp --check");
  • test moves (EngineGateTests, the ContentView flow).

Resolution graduates the build slices (see the map's Not-yet-specified).

[Generated by AI]

Part of #148 ## Question How does the launch chain re-architect so nothing waits on the engine check? Today `ContentView` renders a placeholder until `currentBinaryPath` exists, a blocking sheet (`EngineGateView`) runs the check, `onEnginePass` fires provisioning ×3 + backup, Start Writing dismisses, and `ProvisioningFailureCard` sheets afterwards. Decide: - the app-start check trigger and `EngineGateModel`'s repurposing — does its phase machine become the pill's state source, and who starts the async run; - `ContentView` always rendering `WorkspaceView` (what the first frame shows while the check and the posts scan run); - the auto-fire seam replacing `onEnginePass` (provisioning + backup on pass, chain otherwise unchanged); - `EngineGateView`'s fate — the fail-card content reborn as the pill's expanded state; `AppGateState` slimming (`gateRaised`/`gateDismissed` die); - `state.json` write semantics and #41's one-check-per-app-launch, first-window-only rule without a sheet; - mentor-pane `binaryPath` seeding when no gate hands it over (WorkspaceView renders before the check finishes); - map #12 AC amendments + the PRD G1 line ("First run gates on `hermes acp --check`"); - test moves (`EngineGateTests`, the ContentView flow). Resolution graduates the build slices (see the map's Not-yet-specified). [Generated by AI]
AlexKucera added the wayfinder:grillingwayfinder:grilling labels 2026-11-03 15:18:24 +01:00
AlexKucera self-assigned this 2026-11-03 15:45:24 +01:00
Author
Owner

Resolution — architecture (grilling round 2026-11-03, owner picked one-slice)

Pinned: one build slice — Gateless launch S1: async engine check, rail pill, auto-fire — the full flip. The interlocking deletions (gateDismissed feeds ProvisioningFailureCard's presentation; the placeholder gates the workspace on the check) resist mid-states — every split needed a throwaway shim to keep failure visible between slices. Two-slice alternatives were offered and declined.

Architecture facts (folded assertions, unvetoed; the mid-round first-frame clarification is folded in verbatim)

Trigger + model

  • EngineGateModel stays as-is; its phase machine is the pill's state source — checking → pulse dot, fail → orange, pass/idle → hidden. EngineGateModel.runCheck/beginAutomaticCheck/onPass/currentBinaryPath all survive unchanged.
  • New AppGateState.startLaunchCheck(): wires gateModel.onPass to the auto-fire chain (provisioning runPass(hermesBinary:) then backup.runPass() — the exact closure body from today's ContentView.onEnginePass) and awaits beginAutomaticCheck(). Called from ContentView.task. The existing hasStarted guard preserves #41's one-check-per-app-launch, first-window-only rule without the sheet — ⌘N re-entry no-ops. onPass semantics unchanged: fires on every passing check (Re-check included); provisioning and backup are idempotent, so re-fires are no-ops (backup's 24 h age check makes a same-day re-fire a no-op too).
  • startLaunchCheck no-ops under hosted tests (XCTestConfigurationFilePath — the panes' existing guard pattern), so hosted test runs never probe or auto-provision.

First frame (clarified live: the library NEVER waits on the gate)

  • ContentView renders WorkspaceView unconditionally. The posts scan starts at first frame, concurrent with the engine check — nothing library-side waits on the gate. Today's currentBinaryPath != nil condition is the coupling this ticket kills (the workspace — and therefore the scan — could not start before the check passed). Gateless, the library fills when the scan lands even with hermes missing entirely; only Passes/Sessions are dead, and the pill names why.
  • During the scan's own short duration the library shows its existing empty state (same as a Home re-point today) — no skeleton, no spinner.
  • Placeholder logo screen, gate sheet, failurePresented binding, and both sheet modifiers die. AppGateState.gateRaised/gateDismissed die.

state.json + #41's rule

  • Unchanged: wholesale replace after every completed check (Re-check included); the About window keeps reading it. The one-per-launch rule is enforced by hasStarted, which is trigger-independent — no body change.

binaryPath seeding

  • Panes keep the param pattern (gate.gateModel.currentBinaryPath threaded through WorkspaceView), re-seeding keyed on nil→value arrival (.task(id:) or equivalent), so the mentor/sessions panes spawn the engine the moment the check lands. The header states below cover the interim.

EngineGateView's fate

  • The file's checking/pass cards die. The fail-card content is reborn as the pill's expanded state per #149's contract (geometry, states, copy — including the gateless subtitle). ProvisioningFailureCard (the sheet) is deleted; provisioning failure rides the same expanded card.

Records

  • PRD G1 line amended to: "User-installed Hermes — no app-managed install, no bundled Python. Every launch runs hermes acp --check async at app start — nothing blocks; checking and failed states surface in a rail pill." (final wording may be lightly editorialized in the slice; semantics pinned).
  • This map supersedes the blocking-sheet half of #38's variant-A decision (amendment comments posted on #12 and #38); #38's no-silent-degradation AC survives, carried by the pill.
  • Museion/AGENTS.md engine-gate section rewritten in the slice's DOX pass.

Tests

  • EngineGateTests probe/model tests stay untouched (they construct models with injected paths — no dependency on the deleted views). New pins: startLaunchCheck (auto-fire chain fires per passing check, hosted-test no-op, repeat-call no-op) and pill visibility mapping (idle/pass → hidden, checking → pulse, fail → orange + expanded). The UITests smoke stub has no gate interaction — no UI test moves.

[Generated by AI]

## Resolution — architecture (grilling round 2026-11-03, owner picked one-slice) **Pinned: one build slice — [Gateless launch S1: async engine check, rail pill, auto-fire — the full flip](https://git.babylondreams.de/AlexKucera/museion/issues/151).** The interlocking deletions (`gateDismissed` feeds `ProvisioningFailureCard`'s presentation; the placeholder gates the workspace on the check) resist mid-states — every split needed a throwaway shim to keep failure visible between slices. Two-slice alternatives were offered and declined. ### Architecture facts (folded assertions, unvetoed; the mid-round first-frame clarification is folded in verbatim) **Trigger + model** - `EngineGateModel` stays as-is; its phase machine is the pill's state source — checking → pulse dot, fail → orange, pass/idle → hidden. `EngineGateModel.runCheck`/`beginAutomaticCheck`/`onPass`/`currentBinaryPath` all survive unchanged. - New `AppGateState.startLaunchCheck()`: wires `gateModel.onPass` to the auto-fire chain (provisioning `runPass(hermesBinary:)` then `backup.runPass()` — the exact closure body from today's `ContentView.onEnginePass`) and awaits `beginAutomaticCheck()`. Called from `ContentView.task`. The existing `hasStarted` guard preserves #41's one-check-per-app-launch, first-window-only rule without the sheet — ⌘N re-entry no-ops. `onPass` semantics unchanged: fires on every passing check (Re-check included); provisioning and backup are idempotent, so re-fires are no-ops (backup's 24 h age check makes a same-day re-fire a no-op too). - `startLaunchCheck` no-ops under hosted tests (`XCTestConfigurationFilePath` — the panes' existing guard pattern), so hosted test runs never probe or auto-provision. **First frame (clarified live: the library NEVER waits on the gate)** - `ContentView` renders `WorkspaceView` unconditionally. The posts scan starts at first frame, concurrent with the engine check — nothing library-side waits on the gate. Today's `currentBinaryPath != nil` condition is the coupling this ticket kills (the workspace — and therefore the scan — could not start before the check passed). Gateless, the library fills when the scan lands even with hermes missing entirely; only Passes/Sessions are dead, and the pill names why. - During the scan's own short duration the library shows its existing empty state (same as a Home re-point today) — no skeleton, no spinner. - Placeholder logo screen, gate sheet, `failurePresented` binding, and both sheet modifiers die. `AppGateState.gateRaised`/`gateDismissed` die. **state.json + #41's rule** - Unchanged: wholesale replace after every completed check (Re-check included); the About window keeps reading it. The one-per-launch rule is enforced by `hasStarted`, which is trigger-independent — no body change. **binaryPath seeding** - Panes keep the param pattern (`gate.gateModel.currentBinaryPath` threaded through `WorkspaceView`), re-seeding keyed on nil→value arrival (`.task(id:)` or equivalent), so the mentor/sessions panes spawn the engine the moment the check lands. The header states below cover the interim. **EngineGateView's fate** - The file's checking/pass cards die. The fail-card content is reborn as the pill's expanded state per #149's contract (geometry, states, copy — including the gateless subtitle). `ProvisioningFailureCard` (the sheet) is deleted; provisioning failure rides the same expanded card. **Records** - PRD G1 line amended to: "**User-installed Hermes** — no app-managed install, no bundled Python. Every launch runs `hermes acp --check` async at app start — nothing blocks; checking and failed states surface in a rail pill." (final wording may be lightly editorialized in the slice; semantics pinned). - This map supersedes the blocking-sheet half of #38's variant-A decision (amendment comments posted on #12 and #38); #38's no-silent-degradation AC survives, carried by the pill. - `Museion/AGENTS.md` engine-gate section rewritten in the slice's DOX pass. **Tests** - `EngineGateTests` probe/model tests stay untouched (they construct models with injected paths — no dependency on the deleted views). New pins: `startLaunchCheck` (auto-fire chain fires per passing check, hosted-test no-op, repeat-call no-op) and pill visibility mapping (idle/pass → hidden, checking → pulse, fail → orange + expanded). The UITests smoke stub has no gate interaction — no UI test moves. [Generated by AI]
Sign in to join this conversation.