Archive completed tasks, add cleanup commands, self-documenting dashboard UI
CI / build (push) Has been cancelled
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
This commit is contained in:
@@ -1 +0,0 @@
|
||||
complete
|
||||
@@ -1 +0,0 @@
|
||||
research:approved|2026-06-15T18:40:52.780052+00:00|user
|
||||
@@ -1,14 +0,0 @@
|
||||
# Adversarial Bug Report: Pre-existing Fixes
|
||||
|
||||
## Deep Bugs Found: 0
|
||||
|
||||
No code paths introduced regressions. Verified:
|
||||
- `_infer_state_from_artifacts` logic trace correct for all artifact combinations
|
||||
- `cmd_validate_folder` now properly catches corrupted `.state` files
|
||||
- `upgrade.sh` will now fail visibly instead of silently succeeding
|
||||
- `git rev-parse --git-dir` works for worktrees (returns `.git/worktrees/<name>`)
|
||||
- Edge case: bare repos (`--git-dir` returns the repo path itself) — hooks directory is `<repo>/hooks/` which `mkdir -p` handles correctly
|
||||
|
||||
## Pre-existing Issues Still Not In Scope
|
||||
- Lock timeout parsing in multi-agent mode is case-sensitive
|
||||
- Audit Category 3 (git modification check) is stubbed
|
||||
@@ -1,11 +0,0 @@
|
||||
# Bug Report: Pre-existing Fixes
|
||||
|
||||
## Bugs Found: 0
|
||||
|
||||
All fixes verified:
|
||||
1. `_infer_state_from_artifacts`: `spec_only → research` confirmed by test
|
||||
2. `_infer_state_from_artifacts`: `implementation_only → bug_find` confirmed by test
|
||||
3. `cmd_validate_folder`: empty `.state` → error, confirmed by test
|
||||
4. `cmd_validate_folder`: whitespace `.state` → error, confirmed by test
|
||||
5. `upgrade.sh`: `|| true` removed, python3 check added, git-dir detection fixed
|
||||
6. All 206 tests pass
|
||||
@@ -1,13 +0,0 @@
|
||||
# Doc Review: Pre-existing Fixes
|
||||
|
||||
## Review Summary
|
||||
|
||||
All documentation and code comments are accurate.
|
||||
|
||||
## Checklist
|
||||
- [x] `upgrade.sh` comments and error messages are clear
|
||||
- [x] `_infer_state_from_artifacts` docstring unchanged (function has no docstring — relies on code clarity)
|
||||
- [x] `cmd_validate_folder` error message for corrupted state is clear and actionable
|
||||
- [x] No stale references to removed behavior (no || true, no `.git/hooks` assumption)
|
||||
- [x] Tests are well-documented with descriptive names
|
||||
- [x] IMPLEMENTATION.md accurately describes all changes
|
||||
@@ -1,28 +0,0 @@
|
||||
# Implementation: Pre-existing Fixes
|
||||
|
||||
## Changes Made
|
||||
|
||||
### 1. `_infer_state_from_artifacts` heuristic fix (`scripts/status.py` lines 304-309)
|
||||
**Before**: `SPEC.md exists AND BUG_REPORT.md doesn't exist → bug_find` (wrong — most tasks only have SPEC.md)
|
||||
**After**: Simplified logic:
|
||||
- `BUG_REPORT.md` alone → `adversarial_bug_find` (bug_find done)
|
||||
- `IMPLEMENTATION.md` alone → `bug_find` (implement done)
|
||||
- `SPEC.md` alone → `research` (correct mapping)
|
||||
- Removed the buggy SPEC+no-BUG_REPORT case entirely
|
||||
|
||||
### 2. `cmd_validate_folder` corrupted state fix (`scripts/status.py` lines 563-568)
|
||||
**Before**: If `.state` exists but `_read_state()` returns None, silently falls back to `_infer_state_from_artifacts`
|
||||
**After**: Error out with clear message: "corrupted .state file — re-bootstrap with --upgrade"
|
||||
|
||||
### 3. `upgrade.sh` fixes (`scripts/upgrade.sh`)
|
||||
- **Removed `|| true`**: `python3 status.py --upgrade` now fails loudly with error message
|
||||
- **Added python3 check**: Script exits early with clear error if python3 not in PATH
|
||||
- **Git hooks directory**: Use `git rev-parse --git-dir` instead of assuming `.git/hooks/` (supports worktrees and bare repos)
|
||||
- **mkdir -p hooks**: Ensure hooks directory exists before symlinking
|
||||
|
||||
### 4. Tests added (`tests/test_status.py`)
|
||||
- `TestInferStateFromArtifacts`: 4 tests verifying heuristic correctness (spec→research, impl→bug_find, bug_report→adversarial_bug_find, spec+decomp→decomposition)
|
||||
- `TestValidateFolderCorruptedState`: 2 tests verifying empty/whitespace .state files produce errors
|
||||
|
||||
## Test Results
|
||||
All 206 tests pass (6 new tests, 200 existing).
|
||||
@@ -1,44 +0,0 @@
|
||||
# Pre-existing Fixes
|
||||
|
||||
## Goal
|
||||
Fix 4 pre-existing issues in the enforcement layer.
|
||||
|
||||
## Issues
|
||||
|
||||
### 1. `_infer_state_from_artifacts` heuristic bug
|
||||
**File**: `scripts/status.py` lines 306-309
|
||||
**Problem**: `if "SPEC.md" in artifacts and "BUG_REPORT.md" not in artifacts: return "bug_find"` — this is wrong. Having SPEC.md without BUG_REPORT.md could mean the task is in research, design, implement, etc. This condition is reached after line 304 checks for both SPEC+BUG_REPORT → adversarial_bug_find, so it only fires when BUG_REPORT.md is missing. But that's most tasks! The correct behavior is that SPEC.md alone should map to `research` (which line 318-319 already does).
|
||||
**Fix**: Remove lines 306-309 (the SPEC+no BUG_REPORT case). Also fix line 311 `IMPLEMENTATION.md` → `bug_find` — semantically, having only IMPLEMENTATION.md should map to `implement` completion, not `bug_find`. But since bug_find comes after implement, mapping to implement is wrong too. The safest fix: remove lines 308-311 so SPEC.md alone → research, IMPLEMENTATION alone → implement.
|
||||
|
||||
### 2. `cmd_validate_folder` unnecessary fallback after `.state` exists
|
||||
**File**: `scripts/status.py` lines 563-566
|
||||
**Problem**: After confirming `.state` exists (line 548-556 handles the no-state case), lines 563-566 fall back to `_infer_state_from_artifacts` if `_read_state` returns None. But if `.state` exists and `_read_state` returns None, that's a corrupted `.state` file — not something to silently paper over.
|
||||
**Fix**: After confirming `.state` exists, if `_read_state` returns None, error out instead of falling back to inference.
|
||||
|
||||
### 3. `upgrade.sh` silently swallows `status.py --upgrade` failures
|
||||
**File**: `scripts/upgrade.sh` line 26
|
||||
**Problem**: `python3 "$STATUS_SCRIPT" --upgrade --project "$PROJECT_DIR" || true` — the `|| true` means failures are silently swallowed. With `set -euo pipefail`, this is even more dangerous because the script appears to succeed.
|
||||
**Fix**: Remove `|| true`. If the upgrade fails, the script should fail. Add a clear error message.
|
||||
|
||||
### 4. `upgrade.sh` doesn't verify python3 is available
|
||||
**File**: `scripts/upgrade.sh`
|
||||
**Problem**: The script runs `python3` without checking it's installed.
|
||||
**Fix**: Add a python3 availability check at the top of the script.
|
||||
|
||||
### 5. Pre-commit hook doesn't handle bare repos or worktrees
|
||||
**File**: `scripts/upgrade.sh` lines 60-62, `scripts/git-hooks/pre-commit` line 18
|
||||
**Problem**: `upgrade.sh` checks for `.git/hooks/` directory, and the pre-commit hook uses `git rev-parse --show-toplevel`. In bare repos, `.git/` doesn't exist as a directory. In worktrees, `.git` is a file, not a directory.
|
||||
**Fix**:
|
||||
- `upgrade.sh`: Use `git rev-parse --git-dir` to find the hooks directory instead of assuming `.git/hooks/`
|
||||
- `pre-commit`: Already uses `git rev-parse --show-toplevel` which works for worktrees. No change needed there.
|
||||
- `upgrade.sh`: Use `git rev-parse --git-dir` to reliably find hooks dir
|
||||
|
||||
## Acceptance Criteria
|
||||
- [ ] `_infer_state_from_artifacts` no longer returns `bug_find` for SPEC-only tasks
|
||||
- [ ] `_infer_state_from_artifacts` no longer returns `bug_find` for IMPLEMENTATION-only tasks
|
||||
- [ ] `cmd_validate_folder` errors on corrupted `.state` files instead of falling back
|
||||
- [ ] `upgrade.sh` fails loudly when `status.py --upgrade` fails
|
||||
- [ ] `upgrade.sh` checks python3 is available before proceeding
|
||||
- [ ] `upgrade.sh` uses `git rev-parse --git-dir` for hooks directory
|
||||
- [ ] All 200+ existing tests pass
|
||||
- [ ] New tests for each fix
|
||||
@@ -1,19 +0,0 @@
|
||||
# Verdict: pre-existing-fixes
|
||||
|
||||
## Status: PASS
|
||||
**Completion Date**: 2026-06-15
|
||||
|
||||
## Summary
|
||||
Fixed 4 pre-existing issues:
|
||||
1. `_infer_state_from_artifacts` heuristic: SPEC-only now correctly returns `research` instead of `bug_find`; IMPLEMENTATION-only returns `bug_find` (implement done → next phase)
|
||||
2. `cmd_validate_folder`: corrupted `.state` files now error instead of silently falling back to artifact inference
|
||||
3. `upgrade.sh`: removed `|| true` so upgrade failures are visible; added python3 availability check; uses `git rev-parse --git-dir` for hooks directory (supports worktrees)
|
||||
4. 6 new tests covering all fixes
|
||||
|
||||
## Findings
|
||||
- All 206 tests pass
|
||||
- No regressions introduced
|
||||
- Heuristic fix aligns with existing `TestStateMachineAlignment` tests
|
||||
|
||||
## Score
|
||||
+10
|
||||
Reference in New Issue
Block a user