forked from yvv/decision
Lot T2 : les trois phrases de F1.1, F1.2 et N1.1 écrites justes (la part du cran, la plus haute au quorum, baisse quand la participation monte ; le quorum se fixe tant que l'article ne garde la trace d'aucun vote ; le quorum n'est pas un nombre minimal de votants), dans le seed et par un amendement gardé qui suit celui de M6b
- seed_amend : 2026-11-03-f1-1-phrases, -f1-2-phrases, -n1-1-phrases ; la garde admet la révision écrite par la chaîne des amendements suivis (earlier), dans leur ordre, le dernier étant celui de M6b (F1.1 en révision 2, F1.2 et N1.1 en révision 3) ; les amendements de M6b dépassés ; le commentaire dit les deux votes qui ne laissent pas de trace (vote direct retiré dans le groupe d'essai, votes simulés après « supprime ») - tests : base faite comme la production après M6b (fixture seed-quorum-m6b.json), appliqué une fois, refus votes et ballots, second démarrage sans rejeu, base née le 02/11 ; les phrases et leur preuve par le moteur ; le quorum de nouveau réglable après un vote direct retiré et après « supprime » - moteur : la part exigée au quorum en production (W 5 707) : 64,4 · 73,5 · 77,4 · 85,3 · 91,9 % (la relecture disait 74 au cran 2) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -248,7 +248,7 @@ pub fn quorum_bounds(electorate: u32, test_group: bool) -> (u32, u32) {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::threshold::required_ratio;
|
||||
use crate::threshold::{judged_voters, required_ratio};
|
||||
|
||||
const W: u32 = 7224;
|
||||
/// The reference quorum of Monnaie libre (`vote_floor`): p0 = 2 × 50 / W.
|
||||
@@ -312,6 +312,35 @@ mod tests {
|
||||
// Ten voters, no quorum in the way: 7, 8, 9, 9 and 10 « pour », level 1 to 5.
|
||||
let ten: Vec<u32> = InertiaLevel::ALL.iter().map(|k| scale.required(10, *k, 1).expect("valid")).collect();
|
||||
assert_eq!(ten, [7, 8, 9, 9, 10]);
|
||||
// The share asked is highest at the quorum, never near-unanimity (review of M6b, lot
|
||||
// T2): 64,4 · 73,5 · 77,4 · 85,3 · 91,9 % of the quorum, level 1 to 5 — the review said
|
||||
// 74 at level 2; rounded up to whole voters, 9 « pour » of 12 (75 %).
|
||||
let at_quorum: Vec<f64> = InertiaLevel::ALL
|
||||
.iter()
|
||||
.map(|k| {
|
||||
let q = scale.quorum(*k, None);
|
||||
(required_ratio(w, judged_voters(0, q), &scale.params(*k, q)) * 1000.0).round() / 10.0
|
||||
})
|
||||
.collect();
|
||||
assert_eq!(at_quorum, [64.4, 73.5, 77.4, 85.3, 91.9]);
|
||||
assert_eq!((yes(2, 12, 0), scale.quorum(level(2), None)), (9, 12));
|
||||
// Beyond the quorum the share only falls, down to M when everyone votes; under it,
|
||||
// the voters counted are the quorum, and so is the share.
|
||||
for k in InertiaLevel::ALL {
|
||||
let q = scale.quorum(k, None);
|
||||
let p = scale.params(k, q);
|
||||
let share = |t: u32| required_ratio(w, judged_voters(t, q), &p);
|
||||
let mut last = share(0);
|
||||
for t in 0..=w {
|
||||
let s = share(t);
|
||||
assert!(s <= last, "level {}: the share never rises with the voters ({t})", k.get());
|
||||
if t <= q {
|
||||
assert_eq!(s, share(0), "level {}: under the quorum, the share of the quorum", k.get());
|
||||
}
|
||||
last = s;
|
||||
}
|
||||
assert!((share(w) - k.majority_pct() / 100.0).abs() < 1e-12, "level {}: M at full turnout", k.get());
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -10,9 +10,15 @@
|
||||
//! Since 2026-11-03 (lot T), a text may be amended twice: F1.1, F1.2 and N1.1 say
|
||||
//! the quorum by level (ADR 0013) instead of the floor C, and F1.2 and N1.1 had
|
||||
//! been rewritten by the amendments of 02/11. An amendment that `follows` an
|
||||
//! earlier one replaces the text that one wrote: it admits, besides the seed's
|
||||
//! own revision 1, the revision 2 whose history is « initial » then « amendment »
|
||||
//! and on which that earlier amendment, and it alone, was applied — nothing else.
|
||||
//! earlier one replaces the text that one wrote. The same day (lot T2, after the
|
||||
//! review of M6b), three phrases of those texts are written true by amendments that
|
||||
//! follow lot T's: F1.1 is then at its revision 2, F1.2 and N1.1 at their revision 3.
|
||||
//! So an amendment admits, besides the seed's own revision 1, the revision written
|
||||
//! by the amendments it follows (`earlier`: the one it follows, the one that one
|
||||
//! follows…), applied in that order, the last being the one it follows, and nothing
|
||||
//! else between them: a revision n + 1 whose history is « initial » then n times
|
||||
//! « amendment », on which those n amendments, and they alone, were applied
|
||||
//! (`seed_amendments`), its text the one the amendment replaces (fingerprint).
|
||||
//! The earlier one is then `superseded_by` it: the seed no longer gives its text,
|
||||
//! so it decides nothing more, without an error (the decisions already taken stay).
|
||||
//!
|
||||
@@ -23,11 +29,16 @@
|
||||
//! nobody has touched the article**:
|
||||
//!
|
||||
//! - its version in force is the seed's own, a *seed a minima* (never voted
|
||||
//! into force, never confirmed), at revision 1 — or 2, after the amendment it
|
||||
//! follows;
|
||||
//! - nobody ever voted on it (a vote, or a line of a ballot of the buffer, pending
|
||||
//! or proven, whatever became of it: ADR 0012), corrected it, edited one of its
|
||||
//! translations or named it in a contradiction signal (an objection);
|
||||
//! into force, never confirmed), at revision 1 — or further, written by the
|
||||
//! amendments it follows;
|
||||
//! - no trace of a vote is on it — a vote that counts (`votes`: a vote of the server,
|
||||
//! proven by the chain, or simulated), or a line of a ballot of the buffer, pending
|
||||
//! or proven, whatever became of it (ADR 0012) — and nobody corrected it, edited
|
||||
//! one of its translations or named it in a contradiction signal (an objection).
|
||||
//! Two votes leave no trace, and so do not keep the text: in a group without the
|
||||
//! buffer (the test group), a vote of the server withdrawn (`votes` keeps the last
|
||||
//! choice only); and a simulated vote once the act « supprime » took it away
|
||||
//! (`simulation::discard`);
|
||||
//! - its text is exactly the one the amendment replaces (fingerprint).
|
||||
//!
|
||||
//! Each document is decided once, at the first start that knows the
|
||||
@@ -146,7 +157,7 @@ pub const AMENDMENTS: &[Amendment] = &[
|
||||
to: "ca6d3c74a3e6de22ebf55eb0cdd6465dbe22d69cd86aae89ac335b960671b4fa",
|
||||
reason: "proposition de départ réécrite : F1.1, le quorum par cran",
|
||||
follows: None,
|
||||
superseded_by: None,
|
||||
superseded_by: Some("2026-11-03-f1-1-phrases"),
|
||||
},
|
||||
Amendment {
|
||||
id: "2026-11-03-f1-2-quorum",
|
||||
@@ -157,7 +168,7 @@ pub const AMENDMENTS: &[Amendment] = &[
|
||||
to: "66a9bc125c78120a76a81e8b53c427f4d2d5895581cb4ed4ade1aaab740944a9",
|
||||
reason: "proposition de départ réécrite : F1.2, le quorum par cran",
|
||||
follows: Some("2026-11-02-f1-2-regles"),
|
||||
superseded_by: None,
|
||||
superseded_by: Some("2026-11-03-f1-2-phrases"),
|
||||
},
|
||||
Amendment {
|
||||
id: "2026-11-03-n1-1-quorum",
|
||||
@@ -168,6 +179,43 @@ pub const AMENDMENTS: &[Amendment] = &[
|
||||
to: "1bdd26a63cadb4529f5347863ced83a823439f53247b6aea8e703301bab3de48",
|
||||
reason: "proposition de départ réécrite : N1.1, le quorum par cran",
|
||||
follows: Some("2026-11-02-n1-1-regles"),
|
||||
superseded_by: Some("2026-11-03-n1-1-phrases"),
|
||||
},
|
||||
// The three phrases the review of M6b left inexact (lot T2, 2026-11-03): the share of the
|
||||
// level is highest at the quorum (F1.1); the author sets the quorum while the article keeps
|
||||
// no trace of a vote (F1.2); the quorum is no minimum of voters (N1.1). Each replaces the
|
||||
// text lot T wrote: F1.1 at its revision 2, F1.2 and N1.1 at their revision 3.
|
||||
Amendment {
|
||||
id: "2026-11-03-f1-1-phrases",
|
||||
doc: "acte-engagement-certification",
|
||||
unit: "F1.1",
|
||||
version: Version::Open("1.0.0"),
|
||||
from: "ca6d3c74a3e6de22ebf55eb0cdd6465dbe22d69cd86aae89ac335b960671b4fa",
|
||||
to: "8375b78af825e5ce5f978442519c078010ac9ad87f5cbc9358b407aa3668c5e5",
|
||||
reason: "proposition de départ réécrite : F1.1, la part du cran au-delà du quorum",
|
||||
follows: Some("2026-11-03-f1-1-quorum"),
|
||||
superseded_by: None,
|
||||
},
|
||||
Amendment {
|
||||
id: "2026-11-03-f1-2-phrases",
|
||||
doc: "acte-engagement-certification",
|
||||
unit: "F1.2",
|
||||
version: Version::Open("1.0.0"),
|
||||
from: "66a9bc125c78120a76a81e8b53c427f4d2d5895581cb4ed4ade1aaab740944a9",
|
||||
to: "96caf353b33805f2894593d72c5b70fce2e751039cd7f4651d8842c986729a14",
|
||||
reason: "proposition de départ réécrite : F1.2, le quorum fixé tant qu'aucun vote n'a laissé de trace",
|
||||
follows: Some("2026-11-03-f1-2-quorum"),
|
||||
superseded_by: None,
|
||||
},
|
||||
Amendment {
|
||||
id: "2026-11-03-n1-1-phrases",
|
||||
doc: "acte-engagement-certification",
|
||||
unit: "N1.1",
|
||||
version: Version::Open("1.0.0"),
|
||||
from: "1bdd26a63cadb4529f5347863ced83a823439f53247b6aea8e703301bab3de48",
|
||||
to: "7fbedcb8750c208f8790c4f87dc21d8bd1096a27a1a0044af6b9b8f2057f2aa8",
|
||||
reason: "proposition de départ réécrite : N1.1, le quorum n'est pas un minimum de votants",
|
||||
follows: Some("2026-11-03-n1-1-quorum"),
|
||||
superseded_by: None,
|
||||
},
|
||||
];
|
||||
@@ -211,8 +259,24 @@ pub enum Verdict {
|
||||
Refuse(&'static str),
|
||||
}
|
||||
|
||||
/// The rule, apart from the database: any trace of a person keeps the text.
|
||||
pub fn verdict(facts: Option<&Facts>, a: &Amendment) -> Verdict {
|
||||
/// The amendments whose text `a` replaces, oldest first: the one it follows, the one that
|
||||
/// one follows, and so on, through `list`. Empty when it follows none.
|
||||
pub fn earlier(list: &[Amendment], a: &Amendment) -> Vec<&'static str> {
|
||||
let mut out = Vec::new();
|
||||
let mut at = a.follows;
|
||||
while let Some(id) = at {
|
||||
if out.contains(&id) {
|
||||
break;
|
||||
}
|
||||
out.insert(0, id);
|
||||
at = list.iter().find(|e| e.id == id).and_then(|e| e.follows);
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// The rule, apart from the database: any trace of a person keeps the text. `earlier`:
|
||||
/// the amendments `a` follows, oldest first (`earlier`).
|
||||
pub fn verdict(facts: Option<&Facts>, a: &Amendment, earlier: &[&str]) -> Verdict {
|
||||
let Some(f) = facts else {
|
||||
return Verdict::Refuse(match a.version {
|
||||
Version::InForce => "no_text_in_force",
|
||||
@@ -222,9 +286,16 @@ pub fn verdict(facts: Option<&Facts>, a: &Amendment) -> Verdict {
|
||||
if f.fingerprint == a.to {
|
||||
return Verdict::Present;
|
||||
}
|
||||
// The text the amendment follows: written by it, and by it alone, at revision 2.
|
||||
let after_earlier = a.follows.is_some_and(|id| f.revision == 2 && f.amendments == [id]);
|
||||
let history: &[&str] = if after_earlier { &["initial", "amendment"] } else { &["initial"] };
|
||||
// The text the amendments it follows wrote: by them alone, in their order, the last
|
||||
// being the one it follows (a base born later holds the last ones only), one revision
|
||||
// each over the seed's.
|
||||
let n = f.amendments.len();
|
||||
let after_earlier = n > 0
|
||||
&& f.revision == 1 + n as i64
|
||||
&& earlier.len() >= n
|
||||
&& earlier[earlier.len() - n..].iter().zip(&f.amendments).all(|(e, applied)| e == applied);
|
||||
let history: Vec<&str> =
|
||||
std::iter::once("initial").chain(std::iter::repeat_n("amendment", if after_earlier { n } else { 0 })).collect();
|
||||
let refusal = if f.origin != "seed" {
|
||||
"not_a_seed"
|
||||
} else if f.entered {
|
||||
@@ -264,13 +335,16 @@ pub async fn apply(state: &AppState, seeds: &[SeedDoc], list: &[Amendment]) -> a
|
||||
let mut out = Vec::new();
|
||||
for a in list {
|
||||
let Some((seed, target)) = target_of(seeds, a) else { continue };
|
||||
let before = earlier(list, a);
|
||||
let docs: Vec<(String, String, Option<String>)> =
|
||||
sqlx::query_as("SELECT id, group_slug, publish_path FROM documents WHERE slug = ? ORDER BY group_slug")
|
||||
.bind(a.doc)
|
||||
.fetch_all(&state.db)
|
||||
.await?;
|
||||
for (doc_id, group, publish_path) in docs {
|
||||
let Some(v) = decide(state, a, seed, target, &doc_id, publish_path.is_some()).await? else { continue };
|
||||
let Some(v) = decide(state, a, &before, seed, target, &doc_id, publish_path.is_some()).await? else {
|
||||
continue;
|
||||
};
|
||||
match v {
|
||||
Verdict::Apply => tracing::info!(amendment = a.id, %group, unit = a.unit, "seed amendment applied"),
|
||||
Verdict::Present => {
|
||||
@@ -406,6 +480,7 @@ pub(crate) async fn facts(
|
||||
async fn decide(
|
||||
state: &AppState,
|
||||
a: &Amendment,
|
||||
earlier: &[&str],
|
||||
seed: &SeedDoc,
|
||||
target: &SeedVersion,
|
||||
doc_id: &str,
|
||||
@@ -450,7 +525,7 @@ async fn decide(
|
||||
Some((id, status)) => facts(&mut tx, id, status).await?,
|
||||
None => None,
|
||||
};
|
||||
let mut v = verdict(found.as_ref(), a);
|
||||
let mut v = verdict(found.as_ref(), a, earlier);
|
||||
let now = util::now();
|
||||
let judged = found.as_ref().map_or(1, |f| f.revision);
|
||||
if let (Verdict::Apply, Some((pid, status))) = (v, &examined) {
|
||||
@@ -564,13 +639,13 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn an_untouched_starting_text_is_replaced() {
|
||||
assert_eq!(verdict(Some(&intact()), &A), Verdict::Apply);
|
||||
assert_eq!(verdict(Some(&intact()), &A, &[]), Verdict::Apply);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_new_text_already_there_is_left_as_it_is() {
|
||||
let f = Facts { fingerprint: "new".into(), revision: 3, votes: 12, ..intact() };
|
||||
assert_eq!(verdict(Some(&f), &A), Verdict::Present);
|
||||
assert_eq!(verdict(Some(&f), &A, &[]), Verdict::Present);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -590,14 +665,14 @@ mod tests {
|
||||
(Some(Facts { fingerprint: "other".into(), ..intact() }), "text_differs"),
|
||||
];
|
||||
for (facts, reason) in cases {
|
||||
assert_eq!(verdict(facts.as_ref(), &A), Verdict::Refuse(reason), "{facts:?}");
|
||||
assert_eq!(verdict(facts.as_ref(), &A, &[]), Verdict::Refuse(reason), "{facts:?}");
|
||||
}
|
||||
// An open proposal of the seed that is no longer there (withdrawn, never seeded).
|
||||
let open = Amendment { version: Version::Open("1.0.0"), ..A };
|
||||
assert_eq!(verdict(None, &open), Verdict::Refuse("no_open_version"));
|
||||
assert_eq!(verdict(Some(&intact()), &open), Verdict::Apply);
|
||||
assert_eq!(verdict(None, &open, &[]), Verdict::Refuse("no_open_version"));
|
||||
assert_eq!(verdict(Some(&intact()), &open, &[]), Verdict::Apply);
|
||||
// A ballot of the buffer names it, pending or proven, whatever became of it (ADR 0012).
|
||||
assert_eq!(verdict(Some(&Facts { ballots: 1, ..intact() }), &A), Verdict::Refuse("ballots"));
|
||||
assert_eq!(verdict(Some(&Facts { ballots: 1, ..intact() }), &A, &[]), Verdict::Refuse("ballots"));
|
||||
}
|
||||
|
||||
/// The text an earlier amendment wrote, as production holds F1.2 and N1.1 since M5.
|
||||
@@ -615,23 +690,23 @@ mod tests {
|
||||
// Lot T (2026-11-03): F1.2 and N1.1 were amended by M5 (revision 2); the quorum
|
||||
// texts replace them, after that amendment only.
|
||||
let second = Amendment { version: Version::Open("1.0.0"), follows: Some("m5"), ..A };
|
||||
assert_eq!(verdict(Some(&amended_by("m5")), &second), Verdict::Apply);
|
||||
assert_eq!(verdict(Some(&amended_by("m5")), &second, &["m5"]), Verdict::Apply);
|
||||
// A base born with the text of M5: its revision 1, as the seed made it.
|
||||
assert_eq!(verdict(Some(&intact()), &second), Verdict::Apply);
|
||||
assert_eq!(verdict(Some(&intact()), &second, &["m5"]), Verdict::Apply);
|
||||
// Not the amendment it follows, or none: a revision 2 of something else.
|
||||
assert_eq!(verdict(Some(&amended_by("other")), &second), Verdict::Refuse("revised"));
|
||||
assert_eq!(verdict(Some(&amended_by("other")), &second, &["m5"]), Verdict::Refuse("revised"));
|
||||
let typo = Facts { revisions: vec!["initial".into(), "typo".into()], amendments: vec![], ..amended_by("m5") };
|
||||
assert_eq!(verdict(Some(&typo), &second), Verdict::Refuse("revised"));
|
||||
assert_eq!(verdict(Some(&typo), &second, &["m5"]), Verdict::Refuse("revised"));
|
||||
// A history that is not « initial then amendment ».
|
||||
let odd = Facts { revisions: vec!["initial".into(), "substantive".into()], ..amended_by("m5") };
|
||||
assert_eq!(verdict(Some(&odd), &second), Verdict::Refuse("corrected"));
|
||||
assert_eq!(verdict(Some(&odd), &second, &["m5"]), Verdict::Refuse("corrected"));
|
||||
// Further on, nothing is admitted.
|
||||
let third = Facts {
|
||||
revision: 3,
|
||||
revisions: vec!["initial".into(), "amendment".into(), "typo".into()],
|
||||
..amended_by("m5")
|
||||
};
|
||||
assert_eq!(verdict(Some(&third), &second), Verdict::Refuse("revised"));
|
||||
assert_eq!(verdict(Some(&third), &second, &["m5"]), Verdict::Refuse("revised"));
|
||||
// The same traces of a person keep it.
|
||||
for (f, why) in [
|
||||
(Facts { votes: 1, ..amended_by("m5") }, "votes"),
|
||||
@@ -641,9 +716,92 @@ mod tests {
|
||||
(Facts { signals: 1, ..amended_by("m5") }, "signalled"),
|
||||
(Facts { fingerprint: "other".into(), ..amended_by("m5") }, "text_differs"),
|
||||
] {
|
||||
assert_eq!(verdict(Some(&f), &second), Verdict::Refuse(why), "{f:?}");
|
||||
assert_eq!(verdict(Some(&f), &second, &["m5"]), Verdict::Refuse(why), "{f:?}");
|
||||
}
|
||||
// An amendment that follows none never admits a revision 2.
|
||||
assert_eq!(verdict(Some(&amended_by("m5")), &A), Verdict::Refuse("revised"));
|
||||
assert_eq!(verdict(Some(&amended_by("m5")), &A, &[]), Verdict::Refuse("revised"));
|
||||
}
|
||||
|
||||
/// The text written by `applied`, in order, one revision each over the seed's.
|
||||
fn written_by(applied: &[&str]) -> Facts {
|
||||
let mut revisions = vec!["initial".to_owned()];
|
||||
revisions.extend(applied.iter().map(|_| "amendment".to_owned()));
|
||||
Facts {
|
||||
revision: 1 + applied.len() as i64,
|
||||
revisions,
|
||||
amendments: applied.iter().map(|a| (*a).to_owned()).collect(),
|
||||
..intact()
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_third_amendment_admits_the_texts_the_two_before_wrote_and_nothing_else() {
|
||||
// Lot T2 (2026-11-03): F1.2 and N1.1 were amended by M5 (revision 2), then by M6b
|
||||
// (revision 3); the true phrases replace the text of M6b, after it only.
|
||||
let third = Amendment { version: Version::Open("1.0.0"), follows: Some("t"), ..A };
|
||||
let before: &[&str] = &["m5", "t"];
|
||||
// Production: M5 then M6b, each its revision.
|
||||
assert_eq!(verdict(Some(&written_by(&["m5", "t"])), &third, before), Verdict::Apply);
|
||||
// A base born with the text of M5 (02/11): M6b alone wrote its revision 2.
|
||||
assert_eq!(verdict(Some(&written_by(&["t"])), &third, before), Verdict::Apply);
|
||||
// A base born with the text of M6b: its revision 1.
|
||||
assert_eq!(verdict(Some(&intact()), &third, before), Verdict::Apply);
|
||||
// The last revision is not M6b's, or not M6b's alone, or out of order: refused.
|
||||
for applied in [&["m5"][..], &["t", "m5"], &["m5", "other"], &["other", "t"], &["m5", "t", "t"]] {
|
||||
assert_eq!(verdict(Some(&written_by(applied)), &third, before), Verdict::Refuse("revised"), "{applied:?}");
|
||||
}
|
||||
// A revision that no amendment wrote: a typo after M6b, a revision count off by one.
|
||||
let typo = Facts {
|
||||
revision: 4,
|
||||
revisions: vec!["initial".into(), "amendment".into(), "amendment".into(), "typo".into()],
|
||||
..written_by(&["m5", "t"])
|
||||
};
|
||||
assert_eq!(verdict(Some(&typo), &third, before), Verdict::Refuse("revised"));
|
||||
let short = Facts { revision: 2, ..written_by(&["m5", "t"]) };
|
||||
assert_eq!(verdict(Some(&short), &third, before), Verdict::Refuse("revised"));
|
||||
// The history is not « initial » then twice « amendment ».
|
||||
let odd = Facts {
|
||||
revisions: vec!["initial".into(), "amendment".into(), "substantive".into()],
|
||||
..written_by(&["m5", "t"])
|
||||
};
|
||||
assert_eq!(verdict(Some(&odd), &third, before), Verdict::Refuse("corrected"));
|
||||
// Any trace of a person keeps the text, with its reason.
|
||||
for (f, why) in [
|
||||
(Facts { votes: 1, ..written_by(&["m5", "t"]) }, "votes"),
|
||||
(Facts { ballots: 1, ..written_by(&["m5", "t"]) }, "ballots"),
|
||||
(Facts { typos: 1, ..written_by(&["m5", "t"]) }, "corrected"),
|
||||
(Facts { member_translations: 1, ..written_by(&["m5", "t"]) }, "translation_edited"),
|
||||
(Facts { signals: 1, ..written_by(&["m5", "t"]) }, "signalled"),
|
||||
(Facts { fingerprint: "other".into(), ..written_by(&["m5", "t"]) }, "text_differs"),
|
||||
(Facts { entered: true, ..written_by(&["m5", "t"]) }, "voted_into_force"),
|
||||
] {
|
||||
assert_eq!(verdict(Some(&f), &third, before), Verdict::Refuse(why), "{f:?}");
|
||||
}
|
||||
// Lot T's own amendment, which follows M5 alone, never admits a revision 3.
|
||||
let second = Amendment { version: Version::Open("1.0.0"), follows: Some("m5"), ..A };
|
||||
assert_eq!(verdict(Some(&written_by(&["m5", "t"])), &second, &["m5"]), Verdict::Refuse("revised"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_amendments_followed_are_read_through_the_list_oldest_first() {
|
||||
let by_id = |id: &str| AMENDMENTS.iter().find(|a| a.id == id).expect("amendment");
|
||||
assert_eq!(
|
||||
earlier(AMENDMENTS, by_id("2026-11-03-f1-2-phrases")),
|
||||
["2026-11-02-f1-2-regles", "2026-11-03-f1-2-quorum"]
|
||||
);
|
||||
assert_eq!(
|
||||
earlier(AMENDMENTS, by_id("2026-11-03-n1-1-phrases")),
|
||||
["2026-11-02-n1-1-regles", "2026-11-03-n1-1-quorum"]
|
||||
);
|
||||
assert_eq!(earlier(AMENDMENTS, by_id("2026-11-03-f1-1-phrases")), ["2026-11-03-f1-1-quorum"]);
|
||||
assert!(earlier(AMENDMENTS, by_id("2026-10-30-i1-raison-d-etre")).is_empty());
|
||||
// Each one followed wrote the text the next replaces, and is superseded by it.
|
||||
for a in AMENDMENTS.iter().filter(|a| a.follows.is_some()) {
|
||||
let e = by_id(a.follows.expect("follows"));
|
||||
assert_eq!((e.unit, e.doc, e.to, e.superseded_by), (a.unit, a.doc, a.from, Some(a.id)), "{}", a.id);
|
||||
}
|
||||
// A list that loops never hangs.
|
||||
let looped = [Amendment { id: "x", follows: Some("y"), ..A }, Amendment { id: "y", follows: Some("x"), ..A }];
|
||||
assert_eq!(earlier(&looped, &looped[0]), ["x", "y"]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2073,6 +2073,16 @@ async fn a_vote_exists_for_every_state_of_the_buffer() {
|
||||
ld_server::simulation::discard(&state, true).await.expect("act");
|
||||
assert!(!exists(unit_id("E3")).await && !exists(unit_id("E4")).await);
|
||||
assert!(exists(unit_id("E1")).await, "a proven trace stays");
|
||||
// And the quorum changes again where no trace stays — « tant que l'article ne garde la
|
||||
// trace d'aucun vote » (F1.2, lot T2), not « ensuite, il ne change plus ».
|
||||
for code in ["E3", "E4"] {
|
||||
let (s, v) =
|
||||
admin.call("PUT", &format!("/api/units/{}/quorum", unit_id(code)), Some(json!({ "quorum": 20 }))).await;
|
||||
assert_eq!(s, StatusCode::OK, "{code}: {v}");
|
||||
}
|
||||
let (s, v) =
|
||||
admin.call("PUT", &format!("/api/units/{}/quorum", unit_id("E1")), Some(json!({ "quorum": 20 }))).await;
|
||||
assert_eq!((s, v["error"].as_str()), (StatusCode::CONFLICT, Some("voted")), "E1: its proven trace holds it");
|
||||
let _ = doc_id;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"_source": "seeds/acte-engagement-certification.json au commit 3956a3e : F1.1, F1.2 et N1.1 tels que la production les tient depuis M6b (bb4bdf5, le 03/11 à 08 h 02 ; lot T, le quorum par cran), inchangés par M7 (b2e597b)",
|
||||
"units": {
|
||||
"F1.1": {
|
||||
"label": "1.0.0",
|
||||
"title": {
|
||||
"fr": "Formule du seuil WoT",
|
||||
"en": "WoT threshold formula",
|
||||
"es": "Fórmula del umbral WoT"
|
||||
},
|
||||
"body": {
|
||||
"fr": "Le seuil est le nombre de voix pour qu'il faut à une version pour entrer en vigueur. Sous le quorum Q, les votants qui manquent comptent comme « non » : le seuil se calcule comme si Q personnes avaient voté. Au-delà, il faut la part de « pour » que demande le cran d'inertie de l'article, parmi tous les votants : presque l'unanimité quand peu de gens votent, la majorité M quand tout le monde vote.\n\n`T' = max(T, Q)`\n`Seuil = B^W + (M + (1 − M) × (1 − (T'/W)^G)) × T'`\n\nUne version passe quand ses voix pour atteignent le seuil, arrondi à l'entier au-dessus.\n\n- **T** : les votes exprimés sur la version, pour et contre.\n- **Q** : le quorum de l'article ; **T'** : les votants retenus, T, ou Q s'il en manque.\n- **W** : le nombre de membres de la toile de confiance Ğ1.\n- **B** : la base ; à la puissance W, elle est si petite qu'elle ne compte pas.\n- **M** : la majorité demandée quand tout le monde vote.\n- **G** : le gradient : plus il est grand, plus la part demandée monte quand peu de gens votent.\n\nLeurs valeurs sont dans « Paramètres par défaut » et « Niveaux d'inertie ».",
|
||||
"en": "The threshold is the number of votes in favour a version needs to come into force. Below the quorum Q, the voters who are missing count as votes against: the threshold is worked out as if Q people had voted. Beyond it, it takes the share of votes in favour that the article's level of inertia asks for, among all the voters: near-unanimity when few people vote, the majority M when everyone votes.\n\n`T' = max(T, Q)`\n`Threshold = B^W + (M + (1 − M) × (1 − (T'/W)^G)) × T'`\n\nA version passes when its votes in favour reach the threshold, rounded up to a whole number.\n\n- **T**: the votes cast on the version, for and against.\n- **Q**: the article's quorum; **T'**: the voters counted, T, or Q if some are missing.\n- **W**: the number of members of the Ğ1 web of trust.\n- **B**: the base; raised to the power W, it is so small that it does not count.\n- **M**: the majority asked for when everyone votes.\n- **G**: the gradient: the larger it is, the higher the share asked for when few people vote.\n\nTheir values are in “Default parameters” and “Inertia levels”.",
|
||||
"es": "El umbral es el número de votos a favor que necesita una versión para entrar en vigor. Por debajo del quórum Q, los votantes que faltan cuentan como «no»: el umbral se calcula como si hubieran votado Q personas. Más allá, hace falta la proporción de votos a favor que pide el nivel de inercia del artículo, entre todos los votantes: casi la unanimidad cuando vota poca gente, la mayoría M cuando vota todo el mundo.\n\n`T' = max(T, Q)`\n`Umbral = B^W + (M + (1 − M) × (1 − (T'/W)^G)) × T'`\n\nUna versión pasa cuando sus votos a favor alcanzan el umbral, redondeado al entero superior.\n\n- **T**: los votos emitidos sobre la versión, a favor y en contra.\n- **Q**: el quórum del artículo; **T'**: los votantes contados, T, o Q si faltan.\n- **W**: el número de miembros de la red de confianza Ğ1.\n- **B**: la base; elevada a la potencia W, es tan pequeña que no cuenta.\n- **M**: la mayoría pedida cuando vota todo el mundo.\n- **G**: el gradiente: cuanto mayor es, más alta es la proporción pedida cuando vota poca gente.\n\nSus valores están en «Parámetros por defecto» y «Niveles de inercia»."
|
||||
}
|
||||
},
|
||||
"F1.2": {
|
||||
"label": "1.0.0",
|
||||
"title": {
|
||||
"fr": "Paramètres par défaut",
|
||||
"en": "Default parameters",
|
||||
"es": "Parámetros por defecto"
|
||||
},
|
||||
"body": {
|
||||
"fr": "Les valeurs des lettres de la formule (voir « Formule du seuil WoT ») et la façon dont le vote se déroule.\n\n**Un vote permanent, sans durée**\n\n- Chaque version se vote à tout moment, sans échéance. Chacun peut changer ou retirer son vote : le dernier fait foi.\n- Une proposition entre en vigueur dès qu'elle atteint son seuil. S'il y a déjà un texte en vigueur, il lui faut en plus une marge (voix pour moins voix exigées) plus large que celle de ce texte. Le texte remplacé redevient une proposition, avec ses votes : il peut revenir.\n- Si plusieurs propositions y parviennent, celle qui a la marge la plus large entre en vigueur.\n\n**Les lettres**\n\n- **W** : le nombre de membres de la toile de confiance Ğ1, relu sur la chaîne toutes les 6 heures.\n- **T** : les votes exprimés sur la version, pour et contre.\n- **Q**, le quorum : sous ce nombre de votants, ceux qui manquent comptent comme « non ». Chaque article prend celui de son cran : 12, 12, 50, 50 et 50 dans Monnaie libre, du cran 1 au cran 5. L'auteur de la première version d'un article, un administrateur pour les textes de départ, peut en fixer un autre tant que personne n'a voté sur l'article ; ensuite, il ne change plus. Dans Monnaie libre, jamais moins de 2 : une seule voix ne fait jamais passer un texte.\n- **B = 0,1** : dans la toile de confiance, `B^W` est si petit qu'il ne compte pas.\n- **M** et **G** : donnés par le cran d'inertie de l'article (voir « Niveaux d'inertie »). G n'est pas fixé à la main : il se déduit de la participation habituelle du groupe.\n\n**Par défaut**\n\n- Le cran par défaut est le 3 (moyenne) : M = 55 %, un quorum de 50 dans Monnaie libre, et le groupe demande 75 % de « pour » quand il vote comme d'habitude. Tout nouvel article commence à ce cran.\n- Au départ, aucun article n'est en vigueur. Raison d'être, Unicité du compte et Réciprocité sont des Propositions seed, mises en avant pour lancer le vote, au cran 2 (basse). Le titre du document est au cran 4 (haute), l'ordre des articles de chaque section au cran 2, tous les autres articles au cran 3.",
|
||||
"en": "The values of the letters of the formula (see “WoT threshold formula”) and how the vote runs.\n\n**A permanent vote, with no duration**\n\n- Every version can be voted on at any time, with no deadline. Anyone can change or withdraw their vote: the last one is the one that counts.\n- A proposal comes into force as soon as it reaches its threshold. If a text is already in force, it also needs a wider margin (votes in favour minus votes required) than that text has. The replaced text becomes a proposal again, with its votes: it can come back.\n- If several proposals get there, the one with the widest margin comes into force.\n\n**The letters**\n\n- **W**: the number of members of the Ğ1 web of trust, read again from the chain every 6 hours.\n- **T**: the votes cast on the version, for and against.\n- **Q**, the quorum: below this number of voters, those who are missing count as votes against. Each article takes the one of its level: 12, 12, 50, 50 and 50 in Monnaie libre, from level 1 to level 5. The author of the first version of an article, an administrator for the starting texts, can set another one as long as nobody has voted on the article; after that, it no longer changes. In Monnaie libre, never less than 2: a single vote never passes a text.\n- **B = 0.1**: in the web of trust, `B^W` is so small that it does not count.\n- **M** and **G**: given by the article's level of inertia (see “Inertia levels”). G is not set by hand: it follows from the group's usual turnout.\n\n**By default**\n\n- The default level is 3 (medium): M = 55%, a quorum of 50 in Monnaie libre, and the group asks for 75% of votes in favour when it votes as usual. Every new article starts at this level.\n- At the start, no article is in force. Purpose, Uniqueness of the account and Reciprocity are seed proposals, put forward to start the vote, at level 2 (low). The title of the document is at level 4 (high), the order of the articles of each section at level 2, all other articles at level 3.",
|
||||
"es": "Los valores de las letras de la fórmula (ver «Fórmula del umbral WoT») y cómo se desarrolla la votación.\n\n**Una votación permanente, sin duración**\n\n- Cada versión se vota en cualquier momento, sin plazo. Cada cual puede cambiar o retirar su voto: el último es el que cuenta.\n- Una propuesta entra en vigor en cuanto alcanza su umbral. Si ya hay un texto en vigor, necesita además un margen (votos a favor menos votos exigidos) más amplio que el de ese texto. El texto sustituido vuelve a ser una propuesta, con sus votos: puede volver.\n- Si varias propuestas lo consiguen, entra en vigor la que tiene el margen más amplio.\n\n**Las letras**\n\n- **W**: el número de miembros de la red de confianza Ğ1, leído de nuevo en la cadena cada 6 horas.\n- **T**: los votos emitidos sobre la versión, a favor y en contra.\n- **Q**, el quórum: por debajo de este número de votantes, los que faltan cuentan como «no». Cada artículo toma el de su nivel: 12, 12, 50, 50 y 50 en Monnaie libre, del nivel 1 al nivel 5. El autor de la primera versión de un artículo, un administrador para los textos de partida, puede fijar otro mientras nadie haya votado sobre el artículo; después, ya no cambia. En Monnaie libre, nunca menos de 2: un solo voto nunca hace pasar un texto.\n- **B = 0,1**: en la red de confianza, `B^W` es tan pequeño que no cuenta.\n- **M** y **G**: los da el nivel de inercia del artículo (ver «Niveles de inercia»). G no se fija a mano: se deduce de la participación habitual del grupo.\n\n**Por defecto**\n\n- El nivel por defecto es el 3 (media): M = 55 %, un quórum de 50 en Monnaie libre, y el grupo pide un 75 % de votos a favor cuando vota como de costumbre. Todo artículo nuevo empieza en este nivel.\n- Al inicio, ningún artículo está en vigor. Razón de ser, Unicidad de la cuenta y Reciprocidad son Propuestas seed, puestas en primer plano para lanzar la votación, en el nivel 2 (baja). El título del documento está en el nivel 4 (alta), el orden de los artículos de cada sección en el nivel 2, todos los demás artículos en el nivel 3."
|
||||
}
|
||||
},
|
||||
"N1.1": {
|
||||
"label": "1.0.0",
|
||||
"title": {
|
||||
"fr": "Niveaux d'inertie",
|
||||
"en": "Inertia levels",
|
||||
"es": "Niveles de inercia"
|
||||
},
|
||||
"body": {
|
||||
"fr": "À chaque cran, le groupe demande un quorum de votants, puis une part de « pour » parmi eux (voir « Formule du seuil WoT »). Sous le quorum, les votants qui manquent comptent comme « non ». La part dépend du cran et du nombre de votants, comparé à la participation habituelle du groupe : plus il y a de votants, plus elle baisse, jusqu'à la majorité M quand tout le monde vote.\n\n`Part exigée = M + (1 − M) × (1 − (T'/W)^G)`, où T' est le nombre de votants, ou le quorum s'il en manque.\n\n**Les cinq crans** : le quorum dans Monnaie libre, la part exigée quand le groupe vote comme d'habitude, puis quand tout le monde vote, et ce qui est à ce cran au départ.\n\n- **Cran 1 · très basse** : quorum 12 ; 60 % comme d'habitude, 50 % quand tout le monde vote. Aucun article au départ.\n- **Cran 2 · basse** : quorum 12 ; 67 % comme d'habitude, 50 % quand tout le monde vote. Raison d'être, Unicité du compte, Réciprocité, et l'ordre des articles de chaque section.\n- **Cran 3 · moyenne** : quorum 50 ; 75 % comme d'habitude, 55 % quand tout le monde vote. Le cran par défaut : tous les autres articles, et chaque nouvel article.\n- **Cran 4 · haute** : quorum 50 ; 83 % comme d'habitude, 60 % quand tout le monde vote. Le titre du document.\n- **Cran 5 · très haute** : quorum 50 ; 90 % comme d'habitude, 66 % quand tout le monde vote. Aucun article au départ.\n\n**La participation habituelle** est la médiane du nombre de votants des propositions du groupe votées depuis un an. Tant que le groupe n'a pas voté sur 5 propositions, elle vaut deux fois le quorum de référence du document : 100 votants dans Monnaie libre. Elle ne dépend pas du quorum d'un article. Elle reste entre 1 % et 50 % de l'électorat, et se mesure une fois par jour.\n\n**G** se calcule pour que la part exigée, à la participation habituelle, soit exactement celle du cran : `G = ln(1 − (s − M)/(1 − M)) / ln(p̃)`, où s est la part exigée comme d'habitude et p̃ la participation habituelle divisée par W.\n\nExemple : avec 7 224 membres et une participation habituelle de 120 votants, quand 120 personnes votent, il faut 72, 81, 90, 100 ou 108 voix pour, du cran 1 au cran 5 ; au cran 3, 75 % des 120 votants, soit 90. Sous le quorum, les absents comptent comme « non » : au cran 2 (quorum 12), 9 voix pour passent avec 3 « contre » au plus ; au cran 3 (quorum 50), il faut 39 voix pour, avec 11 « contre » au plus.",
|
||||
"en": "At each level, the group asks for a quorum of voters, then for a share of votes in favour among them (see “WoT threshold formula”). Below the quorum, the voters who are missing count as votes against. The share depends on the level and on the number of voters, compared with the group's usual turnout: the more voters, the lower it gets, down to the majority M when everyone votes.\n\n`Share asked = M + (1 − M) × (1 − (T'/W)^G)`, where T' is the number of voters, or the quorum if some are missing.\n\n**The five levels**: the quorum in Monnaie libre, the share asked when the group votes as usual, then when everyone votes, and what is at that level at the start.\n\n- **Level 1 · very low**: quorum 12; 60% as usual, 50% when everyone votes. No article at the start.\n- **Level 2 · low**: quorum 12; 67% as usual, 50% when everyone votes. Purpose, Uniqueness of the account, Reciprocity, and the order of the articles of each section.\n- **Level 3 · medium**: quorum 50; 75% as usual, 55% when everyone votes. The default level: all other articles, and every new article.\n- **Level 4 · high**: quorum 50; 83% as usual, 60% when everyone votes. The title of the document.\n- **Level 5 · very high**: quorum 50; 90% as usual, 66% when everyone votes. No article at the start.\n\n**The usual turnout** is the median number of voters on the group's proposals voted on over the past year. Until the group has voted on 5 proposals, it is twice the document's reference quorum: 100 voters in Monnaie libre. It does not depend on the quorum of an article. It stays between 1% and 50% of the electorate, and is measured once a day.\n\n**G** is computed so that the share asked, at the usual turnout, is exactly that of the level: `G = ln(1 − (s − M)/(1 − M)) / ln(p̃)`, where s is the share asked as usual and p̃ the usual turnout divided by W.\n\nExample: with 7,224 members and a usual turnout of 120 voters, when 120 people vote, it takes 72, 81, 90, 100 or 108 votes in favour, from level 1 to level 5; at level 3, 75% of the 120 voters, i.e. 90. Below the quorum, those missing count as votes against: at level 2 (quorum 12), 9 votes in favour pass with 3 votes against at most; at level 3 (quorum 50), it takes 39 votes in favour, with 11 votes against at most.",
|
||||
"es": "En cada nivel, el grupo pide un quórum de votantes, y luego una proporción de votos a favor entre ellos (ver «Fórmula del umbral WoT»). Por debajo del quórum, los votantes que faltan cuentan como «no». La proporción depende del nivel y del número de votantes, comparado con la participación habitual del grupo: cuantos más votantes, más baja, hasta la mayoría M cuando vota todo el mundo.\n\n`Proporción exigida = M + (1 − M) × (1 − (T'/W)^G)`, donde T' es el número de votantes, o el quórum si faltan.\n\n**Los cinco niveles**: el quórum en Monnaie libre, la proporción exigida cuando el grupo vota como de costumbre, luego cuando vota todo el mundo, y lo que está en ese nivel al inicio.\n\n- **Nivel 1 · muy baja**: quórum 12; 60 % como de costumbre, 50 % cuando vota todo el mundo. Ningún artículo al inicio.\n- **Nivel 2 · baja**: quórum 12; 67 % como de costumbre, 50 % cuando vota todo el mundo. Razón de ser, Unicidad de la cuenta, Reciprocidad, y el orden de los artículos de cada sección.\n- **Nivel 3 · media**: quórum 50; 75 % como de costumbre, 55 % cuando vota todo el mundo. El nivel por defecto: todos los demás artículos, y todo artículo nuevo.\n- **Nivel 4 · alta**: quórum 50; 83 % como de costumbre, 60 % cuando vota todo el mundo. El título del documento.\n- **Nivel 5 · muy alta**: quórum 50; 90 % como de costumbre, 66 % cuando vota todo el mundo. Ningún artículo al inicio.\n\n**La participación habitual** es la mediana del número de votantes de las propuestas del grupo votadas en el último año. Hasta que el grupo haya votado 5 propuestas, vale dos veces el quórum de referencia del documento: 100 votantes en Monnaie libre. No depende del quórum de un artículo. Se mantiene entre el 1 % y el 50 % del electorado, y se mide una vez al día.\n\n**G** se calcula para que la proporción exigida, con la participación habitual, sea exactamente la del nivel: `G = ln(1 − (s − M)/(1 − M)) / ln(p̃)`, donde s es la proporción exigida como de costumbre y p̃ la participación habitual dividida por W.\n\nEjemplo: con 7224 miembros y una participación habitual de 120 votantes, cuando votan 120 personas, hacen falta 72, 81, 90, 100 o 108 votos a favor, del nivel 1 al nivel 5; en el nivel 3, el 75 % de los 120 votantes, es decir 90. Por debajo del quórum, los que faltan cuentan como «no»: en el nivel 2 (quórum 12), 9 votos a favor pasan con 3 en contra como mucho; en el nivel 3 (quórum 50), hacen falta 39 votos a favor, con 11 en contra como mucho."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -226,6 +226,14 @@ async fn the_author_of_an_article_sets_its_quorum_before_the_first_vote() {
|
||||
assert_eq!((s, v["error"].as_str()), (StatusCode::CONFLICT, Some("voted")));
|
||||
// A vote on its change of inertia counts as well: it is the same article.
|
||||
assert!(ld_server::quorum::a_vote_exists(&state, &u).await.expect("query"));
|
||||
// Her vote withdrawn: in the test group (no buffer) it leaves no trace, and the author
|
||||
// sets the quorum again — « tant que l'article ne garde la trace d'aucun vote » (F1.2,
|
||||
// lot T2), not « ensuite, il ne change plus ».
|
||||
luna.vote(&text, None).await;
|
||||
assert!(!ld_server::quorum::a_vote_exists(&state, &u).await.expect("query"));
|
||||
assert_eq!(quorum_of(unit_by_id(&chiara.doc("essai").await, &u)), (Some(2), Some(1), Some(true)));
|
||||
let (s, v) = chiara.set(&u, json!(1)).await;
|
||||
assert_eq!(s, StatusCode::OK, "{v}");
|
||||
}
|
||||
|
||||
/// A ballot of the chain on a proposal, as the server writes it when a wallet asks.
|
||||
|
||||
@@ -7,9 +7,15 @@
|
||||
//! the rules of the texts (`docs/chantiers/acte-certification/textes-quorum-seed.md`).
|
||||
//! A guarded seed amendment replaces them in production, on a base made as production
|
||||
//! is after M6, only where nobody touched them.
|
||||
//!
|
||||
//! Lot T2 (2026-11-03, after the review of M6b): three phrases of these texts said more than
|
||||
//! the rules do — F1.1 « presque l'unanimité quand peu de gens votent », F1.2 « ensuite, il
|
||||
//! ne change plus », N1.1 « le groupe demande un quorum de votants ». A second guarded
|
||||
//! amendment, which follows lot T's, writes them true on a base made as production is
|
||||
//! after M6b; the texts of M6b are kept in `tests/fixtures/seed-quorum-m6b.json`.
|
||||
|
||||
use ld_engine::inertia::{InertiaLevel, Participation, Scale, gradient, quorum_bounds};
|
||||
use ld_engine::threshold::{FormulaParams, judged_voters, no_needed, required_ratio, yes_needed};
|
||||
use ld_engine::threshold::{FormulaParams, Tally, judged_voters, no_needed, passes, required_ratio, yes_needed};
|
||||
use ld_server::seed_amend::{self, AMENDMENTS, Version};
|
||||
use ld_server::{AppState, Config, open_db, seed};
|
||||
use serde_json::Value;
|
||||
@@ -50,6 +56,16 @@ fn rules_before() -> Value {
|
||||
read(fixtures().join("seed-regles-avant.json"))
|
||||
}
|
||||
|
||||
/// F1.1, F1.2 and N1.1 as lot T wrote them: production's since M6b (bb4bdf5), unchanged by M7.
|
||||
fn m6b_texts() -> Value {
|
||||
read(fixtures().join("seed-quorum-m6b.json"))
|
||||
}
|
||||
|
||||
/// The seed production runs since M6b: today's, with the texts of lot T.
|
||||
fn m6b_seed() -> Value {
|
||||
with_texts(&today_seed(), &m6b_texts(), &CODES)
|
||||
}
|
||||
|
||||
fn unit<'a>(seed: &'a Value, code: &str) -> &'a Value {
|
||||
seed["units"].as_array().expect("units").iter().find(|u| u["code"] == code).expect("unit")
|
||||
}
|
||||
@@ -470,6 +486,122 @@ fn every_number_of_the_quorum_texts_is_the_engine_s() {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Lot T2: the three phrases the review of M6b left inexact
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// (article, language, the words of M6b, the words of today): the only change of lot T2.
|
||||
const PHRASES: [(&str, &str, &str, &str); 9] = [
|
||||
(
|
||||
"F1.1",
|
||||
"fr",
|
||||
"parmi tous les votants : presque l'unanimité quand peu de gens votent, la majorité M quand tout le monde vote.",
|
||||
"parmi tous les votants : cette part est la plus haute au quorum et baisse quand la participation monte, jusqu'à la majorité M quand tout le monde vote.",
|
||||
),
|
||||
(
|
||||
"F1.1",
|
||||
"en",
|
||||
"among all the voters: near-unanimity when few people vote, the majority M when everyone votes.",
|
||||
"among all the voters: that share is highest at the quorum and falls as turnout rises, down to the majority M when everyone votes.",
|
||||
),
|
||||
(
|
||||
"F1.1",
|
||||
"es",
|
||||
"entre todos los votantes: casi la unanimidad cuando vota poca gente, la mayoría M cuando vota todo el mundo.",
|
||||
"entre todos los votantes: esa proporción es la más alta en el quórum y baja cuando sube la participación, hasta la mayoría M cuando vota todo el mundo.",
|
||||
),
|
||||
(
|
||||
"F1.2",
|
||||
"fr",
|
||||
"peut en fixer un autre tant que personne n'a voté sur l'article ; ensuite, il ne change plus.",
|
||||
"peut en fixer un autre tant que l'article ne garde la trace d'aucun vote.",
|
||||
),
|
||||
(
|
||||
"F1.2",
|
||||
"en",
|
||||
"can set another one as long as nobody has voted on the article; after that, it no longer changes.",
|
||||
"can set another one as long as the article keeps no trace of any vote.",
|
||||
),
|
||||
(
|
||||
"F1.2",
|
||||
"es",
|
||||
"puede fijar otro mientras nadie haya votado sobre el artículo; después, ya no cambia.",
|
||||
"puede fijar otro mientras el artículo no guarde rastro de ningún voto.",
|
||||
),
|
||||
(
|
||||
"N1.1",
|
||||
"fr",
|
||||
"À chaque cran, le groupe demande un quorum de votants, puis une part de « pour » parmi eux (voir « Formule du seuil WoT »). Sous le quorum, les votants qui manquent comptent comme « non ». La part dépend du cran et du nombre de votants, comparé à la participation habituelle du groupe : plus il y a de votants, plus elle baisse,",
|
||||
"À chaque cran, le groupe demande une part de « pour » parmi les votants (voir « Formule du seuil WoT »). Chaque cran a aussi son quorum, qui n'est pas un nombre minimal de votants : sous le quorum, les votants qui manquent comptent comme « non ». La part dépend du cran et du nombre de votants, comparé à la participation habituelle du groupe : au-delà du quorum, plus il y a de votants, plus elle baisse,",
|
||||
),
|
||||
(
|
||||
"N1.1",
|
||||
"en",
|
||||
"At each level, the group asks for a quorum of voters, then for a share of votes in favour among them (see “WoT threshold formula”). Below the quorum, the voters who are missing count as votes against. The share depends on the level and on the number of voters, compared with the group's usual turnout: the more voters, the lower it gets,",
|
||||
"At each level, the group asks for a share of votes in favour among the voters (see “WoT threshold formula”). Each level also has its quorum, which is not a minimum number of voters: below the quorum, the voters who are missing count as votes against. The share depends on the level and on the number of voters, compared with the group's usual turnout: beyond the quorum, the more voters, the lower it gets,",
|
||||
),
|
||||
(
|
||||
"N1.1",
|
||||
"es",
|
||||
"En cada nivel, el grupo pide un quórum de votantes, y luego una proporción de votos a favor entre ellos (ver «Fórmula del umbral WoT»). Por debajo del quórum, los votantes que faltan cuentan como «no». La proporción depende del nivel y del número de votantes, comparado con la participación habitual del grupo: cuantos más votantes, más baja,",
|
||||
"En cada nivel, el grupo pide una proporción de votos a favor entre los votantes (ver «Fórmula del umbral WoT»). Cada nivel tiene además su quórum, que no es un número mínimo de votantes: por debajo del quórum, los votantes que faltan cuentan como «no». La proporción depende del nivel y del número de votantes, comparado con la participación habitual del grupo: más allá del quórum, cuantos más votantes, más baja,",
|
||||
),
|
||||
];
|
||||
|
||||
#[test]
|
||||
fn the_three_phrases_of_the_review_of_m6b_are_written_true() {
|
||||
let (m6b, today) = (m6b_seed(), today_seed());
|
||||
for (code, lang, old, new) in PHRASES {
|
||||
assert!(text(&m6b, code, lang).1.contains(old), "{code} {lang}: the words of M6b");
|
||||
let (_, body) = text(&today, code, lang);
|
||||
assert!(!body.contains(old), "{code} {lang}: still the words of M6b\n{body}");
|
||||
assert!(body.contains(new), "{code} {lang}: missing « {new} »\n{body}");
|
||||
}
|
||||
// F1.1 and N1.1, by the engine: the share of a level is that of the quorum while fewer
|
||||
// vote, its highest; beyond, it falls as turnout rises, down to M when everyone votes —
|
||||
// never near-unanimity because few vote. Every level, quorum and electorate of the grid.
|
||||
for (w, median) in [(5707u32, None), (7224, Some(120.0)), (40, Some(9.0)), (2, Some(1.0))] {
|
||||
let p = Participation::of(w, 50.0, median, 9).ratio;
|
||||
let scale = Scale { electorate: w, participation: p, quorums: [12, 12, 50, 50, 50] };
|
||||
for k in InertiaLevel::ALL {
|
||||
for q in [1u32, 2, 12, 50].into_iter().filter(|q| *q <= w) {
|
||||
let params = scale.params(k, q);
|
||||
let share = |t: u32| required_ratio(w, judged_voters(t, q), ¶ms);
|
||||
let top = share(0);
|
||||
let mut last = top;
|
||||
for t in 0..=w {
|
||||
let s = share(t);
|
||||
assert!(s <= last, "W {w} k {} Q {q}: the share rises at {t} voters", k.get());
|
||||
if t <= q {
|
||||
assert_eq!(s, top, "W {w} k {} Q {q}: under the quorum, the share of the quorum", k.get());
|
||||
}
|
||||
last = s;
|
||||
}
|
||||
let m = k.majority_pct() / 100.0;
|
||||
assert!((share(w) - m).abs() < 1e-12, "W {w} k {} Q {q}: M when everyone votes", k.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
// N1.1: the quorum is no minimum of voters. In Monnaie libre (W 5 707 on 02/11, the
|
||||
// reference turnout), at every level, fewer voters than its quorum pass when they all
|
||||
// vote « pour »: 8 of 12, 9 of 12, 39 of 50, 43 of 50, 46 of 50.
|
||||
let w = 5707;
|
||||
let f = figures(&today);
|
||||
let scale = Scale { electorate: w, participation: Participation::of(w, 50.0, None, 0).ratio, quorums: f.quorums };
|
||||
let fewer: Vec<(u32, u32)> = InertiaLevel::ALL
|
||||
.iter()
|
||||
.map(|k| {
|
||||
let q = scale.quorum(*k, None);
|
||||
let p = scale.params(*k, q);
|
||||
let yes = yes_needed(0, w, &p).expect("valid");
|
||||
assert!(passes(Tally { for_votes: yes, against: 0 }, w, &p).expect("valid"));
|
||||
(yes, q)
|
||||
})
|
||||
.collect();
|
||||
assert_eq!(fewer, [(8, 12), (9, 12), (39, 50), (43, 50), (46, 50)]);
|
||||
assert!(fewer.iter().all(|(yes, q)| yes < q));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// The formulas: evaluated as written, against the engine
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -730,28 +862,27 @@ fn the_quorum_texts_follow_the_rules_of_form() {
|
||||
// Production: a guarded amendment, on a base made as production is after M6
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// The amendment of an article, by lot T.
|
||||
fn amendment_t(code: &str) -> &'static seed_amend::Amendment {
|
||||
/// The amendment of an article by lot T (`quorum`) or lot T2 (`phrases`).
|
||||
fn amendment(code: &str, lot: &str) -> &'static seed_amend::Amendment {
|
||||
AMENDMENTS
|
||||
.iter()
|
||||
.find(|a| a.unit == code && a.id.starts_with("2026-11-03-"))
|
||||
.unwrap_or_else(|| panic!("no amendment of lot T for {code}"))
|
||||
.find(|a| a.unit == code && a.id.starts_with("2026-11-03-") && a.id.ends_with(lot))
|
||||
.unwrap_or_else(|| panic!("no amendment « {lot} » for {code}"))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_shipped_amendments_go_from_production_to_the_seed_of_today() {
|
||||
let (prod, today) = (production_seed(), today_seed());
|
||||
fn the_amendments_of_lot_t_went_from_m5_to_the_texts_of_m6b() {
|
||||
let (prod, m6b) = (production_seed(), m6b_seed());
|
||||
for code in CODES {
|
||||
let a = amendment_t(code);
|
||||
let a = amendment(code, "-quorum");
|
||||
assert_eq!((a.doc, a.version), ("acte-engagement-certification", Version::Open("1.0.0")), "{code}");
|
||||
let (t, b) = text(&prod, code, "fr");
|
||||
assert_eq!(seed_amend::fingerprint(t, b), a.from, "{code}: the text production holds");
|
||||
let (t, b) = text(&today, code, "fr");
|
||||
assert_eq!(seed_amend::fingerprint(t, b), a.to, "{code}: the text of the seed today");
|
||||
assert_eq!(seed_amend::fingerprint(t, b), a.from, "{code}: the text production held before M6b");
|
||||
let (t, b) = text(&m6b, code, "fr");
|
||||
assert_eq!(seed_amend::fingerprint(t, b), a.to, "{code}: the text production holds since M6b");
|
||||
assert_ne!(a.from, a.to, "{code}");
|
||||
assert_eq!(a.superseded_by, None, "{code}");
|
||||
// F1.1 was never amended; F1.2 and N1.1 follow the amendment of M5, which wrote the
|
||||
// text they replace and which the seed no longer gives: it is superseded.
|
||||
// F1.1 was never amended before; F1.2 and N1.1 follow the amendment of M5, which wrote
|
||||
// the text they replace and which the seed no longer gives: it is superseded.
|
||||
match a.follows {
|
||||
None => assert_eq!(code, "F1.1"),
|
||||
Some(earlier) => {
|
||||
@@ -759,6 +890,41 @@ fn the_shipped_amendments_go_from_production_to_the_seed_of_today() {
|
||||
assert_eq!((m5.unit, m5.to, m5.superseded_by), (code, a.from, Some(a.id)), "{code}");
|
||||
}
|
||||
}
|
||||
// Lot T2 replaces its text: it is superseded in turn.
|
||||
assert_eq!(a.superseded_by, Some(amendment(code, "-phrases").id), "{code}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_amendments_of_lot_t2_go_from_the_texts_of_m6b_to_the_seed_of_today() {
|
||||
let (m6b, today) = (m6b_seed(), today_seed());
|
||||
for code in CODES {
|
||||
let a = amendment(code, "-phrases");
|
||||
let t = amendment(code, "-quorum");
|
||||
assert_eq!((a.doc, a.version), ("acte-engagement-certification", Version::Open("1.0.0")), "{code}");
|
||||
let (title, body) = text(&m6b, code, "fr");
|
||||
assert_eq!(seed_amend::fingerprint(title, body), a.from, "{code}: the text production holds");
|
||||
let (title, body) = text(&today, code, "fr");
|
||||
assert_eq!(seed_amend::fingerprint(title, body), a.to, "{code}: the text of the seed today");
|
||||
assert_ne!(a.from, a.to, "{code}");
|
||||
// It follows lot T's, which wrote the text it replaces; nothing replaces it yet.
|
||||
assert_eq!(
|
||||
(a.follows, t.to, t.superseded_by, a.superseded_by),
|
||||
(Some(t.id), a.from, Some(a.id), None),
|
||||
"{code}"
|
||||
);
|
||||
// The titles stay, and only the phrases of the review change (`PHRASES`).
|
||||
for lang in LANGS {
|
||||
let (before, now) = (text(&m6b, code, lang), text(&today, code, lang));
|
||||
assert_eq!(before.0, now.0, "{code} {lang}: the title is kept");
|
||||
let mut b = before.1.to_owned();
|
||||
for (c, l, old, new) in PHRASES {
|
||||
if (c, l) == (code, lang) {
|
||||
b = b.replacen(old, new, 1);
|
||||
}
|
||||
}
|
||||
assert_eq!(b, now.1, "{code} {lang}: nothing else changes");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -827,32 +993,40 @@ async fn kinds(state: &AppState, id: &str) -> Vec<String> {
|
||||
.expect("revisions")
|
||||
}
|
||||
|
||||
/// Each decision of lot T: (group, unit, outcome, reason).
|
||||
async fn decisions(state: &AppState) -> Vec<(String, String, String, Option<String>)> {
|
||||
/// Each decision of lot T (`-quorum`) or lot T2 (`-phrases`): (group, unit, outcome, reason).
|
||||
async fn decisions(state: &AppState, lot: &str) -> Vec<(String, String, String, Option<String>)> {
|
||||
sqlx::query_as(
|
||||
"SELECT d.group_slug, s.unit_code, s.outcome, s.reason FROM seed_amendments s
|
||||
JOIN documents d ON d.id = s.doc_id
|
||||
WHERE s.amendment_id LIKE '2026-11-03-%' ORDER BY d.group_slug, s.unit_code",
|
||||
WHERE s.amendment_id LIKE ? ORDER BY d.group_slug, s.unit_code",
|
||||
)
|
||||
.bind(format!("2026-11-03-%{lot}"))
|
||||
.fetch_all(&state.db)
|
||||
.await
|
||||
.expect("decisions")
|
||||
}
|
||||
|
||||
async fn queued(state: &AppState) -> Vec<(String, String)> {
|
||||
sqlx::query_as(
|
||||
"SELECT d.group_slug, o.reason FROM outbox o JOIN documents d ON d.id = o.doc_id
|
||||
WHERE o.reason LIKE '%quorum par cran%' ORDER BY o.id",
|
||||
)
|
||||
.fetch_all(&state.db)
|
||||
.await
|
||||
.expect("outbox")
|
||||
/// The rows the amendments of a lot added to the publication queue: (group, reason).
|
||||
async fn queued(state: &AppState, lot: &str) -> Vec<(String, String)> {
|
||||
let reasons: Vec<&str> = CODES.iter().map(|c| amendment(c, lot).reason).collect();
|
||||
let rows: Vec<(String, String)> =
|
||||
sqlx::query_as("SELECT d.group_slug, o.reason FROM outbox o JOIN documents d ON d.id = o.doc_id ORDER BY o.id")
|
||||
.fetch_all(&state.db)
|
||||
.await
|
||||
.expect("outbox");
|
||||
rows.into_iter().filter(|(_, r)| reasons.contains(&r.as_str())).collect()
|
||||
}
|
||||
|
||||
/// A start with the seed of M6b (bb4bdf5, and M7 since): lot T decides, lot T2 does not yet.
|
||||
fn m6b_config(tag: &str) -> Config {
|
||||
config(seed_dir(&format!("{tag}-m6b"), &m6b_seed()))
|
||||
}
|
||||
|
||||
/// Lot T, as M6b played it on production (03/11, 08 h 02): started with the seed of M6b.
|
||||
#[tokio::test]
|
||||
async fn production_after_m6_gets_the_quorum_texts_once() {
|
||||
let base = production_after_m6("apply").await;
|
||||
let (prod, today) = (production_seed(), today_seed());
|
||||
let (prod, today) = (production_seed(), m6b_seed());
|
||||
// The base is as production after M6: F1.1 as born, F1.2 and N1.1 as M5 wrote them.
|
||||
for group in GROUPS {
|
||||
for code in CODES {
|
||||
@@ -873,11 +1047,11 @@ async fn production_after_m6_gets_the_quorum_texts_once() {
|
||||
.await
|
||||
.expect("count");
|
||||
assert_eq!((seed_proposals, quorums), (6, 2), "M6: seed proposals and quorums written");
|
||||
assert!(decisions(&base).await.is_empty(), "the seed of M6 decides nothing of lot T");
|
||||
assert!(decisions(&base, "-quorum").await.is_empty(), "the seed of M6 decides nothing of lot T");
|
||||
let (before, before_tr) = (proposals(&base).await, translations(&base).await);
|
||||
|
||||
// Started with today's seed.
|
||||
let state = start(&base.db, Config::for_tests()).await;
|
||||
// Started with the seed of M6b.
|
||||
let state = start(&base.db, m6b_config("apply")).await;
|
||||
let mut touched = Vec::new();
|
||||
for group in GROUPS {
|
||||
for code in CODES {
|
||||
@@ -916,7 +1090,8 @@ async fn production_after_m6_gets_the_quorum_texts_once() {
|
||||
.iter()
|
||||
.flat_map(|g| CODES.iter().map(move |c| ((*g).to_owned(), (*c).to_owned(), "applied".to_owned(), None)))
|
||||
.collect();
|
||||
assert_eq!(decisions(&state).await, expected);
|
||||
assert_eq!(decisions(&state, "-quorum").await, expected);
|
||||
assert!(decisions(&state, "-phrases").await.is_empty(), "the seed of M6b decides nothing of lot T2");
|
||||
// Nothing else is touched: no other proposal, no other translation, no vote.
|
||||
let keep = |rows: Vec<Row>| rows.into_iter().filter(|r| !touched.contains(&r.0)).collect::<Vec<_>>();
|
||||
assert_eq!(keep(proposals(&state).await), keep(before.clone()));
|
||||
@@ -927,14 +1102,14 @@ async fn production_after_m6_gets_the_quorum_texts_once() {
|
||||
let votes: i64 = sqlx::query_scalar("SELECT COUNT(*) FROM votes").fetch_one(&state.db).await.expect("votes");
|
||||
assert_eq!(votes, 0);
|
||||
// Monnaie libre republishes, once per article; the test group never.
|
||||
let rows = queued(&state).await;
|
||||
let rows = queued(&state, "-quorum").await;
|
||||
assert_eq!(rows.len(), 3, "{rows:?}");
|
||||
assert!(rows.iter().all(|(g, _)| g == "monnaie-libre"), "{rows:?}");
|
||||
// Decided once: a second start changes nothing.
|
||||
let again = start(&state.db, Config::for_tests()).await;
|
||||
assert_eq!(decisions(&again).await, expected);
|
||||
let again = start(&state.db, m6b_config("apply-again")).await;
|
||||
assert_eq!(decisions(&again, "-quorum").await, expected);
|
||||
assert_eq!(proposals(&again).await, proposals(&state).await);
|
||||
assert_eq!(queued(&again).await.len(), 3);
|
||||
assert_eq!(queued(&again, "-quorum").await.len(), 3);
|
||||
}
|
||||
|
||||
async fn identity(state: &AppState, id: &str) {
|
||||
@@ -948,6 +1123,7 @@ async fn identity(state: &AppState, id: &str) {
|
||||
.expect("identity");
|
||||
}
|
||||
|
||||
/// Lot T's guard, as M6b played it: started with the seed of M6b.
|
||||
#[tokio::test]
|
||||
async fn a_vote_a_ballot_or_a_member_s_translation_keeps_the_text_of_before() {
|
||||
let base = production_after_m6("refuse").await;
|
||||
@@ -993,12 +1169,12 @@ async fn a_vote_a_ballot_or_a_member_s_translation_keeps_the_text_of_before() {
|
||||
.await
|
||||
.expect("translation");
|
||||
|
||||
let state = start(&base.db, Config::for_tests()).await;
|
||||
let state = start(&base.db, m6b_config("refuse")).await;
|
||||
let refused =
|
||||
|g: &str, c: &str, why: &str| (g.to_owned(), c.to_owned(), "refused".to_owned(), Some(why.to_owned()));
|
||||
let applied = |g: &str, c: &str| (g.to_owned(), c.to_owned(), "applied".to_owned(), None);
|
||||
assert_eq!(
|
||||
decisions(&state).await,
|
||||
decisions(&state, "-quorum").await,
|
||||
[
|
||||
refused("essai", "F1.1", "translation_edited"),
|
||||
applied("essai", "F1.2"),
|
||||
@@ -1008,7 +1184,7 @@ async fn a_vote_a_ballot_or_a_member_s_translation_keeps_the_text_of_before() {
|
||||
refused("monnaie-libre", "N1.1", "ballots"),
|
||||
]
|
||||
);
|
||||
let (prod, today) = (production_seed(), today_seed());
|
||||
let (prod, today) = (production_seed(), m6b_seed());
|
||||
for (group, code, kept) in [
|
||||
("essai", "F1.1", true),
|
||||
("essai", "F1.2", false),
|
||||
@@ -1023,14 +1199,14 @@ async fn a_vote_a_ballot_or_a_member_s_translation_keeps_the_text_of_before() {
|
||||
assert_eq!(revision, 1 + m5 + i64::from(!kept), "{group} {code}");
|
||||
}
|
||||
// Republished for the one article applied in Monnaie libre only.
|
||||
let rows = queued(&state).await;
|
||||
let rows = queued(&state, "-quorum").await;
|
||||
assert_eq!(
|
||||
rows.iter().map(|(g, r)| (g.as_str(), r.contains("F1.1"))).collect::<Vec<_>>(),
|
||||
[("monnaie-libre", true)]
|
||||
);
|
||||
// The refusal stands: decided once, it is not tried again.
|
||||
let again = start(&state.db, Config::for_tests()).await;
|
||||
assert_eq!(decisions(&again).await, decisions(&state).await);
|
||||
let again = start(&state.db, m6b_config("refuse-again")).await;
|
||||
assert_eq!(decisions(&again, "-quorum").await, decisions(&state, "-quorum").await);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
@@ -1044,15 +1220,308 @@ async fn a_new_base_is_born_with_the_quorum_texts() {
|
||||
assert_eq!(((title.as_str(), body.as_str()), revision), (text(&today, code, "fr"), 1), "{group} {code}");
|
||||
}
|
||||
}
|
||||
let got = decisions(&state).await;
|
||||
// Lot T2's amendments find their text there: present.
|
||||
let got = decisions(&state, "-phrases").await;
|
||||
assert_eq!(got.len(), 6);
|
||||
assert!(got.iter().all(|(_, _, o, _)| o == "present"), "{got:?}");
|
||||
// The amendments of M5 on F1.2 and N1.1, superseded, decide nothing on a new base.
|
||||
// The amendments of M5 and of lot T on these articles, superseded, decide nothing on a
|
||||
// new base.
|
||||
let m5: Vec<String> = sqlx::query_scalar(
|
||||
"SELECT unit_code FROM seed_amendments WHERE amendment_id IN ('2026-11-02-f1-2-regles', '2026-11-02-n1-1-regles')",
|
||||
"SELECT amendment_id FROM seed_amendments
|
||||
WHERE amendment_id IN ('2026-11-02-f1-2-regles', '2026-11-02-n1-1-regles') OR amendment_id LIKE '2026-11-03-%-quorum'",
|
||||
)
|
||||
.fetch_all(&state.db)
|
||||
.await
|
||||
.expect("m5");
|
||||
assert!(m5.is_empty(), "{m5:?}");
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Lot T2 in production: on a base made as production is after M6b
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// Production's history, for these articles, after M6b (03/11, 08 h 02): F1.1 at its
|
||||
/// revision 2, F1.2 and N1.1 at their revision 3, each written by an amendment of the seed.
|
||||
async fn production_after_m6b(tag: &str) -> AppState {
|
||||
let base = production_after_m6(tag).await;
|
||||
start(&base.db, m6b_config(tag)).await
|
||||
}
|
||||
|
||||
async fn count(state: &AppState, sql: &str) -> i64 {
|
||||
sqlx::query_scalar(sql).fetch_one(&state.db).await.expect("count")
|
||||
}
|
||||
|
||||
/// The last revision of a proposal: (revision, kind, title, body, author).
|
||||
async fn last_revision(state: &AppState, id: &str) -> (i64, String, String, String, Option<String>) {
|
||||
sqlx::query_as(
|
||||
"SELECT revision, kind, title, body, author_id FROM revisions WHERE proposal_id = ? ORDER BY id DESC LIMIT 1",
|
||||
)
|
||||
.bind(id)
|
||||
.fetch_one(&state.db)
|
||||
.await
|
||||
.expect("revision")
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn production_after_m6b_gets_the_three_phrases_once() {
|
||||
let base = production_after_m6b("t2-apply").await;
|
||||
let (m6b, today) = (m6b_seed(), today_seed());
|
||||
// The base is as production after M6b: the texts of lot T, at revision 2 and 3.
|
||||
for group in GROUPS {
|
||||
for code in CODES {
|
||||
let (id, title, body, revision) = proposal(&base, group, code).await;
|
||||
assert_eq!((title.as_str(), body.as_str()), text(&m6b, code, "fr"), "{group} {code}");
|
||||
let m5 = code != "F1.1";
|
||||
assert_eq!(revision, if m5 { 3 } else { 2 }, "{group} {code}");
|
||||
let expected: &[&str] = if m5 { &["initial", "amendment", "amendment"] } else { &["initial", "amendment"] };
|
||||
assert_eq!(kinds(&base, &id).await, expected, "{group} {code}");
|
||||
}
|
||||
}
|
||||
let lot_t = decisions(&base, "-quorum").await;
|
||||
assert_eq!(lot_t.len(), 6);
|
||||
assert!(lot_t.iter().all(|(_, _, o, _)| o == "applied"), "{lot_t:?}");
|
||||
assert!(decisions(&base, "-phrases").await.is_empty(), "the seed of M6b decides nothing of lot T2");
|
||||
let (before, before_tr) = (proposals(&base).await, translations(&base).await);
|
||||
let outbox = count(&base, "SELECT COUNT(*) FROM outbox").await;
|
||||
let revisions = count(&base, "SELECT COUNT(*) FROM revisions").await;
|
||||
|
||||
// Started with today's seed.
|
||||
let state = start(&base.db, Config::for_tests()).await;
|
||||
let mut touched = Vec::new();
|
||||
for group in GROUPS {
|
||||
for code in CODES {
|
||||
let (id, title, body, revision) = proposal(&state, group, code).await;
|
||||
assert_eq!((title.as_str(), body.as_str()), text(&today, code, "fr"), "{group} {code}");
|
||||
let m5 = code != "F1.1";
|
||||
assert_eq!(revision, if m5 { 4 } else { 3 }, "{group} {code}");
|
||||
let mut expected = vec!["initial", "amendment", "amendment"];
|
||||
if m5 {
|
||||
expected.push("amendment");
|
||||
}
|
||||
assert_eq!(kinds(&state, &id).await, expected, "{group} {code}");
|
||||
// The history keeps the text of lot T, and says the new one, without author.
|
||||
assert_eq!(
|
||||
last_revision(&state, &id).await,
|
||||
(revision, "amendment".to_owned(), title.clone(), body.clone(), None),
|
||||
"{group} {code}"
|
||||
);
|
||||
let (_, kind, t, b, _) = sqlx::query_as::<_, (i64, String, String, String, Option<String>)>(
|
||||
"SELECT revision, kind, title, body, author_id FROM revisions WHERE proposal_id = ? AND revision = ?",
|
||||
)
|
||||
.bind(&id)
|
||||
.bind(revision - 1)
|
||||
.fetch_one(&state.db)
|
||||
.await
|
||||
.expect("revision of lot T");
|
||||
assert_eq!(
|
||||
(kind.as_str(), (t.as_str(), b.as_str())),
|
||||
("amendment", text(&m6b, code, "fr")),
|
||||
"{group} {code}"
|
||||
);
|
||||
for lang in ["en", "es"] {
|
||||
let (t, b, hash, origin, by): (String, String, String, String, Option<String>) = sqlx::query_as(
|
||||
"SELECT title, body, source_hash, origin, updated_by FROM translations WHERE proposal_id = ? AND lang = ?",
|
||||
)
|
||||
.bind(&id)
|
||||
.bind(lang)
|
||||
.fetch_one(&state.db)
|
||||
.await
|
||||
.expect("translation");
|
||||
assert_eq!((t.as_str(), b.as_str()), text(&today, code, lang), "{group} {code} {lang}");
|
||||
assert_eq!(hash, seed_amend::fingerprint(&title, &body), "{group} {code} {lang}: up to date");
|
||||
assert_eq!((origin.as_str(), by), ("seed", None));
|
||||
}
|
||||
touched.push(id);
|
||||
}
|
||||
}
|
||||
let expected: Vec<(String, String, String, Option<String>)> = GROUPS
|
||||
.iter()
|
||||
.flat_map(|g| CODES.iter().map(move |c| ((*g).to_owned(), (*c).to_owned(), "applied".to_owned(), None)))
|
||||
.collect();
|
||||
assert_eq!(decisions(&state, "-phrases").await, expected);
|
||||
// Lot T's decisions stay as they were taken; superseded, it decides nothing more.
|
||||
assert_eq!(decisions(&state, "-quorum").await, lot_t);
|
||||
// Nothing else is touched: no other proposal, no other translation, no vote, six revisions.
|
||||
let keep = |rows: Vec<Row>| rows.into_iter().filter(|r| !touched.contains(&r.0)).collect::<Vec<_>>();
|
||||
assert_eq!(keep(proposals(&state).await), keep(before));
|
||||
let others = |rows: Vec<(String, String, String, String, String)>| {
|
||||
rows.into_iter().filter(|r| !touched.contains(&r.0)).collect::<Vec<_>>()
|
||||
};
|
||||
assert_eq!(others(translations(&state).await), others(before_tr));
|
||||
assert_eq!(count(&state, "SELECT COUNT(*) FROM votes").await, 0);
|
||||
assert_eq!(count(&state, "SELECT COUNT(*) FROM revisions").await, revisions + 6);
|
||||
// Monnaie libre republishes, once per article; the test group never.
|
||||
let rows = queued(&state, "-phrases").await;
|
||||
assert_eq!(rows.len(), 3, "{rows:?}");
|
||||
assert!(rows.iter().all(|(g, _)| g == "monnaie-libre"), "{rows:?}");
|
||||
assert_eq!(count(&state, "SELECT COUNT(*) FROM outbox").await, outbox + 3);
|
||||
// Decided once: a second start replays nothing.
|
||||
let again = start(&state.db, Config::for_tests()).await;
|
||||
assert_eq!(decisions(&again, "-phrases").await, expected);
|
||||
assert_eq!(proposals(&again).await, proposals(&state).await);
|
||||
assert_eq!(translations(&again).await, translations(&state).await);
|
||||
assert_eq!(count(&again, "SELECT COUNT(*) FROM revisions").await, revisions + 6);
|
||||
assert_eq!(count(&again, "SELECT COUNT(*) FROM outbox").await, outbox + 3);
|
||||
}
|
||||
|
||||
/// A person, voting through the interface's own routes (no chain in the test group).
|
||||
struct Voter {
|
||||
router: axum::Router,
|
||||
cookie: String,
|
||||
}
|
||||
|
||||
impl Voter {
|
||||
async fn call(&self, method: &str, uri: &str, body: Value, cookie: Option<&str>) -> axum::response::Response {
|
||||
use tower::ServiceExt;
|
||||
let mut req = axum::http::Request::builder()
|
||||
.method(method)
|
||||
.uri(uri)
|
||||
.header(ld_server::CSRF_HEADER, ld_server::CSRF_VALUE)
|
||||
.header(axum::http::header::CONTENT_TYPE, "application/json");
|
||||
if let Some(c) = cookie {
|
||||
req = req.header(axum::http::header::COOKIE, c);
|
||||
}
|
||||
let req = req.body(axum::body::Body::from(body.to_string())).expect("request");
|
||||
self.router.clone().oneshot(req).await.expect("response")
|
||||
}
|
||||
|
||||
async fn login(state: &AppState, name: &str) -> Self {
|
||||
let mut v = Self { router: ld_server::app(state.clone()), cookie: String::new() };
|
||||
let res = v.call("POST", "/api/auth/dev", serde_json::json!({ "name": name }), None).await;
|
||||
assert_eq!(res.status(), axum::http::StatusCode::OK);
|
||||
let set = res.headers().get(axum::http::header::SET_COOKIE).expect("cookie").to_str().expect("cookie");
|
||||
v.cookie = set.split(';').next().expect("cookie").to_owned();
|
||||
v
|
||||
}
|
||||
|
||||
async fn vote(&self, proposal: &str, choice: Option<&str>) {
|
||||
let uri = format!("/api/proposals/{proposal}/vote");
|
||||
let res = self.call("POST", &uri, serde_json::json!({ "choice": choice }), Some(&self.cookie)).await;
|
||||
assert_eq!(res.status(), axum::http::StatusCode::OK, "{uri} {choice:?}");
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn an_article_voted_on_keeps_the_text_of_m6b_and_says_why() {
|
||||
let base = production_after_m6b("t2-refuse").await;
|
||||
let doc: String = sqlx::query_scalar("SELECT id FROM documents WHERE group_slug = 'monnaie-libre'")
|
||||
.fetch_one(&base.db)
|
||||
.await
|
||||
.expect("doc");
|
||||
identity(&base, "dev:vera").await;
|
||||
// In Monnaie libre, a simulated vote on F1.1, at its revision 2…
|
||||
let (f11, ..) = proposal(&base, "monnaie-libre", "F1.1").await;
|
||||
sqlx::query(
|
||||
"INSERT INTO votes (proposal_id, identity_id, choice, revision, cast_at, source)
|
||||
VALUES (?, 'dev:vera', 'against', 2, '2026-11-03T09:00:00Z', 'simulated')",
|
||||
)
|
||||
.bind(&f11)
|
||||
.execute(&base.db)
|
||||
.await
|
||||
.expect("vote");
|
||||
// …and a ballot still pending on F1.2, at its revision 3: cast, not proven yet.
|
||||
let (f12, ..) = proposal(&base, "monnaie-libre", "F1.2").await;
|
||||
sqlx::query(
|
||||
"INSERT INTO ballots (id, doc_id, requested_by, salt, digest, remark_hash, account, amount, status, mode,
|
||||
created_at, expires_at)
|
||||
VALUES ('b2', ?, 'dev:vera', 'salt', 'digest-b2', 'remark-b2', '', 0, 'pending', 'simulated',
|
||||
'2026-11-03T09:00:00Z', '2026-11-04T09:00:00Z')",
|
||||
)
|
||||
.bind(&doc)
|
||||
.execute(&base.db)
|
||||
.await
|
||||
.expect("ballot");
|
||||
sqlx::query("INSERT INTO ballot_lines (ballot_id, proposal_id, revision, choice) VALUES ('b2', ?, 3, 'against')")
|
||||
.bind(&f12)
|
||||
.execute(&base.db)
|
||||
.await
|
||||
.expect("line");
|
||||
// In the test group, Luna votes « contre » N1.1 and keeps her vote (a « pour » would pass
|
||||
// there, quorum 1); she votes on F1.2, then withdraws: a direct vote withdrawn leaves no
|
||||
// trace (the guard's known limit, `seed_amend`).
|
||||
let luna = Voter::login(&base, "Luna").await;
|
||||
let (n11, ..) = proposal(&base, "essai", "N1.1").await;
|
||||
luna.vote(&n11, Some("against")).await;
|
||||
let (f12_essai, ..) = proposal(&base, "essai", "F1.2").await;
|
||||
luna.vote(&f12_essai, Some("against")).await;
|
||||
luna.vote(&f12_essai, None).await;
|
||||
let traces = |id: String| {
|
||||
let state = base.clone();
|
||||
async move {
|
||||
let sql = "SELECT (SELECT COUNT(*) FROM votes WHERE proposal_id = ?1)
|
||||
+ (SELECT COUNT(*) FROM ballot_lines WHERE proposal_id = ?1)";
|
||||
sqlx::query_scalar::<_, i64>(sql).bind(id).fetch_one(&state.db).await.expect("traces")
|
||||
}
|
||||
};
|
||||
assert_eq!((traces(n11.clone()).await, traces(f12_essai.clone()).await), (1, 0));
|
||||
|
||||
let state = start(&base.db, Config::for_tests()).await;
|
||||
let refused =
|
||||
|g: &str, c: &str, why: &str| (g.to_owned(), c.to_owned(), "refused".to_owned(), Some(why.to_owned()));
|
||||
let applied = |g: &str, c: &str| (g.to_owned(), c.to_owned(), "applied".to_owned(), None);
|
||||
assert_eq!(
|
||||
decisions(&state, "-phrases").await,
|
||||
[
|
||||
applied("essai", "F1.1"),
|
||||
applied("essai", "F1.2"),
|
||||
refused("essai", "N1.1", "votes"),
|
||||
refused("monnaie-libre", "F1.1", "votes"),
|
||||
refused("monnaie-libre", "F1.2", "ballots"),
|
||||
applied("monnaie-libre", "N1.1"),
|
||||
]
|
||||
);
|
||||
let (m6b, today) = (m6b_seed(), today_seed());
|
||||
for group in GROUPS {
|
||||
for code in CODES {
|
||||
let kept = matches!((group, code), ("essai", "N1.1") | ("monnaie-libre", "F1.1" | "F1.2"));
|
||||
let (_, title, body, revision) = proposal(&state, group, code).await;
|
||||
let expected = if kept { text(&m6b, code, "fr") } else { text(&today, code, "fr") };
|
||||
assert_eq!((title.as_str(), body.as_str()), expected, "{group} {code}");
|
||||
let lot_t = if code == "F1.1" { 2 } else { 3 };
|
||||
assert_eq!(revision, lot_t + i64::from(!kept), "{group} {code}");
|
||||
}
|
||||
}
|
||||
// Republished for the one article applied in Monnaie libre only.
|
||||
let rows = queued(&state, "-phrases").await;
|
||||
assert_eq!(
|
||||
rows.iter().map(|(g, r)| (g.as_str(), r.contains("N1.1"))).collect::<Vec<_>>(),
|
||||
[("monnaie-libre", true)]
|
||||
);
|
||||
// The refusals stand: decided once, never tried again, even once the vote is gone.
|
||||
sqlx::query("DELETE FROM votes WHERE proposal_id = ?").bind(&f11).execute(&state.db).await.expect("delete");
|
||||
let again = start(&state.db, Config::for_tests()).await;
|
||||
assert_eq!(decisions(&again, "-phrases").await, decisions(&state, "-phrases").await);
|
||||
let (_, title, body, _) = proposal(&again, "monnaie-libre", "F1.1").await;
|
||||
assert_eq!((title.as_str(), body.as_str()), text(&m6b, "F1.1", "fr"));
|
||||
}
|
||||
|
||||
/// A base born on 02/11 with the seed of M5 (F1.2 and N1.1 at their revision 1, in M5's
|
||||
/// words): lot T wrote their revision 2, and lot T2 follows it there too.
|
||||
#[tokio::test]
|
||||
async fn a_base_born_with_the_texts_of_m5_gets_the_three_phrases() {
|
||||
let prod = production_seed();
|
||||
let db = open_db("sqlite::memory:").await.expect("db");
|
||||
let first = AppState::new(config(seed_dir("t2-born-m5", &prod)), db.clone()).await.expect("state");
|
||||
seed::documents(&first).await.expect("born");
|
||||
start(&db, config(seed_dir("t2-born-m5-m5", &prod))).await;
|
||||
start(&db, config(seed_dir("t2-born-m5-m6", &with_texts(&today_seed(), &prod, &CODES)))).await;
|
||||
let base = start(&db, m6b_config("t2-born-m5")).await;
|
||||
for group in GROUPS {
|
||||
for code in CODES {
|
||||
let (id, ..) = proposal(&base, group, code).await;
|
||||
assert_eq!(kinds(&base, &id).await, ["initial", "amendment"], "{group} {code}: lot T, alone");
|
||||
}
|
||||
}
|
||||
let state = start(&db, Config::for_tests()).await;
|
||||
let today = today_seed();
|
||||
for group in GROUPS {
|
||||
for code in CODES {
|
||||
let (id, title, body, revision) = proposal(&state, group, code).await;
|
||||
assert_eq!(((title.as_str(), body.as_str()), revision), (text(&today, code, "fr"), 3), "{group} {code}");
|
||||
assert_eq!(kinds(&state, &id).await, ["initial", "amendment", "amendment"], "{group} {code}");
|
||||
}
|
||||
}
|
||||
let got = decisions(&state, "-phrases").await;
|
||||
assert_eq!(got.len(), 6);
|
||||
assert!(got.iter().all(|(_, _, o, _)| o == "applied"), "{got:?}");
|
||||
}
|
||||
|
||||
@@ -120,16 +120,17 @@ fn the_shipped_amendments_go_from_the_texts_of_before_to_the_seed_of_m5() {
|
||||
let (t, b) = fr(v);
|
||||
assert_eq!(seed_amend::fingerprint(t, b), a.to, "{code}: the text of the seed of M5");
|
||||
assert_ne!(a.from, a.to, "{code}");
|
||||
// Today's seed gives it, or another text whose amendment follows this one.
|
||||
// Today's seed gives it, or the text of the last of the amendments that follow it,
|
||||
// each replacing the text of the one before (lot T, then lot T2, on 03/11).
|
||||
let (t, b) = fr(version(&today, code));
|
||||
let now = seed_amend::fingerprint(t, b);
|
||||
match a.superseded_by {
|
||||
None => assert_eq!(now, a.to, "{code}: still the text of today"),
|
||||
Some(later) => {
|
||||
let l = AMENDMENTS.iter().find(|l| l.id == later).expect("the later amendment");
|
||||
assert_eq!((l.unit, l.follows, l.from, l.to), (code, Some(a.id), a.to, now.as_str()), "{code}");
|
||||
}
|
||||
let mut last = a;
|
||||
while let Some(later) = last.superseded_by {
|
||||
let l = AMENDMENTS.iter().find(|l| l.id == later).expect("the later amendment");
|
||||
assert_eq!((l.unit, l.follows, l.from), (code, Some(last.id), last.to), "{code}: {}", l.id);
|
||||
last = l;
|
||||
}
|
||||
assert_eq!(now, last.to, "{code}: the text of today");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"_source": "maquette/frontend/app/data/seeds/duniter-g1.bundle.json (doc engagement-certification, 33 clauses + 2 variantes). Aucun article en vigueur au départ. I1, E1, E2 : Propositions seed (« seedProposal »), ouvertes, mises en avant pour amorcer le vote, sans niveau d'inertie ici : elles démarrent au cran SEED_PROPOSAL_LEVEL (crates/ld-server/src/seed.rs : 2 « basse », choix d'Yvv du 2026-11-02, qui remontera leur inertie par un vote une fois les textes passés ; ADR 0011). Tant qu'aucun article n'est en vigueur, la publication attend le premier texte. Tout le reste : propositions ouvertes à 0 vote (Yvv, 2026-10-21), inertie 3 / 5. I1 « Raison d'être » remplace le Préambule (texte d'Yvv, revue du 2026-10-30). Modules : le titre du document à 4, l'ordre des articles de chaque section à 2, en vigueur sans vote (seed a minima ; revue du 2026-10-30, ADR 0009). F1.2, N1, N1.1, O1 réécrits selon les règles appliquées (Yvv, 2026-11-02). Quorums par cran (« quorums », ADR 0013, Yvv, 2026-11-02 et 03) : 12 · 12 · 50 · 50 · 50 dans Monnaie libre, 1 partout dans le groupe d'essai ; sous le quorum, les votants qui manquent comptent comme « non » ; voteFloor reste le quorum de référence de la participation p0 = 2 × voteFloor / W. Une base existante reçoit ces changements par des amendements gardés (seed_amend, seed_proposal_amend, quorum_amend), jamais en réinstanciant le document. F1.1, F1.2 et N1.1 réécrits pour le quorum par cran (ADR 0013 ; Yvv, 2026-11-02 et 03 ; lot T, textes relus dans docs/chantiers/acte-certification/textes-quorum-seed.md) : sous le quorum, les votants qui manquent comptent comme « non » ; au-delà, la part du cran.",
|
||||
"_source": "maquette/frontend/app/data/seeds/duniter-g1.bundle.json (doc engagement-certification, 33 clauses + 2 variantes). Aucun article en vigueur au départ. I1, E1, E2 : Propositions seed (« seedProposal »), ouvertes, mises en avant pour amorcer le vote, sans niveau d'inertie ici : elles démarrent au cran SEED_PROPOSAL_LEVEL (crates/ld-server/src/seed.rs : 2 « basse », choix d'Yvv du 2026-11-02, qui remontera leur inertie par un vote une fois les textes passés ; ADR 0011). Tant qu'aucun article n'est en vigueur, la publication attend le premier texte. Tout le reste : propositions ouvertes à 0 vote (Yvv, 2026-10-21), inertie 3 / 5. I1 « Raison d'être » remplace le Préambule (texte d'Yvv, revue du 2026-10-30). Modules : le titre du document à 4, l'ordre des articles de chaque section à 2, en vigueur sans vote (seed a minima ; revue du 2026-10-30, ADR 0009). F1.2, N1, N1.1, O1 réécrits selon les règles appliquées (Yvv, 2026-11-02). Quorums par cran (« quorums », ADR 0013, Yvv, 2026-11-02 et 03) : 12 · 12 · 50 · 50 · 50 dans Monnaie libre, 1 partout dans le groupe d'essai ; sous le quorum, les votants qui manquent comptent comme « non » ; voteFloor reste le quorum de référence de la participation p0 = 2 × voteFloor / W. Une base existante reçoit ces changements par des amendements gardés (seed_amend, seed_proposal_amend, quorum_amend), jamais en réinstanciant le document. F1.1, F1.2 et N1.1 réécrits pour le quorum par cran (ADR 0013 ; Yvv, 2026-11-02 et 03 ; lot T, textes relus dans docs/chantiers/acte-certification/textes-quorum-seed.md) : sous le quorum, les votants qui manquent comptent comme « non » ; au-delà, la part du cran. Trois phrases reprises après la relecture de M6b (lot T2) : la part du cran, la plus haute au quorum, baisse quand la participation monte (F1.1) ; l'auteur fixe le quorum tant que l'article ne garde la trace d'aucun vote (F1.2) ; le quorum n'est pas un nombre minimal de votants (N1.1).",
|
||||
"slug": "acte-engagement-certification",
|
||||
"title": {
|
||||
"fr": "Acte d'engagement Certification",
|
||||
@@ -672,9 +672,9 @@
|
||||
"es": "Fórmula del umbral WoT"
|
||||
},
|
||||
"body": {
|
||||
"fr": "Le seuil est le nombre de voix pour qu'il faut à une version pour entrer en vigueur. Sous le quorum Q, les votants qui manquent comptent comme « non » : le seuil se calcule comme si Q personnes avaient voté. Au-delà, il faut la part de « pour » que demande le cran d'inertie de l'article, parmi tous les votants : presque l'unanimité quand peu de gens votent, la majorité M quand tout le monde vote.\n\n`T' = max(T, Q)`\n`Seuil = B^W + (M + (1 − M) × (1 − (T'/W)^G)) × T'`\n\nUne version passe quand ses voix pour atteignent le seuil, arrondi à l'entier au-dessus.\n\n- **T** : les votes exprimés sur la version, pour et contre.\n- **Q** : le quorum de l'article ; **T'** : les votants retenus, T, ou Q s'il en manque.\n- **W** : le nombre de membres de la toile de confiance Ğ1.\n- **B** : la base ; à la puissance W, elle est si petite qu'elle ne compte pas.\n- **M** : la majorité demandée quand tout le monde vote.\n- **G** : le gradient : plus il est grand, plus la part demandée monte quand peu de gens votent.\n\nLeurs valeurs sont dans « Paramètres par défaut » et « Niveaux d'inertie ».",
|
||||
"en": "The threshold is the number of votes in favour a version needs to come into force. Below the quorum Q, the voters who are missing count as votes against: the threshold is worked out as if Q people had voted. Beyond it, it takes the share of votes in favour that the article's level of inertia asks for, among all the voters: near-unanimity when few people vote, the majority M when everyone votes.\n\n`T' = max(T, Q)`\n`Threshold = B^W + (M + (1 − M) × (1 − (T'/W)^G)) × T'`\n\nA version passes when its votes in favour reach the threshold, rounded up to a whole number.\n\n- **T**: the votes cast on the version, for and against.\n- **Q**: the article's quorum; **T'**: the voters counted, T, or Q if some are missing.\n- **W**: the number of members of the Ğ1 web of trust.\n- **B**: the base; raised to the power W, it is so small that it does not count.\n- **M**: the majority asked for when everyone votes.\n- **G**: the gradient: the larger it is, the higher the share asked for when few people vote.\n\nTheir values are in “Default parameters” and “Inertia levels”.",
|
||||
"es": "El umbral es el número de votos a favor que necesita una versión para entrar en vigor. Por debajo del quórum Q, los votantes que faltan cuentan como «no»: el umbral se calcula como si hubieran votado Q personas. Más allá, hace falta la proporción de votos a favor que pide el nivel de inercia del artículo, entre todos los votantes: casi la unanimidad cuando vota poca gente, la mayoría M cuando vota todo el mundo.\n\n`T' = max(T, Q)`\n`Umbral = B^W + (M + (1 − M) × (1 − (T'/W)^G)) × T'`\n\nUna versión pasa cuando sus votos a favor alcanzan el umbral, redondeado al entero superior.\n\n- **T**: los votos emitidos sobre la versión, a favor y en contra.\n- **Q**: el quórum del artículo; **T'**: los votantes contados, T, o Q si faltan.\n- **W**: el número de miembros de la red de confianza Ğ1.\n- **B**: la base; elevada a la potencia W, es tan pequeña que no cuenta.\n- **M**: la mayoría pedida cuando vota todo el mundo.\n- **G**: el gradiente: cuanto mayor es, más alta es la proporción pedida cuando vota poca gente.\n\nSus valores están en «Parámetros por defecto» y «Niveles de inercia»."
|
||||
"fr": "Le seuil est le nombre de voix pour qu'il faut à une version pour entrer en vigueur. Sous le quorum Q, les votants qui manquent comptent comme « non » : le seuil se calcule comme si Q personnes avaient voté. Au-delà, il faut la part de « pour » que demande le cran d'inertie de l'article, parmi tous les votants : cette part est la plus haute au quorum et baisse quand la participation monte, jusqu'à la majorité M quand tout le monde vote.\n\n`T' = max(T, Q)`\n`Seuil = B^W + (M + (1 − M) × (1 − (T'/W)^G)) × T'`\n\nUne version passe quand ses voix pour atteignent le seuil, arrondi à l'entier au-dessus.\n\n- **T** : les votes exprimés sur la version, pour et contre.\n- **Q** : le quorum de l'article ; **T'** : les votants retenus, T, ou Q s'il en manque.\n- **W** : le nombre de membres de la toile de confiance Ğ1.\n- **B** : la base ; à la puissance W, elle est si petite qu'elle ne compte pas.\n- **M** : la majorité demandée quand tout le monde vote.\n- **G** : le gradient : plus il est grand, plus la part demandée monte quand peu de gens votent.\n\nLeurs valeurs sont dans « Paramètres par défaut » et « Niveaux d'inertie ».",
|
||||
"en": "The threshold is the number of votes in favour a version needs to come into force. Below the quorum Q, the voters who are missing count as votes against: the threshold is worked out as if Q people had voted. Beyond it, it takes the share of votes in favour that the article's level of inertia asks for, among all the voters: that share is highest at the quorum and falls as turnout rises, down to the majority M when everyone votes.\n\n`T' = max(T, Q)`\n`Threshold = B^W + (M + (1 − M) × (1 − (T'/W)^G)) × T'`\n\nA version passes when its votes in favour reach the threshold, rounded up to a whole number.\n\n- **T**: the votes cast on the version, for and against.\n- **Q**: the article's quorum; **T'**: the voters counted, T, or Q if some are missing.\n- **W**: the number of members of the Ğ1 web of trust.\n- **B**: the base; raised to the power W, it is so small that it does not count.\n- **M**: the majority asked for when everyone votes.\n- **G**: the gradient: the larger it is, the higher the share asked for when few people vote.\n\nTheir values are in “Default parameters” and “Inertia levels”.",
|
||||
"es": "El umbral es el número de votos a favor que necesita una versión para entrar en vigor. Por debajo del quórum Q, los votantes que faltan cuentan como «no»: el umbral se calcula como si hubieran votado Q personas. Más allá, hace falta la proporción de votos a favor que pide el nivel de inercia del artículo, entre todos los votantes: esa proporción es la más alta en el quórum y baja cuando sube la participación, hasta la mayoría M cuando vota todo el mundo.\n\n`T' = max(T, Q)`\n`Umbral = B^W + (M + (1 − M) × (1 − (T'/W)^G)) × T'`\n\nUna versión pasa cuando sus votos a favor alcanzan el umbral, redondeado al entero superior.\n\n- **T**: los votos emitidos sobre la versión, a favor y en contra.\n- **Q**: el quórum del artículo; **T'**: los votantes contados, T, o Q si faltan.\n- **W**: el número de miembros de la red de confianza Ğ1.\n- **B**: la base; elevada a la potencia W, es tan pequeña que no cuenta.\n- **M**: la mayoría pedida cuando vota todo el mundo.\n- **G**: el gradiente: cuanto mayor es, más alta es la proporción pedida cuando vota poca gente.\n\nSus valores están en «Parámetros por defecto» y «Niveles de inercia»."
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -694,9 +694,9 @@
|
||||
"es": "Parámetros por defecto"
|
||||
},
|
||||
"body": {
|
||||
"fr": "Les valeurs des lettres de la formule (voir « Formule du seuil WoT ») et la façon dont le vote se déroule.\n\n**Un vote permanent, sans durée**\n\n- Chaque version se vote à tout moment, sans échéance. Chacun peut changer ou retirer son vote : le dernier fait foi.\n- Une proposition entre en vigueur dès qu'elle atteint son seuil. S'il y a déjà un texte en vigueur, il lui faut en plus une marge (voix pour moins voix exigées) plus large que celle de ce texte. Le texte remplacé redevient une proposition, avec ses votes : il peut revenir.\n- Si plusieurs propositions y parviennent, celle qui a la marge la plus large entre en vigueur.\n\n**Les lettres**\n\n- **W** : le nombre de membres de la toile de confiance Ğ1, relu sur la chaîne toutes les 6 heures.\n- **T** : les votes exprimés sur la version, pour et contre.\n- **Q**, le quorum : sous ce nombre de votants, ceux qui manquent comptent comme « non ». Chaque article prend celui de son cran : 12, 12, 50, 50 et 50 dans Monnaie libre, du cran 1 au cran 5. L'auteur de la première version d'un article, un administrateur pour les textes de départ, peut en fixer un autre tant que personne n'a voté sur l'article ; ensuite, il ne change plus. Dans Monnaie libre, jamais moins de 2 : une seule voix ne fait jamais passer un texte.\n- **B = 0,1** : dans la toile de confiance, `B^W` est si petit qu'il ne compte pas.\n- **M** et **G** : donnés par le cran d'inertie de l'article (voir « Niveaux d'inertie »). G n'est pas fixé à la main : il se déduit de la participation habituelle du groupe.\n\n**Par défaut**\n\n- Le cran par défaut est le 3 (moyenne) : M = 55 %, un quorum de 50 dans Monnaie libre, et le groupe demande 75 % de « pour » quand il vote comme d'habitude. Tout nouvel article commence à ce cran.\n- Au départ, aucun article n'est en vigueur. Raison d'être, Unicité du compte et Réciprocité sont des Propositions seed, mises en avant pour lancer le vote, au cran 2 (basse). Le titre du document est au cran 4 (haute), l'ordre des articles de chaque section au cran 2, tous les autres articles au cran 3.",
|
||||
"en": "The values of the letters of the formula (see “WoT threshold formula”) and how the vote runs.\n\n**A permanent vote, with no duration**\n\n- Every version can be voted on at any time, with no deadline. Anyone can change or withdraw their vote: the last one is the one that counts.\n- A proposal comes into force as soon as it reaches its threshold. If a text is already in force, it also needs a wider margin (votes in favour minus votes required) than that text has. The replaced text becomes a proposal again, with its votes: it can come back.\n- If several proposals get there, the one with the widest margin comes into force.\n\n**The letters**\n\n- **W**: the number of members of the Ğ1 web of trust, read again from the chain every 6 hours.\n- **T**: the votes cast on the version, for and against.\n- **Q**, the quorum: below this number of voters, those who are missing count as votes against. Each article takes the one of its level: 12, 12, 50, 50 and 50 in Monnaie libre, from level 1 to level 5. The author of the first version of an article, an administrator for the starting texts, can set another one as long as nobody has voted on the article; after that, it no longer changes. In Monnaie libre, never less than 2: a single vote never passes a text.\n- **B = 0.1**: in the web of trust, `B^W` is so small that it does not count.\n- **M** and **G**: given by the article's level of inertia (see “Inertia levels”). G is not set by hand: it follows from the group's usual turnout.\n\n**By default**\n\n- The default level is 3 (medium): M = 55%, a quorum of 50 in Monnaie libre, and the group asks for 75% of votes in favour when it votes as usual. Every new article starts at this level.\n- At the start, no article is in force. Purpose, Uniqueness of the account and Reciprocity are seed proposals, put forward to start the vote, at level 2 (low). The title of the document is at level 4 (high), the order of the articles of each section at level 2, all other articles at level 3.",
|
||||
"es": "Los valores de las letras de la fórmula (ver «Fórmula del umbral WoT») y cómo se desarrolla la votación.\n\n**Una votación permanente, sin duración**\n\n- Cada versión se vota en cualquier momento, sin plazo. Cada cual puede cambiar o retirar su voto: el último es el que cuenta.\n- Una propuesta entra en vigor en cuanto alcanza su umbral. Si ya hay un texto en vigor, necesita además un margen (votos a favor menos votos exigidos) más amplio que el de ese texto. El texto sustituido vuelve a ser una propuesta, con sus votos: puede volver.\n- Si varias propuestas lo consiguen, entra en vigor la que tiene el margen más amplio.\n\n**Las letras**\n\n- **W**: el número de miembros de la red de confianza Ğ1, leído de nuevo en la cadena cada 6 horas.\n- **T**: los votos emitidos sobre la versión, a favor y en contra.\n- **Q**, el quórum: por debajo de este número de votantes, los que faltan cuentan como «no». Cada artículo toma el de su nivel: 12, 12, 50, 50 y 50 en Monnaie libre, del nivel 1 al nivel 5. El autor de la primera versión de un artículo, un administrador para los textos de partida, puede fijar otro mientras nadie haya votado sobre el artículo; después, ya no cambia. En Monnaie libre, nunca menos de 2: un solo voto nunca hace pasar un texto.\n- **B = 0,1**: en la red de confianza, `B^W` es tan pequeño que no cuenta.\n- **M** y **G**: los da el nivel de inercia del artículo (ver «Niveles de inercia»). G no se fija a mano: se deduce de la participación habitual del grupo.\n\n**Por defecto**\n\n- El nivel por defecto es el 3 (media): M = 55 %, un quórum de 50 en Monnaie libre, y el grupo pide un 75 % de votos a favor cuando vota como de costumbre. Todo artículo nuevo empieza en este nivel.\n- Al inicio, ningún artículo está en vigor. Razón de ser, Unicidad de la cuenta y Reciprocidad son Propuestas seed, puestas en primer plano para lanzar la votación, en el nivel 2 (baja). El título del documento está en el nivel 4 (alta), el orden de los artículos de cada sección en el nivel 2, todos los demás artículos en el nivel 3."
|
||||
"fr": "Les valeurs des lettres de la formule (voir « Formule du seuil WoT ») et la façon dont le vote se déroule.\n\n**Un vote permanent, sans durée**\n\n- Chaque version se vote à tout moment, sans échéance. Chacun peut changer ou retirer son vote : le dernier fait foi.\n- Une proposition entre en vigueur dès qu'elle atteint son seuil. S'il y a déjà un texte en vigueur, il lui faut en plus une marge (voix pour moins voix exigées) plus large que celle de ce texte. Le texte remplacé redevient une proposition, avec ses votes : il peut revenir.\n- Si plusieurs propositions y parviennent, celle qui a la marge la plus large entre en vigueur.\n\n**Les lettres**\n\n- **W** : le nombre de membres de la toile de confiance Ğ1, relu sur la chaîne toutes les 6 heures.\n- **T** : les votes exprimés sur la version, pour et contre.\n- **Q**, le quorum : sous ce nombre de votants, ceux qui manquent comptent comme « non ». Chaque article prend celui de son cran : 12, 12, 50, 50 et 50 dans Monnaie libre, du cran 1 au cran 5. L'auteur de la première version d'un article, un administrateur pour les textes de départ, peut en fixer un autre tant que l'article ne garde la trace d'aucun vote. Dans Monnaie libre, jamais moins de 2 : une seule voix ne fait jamais passer un texte.\n- **B = 0,1** : dans la toile de confiance, `B^W` est si petit qu'il ne compte pas.\n- **M** et **G** : donnés par le cran d'inertie de l'article (voir « Niveaux d'inertie »). G n'est pas fixé à la main : il se déduit de la participation habituelle du groupe.\n\n**Par défaut**\n\n- Le cran par défaut est le 3 (moyenne) : M = 55 %, un quorum de 50 dans Monnaie libre, et le groupe demande 75 % de « pour » quand il vote comme d'habitude. Tout nouvel article commence à ce cran.\n- Au départ, aucun article n'est en vigueur. Raison d'être, Unicité du compte et Réciprocité sont des Propositions seed, mises en avant pour lancer le vote, au cran 2 (basse). Le titre du document est au cran 4 (haute), l'ordre des articles de chaque section au cran 2, tous les autres articles au cran 3.",
|
||||
"en": "The values of the letters of the formula (see “WoT threshold formula”) and how the vote runs.\n\n**A permanent vote, with no duration**\n\n- Every version can be voted on at any time, with no deadline. Anyone can change or withdraw their vote: the last one is the one that counts.\n- A proposal comes into force as soon as it reaches its threshold. If a text is already in force, it also needs a wider margin (votes in favour minus votes required) than that text has. The replaced text becomes a proposal again, with its votes: it can come back.\n- If several proposals get there, the one with the widest margin comes into force.\n\n**The letters**\n\n- **W**: the number of members of the Ğ1 web of trust, read again from the chain every 6 hours.\n- **T**: the votes cast on the version, for and against.\n- **Q**, the quorum: below this number of voters, those who are missing count as votes against. Each article takes the one of its level: 12, 12, 50, 50 and 50 in Monnaie libre, from level 1 to level 5. The author of the first version of an article, an administrator for the starting texts, can set another one as long as the article keeps no trace of any vote. In Monnaie libre, never less than 2: a single vote never passes a text.\n- **B = 0.1**: in the web of trust, `B^W` is so small that it does not count.\n- **M** and **G**: given by the article's level of inertia (see “Inertia levels”). G is not set by hand: it follows from the group's usual turnout.\n\n**By default**\n\n- The default level is 3 (medium): M = 55%, a quorum of 50 in Monnaie libre, and the group asks for 75% of votes in favour when it votes as usual. Every new article starts at this level.\n- At the start, no article is in force. Purpose, Uniqueness of the account and Reciprocity are seed proposals, put forward to start the vote, at level 2 (low). The title of the document is at level 4 (high), the order of the articles of each section at level 2, all other articles at level 3.",
|
||||
"es": "Los valores de las letras de la fórmula (ver «Fórmula del umbral WoT») y cómo se desarrolla la votación.\n\n**Una votación permanente, sin duración**\n\n- Cada versión se vota en cualquier momento, sin plazo. Cada cual puede cambiar o retirar su voto: el último es el que cuenta.\n- Una propuesta entra en vigor en cuanto alcanza su umbral. Si ya hay un texto en vigor, necesita además un margen (votos a favor menos votos exigidos) más amplio que el de ese texto. El texto sustituido vuelve a ser una propuesta, con sus votos: puede volver.\n- Si varias propuestas lo consiguen, entra en vigor la que tiene el margen más amplio.\n\n**Las letras**\n\n- **W**: el número de miembros de la red de confianza Ğ1, leído de nuevo en la cadena cada 6 horas.\n- **T**: los votos emitidos sobre la versión, a favor y en contra.\n- **Q**, el quórum: por debajo de este número de votantes, los que faltan cuentan como «no». Cada artículo toma el de su nivel: 12, 12, 50, 50 y 50 en Monnaie libre, del nivel 1 al nivel 5. El autor de la primera versión de un artículo, un administrador para los textos de partida, puede fijar otro mientras el artículo no guarde rastro de ningún voto. En Monnaie libre, nunca menos de 2: un solo voto nunca hace pasar un texto.\n- **B = 0,1**: en la red de confianza, `B^W` es tan pequeño que no cuenta.\n- **M** y **G**: los da el nivel de inercia del artículo (ver «Niveles de inercia»). G no se fija a mano: se deduce de la participación habitual del grupo.\n\n**Por defecto**\n\n- El nivel por defecto es el 3 (media): M = 55 %, un quórum de 50 en Monnaie libre, y el grupo pide un 75 % de votos a favor cuando vota como de costumbre. Todo artículo nuevo empieza en este nivel.\n- Al inicio, ningún artículo está en vigor. Razón de ser, Unicidad de la cuenta y Reciprocidad son Propuestas seed, puestas en primer plano para lanzar la votación, en el nivel 2 (baja). El título del documento está en el nivel 4 (alta), el orden de los artículos de cada sección en el nivel 2, todos los demás artículos en el nivel 3."
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -760,9 +760,9 @@
|
||||
"es": "Niveles de inercia"
|
||||
},
|
||||
"body": {
|
||||
"fr": "À chaque cran, le groupe demande un quorum de votants, puis une part de « pour » parmi eux (voir « Formule du seuil WoT »). Sous le quorum, les votants qui manquent comptent comme « non ». La part dépend du cran et du nombre de votants, comparé à la participation habituelle du groupe : plus il y a de votants, plus elle baisse, jusqu'à la majorité M quand tout le monde vote.\n\n`Part exigée = M + (1 − M) × (1 − (T'/W)^G)`, où T' est le nombre de votants, ou le quorum s'il en manque.\n\n**Les cinq crans** : le quorum dans Monnaie libre, la part exigée quand le groupe vote comme d'habitude, puis quand tout le monde vote, et ce qui est à ce cran au départ.\n\n- **Cran 1 · très basse** : quorum 12 ; 60 % comme d'habitude, 50 % quand tout le monde vote. Aucun article au départ.\n- **Cran 2 · basse** : quorum 12 ; 67 % comme d'habitude, 50 % quand tout le monde vote. Raison d'être, Unicité du compte, Réciprocité, et l'ordre des articles de chaque section.\n- **Cran 3 · moyenne** : quorum 50 ; 75 % comme d'habitude, 55 % quand tout le monde vote. Le cran par défaut : tous les autres articles, et chaque nouvel article.\n- **Cran 4 · haute** : quorum 50 ; 83 % comme d'habitude, 60 % quand tout le monde vote. Le titre du document.\n- **Cran 5 · très haute** : quorum 50 ; 90 % comme d'habitude, 66 % quand tout le monde vote. Aucun article au départ.\n\n**La participation habituelle** est la médiane du nombre de votants des propositions du groupe votées depuis un an. Tant que le groupe n'a pas voté sur 5 propositions, elle vaut deux fois le quorum de référence du document : 100 votants dans Monnaie libre. Elle ne dépend pas du quorum d'un article. Elle reste entre 1 % et 50 % de l'électorat, et se mesure une fois par jour.\n\n**G** se calcule pour que la part exigée, à la participation habituelle, soit exactement celle du cran : `G = ln(1 − (s − M)/(1 − M)) / ln(p̃)`, où s est la part exigée comme d'habitude et p̃ la participation habituelle divisée par W.\n\nExemple : avec 7 224 membres et une participation habituelle de 120 votants, quand 120 personnes votent, il faut 72, 81, 90, 100 ou 108 voix pour, du cran 1 au cran 5 ; au cran 3, 75 % des 120 votants, soit 90. Sous le quorum, les absents comptent comme « non » : au cran 2 (quorum 12), 9 voix pour passent avec 3 « contre » au plus ; au cran 3 (quorum 50), il faut 39 voix pour, avec 11 « contre » au plus.",
|
||||
"en": "At each level, the group asks for a quorum of voters, then for a share of votes in favour among them (see “WoT threshold formula”). Below the quorum, the voters who are missing count as votes against. The share depends on the level and on the number of voters, compared with the group's usual turnout: the more voters, the lower it gets, down to the majority M when everyone votes.\n\n`Share asked = M + (1 − M) × (1 − (T'/W)^G)`, where T' is the number of voters, or the quorum if some are missing.\n\n**The five levels**: the quorum in Monnaie libre, the share asked when the group votes as usual, then when everyone votes, and what is at that level at the start.\n\n- **Level 1 · very low**: quorum 12; 60% as usual, 50% when everyone votes. No article at the start.\n- **Level 2 · low**: quorum 12; 67% as usual, 50% when everyone votes. Purpose, Uniqueness of the account, Reciprocity, and the order of the articles of each section.\n- **Level 3 · medium**: quorum 50; 75% as usual, 55% when everyone votes. The default level: all other articles, and every new article.\n- **Level 4 · high**: quorum 50; 83% as usual, 60% when everyone votes. The title of the document.\n- **Level 5 · very high**: quorum 50; 90% as usual, 66% when everyone votes. No article at the start.\n\n**The usual turnout** is the median number of voters on the group's proposals voted on over the past year. Until the group has voted on 5 proposals, it is twice the document's reference quorum: 100 voters in Monnaie libre. It does not depend on the quorum of an article. It stays between 1% and 50% of the electorate, and is measured once a day.\n\n**G** is computed so that the share asked, at the usual turnout, is exactly that of the level: `G = ln(1 − (s − M)/(1 − M)) / ln(p̃)`, where s is the share asked as usual and p̃ the usual turnout divided by W.\n\nExample: with 7,224 members and a usual turnout of 120 voters, when 120 people vote, it takes 72, 81, 90, 100 or 108 votes in favour, from level 1 to level 5; at level 3, 75% of the 120 voters, i.e. 90. Below the quorum, those missing count as votes against: at level 2 (quorum 12), 9 votes in favour pass with 3 votes against at most; at level 3 (quorum 50), it takes 39 votes in favour, with 11 votes against at most.",
|
||||
"es": "En cada nivel, el grupo pide un quórum de votantes, y luego una proporción de votos a favor entre ellos (ver «Fórmula del umbral WoT»). Por debajo del quórum, los votantes que faltan cuentan como «no». La proporción depende del nivel y del número de votantes, comparado con la participación habitual del grupo: cuantos más votantes, más baja, hasta la mayoría M cuando vota todo el mundo.\n\n`Proporción exigida = M + (1 − M) × (1 − (T'/W)^G)`, donde T' es el número de votantes, o el quórum si faltan.\n\n**Los cinco niveles**: el quórum en Monnaie libre, la proporción exigida cuando el grupo vota como de costumbre, luego cuando vota todo el mundo, y lo que está en ese nivel al inicio.\n\n- **Nivel 1 · muy baja**: quórum 12; 60 % como de costumbre, 50 % cuando vota todo el mundo. Ningún artículo al inicio.\n- **Nivel 2 · baja**: quórum 12; 67 % como de costumbre, 50 % cuando vota todo el mundo. Razón de ser, Unicidad de la cuenta, Reciprocidad, y el orden de los artículos de cada sección.\n- **Nivel 3 · media**: quórum 50; 75 % como de costumbre, 55 % cuando vota todo el mundo. El nivel por defecto: todos los demás artículos, y todo artículo nuevo.\n- **Nivel 4 · alta**: quórum 50; 83 % como de costumbre, 60 % cuando vota todo el mundo. El título del documento.\n- **Nivel 5 · muy alta**: quórum 50; 90 % como de costumbre, 66 % cuando vota todo el mundo. Ningún artículo al inicio.\n\n**La participación habitual** es la mediana del número de votantes de las propuestas del grupo votadas en el último año. Hasta que el grupo haya votado 5 propuestas, vale dos veces el quórum de referencia del documento: 100 votantes en Monnaie libre. No depende del quórum de un artículo. Se mantiene entre el 1 % y el 50 % del electorado, y se mide una vez al día.\n\n**G** se calcula para que la proporción exigida, con la participación habitual, sea exactamente la del nivel: `G = ln(1 − (s − M)/(1 − M)) / ln(p̃)`, donde s es la proporción exigida como de costumbre y p̃ la participación habitual dividida por W.\n\nEjemplo: con 7224 miembros y una participación habitual de 120 votantes, cuando votan 120 personas, hacen falta 72, 81, 90, 100 o 108 votos a favor, del nivel 1 al nivel 5; en el nivel 3, el 75 % de los 120 votantes, es decir 90. Por debajo del quórum, los que faltan cuentan como «no»: en el nivel 2 (quórum 12), 9 votos a favor pasan con 3 en contra como mucho; en el nivel 3 (quórum 50), hacen falta 39 votos a favor, con 11 en contra como mucho."
|
||||
"fr": "À chaque cran, le groupe demande une part de « pour » parmi les votants (voir « Formule du seuil WoT »). Chaque cran a aussi son quorum, qui n'est pas un nombre minimal de votants : sous le quorum, les votants qui manquent comptent comme « non ». La part dépend du cran et du nombre de votants, comparé à la participation habituelle du groupe : au-delà du quorum, plus il y a de votants, plus elle baisse, jusqu'à la majorité M quand tout le monde vote.\n\n`Part exigée = M + (1 − M) × (1 − (T'/W)^G)`, où T' est le nombre de votants, ou le quorum s'il en manque.\n\n**Les cinq crans** : le quorum dans Monnaie libre, la part exigée quand le groupe vote comme d'habitude, puis quand tout le monde vote, et ce qui est à ce cran au départ.\n\n- **Cran 1 · très basse** : quorum 12 ; 60 % comme d'habitude, 50 % quand tout le monde vote. Aucun article au départ.\n- **Cran 2 · basse** : quorum 12 ; 67 % comme d'habitude, 50 % quand tout le monde vote. Raison d'être, Unicité du compte, Réciprocité, et l'ordre des articles de chaque section.\n- **Cran 3 · moyenne** : quorum 50 ; 75 % comme d'habitude, 55 % quand tout le monde vote. Le cran par défaut : tous les autres articles, et chaque nouvel article.\n- **Cran 4 · haute** : quorum 50 ; 83 % comme d'habitude, 60 % quand tout le monde vote. Le titre du document.\n- **Cran 5 · très haute** : quorum 50 ; 90 % comme d'habitude, 66 % quand tout le monde vote. Aucun article au départ.\n\n**La participation habituelle** est la médiane du nombre de votants des propositions du groupe votées depuis un an. Tant que le groupe n'a pas voté sur 5 propositions, elle vaut deux fois le quorum de référence du document : 100 votants dans Monnaie libre. Elle ne dépend pas du quorum d'un article. Elle reste entre 1 % et 50 % de l'électorat, et se mesure une fois par jour.\n\n**G** se calcule pour que la part exigée, à la participation habituelle, soit exactement celle du cran : `G = ln(1 − (s − M)/(1 − M)) / ln(p̃)`, où s est la part exigée comme d'habitude et p̃ la participation habituelle divisée par W.\n\nExemple : avec 7 224 membres et une participation habituelle de 120 votants, quand 120 personnes votent, il faut 72, 81, 90, 100 ou 108 voix pour, du cran 1 au cran 5 ; au cran 3, 75 % des 120 votants, soit 90. Sous le quorum, les absents comptent comme « non » : au cran 2 (quorum 12), 9 voix pour passent avec 3 « contre » au plus ; au cran 3 (quorum 50), il faut 39 voix pour, avec 11 « contre » au plus.",
|
||||
"en": "At each level, the group asks for a share of votes in favour among the voters (see “WoT threshold formula”). Each level also has its quorum, which is not a minimum number of voters: below the quorum, the voters who are missing count as votes against. The share depends on the level and on the number of voters, compared with the group's usual turnout: beyond the quorum, the more voters, the lower it gets, down to the majority M when everyone votes.\n\n`Share asked = M + (1 − M) × (1 − (T'/W)^G)`, where T' is the number of voters, or the quorum if some are missing.\n\n**The five levels**: the quorum in Monnaie libre, the share asked when the group votes as usual, then when everyone votes, and what is at that level at the start.\n\n- **Level 1 · very low**: quorum 12; 60% as usual, 50% when everyone votes. No article at the start.\n- **Level 2 · low**: quorum 12; 67% as usual, 50% when everyone votes. Purpose, Uniqueness of the account, Reciprocity, and the order of the articles of each section.\n- **Level 3 · medium**: quorum 50; 75% as usual, 55% when everyone votes. The default level: all other articles, and every new article.\n- **Level 4 · high**: quorum 50; 83% as usual, 60% when everyone votes. The title of the document.\n- **Level 5 · very high**: quorum 50; 90% as usual, 66% when everyone votes. No article at the start.\n\n**The usual turnout** is the median number of voters on the group's proposals voted on over the past year. Until the group has voted on 5 proposals, it is twice the document's reference quorum: 100 voters in Monnaie libre. It does not depend on the quorum of an article. It stays between 1% and 50% of the electorate, and is measured once a day.\n\n**G** is computed so that the share asked, at the usual turnout, is exactly that of the level: `G = ln(1 − (s − M)/(1 − M)) / ln(p̃)`, where s is the share asked as usual and p̃ the usual turnout divided by W.\n\nExample: with 7,224 members and a usual turnout of 120 voters, when 120 people vote, it takes 72, 81, 90, 100 or 108 votes in favour, from level 1 to level 5; at level 3, 75% of the 120 voters, i.e. 90. Below the quorum, those missing count as votes against: at level 2 (quorum 12), 9 votes in favour pass with 3 votes against at most; at level 3 (quorum 50), it takes 39 votes in favour, with 11 votes against at most.",
|
||||
"es": "En cada nivel, el grupo pide una proporción de votos a favor entre los votantes (ver «Fórmula del umbral WoT»). Cada nivel tiene además su quórum, que no es un número mínimo de votantes: por debajo del quórum, los votantes que faltan cuentan como «no». La proporción depende del nivel y del número de votantes, comparado con la participación habitual del grupo: más allá del quórum, cuantos más votantes, más baja, hasta la mayoría M cuando vota todo el mundo.\n\n`Proporción exigida = M + (1 − M) × (1 − (T'/W)^G)`, donde T' es el número de votantes, o el quórum si faltan.\n\n**Los cinco niveles**: el quórum en Monnaie libre, la proporción exigida cuando el grupo vota como de costumbre, luego cuando vota todo el mundo, y lo que está en ese nivel al inicio.\n\n- **Nivel 1 · muy baja**: quórum 12; 60 % como de costumbre, 50 % cuando vota todo el mundo. Ningún artículo al inicio.\n- **Nivel 2 · baja**: quórum 12; 67 % como de costumbre, 50 % cuando vota todo el mundo. Razón de ser, Unicidad de la cuenta, Reciprocidad, y el orden de los artículos de cada sección.\n- **Nivel 3 · media**: quórum 50; 75 % como de costumbre, 55 % cuando vota todo el mundo. El nivel por defecto: todos los demás artículos, y todo artículo nuevo.\n- **Nivel 4 · alta**: quórum 50; 83 % como de costumbre, 60 % cuando vota todo el mundo. El título del documento.\n- **Nivel 5 · muy alta**: quórum 50; 90 % como de costumbre, 66 % cuando vota todo el mundo. Ningún artículo al inicio.\n\n**La participación habitual** es la mediana del número de votantes de las propuestas del grupo votadas en el último año. Hasta que el grupo haya votado 5 propuestas, vale dos veces el quórum de referencia del documento: 100 votantes en Monnaie libre. No depende del quórum de un artículo. Se mantiene entre el 1 % y el 50 % del electorado, y se mide una vez al día.\n\n**G** se calcula para que la proporción exigida, con la participación habitual, sea exactamente la del nivel: `G = ln(1 − (s − M)/(1 − M)) / ln(p̃)`, donde s es la proporción exigida como de costumbre y p̃ la participación habitual dividida por W.\n\nEjemplo: con 7224 miembros y una participación habitual de 120 votantes, cuando votan 120 personas, hacen falta 72, 81, 90, 100 o 108 votos a favor, del nivel 1 al nivel 5; en el nivel 3, el 75 % de los 120 votantes, es decir 90. Por debajo del quórum, los que faltan cuentan como «no»: en el nivel 2 (quórum 12), 9 votos a favor pasan con 3 en contra como mucho; en el nivel 3 (quórum 50), hacen falta 39 votos a favor, con 11 en contra como mucho."
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user