--- id: RAIL-BS-WP-0011 type: workplan title: "Legacy-meter 8h capture image reconcile (STATE-WP-0073)" domain: financials repo: railiance-cluster status: finished owner: railiance-cluster topic_slug: railiance created: "2026-07-09" updated: "2026-07-09" state_hub_workstream_id: "a97b27ae-cb9f-455b-b5a7-5f5a31bc7058" --- # Legacy-meter 8h capture image reconcile (STATE-WP-0073) ## Context State Hub suggestion `8b3301d6-0222-41e4-89c9-99e8c6dd5248` (origin `legacy-meter-8h-capture-railiance-rollout`, STATE-WP-0073): rebuild `activity-core:railiance01-prod` from activity-core `f41cf14` or later so the `legacy_meter_weekly_review` resolver passes `hours=8` to State Hub. Without this, `legacy-meter-8h-capture` scheduled runs report a 7-day window instead of the intended 8-hour retirement gate. activity-core commit `f41cf14` adds `hours` through the State Hub resolver, `legacy-meter-8h-capture` cron (`0 */8 * * *` UTC), and progress sink `legacy_meter_8h_capture` for STATE-WP-0070 seven-window gating. The runtime ConfigMap and definition are already applied on railiance01; the live image digest `sha256:ead63d4a…` predates the resolver change (`hours` absent in `_legacy_meter_weekly_review` source). **Deploy coupling:** resolver code must ship in the activity-core image; the definition projection is already in `k8s/railiance/20-runtime.yaml`. Image reconcile is the remaining gate. **Prereqs:** - activity-core checkout at `f41cf14` or later (workstation and railiance01) - `export KUBECONFIG=~/.kube/config-hosteurope` (workstation) or `/etc/rancher/k3s/k3s.yaml` (railiance01) - `actcore-state-hub-bridge` reachable at `127.0.0.1:18000` (State Hub tunnel) **Pattern reuse:** RAIL-BS-WP-0010 revision-gated image reconcile. Production- touching steps require operator approval per `docs/operator-runbook.md`. ## Reconcile activity-core image to f41cf14+ ```task id: RAIL-BS-WP-0011-T01 status: done priority: high state_hub_task_id: "9c29427e-d3d9-464f-aeec-533038e7a8d4" ``` Build `activity-core:railiance01-prod` from activity-core main at `f41cf14` or later, import into railiance01 k3s containerd, and restart `actcore-api`, `actcore-worker`, and `actcore-event-router` only if the image digest changed. Sync remote activity-core repo to `f41cf14+` for revision evidence. 2026-07-09: Built `activity-core:railiance01-prod` from workstation checkout `f41cf14`, imported into railiance01 k3s. Digest changed `sha256:ead63d4a…` → `sha256:7f8e56a378b1521f8d3d1d75f47bfcc90dc6e0ad7b15531f181603a7878e3b03`. Deployments restarted; all rollouts green. Remote activity-core on railiance01 already at `f41cf14`. ## Verify resolver hours param in live pods ```task id: RAIL-BS-WP-0011-T02 status: done priority: high state_hub_task_id: "977e57b7-060a-45bb-94c7-1db8b480351b" ``` Confirm `_legacy_meter_weekly_review` source in the worker pod includes the `hours` param path. Confirm `legacy-meter-8h-capture` is `enabled=true` in the activity-core DB with cron `0 */8 * * *` UTC and a matching Temporal schedule. 2026-07-09: `hours_in_resolver: True` in actcore-api pod post-rollout. Edge relay logged `GET /legacy-meter/weekly-review?hours=8` 200 OK. Definition `a0fae182-52e9-5990-9fa6-6fea12a14753` enabled in DB; ConfigMap carries `hours: 8` and cron `0 */8 * * *` UTC. Recheck (same day): image digest `sha256:7f8e56a3…` still live. Temporal schedule `activity-schedule-a0fae182-52e9-5990-9fa6-6fea12a14753` was missing from the 13-schedule inventory (bulk `sync_schedules` blocked by unrelated `ScheduleAlreadyRunningError`). Targeted `upsert_schedule` created it: every 8h at `:00` UTC, `paused=false`, schedule count 13 → 14. ## Manual trigger acceptance smoke ```task id: RAIL-BS-WP-0011-T03 status: done priority: high state_hub_task_id: "ba6256fe-efff-4038-bb7d-72dadac33251" ``` Manually trigger `legacy-meter-8h-capture` once. Poll State Hub for `event_type=legacy_meter_8h_capture` linked to workplan `44e2e123-9934-4b5e-8b50-1bac548c5b70`. Record non-secret evidence: `window_label: 8h`, retirement-candidate counts, matched progress event id. Closes the functional acceptance gate for suggestion `8b3301d6`. 2026-07-09: Manual trigger `activity-a0fae182-52e9-5990-9fa6-6fea12a14753:manual-49eebfc6-1d23-4bb9-bdad-6ffd1f6eab65` completed. Cluster State Hub progress `92893da2-46e5-4060-a0d5-9b247e1b2ef3` (`legacy_meter_8h_capture`, workplan `44e2e123-9934-4b5e-8b50-1bac548c5b70`): `window_label: 8h`, 1 retirement candidate of 9 interfaces, 382103 legacy calls in window. Prerequisite: inserted STATE-WP-0073 workplan row into cluster `state_hub` DB (FK was missing vs workstation hub). Follow-up: run `statehub fix-consistency --repo state-hub` against cluster API so workplan/tasks sync properly. ## First scheduled 8h UTC run watch ```task id: RAIL-BS-WP-0011-T04 status: done priority: low state_hub_task_id: "b7f725bc-cd6f-468d-9748-e5b887185adb" ``` After T03 passes, leave the schedule enabled. On the next `0 */8 * * *` UTC tick, confirm a second `legacy_meter_8h_capture` progress event arrives without operator action. Proves production cadence, not only manual trigger. 2026-07-09 16:00 UTC: Temporal schedule `activity-schedule-a0fae182-52e9-5990-9fa6-6fea12a14753` fired at 16:00:00Z (workflow `activity-a0fae182-52e9-5990-9fa6-6fea12a14753:${firstScheduledTime}-2026-07-09T16:00:00Z`, no manual trigger). Cluster progress `ec231bca-e8c6-4e4e-9b48-c1295aec5221` at 16:00:13Z: `window_label: 8h`, 1 retirement candidate of 9 interfaces, 396529 legacy calls in window, workplan `44e2e123-9934-4b5e-8b50-1bac548c5b70`. Next scheduled ticks: 00:00 / 08:00 / 16:00 UTC daily cadence confirmed.