feat(launch): flip to the gateless launch (#151)
CI / ci (push) Canceled after 0s
CI / ci (push) Canceled after 0s
Wayfinder map #148's terminal slice (decisions #150 architecture, #149 UX variant A): every launch now opens straight into the workspace. The engine check (hermes acp --check) runs async from ContentView.task via AppGateState.startLaunchCheck — provisioning (x3 profiles) and the daily backup auto-fire the moment it passes (the gate era's exact onEnginePass chain, moved verbatim; once per app-launch, first window only, no-op under hosted tests). Nothing blocks: the blocking gate sheet, the placeholder logo screen, gateRaised/gateDismissed, EngineGateView, and the ProvisioningFailureCard sheet are deleted (net -350 lines with the additions). Engine state stays visible instead of interrupting: a 44x44 rail pill above Archive (8pt pulsing accent dot while checking, warning glyph on an accent-12% wash when failed, nothing at all once healthy — the slot collapses and the rail spacing closes) and mono-10 mentor-pane header states (checking... / engine missing / setup failed / hermes <base> once ready — the BASE version, never the gate's derived string; session chip renders only once ready). Failure auto-expands an anchored floating card (340pt, accent border — floats, never blocks): engine-missing carries #40's install steps with the gateless correction plus Copy, guide link, Re-check (disabled-while-checking), stderr + probed path; provisioning failure rides the same card (failing profile named, Retry inline). Focus mode recesses the card with the rail. Panes spawn the engine the moment the check lands (.task(id: binaryPath) on the nil->value arrival; a nil binary never calls openSession — that path lands the crash card). state.json semantics unchanged (About still reads it); #38's no-silent-degradation AC survives, carried by the pill. New GatelessLaunchTests pin the seam (hosted-test no-op, chain armed, pill + mentor-header visibility mappings — flip-verified); EngineGateTests byte-untouched and green; the dead deferFailure (#48's Not-Now) deleted with its test. PRD G1 amended; gateless DOX pass (Museion/AGENTS.md engine section rewritten); CHANGELOG; devlog. The #149 prototype ships lint-clean. Verified: full-scheme test 582 passed / 0 failed / 0 skipped (xcresult executed count, unit + UI), swiftformat lint clean, swiftlint 0 errors on touched files, finish-audit fanout clean (ponytail/security/general; 5 fixes applied, header-mapping pins flip-discriminated and restored). Closes #151 Closes #139
This commit is contained in:
1 parent
4065c31ec8
commit
55eff3a754
19 files changed
+1721
-384
No files matched your search
@@ -16,6 +16,10 @@ struct MentorPaneView: View {
|
||||
@Environment(\.openWindow) private var openWindow
|
||||
/// Set post-gate by ContentView: the probe's winning binary (no re-probe).
|
||||
var binaryPath: String?
|
||||
/// #151: the app-scoped gate — the header's engine states read the
|
||||
/// gate's phase machine (nil = previews; the pane then derives from
|
||||
/// the mentor model alone).
|
||||
var gate: AppGateState?
|
||||
/// #24 (S3.1): app-scoped Posts state for the pass bar (nil = no pass
|
||||
/// surface, previews).
|
||||
var posts: PostsModel?
|
||||
@@ -36,12 +40,14 @@ struct MentorPaneView: View {
|
||||
init(
|
||||
model: MentorSessionModel,
|
||||
binaryPath: String?,
|
||||
gate: AppGateState? = nil,
|
||||
posts: PostsModel? = nil,
|
||||
home: URL? = nil,
|
||||
onOpenSettings: (() -> Void)? = nil,
|
||||
) {
|
||||
_model = State(initialValue: model)
|
||||
self.binaryPath = binaryPath
|
||||
self.gate = gate
|
||||
self.posts = posts
|
||||
self.home = home
|
||||
self.onOpenSettings = onOpenSettings
|
||||
@@ -53,8 +59,27 @@ struct MentorPaneView: View {
|
||||
Divider()
|
||||
switch model.phase {
|
||||
case .idle, .starting:
|
||||
ProgressView("Starting the mentor engine…")
|
||||
if case .fail? = gate?.gateModel.phase {
|
||||
// #151: the gateless check answered "no engine" — an
|
||||
// eternal "Starting…" spinner would lie. The rail card
|
||||
// carries the install steps.
|
||||
VStack(spacing: 10) {
|
||||
Image(systemName: "exclamationmark.triangle.fill")
|
||||
.font(.system(size: 24))
|
||||
.foregroundStyle(DesignTokens.accent)
|
||||
Text("The Hermes engine is missing")
|
||||
.font(.system(size: 14, weight: .semibold, design: DesignTokens.serif))
|
||||
Text("Install steps are one click away at the rail's status icon — the editor keeps working.")
|
||||
.font(.system(size: 12))
|
||||
.foregroundStyle(DesignTokens.muted)
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(.horizontal, 24)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
} else {
|
||||
ProgressView("Starting the mentor engine…")
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
case .ready:
|
||||
modePicker
|
||||
if let kind = passKind {
|
||||
@@ -90,20 +115,28 @@ struct MentorPaneView: View {
|
||||
}
|
||||
// #17: the pane lives in the workspace's fixed 356pt mentor column —
|
||||
// no root min frame (it was the full-window M0 surface).
|
||||
.task {
|
||||
// #151: keyed on binaryPath — the gateless check lands AFTER the
|
||||
// pane mounts, so re-seeding rides the nil→value arrival and the
|
||||
// engine spawns the moment the check passes.
|
||||
.task(id: binaryPath) {
|
||||
// #28 review: an honest if-let — the ?? self-assignment was a no-op.
|
||||
if let binaryPath {
|
||||
model.binaryPath = binaryPath
|
||||
}
|
||||
// #137: the Run Pass posture over the pass profiles' keys —
|
||||
// a no-op without a binaryPath; pane re-entry re-fires this
|
||||
// task, so a key added in Settings re-enables Run Pass.
|
||||
// a no-op without a binaryPath; every re-fire of this task
|
||||
// re-runs it, so a key added in Settings re-enables Run Pass.
|
||||
await model.refreshPassReadiness()
|
||||
// Hosted unit tests run this app as their runner — never spawn a
|
||||
// real engine child there (it outlives the test session and kills
|
||||
// the runner).
|
||||
guard ProcessInfo.processInfo.environment["XCTestConfigurationFilePath"] == nil else { return }
|
||||
await model.openSession()
|
||||
// #151: openSession with a nil binary would land the crash
|
||||
// card ("no engine binary path available") — the honest
|
||||
// missing-engine states own the no-binary interim.
|
||||
if binaryPath != nil {
|
||||
await model.openSession()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,20 +148,14 @@ struct MentorPaneView: View {
|
||||
.foregroundStyle(.secondary)
|
||||
Text("Mentor Session")
|
||||
.font(.headline)
|
||||
if let version = model.engineVersion {
|
||||
Text(version)
|
||||
.font(.caption)
|
||||
.foregroundStyle(.tertiary)
|
||||
}
|
||||
if let note = model.versionNote {
|
||||
Text(note)
|
||||
.font(.caption)
|
||||
.foregroundStyle(.orange)
|
||||
.help(note)
|
||||
}
|
||||
.fixedSize()
|
||||
MentorEngineStatus(gate: gate, model: model)
|
||||
Spacer()
|
||||
// #137: the transient pass transcript carries no session id — the
|
||||
// chip stays hidden while a pass run owns the active surface.
|
||||
// #151: renders only once ready — no live session exists while
|
||||
// the engine is missing or checking (#149); status text wins
|
||||
// layout priority.
|
||||
if case .ready = model.phase, let sessionId = model.activeEntry?.sessionId, sessionId != MentorSessionModel.passTranscriptKey {
|
||||
Text("session \(sessionId.prefix(8))")
|
||||
.font(.caption2)
|
||||
|
||||
Reference in new issue
Block a user