fix(anatomy): R5.4 drawings projection charges each drawing's fixed parts

This commit is contained in:
bchanot committed 2026-10-23 16:38:06 +02:00
1 parent 411e1058c0
commit c4e717da86
5 files changed
+193 -8

No files matched your search

+22 -1
View File
@@ -243,7 +243,7 @@ fn the_rule_fallback_refuses_what_the_tree_does_not_carry() {
// ---------------------------------------------------------------------------------------------
// Synthetic cases written by the TypeScript (`oracles/r5/review-synthetic.json`).
/// Cases the port refuses where the TypeScript wrote a file (declared in RUST.md §11.12).
/// Cases the port refuses where the TypeScript wrote a file (declared in RUST.md §11.10 and §11.14).
const DECLARED_REFUSALS: [&str; 1] = ["declared-emoji-in-a-cell"];
struct Rendered {
@@ -546,3 +546,24 @@ fn unnamed_triggers_repeating_a_long_view_name_are_refused_before_rendering() {
"{error}"
);
}
/// The drawings projection is an upper bound of what is written: on the equine draft, and on
/// a draft whose annotations are all gone, where only the drawings' fixed parts remain
/// (verifier R5.4 round 11: 477 bytes over before the per-drawing allowance).
#[test]
fn the_drawings_projection_bounds_what_is_written() {
use faunosteo_core::curation::draft::pipeline::review_drawings_bytes;
let written = |draft: &DraftResult, anomalies: &[Anomaly]| -> usize {
render_draft_artifacts(draft, anomalies)
.unwrap()
.iter()
.filter(|(name, _)| name.starts_with("review/"))
.map(|(_, text)| text.len())
.sum()
};
let (result, mut draft) = equine();
assert!(review_drawings_bytes(&draft).unwrap() >= written(&draft, &result.anomalies));
draft.document["annotations"] = Value::Array(Vec::new());
draft.baseline["annotations"] = Value::Array(Vec::new());
assert!(review_drawings_bytes(&draft).unwrap() >= written(&draft, &result.anomalies));
}