"""worker_lane.autoscale — may this lane grow itself? Milestone 422 step 7. One boolean, defaulting FALSE on every existing row and on every new one. ## Why the default is false and not "sensible" This is the only part of the milestone that acts without anyone watching. The manual dial (step 4) and the reconcile (step 3) both do exactly what someone asked for; this one decides. Shipping it on would mean every install starts with a process that changes its own resource usage based on a heuristic tuned against nobody's workload. Off also makes the failure mode benign: if the signal is wrong, nothing happens until an operator opts a lane in, and they opted in while watching. ## Why per lane and not one global switch The lanes are not alike in what a slot costs. A `worker` slot is a process; an `ml` slot is another copy of a ~3.5GB model. A global switch would enable growth on a lane whose behaviour under load nobody has observed, and the one it would hurt most is the one whose cost is least visible. Revision ID: 0104 Revises: 0103 Create Date: 2026-09-22 """ from typing import Sequence, Union import sqlalchemy as sa from alembic import op revision: str = "0104" down_revision: Union[str, None] = "0103" branch_labels: Union[str, Sequence[str], None] = None depends_on: Union[str, Sequence[str], None] = None def upgrade() -> None: op.add_column( "worker_lane", sa.Column( "autoscale", sa.Boolean(), server_default=sa.text("false"), nullable=False, ), ) def downgrade() -> None: op.drop_column("worker_lane", "autoscale")