AgentEvalTool/migrations/versions/c5d8f0a2e4b7_add_patrol_watermark_to_campaigns.py
sinohqb 6340ec503c feat(exploration): stateless patrol API with watermark increments
Resident agents call GET /api/exploration/patrol once per cycle to see
every running production-line campaign that opted into exploration
(seed set present), the new results since the last watermark (reusing
campaign report aggregation), and the remaining exploration budget.
The watermark advances after each call so subsequent calls only report
increments; accelerated and terminal campaigns are excluded.
2026-08-03 18:12:11 +08:00

27 lines
711 B
Python

"""add campaigns.last_patrolled_at watermark
Revision ID: c5d8f0a2e4b7
Revises: b3c7d9e1f5a2
Create Date: 2026-08-03
"""
from typing import Sequence, Union
import sqlalchemy as sa
from alembic import op
revision: str = "c5d8f0a2e4b7"
down_revision: Union[str, Sequence[str], None] = "b3c7d9e1f5a2"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
with op.batch_alter_table("campaigns") as batch_op:
batch_op.add_column(sa.Column("last_patrolled_at", sa.DateTime(), nullable=True))
def downgrade() -> None:
with op.batch_alter_table("campaigns") as batch_op:
batch_op.drop_column("last_patrolled_at")