Skip to content

feat(ox-core): add project root trust store for hooks and commands - #986

Open
hakula139 wants to merge 1 commit into
mainfrom
feat/project-trust
Open

hakula139 wants to merge 1 commit into
mainfrom
feat/project-trust

Conversation

@hakula139

Copy link
Copy Markdown
Member

Summary

  • Add ox_core::trust (TrustStore, TrustDecision, TrustError, default_trust_file_path) with zero new external dependencies.
  • Persist canonicalized trusted project roots in $XDG_STATE_HOME/ox/trusted.toml (falling back to ~/.local/state/ox/trusted.toml, overridable via TrustStore::load) using atomic temporary-file writes and rename.
  • Provide TrustStore::gate_project and TrustStore::guard_project helpers so project-local hooks, plugins, and commands only load or execute for trusted project roots.
  • Document the storage location, trusted.toml format, and gating behavior in docs/reference/trust.md and link it in docs/README.md.

Test plan

  • nix develop -c run-hooks
  • nix develop -c cargo doc --no-deps
  • nix develop -c cargo llvm-cov --workspace --show-missing-lines (crates/ox-core/src/trust.rs: 85.14% line / 85.93% region coverage; workspace total: 94.53% line coverage)

Related

@hakula139 hakula139 self-assigned this Dec 1, 2026
@codecov

codecov Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.60584% with 23 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/ox-core/src/trust.rs 91.60% 23 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

Trust project roots before running their hooks and commands

1 participant