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§
- Component
Bytes - A component’s bytes, shared rather than copied.
- Component
Rule - Where a component-backed rule’s code is, and what it is configured with.
- Config
- A loaded, validated configuration.
- Load
Options - What a load needs beyond the config file, for a caller that has more to say than
loadcan carry. - Resolved
Rule - A rule reference, resolved, with the options it was configured with.
- Rule
Spec - A rule as the config declares it.
- Suppression
Policy - Policy for suppression directives: which shapes of valid directive a project accepts.
Enums§
- Config
Error - Why a configuration could not be loaded.
- Rule
Reference - What a rule reference in a
lanekeep.jsonnames.
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.