feat: add workplan aliases and legacy meter

Adds preferred workplan REST/event surfaces, legacy-meter telemetry and weekly review summaries, documentation/dashboard terminology updates, dashboard API loading fixes, and close-out sync for STATE-WP-0052 and STATE-WP-0054.
This commit is contained in:
2026-06-04 08:25:31 +02:00
parent 355f80b078
commit 166aedfa8d
43 changed files with 1851 additions and 145 deletions

View File

@@ -0,0 +1,34 @@
---
id: ADHOC-2026-06-04
type: workplan
title: "Ad hoc fixes - 2026-06-04"
domain: custodian
repo: state-hub
status: finished
owner: codex
topic_slug: custodian
created: "2026-06-04"
updated: "2026-06-04"
state_hub_workstream_id: "2a8f3aff-8f5d-4e42-b33f-225d60e0b30b"
---
# Ad hoc fixes - 2026-06-04
## Fix Dashboard Overview API Loading
```task
id: ADHOC-2026-06-04-T01
status: done
priority: high
state_hub_task_id: "5f6aa1e4-ccc5-4c8b-8183-cc1578190b7b"
```
The overview page reported `Dashboard data load failed: NetworkError when
attempting to fetch resource.` even when the API was healthy from Windows.
The root cause was brittle browser/API connection setup: the dashboard assumed
`http://127.0.0.1:8000`, while the API CORS defaults allowed only the exact
dashboard origins on port 3000.
Result: the dashboard now resolves its API base from the current browser host
with explicit query/storage/global overrides, and the API allows common local
Observable dashboard origins on ports 3000-3005, including IPv6 loopback.

View File

@@ -4,11 +4,11 @@ type: workplan
title: "Task State Canon Adaptation"
domain: custodian
repo: state-hub
status: active
status: finished
owner: codex
topic_slug: custodian
created: "2026-05-25"
updated: "2026-05-25"
updated: "2026-06-04"
state_hub_workstream_id: "bc54c18b-4d98-430d-b9ad-c4410010c897"
---
@@ -321,7 +321,7 @@ task, or a recorded no-impact classification.
```task
id: STATE-WP-0052-T10
status: wait
status: done
priority: medium
state_hub_task_id: "1cde226a-6287-4db4-9d2f-7fa9ed0b6c4d"
```
@@ -342,10 +342,11 @@ Requirements:
Done when State Hub is canon-conformant, attached repos have been notified, and
the remaining compatibility window is explicit.
Current wait condition: attached repos have been notified through interface
change `649102a2-4373-4621-9848-cc257e67c262`; closing the compatibility window
depends on repo-agent responses and a later decision on when aliases become
warnings or errors.
Close-out note: attached repos were notified through interface change
`649102a2-4373-4621-9848-cc257e67c262`; decision
`c386f42f-a50a-41d9-9457-f384227f8f6c` keeps legacy aliases accepted during the
adaptation window and leaves any future warnings/errors to a later explicit
decision.
## Acceptance Criteria

View File

@@ -4,13 +4,13 @@ type: workplan
title: "Workplan Terminology Transition and Legacy Meter"
domain: custodian
repo: state-hub
status: proposed
status: finished
owner: codex
topic_slug: custodian
planning_priority: high
planning_order: 54
created: "2026-06-03"
updated: "2026-06-03"
updated: "2026-06-04"
state_hub_workstream_id: "471401c8-38b2-46fd-ae34-052825710376"
---
@@ -100,7 +100,7 @@ record an explicit `unknown` bucket instead of dropping the observation.
```task
id: STATE-WP-0054-T01
status: todo
status: done
priority: high
state_hub_task_id: "f43ed8c0-f62c-42af-b38f-d4ccd7a7bed5"
```
@@ -117,11 +117,15 @@ or out of scope. Map every legacy-compatible interface to its preferred
Done when the repo has a reviewed compatibility matrix that separates semantic
renames from high-risk storage or event-contract changes.
Result 2026-06-04: added `docs/workplan-terminology-transition.md` with the
preferred workplan interfaces, legacy workstream compatibility paths,
legacy-meter keys, retirement rules, and activity-core handoff boundary.
### T02 - Add Preferred Workplan Interface Variants
```task
id: STATE-WP-0054-T02
status: todo
status: done
priority: high
state_hub_task_id: "65dca8e4-a032-4b1a-a21f-8559f1fb87f5"
```
@@ -142,11 +146,17 @@ Likely examples:
Done when new clients can use workplan-named interfaces without relying on
workstream-named entry points.
Result 2026-06-04: added preferred REST aliases for `/workplans`,
`/workplans/{id}`, `/workplans/index`,
`/workplans/{id}/dependencies/`, and
`/execution/workplans/{id}/intent`. Completion now also emits preferred
`org.statehub.workplan.completed` events while retaining the legacy event.
### T03 - Implement Legacy Meter Data Model And Service
```task
id: STATE-WP-0054-T03
status: todo
status: done
priority: high
state_hub_task_id: "b4008ab7-1f59-4ea7-a728-48557473c22d"
```
@@ -162,11 +172,15 @@ update first/last seen timestamps.
Done when tests can register a legacy interface and prove usage counters are
updated without changing the legacy interface's behavior.
Result 2026-06-04: added `legacy_interfaces` and
`legacy_interface_usage_buckets` models, migration, schemas, service helpers,
and `/legacy-meter` registration/usage/summary endpoints.
### T04 - Instrument Legacy Workstream Interfaces
```task
id: STATE-WP-0054-T04
status: todo
status: done
priority: high
state_hub_task_id: "28c31bbc-4479-4dd9-8e2c-08235e81ba91"
```
@@ -182,11 +196,16 @@ must not break the legacy interface path.
Done when calls to selected `workstream` interfaces appear in legacy-meter
usage summaries with call counts and tenant/user/component buckets.
Result 2026-06-04: instrumented retained `/workstreams` REST routes,
dependency routes, `/execution/workstreams/{id}/intent`, and the legacy
`org.statehub.workstream.completed` event subject. Legacy REST responses now
include deprecation and replacement headers.
### T05 - Add Legacy Usage Review And Retirement Signals
```task
id: STATE-WP-0054-T05
status: todo
status: done
priority: high
state_hub_task_id: "fca14802-1a15-4b5a-8267-5348666b3c50"
```
@@ -206,11 +225,16 @@ An interface becomes a retirement candidate only when:
Done when State Hub can produce a precise retirement-candidate list without
manual log scraping.
Result 2026-06-04: added `/legacy-meter/summary` and
`/legacy-meter/weekly-review` with review-window counters, last-seen timestamps,
identity buckets, verified-replacement gating, manual holds, and retirement
candidate reasons.
### T06 - Schedule Weekly Activity-Core Review
```task
id: STATE-WP-0054-T06
status: todo
status: done
priority: high
state_hub_task_id: "3d6fb438-707f-45e8-9c38-3e7352ae2a93"
```
@@ -226,11 +250,15 @@ letting activity-core own wakeups, schedules, and dispatch.
Done when a weekly activity-core check can read legacy-meter summaries and
raise retirement work only for interfaces with no prior-week usage.
Result 2026-06-04: exposed activity-core handoff metadata in
`/legacy-meter/weekly-review`: weekly cadence, source endpoint, State Hub as
state owner, and activity-core as scheduler owner.
### T07 - Update Documentation, Dashboard Labels, And Agent Guidance
```task
id: STATE-WP-0054-T07
status: todo
status: done
priority: medium
state_hub_task_id: "55a05f68-a337-412c-8462-847e6465d15e"
```
@@ -243,11 +271,15 @@ interfaces and link to their preferred replacements.
Done when new users and agents are guided toward workplan terminology without
losing instructions for existing compatibility paths.
Result 2026-06-04: updated State Hub docs, dashboard API calls/reference docs,
NATS event docs, README, and AGENTS guidance to prefer workplan terminology and
document legacy workstream compatibility.
### T08 - Prove Compatibility And Rollout Safety
```task
id: STATE-WP-0054-T08
status: todo
status: done
priority: high
state_hub_task_id: "2ae2580f-4626-49fe-aec6-ca9340792afd"
```
@@ -263,6 +295,16 @@ exist, and what activity-core will review weekly.
Done when existing `workstream` clients still pass, new `workplan` clients pass,
and legacy-meter telemetry proves the compatibility window is observable.
Progress 2026-06-04: added `tests/test_legacy_meter.py` for preferred
workplan routes, legacy route metering, identity buckets, weekly retirement
review, completion event metering, dependency aliases, and execution aliases.
Focused verification passed with
`.venv/bin/python -m pytest tests/test_legacy_meter.py tests/test_routers_core.py::TestWorkstreams tests/test_routers_core.py::TestExecutionQueueEndpoints`.
Result 2026-06-04: full backend verification passed with
`.venv/bin/python -m pytest` (`340 passed`), dashboard verification passed with
`npm test` in `dashboard/` (`11 passed`), and `git diff --check` passed.
## Acceptance Criteria
- `workplan` is the recommended user-facing term in State Hub docs, dashboard
@@ -279,4 +321,3 @@ and legacy-meter telemetry proves the compatibility window is observable.
documented replacement.
- No physical database or event-contract rename is required in this workplan
unless compatibility evidence shows it is safe.