|
1 | | -# iter-codex |
| 1 | +# codex-self-iter |
| 2 | + |
| 3 | +`codex-self-iter` is a plugin-style repository that runs a continuous autonomous loop for coding tasks: |
| 4 | + |
| 5 | +1. Read `TASK.md` + `plan.md` |
| 6 | +2. Generate one small next step |
| 7 | +3. Execute the step via agent command |
| 8 | +4. Review result and decide whether to continue |
| 9 | +5. Repeat until no meaningful next action exists or user stops it |
| 10 | + |
| 11 | +## Repository Layout |
| 12 | + |
| 13 | +```text |
| 14 | +. |
| 15 | +├── .codex-plugin/plugin.json |
| 16 | +├── src/codex_self_iter/ |
| 17 | +├── tests/ |
| 18 | +├── examples/ |
| 19 | +├── scripts/ |
| 20 | +├── pyproject.toml |
| 21 | +└── .github/workflows/ci.yml |
| 22 | +``` |
| 23 | + |
| 24 | +## Quick Start |
| 25 | + |
| 26 | +1. Install locally: |
| 27 | + |
| 28 | +```bash |
| 29 | +pip install -e .[dev] |
| 30 | +``` |
| 31 | + |
| 32 | +2. Prepare task files in your workspace: |
| 33 | + |
| 34 | +- `TASK.md` (optional) |
| 35 | +- `plan.md` (required) |
| 36 | + |
| 37 | +3. Run: |
| 38 | + |
| 39 | +```bash |
| 40 | +python3 -m codex_self_iter \ |
| 41 | + --workspace . \ |
| 42 | + --task-file TASK.md \ |
| 43 | + --plan-file plan.md \ |
| 44 | + --state-dir .codex-self-iter \ |
| 45 | + --agent-command-template "codex exec --auto --prompt-file {prompt_file}" |
| 46 | +``` |
| 47 | + |
| 48 | +Or use: |
| 49 | + |
| 50 | +```bash |
| 51 | +./scripts/run-local.sh . |
| 52 | +``` |
| 53 | + |
| 54 | +## Stop Conditions |
| 55 | + |
| 56 | +- Create `.codex-self-iter/STOP` |
| 57 | +- Or create workspace-level `.codex-stop` |
| 58 | +- Or interrupt process manually |
| 59 | + |
| 60 | +## Output Artifacts |
| 61 | + |
| 62 | +- `.codex-self-iter/prompts/`: planner/executor/reviewer prompts |
| 63 | +- `.codex-self-iter/logs/iterations.jsonl`: loop records |
| 64 | +- `.codex-self-iter/status.json`: last iteration state |
| 65 | + |
| 66 | +## Configuration |
| 67 | + |
| 68 | +See `config.example.toml`. |
| 69 | + |
| 70 | +Important fields: |
| 71 | + |
| 72 | +- `agent_command_template` must include `{prompt_file}` |
| 73 | +- `max_iterations = 0` means unbounded loop |
| 74 | +- `max_stagnation` prevents infinite cycling on identical `next_focus` |
| 75 | + |
| 76 | +## Development |
| 77 | + |
| 78 | +Run tests: |
| 79 | + |
| 80 | +```bash |
| 81 | +pytest -q |
| 82 | +``` |
| 83 | + |
| 84 | +## Security and Automation Boundary |
| 85 | + |
| 86 | +The loop is autonomous at application logic level but still bounded by host permissions, sandbox policy, and tool confirmations. |
0 commit comments