πŸ” simplicio-loop β€” The Universal Looping AI Orchestrator


πŸš€ The new generation β€” an operating system for verified agent work

simplicio-loop has evolved far beyond a repeat-until-done prompt. It now compiles intent into a frozen task contract, maps the repository, schedules dependency-aware work, fans execution out into isolated worktrees, collects structured receipts, verifies independently, rolls back safely, remembers every attempt, and keeps the source of record synchronized through delivery.

  • Contract first β€” acceptance criteria, dependencies, risks, source state, and the completion oracle are explicit before execution.
  • Parallel without corruption β€” ready tasks run in isolated lanes/worktrees and converge through an operational ledger.
  • Automatic fan-out by default β€” batch provisions one owned worktree per independent, authorized task; overlap, missing evidence, or unavailable isolation falls back to a visible serial lane. See docs/AUTO_FAN_OUT.md.
  • Proof before completion β€” tests, impact/flow checks, watcher challenges, delivery receipts, and HBP evidence reject false done states.
  • Memory that changes behavior β€” the journal, stall detector, checkpoints, and cross-agent wiki prevent oscillation and make handoffs durable.

That architecture lets one goal become a governed delivery system: from a single hard task to an entire backlog, across sessions and runtimes, with local-first operators and receipts strong enough for humans, CI, or another agent to audit.

πŸ€– Shipped: a concrete agent behind every stage

Implementation status: #422–#436 β€” the whole EPIC β€” is closed and shipped as of v3.37.0, including the full mandatory stage-reporting gate (#433) and the multi-tracker interface (#436). v3.38.0 adds the multi-agent coordination layer on top (scripts/coordinator.py, scripts/pr_dod_review.py) β€” see Β§ What's new.

The portable driver assigns one accountable agent to intake/planning, implementation, safety, delivery, feedback/recovery, and final completion audit. Review fans out to four independent agents β€” security/correctness, code quality, runtime reproduction, and blast radius β€” before it can reconverge. Every transition emits an event and receipt; the completion auditor accepts evidence, never self-reported confidence.

Work-item comment policy

Work tracker Reporting policy Completion meaning
GitHub Issues / PRs Required for GitHub-bound runs COMPLETE waits for a remotely observed comment receipt
Azure DevOps Only when its connector is detected, authenticated, authorized, and target-resolved Connected providers report; NOT_CONNECTED is an explicit, non-blocking skip
Jira Only when connected Same canonical timeline, provider-specific confirmation
Asana Only when connected Same canonical timeline, provider-specific confirmation
Trello Only when connected Same canonical timeline, provider-specific confirmation
flowchart LR
  SOURCE["Issue Β· task Β· queue"] --> COORD["Portable coordinator"]
  COORD --> PLAN["Intake + Planner agent"]
  PLAN --> BUILD["Implementation agent"]
  BUILD --> SAFE["Safety agent"]
  SAFE --> R1["Review agent Β· security"]
  SAFE --> R2["Review agent Β· quality"]
  SAFE --> R3["Review agent Β· runtime/E2E"]
  SAFE --> R4["Review agent Β· blast radius"]
  R1 --> DELIVER["Delivery agent"]
  R2 --> DELIVER
  R3 --> DELIVER
  R4 --> DELIVER
  DELIVER --> RECOVER["Feedback + Recovery agent"]
  RECOVER --> BUILD
  DELIVER --> AUDIT["Completion auditor"]
  AUDIT --> VERDICT{"COMPLETE Β· PARTIAL Β· BLOCKED Β· REGRESSED"}
  PLAN -. "events + receipts" .-> LEDGER["Append-only stage ledger"]
  BUILD -.-> LEDGER
  SAFE -.-> LEDGER
  DELIVER -.-> LEDGER
  AUDIT -.-> LEDGER
  LEDGER --> GH["GitHub comments Β· REQUIRED"]
  LEDGER -. "only if connected" .-> AZ["Azure DevOps comments"]
  LEDGER -. "only if connected" .-> JIRA["Jira comments"]
  LEDGER -. "only if connected" .-> ASANA["Asana comments"]
  LEDGER -. "only if connected" .-> TRELLO["Trello comments"]
  GH --> AUDIT

The provider-neutral contract, capability probes, idempotent markers, durable outboxes, recovery rules, sandbox E2E matrix, and acceptance criteria are specified in #436. An optional provider is never treated as connected merely because a CLI exists, and no remote acknowledgment is ever invented.

πŸ†• What's new in v3.38.0 β€” the multi-agent coordination release

This release is about one hard problem that only shows up once several agent sessions work the same repo at once: how does a session know what's already claimed, what's already merged-but- incomplete, and what to do with its own idle time instead of duplicating a sibling's work? Every item below was built, tested, and shipped against the live, multi-session state of this very repo β€” not a synthetic scenario.

  • scripts/coordinator.py β€” the decision core. Given today's GitHub state (open-issue claim comments + merged PRs), it returns one deterministic action per issue: OWN (nothing claimed yet), CONTINUE_OWN (you're already the latest claimant), DEFER_ACTIVE_CLAIM (a sibling session claimed it recently β€” don't duplicate), RECLAIM_STALE (that claim went cold, safe to pick up), or VERIFY_PARTIAL (a PR already merged for this issue, but it's still open β€” check what's actually done before assuming either "nothing happened" or "it's finished"). It also raises a duplicate_risk flag the instant two sessions claim the same issue close together. Caught, live, on day one: two sessions independently building a findings collector for the same issue under two different filenames.
  • scripts/pr_dod_review.py β€” the reviewer for idle time. When every open issue is already claimed, a session's highest-leverage move isn't to wait β€” it's to check the open PRs against this repo's own bar: the 7-dimension Definition of Done (implementation, unit/integration/ system/regression tests, a performance benchmark, β‰₯85% coverage) and the underlying issue's frozen acceptance-criteria checklist. check --post posts a mechanical, line-by-line verdict as a PR comment instead of a vibe-based approval. Proven against a real, already-merged "MVP slice" PR: it correctly flagged 17 of 17 acceptance criteria on the parent epic as still unresolved.
  • scripts/finding_collector.py β€” durable, deduplicated defect memory (issue #466, phase 1). A simplicio.finding/v1 record per distinct defect, fingerprinted so the same underlying bug β€” seen by any agent, any run, any timestamp β€” collapses into one record with an occurrence count instead of spawning duplicate noise. No GitHub calls yet; that's the next phase. scripts/evolution.py (taxonomy + priority + dedup) and scripts/workflow_topology.py (DAG diff + validator) shipped as the first MVP slices of the companion Continuous Evolution (#467) and Adaptive Architecture (#468) epics; scripts/agent_replication.py did the same for Elastic Replication (#469) β€” admission control and winner-selection for speculative duplicate execution.
  • references/multi-agent-coordination.md + references/background-verification.md β€” two new documented conventions wired straight into SKILL.md's triage step: check coordinator ownership before touching an issue, review PRs instead of idling once everything's claimed, and launch slow verification commands (tests/claims_audit.py) in the background so a turn keeps making progress instead of watching a progress bar.
  • Mandatory post-merge cleanup (scripts/worktree_cleanup.py, #484) β€” a merged branch's local worktree and branch ref are now removed automatically instead of accumulating across sessions.
  • CLI contract additions (WI-471) β€” a preflight subcommand and a --json flag on status, so an external supervisor can machine-check readiness before arming a run.
  • Continuous Findings wiring (WI-466) β€” the completion gate now genuinely consults the finding store, and a store/repo consistency bug was found and fixed in the same pass.
  • Two real regressions caught and fixed on main itself, live, this release cycle β€” a PR that silently deleted a function definition (breaking loop_progress.py's own selftest) merged once, and a squash-merge race then reintroduced the exact same broken code onto main a second time. Both were found by actually running the affected script, not by trusting a green PR description β€” the whole reason coordinator.py and pr_dod_review.py exist now.
  • Carried forward from v3.37.0's Portable Stage Agents epic (#422–#436) β€” a concrete, independently verifiable agent behind every stage (intake/planner, implementation, four-way review panel, safety gate, delivery, feedback/recovery, completion auditor), a portable contract validator for the shared graph/receipt schema, human-readable agent identities, and optional native binds for simplicio-runtime, simplicio-mapper, and simplicio-dev-cli. Runtime rows are capability inventory; a runtime is counted as executed only by the separate installed lane when its binary and executable adapter are actually available.
  • Test-suite inventory is measured, not hard-coded. The checkout and the latest local gate receipt are the source of truth for file and result counts. scripts/test_categories.py reports the unit/integration/system/regression convention where it applies, including any uncategorized files; scripts/claims_audit.py stayed at 14/14 through every merge this cycle.

What this means for you, concretely: if you run simplicio-loop across more than one session or machine against the same repo, it now actively protects you from the two failure modes that actually happen in practice β€” two agents quietly redoing the same work, and a "done" PR that merged but left the real issue only partially solved. Neither used to be visible; both now are, mechanically, every triage pass.

See CHANGELOG.md for the full list and the v3.38.0 release for signed artifacts (wheel, sdist, SBOM, provenance).

⚑ TL;DR

simplicio-loop is a runtime-agnostic super-plugin β€” one autonomous looping orchestrator (invoked as /simplicio-loop) plus six satellite skills and five accelerators β€” that turns any strong LLM (Claude, Codex, Copilot, Gemini, Cursor, local models) into a self-driving worker. You point it at a body of work β€” "finish all the open issues", "clear the CI queue", "drain the Jira board" β€” and it runs the whole lifecycle on its own:

discover β†’ understand β†’ decide β†’ act β†’ verify β†’ correct β†’ record β†’ repeat

It discovers work from any source (GitHub Issues, Jira, Azure DevOps, agentsview sessions, and more), dedups, auto-scales an agent fleet to your machine, implements each item through a quality loop that runs the code (not just compiles it), opens PRs, resolves CI/review feedback, merges, and keeps watching 24/7 for new work β€” all behind safety gates and evidence checks.

/simplicio-loop finish all open issues
β†’ identity + pre-flight (auth, watcher, STOP path)
β†’ discover 50 issues Β· dedup Β· build dependency DAG
→ autoscale fleet = 14 · pipeline implement→review→merge
β†’ each item: read body+ACs β†’ orient code β†’ plan β†’ edit β†’ run β†’ verify β†’ PR
β†’ merge Β· close with evidence Β· rollback if main breaks
β†’ keep looping every ~2 min until the queue is dry (evidence-gated, never a false "done")

Three things make it different: it is a super-plugin of focused skills, it runs the same protocol on 15 runtimes, and it does all of this with aggressive, honest token economy.

The skill installs standalone too: you do not need simplicio-runtime or any mandatory runtime-native component just to use simplicio-loop. Native binds, operators, capture services, and the wider Simplicio runtime stack are optional accelerators on top of the core skill bundle.

Within the Simplicio product line, this repo is also the current reference task flow for company work. simplicio-runtime is the unified entrypoint going forward, but it is expected to reuse this loop's evidence-gated converge/drain discipline, durable attempt journal, and worker coordination patterns instead of creating a separate task semantics.

πŸ‘οΈ Progresso visual, honesto e portΓ‘til

Cada execuΓ§Γ£o pode ser acompanhada por texto, Markdown, JSON ou uma animaΓ§Γ£o ANSI. Todas as superfΓ­cies consomem o mesmo evento simplicio.progress/v1, incluindo Γ­cones de etapa, gates de evidence/watcher/oracle, lanes de worktrees e eventos de worker_claimed atΓ© delivery_reconciled.

simplicio-loop progress <run-id> --format text --once
simplicio-loop progress <run-id> --format markdown --once   # LLM/chat
simplicio-loop progress <run-id> --format json --once       # dashboard/adapters
simplicio-loop progress <run-id> --format text --ascii --no-animation  # log/PowerShell

100% sΓ³ aparece com receipt do oracle pronto (COMPLETE/DRAINED); uma fase done sem prova fica quase concluΓ­da e mostra o blocker. Consulte o contrato completo em docs/PROGRESS_PROTOCOL.md.


πŸ€– LLM front door

If you are an agent/runtime entering this repo cold, read llms.txt first for the short operational contract, then AGENTS.md, then .claude/skills/simplicio-loop/SKILL.md.


πŸ“˜ Official capability record

The complete, official roster of what simplicio-loop ships β€” every capability below is real, runnable, and tested by the applicable local gate. Exact collected/executed/skipped/deselected counts belong to that gate receipt, not this document. Each capability links to its deep section and its worker.

Capability What it does Proof / worker Details
🎬 Video evidence (video_evidence) Records the real browser session as moving proof a UI change works (Playwright, default); renders a deterministic captioned MP4 with hyperframes for an explicit explainer request (/simplicio-loop make a video of screen X) scripts/video_evidence.py · BLOCKED (never fake-pass) without the toolchain § Video evidence
🧠 Attempt memory + stall detector A durable run-journal (.orchestrator/loop/journal.jsonl) + a stall detector so the loop changes strategy instead of oscillating; incremental triage (since) reads only the delta each turn, and optional stage lineage makes retries/governance explicit scripts/loop_journal.py · selftest 13/13 § Anti-oscillation
🧭 Repo conventions (repo_conventions) Learns the repo's own playbook β€” mines git history + merged PRs + static config into .orchestrator/conventions.json so every new branch/commit/PR mirrors the team's established style; worktree-per-item isolation is the default scripts/repo_conventions.py Β· selftest 19/19 Β§ The full flow
🧩 Scope reflection (dependency_graph) Maps local dependencies, reverse dependents, and related tests from the planned touched files; blocks task plans that ignore callers, sibling files, or proof points before the edit starts scripts/impact_audit.py · selftest § Tests & local checks
πŸ•ΈοΈ Flow coverage (endpoint_compare) Maps mixed front/back/service workspaces: UI actions β†’ frontend HTTP calls β†’ backend endpoints β†’ service calls; blocks frontend calls with no backend endpoint and stubbed endpoints, and surfaces unclassified loose ends scripts/flow_audit.py Β· selftest Β§ Tests & local checks
πŸ”’ Fail-closed safety gate (action_gate) A PreToolUse/git-pre-push hook that mechanically blocks force-push, history rewrite, mass-delete, destructive DDL, infra teardown, and secret-laden commits/pushes β€” Step 5 made executable, not prose hooks/action_gate.py Β· selftest 15/15 Β§ Safety
πŸ”¬ Local verification A test suite (worker selftests + an e2e of the loop driver proving evidence-gated exit) + a claims-audit (referenced scripts exist Β· counts consistent Β· _bundle ≑ source) β€” all local, no paid CI scripts/check.py Β· scripts/claims_audit.py Β· tests/ Β§ Tests & local checks
βœ… Honest savings The savings line is now evidence-gated, not mandatory β€” a number is shown only with a measured receipt (clamp/signatures/cache/deterministic_edit/ledger); never fabricated token-economy contract Β§ Token economy
🀝 Multi-agent coordinator (coordinator.py) Decides OWN / CONTINUE_OWN / DEFER_ACTIVE_CLAIM / RECLAIM_STALE / VERIFY_PARTIAL per issue from live claim comments + merged PRs, so two sessions never duplicate the same work scripts/coordinator.py · selftest 10/10 § The full flow
πŸ•΅οΈ PR DoD/AC reviewer (pr_dod_review) When every issue is claimed, reviews open PRs against the 7-dimension Definition of Done + the issue's own acceptance-criteria checklist β€” a mechanical verdict, not a vibe-based approval scripts/pr_dod_review.py Β· selftest 13/13 Β§ The full flow
🐞 Finding collector (finding_collector) Fingerprinted, deduplicated defect memory β€” the same underlying bug collapses into one record with an occurrence count, no matter how many agents/runs observe it scripts/finding_collector.py Β· selftest 9/9 Β§ Official capability record
πŸ”” Release check (release_check) Compares the local canonical version against the latest GitHub release and tells the driving LLM to update instead of quietly working on a stale checkout β€” fail-open when offline scripts/release_check.py Β· selftest 8/8 Β§ Install & use

Two loop modes make termination explicit: converge (a single hard task β€” ends on the evidence-gated <promise> or a stall escalation) vs drain (a queue β€” ends when the source re-query stays empty K rounds). Both still obey the universal exits (promise+evidence, max_iterations, STOP).

Loop scoring across this line of work: 7.5 (strong design, unproven) β†’ 9 (attempt memory + anti-oscillation) β†’ 9.5 (reproducible local proof) β†’ ~10 (enforced safety + complete loop semantics). The verification infra now catches the project's own regressions as it grows.


🧠 The 7 skills + 5 accelerators

The orchestrator core + six satellites + five accelerators/integrations. Each satellite is optional β€” when loaded, the orchestrator delegates to it (richer + cheaper); when absent, the inline protocol covers 100%. Accelerators are auto-detected β€” present = used, absent = LLM fallback.

# Capability Absorbs What it does Token impact
1 πŸ” simplicio-loop β€” Unified public entrypoint: orchestrator core + hardened loop behind one command Core + loop
2 ↩️ simplicio-tasks legacy alias Compatibility shim for older installs and saved prompts Legacy alias
3 🧱 simplicio-orient rtk + caveman Terminal-first execution, output-reduction catalog, tee-cache, signatures-read L0 deterministic
4 πŸ”₯ simplicio-review thermos Parallel adversarial review on distinct rubrics β†’ deduped verdict Quality gate
5 πŸ—œοΈ simplicio-compress caveman Output + memory compression, fail-closed transform_guard 40-60% fewer
6 πŸŽ“ simplicio-learn teaching Post-run retrospective β†’ durable, deduped lessons in memory Smarter each run
7 πŸ§ͺ simplicio-autoresearch Karpathy autoresearch + ECC autoresearch-agent Evolutionary mutate/eval/keep-revert loop: yool-guardrailed caps, git-isolated branch, anti-Goodhart gate-first eval, savings-event receipt Auto-optimize
8 🧭 Understand Anything Egonex-AI Knowledge graph orient: semantic search, guided tours, dependency graph L0 zero tokens
9 πŸ“Š agentsview kenn-io Session analytics, cost tracking, stalled-session discovery L1 SQL only
10 ⚑ LMCache LMCache KV cache between loop turns β€” 40-70% TTFT reduction on local models GPU time ↓
11 πŸ—œοΈ Simplicio capture engine engine/simplicio_engine.py (native, stdlib-only) Transparent capture proxy: forwards to the real provider, measures + deterministically compresses, writes proxy_savings.json deterministic
12 🎬 video_evidence Playwright (default) · hyperframes (on request) Records the real session as moving proof of a UI change (Playwright); renders a deterministic captioned MP4 explainer with hyperframes when the video IS the deliverable Evidence producer

Each skill lives under .claude/skills/; each accelerator has a reference doc under .claude/skills/simplicio-loop/references/ (the video producer: video-evidence.md, worker scripts/video_evidence.py).


πŸ“‘ Source adapters

The orchestrator discovers work from any source via pluggable adapters. Each exposes six verbs: list_ready, get_details, claim, update_status, attach_evidence, close.

Source Adapter Purpose
GitHub Issues/PRs gh CLI (native) Primary work-item source; canonical lifecycle comments ship today
Azure DevOps az boards / host connector Azure Boards discovery; stage comments only after a real connected-capability probe
Jira host connector Jira discovery; stage comments only when connected
Asana host connector Asana discovery; stage comments only when connected
Trello host connector Trello discovery; stage comments only when connected
ClickUp / Linear / Notion host connector Board/project discovery; no stage-comment claim without a certified adapter
agentsview sessions scripts/agentsview_adapter.py Stalled session recovery + cost observability
Local files / CI queue filesystem / CI API Internal work tracking

See each adapter's reference doc under .claude/skills/simplicio-loop/references/.


🌐 15 runtimes, one protocol β€” 3 guaranteed + 12 best-effort

One universal skill core + one set of hooks drives every runtime. An adapter is thin: it tells a runtime where to load the skills, how to arm the loop, and how to bind native speed. The skill names no runtime; the runtime detects the skill. The native simplicio-runtime MCP bind is optional: when it is missing or unreachable, the adapter reports explicit degraded mode rather than blocking the standalone loop β€” see docs/MCP_SETUP.md for per-host configuration.

Tier 1 β€” Guaranteed (gated on every commit)

Runtime Skill load Loop drive Native bind (MCP)
Claude Code .claude/skills/ + plugin Stop hook optional β€” ~/.claude.json
Codex AGENTS.md self-paced optional β€” ~/.codex/config.toml
Cursor .cursor-plugin/ stop+afterAgentResponse optional β€” .cursor/mcp.json

Tier 2 β€” Best-effort (contributions welcome, no gate)

Runtime Skill load Loop drive Native bind (MCP)
VS Code (Copilot) copilot-instructions.md tasks optional β€” .vscode/mcp.json
Antigravity rules / AGENTS.md self-paced optional β€” best-effort path
Kiro .kiro/steering/ specs optional β€” .kiro/settings/mcp.json
OpenCode AGENTS.md self-paced optional β€” opencode.json
Gemini (CLI/Code Assist) GEMINI.md self-paced optional β€” .gemini/settings.json (CLI)
Kimi inlined conventions self-paced optional β€” best-effort, no verified client
Qwen (Code/CLI) AGENTS.md-equivalent self-paced optional β€” .qwen/settings.json (best-effort)
DeepSeek inlined conventions self-paced optional β€” no first-party client, best-effort
Aider CONVENTIONS.md self-paced optional β€” no MCP client (LLM fallback for exec)
Simplicio Agent (formerly Hermes) native recall native loop optional β€” native
OpenClaw plugin SDK native scheduler optional β€” native
Orca via inner agent + skills registry inner hook / scheduled automations optional β€” registry/inner-agent config

The promise: same protocol, same gates, same safety on all 15 β€” Tier 1 verified mechanically, Tier 2 best-effort. orient_clamp.py (token economy) works on every runtime with zero wiring. See adapters/MATRIX.md for the promotion/demotion rules.


πŸ—ΊοΈ The full flow β€” from demand to delivery

Every layer the orchestrator acts on, in order β€” from reading the demand (issues, tasks, assigns) to delivering merged, evidenced work, then looping 24/7 for more.

flowchart LR
  IN["Intent: issue Β· task Β· queue"] --> CONTRACT["1 Β· Freeze task contract"]
  CONTRACT --> MAP["2 Β· Map source + normalize"]
  MAP --> COORD{"3 Β· Coordinator decide (multi-session)"}
  COORD -->|"OWN / CONTINUE_OWN / RECLAIM_STALE"| PLAN["4 Β· Dependency DAG + acceptance criteria"]
  COORD -->|"DEFER_ACTIVE_CLAIM (all issues)"| REVIEW["PR DoD/AC review β€” never idle"]
  COORD -->|"VERIFY_PARTIAL"| RECHECK["Verify what's actually merged before continuing"]
  RECHECK --> PLAN
  REVIEW --> IN
  PLAN --> ROUTE{"5 Β· Ready task?"}
  ROUTE -->|"solo / small"| SOLO["Targeted lane"]
  ROUTE -->|"parallel / medium+"| FAN["Bounded fan-out"]
  FAN --> A["Isolated worktree A"]
  FAN --> B["Isolated worktree B"]
  FAN --> C["Isolated worktree C"]
  SOLO --> VERIFY["6 Β· Test + impact/flow evidence"]
  A --> VERIFY
  B --> VERIFY
  C --> VERIFY
  VERIFY --> RECEIPT["Watcher challenge + evidence receipt"]
  RECEIPT --> ORACLE{"7 Β· Completion oracle"}
  ORACLE -->|"pending / blocked"| RECOVER["Journal Β· checkpoint Β· rollback Β· backlog-only maintenance"]
  RECOVER --> PLAN
  ORACLE -->|"verified / measured"| DELIVER["8 Β· Source sync Β· PR Β· merge"]
  DELIVER --> CLEANUP["Post-merge worktree/branch cleanup"]
  CLEANUP --> MEMORY["9 Β· Ledger Β· wiki Β· durable attempt memory"]
  MEMORY --> WATCH["10 Β· Re-feed Β· watcher Β· STOP path"]
  WATCH -->|"new work"| IN

Multi-agent coordination (new in v3.38.0). Step 3 is the mechanical answer to "is a sibling session already on this?" β€” scripts/coordinator.py decides from live GitHub state, never a guess. When every candidate issue comes back deferred, the loop doesn't idle: it reviews open PRs against the DoD + acceptance criteria (scripts/pr_dod_review.py) instead. Full detail: references/multi-agent-coordination.md.

Planning gate (issue #284). Steps 1–3 above are not just guidance β€” simplicio_loop/planning_gate.py makes them a fail-closed mechanical barrier between "claimed" and "mutating": every real arm_run() self-builds a planning-receipt.json binding run/attempt/contract/plan/lease/fence (and, on a GitHub source, the source-snapshot hash) into a single-use mutation_authority token, and execute_operator()/execute_operator_batch() refuse to run without a matching one. Both halves of the gate (SIMPLICIO_REQUIRE_MUTATION_AUTHORITY, SIMPLICIO_LOOP_AUTO_PLANNING_RECEIPT) are mandatory by default β€” see .claude/skills/simplicio-loop/references/planning-gate.md and docs/adr/0004-planning-gate-rollout.md.


πŸ” The loop

The Evidence-Gated Loop is the core mechanism. It re-feeds the same goal each turn so the agent sees its own prior work. Exit is ONLY via:

  1. Evidence-gated <promise> β€” the turn that emits the promise MUST also carry concrete proof (passing test, merged PR, closed-item re-query). A promise with no evidence = ignored.
  2. max_iterations cap β€” hard safety backstop
  3. STOP signal β€” .orchestrator/STOP or channel command

Between turns, LMCache (when available) caches the KV state so re-feed costs near-zero prefill.

🧠 Attempt memory + stall detector (anti-oscillation)

A re-feed loop that remembers nothing oscillates β€” try X, fail, try X again β€” until the cap burns. simplicio-loop keeps a durable run-journal (.orchestrator/loop/journal.jsonl, append-only: iteration Β· action Β· hypothesis Β· gate Β· error-fingerprint, plus optional lineage like execution_state Β· stage_id Β· validator Β· decision Β· retry_count) and a stall detector (scripts/loop_journal.py, deterministic + model-free):

  • Error fingerprint β€” the failing gate output is reduced to a stable hash with line numbers, paths, hex/uuids, timestamps and durations normalized away, so the same bug is recognized across turns even when the incidental text differs.
  • Stall = K identical-fingerprint failures in a row (default K=3). A changing fingerprint means the loop is moving (PROGRESS); the same one K times means it is spinning (STALLED).
  • On STALLED the loop does not re-feed the same goal β€” it names the dead-end actions to avoid, then switches strategy or escalates to the human gate with the fingerprint.
  • loop_journal.py resume is read at the top of every turn, so a fresh process continues without re-deriving prior attempts (real resume) and never retries a known dead-end.
  • When the loop is doing extraction, validation, or governed retries, record can also stamp --execution-state, --stage-id, --source-artifact, --chunk-id, --validator, --decision, --retry-count, --blocked-reason, and --next-action, so the next turn knows not just what failed, but where in the flow it failed.
loop_journal.py resume                       # what was tried + dead-ends to avoid
loop_journal.py record --iteration N --action "…" --gate fail --gate-output test.log \
  --execution-state planned --stage-id validate --validator pytest --decision retry
loop_journal.py stall --k 3 --exit-code      # PROGRESS β†’ re-feed Β· STALLED β†’ switch/escalate

πŸ“¦ Exported contract for other runtimes β€” simplicio.loop-execution/v1

simplicio-loop is the reference implementation of this converge/drain discipline. So that simplicio-runtime (or any other consumer) reuses this semantics instead of inventing a second, incompatible execution contract (#115), the discipline is published as versioned, testable fixtures under contracts/loop-execution/v1/: converge success, stall + escalation, drain with empty rounds, the STOP path, evidence-gated completion, and the minimal append-only journal shape. python3 scripts/check_loop_contract.py (wired into scripts/check.py) validates every fixture against the REAL producers (hooks/loop_stop.py, scripts/loop_journal.py) by actually running them in an isolated temp directory β€” not a re-description of them β€” so a runtime implementing its own executor can diff its behavior against each fixture's expected.json instead of re-deriving the rules from prose. See contracts/loop-execution/v1/SCHEMA.md for the full contract and how to consume it.


🎬 Video evidence β€” Playwright by default, hyperframes on request

The loop produces demo videos as proof a change works β€” two engines, one video_evidence extension point (worker scripts/video_evidence.py, contract references/video-evidence.md):

  1. Default β€” the normal evidence flow uses Playwright. After a UI change, video_evidence records the real browser session driving the screen (Playwright native video β†’ .webm, β†’ .mp4 with FFmpeg) β€” the strongest "works, not just compiles" receipt (Step 4b) and a valid evidence-gated <promise>.

    python3 scripts/video_evidence.py verify --url http://localhost:3000/login \
        --name login-demo --expect "Sign in" --issue 42 [--upload --pr 42]
    
  2. On request β€” a personalized explainer uses hyperframes. When the deliverable IS a video ("make an explainer video of screen X"), the orchestrator renders a deterministic, captioned slideshow of the web_verify screenshots with hyperframes (by HeyGen β€” "same input, same frames, same output", CI-reproducible, no API keys, local render via headless Chrome + FFmpeg).

    /simplicio-loop make an explainer video of the system login screen
    β†’ detect: video-creation request β†’ web_verify captures the screens
    β†’ video_evidence verify --engine hyperframes β†’ deterministic MP4 β†’ attached to the PR
    

Either engine: a video that never recorded/rendered yields BLOCKED, never a fake pass. Evidence is always a file path + boolean verdict β€” never video bytes in context (token economy).


πŸ“Š Token economy

Technique Savings
deterministic_edit (L0) 100% of edit tokens (file written mechanically, never by LLM)
Terminal-first execution Facts from shell, not LLM hallucination
Output-reduction catalog Caps per command type (CAP_ERRORS=20, CAP_WARNINGS=10, `CAP_L