From 86e510f96659b3eb8c21de88107fd7b86cdde902 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 19 Nov 2026 04:24:52 +0000 Subject: corpus: cases chosen by what they show, merges by nodes their party lists The corpora written from four seeds of each kind showed little: of 32 histories, 4 versions written, no move and no stop, and every merge event refused, as the generator signed them with any of ten node keys, so the corpus of revision 1 judged as the base revision's did. A generated merge event is signed by a node its party lists there, more often than not. Of each kind, the corpus keeps the histories of the first two seeds, and of the next 400 those showing what the ones kept don't (`shows`: of each kind of event, what became of one; a version written, a move, a stop), eight at most. The check asks that together a revision's cases show a version written, a move to a checkpoint, a stop, and a merge event taken where the revision has merge events, else refused. --- src/federation/properties.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/federation/properties.rs') diff --git a/src/federation/properties.rs b/src/federation/properties.rs index b45b664..91e038e 100644 --- a/src/federation/properties.rs +++ b/src/federation/properties.rs @@ -161,8 +161,17 @@ pub(super) fn generate_at(rng: &mut Rng, kind: Kind, revision: Option) .collect(); let roll = rng.below(100); let event = if roll < 4 { - // A node merges, its party's or not. - harness::merge(&party.name, rng.below(10) as u8, &deps) + // A node merges: one its party lists there, more often than not, else any. + let listed = world.state_at(&deps).nodes_of(&party.name, ¤t); + let ours: Vec = (0..10) + .filter(|seed| listed.contains(&harness::node_id(*seed))) + .collect(); + let seed = if !ours.is_empty() && rng.chance(0.75) { + *rng.pick(&ours) + } else { + rng.below(10) as u8 + }; + harness::merge(&party.name, seed, &deps) } else if roll < 35 || (roll >= 60 && mine.is_empty()) { let path = format!("home/{}/k{}", party.name, rng.below(3)); writer.write(&deps, &path, harness::str(&step.to_string())) -- cgit v1.3.1