Dependency policy
ayaml keeps its runtime dependency graph small and does not delegate YAML parsing to another parser.
Runtime dependencies
Section titled “Runtime dependencies”| Crate | Role |
|---|---|
serde |
Serde traits and data model; the ecosystem contract. |
indexmap |
Insertion-ordered map used by Mapping. |
No third-party YAML parser, scanner, composer, or native YAML library is in the normal dependency graph.
The fuzz workspace, which isn’t published, also uses serde_json, at the version the tests use:
its allocation counter decodes into a JSON tree to budget what a consumer of JSON allocates.
Unsafe code policy
Section titled “Unsafe code policy”- The crates in this workspace forbid
unsafecode. Only the fuzz workspace, which isn’t published, has any: the counting allocator infuzz/src/bin/memcount.rs. - The YAML-specific parser and composer code is written in safe Rust and does not use FFI.
serdeandindexmapcontain reviewed implementations with internalunsafe, as doserde_coreandhashbrown, which they bring in. All four are allowlisted runtime dependencies.- A new dependency with unsafe code requires a measured need, a safety review, and an explicit policy update.
- CI runs an unsafe census with
cargo-geiger, andtools/check_unsafe_census.pyholds the allowlist. It fails if ayaml has any unsafe code or stops forbidding it, or if any other crate in the census has unsafe code. - Dev-only property-test, fuzzing, allocation, and benchmark dependencies are not part of the shipped graph.
cargo tree -p ayaml -e normal,build --all-features is the shipped graph.
tools/check_deps.py reads it, and any crate not on its allowlists fails, including
a YAML parser.
Scanner boundary
Section titled “Scanner boundary”The scanner stays independent of third-party crates as well as of the value
layer. It may use core, alloc, std, self, super, and only the
crate-local error, event, limits, position, span, and tag modules
(plus the scanner’s own line and scalars submodules). tools/check_deps.py
reads the scanner sources and fails on any other import, including a new
third-party crate or an unapproved crate module.
Build and test dependencies
Section titled “Build and test dependencies”The repository uses dev-only crates for conformance, property testing, fuzzing, allocation measurement, and benchmarks. These are not reachable from the normal runtime graph.
Minimum supported Rust version
Section titled “Minimum supported Rust version”The MSRV is Rust 1.88. CI checks the locked dependency graph, not only the
direct crate metadata, because a transitive dependency can raise the effective
floor. In 1.x, raising the MSRV requires a minor version bump and an explicit
release note.