Expand description
bootroom.toml schema + load-time validation.
This module is the single source of truth for the Phase-3 config
surface (Pitfall #5: schema drift). Every downstream consumer —
/api/config, bootroom check, the live-reload watcher, and the
Phase-4 scenario engine — projects from these types.
Pure: no I/O, no async, no panic on operator input. All errors
surface through LoadError with optional 1-based line/col
span coordinates suitable for UI underlining.
See .planning/phases/03-config-buttons-watcher/03-CONTEXT.md
decision D-01 for the canonical schema shape.
§Phase 4 extensions: load-time assertion validation
Two checks run at LoadedConfig::from_config time, after the
existing scenario cross-validation loop:
-
Assertions with
kind = "regex"have theirpatterncompiled by the Rustregexcrate. The supported regex feature subset is the intersection of Rustregexand ECMAScriptRegExp: no backreferences, no lookaround. Rust is the stricter engine — anything Rust accepts here will compile as a JSRegExpin the browser scenario engine. See 04-RESEARCH Pitfall #1 for the feature-intersection table. -
Every assertion’s
aftervalue must resolve to either the literal"any"(universal-buffer evaluation, Pitfall #5) OR a label that appears in THIS scenario’sactionsVec. A typo likeafter = "rebot"whenactions = ["reboot"]would silently never-match in the browser engine; rejecting at load surfaces the typo inbootroom checkinstead.
Structs§
- Action
- Assertion
- CliAction
- An ad-hoc Action introduced via
--action label=<bytes>on the CLI. - Config
- Root
bootroom.tomldocument. - Load
Error - Failure raised while parsing or validating a
bootroom.toml. - Loaded
Config - A fully-validated
bootroom.tomlready for projection to/api/config,bootroom check, the watcher, or the Phase-4 scenario engine. - Resolved
Action - One Action after byte-escape decoding and CLI-override merging.
- Scenario
Enums§
Functions§
- offset_
to_ line_ col - Convert a 0-based byte offset within
inputinto a 1-based (line, col) pair suitable forvim/codeeditor jump-to-line. - parse_
str - Parse a
bootroom.tomlstring into the rawConfigAST.