| name | task-chunk-loop |
| description | Execute exactly one approved chunk using bounded implementation, evidence gates, zero-trust reviewers, repair loop, and PR trust bundle. Do not start the next chunk. |
Task Chunk Loop
Execute exactly one approved chunk.
Inputs
- Chunk contract path.
- Initiative artifacts:
INTENT.md, DISCOVERY.md, PLAN.md, CHUNK_MAP.md.
- Policies under
.agent-loop/policies/.
Required process
- Read the chunk contract and parent initiative artifacts.
- Restate:
- goal
- why this chunk exists
- allowed files
- not allowed changes
- acceptance criteria
- risk class
- required reviewers
- human review focus
- Produce a short implementation plan.
- Run plan review for L0/L1 or architecture/security-sensitive work.
- Implement only the approved chunk.
- Run relevant tests/checks.
- Run deterministic proof checks before reviewer fanout.
- If deterministic checks fail, fix cheap blockers before reviewer fanout.
- Run required reviewer agents or skills based on risk routing.
- Fix all Critical and High findings.
- Re-run failed reviewers.
- Write internal review evidence.
- Run the internal review evidence gate.
- Stop after two failed repair cycles on the same class of issue.
- Produce a PR trust bundle.
- Stop for human review.
Hard stops
Stop immediately if:
- required scope exceeds the chunk contract
- architecture direction changes
- auth/payment/policy/data boundary changes beyond contract
- tests or CI must be weakened to pass
- secrets or production credentials are required
- same blocker remains after two repair attempts
Output
Return:
- Summary
- Files changed
- Tests/checks run
- Evidence gate result
- Reviewer results
- Remaining risks
- PR trust bundle draft
- Explicit stop: "Chunk complete or blocked. Awaiting human review."