install.sh does not seed TOOLS.md — breaks AGENTS.md mandatory load order #457
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Problem
~/.config/mosaic/TOOLS.mdis never created during a bootstrap install, even thoughAGENTS.md(position 5 in the mandatory load order) declares it as required reading for every agent session. The installer explicitly lists TOOLS.md inPRESERVE_PATHSbut then forgets to seed it fromdefaults/— a pure oversight, not intentional.As a second-order consequence, the
mosaic claude/mosaic codex/mosaic opencode/mosaic piadapter's "read these files in order" contract points at a file that does not exist. Jason's own install on a fresh 0.0.29 machine is currently broken this way.Root cause
packages/mosaic/framework/install.shlines 228-236:Secondary issues found during investigation
packages/mosaic/src/config/file-adapter.tssyncFrameworkis too greedy. It iterates every file underframework/defaults/and copies any that don't exist — which would silently seed the Jarvis-flavoreddefaults/SOUL.md, placeholderdefaults/USER.md, and internalAUDIT-*.md/README.mdinto the user's mosaic home before the wizard's own identity stages ever run. The fix restricts seeding to an explicit whitelist:AGENTS.md,STANDARDS.md,TOOLS.md.packages/mosaic/framework/templates/TOOLS.md.templateis stale. It still references~/.config/mosaic/rails/git/...and~/.config/mosaic/rails/codex/.... Therails/tree was renamed totools/in the v1 → v2 framework migration — so any user who did runmosaic initwould end up with aTOOLS.mdthat points to non-existent paths. The fix replacesrails/withtools/in the template.preservePathsdrift between bash and TS.install.shpreservesAGENTS.md STANDARDS.md SOUL.md USER.md TOOLS.md memory sources credentialson upgrade;file-adapter.tswas only preservingSOUL.md USER.md TOOLS.md memory. The fix brings the TS list into agreement with the bash list so the two install paths have identical upgrade semantics.Fix
packages/mosaic/framework/install.sh— extend the explicit seed loop toAGENTS.md STANDARDS.md TOOLS.md.packages/mosaic/src/config/file-adapter.ts— replace the greedyreaddirSyncloop with an exportedDEFAULT_SEED_FILESwhitelist and alignpreservePathswith the bashPRESERVE_PATHS.packages/mosaic/framework/templates/TOOLS.md.template—rails/→tools/.packages/mosaic/src/config/file-adapter.test.ts(new) — 5 regression tests asserting the whitelist, the non-seeding ofSOUL.md/USER.md/README.md/AUDIT-*.md, the preservation of existing user contract files underkeepmode (includingAGENTS.md), and no-op behavior whendefaults/is missing.Affected version
@mosaicstack/mosaic0.0.29 (current). Ships in 0.0.30.Fixed in PR #458, merged as
c3f810bbon main. Framework installer now seeds~/.config/mosaic/TOOLS.mdfromdefaults/TOOLS.mdon first install, the TS wizard'ssyncFrameworkuses an explicit whitelist,preservePathsare aligned between bash and TS, and the stalerails/references inTOOLS.md.templateare replaced withtools/. Ships in@mosaicstack/mosaic0.0.30.