Skip to main content

Crate allow_core

Crate allow_core 

Source
Expand description

Core data model for cargo-allow source-tree exception governance.

This crate defines the shared finding, policy-entry, selector, lifecycle, match-outcome, path-normalization, and stable fingerprint primitives used by the cargo-allow crate family. It does not scan source files, invoke Cargo, compile code, or execute repository artifacts.

Structs§

AllowConfig
AllowEntry
CargoAllowDiagnostic
Structured validation or execution detail.
CargoAllowError
The unified error type for the cargo-allow workspace.
CargoAllowErrorLocation
One-based source location attached to a parse or validation diagnostic.
Finding
LaneConfig
LastSeen
LedgerPosture
Orthogonal movement and posture delta for a ledger-state projection.
LedgerProvenance
Lifecycle
MatchOutcome
Requirements
Per-ledger requirements toggles. Defaults are intentionally strict on ownership/accountability (owner/reason/classification/lifecycle required) and on unsafe findings (unsafe_evidence_required: true) while ordinary evidence is advisory by default (evidence_required: false).
Selector
SimpleDate
Span
StructuralIdentity
WorkspaceConfig

Enums§

CappedReadError
Why a capped text read failed.
CargoAllowDiagnosticSeverity
Severity for a machine-readable diagnostic carried by a command error.
CargoAllowErrorKind
Structured kind for CargoAllowError, enabling programmatic consumers (CI tooling, sibling tools) to branch on error class instead of string-matching the rendered message.
FindingKind
LaneEnforcementMode
MatchStatus
NetPosture
Aggregate PR diff net posture for summary surfaces (diff.net_posture).
PostureDelta
Canonical posture quality delta for a retained ledger entry or finding.
PresenceMovement
Canonical presence movement for ledger entries and findings in a diff context.
WorkspaceMode
The supported workspace default check modes, mirroring the CLI --mode flag and the [workspace] default_mode policy field. A typo’d or unsupported value (e.g. "no_new") is rejected at validation time rather than silently treated as a string that never matches a real mode.

Constants§

GLOB_MATCH_MAX_STEPS
Maximum recursive match steps for one glob evaluation.
MAX_IDENTITY_FIELD_LEN
Maximum length (bytes) of any source-derived string field in a StructuralIdentity. Caps the DoS / noisy-diff surface from a scanned file with a megabyte-long identifier (#1919). Generous enough for realistic Rust paths/identifiers (e.g. deeply-qualified module paths), small enough that an artifact cannot be inflated by a single field.
POLICY_NAME
The only recognized policy name.
SOURCE_FILE_READ_MAX_BYTES
Maximum bytes cargo-allow will load from one source-tree text file.
STRUCTURAL_IDENTITY_SCHEMA_ID
SUPPORTED_SCHEMA_VERSION
Supported policy schema versions. "1" is accepted as a legacy alias.
SUPPORTED_SCHEMA_VERSION_ALIAS

Functions§

allow_entry_broad_scope
allow_entry_content_fingerprint
Deterministic content fingerprint of an allow entry’s full state, for mutation-receipt provenance (CARGO-ALLOW-SPEC-0008 “Mutation Receipt Envelope”). The v1 canonical serialization is length-prefixed and has a fixed field order, so it is independent of Rust’s Debug formatting and platform path separators — path, glob, and selector.glob are all slash-normalized before hashing, so semantically identical entries authored on Windows and Unix fingerprint identically. The SHA-256 digest is provenance evidence, not an identity or matching key.
effective_lane_posture_for_findings
finding_identity_key
glob_matches
glob_matches_str
json_escape
lane_enforcement_mode_for_kind
normalize_path
normalize_snippet
read_text_file_capped
Read a UTF-8 text file only when its size is within SOURCE_FILE_READ_MAX_BYTES.
read_text_file_capped_with_limit
Read a UTF-8 text file only when its size is within limit bytes.
source_tree_path_is_ignored
source_tree_path_matches_filter
source_tree_scope_has_wildcard
stable_hash_hex

Type Aliases§

CargoAllowResult