openloops.board#
The phone task board: task records in, a static page and its data files out.
build_board() writes five files into a directory the caller names:
The page is meant to be published as a claude.ai Artifact with a db capability.
Its persistence model (immutable outbox/<eventId> events written by the page,
receipts/<eventId> written only by the receiving session) is documented at the
top of its <script>.
What openloops does not do (ADR-008): post the comments, close the issues or
dispatch the workers that the board’s events ask for. That write side is a
procedure a Claude session follows, shipped as the openloops-phone-board skill.
This module writes files into out_dir and nothing else, and it never puts the
data anywhere near the repository: where the board lives is the caller’s choice.
>>> tasks = [
... {'id': 'a/x#1', 'tier': 'browser', 'pattern': 'api-key', 'minutes': 3},
... {'id': 'a/y#2', 'tier': 'browser', 'pattern': 'api-key', 'minutes': 5},
... {'id': 'a/z#3', 'tier': 'tap', 'pattern': 'other', 'status': 'likely-done'},
... ]
>>> [(r['key'], r['ids']) for r in group_runs(tasks)]
[('cleanup', ['a/z#3']), ('api-key', ['a/x#1', 'a/y#2'])]
Functions
|
The page as a full HTML document, for hosting outside a claude.ai Artifact. |
Where the page template and the default run specs ship, inside the package. |
|
|
Write the board's five files into |
|
Repeated chores grouped into runs, ordered as the specs are. |
|
Fill each record's missing |
|
The deployment's run extras (a JSON object keyed by run), or |
|
The run specs: one per pattern, in display order. |
|
Cheapest first: by tier, then by minutes per thing the item unblocks. |
- openloops.board.as_document(fragment)[source]#
The page as a full HTML document, for hosting outside a claude.ai Artifact.
The page template is a fragment, because the Artifact host supplies the document skeleton; anywhere else the skeleton has to be in the file. The page’s own styles come after this reset, so its dark theme still wins.
>>> doc = as_document('<title>t</title><p>hi</p>') >>> doc.startswith('<!doctype html>') and 'name="viewport"' in doc True >>> as_document(doc) == doc True
- Return type:
- openloops.board.board_dir()[source]#
Where the page template and the default run specs ship, inside the package.
- Return type:
- openloops.board.build_board(records, out_dir, *, candidates=(), specs=None, extras=None, title='Phone Task Board', session=None, read_only_orgs=(), machine=None, store='artifact', api=None, moved_to=None, links=None)[source]#
Write the board’s five files into
out_dirand say what went in.links(seenormalise_links()) puts a row of name-and-address links in the page’s header and keeps them inboard.json. Links only: no card, no fetched count. Without links the page andboard.jsonare exactly what they were.sessionis the name of the Claude session that receives the board’s events (the page names it in the prompts it copies);read_only_orgsare organisations whose items the page never offers to close or comment on;machineis the default machine named by a run’s “have an agent start this run”.storepicks where the page keeps its state:artifact(the claude.ai Artifactdbcapability) orhttp(a self-hosted board store API atapi, same origin as the page, served by anything wrappingopenloops.board_store).moved_to(anhttps://URL) builds the page as a forwarding notice: it flushes what a phone already queued and takes no new taps.
- openloops.board.group_runs(tasks, *, specs=None, extras=None)[source]#
Repeated chores grouped into runs, ordered as the specs are.
Open items go to their pattern’s run (a
mac-onlytier goes tomac-only);likely-doneandstaleitems go tocleanup. A pattern with no spec, or with fewer items than itsmin_items, has no run.extrasoverlays a run by key, for what only this deployment knows (a prompt, a package table, a better title). Itsabsorbnames other runs whose items move into this one, and those runs disappear: two chores done in one session run.
- openloops.board.join_created(tasks, candidates)[source]#
Fill each record’s missing
createdfrom the gathered candidate with its URL.>>> join_created([{'url': 'u', 'created': None}], [{'url': 'u', 'created': '2026-01-02'}]) [{'url': 'u', 'created': '2026-01-02'}]
- openloops.board.run_extras(path=None)[source]#
The deployment’s run extras (a JSON object keyed by run), or
Nonewithout a path.>>> run_extras() is None True
- openloops.board.run_specs(path=None)[source]#
The run specs: one per pattern, in display order. Packaged ones by default.
Each spec is
{key, title, why, steps, tier?, min_items?, prompt?, machine?};keyis a pattern fromopenloops.tasks.PATTERNS, orcleanup.>>> run_specs()[0]['key'] 'cleanup'