Repository navigation
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Context
Audit of the CLI on 2026-11-09. Root persistent flags are accepted everywhere but read by few commands, and two command groups skip the capability gate.
- verified:
fleet apply --module sshapplies every module;fleet.Applynever reads--module(internal/cli/fleet.go:247). All fleet commands also accept and ignore--profile,--config,--force,--tunnel-token. - verified:
--moduleis ignored bystatusanddoctor;--forceis only read by the ssh module and reused byconfig initto mean "overwrite file". - verified:
tunnelandgpumutations build their context throughloadRunContext(tunnel.go:202) withoutValidateCapabilities, although docs/rocky-support.md marks gpu and cloudflared unsupported on Rocky and AGENTS.md requires rejection before changes. It also always builds an APT backend. - verified:
backupwrites root-only archives but is not inmutatingCommands(no lock, no audit).ROOTFILES_YESis honoured byapplyandtunnelbut notrollback.fleetvalidates-oonly after the SSH work.
Implementation starts only on the owner's go-ahead.
Decisions
- A flag a command does not read is an error on that command, not silently ignored. Use the existing
Visitrefusal pattern fromtenant ops(tenant.go:524) for fleet; move--moduleand--forceoff the root where possible. - Every root-mutating subcommand validates capabilities for the modules it touches before acting.
Design
buildRunContext(cmd, modules ...string)validates capabilities for the given modules and picks the package manager by distro (NewPackageManager).fleetrejects--module,--profile,--config,--force,--tunnel-tokenwith a message that says where the setting belongs (inventory or remote config).status/doctor: either honour--moduleor reject it (pick honour forstatus, reject fordoctor).config init --overwrite;--forcekept there as a deprecated alias.- Add
{"backup"}tomutatingCommands; readROOTFILES_YESin one place (yesFlag(cmd)). - Validate
-obefore connecting in fleet.
Changes
internal/cli/{runtime,tunnel,gpu,fleet,status,doctor,configcmd,backup,rollback,apply}.goand tests; README flag notes.
Acceptance criteria
- AC1:
rootfiles fleet apply --module ssh ...exits non-zero before any SSH connection, naming the flag. - AC2: on a Rocky system stub,
gpu assignandtunnel setuprefuse before any change with the capability message. - AC3:
backuptakes the lock and writes an audit record. - AC4:
ROOTFILES_YES=truebehaves the same onapply,tunnel,rollback. - AC5:
fleet status -o yamlfails before connecting. - AC6: the fleet sudoers command strings and remote command lines are unchanged (
module/fleet_sudo.go:24,internal/fleet/rollout.go).
Tasks
- T1: capability validation in
buildRunContext(AC2) - T2: fleet flag refusal + early
-ovalidation (AC1, AC5, AC6) - T3:
--module/--forcescoping,config init --overwrite(deprecated alias) - T4: backup as mutating,
yesFlag(AC3, AC4)- Done when:
go test ./internal/cli/... -racepasses.
- Done when:
Out of scope
- Renaming
-oonbackup/user backup(feat(cli): consistent flags, deduplicated commands and accurate help #92).
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
fix(cli): leave doctor out of the vlan-address override
fix(cli): leave doctor out of the vlan-address override
fix(profiles)!: keep site-specific and no-op values out of the embedd…