Skip to content

feat(execution): manage company task fleets - #438

Merged
allisonmahmood merged 7 commits into
mainfrom
tier2/405-fleet-controller
Oct 1, 2026
Merged

allisonmahmood merged 7 commits into
mainfrom
tier2/405-fleet-controller

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

Tier 2 documents need a company task before server calls can run. Hosts need to bind, drain and replace those tasks without replaying held calls or losing metering.

Adds a database-backed fleet controller exercised against real local task processes. It manages spare capacity, atomic binding, stopping and rollout, housekeeping, bound/process metering, and the cross-host breaker. The shell uses the T-1 starting cover picked in #385, with bounded held calls, focus handling and retry without replay.

Stacked on tier2/404-dev-engine. This PR targets that branch and contains only the fleet work and its starting-cover refinement. Production admission remains closed until the ECS provider lands.

Closes #405.

Verification

  • Current head: server and dependency builds passed; all five Chromium starting scenarios passed.
  • Fleet implementation: full offline suite passed, 132 files and 1,444 tests. After review fixes, 80 focused regression tests, typecheck, server build and lint passed.
  • Standards and specification reviews cleared all findings on the fleet implementation.

Fleet implementation and PR preparation used GPT-6 Astra in omp. The starting-cover follow-up credits Claude Opus 5.5.

@github-actions github-actions Bot added area:server Touches the server area area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:core Touches the core area area:docs Touches the docs area area:ui Portal and first-party browser pages, shared rendering and styles size:xl Over 1,000 changed lines; review in multiple passes labels Sep 29, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Astra review

Reviewed origin/tier2/404-dev-engine...HEAD, base cc98e886, head ca85e534, against #405 and #384. One pass, no subagents. Only merge-blocking findings.

Standards

No separate merge-blocking method or YAGNI findings.

Spec

1. Intent: the local fleet cannot work across independently constructed hosts

Each host creates its own provider, whose task inventory is an instance-local Map. The database bindings and housekeeping lease are shared, but task discovery and management routing are not.

A second host selects the first host's active binding, then fails to load its bundle because that task is absent from its provider. Once the second host takes the housekeeping lease, the missing-task branch records the still-running task as stopped. It can then launch a replacement without stopping the original, exceeding the fleet budget and recording a false stop time.

#405 requires the controller to run against a local task provider so "every state transition is testable offline", with the housekeeping lease "held by one replica" for replenishment and orphan reconciliation. #384 §5 specifies a "global pool of spares". The current two-replica tests share one provider object, hiding the host composition failure.

Reproduced with disposable real Postgres and two independently constructed local providers/controllers:

SECOND_HOST_BIND {"sameTask":true,"result":"Failure","reason":"transport"}
SECOND_HOST_HOUSEKEEPING true
POST_RECONCILIATION {"freshBinding":true,"originalProviderState":"running","actualRunning":2,"databaseLive":1,"budget":1}

Make local task discovery and management routing shared across host instances, and cover this through independently constructed hosts/providers rather than sharing one in-memory provider. A host-local inventory cannot authoritatively reconcile the global fleet. This is an offline-controller blocker, not a request to bring the ECS ticket into scope.

Verification used an isolated smoke script, not a suite rerun. Its task processes and temporary database were cleaned up; repository files were unchanged.

Summary: Standards 0; Spec 1 blocker, cross-host task discovery breaks routing, reconciliation and the fleet budget.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Opus review

Scope: git diff origin/tier2/404-dev-engine...HEAD, read against #405, spec #384 §5, §9 and §14, the r298/r304 decisions and the #385 T-1 pick. The migration is spread into all three migrator runs, and the ledger in ADR-0003 and AGENTS.md, the glossary, limits.md, API.md, ADR-0012 and the ui-consistency amendment are all updated. The claim/fence/adopt SQL, the idle check against advisory locks and the breaker window all hold up. Four blocking findings, most severe first.

1. The 15 s housekeeping lease can't outlast a real cold start, so an empty-pool first open always hits start_failed

packages/execution/src/fleet.ts:392-394 (and 314-319), with the lease at packages/limits/src/registry.ts:548.

provider.start blocks until the task is ready: TaskProvider.Task.readyAt is non-null, and the local provider awaits ready. The lease is only renewed by guard between steps. r304 measured a full empty-pool first open at 35 s, and Fargate startup alone is about 25 s. So:

  • The guard right after provider.start fails with LeaseLost.
  • Because of that, store.ready never runs and the new task stays starting. It only becomes a claimable spare on a later pass, after the lease is re-acquired.
  • On the lease holder, ensure runs housekeeping() inline (fleet.ts:444). The LeaseLost surfaces there as source_unavailable, which becomes start_failed at about 35 s.
  • On any other replica, the spare becomes claimable only after the next pass (5 s interval plus the idempotent re-start). That is over 40 s, so it also ends in start_failed.

This is exactly the case the 40 s bound was sized for. Replenishment is also serial: one blocking start per loop iteration, so a lease pass adds at most one spare.

Fix: renew the lease from a background fiber for the whole pass, or make start launch-only and let a later pass move starting → spare once the task is ready (the state already exists). store.ready needs no lease guard; it is conditional on state = 'starting' and idempotent.

2. One failing task halts housekeeping for the whole fleet, and ensure passes the failure on to opens

fleet.ts:297-368 (per-task and per-binding work), 369-397 (replenishment and emitBindings), 444.

Nothing is isolated per item. Any error from collect/provider.stats, the provider.bind of a claiming binding, or provider.stop in finishStop fails the entire pass. Replenishment and binding events come after the bindings loop. So one wedged or unreachable task, one the provider still lists as running while its stats call fails, means:

  • no spares are ever replenished;
  • bindings later in the loop are never released for idleness;
  • the same happens on every pass, on whichever replica holds the lease.

Because ensure does not catch housekeeping(), every empty-pool open on the lease holder fails at once instead of waiting out the pool bound. post in localTaskProvider.ts:234-247 has no timeout, so a wedged supervisor hangs the pass indefinitely while it holds housekeepingLock.

Fix:

  • catch and log failures per task and per binding;
  • run replenishment independently of per-binding work;
  • bound provider calls with a timeout;
  • in ensure, ignore housekeeping failures and keep polling for a spare until execution.pool.wait.

3. Presence depends on one reserved session that never recovers

fleet.ts:67 and 93-107.

Every document's company lock and every admission's binding lock is a session-level advisory lock on one sql.reserve connection per replica. That connection can drop: a Neon compute restart, a failover or a network reset. When it does:

  • Postgres releases all of that replica's presence and admission locks, while its streams stay open.
  • idleFence then sees no holders, and after the idle window it releases companies that still have connected documents.
  • Every later hold runs on the dead connection and fails. acquire and connect map that to source_unavailable, so every tier 2 open and server.call on that replica is refused until the process restarts.

Nothing detects or reports any of this.

Fix: on a session error, reserve a new session and re-take the shared locks for the keys still held (track them in memory), or fail the host's readiness so it gets replaced.

4. Rollouts: registering a revision at host startup strands every bound company, and a rollback can't restore the old revision

fleet.ts:71 and 413-418; fleetStore.ts:102-110, 131-135 and 252-258.

Fleet.make registers its revision as current as soon as the first new host starts, before any spare of that revision exists. From then on:

  • claim only takes new-revision spares, and there are none.
  • Every acquire for a company bound to an old task fences it through isCurrentTask.
  • Housekeeping drains the old spares.

Every active company needs a cold start at the same moment. The target is about 2 spares, started serially (finding 1), so past the first couple of companies they get start_failed on every deploy. A crash-looping new host still flips "current".

Rolling back to the earlier revision can't make it current again: registerDeployment is ON CONFLICT DO NOTHING and "current" is the highest ordinal. The controller keeps starting tasks from the bad revision until someone runs retireDeployment by hand.

Fix: promote a revision explicitly, either by a controller operation the deploy runs or once its spares reach the floor, and let a rollback promote an earlier revision. Until a revision is promoted, keep claiming and binding on the current one.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Addressed the five blocking findings in 9b6741f; retained the T-1 UI commit ca85e53 unchanged.

  • Astra 1 — fixed. Independently constructed local providers now share a private task directory and detached, flock-owned supervisors. Host shutdown no longer owns task shutdown. Discovery, management routing, final reports and observed stops survive the launching host. Tests use separate providers, exercise another host's callback, transfer the lease and compare actual live processes with the fleet budget. Unknown process ownership retains the slot rather than inventing a stop.
  • Opus 1 — fixed. Housekeeping renews its lease throughout provider work and starts spares concurrently. Opens start housekeeping without awaiting the whole pass and retain the full pool deadline. The regression covers a 25-second cold start with a 15-second lease and a 40-second waiter bound.
  • Opus 2 — fixed. Provider operations are bounded; reconciliation isolates failed tasks/bindings, and replenishment runs independently. Stats, bind, stop and start failures no longer abort unrelated work or immediately fail waiting opens.
  • Opus 3 — fixed. Activity holds are reference-counted. A failed reserved session is replaced and its live locks reacquired; bounded idle probes also recover documents making no requests. Real Postgres backend-termination regressions cover recovery and correct release. Observed activity refreshes the idle timestamp so the reconnect gap does not immediately idle a long-open document.
  • Opus 4 — fixed. Registration does not promote an established fleet. Explicit stage/warm/promote operations require ready capacity and support promotion of an earlier, retired revision for rollback. Existing companies move incrementally to ready replacements while admitted calls retain their old binding.

Kept: production refuses the local provider; ECS remains outside this ticket. The local provider requires a shared Linux filesystem/process/network namespace and stable callback ports. The supervisor still reports invocation failure promptly: the CI breaker test now waits for the actual terminal report before collection, retaining the assertion of exactly six durable kill reports rather than weakening it.

Additional review: Standards and Spec reviewers independently found the same owner startup-record race. Child identity is now persisted before the initialize handshake. A deterministic real-process smoke with a delayed identity read reproduced lost readiness before the fix and preserved readiness afterward. Both axes then reported no remaining findings.

Verification: 26 targeted tests passed; the full offline suite passed (133 files, 1,455 tests). After the startup ordering fix, typecheck, lint, server/dependency build, all four provider tests and all five Chromium starting/fleet scenarios passed. Documentation, the dev-loop skill, runtime glossary and disposable host fixtures match the new lifecycle/configuration. No public CLI or wire contract changed; migration 0014 remains wired through all three migrators.

Read conversation comments, review bodies and inline comments again after the push; no Grok feedback was present. Latest-commit CI confirmation is pending below; this PR has not been merged.

@allisonmahmood

allisonmahmood commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner Author

CI exposed a TestClock/Postgres synchronization race in the new active-housekeeping regressions: simulated time could advance past lease expiry while real SQL or its continuation was still pending. SQL observation barriers did not fully solve that scheduling mismatch. Commit 52c21c3 removes those barriers and runs the cold-start and failure-isolation scenarios with a live clock, real Postgres and actual supervisors. The 25-second cold start, 15-second lease, competing-host refusal, same lease epoch, concurrent starts, 40-second admission bound and completion despite wedged stats remain asserted. Idle and breaker windows still use TestClock. Production code is unchanged. All 15 fleet tests passed on Node 24.20.0 (including the actual 25-second startup and 40-second wedged-call bound); lint passed. Waiting for CI on 52c21c3.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Address round complete at 9dcfcc5. This supersedes the earlier CI-pending updates and the live-clock approach in 52c21c3.

Fixed

  • Astra: independent hosts could not see/manage each other's tasks. Replaced instance-local ownership with shared durable task records and detached task owners, with cross-host routing and process-identity checks. Host shutdown no longer kills shared tasks; uncertain ownership does not free a budget slot.
  • Opus: cold starts outlived the housekeeping lease. Added scoped renewal during the pass, concurrent spare starts and host-scoped housekeeping so admission retains its bounded wait without losing lease fencing.
  • Opus: one failed or wedged provider operation blocked unrelated work. Bounded provider operations and isolated failures per task/binding; healthy companies and spare replenishment can proceed.
  • Opus: losing the reserved SQL session permanently lost activity locks. Added session replacement, live-key replay and periodic recovery, preserving reference counts and idempotent release so open activity survives reconnection.
  • Opus: registration implicitly promoted revisions and prevented rollback. Separated registration, staging and promotion, requiring ready capacity and bounding replacement/draining. Explicitly staging an older revision permits rollback without making registration promote it.
  • Task-owner startup race. Serialized the initial process-identity write before initialization so it cannot overwrite an already published Ready URL.
  • Lease/housekeeping test races. Both cases now use TestClock and an explicit renewal barrier. The real SQL renewal must return and its next timer must be armed before virtual time advances again. A committed row alone was insufficient. Removed the live-clock waits; no wall-clock sleeps or timing increases are used to coordinate these cases. Updated docs/DEVELOPMENT.md with the synchronization invariant.

Kept, with reasons

  • Supervisor fail-fast behavior: a kill notification need not wait for final-report persistence. The test waits for the durable terminal report before collecting and still requires all six reports; production behavior is unchanged.
  • Lease/admission bounds and real integration coverage: the cold-start case still exercises a 25-second start against a 15-second lease within the 40-second admission bound, using real Postgres and child processes. Synchronization replaces scheduler assumptions, not the behavioral assertions.
  • Same-machine Linux local-provider scope and production refusal: shared filesystem/process/network access is still required. ECS support is outside this PR; local ownership must not masquerade as a production provider.
  • The existing CLI publishing tests and their timeouts: Node 22 encountered two different five-second CLI test timeouts on successive attempts. Failed-job retries passed without source or timeout changes. The fleet suite passed on every attempt of this head.
  • User UI commit ca85e53 and stacked base tier2/404-dev-engine: preserved; neither belongs to this address round.

Verification

  • Local focused lease/housekeeping scenarios passed; serial pnpm typecheck, pnpm lint, and pnpm test passed (133 files, 1,455 tests).
  • All eight reported checks on 9dcfcc5381f3227c5ae74726517651708bacf7c8 are successful: Node 22, Node 24, lint/format/typecheck, CLI smoke, live Clerk, Postgres concurrency, dependency review and labels. CI run.
  • gh pr checks --required reports no separately required checks for this branch; the complete reported check set is green.
  • Rechecked conversation comments, review bodies and inline comments after CI: no new findings. PR remains open, non-draft and mergeable; not merged.

Addressed with OpenAI GPT-6 Astra in omp.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Opus re-review

I re-reviewed git diff ca85e53..9dcfcc5 against my four findings and Astra's. All five are resolved, and the rework adds no new blockers.

  1. Lease vs. cold start: resolved. The pass now renews the lease on a timer (every lease / 3) while it runs (fleet.ts, the raceFirst around work). Spares start concurrently, and each task has its own pool.wait timeout. ensure no longer runs housekeeping inline and no longer fails with it: requestHousekeeping forks a pass and skips if one is already running. The waiter also wakes when a spare becomes ready. The 25 s start against a 15 s lease test covers this.
  2. Failure isolation: resolved. Every task, binding, orphan and start step goes through isolate, which has a timeout and logs the failure. LeaseLost still passes through. Replenishment now runs alongside the reconcile steps and repeats while they are slow. A failed list only skips reconciliation. The new test with a wedged stats call, a failed bind and a failed stop shows healthy companies still claiming new spares.
  3. Presence session: resolved. FleetActivity bounds each query, replaces a dead session, re-takes every held key and keeps the per-key reference counts. It also checks the session every interval, so locks come back without waiting for a new request. Interrupting a blocked lock call sends a cancel request (the Effect pg driver pins the connection), so no lock leaks onto a pooled connection. The short gap during a reconnect is harmless: idleFence now clears idle_since whenever the locks are held, and in-flight calls are still covered by protected_until.
  4. Promotion and rollback: resolved. Registering a host only stages its revision, and only when nothing is current yet (the first deploy). Promotion is explicit and needs ready spares at the floor. Tasks on any non-retired revision stay admissible, so no active company is stranded. replaceDeploymentBinding fences the old binding and claims the new one in a single transaction, and only when a current spare exists. Rollback is stageDeployment plus promoteDeployment on the earlier revision.
  5. Astra, private task inventories: resolved. The shared on-disk inventory, identity fixed on creation (link), task owners that outlive their host, and /proc process-identity checks give every host one view of all tasks. Closing a host no longer stops its tasks. The new provider test routes a second host to the first host's task after that host closes.

Not blocking, for the record:

  • Only one deployment replacement runs at a time (fleetStore.ts replaceDeploymentBinding, the pending check). A deployment stopping binding whose stop keeps failing would stall the rollout, but old tasks keep serving, so it fails safe.
  • releaseActivity is still Effect.orDie. If the database fails for both the unlock attempt and its retry, a completed call's release turns into a defect. This predates the rework.
  • localTaskOwner and localTaskStore are a lot of machinery for an offline provider, but they are what Astra's finding needed.

All eight checks are green on 9dcfcc5.

allisonmahmood and others added 7 commits October 1, 2026 06:35
Implement #405 with a real-process local provider, durable fleet lifecycle and metering, breaker admission, and the T-1 starting flow. Production remains closed pending the ECS provider.
The T-1 cover now matches the picked mock: a static dim over the frame with
one centred note-float. Starting is blue with the elapsed time ("12 s so far")
rewritten once a second, no spinner. start_failed turns the same note amber
with Try again and holds through automatic bind retries until ready, Try again
or a resume. The dialog keeps the name "Starting your tools" and the elapsed
line stays outside the live region.

supporting-text moves into core's shell subset so the served wrapper has it.
ui-consistency, API.md and ADR-0010/0012 follow the new copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood force-pushed the tier2/405-fleet-controller branch from 9dcfcc5 to 6923ee5 Compare October 1, 2026 04:35
@allisonmahmood
allisonmahmood merged commit a2f4553 into main Oct 1, 2026
8 checks passed
@allisonmahmood
allisonmahmood deleted the tier2/405-fleet-controller branch October 1, 2026 04:48
allisonmahmood added a commit that referenced this pull request Oct 29, 2026
…uns 24 boxes (#984)

## What changed

Company boxes and hosts ran on half a vCPU, and production capped the
fleet at 15 boxes with 2 warm spares. Both now get a full vCPU (memory
stays 2 GiB), and the fleet can run 24 boxes with 3 warm spares. Patches
should feel quicker, and more companies can be open at once before
anyone waits for a box. 24 is what the account's current 30-vCPU Fargate
quota allows at a full vCPU each; the budget goes to 30 once the quota
is raised.

## Look at

1. **The sizes and the fleet limits** in `apps/infra/src/AppStack.ts`:
exec and host task definitions go `512` → `1024` CPU units, and the
hosts' `PATCHY_LIMITS_JSON` goes `{"execution.fleet.budget":15}` →
`{"execution.fleet.budget":24,"execution.pool.spares":3}`. A new infra
case pins them. It fails against main's stack and passes on this branch:

   ```
   # main's AppStack.ts with this branch's test
× gives hosts and company boxes a full vCPU, and the fleet 24 boxes with
three spares
AssertionError: Template has 2 resources with type
AWS::ECS::TaskDefinition, but none match as expected.
   Tests  1 failed | 6 passed (7)

   # this branch
   Test Files  1 passed (1)
        Tests  7 passed (7)
   ```

2. **`execution.task.cpu` and `execution.task.memory` stay, but inert
and truthful.** Nothing reads them: the ECS provider sends no size
override, so the exec task definition sets every box's size. Their
defaults now match it (1 vCPU, 2 GiB), and their measure says they
aren't read and are kept so existing configuration still loads.
`docs/limits.md` says where the size comes from. A `PATCHY_LIMITS_JSON`
naming either id still loads, and stored override rows can still be read
and removed. Removing the ids is a separate change that needs a
deprecation path. The limits docs and skill snapshots are regenerated.

3. **The Fargate vCPU quota** in `docs/OPERATIONS.md` › Production. The
account's Fargate On-Demand vCPU quota must cover 24 boxes + 4 hosts
mid-deploy + the promote task, which is **29 vCPUs** (it was 10), inside
the current 30. Fargate refuses launches past the quota, so raising the
budget to 30 needs the quota raised first.

4. **Freeing budget for a promotion**, a new runbook in OPERATIONS.md ›
Rolling back. Housekeeping never trims the current revision's surplus
spares. So a rollback to an older release (budget 15, floor 2) can stall
forever with **no company bound** once this release holds 14 or more
spares. Waiting and re-running don't help. The runbook has two
statements for the platform database:
- **A count query** that diagnoses the stall and gives `stops`: `max(0,
live + max(0, floor − staged spares and starting) − budget)`. `live` is
every `starting`, `spare` and `bound` task of either revision, so a
fleet already over the staged budget is covered; `stopping` tasks are
already leaving, so recounting right after a fence is correct.
- **The fence** the controller itself puts on a spare before stopping it
(`fleet.ts`, `drainTask`). It sets the current revision's newest `spare`
rows to `stopping` with `FOR UPDATE SKIP LOCKED`, so it never takes a
row a claim holds, and a claim never takes a row it holds.
Housekeeping's reconcile stops every `stopping` task through ECS on its
next pass, so the operator never calls ECS. That path has existed since
the fleet landed (#438), so every release production could roll back to
has it.

If `stops` is more than the eligible spares, the runbook says the rest
must come from bound companies going idle, and to count again each
round.

A throwaway probe on this head ran both statements verbatim
(placeholders filled) with the real controller and store, disposable
Postgres and the memory provider:

   ```
   race A: fence in open transaction [race-spare-00]
   race A: claim while fence uncommitted no spare
   race A: claim after commit no spare   # row is stopping
   race B: claim in open transaction race-spare-01
   race B: fence while claim uncommitted []
   race B: fence after commit []         # row stays bound
   stalled [larger spare 16] promoted false
count {live 16, stopping 0, current_spares 16, staged_spares 0, stops 3}
   fenced [larger-spare-13, larger-spare-14, larger-spare-15]
   count after fence {live 13, stopping 3, stops 0}
pass 1 [larger spare 13] promoted false # the controller stopped the
three
   pass 2 [larger spare 13, older spare 2] promoted true
after promotion [older spare 2] # the surplus drains on its own
   ```

This PR adds no controller test for it, because `packages/execution`
belongs to another lane this round. The probe is the reproduction.

Docs that followed: OPERATIONS.md (promotion now needs **three** ready
spares within **24**), ADR-0012's production topology and hosting
decisions 1–2, product.md's box size and cost promise (about $36 a month
for an always-on box instead of $21, with the per-call figures scaled
the same way), and a `packages/serving` comment that said "half a vCPU".
ADR-0012's spike measurements still say half a vCPU on purpose: they
record what was measured. The spike script keeps its own 512.

## How it was verified

- `pnpm --filter @patchy/infra exec vitest run`: red on main's stack,
green here (above). The security-group snapshot doesn't cover task
sizes, so it is unchanged.
- `packages/limits` and `apps/infra` tests: 6 files, 32 tests pass. A
probe loads `{"execution.task.cpu":0.5}` and
`{"execution.task.memory":2147483648}` on this head without error, as on
main.
- `pnpm check`: format, lint, typecheck and synth pass. The offline
tests fail locally in the `packages/patchy` CLI suites and
`LocalTaskProvider`. That's stray `GET /` requests from another process
on the shared machine reaching the tests' fake servers on random
localhost ports (`expected { method: 'GET', url: '/' } to match object {
url: '/api/me' }`). A different set fails on every run, and
`SdkApi.test.ts`'s two 5-second timeouts pass when run alone (21/21). CI
is the clean run.
- Not checked: the deploy and a real ECS rollback. The runbook's
statements ran against Postgres with the real controller, not against
production.

## Release impact

- [ ] **Breaking** — requires action from anyone already running this
- [x] **Not breaking** — no action required

Infrastructure sizing and production's fleet limits, which fit the
account's current Fargate vCPU quota, so nothing is needed before
deploying. No API, CLI, schema or configuration-format change: every
limit id that loaded before still loads, and stored overrides stay
readable. The deployment configuration's revision hash changes because
`execution.task.cpu`'s default moved from 0.5 to 1. It changes whenever
a resolved value does, and nothing reads that value.

- **What does a revert leave behind?** Nothing stored: no schema, no
rows. Exec task definitions are retained on replacement, so the 1-vCPU
revision stays registered, and the previous release's hosts can still
launch and manage its spares until promotion.
- **Does the release before it still work with that?** Yes. An older
release's stacks carry their own sizes (0.5 vCPU), budget (15) and spare
floor (2), and the deploy record hands its hosts this release's exec
task definition as "previous". Its promotion needs two ready spares
inside 15 live tasks, counting this release's bound boxes and spares.
Once this release holds 14 or more spares, that never happens on its
own, even with no company bound.

Rollback line for the deploy: if this release misbehaves, roll back to
the live commit. If the rollback's promote step times out short of two
older spares, follow OPERATIONS.md › Freeing budget for a promotion:
count, fence `stops` of this release's newest spares with the
controller's own fence, recount until the older revision has its two
spares, then re-run the run. If there aren't enough spares to fence, the
rest of the room comes from bound companies going idle.

Made by Claude Opus 5.5 via Claude Code; reviewed with GPT-6.1-Sol.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:core Touches the core area area:docs Touches the docs area area:server Touches the server area area:ui Portal and first-party browser pages, shared rendering and styles size:xl Over 1,000 changed lines; review in multiple passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(execution): the fleet controller: spares, bind and release, starting, the stopping state, the housekeeping lease, the breaker, bound seconds

1 participant