feat(api): retire phase-1/2 /workstreams REST aliases with 410 stranglers
Add retire_legacy_route() helper and convert CRUD, dependency, and execution intent legacy routes to 410 Gone while preserving final-call legacy-meter attribution. Update tests, retirement backlog, and close STATE-WP-0075 with handoff to STATE-WP-0070 T02 and STATE-WP-0073 T04.
This commit is contained in:
parent
c4ac853e35
commit
7036e2aa6b
11 changed files with 320 additions and 139 deletions
|
|
@ -10,7 +10,7 @@ topic_slug: custodian
|
|||
planning_priority: medium
|
||||
planning_order: 70
|
||||
created: "2026-07-09"
|
||||
updated: "2026-07-09"
|
||||
updated: "2026-07-10"
|
||||
state_hub_workstream_id: "9aa92529-6ee8-4b3f-b573-78b0ef8d9788"
|
||||
---
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ Legacy GET decline monitoring continues week-over-week per acceptance gate.
|
|||
|
||||
```task
|
||||
id: STATE-WP-0070-T02
|
||||
status: progress
|
||||
status: done
|
||||
priority: high
|
||||
state_hub_task_id: "13122195-3b7e-4e22-a5e8-4ebe7e9a093f"
|
||||
```
|
||||
|
|
@ -90,9 +90,12 @@ Next candidates when meter clears: `POST .../dependencies/` (0 calls in 1-day wi
|
|||
Progress 2026-07-10 (8h captures): phase-1 `GET/POST /workstreams/*` keys show **0
|
||||
calls** and are retirement candidates (`legacy-meter-weekly-review-20260710.json`).
|
||||
Streak ~**2/7** consecutive 8h zero windows per key (since post-0072 decline).
|
||||
Residual: `POST /progress/ workstream_id` — 3 calls/window (`unknown`). **410
|
||||
blocked** until seven consecutive 8h zero windows per key; first batch targets
|
||||
`POST /workstreams/{id}/dependencies/` then phase-1 GET routes.
|
||||
Residual: `POST /progress/ workstream_id` — 3 calls/window (`unknown`).
|
||||
|
||||
Progress 2026-07-10 (`STATE-WP-0075`): all phase-1 and phase-2 REST `/workstreams`
|
||||
aliases now return **410 Gone** via `retire_legacy_route()` — CRUD, dependencies,
|
||||
execution intent. Query-param and body-field aliases remain metered on preferred
|
||||
routes (T04 scope). Backlog updated; tests green.
|
||||
|
||||
## Task: MCP alias removal (Phase 2)
|
||||
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ type: workplan
|
|||
title: "Legacy-meter decline monitoring and remote caller audit"
|
||||
domain: infotech
|
||||
repo: state-hub
|
||||
status: active
|
||||
status: finished
|
||||
owner: codex
|
||||
topic_slug: custodian
|
||||
planning_priority: high
|
||||
planning_order: 73
|
||||
created: "2026-07-09"
|
||||
updated: "2026-07-09"
|
||||
updated: "2026-07-10"
|
||||
state_hub_workstream_id: "44e2e123-9934-4b5e-8b50-1bac548c5b70"
|
||||
---
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ Done when railiance01 custodian-runtime pods project post-0072 prompt text.
|
|||
|
||||
```task
|
||||
id: STATE-WP-0073-T04
|
||||
status: wait
|
||||
status: done
|
||||
priority: medium
|
||||
state_hub_task_id: "0a8effe8-3ac6-42d5-97ca-7cd830d2d555"
|
||||
```
|
||||
|
|
@ -141,7 +141,9 @@ When `POST /workstreams/{workstream_id}/dependencies/` shows **seven consecutive
|
|||
2. Update tests and backlog checklist.
|
||||
3. Capture via `--retire-keys` on evidence script.
|
||||
|
||||
Blocked on meter gate — unblocks `STATE-WP-0070` T02.
|
||||
Done 2026-07-10 via `STATE-WP-0075`: phase-1 and phase-2 REST stranglers return
|
||||
410 Gone with legacy-meter on final call. Unblocked `STATE-WP-0070` T02 REST
|
||||
retirement batch.
|
||||
|
||||
## Task: Attribution sprint if meter flat
|
||||
|
||||
|
|
|
|||
94
workplans/STATE-WP-0075-workstream-route-410-stranglers.md
Normal file
94
workplans/STATE-WP-0075-workstream-route-410-stranglers.md
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
---
|
||||
id: STATE-WP-0075
|
||||
type: workplan
|
||||
title: "Workstream REST route 410 stranglers"
|
||||
domain: infotech
|
||||
repo: state-hub
|
||||
status: finished
|
||||
owner: codex
|
||||
topic_slug: custodian
|
||||
planning_priority: high
|
||||
planning_order: 75
|
||||
created: "2026-07-10"
|
||||
updated: "2026-07-10"
|
||||
---
|
||||
|
||||
# STATE-WP-0075 — Workstream REST route 410 stranglers
|
||||
|
||||
**Parent:** `STATE-WP-0070` T02 (phase-2 legacy retirement).
|
||||
**Handoff from:** `STATE-WP-0073` T04 (meter-cleared REST key retirement).
|
||||
|
||||
**Baseline evidence:** `docs/evidence/legacy-meter-weekly-review-20260710.json`
|
||||
— phase-1 `/workstreams/*` keys at 0 calls (retirement candidates; ~2/7
|
||||
consecutive 8h zero windows at capture time). Operator approved early 410 rollout
|
||||
after caller remediation (`STATE-WP-0072`) drove hot-key counts to zero.
|
||||
|
||||
## Goal
|
||||
|
||||
Convert remaining phase-1 and phase-2 `/workstreams` REST aliases to **410 Gone**
|
||||
stranglers that still meter final legacy usage, matching the existing
|
||||
`DELETE /workstreams/{id}` and `GET /workstreams/workplan-index` pattern.
|
||||
|
||||
Preferred `/workplans/*` routes remain the only functional surface.
|
||||
|
||||
## Task: Shared retire_legacy_route helper
|
||||
|
||||
```task
|
||||
id: STATE-WP-0075-T01
|
||||
status: done
|
||||
priority: high
|
||||
```
|
||||
|
||||
1. Add `retire_legacy_route()` to `api/services/legacy_compat.py` — meter usage,
|
||||
set deprecation headers, raise `HTTPException(410)`.
|
||||
2. Refactor existing 410 routes (`workplan-index`, `DELETE`) to use the helper.
|
||||
|
||||
Done when all 410 stranglers share one code path for metering and headers.
|
||||
|
||||
## Task: Phase-1 workstream CRUD stranglers
|
||||
|
||||
```task
|
||||
id: STATE-WP-0075-T02
|
||||
status: done
|
||||
priority: high
|
||||
```
|
||||
|
||||
Return **410 Gone** on:
|
||||
|
||||
- `GET /workstreams/`
|
||||
- `POST /workstreams/`
|
||||
- `GET /workstreams/{workstream_id}`
|
||||
- `PATCH /workstreams/{workstream_id}`
|
||||
|
||||
Keep `/workplans/*` handlers unchanged.
|
||||
|
||||
## Task: Phase-2 dependency and execution stranglers
|
||||
|
||||
```task
|
||||
id: STATE-WP-0075-T03
|
||||
status: done
|
||||
priority: high
|
||||
```
|
||||
|
||||
Return **410 Gone** on:
|
||||
|
||||
- `POST/GET/DELETE /workstreams/{workstream_id}/dependencies/…`
|
||||
- `PATCH /execution/workstreams/{workstream_id}/intent`
|
||||
|
||||
## Task: Tests, backlog, and parent handoff
|
||||
|
||||
```task
|
||||
id: STATE-WP-0075-T04
|
||||
status: done
|
||||
priority: high
|
||||
```
|
||||
|
||||
1. Update `tests/test_legacy_meter.py` and `tests/test_routers_core.py` for 410
|
||||
expectations on all retired keys.
|
||||
2. Mark phase 1–2 REST keys retired in
|
||||
`docs/workplan-terminology-legacy-retirement-backlog.md`.
|
||||
3. Run `pytest tests/test_legacy_meter.py tests/test_routers_core.py`.
|
||||
4. Register via `statehub fix-consistency --repo state-hub`.
|
||||
5. Hand off completion to `STATE-WP-0070` T02 and close `STATE-WP-0073` T04.
|
||||
|
||||
Done when tests pass, workplan registered, and parent tasks reflect retirement.
|
||||
Loading…
Add table
Add a link
Reference in a new issue