fix(anatomy): R5.4 records bounded in total, CHANGELOG tables projected before they are joined

This commit is contained in:
bchanot committed 2026-10-23 14:58:40 +02:00
1 parent 777c8000b8
commit 5880dfa959
9 files changed
+258 -6

No files matched your search

+27
View File
@@ -775,6 +775,33 @@ fn the_document_cannot_hold_more_values_than_the_bound() {
assert!(error.contains("more than 200000 values"), "{error}");
}
/// A rename or a remove records the whole item, before and after, with the change's texts:
/// the records are bounded in total (security gate R5.4 round 7: 400 renames of a
/// 5,000-child item asked for 4.3 GB). The equine changeset stays far below the bound.
#[test]
fn the_records_cannot_outgrow_their_bound() {
use faunosteo_core::curation::draft::apply::MAX_RECORDED_WEIGHT;
use faunosteo_core::curation::draft::records::record_weight;
let equine: usize = equine_draft().records.iter().map(record_weight).sum();
println!("equine records weigh {equine} units");
assert!(equine * 8 < MAX_RECORDED_WEIGHT, "{equine}");
let children: Vec<Value> = (0..5_000)
.map(|i| json!({ "id": format!("n{i}"), "name": { "fr": "a", "en": "a" } }))
.collect();
let value = json!({ "id": "many", "name": { "fr": "a", "en": "a" }, "children": children });
let mut ops = vec![json!({ "op": "add", "target": MOBILITY, "value": value })];
for round in 0..200 {
let (from, to) = if round % 2 == 0 {
("many", "other")
} else {
("other", "many")
};
ops.push(json!({ "op": "rename", "target": format!("{MOBILITY}/{from}"), "id": to }));
}
let error = mini_apply(Value::from(ops)).unwrap_err();
assert!(error.contains("the records weigh more than"), "{error}");
}
/// A `__proto__` segment had no faithful reading in the TypeScript (a prototype set, a
/// polluted `Object.prototype`, or nothing written): the port refuses it at the op.
#[test]