Files
the-custodian/state-hub/migrations/versions/l9g0h1i2j3k4_capability_request_routing_note.py
tegwick 634642cb52 feat(capability-requests): add routing_note, PATCH endpoint, word-boundary fix, and ops-bridge tunnel targets
- Add `routing_note` column (migration l9g0h1i2j3k4) to persist why a request was routed to a given domain
- Fix substring-match bug in `_route_capability`: use `\b` word-boundary regex so 'postgres' no longer matches inside 'postgresql'
- Include `title` in keyword scoring for better routing accuracy
- Return `routing_note` string from `_route_capability` and store it on the request
- Add `PATCH /capability-requests/{id}` endpoint + `CapabilityRequestPatch` schema to correct mutable metadata (catalog_entry_id, priority, blocking_task_id, fulfilling_workstream_id)
- Add `patch_capability_request` MCP tool wrapping the new endpoint
- Add 105 lines of routing tests (word-boundary, title-match, multi-entry scoring, broadcast fallback)
- Add `tunnels-up`, `tunnels-status`, `tunnels-check` Makefile targets for ops-bridge managed tunnels

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:47:54 +01:00

20 lines
466 B
Python

"""Add routing_note to capability_requests
Revision ID: l9g0h1i2j3k4
Revises: k8f9a0b1c2d3
Create Date: 2026-03-20
"""
from alembic import op
import sqlalchemy as sa
revision = 'l9g0h1i2j3k4'
down_revision = 'k8f9a0b1c2d3'
branch_labels = None
depends_on = None
def upgrade() -> None:
op.add_column('capability_requests', sa.Column('routing_note', sa.Text(), nullable=True))
def downgrade() -> None:
op.drop_column('capability_requests', 'routing_note')