atomic-love-graph-loop (ALGL) — a task graph executed as an unattended, resumable loop, where a deterministic ledger owns every decision with an objective answer and the model owns only the judgement calls.
Built on the Atomic Task Graph method of
Zhang et al. and the
Love Equation regulator. Drops into Claude Code
or any harness that reads Agent Skills-format
SKILL.md files.
Completion is a hash, not a claim.
a node is done <=> its artifact exists
AND a cached gate-pass matches that artifact's sha256
AND the files it wrote are still as the gate found them
There is no status field to write — algl.py recomputes it, so nothing can assert its own
completion. A node whose session died mid-flight has no artifact, so it is simply ready
again: crash recovery falls out of the data model instead of needing a reaper.
The gate is a defection oracle. An executor that reports success and fails its gate has defected, measurably. That objective signal feeds the regulator, so trust decays on evidence rather than opinion:
LEQ handoff — global E=1.0
worker-a: E=4.055 weight=0.9427 coop=1 defect=0 last=proceed
worker-b: E=0.247 weight=0.0573 coop=0 defect=1 last=redirect
ACTIVE VETO: worker-b on "n2: sloppy work" — do not proceed unblocked
Consequential nodes are held until scored. A high-defection node is redirected, not merely refused — rebuilt as a lower-defection subgraph consuming the same inputs and satisfying the same acceptance criterion. That is the method's own Stage-4 repair triggered by a different signal.
ALGL is a hard dependent of love-equation: every
consequential decision shells out to that repo's scripts/leq.py, and the trust state it
keeps in .leq/ persists across runs. Install the dependency first.
git clone https://github.com/RegardV/love-equation.git /tmp/love-equation
bash /tmp/love-equation/install.sh
cp -r skills/atomic-love-graph-loop ~/.claude/skills/
ALGL=~/.claude/skills/atomic-love-graph-loop/scripts/algl.py
python3 $ALGL --selftest # the ledger → "selftest ok"
python3 $ALGL --deps # the dependency → "love-equation ok: <path>"Both checks, not just the first. --selftest exercises the ledger and passes happily
with love-equation absent, and validate needs a graph to load, so neither can fail on a
broken install. --deps resolves the scorer and runs it, because what ALGL needs is the
working scripts/leq.py — a partial copy carrying only SKILL.md and references/ looks
installed and isn't. If yours lives somewhere non-standard, point $ALGL_LEQ at it;
otherwise ALGL looks in ~/.claude/skills/love-equation/scripts/leq.py and on PATH.
New Claude Code sessions pick it up automatically. Other harnesses may not rescan until they restart.
If you installed an earlier version of this repo, you have a skill ALGL cannot coexist
with. They hold opposite contracts over the same job: the old loop skill stores a status
field and derives completion from it, while ALGL rejects a stored status outright and
derives completion from an artifact hash. Their triggers are nested with no exclusion
language, so any task matching ALGL matches both — and the model can then write a status
into an ALGL graph and hit a hard validation failure, or split one task's state across
.atg/ and .algl/.
mkdir -p ~/.claude/skills-archive
mv ~/.claude/skills/atomic-task-graph-loop ~/.claude/skills-archive/ # reversible
find ~ -type d -name "atomic-task-graph-loop" -not -path "*/skills-archive/*" # no maxdepthRun that find unbounded. Skill trees get copied per project and per harness profile, so
copies hide in places a shallow search misses.
For the full procedure — dependency checks, multi-root installs, trigger-overlap resolution, and confirming the harness actually registered the skill rather than just holding the files — hand INSTALL_AGENT.md to your agent and say "install this skill following the recipe."
"Use atomic-love-graph-loop to migrate all 40 API endpoints to the new auth middleware."
or on a cadence: /loop continue the ALGL migration.
The first iteration compiles the task into a DAG of atomic tool calls, validates it before
paying for anything, and writes .algl/graph.json. validate --preflight also runs every
gate up front and requires each to fail — a gate that is green before the work exists cannot
tell a finished node from an unstarted one. Every iteration after that:
algl.py next # what to run — not a judgement call
algl.py verify --node n2 --agent w # RUNS the gate; the executor never reports its own resultNodes with overlapping writes are serialized rather than isolated — merging two worktrees
produces a state neither node's gate ever covered. Repairs and redirects charge one sticky
budget per repair scope, so replacing a node cannot launder an exhausted scope into a fresh
one. When nothing can run and the graph is incomplete, the loop stops itself and reports
rather than waking forever with nothing to do.
| Path | What it is |
|---|---|
| skills/atomic-love-graph-loop | The skill. Self-contained — method, protocol, and scripts/algl.py. |
| skills/atomic-task-graph | The underlying method alone, for one-shot in-session work with no loop, state file or regulator. Not needed by ALGL. |
| INSTALL_AGENT.md | Agent-driven install recipe. Handles the conflicts a blind cp gets wrong. |
| BUILD_LOG.md | The decisions, and what testing the earlier prose protocol broke. |
| trials/trial-01.md | The first real run: what held, what broke, and what is still untested. |
| .github/workflows/ci.yml | Runs both self-tests on every push. |
scripts/algl.py is stdlib-only with a self-test covering every failure mode found by
testing the earlier prose protocol: stranded in-flight nodes, livelock when nothing is
runnable, budget laundering via node replacement, retry-forever on a failing gate, write
collisions, tampered artifacts and stale-schema state files. CI runs it on every push.
The ledger is tested. The regulator's premise is not: love-equation's own NOTICE states plainly that the Love Equation is a design heuristic, not a validated model, and it still requires testing. ALGL inherits that. A green ledger is not a validated run — read the diffs.
Nor is a green ledger a working system. Gates are per-node, so a graph can pass every one of
them and still assemble into something that does not run — twelve green parts, one dead
whole. Stage 2's end-to-end row exists to force one node that exercises the assembled thing,
but no script can check that you wrote it. COMPLETE means nothing failed, not that it
works.
MIT — see LICENSE. The Atomic Task Graph method is the work of Zhang et al. (arXiv:2607.01942); the Love Equation is Brian Roemmele's. This repository is an independent implementation of both as agent skills. Papers are linked, not vendored.