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:
@@ -0,0 +1 @@
|
||||
complete
|
||||
@@ -0,0 +1,24 @@
|
||||
# Implementation: Clean Up Framework Cruft
|
||||
|
||||
## Summary
|
||||
- R1: Deleted `debug_root.py` (development diagnostic script at framework root)
|
||||
- R2: Removed stale `dashboard = ["inotify>=0.2"]` optional dependency from `pyproject.toml`
|
||||
- R3: Deleted empty `automaton/dashboard/ui/widgets/` directory
|
||||
- R4: Fixed `config.md` line 18: changed "via `free`" to "via `/proc/meminfo` or `sysctl`"
|
||||
- R5: Documented `scripts/dashboard.sh` convenience wrapper in `README.md` Dashboard section
|
||||
- R6: Fixed `_find_tasks_dir()` — removed tautological condition, changed return type to `Path`, updated callers
|
||||
- R7: Removed `sys.path.insert(0, ...)` hack from `__main__.py`
|
||||
|
||||
## Changes
|
||||
- Deleted: `debug_root.py`, `automaton/dashboard/ui/widgets/`
|
||||
- `pyproject.toml`: Removed `dashboard = ["inotify>=0.2"]`
|
||||
- `config.md`: Fixed RAM detection description
|
||||
- `README.md`: Added dashboard.sh convenience wrapper documentation
|
||||
- `automaton/dashboard/ui/app.py`: `_find_tasks_dir()` now returns `Path` (not `Path | None`), removed tautology
|
||||
- `automaton/dashboard/__main__.py`: Removed `sys.path.insert` hack
|
||||
|
||||
## Test Results
|
||||
134 passed in 0.08s
|
||||
|
||||
## Blockers
|
||||
None
|
||||
@@ -0,0 +1,4 @@
|
||||
# Review
|
||||
- **Status**: approved
|
||||
- **Timestamp**: 2026-06-14T20:17:46.522196
|
||||
- **Comment**:
|
||||
@@ -0,0 +1,84 @@
|
||||
# Clean Up Framework Cruft
|
||||
|
||||
## Goal
|
||||
|
||||
Remove or fix a collection of small issues identified by both audits: stray files, stale dependencies, empty directories, incorrect documentation, and unused wrapper scripts.
|
||||
|
||||
## Requirements
|
||||
|
||||
### R1. Delete or relocate `debug_root.py`
|
||||
|
||||
`debug_root.py` (9 lines) is a development diagnostic script at the framework root. It doesn't belong there.
|
||||
|
||||
**Fix**: Delete it. The functionality is covered by `find_automaton_root` tests and the dashboard scope endpoint.
|
||||
|
||||
### R2. Drop stale `inotify` extra from `pyproject.toml`
|
||||
|
||||
`pyproject.toml:13` declares `dashboard = ["inotify>=0.2"]` but the file-system watcher was removed in `remove-file-system-watcher` task. Zero references to `inotify` exist anywhere in `automaton/` source or in `automaton/dashboard/README.md`.
|
||||
|
||||
**Fix**: Remove the `dashboard` optional dependency group from `pyproject.toml`. Also remove the `inotify` mention from `test_additive_extension_model/SPEC.md` if present.
|
||||
|
||||
### R3. Delete empty `ui/widgets/` directory
|
||||
|
||||
`automaton/dashboard/ui/widgets/` is an empty directory with no `__init__.py` and no purpose. It was likely intended for future widget components that were never built.
|
||||
|
||||
**Fix**: Delete the directory.
|
||||
|
||||
### R4. Fix `config.md` system requirements claim
|
||||
|
||||
`config.md:58-61` says RAM detection uses `free`. The actual code (`vram_detect.py:137-162`) reads `/proc/meminfo` and `sysctl hw.memsize` — it never calls `free`.
|
||||
|
||||
**Fix**: Update `config.md:60` from:
|
||||
```
|
||||
- **/proc/meminfo**: Required for RAM detection (Linux)
|
||||
```
|
||||
to include macOS and remove the `free` claim:
|
||||
```
|
||||
- **/proc/meminfo**: Required for RAM detection (Linux)
|
||||
- **sysctl**: Used for RAM detection on macOS
|
||||
```
|
||||
|
||||
### R5. Document or delete `scripts/dashboard.sh`
|
||||
|
||||
`scripts/dashboard.sh` (11 lines) wraps `python -m automaton.dashboard`. It works correctly but is not documented in README or dashboard README.
|
||||
|
||||
**Fix**: Keep the script (it's a valid convenience wrapper) and document it in `README.md` under the Dashboard section. Add: `Or run the convenience wrapper: bash ~/.automaton/scripts/dashboard.sh`
|
||||
|
||||
### R6. Fix `_find_tasks_dir` return type
|
||||
|
||||
`ui/app.py:107-109`:
|
||||
```python
|
||||
def _find_tasks_dir(project_root: Path) -> Path | None:
|
||||
tasks_dir = project_root / ".automaton" / "tasks"
|
||||
return tasks_dir if tasks_dir.exists() else tasks_dir
|
||||
```
|
||||
The logic `return tasks_dir if tasks_dir.exists() else tasks_dir` is tautological (returns `tasks_dir` either way). The type hint says `Path | None` but actually always returns `Path`.
|
||||
|
||||
**Fix**: Change to `return tasks_dir if tasks_dir.exists() else None` or simplify since callers already handle missing dirs. Simplest fix: remove the condition and just `return tasks_dir`. `discover_tasks()` already returns `[]` for non-existent dirs and callers check `if tasks_dir`.
|
||||
|
||||
### R7. Fix `__main__.py:19` sys.path hack
|
||||
|
||||
```python
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent.parent))
|
||||
```
|
||||
This points to `/.automaton` which is already the package root. It does nothing when run via `python -m automaton.dashboard` from inside the framework directory. It may cause issues if `~/.automaton` is not the working directory and isn't on `PYTHONPATH`.
|
||||
|
||||
**Fix**: Remove the `sys.path` manipulation. When installed properly, the package is already importable.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- [ ] `debug_root.py` deleted
|
||||
- [ ] `pyproject.toml` no longer contains `dashboard = ["inotify>=0.2"]`
|
||||
- [ ] `automaton/dashboard/ui/widgets/` directory deleted
|
||||
- [ ] `config.md` line 60 updated to `sysctl` for macOS, no mention of `free`
|
||||
- [ ] `scripts/dashboard.sh` documented in `README.md` Dashboard section
|
||||
- [ ] `_find_tasks_dir()` simplified to `return tasks_dir` with updated docstring/type hint
|
||||
- [ ] `__main__.py:19` line removed
|
||||
- [ ] `python -m pytest tests/` still passes (72/72)
|
||||
- [ ] `python -m py_compile automaton/dashboard/*.py automaton/dashboard/core/*.py automaton/dashboard/ui/*.py` clean
|
||||
- [ ] `python -m automaton.dashboard` starts correctly after __main__.py fix
|
||||
|
||||
## Non-Goals
|
||||
|
||||
- Not reformatting or restructuring files beyond the listed changes
|
||||
- Not adding new tests (existing coverage is sufficient for these mechanical changes)
|
||||
@@ -0,0 +1,21 @@
|
||||
# Verdict: cleanup-cruft
|
||||
|
||||
## Status: PASS
|
||||
**Completion Date**: 2026-06-14
|
||||
|
||||
## Summary
|
||||
Removed 7 pieces of framework cruft: stray debug_root.py, stale inotify dependency, empty widgets directory, incorrect RAM detection docs, undocumented dashboard.sh wrapper, tautological _find_tasks_dir logic, and unnecessary sys.path hack.
|
||||
|
||||
## Findings
|
||||
- All 134 tests pass
|
||||
- debug_root.py removed (functionality covered by tests and dashboard scope endpoint)
|
||||
- inotify dependency removed (filesystem watcher was already deleted in earlier task)
|
||||
- _find_tasks_dir now returns Path instead of Path | None, callers updated
|
||||
- __main__.py works correctly without sys.path hack when run via python -m
|
||||
- config.md now accurately describes RAM detection methods
|
||||
|
||||
## Tasks for Review / Tie-Breaks
|
||||
- None
|
||||
|
||||
## Score
|
||||
+10
|
||||
Reference in New Issue
Block a user