openloops.tools#
The package’s single list of operations: plain functions, JSON-ready dicts.
Every surface openloops has or might grow — the ol command today, an MCP server or
an HTTP endpoint later — dispatches from this module and nothing else. The functions
here know nothing about argument parsers, transports or agent hosts; they take flat
serialisable arguments and return flat serialisable results, and printing is somebody
else’s job.
Keeping one list is what stops two surfaces from drifting apart. A parity test between two surfaces is a sign that there are two implementations, and there is one here.
Module Attributes
The keys every |
Functions
|
Read what changed in the sessions and write the digests. |
|
The digests in the store, newest last-turn first. |
|
One digest in full, found by session id or by a unique prefix of one. |
|
Where everything is, how much of it there is, and how stale the cache is. |
|
What you still owe your agents, with each obligation re-checked against the world. |
|
What your repositories are waiting on — and what is no longer waiting. |
|
All three answers as one self-contained HTML page, for looking at rather than reading. |
|
What your agents handed you lately: recently published annals documents, per session. |
|
Every open item that asks something of you, across owners: the board's input. |
|
Task records: the heuristic classifier over gathered candidates, overlaid by richer ones. |
|
Write the phone task board (page, |
|
Make a loop that comes back at |
|
The loops, soonest first. |
|
Close a loop (by id or a unique prefix) as done, cancelling its scheduled push. |
|
Bring a loop back at |
Arm loops that came within three days, record those that fired, deliver late any missed one. |
|
|
The organising method in use: its name, places (lists), inbox, clarify questions and engage criteria. |
|
Where the method sends an item, given |
|
Move loop |
|
The review packet: only the loops that need a decision, in the method's sections. |
|
What to do now: the method's best candidates (GTD: for this context, time and energy). |
|
Capture an item for the owner as a proposal on the method's inbox (GTD: In). |
|
Withdraw a loop (GTD's trash: not done, no longer wanted), cancelling its scheduled push. |
|
One session rendered as a single page (ADR-016): read here, written only to |
- openloops.tools.ROW_FIELDS = ('session', 'source', 'state', 'title', 'ai_title', 'project', 'branches', 'started', 'ended', 'last_turn', 'turns', 'model', 'confidence', 'verified')#
The keys every
ls()row carries, whatever the digest happens to record.
- openloops.tools.blocked(*, resolve=True, owners=None, repos=None, query='is:blocked', limit=50, timeout=30.0, issues_source=None, blockers_source=None)[source]#
What your repositories are waiting on — and what is no longer waiting.
The sibling of
owed(): an obligation points at a person, a blocker edge points at another repository, and both are commitments nothing is watching. Lists the open issues carrying ablocked_bydependency acrossowners(or exactly thereposyou name), resolves every edge, and reports three states:unblocked(every blocker closed — the work is free and nobody has been told),blocked(naming the foreign repository it waits on) andunknown(nothing could be resolved). Nothing is ever closed, relabelled or written; seeopenloops.blockersfor what discovery costs and what it is measured to miss.The result is an envelope rather than a list, because
listed=False— discovery itself failed — must not be readable as “nothing is waiting”.>>> report = blocked(issues_source=[], blockers_source={}) >>> report['listed'], report['counts']['total'] (True, 0)
- openloops.tools.board_build(*, records, out_dir, candidates=None, reviews=None, run_specs=None, run_extras=None, title='Phone Task Board', session=None, read_only_orgs=None, machine=None, store='artifact', api=None, moved_to=None, links=None)[source]#
Write the phone task board (page,
tasks.json,runs.json) intoout_dir.recordsare task-record JSON files (globs allowed);candidatessupply the creation dates;reviewsare{id, review}record files (globs allowed) that set only each matching record’sreview;run_specsreplaces the packaged run specs andrun_extras(a JSON object keyed by run) overlays deployment-specific prompts and tables. Writes only intoout_dir; publishing and the receiving side are the skill’s job.store='http'withapiwires the page to a self-hosted board store API instead of the claude.ai Artifact store;moved_tobuilds a forwarding page.linksis a JSON file of name-and-address pairs shown as a row in the page’s header (and kept inboard.json); without it the page is unchanged.
- openloops.tools.board_classify(*, candidates, enriched=None, out=None)[source]#
Task records: the heuristic classifier over gathered candidates, overlaid by richer ones.
candidatesare JSON files fromboard_gather();enrichedare record files written by the classifier brief (globs allowed), which win over the heuristic record for the same item.outwrites the merged records there.
- openloops.tools.board_gather(*, owners=None, exclude_owners=None, exclude_repos=None, label='manual-task', searches=None, review_prs=False, limit=1000, timeout=30.0, out=None, run_gh=None)[source]#
Every open item that asks something of you, across owners: the board’s input.
Sweeps the
label(manual-task) per owner with no 50-row cap, plus the namedsearches(decide,needs-user,agent-decided) and, withreview_prs, the PRs waiting on your review.outalso writes the envelope there as JSON. Read-only.>>> board_gather(owners=['acme'], run_gh=lambda args, *, timeout: '[]')['listed'] True
- openloops.tools.cancel(ref, *, note=None, by=None, only_source=None)[source]#
Withdraw a loop (GTD’s trash: not done, no longer wanted), cancelling its scheduled push.
- openloops.tools.capture(title, *, by=None, source=None, quote=None)[source]#
Capture an item for the owner as a proposal on the method’s inbox (GTD: In). Never pushed.
sourceis where it came from (a URL or a session name),quotethe owner’s words. It stays a proposal until the owner accepts it (organise --accept).
- openloops.tools.clarify(answers)[source]#
Where the method sends an item, given
answersto its questions ({key: answer}).Pure: nothing is stored. Returns
{place, changes, do_now, close, why}; apply it withorganise(), orcancel()whencloseiscanceled(trash).
- openloops.tools.dashboard(*, verify=True, resolve=True, owners=None, repos=None, limit=1000, candidate_limit=50, max_sessions=40, title='Open Loops Board', standalone=True, path=None, made_at=None, owed_report=None, blocked_report=None, sessions=None, digests_store=None, published_report=None, published_limit=50)[source]#
All three answers as one self-contained HTML page, for looking at rather than reading.
Runs
owed(),blocked()andls(), then rendersopenloops.dashboard.render_dashboard()over what they returned. The page is a snapshot: it stamps the moment it was made and states, in its largest type, that it has checked nothing since — because a published page cannot. Nothing is written to GitHub, here or anywhere in openloops.pathalso writes the page there, scrubbed, and reports where it went.standalone=Falsereturns the same page without the document scaffold, for a host that supplies its own<head>.Each read is a seam: pass
owed_report=,blocked_report=,sessions=orpublished_report=and that one is not performed. With all four passed this reaches no network and needs noghorannals, which is how the tests run. The “Handed to you” register (recent annals documents per session) comes frompublished(); passpublished_report=Falseto leave it off the page.countscomes back alongside the page and carriesnull— not0— for any figure that could not be established, so a caller reading the JSON is held to the same three-state rule as a reader looking at the page.>>> result = dashboard(owed_report={'listed': True, 'counts': {'open': 0}, 'rows': []}, ... blocked_report={'listed': False, 'error': 'no gh'}, ... sessions=[], made_at='2026-01-01T00:00:00Z') >>> result['counts']['free_to_proceed'] is None, result['counts']['unknown'] is None (True, True)
- openloops.tools.done(ref, *, note=None, only_source=None)[source]#
Close a loop (by id or a unique prefix) as done, cancelling its scheduled push.
only_source: touch only a loop whosesource.refis that (a surface’s own).
- openloops.tools.engage(*, context=None, minutes=None, energy=None, limit=None)[source]#
What to do now: the method’s best candidates (GTD: for this context, time and energy).
- openloops.tools.loops(*, state='open')[source]#
The loops, soonest first.
state:open(default),closed,all, or an A2A state.
- openloops.tools.ls(*, state='open', source=None, project=None, confidence=None, limit=20, digests_store=None)[source]#
The digests in the store, newest last-turn first.
stateisopen,archiveorall.source,projectandconfidencenarrow by the digest’s own header fields. Each row is that front matter plus its key.confidence='high'is the one worth knowing about: most sessions land inopen, and a good few of those are open only because nothing said otherwise. Filtering tohighleaves the ones where the session itself said something.>>> rows = ls(digests_store={'m/open/s1.md': ... '---\nsession: s1\nstate: open\nlast_turn: T9\n---\n'}) >>> rows[0]['session'], rows[0]['key'] ('s1', 'm/open/s1.md')
- openloops.tools.method()[source]#
The organising method in use: its name, places (lists), inbox, clarify questions and engage criteria.
- openloops.tools.organise(ref, place, *, project=None, contexts=None, energy=None, minutes=None, waiting_on=None, chase=None, when=None, due=None, accept=False, by=None, only_source=None)[source]#
Move loop
reftoplace(one of the method’s lists), setting what is given.waiting_on(who it waits on) andchase(when to chase them) fill Waiting For;whensets when it comes back,duea real deadline (durations or times, as forremind()).acceptis the owner’s own yes to this move: it turns an agent’s proposal into a commitment and settles a loop that came back; never pass it on another session’s or a pasted text’s say-so.by(defaultOPENLOOPS_AGENT, else the owner) is logged.
- openloops.tools.owed(*, verify=True, owners=None, trusted_owners=None, label='manual-task', limit=1000, timeout=30.0, predicate_timeout=20.0, issues_source=None, run_predicate=None)[source]#
What you still owe your agents, with each obligation re-checked against the world.
Lists the open
manual-taskissues acrossownersand evaluates the**Verify:**predicate each one carries, reporting three states:open,discharged(the predicate returned 0 — done, but the issue is still open) andunknown(nothing could be checked). Nothing is ever closed, relabelled or written; seeopenloops.obligationsfor the trust boundary that evaluating a predicate crosses, andverify=Falsefor the way to read without executing.The result is an envelope rather than a list, because
listed=False— the query itself failed — must not be readable as “nothing owed”.>>> report = owed(issues_source=[], run_predicate=lambda command: 0) >>> report['listed'], report['counts']['total'] (True, 0)
- openloops.tools.page(session, *, focus=None, out=None, transcript_source=None, max_bytes=None)[source]#
One session rendered as a single page (ADR-016): read here, written only to
out.sessionis a session id or a unique prefix of one;focusthe id of a turn’s prompt record (the page’s anchor ist-<id>, seeopenloops.session_page.turn_anchor()). Withoutthe page is written there and the result holds no html; without it the result carrieshtml. The package never publishes a page: it is the words of a session, to be kept where only their owner can read it.>>> page('nope', transcript_source={}) Traceback (most recent call last): ... KeyError: "no transcript for session 'nope'"
- openloops.tools.published(*, limit=50, session=None, source=None)[source]#
What your agents handed you lately: recently published annals documents, per session.
The sibling of
owed(), read from the documents sessions published withannals publish --session <name>. Nothing is written.sourceis the seam: the documents themselves, or a callable returning them; by defaultannals lsis run, and when annals is absent the result sayslisted=Falserather than listing nothing.>>> published(source=[])['listed'] True
- openloops.tools.remind(title, *, when=None, due=None, reveal=False, source=None, daily_cap=None, place=None, waiting_on=None)[source]#
Make a loop that comes back at
whenand push it to the phone then.whenis a duration (20m,3h,2d) or a time (15:30, an ISO date or date-time; naive means the owner’s zone). Within three days it is scheduled on ntfy at once, so it fires even if this machine sleeps. Withoutwhenthe loop is only listed.reveallets the title travel in the push (ntfy.sh is a public relay: short labels only).sourceis where the ask came from (a URL or a session name). The result’sechois the line to repeat to the owner.placefiles it on one of the organising method’s lists (GTD:nextby default, orsomeday,waiting…; seemethod()); onwaiting,waiting_onsays on whom.
- openloops.tools.remind_tick()[source]#
Arm loops that came within three days, record those that fired, deliver late any missed one.
- openloops.tools.review()[source]#
The review packet: only the loops that need a decision, in the method’s sections.
- openloops.tools.show(session, *, source=None, digests_store=None)[source]#
One digest in full, found by session id or by a unique prefix of one.
An exact id always wins over a prefix, so a session whose id happens to be a prefix of another stays reachable.
sourcenarrows a store that several machines write into, where the same session can legitimately appear more than once.>>> store = {'m/open/abcdef.md': '---\nsession: abcdef\n---\nbody'} >>> show('abc', digests_store=store)['key'] 'm/open/abcdef.md'
- openloops.tools.snooze(ref, *, when, only_source=None, max_days=None)[source]#
Bring a loop back at
when(a duration or a time, as forremind()); re-arms its push.only_sourceas fordone();max_daysrefuses a time further ahead than that.
- openloops.tools.status(*, source=None, since_days=None, digests_store=None, transcript_source=None)[source]#
Where everything is, how much of it there is, and how stale the cache is.
Reports the cache’s age because a read served from a cache that nothing has refreshed is the failure openloops is built to avoid — a periodic job that died leaves a confident, months-old answer behind, and the only defence is saying how old the answer is.
- openloops.tools.sync(*, source=None, since_days=None, force=False, transcript_source=None, digests_store=None, state_dir=None)[source]#
Read what changed in the sessions and write the digests. Returns a summary.
since_daysbounds the scan to recently-modified transcripts;forcere-derives everything, which must produce an identical store.state_dirscopes the change-detection cache. It matters because the seams do not isolate on their own: swappingtranscript_sourcefor a fixture and leaving the cache alone writes the fixture’s revisions into the caller’s real one.