From 6115bb8df63a52435608e535ee481b153c06bd00 Mon Sep 17 00:00:00 2001 From: tegwick Date: Mon, 3 Aug 2026 18:51:38 +0200 Subject: [PATCH] Add REIN-A-0002 for ops_run claim loop and approach selection. Implements ACT-ADR-005 consumer side: claim from activity-core, approach table, and cutover off dual host timers after proof window. --- workplans/REIN-A-0002-ops-run-claim-loop.md | 163 ++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 workplans/REIN-A-0002-ops-run-claim-loop.md diff --git a/workplans/REIN-A-0002-ops-run-claim-loop.md b/workplans/REIN-A-0002-ops-run-claim-loop.md new file mode 100644 index 0000000..658bc74 --- /dev/null +++ b/workplans/REIN-A-0002-ops-run-claim-loop.md @@ -0,0 +1,163 @@ +--- +id: REIN-A-0002 +type: workplan +title: "Ops run claim loop and approach selection" +domain: agents +repo: rein-aharness +status: ready +owner: grok +topic_slug: rein-aharness +priority: high +created: "2026-08-03" +updated: "2026-08-03" +depends_on: + - ACTIVITY-WP-0026 +related: + - ACT-ADR-005 + - HARNESS-WP-0001 +--- + +# 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 + +```task +id: REIN-A-0002-T01 +status: todo +priority: high +``` + +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) + +```task +id: REIN-A-0002-T02 +status: todo +priority: high +``` + +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 + +```task +id: REIN-A-0002-T03 +status: todo +priority: high +``` + +- `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 + +```task +id: REIN-A-0002-T04 +status: todo +priority: high +``` + +- Ensure definition labels include approach keys (`research-brief`, `automated`, …). +- Wire `AGENT_HARNESS_REPO_MAP` / roots for `freedom-intelligence`, `binky-control`. +- Document railiance install of claim-loop service. + +**Done when:** end-to-end: trigger FI def → ops_run claimed → brief path + +`fi_daily_brief` (or skip if not due). + +--- + +### T05 — Cutover: timers become break-glass + +```task +id: REIN-A-0002-T05 +status: todo +priority: medium +``` + +After **5 clean weekday cycles** (or 5 forced triggers): + +1. Disable FI + Binky host oneshot timers **or** set them to “poll once if queue + backlog” only. +2. Update domain `OperatingRhythm.md` / `docs/recurrence-ops.md`. +3. Keep install scripts with break-glass section. + +**Done when:** docs + railiance state match; dual-clock residual closed for FI/Binky. + +--- + +### T06 — Deprecate issue-core as ops intake for automation + +```task +id: REIN-A-0002-T06 +status: todo +priority: medium +``` + +- `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 +- [ ] ACT-ADR-005 / ACTIVITY-WP-0026 contracts implemented + +## Out of scope + +- Implementing ops_run schema (ACTIVITY-WP-0026) +- issue-core Forgejo backend fixes +- Full glas-harness multi-rein routing