Skip to main content

Crate unslop

Crate unslop 

Source
Expand description

A deterministic linter for formulaic writing patterns with counts for each rule family.

The library performs no I/O and no clock reads. analyze is a pure function of (input, config, policy). The embedded policy package is the single rule source.

analyze returns an error for input shaped like a Rust source file. The test reads Rust shape only, so wrap code in a fenced block or pass the prose alone. See input::source_shape for thresholds and the full scope statement.

See also: ai-slop gates the prose a code repository ships, and slop-detector reads text someone sent you.

Re-exports§

pub use report::Coverage;
pub use report::Finding;
pub use report::Report;
pub use waiver::Approval;
pub use waiver::VerifyOutcome;
pub use waiver::Waiver;

Modules§

engine
Compiled matching engines: two global Aho-Corasick automatons split by case mode, and one multi-pattern DFA served through an overlapping forward-plus-reverse adapter. All engines compile once per process.
extract
One markdown parse via into_offset_iter(). The same walk builds prose regions, the section tree, the segmentation map, and structural stats. Event::Code and text inside CodeBlock are never prose.
input
Input contract: decoding, limits, BOM handling, and the raw-source guard. Fail-closed boundary.
policy
Policy package loading, validation, and digest.
render
The locally computed rendered view. No network, no external renderer: the comparison is derived from the same pulldown-cmark parse recorded in the extraction walk.
report
Output schema, deterministic ordering, escaping, and the emit-time span invariant. A mapping bug aborts the report with instrumentation_error.
rules
Rule evaluation beyond the word-set and regex-set engines: structural, ratio, and document-contract rules. One module per rule family that needs code beyond the shared engines.
skill
SKILL.md snapshot generation from the policy package. The snapshot carries the policy digest and the per-profile core-rule stances.
views
The norm view: one owned String plus a run-length (norm_range -> source_range) segment table resolved by binary search. Applied in order: NFC normalization, enumerated entity decoding, markdown escape resolution, default-ignorable (invisible) removal, soft break folding.
waiver
Approval records, waivers, the authority floor, and verify.

Structs§

Config
Deployment
Deployment configuration. All fields optional.
Limits

Enums§

AnalysisError
InputFormat
Profile
Stance
A resolved rule stance for one profile and field.
WaiverAuthority

Constants§

SCHEMA_VERSION
TOOL_VERSION

Functions§

analyze
Analyze one document without panicking on any input.
policy_digest
The sha256 digest of the canonicalized embedded policy package.
verify
Verify a payload against an approval record. now_unix is the caller’s clock reading as unix seconds.