feat(fleet): add generation-guarded agent CRUD #773

Merged
jason.woltje merged 2 commits from feat/758-fleet-agent-crud into main 2026-07-15 12:03:06 +00:00
Owner

Implements FCM-M2-002 under #758.

  • adds direct mosaic fleet create|get|update|delete|plan roster-v2 commands
  • enforces expected-generation locking, deterministic dry-run, atomic roster writes, and redacted partial-failure recovery
  • defaults fresh agents to enabled + stopped; persisted-start changes desired state only
  • removes only exact generated projection on delete while retaining local/legacy/quarantine state
  • rejects unknown command/channel/secret/prototype-sensitive agent inputs fail-closed
  • adds operator how-to, reference docs, and filesystem/Commander regression coverage

Evidence before push: independent REVIEW-5 VERIFIED APPROVE on commit tree bf44b0efeebf87185c672cbba2ba19b76735c4ab; focused 48, package 794, package static, root static, format, and diff gates passed.

No M3 reconcile/apply or runtime/systemd/tmux/session/live action is included.

Refs #758

Implements FCM-M2-002 under #758. - adds direct `mosaic fleet create|get|update|delete|plan` roster-v2 commands - enforces expected-generation locking, deterministic dry-run, atomic roster writes, and redacted partial-failure recovery - defaults fresh agents to enabled + stopped; persisted-start changes desired state only - removes only exact generated projection on delete while retaining local/legacy/quarantine state - rejects unknown command/channel/secret/prototype-sensitive agent inputs fail-closed - adds operator how-to, reference docs, and filesystem/Commander regression coverage Evidence before push: independent REVIEW-5 VERIFIED APPROVE on commit tree `bf44b0efeebf87185c672cbba2ba19b76735c4ab`; focused 48, package 794, package static, root static, format, and diff gates passed. No M3 reconcile/apply or runtime/systemd/tmux/session/live action is included. Refs #758
jason.woltje added 1 commit 2026-07-15 11:33:54 +00:00
feat(fleet): add generation-guarded agent CRUD (FCM-M2-002)
Some checks failed
ci/woodpecker/pr/ci Pipeline failed
23d58cdb90
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jason.woltje added 1 commit 2026-07-15 11:54:52 +00:00
test(fleet): make CRUD projection recovery deterministic
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
128cc81c39
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
Owner

VERIFIED APPROVE — reviewer-of-record

Exact reviewed state:

Review conclusion:

  • Complete committed delta satisfies FCM-M2-002 local roster-v2 create|get|update|delete|plan scope.
  • Verified expected-generation guard, mutation lock, atomic roster write before derived projection apply, dry-run/get byte stability, stopped default, persisted-start as desired-state only, update idempotency, strict unknown/prototype/command/channel/secret rejection and redaction, plan target contract, exact generated-only delete with local/legacy/quarantine/unrelated retention, non-zero redacted post-roster projection recovery, docs, and no M3/live/systemd/tmux/session/runtime/remote/migration/canary/deploy expansion.

Commands/results:

  • git diff --check origin/main...HEAD — PASS.
  • pnpm --filter @mosaicstack/mosaic test -- fleet-agent-crud-command.spec.ts fleet-agent-crud.spec.ts generated-env-boundary.spec.ts — PASS, 3 files / 48 tests.
  • pnpm --filter @mosaicstack/mosaic test -- fleet-agent-crud-command.spec.ts -t "projection fails after roster persistence" — PASS, 2 run / 20 skipped; covers the formerly root-dependent cases.
  • pnpm --filter @mosaicstack/mosaic test — PASS, 54 files / 794 tests.
  • pnpm --filter @mosaicstack/mosaic typecheck — PASS.
  • pnpm --filter @mosaicstack/mosaic lint — PASS.
  • pnpm typecheck — PASS via turbo cache, 42/42 cached.
  • pnpm lint — PASS via turbo cache, 23/23 cached.
  • pnpm format:check — PASS.
  • Adversarial ephemeral checks — PASS: 140 strict rejection/redaction/byte-stability cases; valid authority-flow check; direct CLI flow check; generated-env boundary audit.

CI state:

  • ~/.config/mosaic/tools/git/pr-ci-wait.sh -n 773 -r mosaicstack/stack --host git.mosaicstack.dev -t 1800 -i 15 — PASS, exact head 128cc81c39 green.
  • Woodpecker pipeline 1830 — success for commit 128cc81c39639b13e33028f0b3c3aa61d10cbf52; install, sanitization, typecheck, lint, format, and test steps all success.

Residual risks:

  • Stale .mutation.lock recovery remains manual; not a blocker for M2 because the normative acceptance does not require automatic stale-lock reclaim.
  • Multi-file roster/projection persistence is intentionally authoritative-roster-first with redacted recovery for late projection failures, not all-or-nothing rollback.

No merge authorization from this review. Parent #758 remains open.

VERIFIED APPROVE — reviewer-of-record Exact reviewed state: - PR: mosaicstack/stack#773 - Head: 128cc81c39639b13e33028f0b3c3aa61d10cbf52 - Tree: 1b9ebe4fa1a90734b6f81118e120bae5290cd350 - Base/main: 191efaefeb5c0c6bb218c1292d12ce8e73ace12b - Total PR scope: 10 files. - Prior-head remediation delta: only packages/mosaic/src/commands/fleet-agent-crud-command.spec.ts, 20 insertions / 31 deletions; product source unchanged from 23d58cdb9083f2978662013103788ae176df8aca. Review conclusion: - Complete committed delta satisfies FCM-M2-002 local roster-v2 create|get|update|delete|plan scope. - Verified expected-generation guard, mutation lock, atomic roster write before derived projection apply, dry-run/get byte stability, stopped default, persisted-start as desired-state only, update idempotency, strict unknown/prototype/command/channel/secret rejection and redaction, plan target contract, exact generated-only delete with local/legacy/quarantine/unrelated retention, non-zero redacted post-roster projection recovery, docs, and no M3/live/systemd/tmux/session/runtime/remote/migration/canary/deploy expansion. Commands/results: - git diff --check origin/main...HEAD — PASS. - pnpm --filter @mosaicstack/mosaic test -- fleet-agent-crud-command.spec.ts fleet-agent-crud.spec.ts generated-env-boundary.spec.ts — PASS, 3 files / 48 tests. - pnpm --filter @mosaicstack/mosaic test -- fleet-agent-crud-command.spec.ts -t "projection fails after roster persistence" — PASS, 2 run / 20 skipped; covers the formerly root-dependent cases. - pnpm --filter @mosaicstack/mosaic test — PASS, 54 files / 794 tests. - pnpm --filter @mosaicstack/mosaic typecheck — PASS. - pnpm --filter @mosaicstack/mosaic lint — PASS. - pnpm typecheck — PASS via turbo cache, 42/42 cached. - pnpm lint — PASS via turbo cache, 23/23 cached. - pnpm format:check — PASS. - Adversarial ephemeral checks — PASS: 140 strict rejection/redaction/byte-stability cases; valid authority-flow check; direct CLI flow check; generated-env boundary audit. CI state: - ~/.config/mosaic/tools/git/pr-ci-wait.sh -n 773 -r mosaicstack/stack --host git.mosaicstack.dev -t 1800 -i 15 — PASS, exact head 128cc81c39639b13e33028f0b3c3aa61d10cbf52 green. - Woodpecker pipeline 1830 — success for commit 128cc81c39639b13e33028f0b3c3aa61d10cbf52; install, sanitization, typecheck, lint, format, and test steps all success. Residual risks: - Stale .mutation.lock recovery remains manual; not a blocker for M2 because the normative acceptance does not require automatic stale-lock reclaim. - Multi-file roster/projection persistence is intentionally authoritative-roster-first with redacted recovery for late projection failures, not all-or-nothing rollback. No merge authorization from this review. Parent #758 remains open.
jason.woltje merged commit bc5e73629e into main 2026-07-15 12:03:06 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#773