CI / build (push) Has been cancelled
- Archive 79 completed framework-dev tasks from tasks/ -> tasks/complete/ - status.py: add --cleanup-done and --install-cleanup-schedule commands - Add scripts/automaton-cleanup.sh for periodic task archiving - Dashboard: rename 'Background' tab -> 'Agent', 'Cleanup' agent -> 'Completed Task Archiver', remove redundant group headers and pill badges, dim inactive agent placeholders - .rules.md: add Self-Documenting UI Names rule - New tests: test_cleanup_done.py, expanded test_app.py and test_task.py
3.7 KiB
3.7 KiB
CODE_REVIEW: add-goal-mode
Reviewed against SPEC.md R1-R8.
R1-R8 checklist
| Req | Status | Notes |
|---|---|---|
| R1 find_work dispatch | PASS | _find_work dispatches on work_source.kind; missing/unknown falls back to single with WARNING |
| R2 audit work_source | PASS | _find_work_audit calls --audit --json, sorts by severity, creates task via --create-task when no task field |
| R3 backlog work_source | PASS | _find_work_backlog reads design/<area>/BACKLOG.md, picks top - [ ], slugifies bold heading |
| R4 verifier tokens | PASS | {task_brief}, {acceptance_criteria}, {next_hint} in extras; substituted via _substitute |
| R5 truncate_tokens | PASS | 4 chars/token heuristic; marker appended; caps at 4000/2000/1000 |
| R6 next_hint loop | PASS | _next_hint_text reads last_verdict.next_hint; empty on first tick; fed into implement and verify |
| R7 loop.json schema | PASS | ci-triage template has explicit work_source + acceptance_criteria; technical.md updated |
| R8 audit --json | PASS | cmd_audit emits JSON line with violations/loops/total_tasks/untracked_tasks |
Edge cases checked
- Missing
work_sourcefield -- falls back tosinglewith no WARNING (only unknown kinds warn). Backward compat with ci-triage template preserved. PASS - Unknown
work_source.kind-- WARNING logged, falls back tosingle. PASS - Audit with no violations -- returns
Nonefrom_find_work_audit; skip reasonno_work; does not increment iteration_count. PASS - Audit violation with null task -- slugifies message, calls
--create-task, returns slug. PASS - Audit violation with existing task -- returns task name directly, no create-task call. PASS
- Backlog with all items checked -- returns
None; skipno_work. PASS - Backlog with no bold marker -- falls back to
_slugify(line_body). PASS - Empty task_brief / acceptance_criteria / next_hint --
_truncate_tokens("")returns""; substitution replaces with empty string; no KeyError. PASS last_verdictis None --_next_hint_textchecksisinstance(last, dict); returns"". PASS--audit --jsonwith no violations -- emits{"violations":[], ...}; runner sees empty list, skips. PASS--audit --jsonoutput pickable by_run_json-- single JSON line on stdout;_run_jsontakessplitlines()[-1]. PASS
Code-quality observations
_find_work_auditsubprocess timeout=15 for--create-task-- reasonable; if create-task hangs, the runner swallows it and returns the slug anyway. The task dir may not exist yet, but the orchestrator will handle it on the next tick. Acceptable for v1._slugifyused for both audit and backlog -- consistent slug derivation. The regex[^A-Za-z0-9._-]+->-is reasonable._task_dir_forduplicatesstatus.py_task_dirlogic -- documented as intentional (no cross-script imports per technical.md). If the task dir layout changes, both need updating. Acceptable for v1.- Token substitution only works if harness command contains the placeholder -- the default command
["opencode", "run", "--prompt-file", "{prompt}", "--cwd", "{cwd}"]does not include{task_brief}etc. Custom harness configs must add them explicitly. This is by design (SPEC R4: "tokens absent from the prompt stay literal"). _acceptance_criteria_texthandles both string and list -- list joined with newlines. If the value is a dict or other type,str(raw)is called. Defensive enough._find_work_backlogreads fromdesign/<area>/BACKLOG.md-- usesproject_dir == AUTOMATON_DIRcheck to pick framework vs project path. Consistent with_task_dir_forpattern.
Verdict
APPROVE. Ready for bug_find.