feat(fleet): update-surviving persona customization (H4) #661
Reference in New Issue
Block a user
Delete Branch "feat/h4-persona-overrides"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Implements North Star H4 — update-surviving persona customization: an override layer for personas that survives
mosaic update, a baseline⊕override resolver, and amosaic fleet personaCLI.Override layer location & merge semantics
<mosaicHome>/fleet/roles/*.md— reseeded on everymosaic update(delivers new baseline personas).<mosaicHome>/fleet/roles.local/*.md— PRESERVE-protected; wins over baseline of the same class and may add entirely new classes with no baseline.packages/mosaic/src/commands/fleet-personas.ts):resolvePersona(klass)— override file ifroles.local/defines the class (match by inline`class:`marker, filename fallback), else baseline;nullif neither.listPersonaClasses()— UNION of baseline + override classes.personaStatus()— classifies each class asbaseline/overridden/custom.DRY with #660
The inline-
class:/LIBRARY/filename extraction is now a single shared helperextractClassesFromDir()infleet-personas.ts.fleet-profiles.tsimports it; its oldlistPersonaClasses(rolesDir)is a thin delegate. Profile roster validation now resolves against the override-aware union, so a profile can reference a user-customized or user-added persona.install.sh — AC-NS-7 guarantee
Added
fleet/roles.localtoPRESERVE_PATHS:Baseline
fleet/roles/continues to reseed normally;fleet/roles.local/is excluded from rsync--delete, so user overrides survive update.CLI —
mosaic fleet persona <list|show|customize>persona list [--json]— every class with status + domain.persona show <class> [--json]— the RESOLVED persona and which layer it came from.persona customize <class>— copy baseline intoroles.local/(no-clobber if present);--newscaffolds a brand-new persona; auto-createsroles.local/.Tests (vitest)
fleet-personas.spec.ts: override-wins, custom-add, status classification, AC-NS-7 update-survival simulation (re-seed baseline roles/ while leaving roles.local/ untouched → override still wins, custom class still resolves), and fleet-profiles validation accepting an override-only persona. All 594 mosaic tests pass; typecheck + lint clean.🤖 Generated with Claude Code