docs(fermata): known limits, config reference and READMEs say what the tests show

Known to fail holds only what known_limits.rs pins or Claude Code's docs state;
the multi-line quoted value gets its own limit test. configuration.md follows the
code (unknown fields, [enforcement] settings, marks, plain settings, verb classes)
and every TOML example of it is loaded by tests/docs_toml_examples.rs. Speed
numbers are measured with a release build. matrix.md notes the new refusals.
This commit is contained in:
2026-11-07 01:38:19 +01:00
parent d67ccdc039
commit 999ed6ba4e
8 changed files with 236 additions and 115 deletions
+41
View File
@@ -0,0 +1,41 @@
//! Every fenced TOML example of `docs/configuration.md` loads as a `.botsecrets`, with
//! unknown fields refused. A doc that shows a setting the code dropped fails here.
use dirigent_fermata::core::secrets::config::SecretsConfig;
fn toml_examples(doc: &str) -> Vec<String> {
let mut blocks = Vec::new();
let mut current: Option<String> = None;
for line in doc.lines() {
match (&mut current, line.trim_end()) {
(None, "```toml") => current = Some(String::new()),
(Some(_), "```") => blocks.extend(current.take()),
(Some(block), text) => {
block.push_str(text);
block.push('\n');
}
_ => {}
}
}
blocks
}
#[test]
fn every_toml_example_of_configuration_md_loads() {
let doc = include_str!("../docs/configuration.md");
let examples = toml_examples(doc);
assert!(examples.len() >= 10, "found only {} TOML examples", examples.len());
for example in &examples {
if let Err(error) = SecretsConfig::from_toml(example) {
panic!("this example of configuration.md does not load: {error}\n{example}");
}
}
}
/// The check has teeth: a removed setting is refused.
#[test]
fn a_removed_setting_does_not_load() {
for text in ["[enforcement]\nmode = \"strict\"\n", "[enforcement]\non_parse_error = \"mask-entire-file\"\n"] {
assert!(SecretsConfig::from_toml(text).is_err(), "{text}");
}
}
+10
View File
@@ -170,6 +170,16 @@ fn a_value_after_an_unclosed_quote_is_masked_in_every_spelling_tried() {
}
}
/// A closed quote that spans lines swallows the assignment inside it: the file's parser
/// reads one value, so `DB_PASSWORD` has no entry of its own, and a program that prints it
/// alone shows it. (The value stays masked while it appears inside the whole quoted text.)
#[test]
fn a_value_inside_a_quoted_value_that_spans_lines_is_not_masked_when_printed_alone() {
let p = project(&env_file("API_TOKEN=\"abc\nDB_PASSWORD=fake-swallowed-pass\nOTHER=x\"\n"));
let out = p.after_bash("fake-swallowed-pass");
assert!(out.contains("fake-swallowed-pass"), "{out}");
}
// ---------------------------------------------------------------------------
// Files fermata does not see, and values it cannot tell
// ---------------------------------------------------------------------------