M0: Implement provisioning pass — create museion profile & seed writing skills (S2.1) #47
Notifications
Due Date
No due date set.
Blocks
#48 M0: Provisioning failure alert & retry UX (S2.1)
AlexKucera/museion
Reference: AlexKucera/museion#47
Reference in new issue
Block a user
Parent
#13 (wayfinder map — read its Decisions so far, then each linked ticket's resolution comment)
What to build
The success path of S2.1 provisioning, fully specified by map #13 — no decisions remain. After the gate passes, provisioning creates the dedicated museion profile via the Hermes CLI as a subprocess, then seeds the bundled writing skills into the profile's skills folder. Seeding is additive only; the whole pass is idempotent and runs on every gate pass. Fires from the existing onEnginePass seam, in parallel on pass.
Spec sources:
• #43 — profile create: hermes profile create museion, non-interactive, prompt-free; re-run on an existing profile exits 1 with "already exists" on stdout — treated as success, nothing clobbered; errors go to stdout; Museion never hand-scaffolds the profile
• #46 — payload ships as a plain Resources directory (copy phase, no zip, no compiled manifest); seed-manifest.txt at the payload root (one skill-dir name per line, blank/# lines ignored; inclusion list — only listed dirs copy); per-skill atomic copy (temp name, rename into place); per-skill metadata.version frontmatter is the version stamp, bumped on meaningful content change; .DS_Store excluded
• Map Notes — 11 mentor skills ship; ste-writing and writing-for-agents stay in ref/ as authoring tools, never seeded; dir-check first, spawn only when something's missing — no has-run flag
Acceptance criteria
Blocked by
None — can start immediately.
[Generated by AI]
Resolution
Success path of S2.1 provisioning landed. Build + full test suite green: 23/23 test cases,
xcodebuild testexit 0 (12 gate + 10 provisioning + 1 UI), SwiftFormat/SwiftLint clean on all touched files.What was built
Museion/ProfileProvisioner.swift—ProfileProvisioner.perform(nonisolated, one idempotent pass): dir-check first, spawnhermes profile create museion --no-alias --no-skillsonly when missing (--no-alias/--no-skillsper the #43 research — no shell wrapper; the mentor's profile carries only the curated set, G3); exit 1 + "already exists" on stdout = success, errors read from stdout (#43). Seed phase:seed-manifest.txtinclusion list (blank/#lines ignored), per-skill dir-check, atomic copy (temp name → rename), present skills never opened/overwritten,.DS_Storepurged. One os_log line per pass with per-skill shipped versions + copied/present counts, read from the bundled payload only (#46).ProvisioningModel(@MainActor @Observable) runs it off-main, absorbs re-fires while in flight, recordslastFailure(phase-named copy + excerpt) for #48.Museion/EngineGate.swift—execute/ProcessOutputmade internal (shared child-process machinery);EngineGateModel.currentBinaryPathrecorded on pass so provisioning spawns the exact binary the gate health-checked.Museion/ContentView.swift/MuseionApp.swift—onEnginePassseam wired: firesProvisioningModel.runPassin parallel on pass;AppGateStateowns the model.Museion.xcodeproj— payload ships as a folder reference (ref/writing skills→ plainResources/writing skills/, no zip, no compiled manifest) via a PBXBuildFile entry in the app's Resources phase.ref/writing skills/seed-manifest.txt— new: the 11 mentor skills; sync contract added toref/writing skills/AGENTS.md(#46).serif-writingandfiction-craftwere missinglicense+metadata(their own AGENTS.md contract, and #46 mademetadata.versionthe version stamp) — both now carryversion: "1.0".MuseionTests/EngineGateTests.swift— timeout test margin 1 s → 3 s (ponytail comment); a zsh fake's startup can exceed 1 s under parallel-suite load, which killed the good candidate and made the test flake. Root cause is test margin, not probe code (verified in isolation).Acceptance criteria
fresh pass…+already-exists exit 1 is success…testsalready-exists…test asserts the mentor's edit survives byte-identicallater app version adds new skill…testbundled manifest matches bundled payloadtest runs against the real bundled Resources payload (11 listed dirs exist; authoring tools present but never listed;ste-writing/writing-for-agentsasserted absent from the manifest)Logger.infoper completed pass;frontmatterVersionreads the bundled copy, present skills never opened<binaryDir>/profiles/<name>convention, race-free under parallel Swift Testing)Verification:
xcodebuild -project Museion.xcodeproj -scheme Museion -destination 'platform=macOS' test→ TEST SUCCEEDED, 23 passed / 0 failed. Payload verified present in the built .app (Contents/Resources/writing skills/, 0.DS_Store). DOX updated:Museion/AGENTS.md,MuseionTests/AGENTS.md,ref/writing skills/AGENTS.md. GitNexus re-indexed (719 nodes).Follow-up for #48: the failure-path alert renders
ProvisioningModel.lastFailure— phase rawValue is the alert title, excerpt goes behind Technical details.[Generated by AI]