{"id":50904153,"url":"https://github.com/ctxswitch/agent-loop","last_synced_at":"2026-06-16T05:31:38.553Z","repository":{"id":362715372,"uuid":"1260479396","full_name":"ctxswitch/agent-loop","owner":"ctxswitch","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-05T15:27:37.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-05T16:24:13.598Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ctxswitch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-06-05T14:36:29.000Z","updated_at":"2026-06-05T15:27:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ctxswitch/agent-loop","commit_stats":null,"previous_names":["ctxswitch/agent-loop"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ctxswitch/agent-loop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctxswitch%2Fagent-loop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctxswitch%2Fagent-loop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctxswitch%2Fagent-loop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctxswitch%2Fagent-loop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctxswitch","download_url":"https://codeload.github.com/ctxswitch/agent-loop/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctxswitch%2Fagent-loop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34393302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-16T05:31:37.812Z","updated_at":"2026-06-16T05:31:38.544Z","avatar_url":"https://github.com/ctxswitch.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# agent-loop\n\n`agent-loop` is a workflow runtime concept for coding agents. The goal is to\nmake an agent work through a disciplined development loop with real phase\nisolation, structured evidence, and explicit transitions.\n\nThe loop is:\n\n1. Implementation\n2. Verification\n3. Review\n4. Close\n5. Retro\n\nEach phase should run as a fresh subagent. The orchestrator owns the state\nmachine, prepares a narrow context packet for the phase, launches the subagent,\nrecords the returned artifact, and decides the next transition.\nUsers can start, stop, continue, and inspect status; they never choose phase\ntransitions directly.\n\nFor the Pi runtime, an active loop is scoped to the current branch path inside a\nPi session. Loop commands must reconstruct state from append-only Pi custom\nentries on that active branch path rather than from one project-wide or\nsession-file-wide run. Durable run ledgers can still live inside the project, but\nPi-managed ledgers are mirrors of Pi session state and are namespaced by session.\n\nThe core design principle is artifact exchange instead of chat-history exchange.\nFresh subagents should receive the goal, relevant repo context, diffs, evidence,\nand prior phase outputs. They should not inherit the full implementation\nconversation unless the orchestrator intentionally includes it.\n\n## Intended Shape\n\n- `agent-loop-core`: shared schemas, ledger, transition engine, and phase packet\n  builder used by the Pi extension.\n- `pi-agent-loop`: Pi extension that enforces the protocol, launches phase\n  agents through child Pi processes, injects phase prompts, and updates\n  UI/status.\n\nPi is the primary runtime target because Pi extensions can register commands and\ntools, subscribe to events, persist session state, inject messages, prompt\nthrough UI, and run extension code that delegates to child Pi processes. The\nproject intentionally does not target Codex plugins, skills, or CLI adapters in\nthe current scope.\n\n## Phase Overview\n\n### Implementation\n\nPurpose: produce the smallest working change.\n\nInputs:\n\n- User goal\n- Repo instructions\n- Relevant context\n- Constraints\n- Prior verification or review failures, if any\n\nOutputs:\n\n- Changed files\n- Diff summary\n- Tests or checks run\n- Implementation notes\n- Known risks or unresolved questions\n\n### Verification\n\nPurpose: prove the change works from fresh eyes.\n\nInputs:\n\n- User goal\n- Diff\n- Implementation evidence\n- Known risks\n\nOutputs:\n\n- Scenario matrix\n- Commands or checks run\n- Pass/fail evidence\n- Defects, if any\n- Confidence note\n\n### Review\n\nPurpose: inspect correctness, maintainability, style, and principle fit.\n\nInputs:\n\n- User goal\n- Diff\n- Verification evidence\n- Repo principles\n\nOutputs:\n\n- Findings ordered by severity\n- Required fixes\n- Waived findings, if any\n- Explicit no-findings statement when clean\n\n### Close\n\nPurpose: reconcile evidence and prepare handoff.\n\nInputs:\n\n- Goal\n- Final diff\n- Test and scenario evidence\n- Review result\n- Git status\n\nOutputs:\n\n- Evidence packet\n- Final status\n- Commit or PR proposal\n- Remaining risks\n\n### Retro\n\nPurpose: improve the next run.\n\nInputs:\n\n- All phase artifacts\n- Timings\n- Failures and regressions\n- User interventions\n\nOutputs:\n\n- Process friction\n- Prompt or tool failures\n- Memory or harness behavior recommendations\n\n## Transition Rules\n\n```text\nimplementation -\u003e verification\nverification pass -\u003e review\nverification fail -\u003e implementation with defect packet\nreview pass -\u003e close\nreview fail -\u003e implementation with finding packet\nclose incomplete -\u003e relevant previous phase\nclose complete -\u003e retro\nretro complete -\u003e done\n```\n\n## Current Status\n\nThis repository is a design scaffold. The next step is to define the protocol\nschema, evidence schema, session lifecycle behavior, and minimal phase packet\nformat before implementing the Pi extension.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctxswitch%2Fagent-loop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctxswitch%2Fagent-loop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctxswitch%2Fagent-loop/lists"}