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 +0,0 @@
complete
@@ -1,21 +0,0 @@
# Implementation: Framework Self-Consistency Tests
## Summary
- Added `tests/test_framework_self_consistency.py` with 17 tests across 7 test classes
- R1.A: `TestDeliveryPromptsHaveStopConditions` — verifies all delivery prompts have stop condition blocks
- R1.B: `TestNoHardcodedURLs` — checks for hardcoded IP URLs and localhost:port in prompts/contracts/templates
- R1.C/D: `TestRulesMdSections` — verifies .rules.md mandatory sections and self-improvement examples
- R1.E: `TestCanonicalTaskPaths` — asserts no deprecated `{project}/tasks/` paths in prompts
- R1.F: `TestPyprojectNoStaleExtras` — asserts no inotify reference in pyproject.toml
- R1.G: `TestDashboardCSSThemes` — verifies themable CSS variables have parity across :root and theme overrides
- R3: `TestVerdictParsingRegression` — 6 regression tests for the critical false-BLOCKED verdict bug
- R4: `TestCIWorkflowValidation` — verifies CI runs py_compile, pytest, and bash -n
## Changes
- `tests/test_framework_self_consistency.py`: New test file (17 tests)
## Test Results
151 passed in 0.10s (17 new self-consistency tests)
## Blockers
None
@@ -1,4 +0,0 @@
# Review
- **Status**: approved
- **Timestamp**: 2026-06-14T20:17:48.055171
- **Comment**:
@@ -1,85 +0,0 @@
# Framework Self-Consistency Tests
## Goal
Add automated tests that enforce the framework's own rules — verifying prompt consistency, stop condition presence, canonical paths, and state machine integrity. These tests lock in the fixes from prior tasks and prevent regression.
## Requirements
### R1. Add `tests/test_framework_self_consistency.py`
Create a new test file that performs compile-time checks on the framework itself:
**A. All delivery prompts have a stop condition block**
- Assert every `.md` file in `prompts/` that produces a deliverable artifact contains `## Stop Condition (MANDATORY)` or a documented equivalent
- Exclude `orchestrate.md` (not a delivery prompt), `compaction.md` (uses `COMPACTION_COMPLETE`), `adversarial_bug_find.md` (now has `CONTRACT_MET`), `workflow.md` (reference, not prompt)
**B. No hardcoded repository URLs in prompts/contracts/templates**
- Assert that prompt files don't contain the Gitea URL (`10.37.0.86:3003`) or any other hardcoded repo URL
- `install.sh` at line 13 is the only allowed location (the install script legitimately needs it)
**C. `.rules.md` contains all mandatory rule sections**
- Assert `.rules.md` mentions: Task-Driven Development, VRAM, Changelog, Session Discipline, Scope Confinement, Artifact Integrity
**D. `.rules.md` self-improvement rule has concrete examples**
- Assert the Self-Improvement section references at least one real failure mode
**E. Canonical task path used in all prompts**
- Assert all `{project}/.automaton/tasks/{task-name}/` paths match the canonical format
- Assert zero instances of `{project}/tasks/` (the deprecated location) — including concrete task names like `{project}/tasks/onboarding/`
**F. `pyproject.toml` has no stale extras**
- Assert `pyproject.toml` does not reference `inotify`
**G. Dashboard CSS theme variables are complete**
- Assert both `:root` and `[data-theme="light"]` sections contain the same set of CSS variable names
- This prevents the common bug where a variable is added to one theme but not the other
### R2. Add a minimal JS logic test
`dashboard.js` has 470 lines of untested UI logic. At minimum, test the pure functions:
- `getTaskDisplayGroup()` — review-based group advancement
- `getFilteredTasks()` — filter/sort behavior
- `STATE_ICONS` map completeness (matches `TaskState` values)
This can be done in Python by parsing the JS file and extracting the function logic, or by adding a small Node.js test with jsdom.
### R3. Add verdict parsing regression test
Create a dedicated test file `tests/test_parsing.py` (or extend `test_task.py`) with:
- PASS verdict mentioning FAIL → DONE (not BLOCKED) — the regression test for the critical bug
- PASS verdict mentioning NEEDS_REVIEW → DONE (not BLOCKED)
- Structured verdict with `## Status: PASS` → DONE
- Structured verdict with `## Status: FAIL` → BLOCKED
- Unstructured verdict with just "FAIL" → BLOCKED (fallback behavior)
- Verdict with no status line → RESEARCH (since no SPEC either) or BACKLOG
- IMPLEMENTATION.md alone → BUG_FIND (state machine alignment)
- Empty VERDICT.md → BLOCKED
### R4. CI configuration validation
Add a test that parses `.gitea/workflows/ci.yml` and asserts:
- It runs `py_compile` on all Python source directories
- It runs `pytest`
- It runs `bash -n` on shell scripts
This catches the case where a new directory is added but CI isn't updated.
## Acceptance Criteria
- [ ] `python -m pytest tests/test_framework_self_consistency.py -v` passes
- [ ] All delivery prompts have stop condition blocks (tested by R1.A)
- [ ] No hardcoded URLs in prompts (tested by R1.B)
- [ ] `.rules.md` contains all mandatory sections (tested by R1.C)
- [ ] Zero deprecated `{project}/tasks/` paths in prompts (tested by R1.E)
- [ ] `pyproject.toml` has no `inotify` reference (tested by R1.F)
- [ ] `tests/test_parsing.py` includes all regression cases from R3
- [ ] All existing tests still pass (72/72 minimum)
- [ ] CI workflow correctly includes all framework source directories (tested by R4)
## Non-Goals
- Not adding a linter/formatter (ruff/black) — framework policy doesn't require one
- Not adding mypy type checking
- Not changing the soft-enforcement philosophy — these tests verify prompts and docs, not runtime behavior
- Not testing the dashboard server integration (too heavy for unit tests)
@@ -1,19 +0,0 @@
# Verdict: framework-self-consistency-tests
## Status: PASS
**Completion Date**: 2026-06-14
## Summary
Added 17 automated self-consistency tests that enforce framework rules: stop condition presence in delivery prompts, no hardcoded URLs, mandatory .rules.md sections, canonical task paths, no stale dependencies, CSS theme variable parity, verdict parsing regression tests, and CI workflow validation.
## Findings
- All 151 tests pass (17 new)
- CSS theme parity test correctly identified 3 structural variables (radius-sm/md/lg) that don't need theme overrides — test was adjusted to exclude these
- Inotify dependency was already removed by cleanup-cruft task, test confirms it stays removed
- CI workflow covers py_compile, pytest, and bash -n — test confirms
## Tasks for Review / Tie-Breaks
- None
## Score
+10