# fleet.yaml — fleet-wide manifest; Agent/Role/Brain files live under ./fleet/.
#
#   ours-fleet up            create/start every role (idempotent)
#   ours-fleet up Alice      only the named role(s)
#   ours-fleet restart       re-sync + bounce, resuming context
#   ours-fleet down          stop everything
#   ours-fleet config        validate + print the merged plan
#
# Agent files are bare mappings in ./fleet/agents; reusable presets are in
# ./fleet/roles and ./fleet/brains. Kind comes from the directory and ID from filename.
#
# The v2 manifest contains fleet-wide operational policy and automation only.
# Brain and Role settings belong in bare documents under ./fleet/brains and
# ./fleet/roles; Agents compose them under ./fleet/agents. Legacy `roles:` and
# `fleet.d` are rejected. The web editor writes the manifest and direct Agent
# documents transactionally; Role/Brain presets remain read-only. Run
# `ours-fleet config` to validate the complete source set.

api_version: ours.network/fleet/v2

vars:
  work_root: /home/me/work

# Space out agent LAUNCHES host-wide (ms) so a burst of boots doesn't hit the
# harness/API rate limit at once. Default 0 (no stagger). Enforced at the launch
# point, so it covers systemd host-boot too — not just `ours-fleet up`/restart.
# A lone start/restart waits zero; only concurrent boots are spread out.
# (Replaces the retired FLEET_START_STAGGER env var — see README "Start staggering".)
# start_stagger_ms: 4000

defaults:
  permissions:                # common intent translated to each harness/backend
    approval: ask             # ask | allow | deny
    filesystem: workspace     # read-only | workspace | unrestricted
    unattended: deny          # deny | wait when no ACP console is attached
  monitor:
    mode: fleet               # fleet (default): ours-fleet supervisor; native: harness-owned monitor
    interrupt: false          # false: queue; true: cancel; after_tool: steer at an ACP tool boundary

# Harness, model, effort, session, token limits, session_options, and
# harness_options are Brain-owned. Define them in ./fleet/brains and select the
# Brain from each Agent document; see ./fleet/brains/claude-default.yaml.

# Rooms always use ours-cowork; configure its connection directly. The owner
# provider is a separate setting and defaults to messenger-server.
# rooms:
#   cowork:
#     config: /home/me/.ours-cowork/config.json
#   owner:
#     expected_cid: 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
#     public_invite_file: /home/me/.ours-fleet/owner-room-invite.txt
#   defaults:
#     template: team
#     attach_owner: true
#     close_when_task_done: true
#
# tasks:
#   default_room_template: team
#   create_mode: start
#   close_room_on_done: true

# Scheduled internal turns are ACP-only, idle-only, and never build a backlog.
# The base file must be owned by you and not group/world writable when an enabled
# loop is present. A wildcard targets permanent roles only; temp roles do not inherit.
# loops:
#   coordinator_pass:
#     roles: [FleetCoordinator]
#     interval: 10m
#     initial_delay: 10m       # omitted = one full interval; use 0s explicitly for immediate
#     jitter: 30s
#     enabled: true
#     prompt: |
#       Review current fleet state once and unstick only actionable work.
#       If nothing material changed, complete silently without an owner report.
