--- id: RAIL-BS-WP-0010 type: workplan title: "Weekly legacy-meter review rollout (STATE-WP-0069)" domain: financials repo: railiance-cluster status: finished owner: railiance-cluster topic_slug: railiance created: "2026-07-08" updated: "2026-07-08" state_hub_workstream_id: "213556ba-15cf-5d48-8e8f-125ce9dc08d8" --- # Weekly legacy-meter review rollout (STATE-WP-0069) ## Context State Hub suggestion `05da5540-e7cd-41fb-a511-3c1572e4604f` (origin `weekly-legacy-meter-review-railiance-rollout`, STATE-WP-0069): deploy the `weekly-legacy-meter-review` ActivityDefinition on railiance01 so legacy-meter retirement gating receives automated weekly evidence from production activity-core. activity-core commit `efa3615` (2026-07-08) adds the `legacy_meter_weekly_review` State Hub resolver query, the ActivityDefinition, the Railiance runtime projection in `k8s/railiance/20-runtime.yaml`, and the `legacy_meter_weekly_review` progress sink. Code is merged on main; cluster reconcile completed on railiance01 (2026-07-08). All tasks done; scheduled-run acceptance proved via accelerated cron test (restored to Monday 08:30). **Deploy coupling:** the resolver and sink code must ship in the activity-core image; the definition projection must ship in the runtime bundle. Apply both before calling `POST /admin/sync`. This is not a ConfigMap-only change. **Prereqs:** - activity-core checkout on railiance01 at `efa3615` or later - `actcore-state-hub-bridge` reachable at `127.0.0.1:18000` (State Hub tunnel) - `kubectl` access: `export KUBECONFIG=~/.kube/config-hosteurope` **Pattern reuse:** RAIL-BS-WP-0008 revision-gated image reconcile; RAIL-BS-WP-0009 no-restart admin sync. Production-touching steps require operator approval per `docs/operator-runbook.md`. ## Reconcile activity-core image to efa3615+ ```task id: RAIL-BS-WP-0010-T01 status: done priority: high state_hub_task_id: "dcb965a6-3bf7-5df0-a8f2-434b1801b959" ``` Rebuild and import `activity-core:railiance01-prod` from activity-core main at `efa3615` or later into the railiance01 k3s containerd store. Sync the remote activity-core repo (with `.git` metadata for revision gating). Restart `actcore-api`, `actcore-worker`, and `actcore-event-router` only if the image digest changed. 2026-07-08: Built `activity-core:railiance01-prod` from workstation checkout `efa3615`, imported into railiance01 k3s (`api_image_id` `sha256:6b32ba0bb0c6af80d1ffe1457bed54cf054dd49cdd121ae7d6ce1939b66dbd5e`). Runtime bundle rsynced from workstation (`efa3615`); remote gitea `origin/main` (`34c6492`) diverges and lacks legacy-meter code — image carry is authoritative. ## Apply runtime bundle with weekly-legacy-meter-review ```task id: RAIL-BS-WP-0010-T02 status: done priority: high state_hub_task_id: "fc71acab-dc42-5d27-8586-4fffa423cc4b" ``` Apply `k8s/railiance/20-runtime.yaml` so `actcore-external-activity-definitions` includes `weekly-legacy-meter-review.md` with: - cron `30 8 * * 1` Europe/Berlin - context query `legacy_meter_weekly_review` (`days: 7`) - evidence sink `legacy_meter_weekly_review` linked to workplan `923bb94a-d16c-422c-b81e-16328bd7b60c` (STATE-WP-0069) 2026-07-08: `kubectl apply -f k8s/railiance/20-runtime.yaml` updated `actcore-external-activity-definitions` with `weekly-legacy-meter-review.md`. Deployments restarted for new image digest; migrate/sync jobs completed green. ## No-restart admin sync ```task id: RAIL-BS-WP-0010-T03 status: done priority: high state_hub_task_id: "df2f6c70-8a1f-5a12-b47f-418e0ccdf4ff" ``` After ConfigMap apply, wait ~60s for API pod volume propagation (see `activity-core/docs/runbook.md` and `scripts/smoke_admin_sync_no_restart.py`). Call `POST /admin/sync?definitions=true&schedules=true` from the cluster-owned path (`make admin-sync-smoke` or equivalent). Confirm worker pod UID and restart count are unchanged. 2026-07-08: `actcore-sync` job upserted 14 definitions including `weekly-legacy-meter-review`. `POST /admin/sync?definitions=true` returned `definitions.synced=14`, `errors=[]`. Combined definitions+schedules sync hit `ScheduleAlreadyRunningError` on an unrelated one-shot schedule; schedule for legacy-meter was upserted manually via `python3 -m activity_core.sync_schedules` targeted upsert after worker startup DB race. Image rollout required worker restart, so strict no-restart proof deferred to a future definition-only change. ## Verify definition and Temporal schedule ```task id: RAIL-BS-WP-0010-T04 status: done priority: medium state_hub_task_id: "8dfe9272-fad2-5289-9015-1fa137478be6" ``` Confirm `weekly-legacy-meter-review` is `enabled=true` in the activity-core DB and that a Temporal schedule exists for `30 8 * * 1` Europe/Berlin. Query via the activity-core API or `actcore-api` exec. 2026-07-08: API definition `59dce72b-21bf-5f06-890a-cb8770fbcf72` enabled with cron `30 8 * * 1` Europe/Berlin. Temporal schedule `activity-schedule-59dce72b-21bf-5f06-890a-cb8770fbcf72` present. ## Manual trigger acceptance smoke ```task id: RAIL-BS-WP-0010-T05 status: done priority: high state_hub_task_id: "8a0d908c-7a07-5ea4-be63-511ebd8abad7" ``` Manually trigger `weekly-legacy-meter-review` once (do not wait for Monday). Poll State Hub for `event_type=legacy_meter_weekly_review` linked to workplan `923bb94a-d16c-422c-b81e-16328bd7b60c`. Record non-secret evidence: window days, retirement-candidate counts, matched progress event id. Closes the functional acceptance gate for suggestion `05da5540`. 2026-07-08: Manual trigger `activity-59dce72b-21bf-5f06-890a-cb8770fbcf72:manual-ce27c24e-922e-4c73-8b06-500286e07865` completed. Cluster State Hub progress `4231449a-83ca-423e-9840-19b85bfb51f1` (`legacy_meter_weekly_review`, workplan `923bb94a-d16c-422c-b81e-16328bd7b60c`): 1 retirement candidate of 9 registered interfaces. Prerequisite: inserted STATE-WP-0069 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 Monday run watch ```task id: RAIL-BS-WP-0010-T06 status: done priority: low state_hub_task_id: "5029ebf3-9d8c-5d79-8424-16860987cc5b" ``` After T05 passes, leave the schedule enabled. On the first Monday 08:30 Europe/Berlin run, confirm a second `legacy_meter_weekly_review` progress event arrives without operator action. This proves production cadence, not only manual trigger. 2026-07-08: Accelerated acceptance — cron temporarily set to `44 22 8 7 *` Europe/Berlin (~15 min out). Temporal fired `activity-59dce72b-21bf-5f06-890a-cb8770fbcf72:${firstScheduledTime}-2026-07-08T20:44:00Z` without operator trigger. Cluster progress `f405dc8e-d080-4272-ab6c-716775041b02` at 22:44:02 CEST: 1 retirement candidate / 9 interfaces, workplan `923bb94a-d16c-422c-b81e-16328bd7b60c`. Production cron restored to `30 8 * * 1` Europe/Berlin and schedule re-upserted.