Agents Builders

Elastic worktree Redis capacity (steady-state 20, scale in/out by 10)

Archived Priority 1 steffon
task-ec282d05a59c

From the 2026-06-17 doc audit + scale discussion with Mr. McRitchie. Worktree slug: worktree-redis-elastic-capacity bin/agent-worktree allocates one Redis logical DB per worktree from a fixed 9-15 range (7 slots) and hard-aborts when full. Make the worktree Redis capacity idle at 20 slots, grow by 10 when exhausted, and shrink by 10 (floor 20) as worktrees close -- WITHOUT restarting Redis during normal operation. Design: separate physical capacity (Redis 'databases', restart-bound) from a soft band (the allocatable slot range). Provision generous physical capacity once (databases=64); keep the band elastic + restart-free within it. Persist current_capacity in .agents/redis-capacity.json. Add 'bin/agent-worktree scale [status|out|in|--provision]'. Flush a worktree's Redis DB on remove. Guard allocate+capacity mutation with a file lock. Add a capacity block to the registry snapshot for the future /devops panel. NOTE: this is LOCAL dev parallelism only (single machine, one localhost Redis). The 100-agent horizontal goal is a separate per-agent-infra track, not this.

Created

Jun 17, 23:15

Started

Jun 17, 23:39

Completed

Jun 18, 13:12

DevOps handoff

Type

Feature

Shape

Worktree Slug

Repositories

mcritchie-studio

Release Train

Branch

feat/worktree-redis-elastic-capacity

infra devops redis worktree scaling

Acceptance Criteria

  • scale status reports floor 20 / step 10 / current band / used / free / physical ceiling from redis-cli CONFIG GET databases
  • With Redis provisioned the 21st concurrent worktree auto-grows the band 20 to 30 (logged) with no restart and no error
  • Allocating past the physical ceiling aborts with actionable guidance (scale --provision or cleanup)
  • Removing worktrees until free is 10 above floor auto-shrinks 30 to 20 (logged) and never below 20
  • scale --provision raises Redis databases to target and restarts Redis exactly once; idempotent; warns it bounces stacks; --yes skips confirm
  • remove flushes the worktree Redis DB so no stale keys appear on DB-number reuse
  • allocate plus capacity mutation guarded by a file lock so concurrent new/up cannot double-allocate or corrupt state
  • registry snapshot includes a capacity block (floor / step / current / used / free / physical_max)
  • No regression in plan/new/up/list/remove/cleanup/snapshot when capacity is ample; ruby -c clean; existing tests green
  • Docs: worktrees.md and parallel-agent-devops.md document the lifecycle plus scale subcommand plus restart caveat; AGENTS.md regenerated via bin/install-agent-docs post-merge

Expected Test Plan

  • ruby -c bin/agent-worktree (PASS)
  • bin/agent-worktree scale status (PASS read-only)
  • bin/agent-worktree list regression (PASS)
  • QA on provisioned Redis: scale --provision then live grow 20 to 30 and shrink 30 to 20
  • bin/install-agent-docs check post-merge

Checks Run

No completed checks recorded.

Stage Timeline

Who handled each stage, the time it took (measured), and the model / tokens / cost reported (best-effort) — plus who's on it right now. means the agent didn't report that metric.

No stage changes recorded yet.

Conversation

QA review feedback, agent handoffs, and follow-up notes for this task.

Handoff avi 9 days ago

Marked done after production deployment McRitchie Studio v70 at 82b1791. PR #31 elastic worktree Redis capacity is merged, CI was green, commit 03aff75 is included in production SHA 82b1791, and production /devops responds with an authenticated redirect.

Sealed-bid sizing

Edit →

Alex (PM)

Avi (PO)

Dev

Actual