docs: Add clause to import policy section
What changed, and why it matters
This commit only adds a documentation clause to the project's policy file. It explains that code should use re-exported types from the highest-level crate available rather than importing directly from lower-level crates. There is no code change, no security fix, and no functional impact.
No security action needed. This is a documentation-only policy update.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff appends a new subsection ‘Usage of re-exports’ to docs/policy.md. It states that, to mirror the units, primitives, and bitcoin APIs, the project prefers use crate::Foo over units::Foo, and that this is enforced by CI. No Rust source files were modified.
Changed components
docs/policy.mdInspect captured patch +7 / −0
diff --git a/docs/policy.md b/docs/policy.md
index 10ad87b0..6149d077 100644
--- a/docs/policy.md
+++ b/docs/policy.md
@@ -117,6 +117,13 @@ pub use units::{foo, FooBar};
pub use units::foo::SomeError;
```
+### Usage of re-exports
+
+As part of the attempt to mirror the `units` and `primitives`, and `bitcoin` APIs, in this codebase,
+policy is to use types from the highest crate available i.e `use crate::Foo` not `units::Foo`.
+
+This is enforced by CI.
+
## Return `Self`
Use `Self` as the return type instead of naming the type. When constructing the return value use
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.