agentic-dev-loop 0.3.0__tar.gz → 0.9.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. agentic_dev_loop-0.9.1/PKG-INFO +728 -0
  2. agentic_dev_loop-0.9.1/README.md +684 -0
  3. agentic_dev_loop-0.9.1/pyproject.toml +85 -0
  4. agentic_dev_loop-0.9.1/src/agentic_dev_loop/__init__.py +1 -0
  5. agentic_dev_loop-0.9.1/src/agentic_dev_loop/core/__init__.py +18 -0
  6. agentic_dev_loop-0.9.1/src/agentic_dev_loop/core/config.py +869 -0
  7. agentic_dev_loop-0.9.1/src/agentic_dev_loop/core/paths.py +91 -0
  8. {agentic_dev_loop-0.3.0/src/agentic_dev_loop → agentic_dev_loop-0.9.1/src/agentic_dev_loop/core}/results.py +1 -1
  9. agentic_dev_loop-0.3.0/src/agentic_dev_loop/outputs.py → agentic_dev_loop-0.9.1/src/agentic_dev_loop/core/verdict.py +20 -53
  10. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/__init__.py +2 -0
  11. {agentic_dev_loop-0.3.0/src/agentic_dev_loop → agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine}/actions.py +77 -13
  12. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/agent_error_guide.md +7 -0
  13. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/agent_error_guide.py +26 -0
  14. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/agents.py +208 -0
  15. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/allowlist.py +66 -0
  16. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/brief_coverage.py +85 -0
  17. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/brief_prompt.md +46 -0
  18. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/brief_prompt.py +47 -0
  19. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/cli.py +203 -0
  20. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/containers.py +81 -0
  21. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/deps.py +77 -0
  22. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/dryrun.py +161 -0
  23. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/egress_policy.py +130 -0
  24. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/egress_proxy.py +359 -0
  25. {agentic_dev_loop-0.3.0/src/agentic_dev_loop → agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine}/extensions/aidlc.py +41 -13
  26. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/forbidden.py +91 -0
  27. {agentic_dev_loop-0.3.0/src/agentic_dev_loop → agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine}/graph.py +134 -57
  28. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/hostboundary.py +137 -0
  29. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/isolation.py +1851 -0
  30. {agentic_dev_loop-0.3.0/src/agentic_dev_loop → agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine}/llm.py +16 -9
  31. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/loaders.py +141 -0
  32. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/mounts.py +63 -0
  33. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/outputs.py +63 -0
  34. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/presets.py +50 -0
  35. {agentic_dev_loop-0.3.0/src/agentic_dev_loop → agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine}/proc.py +20 -2
  36. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/registry.py +306 -0
  37. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/seccomp/__init__.py +72 -0
  38. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/seccomp/chromium-userns.json +190 -0
  39. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/secrets.py +118 -0
  40. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/stages.py +1172 -0
  41. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/step_workspace.py +188 -0
  42. agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine/sync_back.py +332 -0
  43. agentic_dev_loop-0.9.1/src/agentic_dev_loop/viz/__init__.py +13 -0
  44. agentic_dev_loop-0.9.1/src/agentic_dev_loop/viz/__main__.py +42 -0
  45. agentic_dev_loop-0.3.0/src/agentic_dev_loop/viz.py → agentic_dev_loop-0.9.1/src/agentic_dev_loop/viz/server.py +133 -45
  46. agentic_dev_loop-0.9.1/src/agentic_dev_loop.egg-info/PKG-INFO +728 -0
  47. agentic_dev_loop-0.9.1/src/agentic_dev_loop.egg-info/SOURCES.txt +101 -0
  48. agentic_dev_loop-0.9.1/src/agentic_dev_loop.egg-info/entry_points.txt +2 -0
  49. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/src/agentic_dev_loop.egg-info/requires.txt +8 -2
  50. agentic_dev_loop-0.9.1/tests/test_029_merge_on_conflict.py +91 -0
  51. agentic_dev_loop-0.9.1/tests/test_033_brief_step.py +606 -0
  52. agentic_dev_loop-0.9.1/tests/test_035_finalize_nudge.py +218 -0
  53. agentic_dev_loop-0.9.1/tests/test_036_banned_commands_and_lane_boundary.py +273 -0
  54. agentic_dev_loop-0.9.1/tests/test_041_brief_coverage.py +293 -0
  55. agentic_dev_loop-0.9.1/tests/test_046_brief_prompt.py +45 -0
  56. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/tests/test_actions.py +167 -19
  57. agentic_dev_loop-0.9.1/tests/test_agent_error_guide.py +187 -0
  58. agentic_dev_loop-0.9.1/tests/test_agents.py +260 -0
  59. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/tests/test_aidlc.py +29 -20
  60. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/tests/test_cli.py +168 -11
  61. agentic_dev_loop-0.9.1/tests/test_config.py +830 -0
  62. agentic_dev_loop-0.9.1/tests/test_containers.py +138 -0
  63. agentic_dev_loop-0.9.1/tests/test_deps.py +76 -0
  64. agentic_dev_loop-0.9.1/tests/test_dry_run.py +199 -0
  65. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/tests/test_e2e_fixtures.py +145 -29
  66. agentic_dev_loop-0.9.1/tests/test_egress_proxy.py +428 -0
  67. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/tests/test_graph.py +169 -39
  68. agentic_dev_loop-0.9.1/tests/test_hostboundary.py +137 -0
  69. agentic_dev_loop-0.9.1/tests/test_hostboundary_integration.py +113 -0
  70. agentic_dev_loop-0.9.1/tests/test_isolation.py +2320 -0
  71. agentic_dev_loop-0.9.1/tests/test_isolation_integration.py +339 -0
  72. agentic_dev_loop-0.9.1/tests/test_isolation_pbt.py +153 -0
  73. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/tests/test_llm.py +49 -9
  74. agentic_dev_loop-0.9.1/tests/test_loaders.py +227 -0
  75. agentic_dev_loop-0.9.1/tests/test_module_contract.py +94 -0
  76. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/tests/test_outputs.py +7 -7
  77. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/tests/test_outputs_pbt.py +6 -3
  78. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/tests/test_proc.py +39 -2
  79. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/tests/test_publish.py +75 -1
  80. agentic_dev_loop-0.9.1/tests/test_qa_prompt.py +53 -0
  81. agentic_dev_loop-0.9.1/tests/test_registry.py +264 -0
  82. agentic_dev_loop-0.9.1/tests/test_repo_ascii.py +60 -0
  83. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/tests/test_results.py +1 -1
  84. agentic_dev_loop-0.9.1/tests/test_sdk_compat.py +135 -0
  85. agentic_dev_loop-0.9.1/tests/test_secrets.py +222 -0
  86. agentic_dev_loop-0.9.1/tests/test_secrets_integration.py +67 -0
  87. agentic_dev_loop-0.9.1/tests/test_secrets_pipeline.py +108 -0
  88. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/tests/test_source_resolution.py +3 -5
  89. agentic_dev_loop-0.9.1/tests/test_stages.py +1027 -0
  90. agentic_dev_loop-0.9.1/tests/test_step_workspace.py +150 -0
  91. agentic_dev_loop-0.9.1/tests/test_sync_back.py +396 -0
  92. agentic_dev_loop-0.9.1/tests/test_trigger_script.py +219 -0
  93. agentic_dev_loop-0.9.1/tests/test_unit5_config.py +166 -0
  94. agentic_dev_loop-0.9.1/tests/test_unit5_pbt.py +93 -0
  95. agentic_dev_loop-0.9.1/tests/test_unit5_pure.py +208 -0
  96. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/tests/test_verdict.py +56 -13
  97. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/tests/test_viz.py +195 -13
  98. agentic_dev_loop-0.3.0/PKG-INFO +0 -318
  99. agentic_dev_loop-0.3.0/README.md +0 -280
  100. agentic_dev_loop-0.3.0/pyproject.toml +0 -59
  101. agentic_dev_loop-0.3.0/src/agentic_dev_loop/__init__.py +0 -1
  102. agentic_dev_loop-0.3.0/src/agentic_dev_loop/agents.py +0 -49
  103. agentic_dev_loop-0.3.0/src/agentic_dev_loop/cli.py +0 -82
  104. agentic_dev_loop-0.3.0/src/agentic_dev_loop/config.py +0 -156
  105. agentic_dev_loop-0.3.0/src/agentic_dev_loop/loaders.py +0 -60
  106. agentic_dev_loop-0.3.0/src/agentic_dev_loop/registry.py +0 -133
  107. agentic_dev_loop-0.3.0/src/agentic_dev_loop/stages.py +0 -423
  108. agentic_dev_loop-0.3.0/src/agentic_dev_loop.egg-info/PKG-INFO +0 -318
  109. agentic_dev_loop-0.3.0/src/agentic_dev_loop.egg-info/SOURCES.txt +0 -46
  110. agentic_dev_loop-0.3.0/src/agentic_dev_loop.egg-info/entry_points.txt +0 -2
  111. agentic_dev_loop-0.3.0/tests/test_agents.py +0 -88
  112. agentic_dev_loop-0.3.0/tests/test_config.py +0 -374
  113. agentic_dev_loop-0.3.0/tests/test_loaders.py +0 -118
  114. agentic_dev_loop-0.3.0/tests/test_registry.py +0 -114
  115. agentic_dev_loop-0.3.0/tests/test_sdk_compat.py +0 -68
  116. agentic_dev_loop-0.3.0/tests/test_stages.py +0 -466
  117. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/LICENSE +0 -0
  118. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/setup.cfg +0 -0
  119. {agentic_dev_loop-0.3.0/src/agentic_dev_loop → agentic_dev_loop-0.9.1/src/agentic_dev_loop/engine}/extensions/__init__.py +0 -0
  120. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/src/agentic_dev_loop/py.typed +0 -0
  121. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/src/agentic_dev_loop.egg-info/dependency_links.txt +0 -0
  122. {agentic_dev_loop-0.3.0 → agentic_dev_loop-0.9.1}/src/agentic_dev_loop.egg-info/top_level.txt +0 -0
@@ -0,0 +1,728 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentic-dev-loop
3
+ Version: 0.9.1
4
+ Summary: Turn an LLM into a gated, sandboxed, resumable construction loop over your codebase.
5
+ Author: Luke Wilson
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/lukedawilson/agentic-dev-loop
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Environment :: Console
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Operating System :: MacOS
12
+ Classifier: Operating System :: Microsoft :: Windows
13
+ Classifier: Operating System :: POSIX :: Linux
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Topic :: Software Development
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Topic :: Software Development :: Quality Assurance
23
+ Classifier: Topic :: Security
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: >=3.12
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: pydantic>=2.0
29
+ Requires-Dist: PyYAML>=6.0
30
+ Requires-Dist: openhands-sdk~=1.17.0
31
+ Requires-Dist: openhands-tools~=1.17.0
32
+ Requires-Dist: agent-client-protocol<1.0.0
33
+ Requires-Dist: langgraph>=1.2
34
+ Requires-Dist: langgraph-checkpoint-sqlite>=3.0
35
+ Requires-Dist: filelock>=4.2.1
36
+ Requires-Dist: pyasn1>=0.6.5
37
+ Requires-Dist: pypdf>=6.21.4
38
+ Provides-Extra: dev
39
+ Requires-Dist: hypothesis>=6.0; extra == "dev"
40
+ Requires-Dist: pytest>=8.0; extra == "dev"
41
+ Requires-Dist: pip-audit>=2.0; extra == "dev"
42
+ Requires-Dist: pre-commit>=3.0; extra == "dev"
43
+ Dynamic: license-file
44
+
45
+ # agentic-dev-loop
46
+
47
+ > **Turn an LLM into a gated, sandboxed, resumable construction loop over your codebase.**
48
+
49
+ Describe your pipeline in one YAML file - agent steps, mechanical test gates, and
50
+ trusted actions - and `agentic-dev-loop` runs it end to end: agent and command steps get
51
+ kernel-level sandboxing via Docker, verdicts route the graph, every boundary is
52
+ checkpointed, and nothing gets committed until every gate passes.
53
+
54
+ ```mermaid
55
+ flowchart LR
56
+ dev["agent: dev"] --> test{{"test gate"}} --> review["agent: review"] --> qa["agent: qa"] --> commit["action: commit"]
57
+ test -- fail --> dev
58
+ review -- fail --> dev
59
+ qa -- fail --> dev
60
+ ```
61
+
62
+ - **A tool, not a wiring project.** One CLI entry point, opinionated defaults,
63
+ fixed safety policies. You write the pipeline and the agent definitions -
64
+ nothing else.
65
+ - **Deterministic.** Same pipeline + same state → same routing. Verdicts are
66
+ parsed from files, retries are bounded, nothing is best-effort.
67
+ - **Sandboxed by default.** The agent's shell and every command step run inside
68
+ an always-on Docker sandbox. There is no opt-out.
69
+
70
+ ---
71
+
72
+ ## Core features
73
+
74
+ | Feature | What it gives you |
75
+ | --- | --- |
76
+ | **Stage-gated agent loop** | Agents do the work, test stages verify it, and the pipeline only advances when each stage passes its gates - looping back with full context when one fails. |
77
+ | **Kernel-level sandboxing** | Agent work and command stages run isolated from your machine: [no network access **by default** - authors opt specific stages in](#per-stage-networking), writes only to declared `mounts:`, and no access to `.git` (steps run against a fresh export). No sandbox available → the run stops instead of degrading. |
78
+ | **Crash-safe resume** | Interrupt a run at any time and pick it up later - finished stages stay finished, and you resume from exactly where it stopped. |
79
+ | **Live graph visualisation** | Follow every run in the browser: stage status, pass/fail verdicts, retry cycles, and live console output as it happens. |
80
+ | **Extensible** | Plug in your own actions, tools, and document loaders to adapt the loop to your projects. |
81
+
82
+ The fixed policies *are* the product: fail fast on missing config/secrets, no
83
+ silent fallbacks, verdicts only from artifacts, bounded retries, per-attempt
84
+ artifact hygiene, a single clean-worktree-gated commit point, no default LLM
85
+ timeout (agent runs are long), and fail fast on a broken sandbox - daemon-side
86
+ exec failures are classified and stop the run without an agent retry loop,
87
+ while a startup reaper reclaims containers leaked by a crashed run.
88
+
89
+ ## Supported platforms
90
+
91
+ The engine is plain Linux under the hood and runs wherever a compliant
92
+ Docker engine does:
93
+
94
+ | Platform | Support |
95
+ | --- | --- |
96
+ | **Linux** | Native. Docker Engine, OrbStack, Colima, or podman with docker compat. |
97
+ | **macOS** | Native. Docker Desktop, OrbStack, or Colima. |
98
+ | **Windows** | Via **WSL2** (Ubuntu distro). Enable Docker Desktop's WSL integration (or run Docker Engine inside the distro) and keep the repo on the WSL filesystem (`~/dev/...`), not `/mnt/c` - bind-mounting a 9p path into containers breaks permissions and is slow. |
99
+
100
+ Native Windows (outside WSL2) is not supported: every Windows-specific code
101
+ path and test was removed, and CI runs on Ubuntu only.
102
+
103
+ ## Installation
104
+
105
+ **Prerequisites**
106
+
107
+ | Requirement | Detail |
108
+ | --- | --- |
109
+ | Python | ≥ 3.12 |
110
+ | Docker engine | Engine API ≥ 1.43 (Engine 24). Any compliant engine works - Docker Desktop, OrbStack, Colima, Rancher Desktop, podman docker-compat. On Windows, run under WSL2: the repo must live on the WSL filesystem, not /mnt/c. |
111
+ | LLM API key | The env var named by your pipeline's `api_key_env` (e.g. `OPENAI_API_KEY`) must be set - a missing key fails fast, naming it. |
112
+
113
+ ```bash
114
+ pip install "agentic-dev-loop==1.0.0a17"
115
+ agentic-dev-loop --version
116
+ ```
117
+
118
+ The canonical consumer install is **pipx**, which puts the engine's venv
119
+ *outside* the workspace - the sandbox mounts only the step's declared `mounts:`
120
+ from a fresh export, so an out-of-workspace install is unmounted and never
121
+ agent-writable:
122
+
123
+ ```bash
124
+ pipx install "agentic-dev-loop==1.0.0a17"
125
+ ```
126
+
127
+ If you install with `uv` shortly after a release, pass `--refresh` - PyPI
128
+ serves the package index with `Cache-Control: max-age=600`, and uv otherwise
129
+ reuses a pre-upload snapshot of the index for up to 10 minutes, reporting
130
+ "no version of agentic-dev-loop==X.Y.Z" for a version that is already live:
131
+
132
+ ```bash
133
+ uv pip install --refresh "agentic-dev-loop==1.0.0a17"
134
+ ```
135
+
136
+ On the first run the engine pulls the **digest-pinned** dev image
137
+ (`ghcr.io/lukedawilson/agentic-dev-loop/dev`) and verifies its digest - the
138
+ supply-chain check refuses to continue on a mismatch. If you're running
139
+ pre-publish tooling, point `AGENTIC_DEV_LOOP_DEV_IMAGE` at your locally built
140
+ image. Engine setup, first-run details, the full `pipeline.yaml` contract, and
141
+ troubleshooting for every fail-fast code live in
142
+ [docs/setup.md](docs/setup.md).
143
+
144
+ ## Usage
145
+
146
+ ```bash
147
+ export OPENAI_API_KEY=... # whatever api_key_env names
148
+ agentic-dev-loop pipeline.yaml # run it
149
+ agentic-dev-loop pipeline.yaml --dry-run # validate first - no LLM, no Docker
150
+ agentic-dev-loop pipeline.yaml --resume <thread-id> --max-attempts 5
151
+ ```
152
+
153
+ | Flag | Effect |
154
+ | --- | --- |
155
+ | `--dry-run` | Full load-and-validate pass, then print the resolved plan. No LLM, no Docker, no state writes, no API key. Exit `0` on a clean load. |
156
+ | `--resume <thread-id>` | Continue the latest checkpoint of a previous run (crash, Ctrl-C, exhaustion) with all accumulated notes intact. |
157
+ | `--max-attempts <n>` | Override the pipeline's `max_attempts`. |
158
+ | `--no-viz` / `--viz-port <port>` | Suppress the live graph view / set a preferred port (default 8321; falls back to a free port when busy). |
159
+ | extension flags | Document-loader flags (e.g. `--plan`, `--aidlc-unit`) appear once the pipeline's extensions are loaded - `agentic-dev-loop PIPELINE --help` shows them. |
160
+
161
+ Exit code is `0` on pipeline success, `1` otherwise.
162
+
163
+ `agentic-dev-loop containers` inspects the engine's sandbox containers and
164
+ networks from the host: the default list is read-only and resolves each
165
+ engine-owned object to its owning run and a `live`, `orphaned`,
166
+ `stale-entry`, or `unregistered` verdict; `containers --reap` removes only
167
+ registry-owned orphans whose owner pid is dead (never unregistered names).
168
+ A SIGTERM to a running pipeline still closes the sandbox (the graph's
169
+ `finally` runs); SIGKILL is unhandleable, so its containers are reclaimed by
170
+ the startup reaper on the next run or by `containers --reap`. The reaper
171
+ and `--reap` prune a registry entry only after the daemon confirms the
172
+ object is gone; a surviving object (a failed removal) keeps its entry so
173
+ the next startup retries it. Pass
174
+ `--state-dir` to point at a custom `isolation.state_dir`.
175
+
176
+ **What a run looks like** (the shipped self-loop example):
177
+
178
+ ![The live graph view - pipeline stages with verdict badges, retry cycles, and per-stage consoles](docs/viz-screenshot.png)
179
+
180
+ 1. **dev** - the dev agent works with full context (loaded docs + shared files).
181
+ Its edits are untracked; only declared `produces:` files are hygiene-tracked.
182
+ 2. **test** - a mechanical command step runs the suite inside the sandbox.
183
+ Exit 0 moves on; anything else rewinds to `dev` with the failing output.
184
+ 3. **review / qa** - verdict agents write artifacts whose `VERDICT:` lines route
185
+ the graph. `fail` rewinds to `dev` and consumes an attempt.
186
+ 4. **commit** - the single commit point fires only when all gates passed and
187
+ the worktree was clean at start.
188
+ 5. **success** - committed; or **failure** when attempts are exhausted.
189
+
190
+ ### pipeline.yaml reference
191
+
192
+ ```yaml
193
+ name: my-construction-loop
194
+ extensions:
195
+ - agentic_dev_loop.engine.extensions.aidlc:AidlcExtension # bundled AI-DLC doc loader
196
+ additional_files:
197
+ - ../README.md # shared context for every agent step
198
+
199
+ llm:
200
+ model: openai/deepseek-v4-pro
201
+ base_url: https://api.deepseek.com
202
+ api_key_env: OPENAI_API_KEY
203
+ # reasoning_effort: medium # optional: low | medium | high | xhigh | none
204
+
205
+ max_attempts: 10 # CLI --max-attempts overrides
206
+ agents_dir: sdk_agents # your <name>.agent.md files
207
+
208
+ steps:
209
+ - name: brief
210
+ reasoning_effort: medium
211
+ brief_inputs:
212
+ include: [AGENTS.md, coding-standards-ddd.yaml]
213
+ sections: [Repo rules digest, Unit scope digest, Environment facts, Open risks]
214
+ env_facts: ["the workspace is an export with no .git; verify with find/ls, never git status"]
215
+ on_pass: dev
216
+
217
+ - name: dev
218
+ agent: dev
219
+ produces: implementation-summary.md
220
+ terminal_timeout: 900
221
+ on_pass: test
222
+
223
+ - name: test
224
+ command: .venv-sandbox/bin/python -m pytest tests/ -q -m "not docker"
225
+ setup: python -m venv .venv-sandbox && .venv-sandbox/bin/pip install -e ".[dev]"
226
+ timeout: 600
227
+ on_pass: review
228
+ on_fail: { goto: dev, retry: true }
229
+
230
+ - name: review
231
+ agent: review
232
+ artifact: review-findings.md
233
+ verdicts: { pass: APPROVED, fail: NEEDS CHANGES }
234
+ # reasoning_effort: xhigh # per-step override; falls back to the llm block, then SDK default
235
+ on_pass: qa
236
+ on_fail: { goto: dev, retry: true }
237
+
238
+ - name: qa
239
+ agent: qa
240
+ artifact: qa-report.md
241
+ verdicts: { pass: PASS, fail: FAIL }
242
+ max_iterations: 100
243
+ finalize_nudge_turns: 10
244
+ on_pass: commit
245
+ on_fail: { goto: dev, retry: true }
246
+
247
+ - name: commit
248
+ action: commit
249
+ params: { message: "feat: construct {subject} (agent dev loop)" }
250
+ ```
251
+
252
+ | Key | Notes |
253
+ | --- | --- |
254
+ | `agent:` / `command:` / `action:` / `brief_inputs:` | Exactly one per step. Agents live in `agents_dir` as `<name>.agent.md`; commands run sandboxed (mechanical, never an LLM call). `commit` is the sole host-side built-in action; consumer actions are sandbox-executed, command-shaped scripts (see [Host boundary](#host-boundary-security-model)). `brief_inputs:` is a native brief step - see its row below. |
255
+ | `produces:` / `artifact:` + `verdicts:` | Hygiene-tracked outputs vs verdict-parsed routing. The **last** `VERDICT:` line wins; stale artifacts are deleted at each attempt start. |
256
+ | `brief_inputs:` | The discriminator for a native brief step: `{ include: [<paths/globs>], env_facts: [<strings>], sections: [<headings>] }`. There is no `agent:`, `produces:`, or `max_iterations:` - the prompt is engine-embedded, the capture file is `attempt-brief.md`, and the iteration cap is 12, all engine-owned. The engine resolves the include list against the workspace, passes the resolved docs + include contents + env facts as the step's task message, and regenerates the step only when those inputs change. `sections` is the ordered list of digest headings the brief must emit (default `[Repo rules digest, Unit scope digest, Environment facts, Open risks]`; non-empty and unique). `name` stays free-form, so multiple brief steps are allowed. |
257
+ | `terminal_timeout:` | Optional agent-step per-action timeout in seconds (gt 0). `SandboxTerminalExecutor` uses it when the agent leaves the terminal action timeout unset, overriding the SDK tool's default. `None` = current behavior. |
258
+ | `finalize_nudge_turns:` | Optional agent-step final-response nudge (gt 0). Requires `max_iterations:` and must be less than it. At `max_iterations - finalize_nudge_turns` completed turns the engine injects one advisory turn ("`N turns remain: produce your final response now`"), exactly once; the agent may still exhaust its turns and existing stuck/unclear handling applies unchanged. Absent = current behavior. Provisional pending one consumer run (revert if noisy or the raised cap inflates cost). |
259
+ | `custom_prompt:` | Planned (planning-docs/040). Optional agent-step value: literal text, or a path whose file contents are read at load time, appended verbatim to the agent prompt at context assembly (after the prompt, before the task/artifacts). A value that looks like a path but names no file is a validation error. Agent steps only. |
260
+ | `reasoning_effort:` | Optional `low` / `medium` / `high` / `xhigh` / `none`. Set on the `llm` block (pipeline-global) or per-step (overrides the block). Unset anywhere = the field is not passed and the SDK default (`high`) applies, so today's behavior is unchanged. Forwarded only for models the SDK/LiteLLM mark as supporting it; an unsupported value fails at the first LLM call. See [Reasoning effort](#reasoning-effort-opt-in). |
261
+ | `on_pass:` / `on_fail:` | A step name, terminal `success`/`failure`, or `{goto: X, retry: true}`. No loops happen unless you write them. |
262
+ | `env:` / `setup:` / `network:` | `env:` declares step vars (fixed safe base + declared vars only); `setup:` runs fresh at every step boundary in a one-shot provision container targeting the export (command or agent steps; network ON; no stamping); `network: true` lets a command/agent step reach the hosts its `egress:` allowlist names (default off) - see [Per-stage networking](#per-stage-networking). |
263
+ | `mounts:` / `egress:` | Per-step workspace isolation. `mounts:` lists `{path, mode}` entries (`rw`/`ro`, default `ro`) and is **strict-by-default** - empty/missing mounts nothing; only declared-rw paths sync back to the repo. `egress:` is `{class, presets, targets}` (`class: browser` = broad-but-logged; otherwise a strict allowlist). See [Per-stage networking](#per-stage-networking) and [docs/setup.md](docs/setup.md). |
264
+ | `secrets:` (top-level) / step `secrets:` | Declares secret **refs only - never values**; each step opts in to the refs it needs. Resolved host-side and injected into that step's exec env only. See [Secrets](#secrets--refs-only-never-values). |
265
+ | `isolation:` (optional) | Configures the sandbox - image override, resource caps, `allow_git_mutations`, `seccomp_profile`. It can never disable it. See [browser sandbox](docs/browser-sandbox.md). |
266
+ | `state_dir` | Defaults to `~/.agentic-dev-loop/runs/<pipeline-hash>/` - artifacts and checkpoints live outside the sandbox mount. |
267
+ | `extensions_dir` | Where consumer `extensions:` modules resolve - defaults to `~/.agentic-dev-loop/extensions`, **outside** the workspace. Workspace-resident extension/tool modules are refused at load. |
268
+ | `deps_policy` | `locked` (default) or `open`. `locked` = the human-owned lockfile is the source of truth and the agent may not add dependencies; `open` = the bootstrap protocol (the agent may add exact-pinned manifest entries). See [Dependency policy](#dependency-policy-locked-by-default). |
269
+ | `lockfiles` | The pipeline's declared lockfile names (workspace-relative), injected into agent context and named by the missing-dependency fail-fast. Required (non-empty) when `deps_policy: locked` - a `locked` pipeline with no lockfiles fails fast at load. |
270
+ | `caches:` / `sync_excludes:` | Top-level run-wide lists. `caches:` names repo-relative toolchain cache dirs bind-mounted rw from host-side stores under `{state_dir}/caches/<name>` (auto-created); a `setup:` hook can warm them (the provision container carries the same cache mounts); `sync_excludes:` names non-gitignored scratch paths skipped from both the export copy and sync-back (wildcard `*` spans separators, so `**/bin/**` matches a `/bin/` segment at any depth). Both default to `[]`. See [docs/setup.md](docs/setup.md). |
271
+ | `merge_on_conflict:` | Top-level run-wide list of append-style logs (same path vocabulary as `sync_excludes:`, default `[]`). A concurrent host edit to a listed path is union-merged instead of raising: the host file wins and the sandbox's export-only lines are appended in order; both sides converge and the run continues. See [docs/setup.md](docs/setup.md). |
272
+
273
+ ### Reasoning effort (opt-in)
274
+
275
+ `reasoning_effort` is an opt-in latency dial on the pipeline `llm` block and
276
+ on individual agent steps. It takes one of `low`, `medium`, `high`, `xhigh`,
277
+ or `none`; unset means the field is never passed and the SDK default
278
+ (`high`) applies, so a pipeline that omits it behaves exactly as before. A
279
+ step's value overrides the `llm` block's value, so the review lane can hold
280
+ a higher effort than the rest.
281
+
282
+ The value is forwarded only for models the SDK/LiteLLM mark as supporting
283
+ it; an unsupported value fails at the first LLM call (the schema rejects
284
+ unknown names at load time, but cannot know provider capability). No
285
+ pipeline ships a value: adopt one only after an observed run proves lower
286
+ per-turn latency with a green suite and no provider 400s.
287
+
288
+ Recommended lane defaults (guidance only, not enforced):
289
+
290
+ | Lane | reasoning_effort | Why |
291
+ | --- | --- | --- |
292
+ | brief | medium | digest and classify, no design work |
293
+ | dev | high | hold the line: dev caught a real plan bug and a real sandbox triage this unit |
294
+ | qa | medium | classification discipline must stay reliable |
295
+ | review | xhigh | shortest lane, highest stakes: a missed detection sails past the last gate into commit |
296
+
297
+ A `brief_inputs:` step is the per-run context-digestion pattern: it runs once at
298
+ run start (or when its inputs change), its engine-owned `attempt-brief.md`
299
+ digest survives attempt starts, and the dev/review agents read that digest
300
+ instead of re-deriving repo rules and environment facts every attempt.
301
+
302
+ The brief digest is mechanically coverage-checked: the configured
303
+ `brief_inputs.sections` headings must each appear on their own line, every
304
+ anchor extracted from the `include` files (markdown `##` headings, and YAML
305
+ category names plus `enforcement_levels`) must appear on its own line
306
+ (case-insensitive, whitespace-collapsed, `**` decoration allowed), and every
307
+ `env_facts` entry must appear verbatim. The section list feeds both the
308
+ engine-embedded brief prompt and the coverage gate, so the two can never
309
+ disagree; a miss
310
+ re-runs the brief agent once per missing set with a `## Coverage retry`
311
+ correction note, bounded to three retries per input set; if the same items are
312
+ still dropped after the cap, the run fails and `last-error.md` names the
313
+ persistent drops. Include files with no extractable anchors pass vacuously, and
314
+ unusual YAML rule shapes are under-checked, never over-checked.
315
+
316
+ ### Secrets (`secrets:`) - refs only, never values
317
+
318
+ Secret values never belong in the pipeline yaml, the workspace, or `state_dir`.
319
+ Declare the refs at the top level and opt each step into the refs it needs:
320
+
321
+ ```yaml
322
+ secrets: # refs only - never values
323
+ kinde-client-secret: # ref name (arbitrary)
324
+ from: env # provider name
325
+ key: KINDIE_CLIENT_SECRET # provider-specific locator
326
+ r2-keys:
327
+ from: env
328
+ key: R2_KEYS
329
+
330
+ steps:
331
+ - name: qa
332
+ agent: qa
333
+ secrets: [kinde-client-secret, r2-keys]
334
+ ```
335
+
336
+ - The engine resolves every declared ref **host-side at run start** (the `env`
337
+ provider reads the named host environment variable). A missing variable, an
338
+ unknown provider, or a ref a step lists without declaring it fails fast -
339
+ naming the ref, the step, and the provider error. No silent fallback.
340
+ - A resolved secret is injected into a step's exec env **only when that step
341
+ lists the ref** - the same path step `env:` uses, no new channel. The secret
342
+ never reaches the provision container, `state_dir`, or any other step.
343
+ - Prefer a mechanical `command` step for secret-consuming work (a script runs
344
+ the app with creds) so the LLM and the secret never meet; an `agent` step
345
+ holds a secret only when its job genuinely requires it.
346
+ - **`.env*` ban.** At run start the workspace root is scanned for `.env*`
347
+ files. Any hit fails fast, naming the files, with the remedy text. The
348
+ convention fixtures `.env.example`, `.env.template`, and `.env.sample` are
349
+ whitelisted. This applies regardless of `network:` flags.
350
+ - **Output scrubbing.** Resolved secret values are scrubbed from every
351
+ engine-written output - captured step output, retry notes, artifacts, and
352
+ `state_dir` files. (Hygiene: the declaring step's agent has already seen
353
+ the value in its own env.)
354
+
355
+ ### Per-stage networking
356
+
357
+ The sandbox is network-off by default. A step that legitimately needs egress -
358
+ a QA step that curls a service it booted, an agent that must hit an API or
359
+ fetch package metadata mid-conversation - declares it explicitly, and names
360
+ exactly what it may reach:
361
+
362
+ ```yaml
363
+ steps:
364
+ - name: fetch-docs
365
+ command: curl -fsSL https://example.com/spec.json -o spec.json
366
+ mounts: [{ path: ".", mode: rw }] # the cwd + a place to write spec.json
367
+ network: true # egress for this step only
368
+ egress: { targets: [example.com] } # ...and only these hosts
369
+
370
+ - name: restore
371
+ command: .venv-sandbox/bin/pip install -e ".[dev]"
372
+ mounts: [{ path: ".", mode: rw }]
373
+ network: true
374
+ egress: { presets: [package-registries] } # pypi/npm/NuGet/cargo + VCS
375
+ ```
376
+
377
+ - **Default off.** Every step runs with `--network none` unless it declares
378
+ `network: true`.
379
+ - **A networked step that writes output must also declare a writable mount.**
380
+ `mounts:` is strict-by-default: with no `mounts:` a step mounts nothing, so
381
+ a command like `curl ... -o spec.json` has no writable cwd to write into.
382
+ Declare `mounts: [{ path: ".", mode: rw }]` (or a narrower rw path) for any
383
+ networked step that needs to produce files.
384
+ - **`network: true` is scoped by the `egress:` allowlist, and egress is
385
+ structurally enforced.** A networked step runs on a per-run internal
386
+ docker network with no route to the host. Its traffic is forced
387
+ through a containerized egress proxy (injected via
388
+ `HTTP_PROXY`/`HTTPS_PROXY`, pointed at the proxy's internal IP
389
+ on the internal network; each distinct egress policy gets its own
390
+ proxy with a distinct internal IP); a request to an undeclared host
391
+ is denied and logged as an enforcement event. The engine never adds
392
+ an undeclared target. `egress: { class: browser }` is the explicit
393
+ broad-but-logged class (every connection logged, nothing filtered); command
394
+ and agent steps default to a strict allowlist.
395
+ - **Command, agent, and sandbox-action steps** may declare it. The host-side
396
+ built-in `commit` action never takes it (refused once the registry is known).
397
+ - **Author opt-in is the control.** A networked step grants its agent egress
398
+ to exactly the declared hosts for that stage; the default stays network-off
399
+ everywhere. Reserve it for stages that need it (QA, integration). The
400
+ residual risks are documented in [docs/setup.md](docs/setup.md).
401
+ - **Host-service reachability (planning-docs/037, 038).** The egress
402
+ proxy is a container on the run's internal network with a second
403
+ host-access attachment carrying the `host.docker.internal`
404
+ host-gateway alias, so the name resolves natively inside the proxy
405
+ container and host services (an S3 SDK against a local MinIO, say)
406
+ are reached through the enforced, logged path. Sandbox containers
407
+ have no host route: the internal network carries no default route to
408
+ the host, and sandbox containers get no host-gateway alias.
409
+ `dial_rewrites` on the proxy remains the platform override for hosts
410
+ where the alias does not resolve.
411
+
412
+ ### Sync-back conflicts (host edits during a run)
413
+
414
+ Only declared-`rw` paths sync back to the real repo after a step. If the host
415
+ also edits a declared-`rw` path while the step is running, sync-back prints
416
+ `[isolation] sync-back conflict: ...` and raises `AE-SBX-016`; the host's
417
+ version wins, the baseline is re-snapshotted, and the next step (even
418
+ `echo hello`) runs clean instead of re-raising forever. For append-style logs
419
+ edited by both sides (an audit log, say), declare them in the top-level
420
+ `merge_on_conflict:` list: those paths are union-merged - the host keeps its
421
+ lines, the sandbox's new lines are appended in order, both sides converge, and
422
+ the run continues with `[isolation] merged concurrent edits: ...` on the
423
+ console.
424
+
425
+
426
+ ## Authoring a loop for your own repo
427
+
428
+ A consumer repo needs two things written by hand - a pipeline file and the
429
+ agent files it names - both committed before the first run (the host-boundary
430
+ check refuses dirty tooling, and the `commit` step never commits it). Two
431
+ reference layouts ship today: this repo dogfoods the engine on itself
432
+ (python + pytest, no frontend, CLI-only qa), and the consumer repo carries
433
+ the wider shape (.NET + npm frontend + a networked browser-probing qa step).
434
+
435
+ ```
436
+ <repo>/agentic-dev-loop/pipeline.yaml
437
+ <repo>/agentic-dev-loop/sdk_agents/dev.agent.md
438
+ <repo>/agentic-dev-loop/sdk_agents/review.agent.md
439
+ <repo>/agentic-dev-loop/sdk_agents/qa.agent.md
440
+ ```
441
+
442
+ ### The agent files
443
+
444
+ Each `sdk_agents/<name>.agent.md` is a markdown prompt plus YAML frontmatter:
445
+ `name` matches a step's `agent:` value; `tools` lists the tool names the step
446
+ may use (`terminal` always; a repo can add more via extensions, e.g.
447
+ `figma`).
448
+
449
+ ```markdown
450
+ ---
451
+ name: review # matches a step's `agent:` value
452
+ tools: [terminal]
453
+ ---
454
+ # Review Agent
455
+ ## WORKFLOW # numbered steps
456
+ ## RULES # absolute never/always rules
457
+ ## SANDBOX NOTES # the sandbox truth for THIS step
458
+ ## OUTPUT # the verdict contract
459
+ ```
460
+
461
+ Three roles, three contracts:
462
+
463
+ | Role | Verdict contract | Typical sandbox |
464
+ | --- | --- | --- |
465
+ | dev | none - the final response is captured as the `produces:` summary | rw mount, offline |
466
+ | review | `VERDICT: APPROVED` / `VERDICT: NEEDS CHANGES` on the first content line | ro mount, offline |
467
+ | qa | `VERDICT: PASS` / `VERDICT: FAIL`; map `unverifiable: UNVERIFIABLE` if you want a third way | shaped by the repo: rw + network + `class: browser` when it boots servers and drives a browser (the consumer repo); ro + offline when it probes the CLI only (this repo) |
468
+
469
+ The conventions that make a good agent file - each one below exists because
470
+ an agent burned budget learning it mid-run:
471
+
472
+ - **State the sandbox truth in the prompt.** Every agent file carries a
473
+ `SANDBOX NOTES` section naming exactly what its step allows: mounts ro or
474
+ rw, network on or off, and which gates have already run. Never make the
475
+ agent discover it.
476
+ - **Gates are the source of truth - cite the record, never re-run.** A
477
+ command the test gate, the editor-tests gate, or the dev summary reports
478
+ as run is coverage evidence, cited as `covered by <test>` or the gate
479
+ record. Review and qa never re-run builds or suites; qa maps every
480
+ acceptance criterion to existing coverage and probes only the remainder.
481
+ - **dev enumerates its impossible set and stops at it.** The dev prompt
482
+ says: stop the moment your next step needs a command this sandbox cannot
483
+ run, and lists the set (package-manager fetches after a new pin, npm or
484
+ vitest offline, playwright downloads, database-category tests), one
485
+ attempt per command. That keeps the productive edit/build/test loop and
486
+ kills doomed retries. The set is toolchain-specific - write yours; this
487
+ repo's is a single bullet (no package managers), the consumer repo's is
488
+ four.
489
+ - **Failure output returns as *Previous attempt feedback*.** Steps route
490
+ `on_fail: { goto: dev, retry: true }`, so gate failure output lands in
491
+ the dev agent's next context; the dev prompt makes every listed issue a
492
+ required fix.
493
+ - **No git mutations, ever.** The `commit` step is the single commit point.
494
+ - **`max_iterations` per role.** qa is bounded probing (100 in this
495
+ repo's dogfood loop, with `finalize_nudge_turns: 10` so it never ends
496
+ silently at the cap - both provisional); dev is open-ended construction
497
+ and stays uncapped (the engine default).
498
+
499
+ ### The pipeline file
500
+
501
+ The full field reference is above; this is the stage lineup and what to
502
+ adapt per repo.
503
+
504
+ | Stage | Kind | Typical shape | Why |
505
+ | --- | --- | --- | --- |
506
+ | dev | agent | rw, offline | does the work; edits are untracked |
507
+ | restore | command | network + `presets: [package-registries]` | fetches what dev pinned (`deps_policy: open`) or the locked install; also the audit escalation point |
508
+ | test | command | offline is fine (warm cache) | exit code is the verdict; the source of truth |
509
+ | editor-tests | command | network + `presets: [package-registries]` | frontend suites that cannot run offline (`npm ci && npm test`). A separate step, never merged into `test`: the step name is the failure diagnosis, its timeout does not contend the backend suite's, and a retry re-runs only its own chain |
510
+ | conformance | command | network + `presets: [package-registries]` | repo-specific fitness checks (the consumer repo: jscpd + DDD rules) |
511
+ | review | agent | ro, offline | static conformance verdict |
512
+ | qa | agent | per repo (see table above) | live-behaviour probes; `max_iterations: 100` + `finalize_nudge_turns: 10` (provisional); inject secrets only if the probes need them |
513
+ | commit | action | host-side | the single commit point |
514
+
515
+ Adaptation checklist for a new repo:
516
+
517
+ 1. `llm:` - model, `base_url`, `api_key_env`.
518
+ 2. `isolation:` - toolchain image override (the consumer repo pins a
519
+ toolchain image by digest) and `seccomp_profile: bundled:chromium-userns`
520
+ only if a stage runs Chromium.
521
+ 3. `caches:` - toolchain cache dirs as rw bind-mounts shared across runs
522
+ (`.nuget-packages`, `qa/node_modules`, `qa/.browsers`,
523
+ `frontend-editor/node_modules`); caches are never synced back, and a
524
+ step's `setup:` hook runs with them mounted so it can warm them.
525
+ 4. `sync_excludes:` - build output trees (`**/bin/**`, `**/obj/**`).
526
+ 5. `secrets:` - refs only, resolved from host env; each step opts in to the
527
+ refs it needs.
528
+ 6. `egress:` - `presets: [package-registries]` for fetch steps;
529
+ `class: browser` (broad-but-logged) for browser-tier qa only.
530
+ 7. `deps_policy:` and `lockfiles:` - see
531
+ [Dependency policy](#dependency-policy-locked-by-default).
532
+ 8. The dev prompt's impossible set - write it for your toolchain.
533
+ 9. `additional_files:` - the repo's `AGENTS.md`, coding standards, design
534
+ docs: shared context for every agent step.
535
+
536
+ Validate before the first run - dry-run loads and prints the resolved plan
537
+ with no LLM, no Docker, no state writes:
538
+
539
+ ```bash
540
+ agentic-dev-loop agentic-dev-loop/pipeline.yaml --dry-run
541
+ ```
542
+
543
+ Then commit the tooling and run for real.
544
+
545
+ ## Dependency policy (locked by default)
546
+
547
+ The supply-chain dial is a pipeline-level `deps_policy:` field, **locked by
548
+ default**. The engine injects the policy into every agent step's context -
549
+ the rule lives in the engine, not in hand-authored `dev.agent.md` prose (the
550
+ class of rule that deadlocked the NuGet cache).
551
+
552
+ ```yaml
553
+ deps_policy: locked # or: open (default: locked)
554
+ lockfiles: [uv.lock] # or: [packages.lock.json, package-lock.json]
555
+ ```
556
+
557
+ - **`locked`** - the human-owned lockfile is the source of truth; the agent
558
+ may not add dependencies. The injected rule says *"You may only use
559
+ dependencies already present in `<lockfile>`. If the design requires a
560
+ dependency that is not present, declare it in your final response under the
561
+ fixed header `## Missing dependencies` (one `name==version` per line) and
562
+ finish what you can. Do not add it to the manifest."* A non-empty
563
+ `## Missing dependencies` declaration **fails the run fast** with
564
+ `Extend <lockfile> with these pins and re-run: …` - one human lockfile edit,
565
+ not a retry loop. The declaration is advisory to the human; the engine never
566
+ auto-fetches the declared packages.
567
+ - **`open`** - the bootstrap protocol (018): the agent may add exact-pinned
568
+ manifest entries directly (never a package-manager `add` command); the
569
+ network-on restore step fetches them. The engine injects the same rule
570
+ canonically. Nothing about `open` is default.
571
+
572
+ The **restore step** runs the toolchain's locked mode and fails when the
573
+ manifest and lockfile disagree:
574
+
575
+ | Toolchain | Locked restore | Lockfile |
576
+ | --- | --- | --- |
577
+ | .NET | `dotnet restore --locked-mode` | `packages.lock.json` (set `RestorePackagesWithLockFile=true`) |
578
+ | node | `npm ci` | `package-lock.json` |
579
+ | python | `uv sync --locked` (or pip-tools `pip-sync requirements.lock`) | `uv.lock` - pip has no native lockfile; `uv` is the canonical locked-install tool |
580
+
581
+ ### Audit escalation in the restore step
582
+
583
+ The restore step also fails on known-CVE findings, at a per-toolchain
584
+ threshold:
585
+
586
+ | Toolchain | Audit (fails the step) |
587
+ | --- | --- |
588
+ | .NET | `NuGetAudit` at `error` - any audit finding fails the restore |
589
+ | node | `npm audit --audit-level=high` |
590
+ | python | `pip-audit` - any finding fails |
591
+
592
+ Under `locked`, a failing audit means the lockfile pins a vulnerable version:
593
+ the run fails and the human regenerates the lockfile at a patched version.
594
+ Under `open`, the failure routes to `dev` like any restore failure - the dev
595
+ agent can bump the pin, but that pin is audited again on the next pass, so
596
+ the loop self-corrects.
597
+
598
+ ### Generating a lockfile
599
+
600
+ A human generates the lockfile once, on a network machine, and commits it -
601
+ the engine never fetches on the agent's behalf:
602
+
603
+ ```bash
604
+ uv lock # python - writes uv.lock from pyproject.toml
605
+ uv sync --locked # installs exactly uv.lock; fails on any drift
606
+ npm install --package-lock-only # node - writes package-lock.json
607
+ npm ci # installs exactly package-lock.json
608
+ dotnet restore --use-lock-file # .NET - writes packages.lock.json
609
+ dotnet restore --locked-mode # installs exactly packages.lock.json
610
+ ```
611
+
612
+ Keep the lockfile tracked (do not gitignore it) and re-run the locked restore
613
+ to prove it holds from a clean cache before setting `deps_policy: locked`.
614
+
615
+ ## Agent-facing error guide
616
+
617
+ The engine bundles an always-on guide for the engine error codes an agent
618
+ can actually observe while running terminal commands. The guide lives at
619
+ `src/agentic_dev_loop/engine/agent_error_guide.md`, versioned with the engine
620
+ code that emits the codes, and is injected into every agent step's task
621
+ context at assembly time. There is no opt-in and no opt-out in v1; command
622
+ and action steps never receive it because no agent reads them.
623
+
624
+ Each agent-visible code has exactly one table row, shaped like this:
625
+
626
+ | Code | Meaning | Correct response |
627
+ | --- | --- | --- |
628
+ | AE-SBX-016 | The loop refused to sync an edit because the real repo changed underneath on a path this workspace also touches; the file in this workspace is stale and its edits will not be applied. | The command is not the problem: retry once, do not edit or work around the named path, and mention the code in your final response if it persists. |
629
+
630
+ The guide is consumer-agnostic: it explains the general mechanism and never
631
+ names a consumer or a consumer domain rule ID. If an ID must appear inside a
632
+ quoted engine message, the placeholder `<domain-rule-id>` is used. Any engine
633
+ change that adds or changes an agent-visible error code must update the guide
634
+ in the same commit; the test suite enforces the pairing by parsing the
635
+ agent-visible `SandboxError` raise sites against the bundled table.
636
+
637
+ ## Host boundary (security model)
638
+
639
+ The orchestrator, tool layer, and the `commit` action run in the **host
640
+ process** - they hold your credentials and your full user account, so the
641
+ engine keeps anything agent-writable out of that process:
642
+
643
+ - **Consumer actions are sandbox-executed.** An action you register via an
644
+ extension is a command-shaped script (`script + params`), run through the
645
+ same sandbox path as command steps - the exit code is the verdict, and the
646
+ code never runs in the host. Only the engine's trusted built-ins (`commit`,
647
+ document loaders) run host-side.
648
+ - **Extensions load from outside the workspace.** `extensions_dir` defaults to
649
+ `~/.agentic-dev-loop/extensions`; at load time any extension or tool module
650
+ whose file resolves under the workspace is refused *before import*, naming
651
+ the file.
652
+ - **The engine installs outside the workspace.** Install with pipx so the venv
653
+ is unmounted from the sandbox; a startup self-check refuses to run if
654
+ `agentic_dev_loop` resolves under the workspace (an editable install bypasses
655
+ everything).
656
+ - **Tooling is read-only by the loop.** At run start the pipeline file,
657
+ `agents_dir`, `additional_files`, `aidlc-docs/`, and `tools/` must be
658
+ git-clean relative to HEAD - otherwise the run refuses, naming the dirty
659
+ files. The `commit` action excludes those paths from its sweep, so the loop
660
+ never commits its own tooling.
661
+ - **`commit` stays host-side, deliberately.** It holds push credentials; moving
662
+ it into the sandbox would trade host-exec-of-trusted-code for
663
+ credential-in-sandbox. It runs argv-style with a scrubbed child env and
664
+ `-c core.hooksPath=~/.agentic-dev-loop/state/hooks` so repo hooks never
665
+ execute.
666
+
667
+ Net: the host executes nothing from the workspace, reads only git-clean
668
+ control files, and the only agent-writable host-consumed thing left is the code
669
+ the loop is building.
670
+
671
+ ### Consumer migration notes
672
+
673
+ - **Actions** - replace a host-side `fn` registration with
674
+ `registry.add_sandbox_action(name, script)`. `script` is a command string
675
+ rendered with the step's `params:` plus `{subject}`; the exit code is the
676
+ verdict. `add_action` (host-side) is now engine-built-in-only and is refused
677
+ from extensions.
678
+ - **Extensions** - move workspace-resident extension modules (e.g.
679
+ `extensions/*.py`) into `~/.agentic-dev-loop/extensions/` (or whatever
680
+ `extensions_dir:` names), and reinstall the engine via pipx so it is not
681
+ editable/in-workspace.
682
+ - **Tooling** - commit the pipeline, agent defs, shared `additional_files`,
683
+ `aidlc-docs/`, and `tools/` before running: the run refuses dirty tooling,
684
+ and `commit` never commits it.
685
+
686
+ ## Development environment
687
+
688
+ ```bash
689
+ git clone git@github.com:lukedawilson/agentic-dev-loop.git
690
+ cd agentic-dev-loop
691
+ pipx install "agentic-dev-loop==1.0.0a17" # engine venv OUTSIDE the workspace (self-check)
692
+ export OPENAI_API_KEY=... # set your LLM key in the host env (no .env in the repo)
693
+ python -m pytest tests/ -q # fast suite (in-repo .venv is for tests only)
694
+ python -m pytest tests/ -q -m "not docker" # skip engine-dependent tests
695
+ agentic-dev-loop agentic-dev-loop/pipeline.yaml --dry-run # run the shipped pipeline
696
+ ./run-demo.sh # viz demo - scripted run replay, no pipeline needed
697
+ ```
698
+
699
+ - `setup-venv.sh` builds the throwaway `.venv` for local `pytest` runs (the
700
+ pipeline's `test` step provisions its own `.venv-sandbox` inside the
701
+ sandbox). The loop itself must run from the pipx install - never an
702
+ in-workspace `.venv`, which the startup self-check refuses.
703
+ - Docker-marked integration tests need a local daemon; CI runs them on Linux.
704
+ - The shipped pipeline (`agentic-dev-loop/pipeline.yaml`) **dogfoods the tool on
705
+ its own repo** - dev → test → review → qa → commit, with the engine's own
706
+ three agent definitions in `sdk_agents/`.
707
+ - CI: `ci.yml` (unit + integration suite, ubuntu),
708
+ `publish-image.yml` (multi-arch dev image, amd64 + arm64), `release.yml`
709
+ (PyPI publishing).
710
+
711
+ ## Contributing
712
+
713
+ - **Read [AGENTS.md](AGENTS.md) first** - it is the instruction set for both
714
+ human and agent contributors (default mode: the user drives, ask before
715
+ coding, TDD, no silent fallbacks).
716
+ - Development is structured by **AI-DLC** - the lifecycle workflow in
717
+ `.aidlc/aidlc-rules/aws-aidlc-rules/` with working docs (plans, units, state)
718
+ in `aidlc-docs/`. The bundled document loader autodetects the current unit
719
+ from `aidlc-state.md` via `--aidlc-unit`, or load any plan with `--plan`.
720
+ - OpenCode commands over the workflow: `/unit-status`, `/epic-status`,
721
+ `/ticket-details`, `/update-subtask`, `/apply-aidlc-patches`, and more.
722
+ - Working extension samples (actions, tools, document loaders) ship as
723
+ `tests/sample_ext.py`.
724
+
725
+ ---
726
+
727
+ Built on [OpenHands SDK](https://github.com/OpenHands/software-agent-sdk) and
728
+ [LangGraph](https://github.com/langchain-ai/langgraph).