Second batch: fix ~12 more zero-assertion smoke tests across fire_test,
rpi_phased_phase_runner_test, rpi_phased_stream_test, rpi_phased_gates_test,
rpi_reliability_test, and rpi_phased_dashboard_test. Each test now
validates output content or state mutations.
Replace "should not panic" smoke tests with captureStdout + assertion
patterns across 11 test files. Each test now validates output content
rather than just verifying no crash occurs.
Files fixed: trace_test, feedback_loop_test, forge_helpers_test,
hooks_test, maturity_inject_test, plans_test, quickstart_test,
round5_test, rpi_status_test, task_sync_test, worktree_test
Wave 1 of ag-4ne (standards-first test quality architecture):
- Enrich standards/references/go.md with Test Conventions, Complexity Budget,
and Before Committing subsections (ag-4ne.13)
- Enrich standards/references/python.md with Test Conventions and Security
subsections (ag-4ne.15)
- Add canonical-source headers to .claude/rules/go.md and python.md while
keeping all existing content self-contained (pre-mortem amendment)
- Harden auto-extract quality filters: expand continuation prefixes 8→24,
raise word min 10→25, sentence min 1→2, add dedup check (ag-4ne.9)
- Add extractBodyAfterFrontmatter helper for dedup comparison
- Update and add tests for new thresholds and dedup behavior
Coverage improvements across 19 packages:
- 8 packages at 100%: formatter, provenance, resolver, safety, taxonomy, types, vibecheck, worker
- Near-ceiling (OS error paths only): config 99.3%, parser 99.5%, context 98.8%
- Consolidated extra test files back into main test files where appropriate
- Deleted 8 coverage-padding test files that used trivial assertions
- Added 7 new focused extra test files for behavioral edge cases
- classifyFlywheelStatus: nil metrics now returns "unknown" instead of
falsely reporting "compounding"
- Remove duplicate TestSessionClose_shortenPath (kept TestShortenPath)
- Extract hardcoded pattern lists to package-level vars with doc comments
for easier maintenance
- Escape bare "---" lines in learning content body to prevent YAML
multi-document parsing issues
writeAutoExtractedLearnings was writing every extracted decision and
knowledge item as a learning file with no content filtering, producing
28 junk files in a single day. Add qualifyAutoExtract() that rejects
fragments (<10 words), continuation-word starts, skill doc parrots,
and content lacking sentence-ending punctuation.
Also surfaces rejected count in SessionCloseResult and table output
so users can diagnose filtered items via --verbose.
Coverage was 78.8% vs 79.0% floor. Added behavioral tests for
trimField, parseListField, findingMatchesQuery, parseFindingFile,
applyFindingFreshness, and collectFindingsFromDir. Coverage now 79.1%.
Also adds missing v2.22.0 release notes.
Address 7 HIGH, 11 MEDIUM, and 5 LOW severity bugs found during
systematic audit of the ao CLI. All fixes use TDD — failing tests
written first, then fixes applied.
HIGH fixes:
- Signal handler goroutine leak in goals/measure.go (done channel pattern)
- Child process map lazy init race in goals/measure.go (eager init)
- Windows filelock unguarded type assertion panic (2 files, safe assertion)
- Pool chain event records wrong FromStatus (capture before mutation)
- Scanner error swallowed in storage/file.go (check scanner.Err())
- Stream parser 64KB alloc per read (reuse buffer)
- Context state race in classifyStreamResult (cache Err() result)
MEDIUM fixes:
- Unbounded stream buffer growth (1MB max line guard)
- Pipe close error silently discarded (log via VerbosePrintf)
- No-op cancel function on zero timeout (use context.WithCancel)
- Pool recordEvent missing Sync (add f.Sync())
- paginate nil vs empty slice inconsistency (always return empty slice)
- Worker pool panic causes deadlock (wrap fn in recover)
- Nil Source pointer in writeArtifact (nil guard)
- Negative/oversized weight parsing (clamp 1-10)
- Worktree context not deferred (use defer cancel())
- Merge conflict error silently discarded (acknowledge explicitly)
- Sandbox nil meta guard in team lifecycle validation
LOW fixes:
- Empty steer field accepted (skip if empty after trim)
- Dead runID parameter (use blank identifier)
- Nil file guard in writeStreamEvent
- Env var precedence documented in toolchain.go
- Windows filelock duplicate assertion (same fix as HIGH #2)
Epic: ag-6bc (8 issues, 1 wave, 8 parallel workers)