Files
museion/Museion/AGENTS.md
T
AlexKucera 753da2135a
CI / ci (push) Canceled after 0s
feat(gate): add Engine gate launch check (S2.1)
Block every app launch behind an Engine gate per wayfinder map #12:
discover the user-installed hermes binary via the documented six-path
probe (#36), health-check it with acp --check (stdin closed, 5 s
per-candidate timeout, exit-status branching), version via
acp --version, and record every completed check in Application
Support state.json (#39). The gate is a blocking sheet with
checking/pass/fail cards (#38/#40), app-scoped so only the first
window per launch auto-checks (#41); an About window mirrors the
state file read-only. Provisioning (#13) has a stub seam at
onEnginePass. 12 unit tests drive the real Process path with fake
hermes binaries; build, tests, swiftformat, swiftlint all green.

Closes #42

[Generated by AI]
2026-09-03 14:53:39 +02:00

3.1 KiB
Raw Blame History

Museion (app target)

Purpose

The Museion application target: the native SwiftUI macOS app shell of the Agentic Writing Environment. Everything user-visible lives here.

Ownership

Owned by the root AGENTS.md contract. The .xcodeproj uses filesystem-synchronized groups — files on disk are the truth; add/move/delete sources here and Xcode follows. Never hand-edit project.pbxproj beyond plain build-setting values (bundle id, version, Swift version).

Local Contracts

  • Entry point: MuseionApp.swift (@main, WindowGroup scene + about window; AppGateState holds app-scoped gate state).
  • AppMetadata is the single source for the displayed app name and tagline; members are nonisolated (default-MainActor project).
  • Swift language mode 6, SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor; deployment target 26.5; bundle id com.babylondreams.Museion.
  • App Sandbox is OFF (ADR-0009) — the engine gate spawns the user-installed hermes binary and provisioning writes outside any container; hardened runtime stays ON for Developer ID notarization. No .entitlements file.
  • No persistence layer yet — the SwiftData template was stripped; vault-vs-database gets an ADR when the need is real. Exception: the engine gate's state.json (see below).
  • Tabs for indentation; SwiftFormat + SwiftLint must both stay clean.

Engine gate (launch gate, tickets #35–#41)

  • EngineGate.swift — EngineProbe (nonisolated): six-path probe order, acp --check health (stdin closed, 5 s timeout, exit-status branching), acp --version version, state.json writer/reader. EngineGateModel (@MainActor @Observable): phases for the UI, onPass seam for #13 provisioning.
  • EngineGateView.swift — blocking sheet card: checking / pass (version + Start Writing) / fail (two install steps per #40, Re-check, Technical details disclosure). interactiveDismissDisabled; sheet never closes itself.
  • state.json lives at ~/Library/Application Support/Museion/ — schemaVersion 1, wholesale-replaced after every completed check; fail records carry no engineVersion. Gate renders in-memory; About (AboutEngineView in MuseionApp.swift) reads the file and never triggers a check.
  • Gate is app-scoped via AppGateState (first window per app-launch only, ticket #41); EngineGateView.onEnginePass is where provisioning (#13) will fire in parallel on pass.
  • Tests: MuseionTests/EngineGateTests.swift builds fake hermes shell scripts and exercises the real Process path — probe order, first-stderr reporting, timeout kill, state records.

Work Guidance

  • Native SwiftUI only — no web-editor embedding, no Electron-style components (ADR-0001).
  • Text editing gets built on TextKit 2 / SwiftUI directly; no CodeMirror/ProseMirror-class dependencies.

Verification

  • xcodebuild -project Museion.xcodeproj -scheme Museion -destination 'platform=macOS' build
  • xcodebuild -project Museion.xcodeproj -scheme Museion -destination 'platform=macOS' test

Child DOX Index

  • None yet — add child docs when subdirectories with distinct responsibilities appear (e.g. editor, library, agent integration).