✔ shared copy: npm ci, pushed reachability, readonly/existing copy, webui delegation (331.317086ms)
✔ wrapper preserves Q81 lease and marker, rejects foreign/symlink; check uses effective roots (361.272339ms)
✖ bus unit copy/pm pins, install refuses all busy states and failed reads, drop-in refusal (326.754738ms)
✔ missing package manifest refuses before npm; npm failure removes the unpublished temp copy (249.95021ms)
✔ real pinned install loads bus and Console; same-copy mosaic talk passes proof, other trees refuse (3046.416635ms)
✔ bus status reads effective copy/pm/drop-ins without writes; check refuses an overridden ExecStart (419.793583ms)
✔ drop-ins in either override field and malformed metadata refuse; uninstall also checks --no-reload (130.782047ms)
✔ install never shows a template name on systemd 261; template drop-ins still refuse (142.929511ms)
✔ unlisted instance drop-in is found in another unit lookup directory; path discovery errors refuse (128.215151ms)
ℹ tests 9
ℹ suites 0
ℹ pass 8
ℹ fail 1
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 5188.613432

✖ failing tests:

test at packages/cli/tests/stack-copy.test.mjs:60:1
✖ bus unit copy/pm pins, install refuses all busy states and failed reads, drop-in refusal (326.754738ms)
  AssertionError [ERR_ASSERTION]: The input did not match the regular expression /bus start %i --pm/. Input:
  
  '# Mosaic bus host, one instance per business: mosaic-bus@<business>.\n' +
    '# Rendered by scripts/bus-service.sh from packages/cli/systemd/; /mnt/storage/scratch/tmp/stack-copy-uMCTFz/copies/8626d2ceebeec33f705e8959b23173b0e9d382e9,\n' +
    '# /usr/local/bin:/usr/bin:/bin and the claude line below are filled in at install time. Edit the template and reinstall; do\n' +
    '# not edit the installed copy. The bus store allows one broker per data\n' +
    '# root, so run one instance per data root (packages/cli/README.md).\n' +
    '[Unit]\n' +
    'Description=Mosaic bus host (%i)\n' +
    'Documentation=file:///mnt/storage/scratch/tmp/stack-copy-uMCTFz/copies/8626d2ceebeec33f705e8959b23173b0e9d382e9/packages/cli/README.md\n' +
    'StartLimitIntervalSec=600\n' +
    'StartLimitBurst=5\n' +
    '\n' +
    '[Service]\n' +
    'Type=simple\n' +
    'WorkingDirectory=/mnt/storage/scratch/tmp/stack-copy-uMCTFz/copies/8626d2ceebeec33f705e8959b23173b0e9d382e9\n' +
    'Environment=PATH=/usr/local/bin:/usr/bin:/bin\n' +
    "# The Claude Code binary that managed sessions and the manifest's\n" +
    '# claudeVersion run, pinned at install (`--claude PATH`, default\n' +
    '# `command -v claude`). Without it they run `claude` from PATH above.\n' +
    'Environment=MOSAIC_CLAUDE_BIN=/usr/bin/claude\n' +
    '# Claude Code sessions log in with what this 0600 file sets, which the\n' +
    "# operator writes: CLAUDE_CODE_OAUTH_TOKEN, ANTHROPIC_API_KEY, or a proxy's\n" +
    '# ANTHROPIC_AUTH_TOKEN with ANTHROPIC_BASE_URL. The `-` lets the unit start\n' +
    '# without it, and a Claude Code launch then refuses.\n' +
    'EnvironmentFile=-%h/.config/mosaic-dev/secrets/claude-session.env\n' +
    '# The host reads the system config and the business file, boots the broker\n' +
    '# (packages/bus/src/process.mjs) and starts the notifier. Config problems and\n' +
    '# refusals exit 3, usage 4, invalid input 2: none of those is retried. A\n' +
    '# child that dies takes the host down with exit 1, and the unit restarts\n' +
    '# the pair.\n' +
    'ExecStart=/mnt/storage/scratch/tmp/stack-copy-uMCTFz/copies/8626d2ceebeec33f705e8959b23173b0e9d382e9/scripts/mosaic bus start %i\n' +
    'Restart=on-failure\n' +
    'RestartSec=15\n' +
    'RestartPreventExitStatus=2 3 4\n' +
    '# `systemctl --user stop` sends SIGTERM to the host, which stops the\n' +
    '# notifier after its poll in flight, then closes the broker.\n' +
    'KillSignal=SIGTERM\n' +
    'KillMode=mixed\n' +
    'TimeoutStopSec=60\n' +
    'NoNewPrivileges=yes\n' +
    '\n' +
    '[Install]\n' +
    'WantedBy=default.target\n'
  
      at TestContext.<anonymous> (file:///mnt/storage/src/mosaic-stack-rocko-85/packages/cli/tests/stack-copy.test.mjs:63:188)
      at Test.runInAsyncScope (node:async_hooks:226:14)
      at Test.run (node:internal/test_runner/test:1402:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:974:18)
      at Test.postRun (node:internal/test_runner/test:1542:19)
      at Test.run (node:internal/test_runner/test:1467:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: "# Mosaic bus host, one instance per business: mosaic-bus@<business>.\n# Rendered by scripts/bus-service.sh from packages/cli/systemd/; /mnt/storage/scratch/tmp/stack-copy-uMCTFz/copies/8626d2ceebeec33f705e8959b23173b0e9d382e9,\n# /usr/local/bin:/usr/bin:/bin and the claude line below are filled in at install time. Edit the template and reinstall; do\n# not edit the installed copy. The bus store allows one broker per data\n# root, so run one instance per data root (packages/cli/README.md).\n[Unit]\nDescription=Mosaic bus host (%i)\nDocumentation=file:///mnt/storage/scratch/tmp/stack-copy-uMCTFz/copies/8626d2ceebeec33f705e8959b23173b0e9d382e9/packages/cli/README.md\nStartLimitIntervalSec=600\nStartLimitBurst=5\n\n[Service]\nType=simple\nWorkingDirectory=/mnt/storage/scratch/tmp/stack-copy-uMCTFz/copies/8626d2ceebeec33f705e8959b23173b0e9d382e9\nEnvironment=PATH=/usr/local/bin:/usr/bin:/bin\n# The Claude Code binary that managed sessions and the manifest's\n# claudeVersion run, pinned at install (`--claude PATH`, default\n# `command -v claude`). Without it they run `claude` from PATH above.\nEnvironment=MOSAIC_CLAUDE_BIN=/usr/bin/claude\n# Claude Code sessions log in with what this 0600 file sets, which the\n# operator writes: CLAUDE_CODE_OAUTH_TOKEN, ANTHROPIC_API_KEY, or a proxy's\n# ANTHROPIC_AUTH_TOKEN with ANTHROPIC_BASE_URL. The `-` lets the unit start\n# without it, and a Claude Code launch then refuses.\nEnvironmentFile=-%h/.config/mosaic-dev/secrets/claude-session.env\n# The host reads the system config and the business file, boots the broker\n# (packages/bus/src/process.mjs) and starts the notifier. Config problems and\n# refusals exit 3, usage 4, invalid input 2: none of those is retried. A\n# child that dies takes the host down with exit 1, and the unit restarts\n# the pair.\nExecStart=/mnt/storage/scratch/tmp/stack-copy-uMCTFz/copies/8626d2ceebeec33f705e8959b23173b0e9d382e9/scripts/mosaic bus start %i\nRestart=on-failure\nRestartSec=15\nRestartPreventExitStatus=2 3 4\n# `systemctl --user stop` sends SIGTERM to the host, which stops the\n# notifier after its poll in flight, then closes the broker.\nKillSignal=SIGTERM\nKillMode=mixed\nTimeoutStopSec=60\nNoNewPrivileges=yes\n\n[Install]\nWantedBy=default.target\n",
    expected: /bus start %i --pm/,
    operator: 'match',
    diff: 'simple'
  }
