STATE-WP-0070 T04 (partial): drop open_workstreams from /state/summary

Removes the redundant open_workstreams mirror field from StateSummary (schema,
router, MCP get_domain_summary reader, dashboard consumers + empty-state stub,
and tests). Consumers already preferred open_workplans, so this is the
low-risk half of T04.

Deferred (still have live callers — not yet retirement-ready):
- workstream_id query/body field alias on preferred routes — external
  session-close curls/scripts fleet-wide still send it.
- flows/workstream.yaml — /flows/workstream/{id} routes are still served and
  exercised by tests; retire only once no callers remain.

Staged on branch state-wp-0070-legacy-retirement — do not merge until the 7th
documented zero-usage window is captured.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
tegwick 2026-07-13 10:04:38 +02:00
parent ef62cb3872
commit 6d3de59436
8 changed files with 9 additions and 16 deletions

View file

@ -199,7 +199,7 @@ async def build_state_summary(session: AsyncSession) -> StateSummary:
)
open_ws = list(open_ws_rows.scalars().all())
# Task counts per workplan (used to enrich open_workplans / open_workstreams)
# Task counts per workplan (used to enrich open_workplans)
task_per_ws: dict = {}
task_statuses_per_ws: dict = {}
for ws_id, tstat, cnt in await session.execute(
@ -430,7 +430,6 @@ async def build_state_summary(session: AsyncSession) -> StateSummary:
open_capability_requests=open_cap_req_count,
ranked_suggestions=ranked_suggestions,
open_workplans=open_workplan_rows,
open_workstreams=open_workplan_rows,
)
return result
@ -793,7 +792,7 @@ async def _build_domain_summaries(session: AsyncSession) -> list[DomainSummary]:
async def get_deps(session: AsyncSession = Depends(get_session)) -> list[WorkstreamWithDeps]:
"""Lightweight dep-graph endpoint: open workstreams with their dependency edges only.
Returns the same structure as open_workstreams in /state/summary but skips
Returns the same structure as open_workplans in /state/summary but skips
the 10-table full-summary computation. Task counts are omitted (all zero).
Used by workstreams.md and dependencies.md which only need dep edges.
"""

View file

@ -83,7 +83,6 @@ class StateSummary(BaseModel):
waiting_tasks: list[TaskRead]
blocked_tasks: list[TaskRead] = []
recent_progress: list[ProgressEventRead]
open_workstreams: list[WorkstreamWithDeps]
open_workplans: list[WorkstreamWithDeps] = []
next_steps: list[NextStep] = []
domains: list[DomainSummary] = []