rein-aharness/workplans/REIN-A-0002-ops-run-claim-loop.md
tegwick 8200a672ea Implement REIN-A-0002 ops_run claim loop and approach registry.
Add activity-core ops_run client, approach selection (FI/Binky/mail/agent),
claim-loop worker with lease heartbeat, CLI run --from-ops-run and claim-loop,
install units, and docs demoting issue-core to legacy external tickets.
T05 timer cutover remains operator after five clean cycles.
2026-08-03 20:04:25 +02:00

4.9 KiB

id type title domain repo status owner topic_slug priority created updated depends_on related state_hub_workstream_id
REIN-A-0002 workplan Ops run claim loop and approach selection agents rein-aharness in_progress grok rein-aharness high 2026-08-03 2026-08-03
ACTIVITY-WP-0026
ACT-ADR-005
HARNESS-WP-0001
ed679a3e-b4ea-4e69-bba6-5694d79ae7c8

REIN-A-0002 — Ops run claim loop and approach selection

Origin

ACT-ADR-005. Closes the dual-clock residual: host systemd timers currently execute Binky/FI while activity-core schedules separately. rein-aharness already polls issue-core (docs/task-intake.md); that path is wrong for internal ops under WP-0022 and issue-core INTENT.

Goal

  1. Claim ops_run from activity-core (not issue-core / not Forgejo).
  2. Select an efficient approach (adapter table) and execute.
  3. Complete/fail the ops_run + domain completion events.
  4. Cut over FI and Binky off dual wall-clock timers once proven.

Tasks

T01 — activity-core ops_run client

id: REIN-A-0002-T01
status: done
priority: high
state_hub_task_id: "a5e32652-ba3f-4cc5-8d41-0d9f3022c50e"

Client module (env: ACTIVITY_CORE_URL, worker credential):

  • claim(worker_id, labels=…)
  • heartbeat / complete / fail

Map ops_run → existing TaskSpec (or thin OpsRunSpec). Tests with httpx mock.

Blocked on: ACTIVITY-WP-0026-T01 API shape (can stub against openapi draft).

Done when: unit tests green; CLI poll --source=ops-run prototype optional.


T02 — Approach registry (v1 static)

id: REIN-A-0002-T02
status: done
priority: high
state_hub_task_id: "c307b119-1bff-4d5c-a911-5b5259de5c86"

Central table/config (code registry, not per-repo cron):

Match (labels / definition id contains) Approach command
research-brief or fi-daily fi-research-brief
rhythm + binky / binky-daily brief-daily
mail-intake mail-scan then optional mail-triage
agent-session run with persona/profile
unmatched fail ops_run with clear reason

Document how to add rows. Prefer cheapest correct path (deterministic before agent session; structured llm-connect before open-ended coding agent).

Done when: pure function tests for match → approach.


T03 — Continuous claim worker

id: REIN-A-0002-T03
status: done
priority: high
state_hub_task_id: "31fb7df3-83a3-4f18-a7b9-9be49e226837"
  • rein-aharness claim-loop (or systemd/service unit): poll interval, lease heartbeat, concurrency 1 default.
  • On success: domain completion already done by approach; close ops_run.
  • On failure: fail ops_run; do not silent drop.
  • Metrics/log for SLA.

Done when: can run against railiance actcore-api with a test ops_run.


T04 — Map FI + Binky definitions

id: REIN-A-0002-T04
status: done
priority: high
state_hub_task_id: "93190150-4df7-47f4-b52e-29b997f9aaf0"
  • FI labels already include research-brief + automated.
  • AGENT_HARNESS_REPO_MAP documented in claim-loop.env.example + ops-run-claim-loop.md.
  • Install: deploy/scripts/install-claim-loop-user.sh.

Prod e2e (operator after WP-0026-T07 migrate): trigger FI → claim-loop once → fi_daily_brief. Code path + install docs landed.


T05 — Cutover: timers become break-glass

id: REIN-A-0002-T05
status: todo
priority: medium
state_hub_task_id: "a04a98e3-ca6a-4a18-b6fd-47a77047ca90"

Procedure landed: deploy/docs/timer-cutover.md + FI docs/recurrence-ops.md updated for claim-loop primary / timer break-glass.

Still open on railiance:

  1. Fill proof table (5 clean cycles).
  2. Disable FI + Binky host oneshot timers.
  3. Keep install scripts for break-glass.

Done when: docs + railiance state match; dual-clock residual closed for FI/Binky.


T06 — Deprecate issue-core as ops intake for automation

id: REIN-A-0002-T06
status: done
priority: medium
state_hub_task_id: "cca10835-d6fc-4ce1-a361-d2d1f2693872"
  • docs/task-intake.md: issue-core poll = legacy / external ticket path only.
  • ops_run = primary for activity-core automation labels.
  • No Gitea references; Forgejo only if mentioning self-hosted forge projection.

Done when: docs and CLI help text consistent with ACT-ADR-005.

Acceptance

  • Claim loop does not require Forgejo or issue-core for FI/Binky ops
  • Approach table selects fi-research-brief / brief-daily without host “schedule”
  • Timers demoted after proof window (T05 operator)
  • ACT-ADR-005 / ACTIVITY-WP-0026 contracts implemented

Shipped: ops_run_client, approaches, claim_loop, CLI claim-loop / run --from-ops-run / poll --source=ops-run, unit tests, install + cutover docs.

Out of scope

  • Implementing ops_run schema (ACTIVITY-WP-0026)
  • issue-core Forgejo backend fixes
  • Full glas-harness multi-rein routing