Skip to main content

Crate solana_ratchet_core

Crate solana_ratchet_core 

Source
Expand description

Core IR and rule engine for ratchet.

This crate holds the framework-agnostic representation of a Solana program’s public surface — accounts, instructions, enums, PDAs — and the rule engine that diffs two versions of that surface and classifies each change as Severity::Additive, Severity::Unsafe, or Severity::Breaking.

Re-exports§

pub use diagnostics::Finding;
pub use diagnostics::Path;
pub use diagnostics::Report;
pub use diagnostics::Severity;
pub use engine::check;
pub use engine::default_rules;
pub use preflight::default_preflight_rules;
pub use preflight::preflight;
pub use preflight::PreflightRule;
pub use rule::CheckContext;
pub use rule::Rule;
pub use surface::AccountDef;
pub use surface::AccountInput;
pub use surface::ArgDef;
pub use surface::Discriminator;
pub use surface::EnumVariant;
pub use surface::EnumVariantFields;
pub use surface::ErrorDef;
pub use surface::EventDef;
pub use surface::FieldDef;
pub use surface::InstructionDef;
pub use surface::PdaSpec;
pub use surface::PrimitiveType;
pub use surface::ProgramSurface;
pub use surface::Seed;
pub use surface::TypeDef;
pub use surface::TypeRef;

Modules§

diagnostics
Findings, severity, and the aggregate report emitted by the rule engine.
engine
Top-level dispatch: run a set of rules over a pair of program surfaces and collect their findings into a Report.
preflight
Single-surface readiness check (“preflight”) — runs on one ProgramSurface and reports design patterns that make future upgrades harder or deployments riskier.
rule
The Rule trait and CheckContext that every check implements.
rules
The built-in rule set.
surface
Framework-agnostic IR of a Solana program’s public surface.