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.
This commit is contained in:
parent
9644202eb2
commit
8200a672ea
15 changed files with 1807 additions and 73 deletions
92
tests/test_approaches.py
Normal file
92
tests/test_approaches.py
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
"""Pure approach selection tests (REIN-A-0002-T02)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from rein_aharness.approaches import (
|
||||
APPROACH_AGENT_SESSION,
|
||||
APPROACH_BRIEF_DAILY,
|
||||
APPROACH_FI_RESEARCH_BRIEF,
|
||||
APPROACH_MAIL_PIPELINE,
|
||||
APPROACH_UNMATCHED,
|
||||
select_approach,
|
||||
)
|
||||
from rein_aharness.ops_run_client import OpsRun
|
||||
|
||||
|
||||
def _run(**kwargs) -> OpsRun:
|
||||
base = dict(
|
||||
id="r",
|
||||
activity_definition_id="",
|
||||
idempotency_key="k",
|
||||
target_repo="x",
|
||||
title="",
|
||||
description="",
|
||||
labels=[],
|
||||
)
|
||||
base.update(kwargs)
|
||||
return OpsRun(**base)
|
||||
|
||||
|
||||
def test_select_fi_by_label() -> None:
|
||||
assert (
|
||||
select_approach(
|
||||
_run(labels=["automated", "research-brief", "freedom-intelligence"])
|
||||
)
|
||||
== APPROACH_FI_RESEARCH_BRIEF
|
||||
)
|
||||
|
||||
|
||||
def test_select_fi_by_blob() -> None:
|
||||
assert (
|
||||
select_approach(
|
||||
_run(
|
||||
labels=["automated"],
|
||||
activity_definition_id="fi-daily-research-brief",
|
||||
title="FI daily research brief",
|
||||
)
|
||||
)
|
||||
== APPROACH_FI_RESEARCH_BRIEF
|
||||
)
|
||||
|
||||
|
||||
def test_select_binky_rhythm() -> None:
|
||||
assert (
|
||||
select_approach(_run(labels=["binky", "rhythm", "automated"]))
|
||||
== APPROACH_BRIEF_DAILY
|
||||
)
|
||||
|
||||
|
||||
def test_select_mail_intake() -> None:
|
||||
assert (
|
||||
select_approach(_run(labels=["mail-intake", "automated"]))
|
||||
== APPROACH_MAIL_PIPELINE
|
||||
)
|
||||
|
||||
|
||||
def test_select_agent_session() -> None:
|
||||
assert (
|
||||
select_approach(_run(labels=["agent-session", "automated"]))
|
||||
== APPROACH_AGENT_SESSION
|
||||
)
|
||||
|
||||
|
||||
def test_select_hint_overrides() -> None:
|
||||
assert (
|
||||
select_approach(
|
||||
_run(labels=["automated"], approach_hint="fi-research-brief")
|
||||
)
|
||||
== APPROACH_FI_RESEARCH_BRIEF
|
||||
)
|
||||
|
||||
|
||||
def test_unmatched() -> None:
|
||||
assert select_approach(_run(labels=["automated"], title="misc hygiene")) == (
|
||||
APPROACH_UNMATCHED
|
||||
)
|
||||
|
||||
|
||||
def test_fi_before_generic_automated() -> None:
|
||||
"""research-brief must not fall through to unmatched when only automated."""
|
||||
assert (
|
||||
select_approach(_run(labels=["research-brief"])) == APPROACH_FI_RESEARCH_BRIEF
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue