Skip to content

fix: harden security and improve performance across the codebase#27

Merged
johnny-emp merged 2 commits intomainfrom
feat/security-and-performance-fixes
Feb 13, 2026
Merged

fix: harden security and improve performance across the codebase#27
johnny-emp merged 2 commits intomainfrom
feat/security-and-performance-fixes

Conversation

@johnny-emp
Copy link
Contributor

Summary

  • SQL injection fixes: Parameterized queries in scheduler list_tasks, strict input validation in DLQ replayer ByErrorType, and SQL identifier validation in azoth-vector VectorSearch::new to prevent injection via table/column names.
  • Credential safety: IpfsProvider now redacts api_key and secret_key from Debug output to prevent accidental exposure in logs. Unsafe extension loading in azoth-vector is documented with safety requirements.
  • Performance improvements: Benchmark reads use read-only transactions; LMDB read pool uses exponential backoff instead of spin-wait; SQLite read pool uses round-robin connection selection to reduce contention; FileEventLog gains a configurable flush_on_append option for deferred flushing.
  • Documentation: Corrected preflight cache eviction docs (FIFO, not LRU); added comprehensive SyncMode durability docs; documented EventProcessor batch size recommendations; added a Performance Tuning section to AGENTS.md.

Files Changed (15)

Area Files Change
Security azoth-scheduler/src/projection.rs, azoth/src/dlq_replayer.rs, azoth-vector/src/search.rs, azoth-vector/src/extension.rs, azoth/src/ipfs.rs SQL injection fixes, credential redaction, unsafe docs
Performance azoth-lmdb/src/read_pool.rs, azoth-sqlite/src/read_pool.rs, azoth-file-log/src/store.rs, azoth/benches/basic_benchmark.rs Backoff, round-robin, deferred flush, read txn for benchmarks
Docs AGENTS.md, azoth-core/src/config/canonical.rs, azoth-lmdb/src/preflight_cache.rs, azoth/src/event_processor.rs SyncMode, cache eviction, batch sizing, tuning guide
Adapters azoth-vector/src/lib.rs, azoth-vector/tests/integration_test.rs Updated for VectorSearch::new returning Result

Test plan

  • cargo check --workspace passes
  • cargo clippy --workspace passes with no warnings
  • cargo test --workspace – all 183 tests pass
  • New tests: test_replay_priority_by_error_type_validation, test_identifier_validation_rejects_injection

Made with Cursor

@johnny-emp johnny-emp force-pushed the feat/security-and-performance-fixes branch from e238c4f to c72e266 Compare February 13, 2026 22:21
Security fixes:
- Fix SQL injection in scheduler list_tasks via parameterized queries
- Fix SQL injection in DLQ replayer ByErrorType with strict input validation
- Add SQL identifier validation in azoth-vector VectorSearch::new
- Document unsafe extension loading risks in azoth-vector
- Redact API credentials from IpfsProvider Debug output

Performance improvements:
- Use read-only transactions in benchmark read test
- Add exponential backoff to LMDB read pool blocking acquire
- Add round-robin connection selection to SQLite read pool
- Add configurable flush_on_append to FileEventLog for deferred flushing
- Document batch size recommendations for EventProcessor

Documentation:
- Correct preflight cache docs from LRU to FIFO eviction policy
- Add comprehensive SyncMode durability/performance docs
- Add Performance Tuning section to AGENTS.md

Co-authored-by: Cursor <cursoragent@cursor.com>
@johnny-emp johnny-emp force-pushed the feat/security-and-performance-fixes branch from c72e266 to ee8808d Compare February 13, 2026 22:22
@johnny-emp johnny-emp merged commit cc3986b into main Feb 13, 2026
8 checks passed
@johnny-emp johnny-emp deleted the feat/security-and-performance-fixes branch February 13, 2026 22:26
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