Skip to content

fix: v0.6.8 bug sweep — 14 fixes from second audit#36

Merged
alderpath merged 1 commit into
masterfrom
fix/v0.6.8-bug-sweep-2
Jun 22, 2026
Merged

fix: v0.6.8 bug sweep — 14 fixes from second audit#36
alderpath merged 1 commit into
masterfrom
fix/v0.6.8-bug-sweep-2

Conversation

@alderpath

Copy link
Copy Markdown
Contributor

Summary

Second-pass audit of v0.6.7 found 14 more bugs. This PR fixes all of them with regression tests.

Critical bugs (data safety / correctness)

# Bug Fix
25 scavenger.rs:91 std::fs::write (non-atomic) atomic_write (tmp + fsync + rename)
27 scavenger.rs:80 no file size guard 10MB check before read_to_string
29 ux.rs:403 wrong table name (file_phrases doesn't exist) SELECT COUNT(*) FROM file_map
10 heal.rs:63 hardcoded cargo test detect_test_command (cargo/pytest/npm/go)
12 antidecision extract_sed_target captures sed pattern not file rewrite + looks_like_sed_pattern filter

High priority

# Bug Fix
11 antidecision.rs 25-item hardcoded keyword ban structural heuristics (lowercase < 5 chars)
14 routes.rs contains('anthropic') false-positives paths parse URL host only
17 init.rs uninstall uses pi --version (hangs) PATH scan + file existence
19 No Claude Code 501 documentation README Troubleshooting section
20 config.rs default Reactive (docs say Strict) default = Strict

Code quality

# Bug Fix
15b 3 SQL PRAGMA corruptions (silent no-ops) fix mcp.rs:53, ux.rs:402, scavenger.rs:60
16 reindex.rs bitwise | instead of || ||
21 MAX_FILE_SIZE duplicated as const + literal daemon.rs pub const, proxy.rs uses it
28 antidecision.rs dead code (format_annotation, annotate_tool_result) deleted

Test coverage

10 new inline regression tests (heal test command, sed pattern detection, anthropic host check, default mode, MAX_FILE_SIZE, structural identifier extraction). Total: 267 tests passing.

CI verification

  • cargo build --release: clean
  • cargo clippy --all-targets -- -D warnings: clean
  • cargo test --release: 267 passed, 0 failed
  • Pre-commit hook: passed

Critical:
- scavenger.rs:91 atomic_write (was std::fs::write, crash = corruption)
- scavenger.rs:80 10MB size guard (OOM risk on large files)
- ux.rs:403 wrong table name (file_phrases -> file_map, status was always 0)
- heal.rs:63 detect_test_command (cargo/pytest/npm/go)
- antidecision.rs extract_sed_target rewrite (was capturing s/old/new/ pattern)

High:
- antidecision.rs grammar-free: 25-item keyword ban -> structural heuristics
- routes.rs normalize_url: host-only anthropic check
- init.rs uninstall: file-based Pi detection, no pi --version
- README: document Claude Code 501 limitation
- config.rs:122 default Strict (was Reactive, matches docs)

Cleanup:
- 3 SQL PRAGMA corruptions: mcp.rs:53, ux.rs:402, scavenger.rs:60
- reindex.rs:118 bitwise | -> ||
- daemon.rs MAX_FILE_SIZE pub const, proxy.rs uses shared
- antidecision.rs: delete dead code (format_annotation, annotate_tool_result)

Tests: 267 passing (was 178, added 10 inline regression tests)
@alderpath
alderpath merged commit fd5be85 into master Jun 22, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant