Archive completed tasks, add cleanup commands, self-documenting dashboard UI
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:
Lap Tran
2026-06-24 22:43:33 -04:00
parent e13513faaa
commit 4a2301b077
572 changed files with 856 additions and 101 deletions
-1
View File
@@ -1 +0,0 @@
complete
@@ -1,2 +0,0 @@
research:approved|2026-06-22T13:56:13.904635+00:00|user
code_review:approved|2026-06-22T14:06:37.059516+00:00|user
@@ -1,19 +0,0 @@
# Adversarial Bug Report: fix-can-edit-path-prefix
## Summary
Adversarial review of the path prefix fix. No additional bugs found.
## Bugs Found
No bugs found.
## Analysis
- **Security — symlink bypass**: `Path(args.file).resolve()` resolves symlinks before comparison, so a symlink inside the project pointing outside would be resolved to the real path and correctly rejected. Good.
- **Trailing slash**: The `== proj_str` clause handles the edge case where `file_path` is exactly the project directory. `Path.resolve()` strips trailing slashes, so this is robust.
- **Case sensitivity**: On macOS (default filesystem is case-insensitive), `Path.resolve()` does not normalize case. A file at `/Users/user/Project/file.py` would not match project `/Users/user/project`. This is consistent with the original behavior and not a regression.
- **Framework vs project**: The fix applies `os.sep` to both `proj_str` and `auto_str` checks — consistent across all 5 locations.
- **Empty file path**: `args.file` is required by argparse for `--can-edit --file` and `--scope-check`, so empty paths are not reachable.
## Score
0
ADVERSARIAL_BUG_FIND_COMPLETE
@@ -1,16 +0,0 @@
# Bug Report: fix-can-edit-path-prefix
## Summary
The fix correctly prevents sibling-directory bypass at all 5 locations in status.py.
## Bugs Found
No bugs found.
## Verification
- `str(file_path).startswith(proj_str + os.sep) or str(file_path) == proj_str` correctly handles both files inside the directory and the directory itself.
- All 5 locations use the same consistent pattern.
- `Path.resolve()` is called on `file_path`, so symlinks are resolved before comparison.
- 3 tests pass: sibling-rejection, subdirectory-acceptance, can-edit-task.
## Score
0
@@ -1,15 +0,0 @@
# Code Review: fix-can-edit-path-prefix
## Summary
Fixes path prefix matching at 5 locations to prevent sibling-directory bypass.
## Findings
- **Correctness**: `str(file_path).startswith(proj_str + os.sep) or str(file_path) == proj_str` correctly handles both files inside the directory and the directory itself. The `os.sep` ensures the boundary is a path separator, preventing `/home/user/project-evil` from matching `/home/user/project`.
- **Consistency**: All 5 locations use the same pattern — good.
- **Edge cases**:
- A file exactly at `proj_str` (the project root itself) is handled by the `== proj_str` clause.
- Symlinks: `Path.resolve()` is called on `file_path`, so symlinks are resolved before comparison. This is correct.
- **Tests**: 3 tests cover the sibling-rejection, subdirectory-acceptance, and can-edit-task scenarios.
## Verdict
APPROVED — no issues found.
@@ -1,12 +0,0 @@
# Doc Review: fix-can-edit-path-prefix
## Summary
No documentation updates needed. The `--can-edit` and `--scope-check` commands' external behavior is unchanged — only the internal path comparison logic was fixed.
## Findings
- README.md, AGENTS.md, and contracts/harness-integration.md document `--can-edit` and `--scope-check` usage but not the internal path comparison implementation.
- The fix does not change any command-line interface, output format, or exit code.
- No user-facing behavior change for valid use cases (only invalid sibling-directory bypass is now correctly rejected).
## Verdict
No doc changes required.
@@ -1,12 +0,0 @@
# Implementation: fix-can-edit-path-prefix
## Changes
- **scripts/status.py** `cmd_can_edit()` (5 locations): Replaced `str(file_path).startswith(proj_str)` with `str(file_path).startswith(proj_str + os.sep) or str(file_path) == proj_str` to prevent sibling-directory bypass. Same fix applied to `auto_str` (framework directory) checks.
- Line ~986: `--can-edit --project --file` scope check
- Line ~1039: `--can-edit --task --file` framework case
- Line ~1045: `--can-edit --task --file` regular project case
- Line ~1082: `--scope-check` project check
- Line ~1087: `--scope-check` framework check
## Test
- `tests/test_status.py::TestCanEditPathPrefix` — 3 tests: sibling directory rejected by scope-check, subdirectory accepted by scope-check, sibling directory rejected by can-edit --task --file.
-30
View File
@@ -1,30 +0,0 @@
# Spec: fix-can-edit-path-prefix
## Problem
`--can-edit` and `--scope-check` in `scripts/status.py` use `str(file_path).startswith(proj_str)` to verify a file is within the project directory. String `startswith` matches sibling directories: `/home/user/project-evil/file.py` matches prefix `/home/user/project`. This allows editing files outside the project boundary.
Affected locations:
- `scripts/status.py:951` (`--can-edit --project --file`)
- `scripts/status.py:1004` (`--can-edit --task --file`, framework case)
- `scripts/status.py:1010` (`--can-edit --task --file`, regular project case)
- `scripts/status.py:1047` (`--scope-check`)
- `scripts/status.py:1052` (`--scope-check`, framework check)
## Fix
Append a trailing path separator to the prefix before comparison:
```python
str(file_path).startswith(proj_str + os.sep)
```
Or use `Path.relative_to()` which correctly resolves path boundaries:
```python
try:
file_path.relative_to(project_dir.resolve())
except ValueError:
# out of scope
```
## Acceptance Criteria
- A file in `/home/user/project-evil/` is correctly rejected as out-of-scope when project is `/home/user/project`
- A file in `/home/user/project/subdir/` is correctly accepted as in-scope
- Both framework and regular project cases work
- Add a test in `tests/test_status.py` covering the sibling-directory edge case
-27
View File
@@ -1,27 +0,0 @@
# Verdict: fix-can-edit-path-prefix
## Status: PASS
**Completion Date**: 2026-06-22
## Summary
The fix correctly prevents sibling-directory bypass at all 5 locations in status.py. All tests pass.
## Findings
- `str(file_path).startswith(proj_str + os.sep) or str(file_path) == proj_str` correctly handles path boundaries.
- All 5 affected locations use the same consistent pattern.
- Bug Finder found no bugs. Adversarial Bug Finder confirmed no issues with symlinks, trailing slashes, or case sensitivity.
- No contradictions between the two reports.
- Test coverage added: `TestCanEditPathPrefix` (3 tests covering sibling rejection, subdirectory acceptance, and can-edit-task).
- All 242 tests pass.
## Tasks for Review / Tie-Breaks
None.
## Remaining Issues
None.
## Score
+10 (PASS)
## Reviewer Comments