docs(fleet): add operator configuration guide
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -2,10 +2,24 @@
|
|||||||
|
|
||||||
## Fleet configuration management
|
## Fleet configuration management
|
||||||
|
|
||||||
- [Generated environment boundary](fleet/reference/generated-env-boundary.md) — roster-derived launch projection, strict local data, legacy quarantine, and downstream interface evidence.
|
- [Fleet configuration entry point](fleet/README.md) — desired-versus-observed decision tree and complete operator link map.
|
||||||
- [Roster v2 structural contract](fleet/reference/roster-v2-fields.md) — local-tmux schema v2 parsing and structural validation.
|
- [Desired, derived, and observed state](fleet/concepts/desired-vs-observed-state.md) — roster authority, generation, ownership, and drift.
|
||||||
- [Role classes and authority](fleet/reference/role-classes.md) — canonical role resolver and protected authority boundaries.
|
- [Identity, class, and runtime](fleet/concepts/identity-class-runtime.md) — stable name, display alias, class, runtime, provider, and model separation.
|
||||||
- [Executable asset dispositions](fleet/migration/example-profile-disposition.md) — shipped v1 fixture/profile/service validation posture.
|
- [Role authority and leases](fleet/concepts/role-authority-and-leases.md) — validator/merge-gate separation and bounded lease authority.
|
||||||
|
- [Generated launch chain](fleet/concepts/generated-env-launch-chain.md) — strict data parsing, precedence, and quarantine.
|
||||||
|
- [Roster v2 structural contract](fleet/reference/roster-v2-fields.md) — schema, supported values, required fields, defaults, and constraints.
|
||||||
|
- [Fleet CLI reference](fleet/reference/cli.md) — local desired-state commands, JSON/exit behavior, and gateway-catalog separation.
|
||||||
|
- [Lifecycle transitions](fleet/reference/lifecycle-transitions.md) — create/apply/reboot/migration/rollback boundaries.
|
||||||
|
- [Status and drift](fleet/reference/status-and-drift.md) — desired/managed/observed state and current/future classifications.
|
||||||
|
- [Safe agent CRUD](fleet/how-to/create-update-delete-agent.md) — expected generation, dry-run, and partial-failure recovery.
|
||||||
|
- [Local lifecycle operations](fleet/how-to/start-stop-restart.md) — persisted versus one-shot actions.
|
||||||
|
- [Configurable interaction instance](fleet/how-to/configure-tess-interaction.md) and [validator instance](fleet/how-to/configure-ultron-validator.md) — generic identities and protected limits.
|
||||||
|
- [Reconcile and recover](fleet/operations/reconcile-and-recover.md) — plan/apply lock and recovery behavior.
|
||||||
|
- [Environment quarantine](fleet/operations/env-quarantine.md) — private evidence and value-free diagnostics.
|
||||||
|
- [Systemd/tmux troubleshooting](fleet/operations/systemd-tmux-troubleshooting.md) — socket, holder, unmanaged-session, and lock decisions.
|
||||||
|
- [Backup/restore boundary](fleet/operations/backup-restore.md) and [upgrade-assets hold](fleet/operations/upgrade-assets.md).
|
||||||
|
- [v1-to-v2 migration preview](fleet/migration/v1-to-v2.md) and [executable artifact dispositions](fleet/migration/example-profile-disposition.md).
|
||||||
|
- [FCM M5 closure evidence](reports/documentation/758-fleet-config-ia-closure.md) and [approved deferrals](reports/deferred/758-fleet-config-deferrals.md).
|
||||||
|
|
||||||
## Official channel plugins
|
## Official channel plugins
|
||||||
|
|
||||||
|
|||||||
@@ -52,20 +52,20 @@ Active workstream is **W1 — Federation v1**. Workers should:
|
|||||||
> the repository quality gates, independent code and security review, terminal-green CI, and
|
> the repository quality gates, independent code and security review, terminal-green CI, and
|
||||||
> the applicable acceptance evidence before merge. Issue #758 remains open until M5 closes.
|
> the applicable acceptance evidence before merge. Issue #758 remains open until M5 closes.
|
||||||
|
|
||||||
| id | status | description | issue | agent | repo | branch | depends_on | estimate | notes |
|
| id | status | description | issue | agent | repo | branch | depends_on | estimate | notes |
|
||||||
| ---------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | ------------- | ----------------- | --------------------------------------- | ---------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------- |
|
| ---------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | ------------- | ----------------- | --------------------------------------- | ---------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| FCM-M0-001 | done | Publish normative PRD requirements/acceptance criteria, this M0–M5 DAG, docs-IA checklist, and legacy example/profile disposition inventory; no implementation changes | #758 | sonnet | mosaicstack/stack | `docs/758-fleet-config-management` | — | 18K | Merged via #760 (`c32d85a`); parent #758 intentionally remains open through M5 |
|
| FCM-M0-001 | done | Publish normative PRD requirements/acceptance criteria, this M0–M5 DAG, docs-IA checklist, and legacy example/profile disposition inventory; no implementation changes | #758 | sonnet | mosaicstack/stack | `docs/758-fleet-config-management` | — | 18K | Merged via #760 (`c32d85a`); parent #758 intentionally remains open through M5 |
|
||||||
| FCM-M1-001 | done | Implement narrow local-tmux v2 roster structural contract/compiler with YAML/JSON canonicalization and schema/parser parity tests | #758 | coder0 | mosaicstack/stack | `feat/758-roster-v2-compiler` | FCM-M0-001 | 30K | #764 squash `aa5b43b`; exact-head RoR and PR/main terminal-green CI; no lifecycle or live mutation |
|
| FCM-M1-001 | done | Implement narrow local-tmux v2 roster structural contract/compiler with YAML/JSON canonicalization and schema/parser parity tests | #758 | coder0 | mosaicstack/stack | `feat/758-roster-v2-compiler` | FCM-M0-001 | 30K | #764 squash `aa5b43b`; exact-head RoR and PR/main terminal-green CI; no lifecycle or live mutation |
|
||||||
| FCM-M1-002 | done | Reuse existing profile/persona/provision resolver for roster semantics; add canonical class/authority validation and approved aliases | #758 | native-sonnet | mosaicstack/stack | `feat/758-shared-role-resolution` | FCM-M0-001 | 25K | #768 squash `a5e8e55`; shared resolver and canonical authority/alias validation delivered |
|
| FCM-M1-002 | done | Reuse existing profile/persona/provision resolver for roster semantics; add canonical class/authority validation and approved aliases | #758 | native-sonnet | mosaicstack/stack | `feat/758-shared-role-resolution` | FCM-M0-001 | 25K | #768 squash `a5e8e55`; shared resolver and canonical authority/alias validation delivered |
|
||||||
| FCM-M1-003 | done | Convert the M0 legacy inventory into executable example/profile/service-preset validation and explicit v1-version/retirement checks | #758 | codex | mosaicstack/stack | `test/758-example-profile-dispositions` | FCM-M1-001, FCM-M1-002 | 20K | #770 squash `e9c4aa3`; shipped artifact disposition validation delivered |
|
| FCM-M1-003 | done | Convert the M0 legacy inventory into executable example/profile/service-preset validation and explicit v1-version/retirement checks | #758 | codex | mosaicstack/stack | `test/758-example-profile-dispositions` | FCM-M1-001, FCM-M1-002 | 20K | #770 squash `e9c4aa3`; shipped artifact disposition validation delivered |
|
||||||
| FCM-M2-001 | done | Migrate generic launch chain to deterministic `.env.generated` plus strict data-only `.env.local`; quarantine forbidden legacy keys | #758 | codex | mosaicstack/stack | `feat/758-generated-env-boundary` | FCM-M1-001, FCM-M1-002 | 30K | #772 squash `191efae`; generated/local boundary and private quarantine delivered |
|
| FCM-M2-001 | done | Migrate generic launch chain to deterministic `.env.generated` plus strict data-only `.env.local`; quarantine forbidden legacy keys | #758 | codex | mosaicstack/stack | `feat/758-generated-env-boundary` | FCM-M1-001, FCM-M1-002 | 30K | #772 squash `191efae`; generated/local boundary and private quarantine delivered |
|
||||||
| FCM-M2-002 | done | Add generation-guarded local fleet agent create/get/update/delete mutations with plan/dry-run, atomic roster writes, and recovery output | #758 | codex | mosaicstack/stack | `feat/758-fleet-agent-crud` | FCM-M1-001, FCM-M2-001 | 30K | #773 squash `bc5e736`; generation-guarded atomic CRUD and recovery contracts delivered |
|
| FCM-M2-002 | done | Add generation-guarded local fleet agent create/get/update/delete mutations with plan/dry-run, atomic roster writes, and recovery output | #758 | codex | mosaicstack/stack | `feat/758-fleet-agent-crud` | FCM-M1-001, FCM-M2-001 | 30K | #773 squash `bc5e736`; generation-guarded atomic CRUD and recovery contracts delivered |
|
||||||
| FCM-M3-001 | done | Implement local roster-owned reconcile/apply plus lifecycle/status/verify/doctor contracts and stable JSON/exit codes | #758 | codex | mosaicstack/stack | `feat/758-local-reconciler` | FCM-M2-001, FCM-M2-002 | 35K | #785 squash `4990905`; exact roster-owned systemd/tmux reconcile and lifecycle contracts delivered |
|
| FCM-M3-001 | done | Implement local roster-owned reconcile/apply plus lifecycle/status/verify/doctor contracts and stable JSON/exit codes | #758 | codex | mosaicstack/stack | `feat/758-local-reconciler` | FCM-M2-001, FCM-M2-002 | 35K | #785 squash `4990905`; exact roster-owned systemd/tmux reconcile and lifecycle contracts delivered |
|
||||||
| FCM-M3-002 | in-progress | Add isolated systemd/tmux lifecycle, drift, socket, unmanaged-session, crash, and rollback acceptance coverage | #758 | sonnet | mosaicstack/stack | `test/758-reconciler-lifecycle-gates` | FCM-M3-001 | 25K | Canonical v2 named-socket + legacy-v1 default-server boundaries; fake adapters/temp fixtures only |
|
| FCM-M3-002 | in-progress | Add isolated systemd/tmux lifecycle, drift, socket, unmanaged-session, crash, and rollback acceptance coverage | #758 | sonnet | mosaicstack/stack | `test/758-reconciler-lifecycle-gates` | FCM-M3-001 | 25K | Canonical v2 named-socket + legacy-v1 default-server boundaries; fake adapters/temp fixtures only |
|
||||||
| FCM-M4-001 | not-started | Implement field-complete v1-to-v2 inventory/preview/migrator with alias, lifecycle, env-quarantine, and remote/connector disposition evidence | #758 | codex | mosaicstack/stack | `feat/758-v1-v2-migrator` | FCM-M1-003, FCM-M3-001 | 35K | Preview first; no unreviewed lifecycle inference |
|
| FCM-M4-001 | done | Implement field-complete v1-to-v2 inventory/preview/migrator with alias, lifecycle, env-quarantine, and remote/connector disposition evidence | #758 | codex | mosaicstack/stack | `feat/758-v1-v2-migrator` | FCM-M1-003, FCM-M3-001 | 35K | PR #788; final head `d63bb0206a1d312ab8352ec1d3ca3631146b0baa`; tree `4da210da9a71b035130d4160a4a2e691bdfde2da`; squash `9745bc3f29c26b021a478b7ad03cfb494f6c9de3`; descendant-main pipeline 1855 terminal success |
|
||||||
| FCM-M4-002 | not-started | Add reversible canary migration, rollback, stale-projection/orphan classification, and current-host 9-managed/3-unmanaged fixture coverage | #758 | sonnet | mosaicstack/stack | `test/758-migration-rollback-gates` | FCM-M4-001, FCM-M3-002 | 25K | Never starts a previously stopped agent or kills an unproven unmanaged session |
|
| FCM-M4-002 | not-started | Add reversible canary migration, rollback, stale-projection/orphan classification, and current-host 9-managed/3-unmanaged fixture coverage | #758 | sonnet | mosaicstack/stack | `test/758-migration-rollback-gates` | FCM-M4-001, FCM-M3-002 | 25K | HOLD: never starts a previously stopped agent or kills an unproven unmanaged session; not authorized by FCM-M5-001 |
|
||||||
| FCM-M5-001 | not-started | Deliver the accepted fleet documentation IA, how-to/operations/migration references, and link/example validation | #758 | haiku | mosaicstack/stack | `docs/758-fleet-config-operator-docs` | FCM-M1-003, FCM-M2-002, FCM-M3-001, FCM-M4-001 | 24K | Must close every checklist item or record an approved deferral |
|
| FCM-M5-001 | in-progress | Deliver the accepted fleet documentation IA, how-to/operations/migration references, and link/example validation | #758 | haiku | mosaicstack/stack | `docs/758-fleet-config-operator-docs` | FCM-M1-003, FCM-M2-002, FCM-M3-001, FCM-M4-001 | 24K | Sole owner: this FCM-M5-001 delivery on the recorded branch; must close every checklist item or record an approved deferral |
|
||||||
| FCM-M5-002 | not-started | Package/update asset-drift checks, rolling local canary, independent validation certificate, and release evidence | #758 | sonnet | mosaicstack/stack | `feat/758-fleet-config-release-gate` | FCM-M3-002, FCM-M4-002, FCM-M5-001 | 30K | Final #758 gate: quality, independent code/security review, validator certificate, merge-gate approval, green CI |
|
| FCM-M5-002 | not-started | Package/update asset-drift checks, rolling local canary, independent validation certificate, and release evidence | #758 | sonnet | mosaicstack/stack | `feat/758-fleet-config-release-gate` | FCM-M3-002, FCM-M4-002, FCM-M5-001 | 30K | HOLD: final #758 gate; quality, independent code/security review, validator certificate, merge-gate approval, and green CI remain out of M5-001 |
|
||||||
|
|
||||||
## Thin-core prompt diet (#528) — feat/contract-thin-core
|
## Thin-core prompt diet (#528) — feat/contract-thin-core
|
||||||
|
|
||||||
|
|||||||
@@ -5,27 +5,27 @@
|
|||||||
This checklist is an acceptance contract for documentation and examples. It does not authorize
|
This checklist is an acceptance contract for documentation and examples. It does not authorize
|
||||||
schema, runtime, systemd, role, profile, or live-fleet changes. An item is complete only when its
|
schema, runtime, systemd, role, profile, or live-fleet changes. An item is complete only when its
|
||||||
named artifact exists, is linked from the fleet documentation entry point, and its evidence is
|
named artifact exists, is linked from the fleet documentation entry point, and its evidence is
|
||||||
recorded in the M0 task/PR.
|
recorded in the M5 closure report and linked deferral evidence.
|
||||||
|
|
||||||
## M0 baseline acceptance
|
## M0 baseline acceptance
|
||||||
|
|
||||||
- [ ] `docs/PRD.md` states the roster as desired-state SSOT; generated environment, systemd,
|
- [x] `docs/PRD.md` states the roster as desired-state SSOT; generated environment, systemd,
|
||||||
tmux, and heartbeat artifacts as non-authoritative projections; and fail-closed handling of
|
tmux, and heartbeat artifacts as non-authoritative projections; and fail-closed handling of
|
||||||
unsupported or quarantined legacy input.
|
unsupported or quarantined legacy input.
|
||||||
- [ ] `docs/PRD.md` defines the required classes and authority boundary: `validator` certifies but
|
- [x] `docs/PRD.md` defines the required classes and authority boundary: `validator` certifies but
|
||||||
does not merge; `merge-gate` remains sole approve-to-land/merge authority; `team-leader`
|
does not merge; `merge-gate` remains sole approve-to-land/merge authority; `team-leader`
|
||||||
capacity is lease-bounded; `interaction` is request/status only; instance names such as Tess
|
capacity is lease-bounded; `interaction` is request/status only; instance names such as Tess
|
||||||
and Ultron remain configurable.
|
and Ultron remain configurable.
|
||||||
- [ ] `docs/PRD.md` defines local lifecycle semantics for `enabled`, persisted desired state, and
|
- [x] `docs/PRD.md` defines local lifecycle semantics for `enabled`, persisted desired state, and
|
||||||
observed state, including stopped-state preservation through migration, apply, and reboot.
|
observed state, including stopped-state preservation through migration, apply, and reboot.
|
||||||
- [ ] `docs/PRD.md` defines the generated-env/local-override boundary, explicitly denies arbitrary
|
- [x] `docs/PRD.md` defines the generated-env/local-override boundary, explicitly denies arbitrary
|
||||||
command overrides in M1–M5, and requires key-name/hash-only quarantine diagnostics.
|
command overrides in M1–M5, and requires key-name/hash-only quarantine diagnostics.
|
||||||
- [ ] `docs/PRD.md` identifies the M1–M5 local-tmux scope and excludes remote reconciliation,
|
- [x] `docs/PRD.md` identifies the M1–M5 local-tmux scope and excludes remote reconciliation,
|
||||||
connector mutation, secret references, arbitrary commands/channels, gateway convergence, and
|
connector mutation, secret references, arbitrary commands/channels, gateway convergence, and
|
||||||
UI configuration storage.
|
UI configuration storage.
|
||||||
- [ ] `docs/TASKS.md` contains the complete M0–M5 one-card/one-PR dependency DAG for #758 with
|
- [x] `docs/TASKS.md` contains the complete M0–M5 one-card/one-PR dependency DAG for #758 with
|
||||||
agent tier, branch, dependency, estimate, and evidence expectations.
|
agent tier, branch, dependency, estimate, and evidence expectations.
|
||||||
- [ ] `docs/fleet/LEGACY-EXAMPLE-PROFILE-DISPOSITION-INVENTORY.md` classifies every current shipped
|
- [x] `docs/fleet/LEGACY-EXAMPLE-PROFILE-DISPOSITION-INVENTORY.md` classifies every current shipped
|
||||||
fleet example, profile, and service preset before M1 implementation starts.
|
fleet example, profile, and service preset before M1 implementation starts.
|
||||||
|
|
||||||
## Required documentation IA for M1–M5
|
## Required documentation IA for M1–M5
|
||||||
@@ -72,15 +72,24 @@ recorded in the M0 task/PR.
|
|||||||
|
|
||||||
## Cross-cutting evidence gates
|
## Cross-cutting evidence gates
|
||||||
|
|
||||||
- [ ] Every retained or migrated YAML/JSON example, profile, and service preset validates through the
|
- [x] Every retained or migrated YAML/JSON example, profile, and service preset validates through the
|
||||||
same executable schema and shared baseline-plus-`roles.local` resolver used by the CLI.
|
same declared executable production parser/resolver path recorded by the disposition inventory;
|
||||||
- [ ] Every retired example/profile/service preset has a replacement link and deprecation note; no
|
versioned v1 fixtures are not forced through the v2 compiler.
|
||||||
|
- [x] Every retired example/profile/service preset has a replacement link and deprecation note; no
|
||||||
unresolved legacy class or tool-policy alias remains silently shipped.
|
unresolved legacy class or tool-policy alias remains silently shipped.
|
||||||
- [ ] Documentation examples contain no secret values, arbitrary command override, or product-hardcoded
|
- [x] Documentation examples contain no secret values, arbitrary command override, or product-hardcoded
|
||||||
Tess/Ultron identity.
|
Tess/Ultron identity.
|
||||||
- [ ] CLI snippets distinguish local fleet desired-state commands from the separate gateway-backed
|
- [x] CLI snippets distinguish local fleet desired-state commands from the separate gateway-backed
|
||||||
`mosaic agent` catalog.
|
`mosaic agent` catalog.
|
||||||
- [ ] Migration, quarantine, lifecycle, status, and troubleshooting documentation state that values of
|
- [x] Migration, quarantine, lifecycle, status, and troubleshooting documentation state that values of
|
||||||
legacy sensitive keys are never printed.
|
legacy sensitive keys are never printed.
|
||||||
- [ ] M5 release review verifies links, schema/example validation, and that all checklist rows have
|
- [x] M5 documentation validation verifies links, schema/example validation, and that checklist
|
||||||
owner/evidence or an explicit approved deferral.
|
rows have owner/evidence or an explicit approved-existing deferral.
|
||||||
|
|
||||||
|
## Held downstream gates
|
||||||
|
|
||||||
|
These unchecked items are intentionally outside FCM-M5-001 and are not authorized by this checklist:
|
||||||
|
|
||||||
|
- [ ] FCM-M4-002 executes and evidences live cutover, canary, stopped-state preservation, and rollback.
|
||||||
|
- [ ] FCM-M5-002 completes independent exact-head review and issues the validator certificate.
|
||||||
|
- [ ] The exact PR head reaches terminal-green CI after independent review.
|
||||||
|
|||||||
63
docs/fleet/README.md
Normal file
63
docs/fleet/README.md
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
# Fleet Configuration Management
|
||||||
|
|
||||||
|
This book documents the local roster-v2 desired-state control plane delivered under issue #758. The normative requirements are the [FCM section of the repository PRD](../PRD.md#fleet-declarative-configuration-management-workstream-fcm-758), not the older fleet-suite or observability planning pages.
|
||||||
|
|
||||||
|
## Authority boundary
|
||||||
|
|
||||||
|
`<MOSAIC_HOME>/fleet/roster.yaml` is the sole writable desired-state authority for local fleet membership, launch policy, and persisted lifecycle. Generated environment files, systemd enablement, tmux sessions, heartbeat files, and status output are derived or observed. Rebuild projections from the roster; never edit them as desired state.
|
||||||
|
|
||||||
|
This control plane is local tmux/systemd only. Remote/SSH entries and connectors are inventory, not reconciliation targets. Arbitrary commands, channels, secret references, gateway catalog convergence, and UI configuration storage are outside this workstream. `mos-comms` is temporary transport glue, not permanent fleet architecture.
|
||||||
|
|
||||||
|
## Choose the right workflow
|
||||||
|
|
||||||
|
1. **Need to inspect intent?** Read the roster and use `mosaic fleet get`; see [desired versus observed state](concepts/desired-vs-observed-state.md).
|
||||||
|
2. **Need to inspect reality?** Use `status` or `doctor`; use `verify` for a strict non-zero drift/ownership gate. These commands do not repair anything.
|
||||||
|
3. **Need to change membership or persisted policy?** Use generation-guarded `plan`, `create`, `update`, or `delete`; see [safe CRUD](how-to/create-update-delete-agent.md).
|
||||||
|
4. **Need a one-time runtime action?** Use `start`, `stop`, or `restart`. These do not change persisted desired state.
|
||||||
|
5. **Need convergence?** Review `apply --dry-run`, resolve blockers, then use `apply` with the same current generation; see [reconcile and recover](operations/reconcile-and-recover.md).
|
||||||
|
6. **Need v1 migration evidence?** Use preview only. Cutover, canary, and rollback remain held for FCM-M4-002.
|
||||||
|
7. **Need the gateway-backed agent catalog?** That is the separate `mosaic agent` surface, not local fleet desired state.
|
||||||
|
|
||||||
|
## Concepts
|
||||||
|
|
||||||
|
- [Desired versus observed state](concepts/desired-vs-observed-state.md)
|
||||||
|
- [Identity, class, runtime, provider, and model](concepts/identity-class-runtime.md)
|
||||||
|
- [Role authority and leases](concepts/role-authority-and-leases.md)
|
||||||
|
- [Generated environment launch chain](concepts/generated-env-launch-chain.md)
|
||||||
|
|
||||||
|
## Operator how-to
|
||||||
|
|
||||||
|
- [Create, inspect, update, and delete](how-to/create-update-delete-agent.md)
|
||||||
|
- [Start, stop, restart, and reconcile](how-to/start-stop-restart.md)
|
||||||
|
- [Configure an interaction instance](how-to/configure-tess-interaction.md)
|
||||||
|
- [Configure a validator instance](how-to/configure-ultron-validator.md)
|
||||||
|
- [Customize roles](how-to/customize-roles.md)
|
||||||
|
|
||||||
|
## Operations and recovery
|
||||||
|
|
||||||
|
- [Reconcile and recover](operations/reconcile-and-recover.md)
|
||||||
|
- [Environment quarantine](operations/env-quarantine.md)
|
||||||
|
- [Systemd/tmux troubleshooting](operations/systemd-tmux-troubleshooting.md)
|
||||||
|
- [Backup and restore boundary](operations/backup-restore.md)
|
||||||
|
- [Upgrade and asset-drift hold](operations/upgrade-assets.md)
|
||||||
|
|
||||||
|
## Reference and migration
|
||||||
|
|
||||||
|
- [Roster v2 fields](reference/roster-v2-fields.md) · [executable JSON Schema](reference/roster-v2.schema.json) · [validated example](examples/roster-v2.yaml)
|
||||||
|
- [CLI and exit codes](reference/cli.md)
|
||||||
|
- [Role classes](reference/role-classes.md)
|
||||||
|
- [Lifecycle transitions](reference/lifecycle-transitions.md)
|
||||||
|
- [Status and drift](reference/status-and-drift.md)
|
||||||
|
- [Generated environment boundary](reference/generated-env-boundary.md)
|
||||||
|
- [v1-to-v2 preview](migration/v1-to-v2.md)
|
||||||
|
- [Example/profile dispositions](migration/example-profile-disposition.md)
|
||||||
|
- [Legacy class aliases](migration/legacy-class-aliases.md)
|
||||||
|
|
||||||
|
## Acceptance evidence and holds
|
||||||
|
|
||||||
|
- [M0/M5 IA checklist](FLEET-CONFIG-DOCS-IA-CHECKLIST.md)
|
||||||
|
- [Legacy example/profile inventory](LEGACY-EXAMPLE-PROFILE-DISPOSITION-INVENTORY.md)
|
||||||
|
- [M5 closure evidence](../reports/documentation/758-fleet-config-ia-closure.md)
|
||||||
|
- [Approved-existing deferrals and live-action holds](../reports/deferred/758-fleet-config-deferrals.md)
|
||||||
|
|
||||||
|
The canonical publishing source remains this repository. This card does not publish externally, run a migration, operate a live fleet, or close parent issue #758.
|
||||||
42
docs/fleet/concepts/desired-vs-observed-state.md
Normal file
42
docs/fleet/concepts/desired-vs-observed-state.md
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# Desired, Derived, and Observed Fleet State
|
||||||
|
|
||||||
|
## One writable authority
|
||||||
|
|
||||||
|
The canonical local v2 roster at `<MOSAIC_HOME>/fleet/roster.yaml` is desired state. Membership, stable identity, class, runtime/provider/model selection, launch policy, enablement, and persisted `running`/`stopped` intent are written only through generation-guarded roster mutations.
|
||||||
|
|
||||||
|
Derived projections are reproducible consequences of that authority:
|
||||||
|
|
||||||
|
- `<name>.env.generated`;
|
||||||
|
- exact roster-named tmux sessions on the configured socket after reconciliation;
|
||||||
|
- systemd service targets managed by installation/reconciliation.
|
||||||
|
|
||||||
|
Current systemd unit enablement is not yet lifecycle-conformant at boot: installation can enable every
|
||||||
|
agent unit, and the launcher projection does not carry `enabled` or `desired_state`. Therefore reboot
|
||||||
|
preservation for stopped/disabled agents remains an FCM-M3-002 acceptance hold, not a guaranteed
|
||||||
|
projection behavior.
|
||||||
|
|
||||||
|
Observed evidence available to current roster-v2 status commands includes systemd active state, tmux
|
||||||
|
presence, holder ownership, and unmanaged sessions. Heartbeat files are observational in the wider fleet,
|
||||||
|
but roster-v2 `status`, `doctor`, and `verify` do not currently read them. Observation never writes back
|
||||||
|
to the roster.
|
||||||
|
|
||||||
|
## Generation and ownership
|
||||||
|
|
||||||
|
`generation` is a positive integer concurrency fence. A mutating request must provide the current value. Successful changed CRUD increments it exactly once; stale or concurrent writers fail before mutation. Apply/reconcile rereads the canonical roster under a private exclusive lock and uses only that generation and content for effects.
|
||||||
|
|
||||||
|
Ownership is exact, never fuzzy. Reconciliation is limited to roster names, the configured socket, the exact holder session, a private installation identity, and private managed paths. An ownership mismatch, unmanaged session, unsafe path, stale generation, or ambiguous lock fails closed.
|
||||||
|
|
||||||
|
## Drift decisions
|
||||||
|
|
||||||
|
| Observation | Interpretation | Safe response |
|
||||||
|
| ---------------------------------------- | ------------------------ | ---------------------------------------------------------------------- |
|
||||||
|
| Generated file differs or is missing | Derived projection drift | Review `apply --dry-run`; regenerate from the roster. |
|
||||||
|
| Desired `running`, exact session missing | `missing-session` | Diagnose ownership/runtime, then reconcile if safe. |
|
||||||
|
| Desired `stopped`, exact session present | `unexpected-session` | Inspect; reconciliation may stop only the proven roster target. |
|
||||||
|
| Disabled agent running | `disabled-running` | Inspect; disabled state wins during explicit safe reconciliation. |
|
||||||
|
| Unknown session on the configured socket | Unmanaged state | Report only. Do not adopt, rename, or kill it. |
|
||||||
|
| Heartbeat stale in the wider fleet | Liveness evidence | Diagnose separately; current roster-v2 status does not read heartbeat. |
|
||||||
|
|
||||||
|
`status` and `doctor` classify. `verify` is also observational but exits non-zero when ownership, drift, or unmanaged-state checks fail. `plan`/`apply --dry-run` validates proposed projection and lifecycle work without mutation. `apply` and `reconcile` converge only after all preconditions pass.
|
||||||
|
|
||||||
|
A partial projection failure does not roll the roster back. Treat the committed roster as authority and regenerate. A lifecycle failure after projection completion preserves both roster and projections for inspection. Sensitive legacy values are never printed; diagnostics are bounded to stable codes, key names where applicable, and hashes.
|
||||||
23
docs/fleet/concepts/generated-env-launch-chain.md
Normal file
23
docs/fleet/concepts/generated-env-launch-chain.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Generated Environment Launch Chain
|
||||||
|
|
||||||
|
The launcher consumes validated data, not shell configuration.
|
||||||
|
|
||||||
|
1. Read and validate the canonical roster.
|
||||||
|
2. Render deterministic `<name>.env.generated` data from that roster.
|
||||||
|
3. Parse optional `<name>.env.local` through a strict allowlist.
|
||||||
|
4. Reject generated-key shadowing, unknown or sensitive-looking keys, unsafe paths/values, duplicates, malformed lines, shell syntax, and command overrides.
|
||||||
|
5. Derive the runtime command from validated runtime/model/reasoning data.
|
||||||
|
6. Target only the exact configured tmux socket and roster session after ownership checks.
|
||||||
|
|
||||||
|
## File precedence and ownership
|
||||||
|
|
||||||
|
| File | Owner | Use |
|
||||||
|
| ----------------- | ------------------------ | --------------------------------------------------------------------------- |
|
||||||
|
| `.env.generated` | Mosaic projection writer | Complete deterministic roster projection. Rebuild; do not edit. |
|
||||||
|
| `.env.local` | Operator | Optional, private, strict machine-local data. Cannot shadow generated keys. |
|
||||||
|
| `.env` | Legacy input | One-time migration input only; never launch authority. |
|
||||||
|
| `.env.quarantine` | Private quarantine | Retained unsafe legacy evidence; never loaded by the launcher. |
|
||||||
|
|
||||||
|
Neither systemd nor the launcher sources these files. No `eval`, shell expansion, arbitrary `MOSAIC_AGENT_COMMAND`, channel, or secret-reference compatibility path exists. Safe legacy generated keys are regenerated, allowed local keys are relocated, and unsafe material is quarantined.
|
||||||
|
|
||||||
|
Diagnostics never expose the rejected value, credential material, or command text. They are bounded to stable rule code, key name where safe, and SHA-256 content identity. See [generated environment reference](../reference/generated-env-boundary.md) and [quarantine operations](../operations/env-quarantine.md).
|
||||||
20
docs/fleet/concepts/identity-class-runtime.md
Normal file
20
docs/fleet/concepts/identity-class-runtime.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Fleet Identity, Class, and Runtime
|
||||||
|
|
||||||
|
Each roster field has one job. Do not use names or model strings as authority shortcuts.
|
||||||
|
|
||||||
|
| Concern | Field | Contract |
|
||||||
|
| ----------------------- | ------------------------------- | -------------------------------------------------------------------------------------------- |
|
||||||
|
| Stable machine identity | `agents[].name` | Unique, immutable mutation target and exact service/session name. |
|
||||||
|
| Display identity | `agents[].alias` | Human-facing label only; may be changed and grants no authority. |
|
||||||
|
| Behavioral contract | `agents[].class` | Resolves through the shared baseline plus `roles.local` persona library. |
|
||||||
|
| Tool boundary | `agents[].tool_policy` | Must match protected canonical classes; cannot independently grant authority. |
|
||||||
|
| Harness | `agents[].runtime` | One of `claude`, `codex`, `opencode`, or `pi`, declared in `runtimes`. |
|
||||||
|
| Backend selection | `agents[].provider` and `model` | Explicit non-empty data; capability validity is not inferred from the display name or class. |
|
||||||
|
| Effort | `agents[].reasoning` | `low`, `medium`, or `high`. |
|
||||||
|
| Local placement | `working_directory` | Explicit safe local work path; not remote placement authority. |
|
||||||
|
|
||||||
|
Tess and Ultron are conventional instance/display names only. They are not products, required machine identities, role aliases, or authority-bearing classes. A configurable interaction instance uses `class: interaction`; a configurable validation instance uses `class: validator`. Any stable name and alias satisfying the structural contract may be used.
|
||||||
|
|
||||||
|
Class aliases are deliberately narrow: `implementer → code`, `reviewer → review`, and `operator-interaction → interaction`. No runtime, provider, model, persona prose, or instance name changes this mapping. See [role classes](../reference/role-classes.md) and the [validated generic example](../examples/roster-v2.yaml).
|
||||||
|
|
||||||
|
Roster v2 is local-only. It contains no host/SSH placement, connector, channel, secret-reference, arbitrary-command, per-agent socket, or gateway mapping fields. Those concerns require separate requirements and threat models.
|
||||||
22
docs/fleet/concepts/role-authority-and-leases.md
Normal file
22
docs/fleet/concepts/role-authority-and-leases.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# Fleet Role Authority and Leases
|
||||||
|
|
||||||
|
Role content describes behavior; protected authority is immutable code metadata derived only from the canonical class.
|
||||||
|
|
||||||
|
## Required workstream classes
|
||||||
|
|
||||||
|
`code`, `review`, `validator`, `orchestrator`, `team-leader`, `enhancer`, and `interaction` are required FCM classes. `merge-gate` is additionally protected because it remains the sole approve-to-land and merge authority.
|
||||||
|
|
||||||
|
| Class | Authority | Boundary |
|
||||||
|
| -------------------------------------------- | ------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
||||||
|
| `merge-gate` | Approve-to-land and merge | Sole merge authority. |
|
||||||
|
| `validator` | Issue independent validation evidence/certificate | Never approves landing or merges. |
|
||||||
|
| `orchestrator` | Orchestrate topology and issue bounded leases | Does not gain merge authority. |
|
||||||
|
| `team-leader` | Use explicitly leased capacity | Cannot issue leases or mutate roster, credentials, topology authority, or merge state. |
|
||||||
|
| `interaction` | Receive requests and report status | Cannot orchestrate, issue leases, mutate configuration, or merge. |
|
||||||
|
| `code`, `review`, `enhancer`, custom classes | No protected authority by default | Persona prose cannot grant protected powers. |
|
||||||
|
|
||||||
|
A lease is capacity authorization from an orchestrator, not ownership. It must identify a bounded task or period and does not alter the leased agent's roster identity, role contract, credentials, authority, or persisted lifecycle. Expiry/revocation returns capacity; it does not rewrite the roster.
|
||||||
|
|
||||||
|
Semantic validation rejects protected class/tool-policy mismatch in either direction. An instance named Ultron with `class: validator` remains validation-only. An instance named Tess with `class: interaction` remains request/status-only. Renaming either instance changes no authority.
|
||||||
|
|
||||||
|
For resolver layering and safe customization, see [role classes](../reference/role-classes.md) and [customize roles](../how-to/customize-roles.md).
|
||||||
61
docs/fleet/examples/roster-v2.yaml
Normal file
61
docs/fleet/examples/roster-v2.yaml
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
version: 2
|
||||||
|
generation: 1
|
||||||
|
transport: tmux
|
||||||
|
tmux:
|
||||||
|
socket_name: mosaic-fleet
|
||||||
|
holder_session: _holder
|
||||||
|
defaults:
|
||||||
|
working_directory: ~/src
|
||||||
|
runtime: pi
|
||||||
|
runtimes:
|
||||||
|
pi:
|
||||||
|
reset_command: /new
|
||||||
|
agents:
|
||||||
|
- name: code-example
|
||||||
|
alias: Code Example
|
||||||
|
class: code
|
||||||
|
runtime: pi
|
||||||
|
provider: example-provider
|
||||||
|
model: example-model
|
||||||
|
reasoning: medium
|
||||||
|
tool_policy: code
|
||||||
|
working_directory: ~/src
|
||||||
|
persistent_persona: false
|
||||||
|
reset_between_tasks: true
|
||||||
|
lifecycle:
|
||||||
|
enabled: true
|
||||||
|
desired_state: stopped
|
||||||
|
launch:
|
||||||
|
yolo: false
|
||||||
|
- name: interaction-example
|
||||||
|
alias: Interaction Example
|
||||||
|
class: interaction
|
||||||
|
runtime: pi
|
||||||
|
provider: example-provider
|
||||||
|
model: example-model
|
||||||
|
reasoning: low
|
||||||
|
tool_policy: interaction
|
||||||
|
working_directory: ~/src
|
||||||
|
persistent_persona: true
|
||||||
|
reset_between_tasks: false
|
||||||
|
lifecycle:
|
||||||
|
enabled: true
|
||||||
|
desired_state: stopped
|
||||||
|
launch:
|
||||||
|
yolo: false
|
||||||
|
- name: validator-example
|
||||||
|
alias: Validator Example
|
||||||
|
class: validator
|
||||||
|
runtime: pi
|
||||||
|
provider: example-provider
|
||||||
|
model: example-model
|
||||||
|
reasoning: high
|
||||||
|
tool_policy: validator
|
||||||
|
working_directory: ~/src
|
||||||
|
persistent_persona: false
|
||||||
|
reset_between_tasks: true
|
||||||
|
lifecycle:
|
||||||
|
enabled: true
|
||||||
|
desired_state: stopped
|
||||||
|
launch:
|
||||||
|
yolo: false
|
||||||
21
docs/fleet/how-to/configure-tess-interaction.md
Normal file
21
docs/fleet/how-to/configure-tess-interaction.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Configure an Interaction Instance
|
||||||
|
|
||||||
|
An interaction instance is a configurable local roster member with canonical `class: interaction` and matching `tool_policy: interaction`. “Tess” may be used as a display alias, but neither that alias nor the stable name is required or authority-bearing.
|
||||||
|
|
||||||
|
Use the [validated generic roster](../examples/roster-v2.yaml) as the safe shape. Choose a unique stable `name`, any descriptive `alias`, a supported declared runtime, explicit provider/model/reasoning, and a safe work directory. Start with:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: interaction-example
|
||||||
|
alias: Interaction Example
|
||||||
|
class: interaction
|
||||||
|
tool_policy: interaction
|
||||||
|
lifecycle:
|
||||||
|
enabled: true
|
||||||
|
desired_state: stopped
|
||||||
|
```
|
||||||
|
|
||||||
|
Plan the complete agent payload with the current roster generation, then create it without `--persisted-start`. Creation defaults to enabled/stopped and performs no runtime action. Review the resulting roster and projection plan before any later lifecycle decision.
|
||||||
|
|
||||||
|
The interaction class is request/status only. It cannot orchestrate, issue leases, mutate the roster/configuration, grant credentials, certify validation, approve landing, or merge. Connector and channel configuration are outside roster v2; do not add connector, channel, secret, command, remote-host, or gateway fields.
|
||||||
|
|
||||||
|
See [safe CRUD](create-update-delete-agent.md), [identity separation](../concepts/identity-class-runtime.md), and [role authority](../concepts/role-authority-and-leases.md).
|
||||||
21
docs/fleet/how-to/configure-ultron-validator.md
Normal file
21
docs/fleet/how-to/configure-ultron-validator.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Configure a Validator Instance
|
||||||
|
|
||||||
|
A validator instance is a configurable local roster member with canonical `class: validator` and matching `tool_policy: validator`. “Ultron” may be used as a display alias, but it is not a required identity, class alias, product name, or source of authority.
|
||||||
|
|
||||||
|
Use the [validated generic roster](../examples/roster-v2.yaml) as the safe shape. Choose a unique stable name and explicit supported runtime/provider/model/reasoning values. Start stopped:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: validator-example
|
||||||
|
alias: Validator Example
|
||||||
|
class: validator
|
||||||
|
tool_policy: validator
|
||||||
|
lifecycle:
|
||||||
|
enabled: true
|
||||||
|
desired_state: stopped
|
||||||
|
```
|
||||||
|
|
||||||
|
Plan the full payload with the current generation and create without `--persisted-start`. Creation writes desired state and projections only; it does not launch a validator.
|
||||||
|
|
||||||
|
`validator` may issue independent validation evidence or a certificate. It has no approve-to-land or merge authority. `merge-gate` remains the sole protected merge authority, and changing the validator's name, alias, persona prose, runtime, provider, model, or tool-policy text cannot elevate it.
|
||||||
|
|
||||||
|
Certificate consumption and final release evidence remain FCM-M5-002 gates. This page does not create a certificate or authorize merge. See [safe CRUD](create-update-delete-agent.md) and [role authority](../concepts/role-authority-and-leases.md).
|
||||||
@@ -14,7 +14,7 @@ mosaic fleet verify
|
|||||||
mosaic fleet doctor
|
mosaic fleet doctor
|
||||||
```
|
```
|
||||||
|
|
||||||
Start with `--dry-run`. It validates roster semantics, deterministic projections, private managed paths, exact holder ownership, and named-socket state without changing files or lifecycle state. `apply` and `reconcile` rebuild derived projections and enforce only persisted roster state: enabled `running` agents may start, while stopped or disabled agents are not started.
|
Start with `--dry-run`. It validates roster semantics, deterministic projections, private managed paths, exact holder ownership, and named-socket state without changing files or lifecycle state. Explicit `apply` and `reconcile` rebuild derived projections and enforce persisted roster state: enabled `running` agents may start, while stopped or disabled agents are not started. This guarantee does not extend to reboot/service activation yet; boot preservation remains an FCM-M3-002 hold.
|
||||||
|
|
||||||
`start`, `stop`, and `restart` are explicit one-shot exact-service actions. They do not persist a lifecycle change. Roster CRUD is the only way to change persisted desired state.
|
`start`, `stop`, and `restart` are explicit one-shot exact-service actions. They do not persist a lifecycle change. Roster CRUD is the only way to change persisted desired state.
|
||||||
|
|
||||||
|
|||||||
20
docs/fleet/operations/env-quarantine.md
Normal file
20
docs/fleet/operations/env-quarantine.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Environment Quarantine Operations
|
||||||
|
|
||||||
|
Legacy `<name>.env` is input evidence, never current launch authority. Projection preparation classifies it deterministically:
|
||||||
|
|
||||||
|
- generated roster keys → discard and regenerate;
|
||||||
|
- allowed strict local keys → relocate to private `.env.local`;
|
||||||
|
- malformed, duplicate, unknown, sensitive-looking, shell-bearing, unsafe, or command-override entries → move the legacy input to private `.env.quarantine`.
|
||||||
|
|
||||||
|
## Safe response
|
||||||
|
|
||||||
|
1. Stop and read the stable error code and reported key name/hash. Do not request or paste the value.
|
||||||
|
2. Confirm the canonical roster contains the intended non-sensitive desired state.
|
||||||
|
3. If the key is an allowed local machine-data field, place only its validated data form in `.env.local` under private permissions.
|
||||||
|
4. Remove unsupported intent rather than translating it into commands, channels, secret references, or unknown `MOSAIC_AGENT_*` keys.
|
||||||
|
5. Regenerate `.env.generated` from the roster and rerun a dry-run/verification gate.
|
||||||
|
6. Retain quarantine evidence privately until the operator's normal retention process permits removal.
|
||||||
|
|
||||||
|
The launcher never reads quarantine. Public/JSON diagnostics expose stable code, key name where safe, and SHA-256 only—never a legacy sensitive value, credential, rejected command, or full line. Quarantine does not prove remediation, backup, migration, or rollback.
|
||||||
|
|
||||||
|
See [generated launch chain](../concepts/generated-env-launch-chain.md), [generated environment boundary](../reference/generated-env-boundary.md), and [migration field disposition](../migration/v1-to-v2.md#field-disposition).
|
||||||
@@ -7,6 +7,8 @@
|
|||||||
3. Resolve stale generation, ownership mismatch, unsafe path, projection validation, or unmanaged-session findings before applying.
|
3. Resolve stale generation, ownership mismatch, unsafe path, projection validation, or unmanaged-session findings before applying.
|
||||||
4. Run `mosaic fleet apply --expected-generation <n>` only after the plan is understood.
|
4. Run `mosaic fleet apply --expected-generation <n>` only after the plan is understood.
|
||||||
|
|
||||||
|
This is per-generation convergence, not a rolling canary. Executable canary cutover/rollback remains held for FCM-M4-002; rolling local release evidence remains FCM-M5-002. Do not approximate either with repeated live apply commands.
|
||||||
|
|
||||||
The reconciler uses the exact roster tmux socket, exact holder session, private installation holder identity, and the complete expected global environment. For mutations it acquires its exclusive lock before rereading the canonical roster and fencing its generation; only that under-lock roster drives validation, planning, projections, and lifecycle effects. Before effects, its exclusive lock proves real private `MOSAIC_HOME` and `fleet` ancestors, uses a private `0600` lock leaf, and binds cleanup to the created file identity and ownership token. A fake holder, contaminated global environment, missing identity, unsafe lock path, or unmanaged session fails closed. It does not adopt, kill, or rename any unproven session. A crash can leave a stale lock for explicit operator inspection; reconciliation deliberately does not guess ownership or remove it.
|
The reconciler uses the exact roster tmux socket, exact holder session, private installation holder identity, and the complete expected global environment. For mutations it acquires its exclusive lock before rereading the canonical roster and fencing its generation; only that under-lock roster drives validation, planning, projections, and lifecycle effects. Before effects, its exclusive lock proves real private `MOSAIC_HOME` and `fleet` ancestors, uses a private `0600` lock leaf, and binds cleanup to the created file identity and ownership token. A fake holder, contaminated global environment, missing identity, unsafe lock path, or unmanaged session fails closed. It does not adopt, kill, or rename any unproven session. A crash can leave a stale lock for explicit operator inspection; reconciliation deliberately does not guess ownership or remove it.
|
||||||
|
|
||||||
## Partial results
|
## Partial results
|
||||||
|
|||||||
24
docs/fleet/operations/systemd-tmux-troubleshooting.md
Normal file
24
docs/fleet/operations/systemd-tmux-troubleshooting.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Systemd and tmux Troubleshooting
|
||||||
|
|
||||||
|
Start with read-only `mosaic fleet status`, `doctor`, and `verify`. Do not manually adopt, rename, terminate, or recreate sessions while ownership is ambiguous.
|
||||||
|
|
||||||
|
## Decision table
|
||||||
|
|
||||||
|
| Finding | Meaning | Safe next step |
|
||||||
|
| ------------------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
||||||
|
| Empty roster `tmux.socket_name` | Literal default tmux server | Do not substitute the named `mosaic-fleet` socket. Use roster-derived commands only. |
|
||||||
|
| Non-empty socket | Exact named socket | Never target another socket or infer a per-agent socket. |
|
||||||
|
| `holder: missing` | Required exact holder absent | Inspect installation/projection readiness; do not create an unproven holder manually. |
|
||||||
|
| `ownership-mismatch` | Holder identity or global environment differs | Stop. Verify private install identity and managed paths before retry. |
|
||||||
|
| `missing-session` | Desired-running roster agent lacks exact session | Check service/runtime preconditions; review apply dry-run. |
|
||||||
|
| `unexpected-session` | Desired-stopped roster agent still has exact session | Confirm ownership; only reconciler may target the exact proven roster member. |
|
||||||
|
| `disabled-running` | Disabled roster member is observed running | Inspect and reconcile only after ownership proof. |
|
||||||
|
| `unmanagedSessions` | Unknown session exists on configured named socket | Report and investigate separately. Reconciler will not kill or adopt it. |
|
||||||
|
| stale/concurrent generation | Desired state changed since plan | Reload roster/generation and recompute the plan. |
|
||||||
|
| stale or ambiguous lock | Prior writer/cleanup cannot be proven | Inspect ownership; do not blindly remove the lock. |
|
||||||
|
| projection failure | Derived files incomplete | Keep roster as authority and regenerate projections. |
|
||||||
|
| lifecycle failure | Projections complete, runtime convergence incomplete | Inspect the exact owned resource, then rerun with current generation. |
|
||||||
|
|
||||||
|
Systemd state, tmux state, heartbeat, and generated files are observations/projections, not alternate desired state. Explicit apply/reconcile honors stopped/disabled intent, but current unit enablement and launcher projections do not yet prove lifecycle-safe reboot; inspect unit enablement before reboot and treat stopped/disabled boot preservation as an FCM-M3-002 hold. Current roster-v2 status commands also do not read heartbeat files. Executable gates do not provide site cutover/rollback or package asset-revision repair.
|
||||||
|
|
||||||
|
Errors and troubleshooting output never print legacy sensitive values, credential contents, or privileged command text. Use stable codes, key names/hashes, exact roster identities, and bounded recovery actions. See [status and drift](../reference/status-and-drift.md) and [reconcile and recover](reconcile-and-recover.md).
|
||||||
18
docs/fleet/operations/upgrade-assets.md
Normal file
18
docs/fleet/operations/upgrade-assets.md
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Upgrade and Installed-Asset Drift
|
||||||
|
|
||||||
|
Fleet source assets and installed assets can differ after an update, but FCM-M5-001 does not add a trustworthy source-versus-installed revision detector or refresh command. Do not infer freshness from checkout presence, timestamps, generated environment files, running sessions, or a ready migration preview.
|
||||||
|
|
||||||
|
## Current safe boundary
|
||||||
|
|
||||||
|
- The canonical roster remains authority and must survive package/framework refresh.
|
||||||
|
- Generated projections are rebuilt from that roster after the installed contract is independently verified.
|
||||||
|
- Operator `roles.local`, `.env.local`, and private quarantine evidence are not generated assets and must not be overwritten.
|
||||||
|
- Baseline roles, schemas, examples, service presets, launcher helpers, and systemd templates must move as one reviewed release set.
|
||||||
|
- Remote/connector inventory and `mos-comms` are not promoted into permanent architecture by an update.
|
||||||
|
- No update may start an agent persisted stopped, adopt an unmanaged session, or bypass generation/ownership checks.
|
||||||
|
|
||||||
|
## Explicit hold
|
||||||
|
|
||||||
|
FCM-M5-002 owns deterministic asset-drift checks, safe package/update refresh evidence, rolling local canary, independent validation certificate, and release evidence. Until that card lands, this page is an operational hold rather than an executable procedure: use the repository/release review path, preserve backups, and do not claim source/installed parity without exact revision evidence from the future validator.
|
||||||
|
|
||||||
|
See [approved deferrals](../../reports/deferred/758-fleet-config-deferrals.md) and [backup/restore boundary](backup-restore.md).
|
||||||
@@ -1,6 +1,25 @@
|
|||||||
# Fleet Control-Plane CLI
|
# Fleet Control-Plane CLI
|
||||||
|
|
||||||
The local roster-v2 control plane is `mosaic fleet`.
|
The local desired-state surface is `mosaic fleet`. It is distinct from the gateway-backed `mosaic agent` catalog and from legacy compatibility commands that act on roster v1.
|
||||||
|
|
||||||
|
## Roster-v2 desired-state commands
|
||||||
|
|
||||||
|
| Command | Effect | Generation | Output |
|
||||||
|
| ---------------------------------------------------------- | ---------------------------------------------- | ---------- | -------------------------- |
|
||||||
|
| `mosaic fleet get <name>` | Read one authoritative agent | no | One JSON object |
|
||||||
|
| `mosaic fleet plan <create\|update\|delete> ...` | Validate proposed CRUD and projections | required | One JSON object; no writes |
|
||||||
|
| `mosaic fleet create ... [--dry-run] [--persisted-start]` | Add desired state; default enabled/stopped | required | One JSON object |
|
||||||
|
| `mosaic fleet update <name> ... [--dry-run]` | Replace mutable agent fields | required | One JSON object |
|
||||||
|
| `mosaic fleet delete <name> ... [--dry-run]` | Remove roster member/generated projection | required | One JSON object |
|
||||||
|
| `mosaic fleet apply ... [--dry-run]` | Plan or converge projections/lifecycle | required | One JSON object |
|
||||||
|
| `mosaic fleet reconcile ... [--dry-run]` | Alias of the same convergence contract | required | One JSON object |
|
||||||
|
| `mosaic fleet start\|stop\|restart [name] ... [--dry-run]` | Exact one-shot lifecycle action | required | One JSON object |
|
||||||
|
| `mosaic fleet status [name]` | Observe desired/managed/runtime state | no | One JSON object |
|
||||||
|
| `mosaic fleet verify` | Strict observational drift/ownership gate | no | One JSON object |
|
||||||
|
| `mosaic fleet doctor` | Classify local drift and recovery context | no | One JSON object |
|
||||||
|
| `mosaic fleet migrate-v1 preview ...` | Non-mutating field-complete migration evidence | no | One JSON object |
|
||||||
|
|
||||||
|
CRUD syntax and full payload shape are documented in [agent mutations](agent-mutations.md). Reconciliation syntax:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
mosaic fleet apply --expected-generation <n> [--dry-run]
|
mosaic fleet apply --expected-generation <n> [--dry-run]
|
||||||
@@ -14,14 +33,14 @@ mosaic fleet doctor
|
|||||||
mosaic fleet migrate-v1 preview --source <path> --decisions <path> --observations <path>
|
mosaic fleet migrate-v1 preview --source <path> --decisions <path> --observations <path>
|
||||||
```
|
```
|
||||||
|
|
||||||
`migrate-v1 preview` is non-mutating: it emits value-free v1 inventory, a canonical semantically
|
`get` is the read/show operation for one v2 agent. Full roster parsing and semantic validation occur on every v2 mutation/reconcile path; there is no separate mutable “config store.” The executable JSON Schema and validated example provide offline structural evidence.
|
||||||
validated v2 candidate when ready, sanitized environment dispositions, and non-executable recovery
|
|
||||||
evidence. It has no write, apply, canary, or rollback option. Missing preview inputs also return one stable
|
|
||||||
blocked JSON object and a non-zero exit, rather than Commander text. See
|
|
||||||
[the migration preview contract](../migration/v1-to-v2.md).
|
|
||||||
|
|
||||||
`apply` and `reconcile` use roster desired state. `start`, `stop`, and `restart` are exact local one-shot lifecycle effects and never persist a desired-state edit. `status`, `verify`, and `doctor` are observational.
|
## JSON and exit behavior
|
||||||
|
|
||||||
Commands emit one JSON object. Handled precondition errors emit `{ "error": { "code": "..." } }` and exit non-zero. Partial derived/lifecycle effects use explicit `authoritativeRoster`, `projections`, `lifecycle`, and bounded `recovery` fields; they never claim rollback. Any additive `cleanup` diagnostic also exits non-zero, even where known effects are complete: it is not a clean completion and the lock requires inspection before retry.
|
Roster-v2 CRUD and reconciler precondition failures emit `{ "error": { "code": "..." } }` and exit non-zero. Migration preview has its own result envelope: a non-ready preview emits `{ "status": "blocked", "blockers": [...] }` and exits non-zero rather than using the CRUD/reconciler error object. Use both exit status and command-specific state fields. A partial reconciliation result distinguishes `authoritativeRoster`, `projections`, `lifecycle`, `recovery`, and optional `cleanup`; it never claims automatic rollback. `verify` exits non-zero for drift, ownership failure, or unmanaged sessions. Sensitive legacy values, credentials, and rejected command text are never printed.
|
||||||
|
|
||||||
This control plane is separate from the gateway-backed `mosaic agent` catalog. It is local-only and rejects remote/connector lifecycle mutation, arbitrary command/channel/secret input, and unproven tmux ownership.
|
## Compatibility and scope
|
||||||
|
|
||||||
|
Roster-v1 initialization, provisioning, profiles/personas, and historical `fleet add/remove` remain compatibility surfaces, not roster-v2 CRUD aliases. New v2 automation should use the table above. `migrate-v1 preview` writes nothing and has no cutover, canary, or rollback option.
|
||||||
|
|
||||||
|
`mosaic agent` is a separate catalog/transport surface; it does not own `<MOSAIC_HOME>/fleet/roster.yaml` desired state. Remote/SSH reconciliation, connector mutation, arbitrary commands/channels, secret references, and gateway convergence are rejected or outside scope.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Fleet Generated Environment Boundary
|
# Fleet Generated Environment Boundary
|
||||||
|
|
||||||
**Card:** FCM-M2-001 · **Issue:** #758 · **Status:** unreleased/card-local
|
**Card:** FCM-M2-001 · **Issue:** #758 · **Status:** merged contract
|
||||||
|
|
||||||
The local fleet roster is the desired-state authority. A launch reads a deterministic,
|
The local fleet roster is the desired-state authority. A launch reads a deterministic,
|
||||||
roster-derived generated projection and an optional strictly data-only local file; neither file is
|
roster-derived generated projection and an optional strictly data-only local file; neither file is
|
||||||
@@ -78,12 +78,12 @@ This card does not add a USC site file, write a USC roster, or run a site canary
|
|||||||
consolidated downstream interface packet. Status is deliberately separated from checkout presence: no
|
consolidated downstream interface packet. Status is deliberately separated from checkout presence: no
|
||||||
product release version has been evidenced for this interface set.
|
product release version has been evidenced for this interface set.
|
||||||
|
|
||||||
| Interface | Canonical public path and version | Tracker/release status | Downstream limit |
|
| Interface | Canonical public path and version | Tracker/release status | Downstream limit |
|
||||||
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
||||||
| M1 structural compiler | `parseRosterV2` in `packages/mosaic/src/fleet/roster-v2.ts`; schema `docs/fleet/reference/roster-v2.schema.json`; roster `version: 2` | FCM-M1-001 is recorded done, merged as #764 (`aa5b43b`); no released product version is asserted here. | Parse YAML/JSON and canonicalize a supplied v2 site roster without writes. |
|
| M1 structural compiler | `parseRosterV2` in `packages/mosaic/src/fleet/roster-v2.ts`; schema `docs/fleet/reference/roster-v2.schema.json`; roster `version: 2` | FCM-M1-001 is recorded done, merged as #764 (`aa5b43b`); no released product version is asserted here. | Parse YAML/JSON and canonicalize a supplied v2 site roster without writes. |
|
||||||
| M1 semantic resolver | `validateRosterV2Semantics` in `packages/mosaic/src/fleet/roster-v2.ts`; baseline `framework/fleet/roles/` plus `roles.local/` | FCM-M1-002 remains `in-progress` in `docs/TASKS.md`; unreleased. | Reuse the shared resolver only; no parallel role resolver or lifecycle action. |
|
| M1 semantic resolver | `validateRosterV2Semantics` in `packages/mosaic/src/fleet/roster-v2.ts`; baseline `framework/fleet/roles/` plus `roles.local/` | FCM-M1-002 merged as #768 (`a5e8e55`); no released product version is asserted here. | Reuse the shared resolver only; no parallel role resolver or lifecycle action. |
|
||||||
| M1 disposition evidence | `packages/mosaic/src/fleet/example-profile-dispositions.ts`; `docs/fleet/migration/example-profile-disposition.md`; retained fixture `version: 1` | FCM-M1-003 remains `not-started` in `docs/TASKS.md`; unreleased even though these checkout artifacts are inspectable. | Inspect fixture/profile/service disposition evidence only; it is not migration authorization. |
|
| M1 disposition evidence | `packages/mosaic/src/fleet/example-profile-dispositions.ts`; `docs/fleet/migration/example-profile-disposition.md`; retained fixture `version: 1` | FCM-M1-003 merged as #770 (`e9c4aa3`); checkout evidence remains validation, not migration authorization. | Inspect fixture/profile/service disposition evidence only; it is not migration authorization. |
|
||||||
| M2 generated boundary | `packages/mosaic/src/fleet/generated-env-boundary.ts`; generated projection contract in this document | FCM-M2-001 card-local and uncommitted; unreleased. | Render/write a roster-derived projection; local input is never authority. |
|
| M2 generated boundary | `packages/mosaic/src/fleet/generated-env-boundary.ts`; generated projection contract in this document | FCM-M2-001 merged as #772 (`191efae`); no released product version is asserted here. | Render/write a roster-derived projection; local input is never authority. |
|
||||||
|
|
||||||
The canonical source remains `<MOSAIC_HOME>/fleet/roster.yaml` for the current local fleet path.
|
The canonical source remains `<MOSAIC_HOME>/fleet/roster.yaml` for the current local fleet path.
|
||||||
Generated environment data is a rebuildable projection, not an operator-editable source of membership,
|
Generated environment data is a rebuildable projection, not an operator-editable source of membership,
|
||||||
|
|||||||
@@ -1,14 +1,21 @@
|
|||||||
# Local Fleet Lifecycle Transitions
|
# Local Fleet Lifecycle Transitions
|
||||||
|
|
||||||
FCM-M3-001 uses the roster-v2 `lifecycle.enabled` and `lifecycle.desired_state` fields as the only desired-state authority. Systemd, tmux, generated environment files, and heartbeats are derived or observed state.
|
Roster-v2 `lifecycle.enabled` and `lifecycle.desired_state` are the only persisted lifecycle authority. Systemd, tmux, generated environment, and heartbeat state are derived or observed.
|
||||||
|
|
||||||
| Command | Desired-state write | Runtime effect | Preconditions |
|
| Event | Desired-state write | Runtime effect | Safety boundary |
|
||||||
| --------------------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
| --------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `fleet apply` / `fleet reconcile` | Never | Rebuilds projections, then starts only enabled agents desired `running`; stops disabled or desired-`stopped` roster agents | Current generation; private managed paths; valid projections; proven holder ownership; no unmanaged named-socket sessions |
|
| `fleet create` | Adds enabled/stopped by default; `--persisted-start` records running | None | Generation-guarded; validates full roster/projections. |
|
||||||
| `fleet start <name>` | Never | One-shot exact `mosaic-agent@<name>.service` start | Current generation; exact enabled roster name; proven ownership |
|
| `fleet update` | May change enabled/desired state in complete payload | None | Generation-guarded; stable name immutable. |
|
||||||
| `fleet stop <name>` | Never | One-shot exact service stop | Current generation; exact roster name; proven ownership |
|
| `fleet delete` | Removes exact roster member | None | Removes only generated projection; retains local/quarantine evidence. |
|
||||||
| `fleet restart <name>` | Never | One-shot exact service restart | Current generation; exact roster name; proven ownership |
|
| `fleet apply` / `reconcile` | Never | Rebuilds projections; starts only enabled/running; stops disabled or stopped roster members | Current generation, private lock/paths, semantic validity, holder ownership, no unmanaged named-socket sessions. |
|
||||||
|
| `fleet start <name>` | Never | One-shot exact service start | Exact enabled roster name and proven ownership. |
|
||||||
|
| `fleet stop <name>` | Never | One-shot exact service stop | Exact roster name and proven ownership. |
|
||||||
|
| `fleet restart <name>` | Never | One-shot exact service restart | Exact enabled roster name and proven ownership. |
|
||||||
|
| Reboot/service activation | Never | Current installation may activate enabled units without honoring roster lifecycle | **Held for FCM-M3-002:** boot preservation for stopped/disabled agents is not yet proven; inspect/disable units rather than assuming lifecycle-safe reboot. |
|
||||||
|
| v1 migration preview | Never | None | Observed active+present maps running; inactive+missing maps stopped; ambiguity blocks. |
|
||||||
|
| Cutover/canary | Held for FCM-M4-002 | Not implemented by preview | Must preserve every observed stopped state. |
|
||||||
|
| Rollback | Held for FCM-M4-002 | Not implemented | Must restore selected authority/projections without surprise starts or unmanaged targeting. |
|
||||||
|
|
||||||
A stopped roster agent is never started by `apply` or `reconcile`. Direct lifecycle commands are explicit one-shot actions and do not change persisted desired state. Use roster CRUD with the explicit persisted-start option to change that desired state.
|
Explicit apply/reconcile never starts a stopped roster agent. Direct lifecycle commands are explicit one-shot actions and do not persist intent. Change durable lifecycle only through generation-guarded CRUD and then review reconciliation. Reboot preservation for stopped/disabled agents is not yet guaranteed because current enabled units and launcher projections do not carry the persisted lifecycle fence; that acceptance evidence remains FCM-M3-002.
|
||||||
|
|
||||||
All mutations require `--expected-generation <n>` and acquire one private roster-adjacent reconciliation lock before projection or lifecycle effects. Missing or stale generations and concurrent writers fail before effects; the lock is released after success, partial failure, or thrown lifecycle failure. Stale, ownership, unmanaged-session, unsupported-runtime, path, projection, and lifecycle-precondition failures return stable redacted JSON errors and a non-zero exit. No command targets a fuzzy tmux name, arbitrary socket, arbitrary command, channel, secret, or generated file as authority.
|
Missing/stale generation, concurrent writer, unsafe path, ownership mismatch, unmanaged session, unsupported runtime, invalid projection, and lifecycle precondition failures return stable redacted JSON and non-zero status. No command targets fuzzy names, arbitrary sockets/commands/channels/secrets, or generated files as authority. Legacy sensitive values are never printed.
|
||||||
|
|||||||
@@ -50,18 +50,20 @@ agents:
|
|||||||
|
|
||||||
## Root fields
|
## Root fields
|
||||||
|
|
||||||
| Field | Required | Constraint | Meaning |
|
| Field | Required | Default | Constraint | Meaning |
|
||||||
| ------------ | -------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
| ------------ | -------- | ------- | --------------------- | ------------------------------------------------------------------------------------------------- |
|
||||||
| `version` | yes | integer constant `2` | Identifies this contract. Version `1` is explicitly rejected by this compiler and remains on the existing v1 path until M4 migration. |
|
| `version` | yes | none | integer constant `2` | Identifies this contract. Version `1` stays on the compatibility path pending explicit migration. |
|
||||||
| `generation` | yes | positive safe integer | Desired-state generation. M2 uses it for mutation guards; M1 does not mutate it. |
|
| `generation` | yes | none | positive safe integer | Desired-state generation and mutation/reconcile concurrency fence. |
|
||||||
| `transport` | yes | constant `tmux` | M1–M5 support local tmux only. |
|
| `transport` | yes | none | constant `tmux` | M1–M5 support local tmux only. |
|
||||||
| `tmux` | yes | strict object | Explicit local socket and holder-session configuration. |
|
| `tmux` | yes | none | strict object | Explicit local socket and holder-session configuration. |
|
||||||
| `defaults` | yes | strict object | Default work directory and one supported local runtime. |
|
| `defaults` | yes | none | strict object | Default work directory and one supported local runtime. |
|
||||||
| `runtimes` | yes | non-empty object | Declared local runtime reset policy map. |
|
| `runtimes` | yes | none | non-empty object | Declared local runtime reset policy map. |
|
||||||
| `agents` | yes | non-empty array | Local fleet entries. Duplicate stable names are rejected. |
|
| `agents` | yes | none | non-empty array | Local fleet entries. Duplicate stable names are rejected. |
|
||||||
|
|
||||||
## Nested fields
|
## Nested fields
|
||||||
|
|
||||||
|
All nested fields in the v2 schema are required and have no implicit default. CRUD `create` is the only higher-level convenience: it records `lifecycle.enabled: true` and `desired_state: stopped` unless `--persisted-start` explicitly records running. That convenience still performs no runtime action.
|
||||||
|
|
||||||
| Path | Required | Constraint |
|
| Path | Required | Constraint |
|
||||||
| ---------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------- |
|
| ---------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------- |
|
||||||
| `tmux.socket_name` | yes | `[A-Za-z0-9_.-]*`; empty string means the literal default tmux server, while a non-empty value names a socket |
|
| `tmux.socket_name` | yes | `[A-Za-z0-9_.-]*`; empty string means the literal default tmux server, while a non-empty value names a socket |
|
||||||
|
|||||||
@@ -1,13 +1,25 @@
|
|||||||
# Local Fleet Status and Drift
|
# Local Fleet Status and Drift
|
||||||
|
|
||||||
`mosaic fleet status [name]`, `verify`, and `doctor` are observational roster-v2 commands. They emit one JSON result and do not write projections, change desired state, start services, stop services, restart services, or mutate tmux.
|
`mosaic fleet status [name]`, `verify`, and `doctor` are observational roster-v2 commands. They emit one JSON result and do not write projections, mutate desired state, operate lifecycle, or change tmux.
|
||||||
|
|
||||||
The report distinguishes:
|
## State dimensions
|
||||||
|
|
||||||
- `missing-session`: an enabled agent desired `running` has no exact roster-named tmux session.
|
- **Desired:** roster membership, generation, enabled flag, and persisted running/stopped target.
|
||||||
- `unexpected-session`: a desired-`stopped` agent still has its exact session.
|
- **Managed/derived:** generated environment and expected exact service/session topology.
|
||||||
- `disabled-running`: a disabled roster agent has its exact session.
|
- **Observed by current roster-v2 commands:** systemd active state, tmux presence, exact holder ownership, and unmanaged sessions.
|
||||||
- `unmanagedSessions`: sessions on the configured named socket that are neither the exact holder nor an exact roster agent.
|
|
||||||
- `holder`: `owned`, `missing`, or `ownership-mismatch` after exact holder, private install identity, and complete global tmux environment validation.
|
|
||||||
|
|
||||||
`doctor` and `status` classify rather than adopt, destroy, or repair unmanaged state. `verify` is observational too, but exits non-zero if ownership cannot be proven, unmanaged sessions exist, or drift is present. Reconciliation fails closed under those conditions and never kills or adopts an unmanaged session.
|
Implemented drift classifications include:
|
||||||
|
|
||||||
|
- `missing-session`: enabled/desired-running agent lacks its exact session;
|
||||||
|
- `unexpected-session`: desired-stopped agent has its exact session;
|
||||||
|
- `disabled-running`: disabled roster agent has its exact session;
|
||||||
|
- `unmanagedSessions`: named-socket sessions that are neither exact holder nor roster agent;
|
||||||
|
- `holder`: `owned`, `missing`, or `ownership-mismatch` after private identity and global environment checks.
|
||||||
|
|
||||||
|
Generated projection failures/staleness are surfaced by plan/apply preparation and bounded recovery fields rather than adopted as configuration. Heartbeat remains wider-fleet observational evidence, never desired state, but the current roster-v2 `status`, `doctor`, and `verify` commands do not read heartbeat files. A provable removed-agent projection may be treated as stale derived state during deletion, but general projection-orphan classification and installed source-versus-asset revision mismatch remain FCM-M4-002/M5-002 holds; current commands must not claim those future checks.
|
||||||
|
|
||||||
|
## Command behavior
|
||||||
|
|
||||||
|
`status` and `doctor` classify rather than adopt, destroy, or repair. `verify` is observational too, but exits non-zero if ownership cannot be proven, unmanaged sessions exist, or drift is present. Reconciliation fails closed under those conditions and never kills or adopts an unmanaged session.
|
||||||
|
|
||||||
|
Doctor/error output uses stable codes and bounded recovery context. Migration, quarantine, lifecycle, status, and troubleshooting output never prints a legacy sensitive value, credential, or privileged command text.
|
||||||
|
|||||||
45
docs/reports/deferred/758-fleet-config-deferrals.md
Normal file
45
docs/reports/deferred/758-fleet-config-deferrals.md
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# FCM-M5-001 Fleet Documentation Deferrals and Holds
|
||||||
|
|
||||||
|
**Issue:** #758 · **Branch:** `docs/758-fleet-config-operator-docs`
|
||||||
|
|
||||||
|
These are accepted existing DAG boundaries, not omissions silently claimed as delivered.
|
||||||
|
|
||||||
|
## FCM-M3-002 hold
|
||||||
|
|
||||||
|
- Boot/reboot preservation for roster members persisted stopped or disabled.
|
||||||
|
- Current installation may enable all agent units, while the launcher projection does not yet carry
|
||||||
|
`lifecycle.enabled` or `desired_state`; documentation therefore does not claim lifecycle-safe reboot.
|
||||||
|
- Heartbeat/liveness integration into roster-v2 `status`, `doctor`, and `verify`; current observations
|
||||||
|
cover systemd active state, tmux sessions, holder ownership, and unmanaged sessions only.
|
||||||
|
|
||||||
|
## FCM-M4-002 hold
|
||||||
|
|
||||||
|
- Executable v1-to-v2 cutover, reversible canary, and rollback.
|
||||||
|
- Stale-projection/orphan migration classification and current-host managed/unmanaged fixture coverage.
|
||||||
|
- Any live migration, lifecycle, systemd/tmux/session, or rollback action.
|
||||||
|
|
||||||
|
M5 docs describe prerequisites and the preview boundary only. A ready preview is not migration or rollback evidence.
|
||||||
|
|
||||||
|
## FCM-M5-002 hold
|
||||||
|
|
||||||
|
- Deterministic source-versus-installed asset revision detection and safe refresh implementation.
|
||||||
|
- Rolling local canary, independent validator certificate, final release evidence, merge-gate approval, and parent #758 closure.
|
||||||
|
|
||||||
|
`operations/upgrade-assets.md` is therefore a fail-closed hold, not an invented procedure.
|
||||||
|
|
||||||
|
## Compatibility interpretation
|
||||||
|
|
||||||
|
The M0 cross-cutting row requiring every retained/migrated artifact to validate through the executable contract is satisfied by each artifact's declared executable disposition, not by forcing versioned v1 fixtures through the v2 parser:
|
||||||
|
|
||||||
|
- retained examples are explicit `version: 1` fixtures validated by the production v1 parser;
|
||||||
|
- canonical profiles validate through the shared baseline plus `roles.local` resolver;
|
||||||
|
- the service preset validates through its production service-policy reader;
|
||||||
|
- migration candidates validate through the production v2 compiler and shared semantic resolver.
|
||||||
|
|
||||||
|
The executable disposition inventory rejects undeclared additions/removals and prevents silent legacy drift.
|
||||||
|
|
||||||
|
## Repository-wide documentation structure
|
||||||
|
|
||||||
|
The accepted #758 IA is the domain book under `docs/fleet/`. Creating global `USER-GUIDE`, `ADMIN-GUIDE`, or `DEVELOPER-GUIDE` books and cleaning unrelated pre-existing `docs/` root files are outside this bounded card. The repository sitemap links the fleet book. No HTTP/API/auth contract changed, so OpenAPI and endpoint-index updates are not applicable.
|
||||||
|
|
||||||
|
Canonical documentation remains in-repository; no external publishing or generated publishing output is in scope. Parent issue #758 stays open through M5.
|
||||||
44
docs/reports/documentation/758-fleet-config-ia-closure.md
Normal file
44
docs/reports/documentation/758-fleet-config-ia-closure.md
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
# FCM-M5-001 Fleet Documentation IA Closure Evidence
|
||||||
|
|
||||||
|
**Issue:** #758 · **Task:** FCM-M5-001
|
||||||
|
|
||||||
|
## Artifact map
|
||||||
|
|
||||||
|
- Fleet entry point and desired/observed decision tree: `docs/fleet/README.md`.
|
||||||
|
- Concepts: `docs/fleet/concepts/` covers authority/projections, identity separation, role authority/leases, and the generated launch chain.
|
||||||
|
- Operator workflows: `docs/fleet/how-to/` covers CRUD, lifecycle, interaction and validator instances, and role overrides.
|
||||||
|
- Operations: `docs/fleet/operations/` covers reconciliation/recovery, quarantine, systemd/tmux troubleshooting, backup/restore boundaries, and upgrade-asset holds.
|
||||||
|
- References: executable schema, complete field/default/constraint reference, CLI/JSON/exit behavior, lifecycle/status/drift, role authority, and generated environment boundary under `docs/fleet/reference/`.
|
||||||
|
- Migration: preview field map, lifecycle preservation, backup/recovery prerequisites, aliases, and executable artifact dispositions under `docs/fleet/migration/`.
|
||||||
|
- Navigation: `docs/SITEMAP.md` and the fleet entry point.
|
||||||
|
|
||||||
|
## Acceptance mapping
|
||||||
|
|
||||||
|
| Checklist area | Evidence |
|
||||||
|
| ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| Roster authority and fail-closed legacy handling | Root PRD FCM-REQ-01/05/08; desired/observed and quarantine pages. |
|
||||||
|
| Classes and authority | Root PRD FCM-REQ-07; role authority concept/reference; configurable interaction/validator how-tos. |
|
||||||
|
| Lifecycle | Root PRD FCM-REQ-04; lifecycle transition table and operator lifecycle how-to. |
|
||||||
|
| Local-only generated launch boundary | Root PRD FCM-REQ-05/09; generated launch concept/reference. |
|
||||||
|
| Complete DAG and artifact inventory | `docs/TASKS.md`; M0 inventory; executable disposition tests. |
|
||||||
|
| IA pages | Every path named by the M0 checklist exists and is linked from `docs/fleet/README.md`. |
|
||||||
|
| Examples | `docs/fleet/examples/roster-v2.yaml` validates through production v2 compiler/shared resolver; shipped artifact dispositions validate through declared production readers. |
|
||||||
|
| Links | Deterministic local Markdown link test covers the entire fleet book and sitemap. |
|
||||||
|
| Sensitive/example safety | Validator scans every fenced fleet-book example plus the canonical roster for sensitive-like keys, arbitrary command override, and hardcoded Tess/Ultron identities; docs consistently state value-free diagnostics. |
|
||||||
|
| Holds | `docs/reports/deferred/758-fleet-config-deferrals.md` records M3-002, M4-002, M5-002, compatibility, and repository-structure boundaries. |
|
||||||
|
|
||||||
|
## Documentation completion checklist
|
||||||
|
|
||||||
|
- [x] Root PRD exists and remains the #758 requirements authority.
|
||||||
|
- [x] Accepted project-specific fleet book is complete and indexed.
|
||||||
|
- [x] Sitemap links the fleet entry point and operator-critical pages.
|
||||||
|
- [x] No HTTP/API/auth contract changed; OpenAPI/endpoint rows are not applicable.
|
||||||
|
- [x] Working evidence remains under `docs/scratchpads/`; closure and deferral evidence remains under `docs/reports/`.
|
||||||
|
- [x] Canonical source remains in-repository; no external publishing action is in scope.
|
||||||
|
- [ ] Independent exact-head documentation review, PR CI, and FCM-M5-002 release certificate remain post-PR gates and are not claimed here.
|
||||||
|
|
||||||
|
## Live-action boundary
|
||||||
|
|
||||||
|
No migration, canary, rollback, deployment, systemd/tmux/session operation, generated projection, or product mutation was performed. `roster.yaml` remains the sole writable desired-state authority. `mos-comms` remains temporary. Parent issue #758 remains open.
|
||||||
|
|
||||||
|
Validation command results and exact commit/tree evidence are recorded in the task scratchpad and PR body after execution.
|
||||||
71
docs/scratchpads/fcm-m5-001-fleet-config-operator-docs.md
Normal file
71
docs/scratchpads/fcm-m5-001-fleet-config-operator-docs.md
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
# FCM-M5-001 — Fleet configuration operator documentation
|
||||||
|
|
||||||
|
- Task: `FCM-M5-001`
|
||||||
|
- Issue: `#758`
|
||||||
|
- Branch: `docs/758-fleet-config-operator-docs`
|
||||||
|
- Exact base: `9745bc3f29c26b021a478b7ad03cfb494f6c9de3` (tree `4da210da9a71b035130d4160a4a2e691bdfde2da`)
|
||||||
|
|
||||||
|
## Objective
|
||||||
|
|
||||||
|
Deliver the accepted fleet documentation information architecture, operator workflows, operations and migration references, comprehensive contract documentation, and deterministic link/example validation without live fleet action or product mutation.
|
||||||
|
|
||||||
|
## Scope and constraints
|
||||||
|
|
||||||
|
- Documentation, examples, documentation validation, and tracking only.
|
||||||
|
- `roster.yaml` remains the sole writable desired-state authority; generated state is derived/observed.
|
||||||
|
- No M4-002 implementation or execution; no canary, migration, rollback, deployment, systemd/tmux/session, generated projection, or product mutation.
|
||||||
|
- `mos-comms` is temporary and is not permanent architecture.
|
||||||
|
- Parent issue `#758` remains open through M5.
|
||||||
|
- No credentials, sensitive values, or privileged command content.
|
||||||
|
|
||||||
|
## Plan
|
||||||
|
|
||||||
|
1. Update tracking first with exact M4-001 evidence and mark M5-001 in progress.
|
||||||
|
2. Map the M0 checklist and current implementation behavior to documentation pages.
|
||||||
|
3. Author operator, operations, migration, schema/reference, recovery, troubleshooting, and security/authority docs.
|
||||||
|
4. Add or extend deterministic documentation/link/example validation if required, red-first.
|
||||||
|
5. Run repository documentation, link, example, and relevant package checks; review and remediate.
|
||||||
|
6. Commit, queue-guard, push one branch, and open one wrapper-created PR; stop for independent review.
|
||||||
|
|
||||||
|
## Budget
|
||||||
|
|
||||||
|
- Task estimate: `24K`.
|
||||||
|
- Working cap: stay within the card estimate by parallelizing read-only discovery and limiting edits to checklist-required artifacts.
|
||||||
|
|
||||||
|
## Progress checkpoints
|
||||||
|
|
||||||
|
- [x] Loaded repository/global delivery and documentation contracts.
|
||||||
|
- [x] Verified `origin/main` is exact required base and created isolated worktree.
|
||||||
|
- [x] Tracking updated first.
|
||||||
|
- [x] Checklist mapped and docs authored.
|
||||||
|
- [x] Validation green.
|
||||||
|
- [x] Review/remediation complete.
|
||||||
|
- [ ] Commit, queue guard, push, PR.
|
||||||
|
|
||||||
|
## Tests and verification
|
||||||
|
|
||||||
|
- Red-first documentation validator initially failed for the absent fleet entry point and canonical
|
||||||
|
example, then passed after the IA and example were added.
|
||||||
|
- `pnpm --filter @mosaicstack/mosaic exec vitest run src/fleet/roster-v2.spec.ts src/fleet/example-profile-dispositions.spec.ts src/fleet/fleet-documentation.spec.ts src/fleet/v1-v2-migration.spec.ts src/fleet/generated-env-boundary.spec.ts src/fleet/fleet-agent-crud.spec.ts src/fleet/fleet-reconciler.spec.ts` — 7 files, 195 tests passed after building workspace dependencies.
|
||||||
|
- `pnpm format:check` — passed.
|
||||||
|
- `pnpm lint` — 23 tasks passed.
|
||||||
|
- `pnpm typecheck` — 42 tasks passed.
|
||||||
|
- `pnpm test` — 43 tasks passed; `@mosaicstack/mosaic` contributed 61 files and 1,045 tests.
|
||||||
|
- `bash packages/mosaic/framework/tools/quality/scripts/verify-sanitized.sh` — passed.
|
||||||
|
- `bash packages/mosaic/framework/tools/quality/scripts/check-resident-budget.sh` — passed.
|
||||||
|
- `git diff --check` — passed before final review.
|
||||||
|
- Independent staged-snapshot review identified four documentation/validation blockers: reboot safety,
|
||||||
|
heartbeat observation, migration failure envelope, and example-scan coverage. All were remediated;
|
||||||
|
focused rereview approved the staged remediations with no blockers. Exact committed-head review remains
|
||||||
|
a post-PR gate.
|
||||||
|
- Post-remediation `@mosaicstack/mosaic` lint/typecheck passed; package test passed 61 files / 1,045
|
||||||
|
tests; sanitization and resident-budget gates passed again.
|
||||||
|
|
||||||
|
## Risks/blockers
|
||||||
|
|
||||||
|
- Checklist may include behavior intentionally deferred to M4-002/M5-002; such items must be recorded as approved-existing holds rather than claimed delivered.
|
||||||
|
- Commands/examples must remain non-live and avoid privileged/sensitive content.
|
||||||
|
|
||||||
|
## Final evidence
|
||||||
|
|
||||||
|
- Pending.
|
||||||
131
packages/mosaic/src/fleet/fleet-documentation.spec.ts
Normal file
131
packages/mosaic/src/fleet/fleet-documentation.spec.ts
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
import { readFile, readdir } from 'node:fs/promises';
|
||||||
|
import { dirname, extname, join, resolve } from 'node:path';
|
||||||
|
import { fileURLToPath } from 'node:url';
|
||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import { parseRosterV2, validateRosterV2Semantics } from './roster-v2.js';
|
||||||
|
|
||||||
|
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..', '..');
|
||||||
|
const repositoryRoot = resolve(packageRoot, '..', '..');
|
||||||
|
const fleetDocs = join(repositoryRoot, 'docs', 'fleet');
|
||||||
|
const frameworkFleet = join(packageRoot, 'framework', 'fleet');
|
||||||
|
|
||||||
|
const REQUIRED_FLEET_PAGES = [
|
||||||
|
'README.md',
|
||||||
|
'concepts/desired-vs-observed-state.md',
|
||||||
|
'concepts/identity-class-runtime.md',
|
||||||
|
'concepts/role-authority-and-leases.md',
|
||||||
|
'concepts/generated-env-launch-chain.md',
|
||||||
|
'reference/roster-v2.schema.json',
|
||||||
|
'reference/roster-v2-fields.md',
|
||||||
|
'reference/cli.md',
|
||||||
|
'reference/role-classes.md',
|
||||||
|
'reference/lifecycle-transitions.md',
|
||||||
|
'reference/status-and-drift.md',
|
||||||
|
'how-to/create-update-delete-agent.md',
|
||||||
|
'how-to/start-stop-restart.md',
|
||||||
|
'how-to/configure-tess-interaction.md',
|
||||||
|
'how-to/configure-ultron-validator.md',
|
||||||
|
'how-to/customize-roles.md',
|
||||||
|
'operations/reconcile-and-recover.md',
|
||||||
|
'operations/env-quarantine.md',
|
||||||
|
'operations/systemd-tmux-troubleshooting.md',
|
||||||
|
'operations/backup-restore.md',
|
||||||
|
'operations/upgrade-assets.md',
|
||||||
|
'migration/v1-to-v2.md',
|
||||||
|
'migration/example-profile-disposition.md',
|
||||||
|
'migration/legacy-class-aliases.md',
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
async function markdownFiles(root: string): Promise<string[]> {
|
||||||
|
const entries = await readdir(root, { withFileTypes: true });
|
||||||
|
const paths = await Promise.all(
|
||||||
|
entries.map(async (entry): Promise<string[]> => {
|
||||||
|
const path = join(root, entry.name);
|
||||||
|
if (entry.isDirectory()) return markdownFiles(path);
|
||||||
|
return extname(entry.name) === '.md' ? [path] : [];
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
return paths.flat().sort();
|
||||||
|
}
|
||||||
|
|
||||||
|
function localMarkdownTargets(source: string): string[] {
|
||||||
|
return [...source.matchAll(/\[[^\]]*\]\(([^)]+)\)/g)]
|
||||||
|
.map((match): string => match[1] ?? '')
|
||||||
|
.filter(
|
||||||
|
(target): boolean =>
|
||||||
|
target !== '' &&
|
||||||
|
!target.startsWith('#') &&
|
||||||
|
!target.startsWith('http://') &&
|
||||||
|
!target.startsWith('https://') &&
|
||||||
|
!target.startsWith('mailto:'),
|
||||||
|
)
|
||||||
|
.map((target): string => decodeURIComponent(target.split('#', 1)[0] ?? ''));
|
||||||
|
}
|
||||||
|
|
||||||
|
function fencedCodeBlocks(source: string): string[] {
|
||||||
|
return [...source.matchAll(/```[^\n]*\n(.*?)```/gs)].map((match): string => match[1] ?? '');
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('fleet operator documentation', (): void => {
|
||||||
|
it('ships every accepted information-architecture page', async (): Promise<void> => {
|
||||||
|
await expect(
|
||||||
|
Promise.all(REQUIRED_FLEET_PAGES.map((path) => readFile(join(fleetDocs, path), 'utf8'))),
|
||||||
|
).resolves.toHaveLength(REQUIRED_FLEET_PAGES.length);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('resolves every local Markdown link in the fleet book and sitemap', async (): Promise<void> => {
|
||||||
|
const files = [...(await markdownFiles(fleetDocs)), join(repositoryRoot, 'docs', 'SITEMAP.md')];
|
||||||
|
const missing: string[] = [];
|
||||||
|
for (const file of files) {
|
||||||
|
const source = await readFile(file, 'utf8');
|
||||||
|
for (const target of localMarkdownTargets(source)) {
|
||||||
|
try {
|
||||||
|
await readFile(resolve(dirname(file), target), 'utf8');
|
||||||
|
} catch {
|
||||||
|
missing.push(`${file.slice(repositoryRoot.length + 1)} -> ${target}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
expect(missing).toEqual([]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('validates the canonical documentation example through the production compiler and resolver', async (): Promise<void> => {
|
||||||
|
const source = await readFile(join(fleetDocs, 'examples', 'roster-v2.yaml'), 'utf8');
|
||||||
|
const roster = parseRosterV2(source, 'yaml');
|
||||||
|
const validated = await validateRosterV2Semantics(roster, {
|
||||||
|
rolesDir: join(frameworkFleet, 'roles'),
|
||||||
|
overrideDir: join(fleetDocs, 'examples', 'roles.local'),
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(validated.generation).toBe(1);
|
||||||
|
expect(validated.agents.map((agent) => agent.canonicalClass)).toEqual([
|
||||||
|
'code',
|
||||||
|
'interaction',
|
||||||
|
'validator',
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('keeps every fenced fleet example free of sensitive values, arbitrary commands, and product-hardcoded identities', async (): Promise<void> => {
|
||||||
|
const violations: string[] = [];
|
||||||
|
for (const file of await markdownFiles(fleetDocs)) {
|
||||||
|
const source = await readFile(file, 'utf8');
|
||||||
|
for (const [index, block] of fencedCodeBlocks(source).entries()) {
|
||||||
|
if (/(?:secret|token|password|credential|MOSAIC_AGENT_COMMAND)/i.test(block)) {
|
||||||
|
violations.push(`${file.slice(repositoryRoot.length + 1)}#block-${index + 1}: sensitive`);
|
||||||
|
}
|
||||||
|
if (/\b(?:Tess|Ultron)\b/.test(block)) {
|
||||||
|
violations.push(`${file.slice(repositoryRoot.length + 1)}#block-${index + 1}: identity`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const rosterSource = await readFile(join(fleetDocs, 'examples', 'roster-v2.yaml'), 'utf8');
|
||||||
|
if (/(?:secret|token|password|credential|MOSAIC_AGENT_COMMAND)/i.test(rosterSource)) {
|
||||||
|
violations.push('docs/fleet/examples/roster-v2.yaml: sensitive');
|
||||||
|
}
|
||||||
|
if (/\b(?:Tess|Ultron)\b/.test(rosterSource)) {
|
||||||
|
violations.push('docs/fleet/examples/roster-v2.yaml: identity');
|
||||||
|
}
|
||||||
|
expect(violations).toEqual([]);
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user