The work graph
How an agent and its subagents share goals, intents, facts and findings through the graph tool, claim work without colliding, and check what is done and what was never examined.
When an agent delegates, its subagents usually report back in free text. The work graph gives them a shared, durable structure instead: the agent that coordinates writes goals and directions of work, subagents claim one direction at a time and write back what they observed and concluded, and anyone in the task can read the whole picture. The idea comes from studying ARTEX, a third-party multi-agent system; the design is ADR 0095.
What is in the graph
| Node | What it is | States |
|---|---|---|
| goal | what the task must achieve | open, met, abandoned |
| intent | one direction of work ("bisect the failing test") | open, running, paused, done, blocked, exhausted, stopped |
| fact | something observed, with its evidence (a command, a file:line, an output) |
confirmed, dismissed |
| finding | a conclusion that matters, resting on facts | confirmed, dismissed |
Nodes are linked: a goal or a fact spawns an intent, an intent yields facts and findings, a finding is derived from facts, and a confirmed fact or finding proves a goal. The rules are enforced, not suggested:
- An intent follows from facts or findings (never from another intent), or from the goal it serves.
- Whatever a subagent records while it holds an intent is linked to that intent.
- A goal is met only by pointing at a confirmed fact or finding. "I think it's done" is not enough.
- A node and its links are written together or not at all.
The graph tool
Agents use one tool, graph, with an action:
| Action | What it does |
|---|---|
overview |
One bounded snapshot: goals, open intents by priority, running intents with who holds them, recently settled intents, recent facts and findings. Every cut list says how many there are in all |
add_goal |
A goal, from text |
add_intent |
A direction of work: text, parents (fact or finding ids) or goal, and an optional priority (higher is claimed first) |
claim |
Take the highest-priority open intent. The agent now holds it; the result shows the facts it follows from |
record |
Facts and findings, several at once: items: [{kind, text, evidence?, basis?}]. A bad item is refused with the right shape and the rest are kept |
settle |
Finish the held intent: state done, blocked, exhausted, stopped, paused, or open to give it back |
coverage |
The coverage ledger (below) |
prove_goal |
Mark goal id met with evidence, the id of a confirmed fact or finding |
The tool appears only where it can help: in the main agent once it delegates with task (in coordinator mode from the start), and in a subagent when its task tree is already using the graph. A session that never delegates sends no extra tokens.
Permissions
The graph tool is asked for like other tools:
| Mode | What happens |
|---|---|
| plan | denied, so the tool is not offered in plan mode at all (a plan-mode subagent such as an explorer reports in text instead) |
| default, accept-edits | you are asked |
| auto | the auto-mode classifier decides, as for other tools that would ask |
| yolo | allowed |
A subagent's request is asked of you in the main session; a headless run with no one to answer denies it. To stop the questions, add an allow rule for graph to your own rules (for example "allow": ["graph"] in ~/.venom/permissions.json); it applies in every mode except plan. A deny rule on graph turns the tool off.
Text read back from the graph was written by another agent, so petawork marks it as outside content, the same way it marks file contents. Anything that looks like a secret is removed before it is stored and again before it is shown.
Claims that cannot collide
Two subagents never work on the same intent. A claim is a single database update that only one caller can win, and it carries a random token. While an agent holds an intent, petawork renews the claim every 15 seconds and on each graph call. If the agent stops (it crashed, or its machine slept), the claim expires after 90 seconds without a renewal and the intent goes back to the open list for someone else. The expiry is measured by the database's clock, not by any one agent's.
An agent whose claim expired and was taken over is told "claim lost" on its next call, and its late settle is refused, so it cannot overwrite the new holder's work. A subagent that finishes without settling gives its intent back at once.
Warnings in the overview
- Repeats. The same direction (compared in lowercase, with numbers and spacing ignored) tried three times with no finding since the first try. Try something else.
- Facts but no finding. Intents that produced observations but no conclusion.
The coverage ledger
For reviews and audits, the ledger records what was examined, area by area:
coveragewithsurface,area,outcomeand anoterecords one area. Outcomes: reported, no_issue_found, ruled_out, not_applicable, needs_follow_up. The previous outcome is kept in the history.coveragewithsurfaceandareaslists areas that must be examined.coveragealone reports the ledger.
A negative outcome (no issue found, ruled out, not applicable) without a note saying why is accepted but reported as a gap. A required area nobody examined is reported as unexamined, never as clean.
Where it is stored
One SQLite file per repository, venom-workgraph/graph.db in the repository's git directory, shared by every worktree and every petawork process working on it; outside a git repository, workgraph/graph.db in petawork's home directory (~/.venom). Each task tree has its own graph inside the file, named after the main session, so resuming the session finds it again. Nothing leaves your machine. A cloud version shared between machines is planned.
For app builders
@venom/harness exports the store as WorkGraph (WorkGraph.open(path), addGoal, addIntent, record, claim, heartbeat, settle, sweep, overview, coverage, proveGoal) and the tool's pieces (graphExtension, shareGraph, runGraphOp). A stale claim throws WorkGraphError with the code claim_lost or state_changed.