--- id: "7c4e9a12-8f3b-4d5e-9c6a-1b2d3e4f5a6b" name: "State Hub Consistency Sweep" type: activity-definition version: "1.1" enabled: false owner: custodian governance: custodian status: paused created: "2026-06-21" updated: "2026-08-21" trigger: type: cron cron_expression: "*/15 * * * *" timezone: UTC misfire_policy: skip context_sources: - type: state-hub query: consistency_sweep_remote_all required: true params: max_seconds: 300 source: activity-core bind_to: context.consistency_sweep_remote_all --- # ActivityDefinition: State Hub Consistency Sweep ## Purpose This definition is the activity-core handoff point for the 15-minute ADR-001 reconciliation sweep (STATE-WP-0064, ACTIVITY-WP-0029). activity-core owns the cron schedule and ActivityRun audit trail. **repo-manager** owns the C-rule engine. State Hub `POST /consistency/sweep/remote-all` is the dual-run adapter until `REPO_MANAGER_URL` / `CONSISTENCY_SWEEP_URL` points at repo-manager. ## Runner Status Paused 2026-08-21 under `RMGR-WP-0005-T11`. The production State Hub sweep mounted `/home/tegwick` read-write and the operator's `/home/tegwick/.ssh`, while 70 railiance01 checkouts still targeted the superseded `gitea-remote` lineage. The Temporal schedule is paused and State Hub sweep mounts are disabled until those checkouts are reconciled to `forgejo-remote` and the registrar preflight passes. Do not re-enable this definition independently. `enabled: true` during `STATE-WP-0064-T03` parallel week (started 2026-06-21) alongside the local `custodian-sync.timer`. Both invoke the same State Hub API; the process lock makes overlapping runs idempotent. Cutover boundary: - **Parallel week (T03):** cluster schedule and local timer both active. - **After T04 cutover:** disable the local timer; this definition remains the sole primary runner. - Do not treat the local timer and this activity-core schedule as two independent primary runners after cutover. ## Trigger Every 15 minutes in UTC, with `misfire_policy: skip`. If the activity-core host is offline at a scheduled tick, the missed run is skipped rather than replayed as a burst after the host returns. ## Deterministic State Hub Invocation The `consistency_sweep_remote_all` resolver issues: - `POST {sweep_base}/consistency/sweep/remote-all` - payload: `{"max_seconds": 300, "source": "activity-core"}` `sweep_base` is `CONSISTENCY_SWEEP_URL` or `REPO_MANAGER_URL` or `STATE_HUB_URL` (default dual-run adapter). The context source is `required: true`. A failed call fails the workflow visibly. On success, the ActivityRun snapshot includes `engine_owner`, `adapter`, and `sweep_url`. `STATE_HUB_URL` (adapter default) must point at the workstation State Hub through the ops-bridge tunnel, not a cluster-local checkout path. ## Output Contract The run should produce: - one State Hub progress event with `event_type: consistency_sweep_remote_all` - zero or more per-repo consistency reports in the API response - a lock-skipped response when another remote-all sweep is already active - one activity-core ActivityRun containing the sweep response metadata - no LLM call and no direct workplan or canon edits