fix(fleet): compose system settings from the installed flattened home layout

The installed ~/.config/mosaic home flattens the repo's
packages/mosaic/framework/ prefix: the real file is
<home>/runtime/<harness>/settings.json, exactly as launch.ts already
resolves it everywhere. The fleet launch composition leaked the repo
layout (framework/runtime/...) into the system layer path, so a real
installed home failed with COMPOSITION_FAILED while the temp-fixture
specs (which mirrored the same wrong prefix) stayed green. Found by the
in-box hour-gate dry-run against the installed mos-dev-stage home.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dtdjx4Gxude9fwyLezCrhh
This commit is contained in:
Jason Woltje
2026-08-13 11:52:00 -05:00
co-authored by Claude Fable 5
parent 92e790ae9d
commit c16256d48c
2 changed files with 5 additions and 5 deletions
@@ -40,10 +40,10 @@ function fixture(profile: Record<string, unknown> = { schema: 1, harness: 'claud
const userHome = join(root, 'user');
const agentDir = join(userHome, 'fleet', 'agents', 'fred');
const namedBundleDir = join(userHome, 'auth', 'claude', 'fred_example.com');
mkdirSync(join(systemHome, 'framework', 'runtime', 'claude'), { recursive: true });
mkdirSync(join(systemHome, 'runtime', 'claude'), { recursive: true });
mkdirSync(agentDir, { recursive: true });
mkdirSync(namedBundleDir, { recursive: true });
writeFileSync(join(systemHome, 'framework', 'runtime', 'claude', 'settings.json'), '{}\n');
writeFileSync(join(systemHome, 'runtime', 'claude', 'settings.json'), '{}\n');
writeFileSync(join(agentDir, 'profile.json'), `${JSON.stringify(profile, null, 2)}\n`);
writeFileSync(join(namedBundleDir, '.credentials.json'), '{}\n', { mode: 0o600 });
writeFileSync(
@@ -352,7 +352,7 @@ describe('dry-run composition', () => {
env: { SEAT_FLAG: 'yes' },
});
writeFileSync(
join(fx.systemHome, 'framework', 'runtime', 'claude', 'settings.json'),
join(fx.systemHome, 'runtime', 'claude', 'settings.json'),
'{"theme":"dark","hooks":["system"],"nested":{"system":true}}\n',
);
mkdirSync(join(fx.userHome, 'config', 'claude'), { recursive: true });
@@ -376,7 +376,7 @@ describe('dry-run composition', () => {
harness: claude
seat-home: <ROOT>/user/fleet/agents/fred/.claude
settings sources:
system: <ROOT>/system/framework/runtime/claude/settings.json
system: <ROOT>/system/runtime/claude/settings.json
user: <ROOT>/user/config/claude/settings.json
agent: <ROOT>/user/fleet/agents/fred/overlay.json
output: <ROOT>/user/fleet/agents/fred/.claude/settings.json
@@ -577,7 +577,7 @@ export function resolveFleetLaunchComposition(
const layers: SettingsLayer[] = [
readSettingsLayer(
'system',
join(roots.systemHome, 'framework', 'runtime', profile.harness, 'settings.json'),
join(roots.systemHome, 'runtime', profile.harness, 'settings.json'),
true,
),
readSettingsLayer(