openloops.runbook_issue#
One manual-task issue, from its number to a reviewed run plan, with no agent in between.
ADR-018 amendment (2026-12-04). The openloops-runbook skill plans many issues at once
and rewrites their commands; for one issue whose body already carries the command, an
agent in between costs the owner more attention than it saves. ol runbook-issue REF
does the planner’s mechanical part in code and keeps the parts that matter:
still needed? the issue must be open, a
manual-task, filed by the owner’s own login, and waiting on no open issue; and every step’s check is the issue’s own**Verify:**line, so a task that is already done runs nothing;safe? the deterministic floor (
openloops.command_risk.risk_floor()), then the independent reviewer (the shippedopenloops-risk-revieweragent, run asclaude -p), which can only raise a level; a weak check means the issue is not closed;run, watched: the plan is shown, the owner’s one yes approves it at its hash, and
openloops.runbook_runruns it at his terminal;done? the Verify line is run again, and
openloops.closercloses the issue only when it passes.
Pure: plan_from_issue(), apply_review(), review_prompt(),
parse_review(). I/O: gather_facts(), claude_reviewer(). Imported by
nothing in the core; tools.runbook_issue loads it lazily. claude_reviewer() is
the one place openloops asks a model, and only when the owner runs this command.
Module Attributes
The reviewer runs on the strongest tier (the agent definition says |
|
Seconds the reviewer may take before the plan is refused for want of a review. |
Functions
|
The plan id for an issue: one plan per issue, replaced when planned again. |
|
A plan of one step per shell block of issue's body, in order, each checked first by the issue's own |
|
Facts a tool gathered for each step, for the reviewer: the hosts it reaches by |
|
What the reviewer is given: each step's command, folder and check, and the facts. |
|
The reviewer's JSON list, one object per step id in ids; an error otherwise. |
|
plan with each step's |
|
The default reviewer: the shipped |
|
Each shell block a comment gives that the body does not, oldest first. |
|
The comments of issue ref posted after its body was last edited, oldest first. |
- openloops.runbook_issue.DFLT_REVIEW_MODEL = 'opus'#
The reviewer runs on the strongest tier (the agent definition says
model: opus).
- openloops.runbook_issue.DFLT_REVIEW_TIMEOUT = 300#
Seconds the reviewer may take before the plan is refused for want of a review.
- openloops.runbook_issue.apply_review(plan, reviews)[source]#
plan with each step’s
reviewstored and its level raised to the reviewer’s.A review can only raise a level. No undo named means
discuss. A weak check on the issue’s last step means the issue is not closed by this run (close: false).>>> p = Plan('p', 'now', steps=[Step('s1', 'o/r#1', 'echo hi', level='run')]) >>> q = apply_review(p, [{'id': 's1', 'level': 'show', 'undo': 'none', ... 'weak_check': True}]) >>> q.steps[0].level, q.steps[0].close ('discuss', False)
- Return type:
- openloops.runbook_issue.claude_reviewer(*, claude='claude', model='opus', timeout=300)[source]#
The default reviewer: the shipped
openloops-risk-reviewerinstructions, run asclaude -pwith no tools and no saved session. Raises when it cannot run or its answer cannot be read: a plan without its review is refused, never run on the floor alone unless the owner says so (--no-review).
- openloops.runbook_issue.comment_bodies(ref, *, gh=None)[source]#
The comments of issue ref posted after its body was last edited, oldest first.
Read only to find shell blocks in them (
newer_commands()). A comment older than the body’s last edit was already folded into it, or superseded by it.
- openloops.runbook_issue.gather_facts(plan, *, run=None)[source]#
Facts a tool gathered for each step, for the reviewer: the hosts it reaches by
sshand, for each folder it works in that is a git checkout, its status and remote. Reads only.
- openloops.runbook_issue.newer_commands(body, comments)[source]#
Each shell block a comment gives that the body does not, oldest first.
A plan runs the body’s blocks only. An agent that refreshed the ask in a comment (a corrected command, a new Verify) left the body stale: running it would run the old command. Whitespace is ignored when comparing.
>>> body = "```bash\nnpm trust github x\n```" >>> newer_commands(body, ["Fixed:\n```bash\nnpm publish && npm trust github x\n```"]) ['npm publish && npm trust github x'] >>> newer_commands(body, ["Same:\n```bash\nnpm trust github x\n```", "no code"]) []
- openloops.runbook_issue.parse_review(text, *, ids)[source]#
The reviewer’s JSON list, one object per step id in ids; an error otherwise.
>>> parse_review('```json\n[{"id": "s1", "level": "show"}]\n```', ids=['s1']) [{'id': 's1', 'level': 'show'}]
- openloops.runbook_issue.plan_from_issue(issue, *, keep_open='', made_by='ol runbook-issue', now=None)[source]#
A plan of one step per shell block of issue’s body, in order, each checked first by the issue’s own
**Verify:**line. Pure.issueis whatopenloops.closer.read_issue()returns (ref,title,body).keep_openis a reason the issue must stay open after the run (the closer would refuse it, or it has no Verify line); the last step then hasclose: falseand the reason in its note.>>> body = '**Verify:** `test -f done`\n\n```bash\ntouch done\n```' >>> p = plan_from_issue({'ref': 'o/r#3', 'title': 'Make it', 'body': body}) >>> [(s.id, s.command, s.check, s.close) for s in p.steps] [('s1', 'touch done', 'test -f done', True)]
- Return type:
- openloops.runbook_issue.plan_id(ref)[source]#
The plan id for an issue: one plan per issue, replaced when planned again.
>>> plan_id('thorwhalen/_private-issues#202') 'issue-thorwhalen-_private-issues-202'
- Return type:
- openloops.runbook_issue.review_prompt(plan, facts)[source]#
What the reviewer is given: each step’s command, folder and check, and the facts. Not the issue’s text, not the floor’s levels: a second opinion has not read the first.
>>> p = Plan('p', 'now', steps=[Step('s1', 'o/r#1', 'echo hi', cwd='~')]) >>> text = review_prompt(p, {'s1': ['clean checkout']}) >>> 'echo hi' in text, 'clean checkout' in text, 'o/r#1' in text (True, True, False)
- Return type: