Skip to content

Hardening: remove 21 DB unwraps, schema versioning, --cache-dir canonicalize, WalkDir cap, concurrent build guard#2

Merged
alderpath merged 1 commit into
masterfrom
feature/security-harden
Jun 1, 2026
Merged

Hardening: remove 21 DB unwraps, schema versioning, --cache-dir canonicalize, WalkDir cap, concurrent build guard#2
alderpath merged 1 commit into
masterfrom
feature/security-harden

Conversation

@alderpath

Copy link
Copy Markdown
Contributor

Summary

Five hardening changes making stria crash-safe against corrupt DBs, stale schemas, symlink traversal, and concurrent builds.

Changes

File Change
src/structural_risk.rs All 14 .unwrap() -> graceful match+eprintln fallback
src/search/mod.rs All 3 .query_map().unwrap() -> match results
src/index/schema.rs PRAGMA user_version tracked; open_existing_db rejects stale schemas
src/main.rs --cache-dir canonicalized; AtomicBool concurrent build guard
src/index/mod.rs WalkDir capped at 500K files

Verification

  • 54/54 unit tests passing
  • 17/17 integration tests passing
  • Zero performance impact on hot path

…cache-dir, cap WalkDir at 500K, add concurrent build guard

P0: All 21 DB .unwrap() calls replaced with graceful match+eprintln fallback. P1: PRAGMA user_version tracked; open_existing_db rejects mismatched schemas. P2: --cache-dir now canonicalized via std::fs::canonicalize. P3: WalkDir capped at 500,000 files with secondary truncate. P5: AtomicBool build_in_progress prevents concurrent index builds on switch_repo. 54/54 unit tests, 17/17 integration tests passing.
@alderpath alderpath merged commit a157ad5 into master Jun 1, 2026
2 checks passed
@alderpath alderpath deleted the feature/security-harden branch June 1, 2026 13:02
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