Complete tasks 3-7: harden verdict parsing, outputs retention, base branch, linux schedule parity, claim loop task
CI / build (push) Has been cancelled

This commit is contained in:
Lap Tran
2026-06-24 10:31:49 -04:00
parent dd2726c0dd
commit e13513faaa
193 changed files with 14934 additions and 98 deletions
+56
View File
@@ -0,0 +1,56 @@
# Verdict: add-status-brakes
**Status: PASS**
The task delivers the loop-engineering brakes layer (R1–R10) entirely inside `status.py`, with no new dependencies and no second enforcement surface. It is the foundation that tasks 3–7 build on; everything those tasks need to call (`--check-gate`, `--can-continue`, `--approve --loop`, `--can-edit --loop`, `--create-loop`, `--install-schedule`, `--loop-list`, `.state.log`) is now in place and unit-tested.
## Requirement coverage
| Req | Delivered | Tests |
|-----|-----------|-------|
| R1 `.state.loop` schema | All 13 fields, atomic tmp+rename | `TestStateLoopSchema` (2) |
| R2 `--create-loop` | kebab/dup/template rejection, name patch | `TestCreateLoop` (5) |
| R3 `--version`, `--approve --loop` | version regex; only halt-clear; `resumed_count++` | `TestVersionAndApprove` (4) |
| R4 `--can-continue` | running-only probe | `TestCanContinue` (3) |
| R5 `--check-gate` (6 gates) | First-failure halts + JSON | `TestCheckGate` (10) |
| R6 `--install-schedule` | Darwin/Linux/Windows dispatch + stub | `TestInstallSchedule` (3) |
| R7 `--can-edit --loop [--loop-worktree]` | Root residency + file_scope | `TestCanEditLoop` (4) |
| R8 `--transition` halt refusal | Owned-task scan | `TestTransitionHaltRefusal` (3) |
| R9 `--audit` Cat-6 + `--loop-list` | Runs even when no tasks; untracked/halted flag | `TestAuditAndList` (6) |
| R10 `.state.log` tick trail | ISO timestamps | `TestTickLog` (3), `TestPauseResume` (3) |
Total: 46 new tests. Suite: **310 passed** (was 264 + 46 new). No regressions. `python3 -m py_compile scripts/status.py` clean.
## Defense against the five loop deaths
- **drift** → `_gate_worktree_drift` (R5)
- **runaway** → `_gate_iterations` (R5)
- **bad verifier** → `_gate_score_plateau` (R5)
- **resource burn** → `_gate_budget` (R5, remote-only informational)
- **undetected halt** → R8 transition refusal + Cat-6 audit + gate halt-write
## Harness / OS / model agnosticism preserved
- All surface reachable via `status.py` subprocess + `--json`. No harness-specific code. Works with opencode or any harness (D8).
- `platform.system()` dispatches launchd/cron/schtasks; missing tools degrade gracefully (warn + skip, not crash). D13 honored.
- Framework never inspects model capability/size/provider — `--loop-mode` already refused sub-16k in task 1; this task does not consult any model field.
## Doc impact landed
- `AGENTS.md` Harness Integration modes block extended with the `--loop` worktree-scope mode (mode 5).
- `AGENTS.md` new "State Enforcement — Loops (v1)" section.
- `README.md` new "Loop Engineering (beta)" subsection with quick-reference commands.
- `CHANGELOG.md` `[unreleased]` entry for the brakes layer.
## Hardening items deferred (tracked)
- A6 `fcntl` lock on `.state.loop` → v1.1.
- A2 `--claim-loop-task` atomic ownership → task 3.
- O3 `blast_radius.base_branch` drift parameterization → task 5.
- O4 `_enable_schedule` Linux parity → task 5 / v1.1.
All four are explicit follow-ups in `BUG_REPORT.md` and `ADVERSARIAL_BUG_REPORT.md`; none block this task.
## Resolution
**PASS — proceed to `complete`.** Task `add-status-brakes` is the foundation for the loop v1 implementation. Tasks 3, 4, 5, 6, 7 can now be unblocked, each relying on the standardized `.state.loop` schema and the brakes gates this task ships.