Skip to content

security(core,llm): enforce unsafe_code deny and deterministic vault serialization#909

Merged
bug-ops merged 5 commits intomainfrom
feat/858-supply-chain
Feb 25, 2026
Merged

security(core,llm): enforce unsafe_code deny and deterministic vault serialization#909
bug-ops merged 5 commits intomainfrom
feat/858-supply-chain

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 25, 2026

Closes #858, closes #867, closes #876.

Summary

  • Add [workspace.lints.rust] unsafe_code = "deny" to root Cargo.toml; future contributors cannot introduce unsafe blocks without an explicit #[allow(unsafe_code)]
  • Annotate unavoidable unsafe blocks with #[allow(unsafe_code)]: candle mmap (VarBuilder::from_mmaped_safetensors) and std::env::set_var/remove_var in tests (Rust 2024 edition)
  • Replace HashMap with BTreeMap in AgeVaultProvider and all related private functions; serialized JSON now has deterministic key order, eliminating spurious vault file churn

Test plan

  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace -- -D warnings — clean
  • cargo nextest run --workspace --lib --bins — 2757 passed

…serialization (#858)

- Add [workspace.lints.rust] unsafe_code = "deny" to root Cargo.toml (#867)
- Annotate unavoidable unsafe blocks (candle mmap, std::env in tests) with #[allow(unsafe_code)]
- Replace HashMap with BTreeMap in AgeVaultProvider to eliminate non-deterministic JSON key ordering in vault.save() (#876)
@github-actions github-actions bot added documentation Improvements or additions to documentation size/S llm LLM provider related rust core tests dependencies labels Feb 25, 2026
…hanges

- docs/src/reference/security.md: document workspace-level unsafe_code = "deny" and BTreeMap in AgeVaultProvider
- README.md: add Security section noting workspace-wide unsafe_code deny policy
- crates/zeph-core/README.md: update vault module description with BTreeMap and deterministic serialization
@github-actions github-actions bot added size/M and removed size/S labels Feb 25, 2026
- Resolve modify/delete conflict: bootstrap.rs refactored into bootstrap/ module (#906)
- Resolve content conflict: main.rs tests extracted to src/tests.rs (#906)
- Apply #[allow(unsafe_code)] to std::env tests in bootstrap/tests.rs and src/commands/vault.rs
- Add 4 BTreeMap coverage tests to vault.rs (deterministic order, save/load roundtrip, into_iter regression)
@bug-ops bug-ops enabled auto-merge (squash) February 25, 2026 21:03
@bug-ops bug-ops merged commit 28d50bf into main Feb 25, 2026
28 checks passed
@bug-ops bug-ops deleted the feat/858-supply-chain branch February 25, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core dependencies documentation Improvements or additions to documentation llm LLM provider related rust size/M tests

Projects

None yet

1 participant