docs: Waste Audit 2026-04-13 — patterns, priorities, and metrics #606

Merged
Rockachopa merged 1 commits from perplexity/waste-audit-2026-04-13 into main 2026-04-13 07:31:40 +00:00

View File

@@ -0,0 +1,94 @@
# Waste Audit — 2026-04-13
Author: perplexity (automated review agent)
Scope: All Timmy Foundation repos, PRs from April 12-13 2026
## Purpose
This audit identifies recurring waste patterns across the foundation's recent PR activity. The goal is to focus agent and contributor effort on high-value work and stop repeating costly mistakes.
## Waste Patterns Identified
### 1. Merging Over "Request Changes" Reviews
**Severity: Critical**
the-door#23 (crisis detection and response system) was merged despite both Rockachopa and Perplexity requesting changes. The blockers included:
- Zero tests for code described as "the most important code in the foundation"
- Non-deterministic `random.choice` in safety-critical response selection
- False-positive risk on common words ("alone", "lost", "down", "tired")
- Early-return logic that loses lower-tier keyword matches
This is safety-critical code that scans for suicide and self-harm signals. Merging untested, non-deterministic code in this domain is the highest-risk misstep the foundation can make.
**Corrective action:** Enforce branch protection requiring at least 1 approval with no outstanding change requests before merge. No exceptions for safety-critical code.
### 2. Mega-PRs That Become Unmergeable
**Severity: High**
hermes-agent#307 accumulated 569 commits, 650 files changed, +75,361/-14,666 lines. It was closed without merge due to 10 conflicting files. The actual feature (profile-scoped cron) was then rescued into a smaller PR (#335).
This pattern wastes reviewer time, creates merge conflicts, and delays feature delivery.
**Corrective action:** PRs must stay under 500 lines changed. If a feature requires more, break it into stacked PRs. Branches older than 3 days without merge should be rebased or split.
### 3. Pervasive CI Failures Ignored
**Severity: High**
Nearly every PR reviewed in the last 24 hours has failing CI (smoke tests, sanity checks, accessibility audits). PRs are being merged despite red CI. This undermines the entire purpose of having CI.
**Corrective action:** CI must pass before merge. If CI is flaky or misconfigured, fix the CI — do not bypass it. The "Create merge commit (When checks succeed)" button exists for a reason.
### 4. Applying Fixes to Wrong Code Locations
**Severity: Medium**
the-beacon#96 fix #3 changed `G.totalClicks++` to `G.totalAutoClicks++` in `writeCode()` (the manual click handler) instead of `autoType()` (the auto-click handler). This inverts the tracking entirely. Rockachopa caught this in review.
This pattern suggests agents are pattern-matching on variable names rather than understanding call-site context.
**Corrective action:** Every bug fix PR must include the reasoning for WHY the fix is in that specific location. Include a before/after trace showing the bug is actually fixed.
### 5. Duplicated Effort Across Agents
**Severity: Medium**
the-testament#45 was closed with 7 conflicting files and replaced by a rescue PR #46. The original work was largely discarded. Multiple PRs across repos show similar patterns of rework: submit, get changes requested, close, resubmit.
**Corrective action:** Before opening a PR, check if another agent already has a branch touching the same files. Coordinate via issues, not competing PRs.
### 6. `wip:` Commit Prefixes Shipped to Main
**Severity: Low**
the-door#22 shipped 5 commits all prefixed `wip:` to main. This clutters git history and makes bisecting harder.
**Corrective action:** Squash or rewrite commit messages before merge. No `wip:` prefixes in main branch history.
## Priority Actions (Ranked)
1. **Immediately add tests to the-door crisis_detector.py and crisis_responder.py** — this code is live on main with zero test coverage and known false-positive issues
2. **Enable branch protection on all repos** — require 1 approval, no outstanding change requests, CI passing
3. **Fix CI across all repos** — smoke tests and sanity checks are failing everywhere; this must be the baseline
4. **Enforce PR size limits** — reject PRs over 500 lines changed at the CI level
5. **Require bug-fix reasoning** — every fix PR must explain why the change is at that specific location
## Metrics
| Metric | Value |
|--------|-------|
| Open PRs reviewed | 6 |
| PRs merged this run | 1 (the-testament#41) |
| PRs blocked | 2 (the-door#22, timmy-config#600) |
| Repos with failing CI | 3+ |
| PRs with zero test coverage | 4+ |
| Estimated rework hours from waste | 20-40h |
## Conclusion
The project is moving fast but bleeding quality. The biggest risk is untested code on main — one bad deploy of crisis_detector.py could cause real harm. The priority actions above are ranked by blast radius. Start at #1 and don't skip ahead.
---
*Generated by Perplexity review sweep, 2026-04-13