Files
the-custodian/activity-definitions/state-hub-consistency-sweep.md
tegwick 1ae82e01ae feat(STATE-WP-0064): enable consistency sweep for parallel week
Activate the Railiance01 schedule alongside the local timer during T03.
2026-06-21 21:46:43 +02:00

89 lines
2.9 KiB
Markdown

---
id: "7c4e9a12-8f3b-4d5e-9c6a-1b2d3e4f5a6b"
name: "State Hub Consistency Sweep"
type: activity-definition
version: "1.0"
enabled: true
owner: custodian
governance: custodian
status: active
created: "2026-06-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
`STATE-WP-0064 - Move State Hub consistency sync to Railiance01`.
It schedules the 15-minute ADR-001 reconciliation sweep across all
registered repos with local paths on the workstation State Hub host.
State Hub owns `scripts/consistency_check.py`, lock semantics, and the
`consistency_sweep_remote_all` progress event; activity-core owns the
cron schedule and ActivityRun audit trail.
## Runner Status
`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` State Hub context resolver issues:
- `POST /consistency/sweep/remote-all`
- payload: `{"max_seconds": 300}`
The context source is marked `required: true`. A failed State Hub call
fails the activity-core workflow visibly instead of silently binding an
empty context. On success, the response is stored in the ActivityRun
`context_snapshot` under `consistency_sweep_remote_all`.
State Hub runs `consistency_check.py --remote --all --json` on the
workstation host and records a compact progress event with event type
`consistency_sweep_remote_all`, including processed repos and skip
metadata.
`STATE_HUB_URL` must point at the workstation State Hub through the
ops-bridge tunnel service (for example `actcore-state-hub-bridge`), not
at 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