M0: Implement Engine gate (S2.1) #42

Closed
opened 2026-09-03 13:00:56 +02:00 by AlexKucera · 1 comment
Owner

What to build

The launch engine gate, fully specified by wayfinder map #12 (closed — read its Decisions so far, then each linked ticket's resolution comment). No decisions remain; build to spec:

  • #35 — hermes CLI ground truth: probe paths, --check semantics, version via hermes acp --version
  • #36 — binary discovery: six-path probe in #35's order, one zsh -l fallback, discovery + health as one iterate-until-pass loop
  • #37 — entitlements posture (already flipped in-repo: sandbox off, ADR-0009)
  • #38 — blocking sheet, every launch, pass/fail card shapes (prototype: prototypes/GateUIPrototype.swift, throwaway reference)
  • #39 — state.json schema: written after every completed check; gate renders in-memory; About reads the file
  • #40 — fail-card copy: installer curl line, re-check loop, technical-details disclosure
  • #41 — launch sequencing: window opens immediately, async check behind a checking card, unlock at pass-card dismissal, per app-launch first window only

Provisioning itself is #13, not this ticket; this ticket fires it in parallel on pass per #41.

Acceptance criteria

[ ] Check runs on every launch, first run included, with explicit pass/fail UI
[ ] Failure state shows install instructions and offers a re-check after the writer installs Hermes
[ ] Engine version recorded in the app-support state file and shown in the gate and About
[ ] No silent degradation — the writer always knows the Engine state

[Generated by AI]

## What to build The launch engine gate, fully specified by wayfinder map #12 (closed — read its Decisions so far, then each linked ticket's resolution comment). No decisions remain; build to spec: - #35 — hermes CLI ground truth: probe paths, --check semantics, version via `hermes acp --version` - #36 — binary discovery: six-path probe in #35's order, one zsh -l fallback, discovery + health as one iterate-until-pass loop - #37 — entitlements posture (already flipped in-repo: sandbox off, ADR-0009) - #38 — blocking sheet, every launch, pass/fail card shapes (prototype: prototypes/GateUIPrototype.swift, throwaway reference) - #39 — state.json schema: written after every completed check; gate renders in-memory; About reads the file - #40 — fail-card copy: installer curl line, re-check loop, technical-details disclosure - #41 — launch sequencing: window opens immediately, async check behind a checking card, unlock at pass-card dismissal, per app-launch first window only Provisioning itself is #13, not this ticket; this ticket fires it in parallel on pass per #41. ## Acceptance criteria [ ] Check runs on every launch, first run included, with explicit pass/fail UI [ ] Failure state shows install instructions and offers a re-check after the writer installs Hermes [ ] Engine version recorded in the app-support state file and shown in the gate and About [ ] No silent degradation — the writer always knows the Engine state [Generated by AI]
AlexKucera added the ready-for-agent label 2026-09-03 13:00:56 +02:00
Author
Owner

Resolution

Shipped in 753da21 (feat(gate): add Engine gate launch check (S2.1)), built to the map's decisions with no deviations:

  • EngineGate.swift — EngineProbe runs the #36 loop: six-path absolute probe order, acp --check per candidate (stdin closed, 5 s timeout, exit-status branching, first-candidate stderr on all-fail), SIGTERM→SIGKILL + reap on timeout, acp --version on the winner (unknown on version failure — health is --check's job), one zsh -l -c last resort. state.json per #39: schemaVersion 1, wholesale replace, fail records carry no engineVersion.
  • EngineGateView.swift — the #38/#40 blocking sheet: checking card (spinner, no buttons), pass card (version + binary path + Start Writing, no re-check), fail card (#40 copy verbatim: curl line with Copy, Re-check, collapsed Technical details).
  • MuseionApp.swift — #41 sequencing: gate app-scoped via AppGateState (shared model, auto-check once per app-launch regardless of windows), About window mirrors state.json read-only (CommandGroup(replacing: .appInfo) — verified SwiftUI has no About scene on macOS 26.5). onEnginePass is the #13 provisioning seam, stubbed.

Acceptance criteria — all four met: check on every launch with explicit pass/fail UI ✅ · fail shows install instructions + Re-check ✅ · engine version in state file, gate, and About ✅ · no silent degradation (blocking sheet, stays until pass) ✅.

Verification: xcodebuild build + test green (12 unit tests driving the real Process path with fake hermes binaries, + 1 UI smoke), swiftformat/swiftlint clean, a real launch wrote {"status":"pass","engineVersion":"0.20.6","binaryPath":"/Users/alex/.local/bin/hermes"}, gitnexus detect-changes low-risk. Post-merge finish-audit (3 fresh-context reviewers) hardened it: zombie-child kill escalation, ⌘N double-check race closed, dead payload deleted. Full session log: docs/devlog/20260903-issue42-engine-gate-s2-1_log.md.

[Generated by AI]

## Resolution Shipped in 753da21 (`feat(gate): add Engine gate launch check (S2.1)`), built to the map's decisions with no deviations: - **EngineGate.swift** — `EngineProbe` runs the #36 loop: six-path absolute probe order, `acp --check` per candidate (stdin closed, 5 s timeout, exit-status branching, first-candidate stderr on all-fail), SIGTERM→SIGKILL + reap on timeout, `acp --version` on the winner (`unknown` on version failure — health is --check's job), one `zsh -l -c` last resort. `state.json` per #39: schemaVersion 1, wholesale replace, fail records carry no engineVersion. - **EngineGateView.swift** — the #38/#40 blocking sheet: checking card (spinner, no buttons), pass card (version + binary path + Start Writing, no re-check), fail card (#40 copy verbatim: curl line with Copy, Re-check, collapsed Technical details). - **MuseionApp.swift** — #41 sequencing: gate app-scoped via `AppGateState` (shared model, auto-check once per app-launch regardless of windows), About window mirrors state.json read-only (`CommandGroup(replacing: .appInfo)` — verified SwiftUI has no About scene on macOS 26.5). `onEnginePass` is the #13 provisioning seam, stubbed. **Acceptance criteria** — all four met: check on every launch with explicit pass/fail UI ✅ · fail shows install instructions + Re-check ✅ · engine version in state file, gate, and About ✅ · no silent degradation (blocking sheet, stays until pass) ✅. **Verification:** xcodebuild build + test green (12 unit tests driving the real Process path with fake hermes binaries, + 1 UI smoke), swiftformat/swiftlint clean, a real launch wrote `{"status":"pass","engineVersion":"0.20.6","binaryPath":"/Users/alex/.local/bin/hermes"}`, gitnexus detect-changes low-risk. Post-merge finish-audit (3 fresh-context reviewers) hardened it: zombie-child kill escalation, ⌘N double-check race closed, dead payload deleted. Full session log: docs/devlog/20260903-issue42-engine-gate-s2-1_log.md. [Generated by AI]
Sign in to join this conversation.