aboutsummaryrefslogtreecommitdiffstats
path: root/src/federation/party.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-19 11:22:42 +0000
committertv <tv@krebsco.de>2026-11-19 13:09:59 +0100
commitd62c36d10e916bff09dff56c384e38bb93e82d86 (patch)
tree7c5e1abed5ae996331de1c676f75888525d37b22 /src/federation/party.rs
parent680e1cd6fdeeb6dacb48598545d9e384dc52ffdc (diff)
federation: continuum-party judge, a store's verdicts in a format releases keep
To check that a release judges histories as an earlier one did, under every revision that one knows, each must say what its store makes of the same histories, in the same words. `continuum-party judge` reads histories from its input, each `case <label>`, `root <hex>` and `event <hex>` for each event in the order offered, and prints for each what became of every event by kind (`became <ID> <kind>`, never a refusal's words) and what the store reads after (`reads <JSON>`): its checkpoint, the current version, the values at places, the members, and the event it stopped at; `root none` where the root reads as none, as one of a revision this continuum doesn't know (`federation::judge`). The format is never to change: an earlier release prints it too.
Diffstat (limited to 'src/federation/party.rs')
-rw-r--r--src/federation/party.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/federation/party.rs b/src/federation/party.rs
index 148bd20..a12dc7f 100644
--- a/src/federation/party.rs
+++ b/src/federation/party.rs
@@ -53,6 +53,7 @@ use super::client::{self, Record};
use super::event::{self, Does, Event, Signed};
use super::fold::Federation;
use super::jcs::Json;
+use super::judge;
use super::keys::{self, Key};
use super::revision::{FEATURES, Revision};
use super::store::Id;
@@ -175,6 +176,10 @@ fn command() -> Command {
.about("What the node finds of the fork whose root a file holds")
.arg(id("file")),
)
+ .subcommand(Command::new("judge").about(
+ "What a store makes of the histories its input spells, in a format every release \
+ keeps (federation-tests.md, Against released revisions)",
+ ))
.subcommand(Command::new("proposals").about(
"The proposals on the current version: whether each passed or is dead, who voted \
what, and what it changes",
@@ -277,6 +282,13 @@ pub(crate) async fn main() -> Result<()> {
}
return out(&super::fork::root_file(&root, &[]));
}
+ if name == "judge" {
+ let mut input = String::new();
+ std::io::Read::read_to_string(&mut std::io::stdin(), &mut input)?;
+ let histories = judge::read(&input).map_err(|why| anyhow!(why))?;
+ print!("{}", judge::judge(&histories));
+ return Ok(());
+ }
let node = Node::new(&options)?;
if name == "proposals" {
return proposals(&node).await;