Skip to content

fix: v0.6.7 bug sweep — 9 fixes from post-v0.6.6 audit#35

Open
alderpath wants to merge 1 commit into
masterfrom
fix/v0.6.7-bug-sweep
Open

fix: v0.6.7 bug sweep — 9 fixes from post-v0.6.6 audit#35
alderpath wants to merge 1 commit into
masterfrom
fix/v0.6.7-bug-sweep

Conversation

@alderpath

Copy link
Copy Markdown
Contributor

Summary

Audited the v0.6.6 merge and found 9 bugs ranging from a critical SQL bug to documentation mismatches. This PR fixes all 9 with regression tests.

Bugs fixed

# Severity Bug
1 High load_dictionary() SQL had no LIMIT, returning entire phrases table
2 Medium GUARD_CACHE constants were declared but unused; magic numbers in eviction
3 Medium CACHE_FEEDBACK map grows unbounded with each new auth_key
4 Medium PER_KEY_STATE outer map grows unbounded with each new auth_key
5 Medium Guard fires on prose mentions of 'edit' (false positives)
6 Medium Anti-decision env var mismatch: docs say ANTI_DISABLE, code reads FEATURE_ANTI
7 Low Cached responses lose x-reliaty-* headers
8 Low GATE_VERSION out of sync (0.6.5 vs workspace 0.6.6)
9 Low Anthropic /v1/messages silently mangled (wrong format handler)

Test coverage

7 new regression tests in crates/reliary-agent/tests/regression_v067.rs. Total test count: 178 (was 171).

CI verification

  • cargo build --release: clean
  • cargo clippy --all-targets -- -D warnings: clean
  • cargo test --release: 178 passed, 0 failed
  • Pre-commit hook: passed (clippy, .ok() check, gitleaks, bans)

- SQL LIMIT 200 in load_dictionary (phrases_fts query was unbounded)
- GUARD_CACHE now uses GUARD_CACHE_TTL/GUARD_CACHE_MAX constants (was magic)
- CACHE_FEEDBACK outer map bounded at 32 entries (was unbounded)
- PER_KEY_STATE outer map bounded at 32 entries (was unbounded)
- Guard no longer fires on prose mentions of 'edit' — only tool_calls array
- Anti-decision env var compatibility: reads both FEATURE_ANTI and ANTI_DISABLE
- Response cache preserves x-reliaty-* headers on cache hits
- Anthropic /v1/messages returns 501 instead of silent mangling
- Synced embedded gate.js copy from canonical pi/gate.js
- Bumped GATE_VERSION to 0.6.7

Tests: 178 passing (7 new regression tests in regression_v067.rs)
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