Compare commits

...

2 Commits

Author SHA1 Message Date
699ef15ee2 fix(progress): accept workplan_id filter alongside legacy workstream_id
STATE-WP-0065 renamed progress_event.workstream_id to workplan_id in
state-hub; the list endpoint now maps both query params to the model column.
2026-06-22 13:52:13 +02:00
24301ccd60 Mark .repo-classification.yaml human-reviewed (CUST-WP-0050 T02)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 11:40:43 +02:00
2 changed files with 15 additions and 3 deletions

View File

@@ -1,11 +1,10 @@
# Repo classification (Repo Classification Standard v1.0).
# First-pass agent classification (CUST-WP-0050 T02) — pending human review.
repo_classification:
standard: Repo Classification Standard
version: '1.0'
classified_at: '2026-06-22'
classified_by: agent
classified_by: human
category: tooling
domain: infotech
secondary_domains: []

View File

@@ -28,6 +28,7 @@ def create_progress_router(
*,
topic_id: uuid.UUID | None = None,
workstream_id: uuid.UUID | None = None,
workplan_id: uuid.UUID | None = None,
task_id: uuid.UUID | None = None,
decision_id: uuid.UUID | None = None,
event_type: str | None = None,
@@ -37,9 +38,9 @@ def create_progress_router(
offset: int = 0,
) -> list[Any]:
q = select(progress_model)
scope_id = workplan_id if workplan_id is not None else workstream_id
for field, value in (
("topic_id", topic_id),
("workstream_id", workstream_id),
("task_id", task_id),
("decision_id", decision_id),
):
@@ -51,6 +52,16 @@ def create_progress_router(
detail=f"Progress events do not support filtering by {field}",
)
q = q.where(column == value)
if scope_id is not None:
column = getattr(progress_model, "workplan_id", None) or getattr(
progress_model, "workstream_id", None
)
if column is None:
raise HTTPException(
status_code=400,
detail="Progress events do not support filtering by workplan_id",
)
q = q.where(column == scope_id)
if event_type:
q = q.where(progress_model.event_type == event_type)
if event_types is not None:
@@ -66,6 +77,7 @@ def create_progress_router(
async def list_progress(
topic_id: uuid.UUID | None = None,
workstream_id: uuid.UUID | None = None,
workplan_id: uuid.UUID | None = None,
task_id: uuid.UUID | None = None,
decision_id: uuid.UUID | None = None,
event_type: str | None = None,
@@ -78,6 +90,7 @@ def create_progress_router(
session,
topic_id=topic_id,
workstream_id=workstream_id,
workplan_id=workplan_id,
task_id=task_id,
decision_id=decision_id,
event_type=event_type,