Skip to main content

Crate lanekeep_config

Crate lanekeep_config 

Source
Expand description

Configuration loading and canonicalized hashing for lanekeep.

Loads lanekeep.config.ts or lanekeep.json, resolves the rule graph, and derives the hashes feeding the cache key.

§How the config is read

A lanekeep.config.ts is a TypeScript module, so reading it means running it. A synthetic entry module imports the config’s default export into a global, and a second evaluation hands back JSON.stringify of the parts that are data.

Going through JSON rather than reaching into engine values is deliberate. It keeps every value crossing the boundary plainly serializable, it makes the whole extraction one testable string, and it sidesteps threading engine lifetimes through this crate.

The one thing it cannot carry is a function, and check is a function. So the extraction separately records whether each rule has a callable check and reduce. Without that, a rule whose handler was misspelled would load cleanly and silently never fire — the worst failure this tool can have, because it looks exactly like passing.

A lanekeep.json is not a program, and is read as what it is: src/json.rs parses, validates and resolves it in Rust, and only a rule reference naming a TypeScript rule reaches the sandbox — because that rule’s own declaration is the only place its id, query and card exist. The note above entry_source in this file records what that cost.

Structs§

ComponentBytes
A component’s bytes, shared rather than copied.
ComponentRule
Where a component-backed rule’s code is, and what it is configured with.
Config
A loaded, validated configuration.
LoadOptions
What a load needs beyond the config file, for a caller that has more to say than load can carry.
ResolvedRule
A rule reference, resolved, with the options it was configured with.
RuleSpec
A rule as the config declares it.
SuppressionPolicy
Policy for suppression directives: which shapes of valid directive a project accepts.

Enums§

ConfigError
Why a configuration could not be loaded.
RuleReference
What a rule reference in a lanekeep.json names.

Functions§

default_config_paths
Where a config file is expected, relative to a project root.
evaluate_into
Evaluate the config module into a sandbox, leaving the rule objects reachable.
hex
Render a hash the way it appears in diagnostics and cache paths.
load
Load and validate a configuration.
load_with
load, with everything a caller knows that the config file does not.
sandbox_for
Build a sandbox able to load configuration from a rules root.

Type Aliases§

Hash
A 32-byte content hash.