picteach 0.1.0

Explainable acceptance policies, tolerance rules, and composable decisions
Documentation
  • Coverage
  • 100%
    31 out of 31 items documented1 out of 24 items with examples
  • Size
  • Source code size: 20.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 269.2 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1s Average build duration of successful builds.
  • all releases: 1s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • hidenoriuehara-art

picteach

picteach is a dependency-free Rust library for expressing the logic of acceptance: what is allowed, how much deviation is tolerated, how rules combine, and why a value was accepted or rejected.

use picteach::Policy;

let temperature = Policy::inclusive_range("comfortable", 18.0, 26.0)?;
let near_target = Policy::absolute_tolerance("near 22°C", 22.0, 0.5)?;
let acceptable = Policy::any("room temperature", [temperature, near_target])?;

let decision = acceptable.evaluate(&25.0);
assert!(decision.is_accepted());
assert_eq!(decision.children().len(), 2);
# Ok::<(), picteach::Error>(())

Principles

  • Acceptance is a named policy, not an unexplained boolean.
  • Every evaluation produces a human-readable decision tree.
  • all, any, and not preserve child results for audits and user feedback.
  • Inclusive and exclusive ranges make boundary behavior explicit.
  • Absolute tolerance includes its boundary and rejects non-finite observations.
  • Relative tolerance supports an absolute floor for values near zero.
  • Custom predicates can provide fixed or value-specific explanations.
  • Policies are cloneable, thread-safe, and dependency-free.

Licensed under MIT.