fleet: move directories off managed paths instead of refusing forever
Launch will not delete a real directory sitting where it expects a managed link -- an auth/<harness>/primary that someone logged into by hand, or a plugin directory a seat acquired before the central store existed. That refusal is right and it is also a dead end: the operator gets a composition error and no way forward. `mosaic fleet adopt` is the way forward. Bare, it lists every such directory and the command that resolves it. With a verb, it moves one where it belongs. Nothing here deletes. A promotion is a rename; an occupied destination is a refusal, not a merge; a cross-device rename is reported rather than retried as copy-then-delete, because a copy-then-delete is a delete. Store adoption stops at the move and does not install the link. The seat's .mosaic-managed-links.json belongs to launch, and a link written behind it fails the next composition as an unrecorded symlink -- one refusal traded for another. The next launch installs and records it when the profile lists the entry; whether a seat gets a plugin stays `mosaic fleet plugin`'s decision. W-F3 of docs/plans/2026-08-14_fleet-seats-on-web1.md.
This commit is contained in:
@@ -42,6 +42,7 @@ import {
|
||||
registerFleetAgentScaffoldCommand,
|
||||
type FleetAgentScaffoldCommandDeps,
|
||||
} from './fleet-agent-scaffold-command.js';
|
||||
import { registerFleetAdoptCommand } from './fleet-adopt-command.js';
|
||||
import {
|
||||
registerFleetMigrationCommand,
|
||||
type FleetMigrationCommandDeps,
|
||||
@@ -2080,6 +2081,11 @@ export function registerFleetCommand(program: Command, deps: FleetCommandDeps =
|
||||
...(deps.fleetDataHome === undefined ? {} : { fleetDataHome: deps.fleetDataHome }),
|
||||
mosaicHomeFor: () => cmd.opts<{ mosaicHome: string }>().mosaicHome,
|
||||
});
|
||||
// The counterpart to launch's refusals: launch will not delete a real directory sitting on
|
||||
// a managed path, and this is how one gets moved out of the way instead.
|
||||
registerFleetAdoptCommand(cmd, {
|
||||
...(deps.fleetDataHome === undefined ? {} : { fleetDataHome: deps.fleetDataHome }),
|
||||
});
|
||||
// Roster-v2 desired-state mutations belong directly to the fleet control
|
||||
// plane; they do not share the root `mosaic agent` gateway-backed surface.
|
||||
registerFleetAgentCrudCommands(cmd, deps);
|
||||
|
||||
Reference in New Issue
Block a user