interplane.Get Omega
Read in your language

synapse

A component of the AienOS ecosystem.

Brought by drakestapleton

GitHub aien-dev/synapse#88 (code only)

closed derived c202ccc813a1d239 #88

Imported from GitHub aien-dev/synapse#88 (code only)

GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed).

Base 3d78efe83d5d08b67848e4b32a83112a95dd2a9d · Head cf3879f499f6e23651844cbd85e694370e51830c

github-advanced-security[bot] commented on crates/synapse-api/tests/b4_revision_states.rs line 101 on 2026-10-17 01:36 UTC

github-advanced-security[bot] commented on crates/synapse-api/tests/b4_revision_states.rs line 102 on 2026-10-17 01:36 UTC

github-advanced-security[bot] commented on crates/synapse-api/tests/b4_revision_states.rs line 104 on 2026-10-17 01:36 UTC

github-advanced-security[bot] commented on crates/synapse-api/tests/b4_revision_states.rs line 126 on 2026-10-17 01:36 UTC

github-advanced-security[bot] commented on crates/synapse-api/tests/b4_revision_states.rs line 127 on 2026-10-17 01:36 UTC

github-advanced-security[bot] commented on crates/synapse-api/tests/b4_revision_states.rs line 128 on 2026-10-17 01:36 UTC

github-advanced-security[bot] reviewed (COMMENTED) on 2026-10-17 01:36 UTC

Apply it

git checkout -b patch-c202ccc813a1d239 3d78efe83d5d08b67848e4b32a83112a95dd2a9d
curl -fsSL https://interplane.io/drakestapleton/synapse/patches/c202ccc813a1d239.patch | git am

Raw patch (mbox) · Diff

Provenance

This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record:

github-import 1
aien-dev/synapse
88
cf3879f499f6e23651844cbd85e694370e51830c
{"kind":"github-import","owner":"aien-dev","repo":"synapse","number":88,"url":"https://github.com/aien-dev/synapse/pull/88","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:39:19Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/.crumb b/.crumb
index 495a32d..ef0139c 100644
--- a/.crumb
+++ b/.crumb
@@ -45,14 +45,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-10-16T09:12:08Z",
+      "compiled_at": "2026-10-17T02:05:18Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:279410a8da95ac0a5c9e9cf32a56684e2ca85469ad52267efcce5e6dbbbef821",
-      "evidence_files": 241,
-      "evidence_root": "sha256:f103bd6c7728e5a399cede51d9c64e4d42afc97e0d48dd424536b6cc72e48314",
-      "files": 411,
-      "generated_at_commit": "5d287e0e4ab4439f79711243518c0a83cce56eff",
-      "source_tree": "sha256:07947598e29d8d8fca9b546541ebe7e575c954cf18901eeb74304d2a9f594e2b"
+      "digest": "sha256:dc4cd7bcbb783b35f9006c41f7a7e626fb2a92b8fae48f4098484f96df4f9748",
+      "evidence_files": 249,
+      "evidence_root": "sha256:915dd8763ee08d5800437ffd2dd6a59720c9481436ec63a8f4b82effe81ced16",
+      "files": 428,
+      "generated_at_commit": "157f1c83674df84a0fe9f4a6205a9f891a7b2ce3",
+      "source_tree": "sha256:f72e4965b6aa26c5ce6ebdab8a641969bdf4fedc3e10a31d9da58a881db5f13c"
     },
     "synapse": {
       "component_paths": {
diff --git a/crates/synapse-api/src/lib.rs b/crates/synapse-api/src/lib.rs
index a7c79a2..e702ab7 100644
--- a/crates/synapse-api/src/lib.rs
+++ b/crates/synapse-api/src/lib.rs
@@ -16,10 +16,10 @@ use synapse_core::{
     FileMode, GitHubPullRequestProjection, GitOid, IdempotencyKey, MutationOp,
     RadicleCanonicalHead, RefusalCode, RepoId, SynapseError, SynapseResult, TreeDigest, WalSeq,
 };
-use synapse_core::{ChainPath, ChangeId, ChangesetEnvelopeV2, ObsolescenceMarker};
+use synapse_core::{ChainPath, ChangeId, ChangesetEnvelopeV2, ObsolescenceMarker, RevisionState};
 use synapse_store::{
     AdmissionAuthority, CompactionReport, FsyncPolicy, IngestOutcome, RecoveryPolicy, ReviewRecord,
-    RevisionOutcome, StoreLimits, StoredChangeset, SynapseStore,
+    RevisionOutcome, StoreLimits, StoredChangeset, StoredRevision, SynapseStore,
 };
 
 mod advisory;
@@ -239,6 +239,41 @@ pub struct WatchQueryPayload {
     pub page: PageRequest,
 }
 
+/// Request payload for `advance_revision_state` (ADR 0003 B4), in its one binary encoding:
+/// `changeset_id [32] | state u8` (the `RevisionState` tag, 1..=5).
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub struct RevisionStateMovePayload {
+    pub changeset_id: ChangesetId,
+    pub to: RevisionState,
+}
+
+impl RevisionStateMovePayload {
+    pub fn encode(&self) -> Vec<u8> {
+        let mut buf = Vec::with_capacity(33);
+        buf.extend_from_slice(&self.changeset_id.0);
+        buf.push(self.to.tag_byte());
+        buf
+    }
+
+    /// Exactly 33 bytes with a known state tag; anything else is `EnvelopeMalformed`.
+    pub fn decode(bytes: &[u8]) -> SynapseResult<Self> {
+        let malformed = || {
+            SynapseError::new(
+                RefusalCode::EnvelopeMalformed,
+                "state move payload must be changeset_id [32] | state u8 (1..=5)",
+            )
+        };
+        let (id, tag) = match bytes {
+            [id @ .., tag] if id.len() == 32 => (id, *tag),
+            _ => return Err(malformed()),
+        };
+        Ok(Self {
+            changeset_id: ChangesetId(id.try_into().map_err(|_| malformed())?),
+            to: RevisionState::from_tag_byte(tag).ok_or_else(malformed)?,
+        })
+    }
+}
+
 /// Exact path index mapping repository paths to touching `ChangesetId`s. Trees live in the
 /// service's shared [`TreeStore`].
 #[derive(Debug, Default)]
@@ -630,6 +665,77 @@ impl SynapseService {
         self.store.record_obsolescence(marker, chain, now_ms)
     }
 
+    /// Move a revision's state (ADR 0003 B4) under an F1 delegation chain granting
+    /// `Propose`. `req.payload` is a [`RevisionStateMovePayload`]. The store applies the
+    /// owner-chain and state-machine rules: any move to `Canonical` is refused
+    /// (`CanonicalOutsidePromotionQueue`; canonical moves only through the promotion queue,
+    /// step E2), another owner's `Private` revision is `ChangesetNotFound`, a chain that does
+    /// not own the revision is `AuthChainNotDominant`, and a move to `Verified` or any move
+    /// that is backwards, in place, or skips a state is `RevisionStateMoveInvalid`.
+    pub fn advance_revision_state(
+        &mut self,
+        req: &ChainedRequest,
+        now_ms: u64,
+    ) -> SynapseResult<WalSeq> {
+        let mv = RevisionStateMovePayload::decode(&req.payload)?;
+        self.auth.authorize_chain(
+            BoundaryKind::Api,
+            "advance_revision_state",
+            &self.repo_id,
+            Capability::Propose,
+            req,
+            self.store.committed_seq().next(),
+            now_ms,
+        )?;
+        let chain = admission_authority(req)?.chain;
+        self.store
+            .advance_revision_state(&self.repo_id, mv.changeset_id, mv.to, chain, now_ms)
+    }
+
+    /// Read an envelope v2 revision (ADR 0003 B4) under an F1 delegation chain granting
+    /// `Read`. `req.payload` is the 32-byte `ChangesetId`. A revision the chain may not see
+    /// is `ChangesetNotFound`, exactly like an unknown one: another owner's `Private`
+    /// revision, or a revision with a mutation path outside the chain's path scope.
+    pub fn read_revision(
+        &mut self,
+        req: &ChainedRequest,
+        now_ms: u64,
+    ) -> SynapseResult<StoredRevision> {
+        let id: [u8; 32] = req.payload.as_slice().try_into().map_err(|_| {
+            SynapseError::new(
+                RefusalCode::EnvelopeMalformed,
+                "read_revision payload must be exactly one 32-byte ChangesetId",
+            )
+        })?;
+        let id = ChangesetId(id);
+        self.auth.authorize_chain(
+            BoundaryKind::Api,
+            "read_revision",
+            &self.repo_id,
+            Capability::Read,
+            req,
+            self.store.committed_seq().next(),
+            now_ms,
+        )?;
+        let viewer = admission_authority(req)?.chain;
+        let rev = self
+            .store
+            .get_revision_visible_to(&self.repo_id, id, &viewer)?;
+        let in_scope = req.chain.leaf().is_some_and(|leaf| {
+            rev.content
+                .mutations
+                .iter()
+                .all(|m| leaf.caveats.paths.covers_path(&m.path))
+        });
+        if !in_scope {
+            return Err(SynapseError::new(
+                RefusalCode::ChangesetNotFound,
+                format!("revision {id} not found"),
+            ));
+        }
+        Ok(rev)
+    }
+
     /// Index a committed (or duplicate) submission in the path index.
     pub fn index_submitted(&mut self, outcome: &IngestOutcome, envelope: &ChangesetEnvelope) {
         let cs_id = match outcome {
diff --git a/crates/synapse-api/tests/b1_chained_revisions.rs b/crates/synapse-api/tests/b1_chained_revisions.rs
index f06ae64..1bba5e8 100644
--- a/crates/synapse-api/tests/b1_chained_revisions.rs
+++ b/crates/synapse-api/tests/b1_chained_revisions.rs
@@ -4,7 +4,7 @@
 
 use ed25519_dalek::SigningKey;
 use std::path::PathBuf;
-use synapse_api::{SynapseService, TreeTarget};
+use synapse_api::{RevisionStateMovePayload, SynapseService, TreeTarget};
 use synapse_auth::{
     Capability, CapabilityChain, CapabilityLink, ChainQuotas, ChainedRequest, ChangeScope,
     LinkCaveats, OperationSet, PathScope, ReferenceKind, ReferenceScope, RequestScope, ROOT_PARENT,
@@ -12,7 +12,7 @@ use synapse_auth::{
 use synapse_core::{
     encode_did_key_ed25519, BlobDigest, ChangeId, ChangesetEnvelopeV2, ChangesetId, FileMode,
     GitOid, IdempotencyKey, MutationOp, ObsolescenceMarker, PathMutation, RefusalCode, RepoId,
-    RevisionContent, TreeDigest, WalSeq,
+    RevisionContent, RevisionState, TreeDigest, WalSeq,
 };
 use synapse_store::{FsyncPolicy, RecoveryPolicy, RevisionOutcome, StoreLimits};
 
@@ -202,6 +202,18 @@ impl Fx {
             .map_err(|e| e.code)
     }
 
+    /// The owner shares a revision (ADR 0003 B4): `Private` -> `Draft`, so chains outside
+    /// its owner chain see it and are refused for dominance rather than as unknown.
+    fn share(&mut self, who: &(SigningKey, CapabilityChain), rev: ChangesetId) {
+        let payload = RevisionStateMovePayload {
+            changeset_id: rev,
+            to: RevisionState::Draft,
+        }
+        .encode();
+        let req = self.request(who, vec![], payload);
+        self.svc.advance_revision_state(&req, NOW).unwrap();
+    }
+
     fn mark(
         &mut self,
         who: &(SigningKey, CapabilityChain),
@@ -235,6 +247,7 @@ fn b1_api_join_and_prune_follow_the_creating_chain_of_real_f1_chains() {
     );
     // V's grant names C explicitly.
     fx.submit(&v, b"scoped attempt", 1).unwrap();
+    fx.share(&o, a);
     // Pruning needs a chain that is or dominates the creating chain.
     assert_eq!(
         fx.mark(&w, a, vec![]).unwrap_err(),
diff --git a/crates/synapse-api/tests/b4_revision_states.rs b/crates/synapse-api/tests/b4_revision_states.rs
new file mode 100644
index 0000000..8bc7c1b
--- /dev/null
+++ b/crates/synapse-api/tests/b4_revision_states.rs
@@ -0,0 +1,416 @@
+//! ADR 0003 step B4 through the API with real signed F1 capability chains: authority `A`
+//! grants orchestrator `O`, outsider `X`, and publisher `P` (root links; `P` may also
+//! `Publish` and touch the canonical reference through the promotion queue); `O` delegates
+//! worker `W` (scoped to `src`), worker `V` (whole repository), and reader `D` (scoped to
+//! `docs`).
+
+use ed25519_dalek::SigningKey;
+use sha2::{Digest, Sha256};
+use std::path::{Path, PathBuf};
+use synapse_api::{RevisionStateMovePayload, SynapseService, TreeTarget};
+use synapse_auth::{
+    Capability, CapabilityChain, CapabilityLink, ChainQuotas, ChainedRequest, ChangeScope,
+    LinkCaveats, OperationSet, PathScope, ReferenceKind, ReferenceScope, RequestScope, ROOT_PARENT,
+};
+use synapse_core::{
+    encode_did_key_ed25519, BlobDigest, ChangeId, ChangesetEnvelopeV2, ChangesetId, FileMode,
+    GitOid, IdempotencyKey, MutationOp, PathMutation, RefusalCode, RepoId, RevisionContent,
+    RevisionState, TreeDigest, WalSeq,
+};
+use synapse_store::{FsyncPolicy, RecoveryPolicy, RevisionOutcome, StoreLimits, StoredRevision};
+
+const NOW: u64 = 2_000;
+const C: ChangeId = ChangeId([0xC4; 16]);
+
+type Agent = (SigningKey, CapabilityChain);
+
+/// Link nonces for one fixture: SHA-256 of the fixture's unique directory and a counter, so
+/// every link gets a fresh nonce and none is a fixed value.
+fn link_nonces(dir: &Path) -> impl FnMut() -> [u8; 32] {
+    let seed = dir.to_string_lossy().into_owned();
+    let mut issued = 0u32;
+    move || {
+        issued += 1;
+        let mut h = Sha256::new();
+        h.update(seed.as_bytes());
+        h.update(issued.to_le_bytes());
+        h.finalize().into()
+    }
+}
+
+fn repo() -> RepoId {
+    RepoId::new("aien-spark/synapse").unwrap()
+}
+
+fn pk(k: &SigningKey) -> [u8; 32] {
+    k.verifying_key().to_bytes()
+}
+
+fn caveats(
+    ops: &[Capability],
+    paths: PathScope,
+    refs: &[ReferenceKind],
+    share: u64,
+) -> LinkCaveats {
+    LinkCaveats {
+        operations: OperationSet::from_capabilities(ops),
+        paths,
+        references: ReferenceScope::from_kinds(refs),
+        changes: ChangeScope::any(),
+        quotas: ChainQuotas {
+            max_ops_per_window: (1_000 / share) as u32,
+            window_duration_ms: 60_000,
+            storage_bytes: (1 << 30) / share,
+            footprint_paths: (1 << 20) / share,
+            max_bytes_per_op: 1 << 20,
+        },
+        issued_at_ms: 1_000,
+        expires_at_ms: 100_000,
+    }
+}
+
+struct Fx {
+    svc: SynapseService,
+    base: TreeDigest,
+    o: Agent,
+    w: Agent,
+    v: Agent,
+    d: Agent,
+    x: Agent,
+    p: Agent,
+    nonce: u8,
+}
+
+impl Fx {
+    fn new(name: &str) -> Self {
+        let dir: PathBuf = std::env::temp_dir().join(format!(
+            "synapse-b4-api-{name}-{}-{}",
+            std::process::id(),
+            std::time::SystemTime::now()
+                .duration_since(std::time::UNIX_EPOCH)
+                .unwrap()
+                .as_nanos()
+        ));
+        let mut svc = SynapseService::open(
+            &dir,
+            repo(),
+            FsyncPolicy::EveryCommit,
+            RecoveryPolicy::StrictFailClosed,
+            StoreLimits {
+                wal_prealloc_bytes: 64 * 1024,
+                ..Default::default()
+            },
+        )
+        .unwrap();
+        let a = SigningKey::from_bytes(&[1; 32]);
+        let key = |n: u8| SigningKey::from_bytes(&[n; 32]);
+        let (o, w, v, d, x, p) = (key(2), key(3), key(4), key(5), key(9), key(7));
+        svc.auth_mut()
+            .register_repo_authority(repo(), encode_did_key_ed25519(&pk(&a)));
+        let rp = [Capability::Read, Capability::Propose];
+        let own = [ReferenceKind::OwnDrafts];
+        let whole = PathScope::whole_repository;
+        let mut nonce = link_nonces(&dir);
+        let root = |nonce: [u8; 32], to: &SigningKey, c: LinkCaveats| {
+            CapabilityLink::issue(&a, ROOT_PARENT, nonce, repo(), pk(to), c)
+        };
+        let root_o = root(nonce(), &o, caveats(&rp, whole(), &own, 1));
+        let root_x = root(nonce(), &x, caveats(&rp, whole(), &own, 1));
+        let root_p = root(
+            nonce(),
+            &p,
+            caveats(
+                &[Capability::Read, Capability::Propose, Capability::Publish],
+                whole(),
+                &[
+                    ReferenceKind::OwnDrafts,
+                    ReferenceKind::CanonicalViaPromotionQueue,
+                ],
+                1,
+            ),
+        );
+        let child = |nonce: [u8; 32], to: &SigningKey, paths: PathScope| {
+            CapabilityLink::issue(
+                &o,
+                root_o.digest(),
+                nonce,
+                repo(),
+                pk(to),
+                caveats(&rp, paths, &own, 4),
+            )
+        };
+        let link_w = child(nonce(), &w, PathScope::new(vec!["src".into()]).unwrap());
+        let link_v = child(nonce(), &v, whole());
+        let link_d = child(nonce(), &d, PathScope::new(vec!["docs".into()]).unwrap());
+        let co = CapabilityChain::new(vec![root_o]);
+        let cx = CapabilityChain::new(vec![root_x]);
+        let cp = CapabilityChain::new(vec![root_p]);
+        let (cw, cv, cd) = (
+            co.extended(link_w),
+            co.extended(link_v),
+            co.extended(link_d),
+        );
+        for c in [&co, &cx, &cp, &cw, &cv, &cd] {
+            svc.auth_mut().grant_link(c, WalSeq(0), NOW).unwrap();
+        }
+        let base_oid = GitOid([0x0B; 20]);
+        svc.register_base_tree(
+            base_oid,
+            vec![("README.md".into(), FileMode::Regular644, b"base".to_vec())],
+        )
+        .unwrap();
+        let base = svc
+            .tree_digest(TreeTarget::BaseGitCommit(base_oid), None)
+            .unwrap();
+        Self {
+            svc,
+            base,
+            o: (o, co),
+            w: (w, cw),
+            v: (v, cv),
+            d: (d, cd),
+            x: (x, cx),
+            p: (p, cp),
+            nonce: 0,
+        }
+    }
+
+    fn request(
+        &mut self,
+        who: &Agent,
+        cap: Capability,
+        scope: RequestScope,
+        payload: Vec<u8>,
+    ) -> ChainedRequest {
+        self.nonce += 1;
+        ChainedRequest::sign_new(
+            &who.0,
+            who.1.clone(),
+            repo(),
+            cap,
+            scope,
+            [self.nonce; 32],
+            NOW,
+            payload,
+        )
+    }
+
+    /// `who` submits a revision of change `C` writing `body` to `src/lib.rs`.
+    fn submit(&mut self, who: &Agent, body: &[u8], idem: u8) -> ChangesetId {
+        let content = RevisionContent {
+            change_id: C,
+            base_tree: self.base,
+            parents: vec![],
+            mutations: vec![PathMutation {
+                path: "src/lib.rs".into(),
+                op: MutationOp::Upsert {
+                    mode: FileMode::Regular644,
+                    blob_digest: BlobDigest::compute(body),
+                    size_bytes: body.len() as u64,
+                },
+            }],
+            intent_summary: "implement the task".into(),
+        };
+        let env =
+            ChangesetEnvelopeV2::sign_new(&who.0, repo(), content, IdempotencyKey([idem; 32]), NOW);
+        let scope = RequestScope {
+            paths: vec!["src/lib.rs".into()],
+            reference: None,
+            join_change: Some(C),
+        };
+        let req = self.request(who, Capability::Propose, scope, env.encode());
+        let blobs = vec![(BlobDigest::compute(body), body.to_vec())];
+        match self.svc.submit_revision(&req, &blobs, NOW).unwrap() {
+            RevisionOutcome::Admitted { changeset_id, .. } => changeset_id,
+            other => panic!("expected an admission, got {other:?}"),
+        }
+    }
+
+    fn read(
+        &mut self,
+        who: &Agent,
+        id: ChangesetId,
+    ) -> Result<StoredRevision, (RefusalCode, String)> {
+        let req = self.request(
+            who,
+            Capability::Read,
+            RequestScope::default(),
+            id.0.to_vec(),
+        );
+        self.svc
+            .read_revision(&req, NOW)
+            .map_err(|e| (e.code, e.message))
+    }
+
+    fn mv(
+        &mut self,
+        who: &Agent,
+        id: ChangesetId,
+        to: RevisionState,
+    ) -> Result<WalSeq, RefusalCode> {
+        let payload = RevisionStateMovePayload {
+            changeset_id: id,
+            to,
+        }
+        .encode();
+        let req = self.request(who, Capability::Propose, RequestScope::default(), payload);
+        self.svc
+            .advance_revision_state(&req, NOW)
+            .map_err(|e| e.code)
+    }
+}
+
+/// Acceptance 2 with real F1 chains: `W`'s `Private` revision is readable by `W` and by `O`
+/// (whose grant `W`'s descends from) and by nobody else: not by the sibling `V`, the reader
+/// `D`, or the outsider `X`, each refused exactly like an unknown revision; none of them can
+/// move it. After `W` moves it to `Draft` it is visible within `Read` scope: to `V` and `X`,
+/// still not to `D`, whose path scope does not cover `src/lib.rs`.
+#[test]
+fn b4_api_private_revision_is_invisible_outside_its_owner_chain_with_real_f1_chains() {
+    let mut fx = Fx::new("private");
+    let (o, w, v, d, x, p) = (
+        fx.o.clone(),
+        fx.w.clone(),
+        fx.v.clone(),
+        fx.d.clone(),
+        fx.x.clone(),
+        fx.p.clone(),
+    );
+    fx.submit(&o, b"orchestrator attempt", 1);
+    let rev = fx.submit(&w, b"worker private attempt", 1);
+    assert_eq!(fx.read(&w, rev).unwrap().state, RevisionState::Private);
+    assert_eq!(fx.read(&o, rev).unwrap().changeset_id, rev);
+    let unknown = ChangesetId([0xEE; 32]);
+    let (code, msg) = fx.read(&o, unknown).unwrap_err();
+    assert_eq!(code, RefusalCode::ChangesetNotFound);
+    for outsider in [&v, &d, &x, &p] {
+        let (c, m) = fx.read(outsider, rev).unwrap_err();
+        assert_eq!(c, code);
+        assert_eq!(m, msg.replace(&unknown.to_string(), &rev.to_string()));
+        assert_eq!(
+            fx.mv(outsider, rev, RevisionState::Draft).unwrap_err(),
+            RefusalCode::ChangesetNotFound
+        );
+    }
+    // The owner shares it: Draft is visible within Read scope.
+    fx.mv(&w, rev, RevisionState::Draft).unwrap();
+    for reader in [&o, &w, &v, &x, &p] {
+        assert_eq!(fx.read(reader, rev).unwrap().state, RevisionState::Draft);
+    }
+    assert_eq!(
+        fx.read(&d, rev).unwrap_err().0,
+        RefusalCode::ChangesetNotFound
+    );
+    // A non-owner may read the Draft but not move it.
+    assert_eq!(
+        fx.mv(&v, rev, RevisionState::Proposed).unwrap_err(),
+        RefusalCode::AuthChainNotDominant
+    );
+    // The orchestrator, whose grant W's descends from, may propose it; then it never goes back.
+    fx.mv(&o, rev, RevisionState::Proposed).unwrap();
+    for to in [
+        RevisionState::Private,
+        RevisionState::Draft,
+        RevisionState::Proposed,
+    ] {
+        assert_eq!(
+            fx.mv(&w, rev, to).unwrap_err(),
+            RefusalCode::RevisionStateMoveInvalid
+        );
+    }
+    assert_eq!(fx.read(&x, rev).unwrap().state, RevisionState::Proposed);
+}
+
+/// Acceptance 3 with real F1 chains: a move to `Canonical` through the state API is refused
+/// for every chain, including one whose grant allows `Publish` and the canonical reference
+/// through the promotion queue; nothing is written. Malformed payloads are refused typed.
+#[test]
+fn b4_api_move_to_canonical_outside_the_promotion_queue_is_refused() {
+    let mut fx = Fx::new("canonical");
+    let (o, w, x, p) = (fx.o.clone(), fx.w.clone(), fx.x.clone(), fx.p.clone());
+    let rev = fx.submit(&w, b"worker attempt", 1);
+    fx.mv(&w, rev, RevisionState::Proposed).unwrap();
+    let before = fx.svc.store().committed_seq();
+    for who in [&o, &w, &x, &p] {
+        for id in [rev, ChangesetId([0xEE; 32])] {
+            assert_eq!(
+                fx.mv(who, id, RevisionState::Canonical).unwrap_err(),
+                RefusalCode::CanonicalOutsidePromotionQueue
+            );
+        }
+    }
+    // Asking with the canonical reference in the request scope changes nothing.
+    let payload = RevisionStateMovePayload {
+        changeset_id: rev,
+        to: RevisionState::Canonical,
+    }
+    .encode();
+    let scope = RequestScope {
+        paths: vec![],
+        reference: Some(ReferenceKind::CanonicalViaPromotionQueue),
+        join_change: None,
+    };
+    let req = fx.request(&p, Capability::Propose, scope, payload);
+    assert_eq!(
+        fx.svc.advance_revision_state(&req, NOW).unwrap_err().code,
+        RefusalCode::CanonicalOutsidePromotionQueue
+    );
+    assert_eq!(
+        fx.mv(&w, rev, RevisionState::Verified).unwrap_err(),
+        RefusalCode::RevisionStateMoveInvalid
+    );
+    assert_eq!(fx.svc.store().committed_seq(), before, "nothing written");
+    assert_eq!(
+        fx.svc.store().get_revision(&repo(), rev).unwrap().state,
+        RevisionState::Proposed
+    );
+    // Payloads: exactly changeset_id [32] | state 1..=5.
+    let mut bad_tag = rev.0.to_vec();
+    bad_tag.push(6);
+    for payload in [vec![], rev.0.to_vec(), bad_tag, vec![0; 34]] {
+        let req = fx.request(&w, Capability::Propose, RequestScope::default(), payload);
+        assert_eq!(
+            fx.svc.advance_revision_state(&req, NOW).unwrap_err().code,
+            RefusalCode::EnvelopeMalformed
+        );
+    }
+    let req = fx.request(&w, Capability::Read, RequestScope::default(), vec![0; 31]);
+    assert_eq!(
+        fx.svc.read_revision(&req, NOW).unwrap_err().code,
+        RefusalCode::EnvelopeMalformed
+    );
+}
+
+/// Joins with real F1 chains: `W`, whose grant descends from `O`'s, submits content
+/// byte-identical to `O`'s `Private` revision and joins it (B1), but gains no ownership: it
+/// cannot read the revision (so not `O`'s witness or attestation) and cannot move it to
+/// `Draft`, so the outsider `X` still cannot see it. Only after `O` shares it can `W` read
+/// it, and moving it stays `O`'s.
+#[test]
+fn b4_api_joining_identical_content_grants_no_ownership_of_a_private_revision() {
+    let mut fx = Fx::new("join");
+    let (o, w, x) = (fx.o.clone(), fx.w.clone(), fx.x.clone());
+    let rev = fx.submit(&o, b"orchestrator private attempt", 1);
+    assert_eq!(fx.submit(&w, b"orchestrator private attempt", 2), rev);
+    assert_eq!(fx.read(&o, rev).unwrap().witnesses.len(), 2);
+    for who in [&w, &x] {
+        assert_eq!(
+            fx.read(who, rev).unwrap_err().0,
+            RefusalCode::ChangesetNotFound
+        );
+    }
+    assert_eq!(
+        fx.mv(&w, rev, RevisionState::Draft).unwrap_err(),
+        RefusalCode::ChangesetNotFound
+    );
+    assert_eq!(
+        fx.read(&x, rev).unwrap_err().0,
+        RefusalCode::ChangesetNotFound
+    );
+    fx.mv(&o, rev, RevisionState::Draft).unwrap();
+    assert_eq!(fx.read(&w, rev).unwrap().state, RevisionState::Draft);
+    assert_eq!(
+        fx.mv(&w, rev, RevisionState::Proposed).unwrap_err(),
+        RefusalCode::AuthChainNotDominant
+    );
+}
diff --git a/crates/synapse-core/src/lib.rs b/crates/synapse-core/src/lib.rs
index caa092e..ccd494c 100644
--- a/crates/synapse-core/src/lib.rs
+++ b/crates/synapse-core/src/lib.rs
@@ -9,6 +9,7 @@ use sha2::{Digest, Sha256};
 use std::fmt;
 
 mod revision;
+mod revision_state;
 mod tree;
 pub use revision::{
     AdmissionWitness, AuthorshipAttestation, ChainPath, ChangesetEnvelopeV2, ObsolescenceKind,
@@ -16,6 +17,7 @@ pub use revision::{
     DOMAIN_AUTHORSHIP_SIGN_V2, DOMAIN_CHANGESET_ID_V2, DOMAIN_OBSOLESCENCE_SIGN_V1,
     ENVELOPE_V2_VERSION, MAX_CHAIN_PATH_DEPTH, MAX_OBSOLESCENCE_SUCCESSORS,
 };
+pub use revision_state::RevisionState;
 pub use tree::{
     tree_entry_order, validate_tree_entry_name, TreeDigest, TreeNodeEncoder, DOMAIN_TREE_V1,
     MAX_TREE_ENTRY_NAME_BYTES, TREE_TAG_DIRECTORY,
@@ -130,6 +132,13 @@ pub enum RefusalCode {
     /// An obsolescence marker names an unknown revision, a revision of another change, itself
     /// as its own successor, or would close a cycle of markers (step B1).
     ObsolescenceMarkerInvalid,
+    /// A revision state move that is not an edge of the state machine: backwards, in place,
+    /// skipping a state, or to `Verified` without its claims and required actions discharged
+    /// (ADR 0003 section 5.3, step B4).
+    RevisionStateMoveInvalid,
+    /// A move of a revision to `Canonical` that does not come from the promotion queue
+    /// (ADR 0003 sections 5.3 and 5.5, step B4).
+    CanonicalOutsidePromotionQueue,
 
     // Git and Radicle canonicality refusals
     GitObjectCorrupt,
diff --git a/crates/synapse-core/src/revision_state.rs b/crates/synapse-core/src/revision_state.rs
new file mode 100644
index 0000000..aca5e66
--- /dev/null
+++ b/crates/synapse-core/src/revision_state.rs
@@ -0,0 +1,237 @@
+//! Revision state machine (ADR 0003 section 5.3, section 9 step B4).
+//!
+//! A revision is `Private` (visible only to its owner's delegation chain) or `Draft` (visible
+//! within `Read` scope), then `Proposed`, then `Verified` (every claim and required action
+//! discharged on its exact tree), then `Canonical` (promoted by quorum, immutable). States
+//! never move backwards: replacing a revision creates a new revision and an obsolescence
+//! marker, never an earlier state. See `docs/B4_REVISION_STATES.md`.
+//!
+//! The only moves are the five forward edges of [`RevisionState::may_move_to`]. Which of them
+//! a caller may take depends on who asks: the owner chain may move a revision to `Draft` or
+//! `Proposed` ([`RevisionState::check_owner_move`]); `Verified` needs claims (step B3) and
+//! required-action receipts (step E1) discharged on the exact tree; `Canonical` is reached
+//! only through the promotion queue (step E2), so every other move to it is refused with
+//! `CanonicalOutsidePromotionQueue`.
+
+use crate::{RefusalCode, SynapseError, SynapseResult};
+
+/// Where a revision stands. The declaration order is the one forward order, so `Ord`
+/// compares states by [`RevisionState::rank`].
+#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
+pub enum RevisionState {
+    /// Visible only to its owner's delegation chain: the keys that submitted it and the keys
+    /// their grants descend from (need N14).
+    Private,
+    /// Visible within `Read` scope.
+    Draft,
+    /// Put forward for verification and promotion.
+    Proposed,
+    /// Every claim and required action discharged on its exact tree.
+    Verified,
+    /// Promoted by quorum through the promotion queue; immutable.
+    Canonical,
+}
+
+impl RevisionState {
+    /// Every state, in forward order.
+    pub const ALL: [Self; 5] = [
+        Self::Private,
+        Self::Draft,
+        Self::Proposed,
+        Self::Verified,
+        Self::Canonical,
+    ];
+
+    /// Position in the forward order (`Private` = 0 .. `Canonical` = 4).
+    pub fn rank(self) -> u8 {
+        match self {
+            Self::Private => 0,
+            Self::Draft => 1,
+            Self::Proposed => 2,
+            Self::Verified => 3,
+            Self::Canonical => 4,
+        }
+    }
+
+    /// Binary tag of the state (1..=5); 0 and anything above 5 are not states.
+    pub fn tag_byte(self) -> u8 {
+        self.rank() + 1
+    }
+
+    /// The state with binary tag `tag`, if any.
+    pub fn from_tag_byte(tag: u8) -> Option<Self> {
+        Self::ALL.get(usize::from(tag.checked_sub(1)?)).copied()
+    }
+
+    /// True for the five edges of the state machine: `Private -> Draft`,
+    /// `Private -> Proposed`, `Draft -> Proposed`, `Proposed -> Verified`, and
+    /// `Verified -> Canonical`. Every edge strictly raises the rank; nothing else is a move.
+    pub fn may_move_to(self, to: Self) -> bool {
+        matches!(
+            (self, to),
+            (Self::Private, Self::Draft)
+                | (Self::Private, Self::Proposed)
+                | (Self::Draft, Self::Proposed)
+                | (Self::Proposed, Self::Verified)
+                | (Self::Verified, Self::Canonical)
+        )
+    }
+
+    /// The order rule: `RevisionStateMoveInvalid` for any move that is not an edge
+    /// (backwards, in place, or skipping a state).
+    pub fn check_move(self, to: Self) -> SynapseResult<()> {
+        if self.may_move_to(to) {
+            return Ok(());
+        }
+        let why = if to < self {
+            "backwards"
+        } else if to == self {
+            "in place"
+        } else {
+            "skipping a state"
+        };
+        Err(SynapseError::new(
+            RefusalCode::RevisionStateMoveInvalid,
+            format!("revision state move {self:?} -> {to:?} is {why}"),
+        ))
+    }
+
+    /// A move asked for by the revision's owner chain. A move to `Canonical` is refused
+    /// with `CanonicalOutsidePromotionQueue` whatever the current state; a move to
+    /// `Verified` is refused with `RevisionStateMoveInvalid` (it is recorded only when the
+    /// claims and required actions are discharged, steps B3 and E1); otherwise the order
+    /// rule of [`RevisionState::check_move`] applies.
+    pub fn check_owner_move(self, to: Self) -> SynapseResult<()> {
+        match to {
+            Self::Canonical => Err(SynapseError::new(
+                RefusalCode::CanonicalOutsidePromotionQueue,
+                format!(
+                    "revision state move {self:?} -> Canonical: canonical moves only through the promotion queue"
+                ),
+            )),
+            Self::Verified => Err(SynapseError::new(
+                RefusalCode::RevisionStateMoveInvalid,
+                format!(
+                    "revision state move {self:?} -> Verified: needs every claim and required action discharged on the exact tree, which the owner chain cannot assert"
+                ),
+            )),
+            _ => self.check_move(to),
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    /// Seeded SplitMix64 (no new dependency), as in the F1 property tests.
+    struct SplitMix64(u64);
+
+    impl SplitMix64 {
+        fn next(&mut self) -> u64 {
+            self.0 = self.0.wrapping_add(0x9E37_79B9_7F4A_7C15);
+            let mut z = self.0;
+            z = (z ^ (z >> 30)).wrapping_mul(0xBF58_476D_1CE4_E5B9);
+            z = (z ^ (z >> 27)).wrapping_mul(0x94D0_49BB_1331_11EB);
+            z ^ (z >> 31)
+        }
+
+        fn state(&mut self) -> RevisionState {
+            RevisionState::ALL[(self.next() % 5) as usize]
+        }
+    }
+
+    #[test]
+    fn b4_state_tags_round_trip_and_unknown_tags_are_not_states() {
+        for s in RevisionState::ALL {
+            assert_eq!(RevisionState::from_tag_byte(s.tag_byte()), Some(s));
+        }
+        assert_eq!(RevisionState::from_tag_byte(0), None);
+        for tag in 6..=u8::MAX {
+            assert_eq!(RevisionState::from_tag_byte(tag), None);
+        }
+    }
+
+    #[test]
+    fn b4_every_allowed_move_raises_the_rank_and_every_other_pair_is_refused() {
+        let mut allowed = 0;
+        for from in RevisionState::ALL {
+            for to in RevisionState::ALL {
+                match from.check_move(to) {
+                    Ok(()) => {
+                        allowed += 1;
+                        assert!(to.rank() > from.rank(), "{from:?} -> {to:?}");
+                    }
+                    Err(e) => assert_eq!(e.code, RefusalCode::RevisionStateMoveInvalid),
+                }
+                if to.rank() <= from.rank() {
+                    assert!(from.check_move(to).is_err(), "{from:?} -> {to:?}");
+                    assert!(from.check_owner_move(to).is_err(), "{from:?} -> {to:?}");
+                }
+            }
+        }
+        assert_eq!(allowed, 5, "exactly the five edges of section 5.3");
+    }
+
+    #[test]
+    fn b4_owner_moves_never_reach_verified_or_canonical() {
+        for from in RevisionState::ALL {
+            assert_eq!(
+                from.check_owner_move(RevisionState::Canonical)
+                    .unwrap_err()
+                    .code,
+                RefusalCode::CanonicalOutsidePromotionQueue
+            );
+            assert_eq!(
+                from.check_owner_move(RevisionState::Verified)
+                    .unwrap_err()
+                    .code,
+                RefusalCode::RevisionStateMoveInvalid
+            );
+        }
+        RevisionState::Private
+            .check_owner_move(RevisionState::Draft)
+            .unwrap();
+        RevisionState::Private
+            .check_owner_move(RevisionState::Proposed)
+            .unwrap();
+        RevisionState::Draft
+            .check_owner_move(RevisionState::Proposed)
+            .unwrap();
+    }
+
+    /// Property: over random sequences of attempted moves (any target, owner or order rule),
+    /// applying only the accepted ones, the rank never decreases and owner moves never reach
+    /// `Verified` or `Canonical`.
+    #[test]
+    fn b4_property_random_move_sequences_never_move_backwards() {
+        let mut rng = SplitMix64(0xB4_5EED);
+        for _case in 0..2_000 {
+            let mut owner_only = rng.next().is_multiple_of(2);
+            let mut state = if rng.next().is_multiple_of(2) {
+                RevisionState::Private
+            } else {
+                RevisionState::Draft
+            };
+            for _ in 0..32 {
+                let to = rng.state();
+                let before = state;
+                let result = if owner_only {
+                    state.check_owner_move(to)
+                } else {
+                    state.check_move(to)
+                };
+                if result.is_ok() {
+                    state = to;
+                }
+                assert!(state.rank() >= before.rank(), "{before:?} -> {state:?}");
+                if owner_only {
+                    assert!(state <= RevisionState::Proposed, "owner reached {state:?}");
+                }
+                if rng.next().is_multiple_of(8) {
+                    owner_only = !owner_only && state <= RevisionState::Proposed;
+                }
+            }
+        }
+    }
+}
diff --git a/crates/synapse-store/src/a1_tests.rs b/crates/synapse-store/src/a1_tests.rs
index a2f0287..2c2d28e 100644
--- a/crates/synapse-store/src/a1_tests.rs
+++ b/crates/synapse-store/src/a1_tests.rs
@@ -407,7 +407,7 @@ fn a1_documented_layout_decodes_and_every_non_canonical_form_is_refused() {
         Err(CodecRefusal::VersionUnsupported { found: 1 })
     );
     let mut k = review.clone();
-    k[1] = 9; // first unused kind (7 and 8 are the B1 revision records)
+    k[1] = 10; // first unused kind (7 and 8 are the B1 revision records, 9 the B4 state move)
     assert_eq!(kind(decode_record(&k, CAP)), "UnknownTag");
     let mut k0 = review.clone();
     k0[1] = 0;
diff --git a/crates/synapse-store/src/codec.rs b/crates/synapse-store/src/codec.rs
index 493b8d8..4344c46 100644
--- a/crates/synapse-store/src/codec.rs
+++ b/crates/synapse-store/src/codec.rs
@@ -340,6 +340,19 @@ pub fn encode_record(record: &WalRecord) -> SynapseResult<Vec<u8>> {
             put_chain(&mut w, chain)?;
             w.u64(*recorded_at_ms);
         }
+        WalRecord::RevisionStateMoved {
+            repo_id,
+            changeset_id,
+            to,
+            chain,
+            moved_at_ms,
+        } => {
+            w.repo(repo_id)?;
+            w.raw(&changeset_id.0);
+            w.u8(to.tag_byte());
+            put_chain(&mut w, chain)?;
+            w.u64(*moved_at_ms);
+        }
     }
     Ok(w.0)
 }
@@ -731,6 +744,24 @@ pub fn decode_record(bytes: &[u8], cap: u64) -> Result<WalRecord, CodecRefusal>
             chain: r.embedded("chain path", ChainPath::decode)?,
             recorded_at_ms: r.u64()?,
         },
+        9 => {
+            let repo_id = r.repo()?;
+            let changeset_id = ChangesetId(r.array()?);
+            let at = r.pos;
+            let tag = r.u8()?;
+            let to = RevisionState::from_tag_byte(tag).ok_or(CodecRefusal::UnknownTag {
+                at,
+                field: "revision state",
+                tag,
+            })?;
+            WalRecord::RevisionStateMoved {
+                repo_id,
+                changeset_id,
+                to,
+                chain: r.embedded("chain path", ChainPath::decode)?,
+                moved_at_ms: r.u64()?,
+            }
+        }
         tag => {
             return Err(CodecRefusal::UnknownTag {
                 at,
@@ -802,7 +833,7 @@ pub struct CheckpointState {
     pub blob_first_visible_seq: BTreeMap<BlobDigest, WalSeq>,
     pub github_projections: BTreeMap<u64, GitHubPullRequestProjection>,
     pub canonical_heads: BTreeMap<RepoId, RadicleCanonicalHead>,
-    /// Revision records (kinds 7 and 8) in sequence order (ADR 0003 B1). Written only when
+    /// Revision records (kinds 7, 8, and 9) in sequence order (ADR 0003 B1, B4). Written only when
     /// non-empty, so checkpoints of stores without revisions keep their exact bytes.
     pub revision_log: Vec<(WalSeq, WalRecord)>,
 }
@@ -1089,7 +1120,7 @@ impl CheckpointState {
                 let tag_at = r.pos + 4 + 1;
                 let bytes = r.bytes()?;
                 let record = decode_record(&bytes, r.cap)?;
-                if !matches!(record.kind_byte(), 7 | 8) {
+                if !matches!(record.kind_byte(), 7..=9) {
                     return Err(CodecRefusal::UnknownTag {
                         at: tag_at,
                         field: "revision record kind",
diff --git a/crates/synapse-store/src/lib.rs b/crates/synapse-store/src/lib.rs
index 144657d..590340a 100644
--- a/crates/synapse-store/src/lib.rs
+++ b/crates/synapse-store/src/lib.rs
@@ -22,7 +22,7 @@ use std::path::{Path, PathBuf};
 use synapse_core::{
     BlobDigest, ChainPath, ChangesetEnvelope, ChangesetEnvelopeV2, ChangesetId, EvidenceAttachment,
     GitHubPullRequestProjection, IdempotencyKey, MutationOp, ObsolescenceMarker,
-    RadicleCanonicalHead, RefusalCode, RepoId, SynapseError, SynapseResult, WalSeq,
+    RadicleCanonicalHead, RefusalCode, RepoId, RevisionState, SynapseError, SynapseResult, WalSeq,
 };
 
 #[cfg(test)]
@@ -323,6 +323,16 @@ pub enum WalRecord {
         chain: ChainPath,
         recorded_at_ms: u64,
     },
+    /// A move of revision `changeset_id` of `repo_id` to state `to`, asked for under `chain` at
+    /// server time `moved_at_ms` (ADR 0003 B4). Binary codec only.
+    #[serde(skip)]
+    RevisionStateMoved {
+        repo_id: RepoId,
+        changeset_id: ChangesetId,
+        to: RevisionState,
+        chain: ChainPath,
+        moved_at_ms: u64,
+    },
 }
 
 impl WalRecord {
@@ -336,6 +346,7 @@ impl WalRecord {
             Self::LeaseUpdated { .. } => 6,
             Self::RevisionAdmitted { .. } => 7,
             Self::ObsolescenceRecorded { .. } => 8,
+            Self::RevisionStateMoved { .. } => 9,
         }
     }
 
@@ -2131,7 +2142,8 @@ impl SynapseStore {
                 }
                 self.revisions.apply(seq, record);
             }
-            record @ WalRecord::ObsolescenceRecorded { .. } => self.revisions.apply(seq, record),
+            record @ (WalRecord::ObsolescenceRecorded { .. }
+            | WalRecord::RevisionStateMoved { .. }) => self.revisions.apply(seq, record),
         }
     }
 
diff --git a/crates/synapse-store/src/revision.rs b/crates/synapse-store/src/revision.rs
index 982e3c0..87dd68f 100644
--- a/crates/synapse-store/src/revision.rs
+++ b/crates/synapse-store/src/revision.rs
@@ -1,10 +1,13 @@
 //! Revision ledger: envelope v2 revisions, their change identities, admission witnesses,
-//! and obsolescence markers (ADR 0003 section 5.1, step B1). See `docs/B1_CHANGE_IDENTITY.md`.
+//! obsolescence markers (ADR 0003 section 5.1, step B1; `docs/B1_CHANGE_IDENTITY.md`), and
+//! revision states with owner-chain visibility (section 5.3, step B4;
+//! `docs/B4_REVISION_STATES.md`).
 //!
 //! The ledger is a pure function of the revision records (`RevisionAdmitted`,
-//! `ObsolescenceRecorded`) applied in `WalSeq` order: replay, a checkpoint (which keeps the
-//! records themselves), and a live store all rebuild exactly the same ledger. v1 changesets
-//! stay in their own map with their own IDs; the two ID domains never meet.
+//! `ObsolescenceRecorded`, `RevisionStateMoved`) applied in `WalSeq` order: replay, a
+//! checkpoint (which keeps the records themselves), and a live store all rebuild exactly the
+//! same ledger. v1 changesets stay in their own map with their own IDs; the two ID domains
+//! never meet.
 
 use crate::WalRecord;
 use sha2::{Digest, Sha256};
@@ -12,7 +15,7 @@ use std::collections::{BTreeMap, BTreeSet};
 use synapse_core::{
     AdmissionWitness, AuthorshipAttestation, BlobDigest, ChainPath, ChangeId, ChangesetEnvelopeV2,
     ChangesetId, IdempotencyKey, MutationOp, ObsolescenceKind, ObsolescenceMarker, RefusalCode,
-    RepoId, RevisionContent, SynapseError, SynapseResult, WalSeq,
+    RepoId, RevisionContent, RevisionState, SynapseError, SynapseResult, WalSeq,
 };
 
 /// Domain tag of the revision part of the state root (only hashed when revisions exist).
@@ -40,6 +43,8 @@ pub struct StoredRevision {
     pub first_seq: WalSeq,
     pub attestations: Vec<AuthorshipAttestation>,
     pub witnesses: Vec<AdmissionWitness>,
+    /// Current state (step B4): `Private` from the first admission; it only moves forward.
+    pub state: RevisionState,
 }
 
 /// A recorded obsolescence marker with the chain it was recorded under.
@@ -141,6 +146,21 @@ fn record_digest(record: &WalRecord) -> [u8; 32] {
             h.update(&chain);
             h.update(recorded_at_ms.to_le_bytes());
         }
+        WalRecord::RevisionStateMoved {
+            repo_id,
+            changeset_id,
+            to,
+            chain: c,
+            moved_at_ms,
+        } => {
+            h.update((repo_id.as_str().len() as u64).to_le_bytes());
+            h.update(repo_id.as_str().as_bytes());
+            h.update(changeset_id.0);
+            h.update([to.tag_byte()]);
+            c.encode_into(&mut chain);
+            h.update(&chain);
+            h.update(moved_at_ms.to_le_bytes());
+        }
         _ => {}
     }
     h.finalize().into()
@@ -150,6 +170,23 @@ fn not_found(msg: String) -> SynapseError {
     SynapseError::new(RefusalCode::ChangesetNotFound, msg)
 }
 
+/// Owner chain rule (ADR 0003 section 5.3, step B4): `chain` owns a revision when it is, or
+/// dominates, the chain of the revision's first admission (the key that submitted it and the
+/// keys its grant descends from). A later admission of identical content (a B1 join) adds a
+/// witness but never an owner: otherwise a joiner could read the owner's authorship records
+/// and publish its `Private` attempt without the owner's consent.
+fn owned_by(rev: &StoredRevision, chain: &ChainPath) -> bool {
+    rev.witnesses
+        .first()
+        .is_some_and(|w| chain.dominates(&w.chain))
+}
+
+/// A `Private` revision is visible only to its owner chain; every later state is visible to
+/// any chain (path `Read` scope is the API's filter).
+fn visible_to(rev: &StoredRevision, viewer: &ChainPath) -> bool {
+    rev.state != RevisionState::Private || owned_by(rev, viewer)
+}
+
 impl RevisionLedger {
     pub(crate) fn log(&self) -> &[(WalSeq, WalRecord)] {
         &self.log
@@ -217,6 +254,7 @@ impl RevisionLedger {
                             first_seq: seq,
                             attestations: Vec::new(),
                             witnesses: Vec::new(),
+                            state: RevisionState::Private,
                         });
                 rev.attestations.push(att.clone());
                 rev.witnesses.push(witness);
@@ -237,6 +275,27 @@ impl RevisionLedger {
                         recorded_at_ms: *recorded_at_ms,
                     });
             }
+            WalRecord::RevisionStateMoved {
+                repo_id,
+                changeset_id,
+                to,
+                chain,
+                ..
+            } => {
+                // Kind 9 is permanently the owner-move record: `Verified` and `Canonical` come
+                // only from the evidence-bearing records of B3, E1, and E2. Kind 9 records are
+                // unsigned and the WAL seal is unkeyed, so replay accepts one only when it is
+                // an owner move (`Private -> Draft`, `Private -> Proposed`, `Draft -> Proposed`,
+                // by a chain that is or dominates the first admission's chain). Both rules are
+                // pure functions of the log that never change, so an old log keeps its
+                // meaning. Any other record stays in the log but changes nothing: no record
+                // sequence, forged or not, moves a revision backwards or past `Proposed`.
+                if let Some(rev) = self.revisions.get_mut(&(repo_id.clone(), *changeset_id)) {
+                    if owned_by(rev, chain) && rev.state.check_owner_move(*to).is_ok() {
+                        rev.state = *to;
+                    }
+                }
+            }
             _ => return,
         }
         self.log.push((seq, record));
@@ -246,6 +305,51 @@ impl RevisionLedger {
         self.revisions.get(&(repo.clone(), id))
     }
 
+    /// The revision if `viewer` may see it; `None` both when it does not exist and when it
+    /// is another owner's `Private` revision, so the two cannot be told apart.
+    pub(crate) fn get_visible(
+        &self,
+        repo: &RepoId,
+        id: ChangesetId,
+        viewer: &ChainPath,
+    ) -> Option<&StoredRevision> {
+        self.get_revision(repo, id)
+            .filter(|rev| visible_to(rev, viewer))
+    }
+
+    /// Checks of a state move asked for under `chain` (step B4). A move to `Canonical` is
+    /// refused first, whatever the revision (`CanonicalOutsidePromotionQueue`); a revision
+    /// the chain cannot see is `ChangesetNotFound`; a chain that is not the owner chain is
+    /// `AuthChainNotDominant`; then the owner-move rule of `RevisionState`.
+    pub(crate) fn plan_move(
+        &self,
+        repo: &RepoId,
+        id: ChangesetId,
+        to: RevisionState,
+        chain: &ChainPath,
+    ) -> SynapseResult<()> {
+        if to == RevisionState::Canonical {
+            return Err(SynapseError::new(
+                RefusalCode::CanonicalOutsidePromotionQueue,
+                format!(
+                    "revision {id} -> Canonical: canonical moves only through the promotion queue"
+                ),
+            ));
+        }
+        let rev = self
+            .get_visible(repo, id, chain)
+            .ok_or_else(|| not_found(format!("revision {id} not found")))?;
+        if !owned_by(rev, chain) {
+            return Err(SynapseError::new(
+                RefusalCode::AuthChainNotDominant,
+                format!(
+                    "moving revision {id} needs a chain that is or dominates the chain of its first admission"
+                ),
+            ));
+        }
+        rev.state.check_owner_move(to)
+    }
+
     /// Every revision (for compaction roots).
     pub(crate) fn revisions(&self) -> impl Iterator<Item = &StoredRevision> {
         self.revisions.values()
@@ -302,7 +406,8 @@ impl RevisionLedger {
             .filter(|e| e.creating_chain.is_some())
             .ok_or_else(|| not_found(format!("change {} not found", marker.change_id)))?;
         for id in std::iter::once(&marker.predecessor).chain(&marker.successors) {
-            if !entry.revisions.contains(id) {
+            // Another owner's `Private` revision is refused exactly like an unknown one (B4).
+            if !entry.revisions.contains(id) || self.get_visible(repo, *id, chain).is_none() {
                 return Err(not_found(format!(
                     "revision {id} is not a revision of change {}",
                     marker.change_id
@@ -376,6 +481,46 @@ impl RevisionLedger {
             markers: entry.markers.clone(),
         })
     }
+
+    /// The change as `viewer` may see it (step B4): only revisions visible to it, and only
+    /// markers whose predecessor and successors are all visible to it; live, obsolete, and
+    /// divergence are computed over those. `None` when the viewer sees no revision.
+    pub(crate) fn change_status_visible(
+        &self,
+        repo: &RepoId,
+        change_id: ChangeId,
+        viewer: &ChainPath,
+    ) -> Option<ChangeStatus> {
+        let entry = self.changes.get(&(repo.clone(), change_id))?;
+        let creating_chain = entry.creating_chain.clone()?;
+        let seen = |id: &ChangesetId| self.get_visible(repo, *id, viewer).is_some();
+        let revisions: Vec<ChangesetId> = entry.revisions.iter().copied().filter(seen).collect();
+        if revisions.is_empty() {
+            return None;
+        }
+        let markers: Vec<RecordedMarker> = entry
+            .markers
+            .iter()
+            .filter(|m| seen(&m.marker.predecessor) && m.marker.successors.iter().all(seen))
+            .cloned()
+            .collect();
+        let obsoleted: BTreeSet<ChangesetId> =
+            markers.iter().map(|m| m.marker.predecessor).collect();
+        let (obsolete, live): (Vec<_>, Vec<_>) = revisions
+            .iter()
+            .copied()
+            .partition(|id| obsoleted.contains(id));
+        Some(ChangeStatus {
+            repo_id: repo.clone(),
+            change_id,
+            creating_chain,
+            revisions,
+            divergent: live.len() > 1,
+            live,
+            obsolete,
+            markers,
+        })
+    }
 }
 
 impl crate::SynapseStore {
@@ -432,7 +577,12 @@ impl crate::SynapseStore {
         self.revisions
             .check_join(&repo, content.change_id, &authority)?;
         for parent in &content.parents {
-            let parent_repo = if self.revisions.get_revision(&repo, *parent).is_some() {
+            // Another owner's `Private` revision is not a parent this chain can name (B4).
+            let parent_repo = if self
+                .revisions
+                .get_visible(&repo, *parent, &authority.chain)
+                .is_some()
+            {
                 &repo
             } else if let Some(cs) = self.changesets.get(parent) {
                 &cs.envelope.repo_id
@@ -543,7 +693,66 @@ impl crate::SynapseStore {
         self.append_revision_record(record, &[])
     }
 
-    /// An admitted revision of `repo_id`.
+    /// Move revision `changeset_id` of `repo_id` to state `to`, asked for under `chain` at
+    /// server time `now_ms` (ADR 0003 step B4). Refused, with nothing written: any move to
+    /// `Canonical` (`CanonicalOutsidePromotionQueue`: canonical moves only through the
+    /// promotion queue, step E2); a revision the chain cannot see (`ChangesetNotFound`, the
+    /// same as an unknown one); a chain that is not, and does not dominate, the chain of
+    /// the revision's first admission (`AuthChainNotDominant`); a move to `Verified`, or any
+    /// move that is backwards, in place, or skips a state (`RevisionStateMoveInvalid`).
+    /// The owner chain may move `Private -> Draft`, `Private -> Proposed`, and
+    /// `Draft -> Proposed`.
+    pub fn advance_revision_state(
+        &mut self,
+        repo_id: &RepoId,
+        changeset_id: ChangesetId,
+        to: RevisionState,
+        chain: ChainPath,
+        now_ms: u64,
+    ) -> SynapseResult<WalSeq> {
+        self.check_writable()?;
+        self.check_binary_codec()?;
+        self.revisions
+            .plan_move(repo_id, changeset_id, to, &chain)?;
+        let record = WalRecord::RevisionStateMoved {
+            repo_id: repo_id.clone(),
+            changeset_id,
+            to,
+            chain,
+            moved_at_ms: now_ms,
+        };
+        self.append_revision_record(record, &[])
+    }
+
+    /// An admitted revision of `repo_id` as `viewer` may see it (step B4): another owner's
+    /// `Private` revision is `ChangesetNotFound`, exactly like an unknown one.
+    pub fn get_revision_visible_to(
+        &self,
+        repo_id: &RepoId,
+        changeset_id: ChangesetId,
+        viewer: &ChainPath,
+    ) -> SynapseResult<StoredRevision> {
+        self.revisions
+            .get_visible(repo_id, changeset_id, viewer)
+            .cloned()
+            .ok_or_else(|| not_found(format!("revision {changeset_id} not found")))
+    }
+
+    /// A change as `viewer` may see it (step B4): only its visible revisions and the markers
+    /// that name only visible revisions. `ChangesetNotFound` when the viewer sees none.
+    pub fn change_status_visible_to(
+        &self,
+        repo_id: &RepoId,
+        change_id: ChangeId,
+        viewer: &ChainPath,
+    ) -> SynapseResult<ChangeStatus> {
+        self.revisions
+            .change_status_visible(repo_id, change_id, viewer)
+            .ok_or_else(|| not_found(format!("change {change_id} not found")))
+    }
+
+    /// An admitted revision of `repo_id`, whatever its state (server side: no visibility
+    /// filter; reads on behalf of a key use [`Self::get_revision_visible_to`]).
     pub fn get_revision(
         &self,
         repo_id: &RepoId,
@@ -602,3 +811,188 @@ impl crate::SynapseStore {
         Ok(seq)
     }
 }
+
+#[cfg(test)]
+mod b4_tests {
+    use super::*;
+    use ed25519_dalek::SigningKey;
+    use synapse_core::{FileMode, PathMutation, TreeDigest};
+
+    struct SplitMix64(u64);
+
+    impl SplitMix64 {
+        fn next(&mut self) -> u64 {
+            self.0 = self.0.wrapping_add(0x9E37_79B9_7F4A_7C15);
+            let mut z = self.0;
+            z = (z ^ (z >> 30)).wrapping_mul(0xBF58_476D_1CE4_E5B9);
+            z = (z ^ (z >> 27)).wrapping_mul(0x94D0_49BB_1331_11EB);
+            z ^ (z >> 31)
+        }
+
+        fn below(&mut self, n: u64) -> u64 {
+            self.next() % n
+        }
+    }
+
+    fn repo() -> RepoId {
+        RepoId::new("aien-spark/synapse").unwrap()
+    }
+
+    fn chain(rng: &mut SplitMix64) -> ChainPath {
+        let len = 1 + rng.below(3) as usize;
+        ChainPath::new((0..len).map(|_| [1 + rng.below(3) as u8; 32]).collect()).unwrap()
+    }
+
+    fn admission(rng: &mut SplitMix64, n: u32) -> WalRecord {
+        let body = n.to_le_bytes();
+        let content = RevisionContent {
+            change_id: ChangeId([(n % 7) as u8; 16]),
+            base_tree: TreeDigest([0x7E; 32]),
+            parents: vec![],
+            mutations: vec![PathMutation {
+                path: "src/lib.rs".into(),
+                op: MutationOp::Upsert {
+                    mode: FileMode::Regular644,
+                    blob_digest: BlobDigest::compute(&body),
+                    size_bytes: body.len() as u64,
+                },
+            }],
+            intent_summary: "implement the task".into(),
+        };
+        let key = SigningKey::from_bytes(&[1 + rng.below(4) as u8; 32]);
+        let envelope = ChangesetEnvelopeV2::sign_new(
+            &key,
+            repo(),
+            content,
+            IdempotencyKey([n as u8; 32]),
+            1_000,
+        );
+        WalRecord::RevisionAdmitted {
+            envelope,
+            chain: chain(rng),
+            admitted_at_ms: 5_000,
+            new_blobs: vec![],
+        }
+    }
+
+    /// Property (acceptance 1, replay side): the ledger applies any sequence of revision
+    /// records, including forged moves no store call would write (backwards, in place,
+    /// skipping, to `Verified` or `Canonical`, by chains that do not own the revision).
+    /// Only owner moves apply, so no revision ever moves backwards or past `Proposed`, every
+    /// owner-move record moves its revision, and rebuilding from the log gives the same states.
+    #[test]
+    fn b4_property_forged_record_sequences_never_move_a_revision_backwards() {
+        let mut rng = SplitMix64(0xB4_0003);
+        let mut forged_refused = 0u32;
+        for _case in 0..200 {
+            let mut ledger = RevisionLedger::default();
+            let mut ids: Vec<ChangesetId> = Vec::new();
+            let mut last: BTreeMap<ChangesetId, RevisionState> = BTreeMap::new();
+            for seq in 1..=60u64 {
+                let record = if ids.is_empty() || rng.below(4) == 0 {
+                    let n = rng.below(12) as u32;
+                    let r = admission(&mut rng, n);
+                    if let WalRecord::RevisionAdmitted { envelope, .. } = &r {
+                        let id = envelope.changeset_id();
+                        if !ids.contains(&id) {
+                            ids.push(id);
+                        }
+                    }
+                    r
+                } else {
+                    WalRecord::RevisionStateMoved {
+                        repo_id: repo(),
+                        changeset_id: ids[rng.below(ids.len() as u64) as usize],
+                        to: RevisionState::ALL[rng.below(5) as usize],
+                        chain: chain(&mut rng),
+                        moved_at_ms: 6_000,
+                    }
+                };
+                let target = match &record {
+                    WalRecord::RevisionStateMoved {
+                        changeset_id,
+                        to,
+                        chain,
+                        ..
+                    } => Some((*changeset_id, *to, chain.clone())),
+                    _ => None,
+                };
+                let before = target.as_ref().map(|(id, to, chain)| {
+                    let rev = ledger.get_revision(&repo(), *id).unwrap();
+                    let legal = owned_by(rev, chain) && rev.state.check_owner_move(*to).is_ok();
+                    (rev.state, legal)
+                });
+                ledger.apply(WalSeq(seq), record);
+                if let (Some((id, to, _)), Some((from, legal))) = (target, before) {
+                    let now = ledger.get_revision(&repo(), id).unwrap().state;
+                    let want = if legal { to } else { from };
+                    assert_eq!(now, want, "{id}: {from:?} -> {to:?}");
+                    if !legal {
+                        forged_refused += 1;
+                    }
+                }
+                for id in &ids {
+                    let now = ledger.get_revision(&repo(), *id).unwrap().state;
+                    let before = last.insert(*id, now).unwrap_or(RevisionState::Private);
+                    assert!(now.rank() >= before.rank(), "{id}: {before:?} -> {now:?}");
+                    assert!(now <= RevisionState::Proposed, "{id} reached {now:?}");
+                }
+            }
+            let rebuilt = RevisionLedger::from_log(ledger.log().to_vec());
+            for id in &ids {
+                assert_eq!(
+                    rebuilt.get_revision(&repo(), *id).unwrap().state,
+                    ledger.get_revision(&repo(), *id).unwrap().state
+                );
+            }
+        }
+        assert!(forged_refused > 0, "the sequences included forged moves");
+    }
+
+    /// Kind 9 records carry no signature and the WAL seal is unkeyed, so replay accepts a
+    /// state move only when it is an owner move (`Private -> Draft`, `Private -> Proposed`,
+    /// `Draft -> Proposed`, by a chain that is or dominates the first admission's chain).
+    /// A forged `Proposed -> Verified` record, even naming the owner's chain, is refused on
+    /// replay: `Verified` comes only from B3/E1 evidence records, never from kind 9.
+    #[test]
+    fn b4_replay_refuses_a_forged_move_to_verified() {
+        let mut rng = SplitMix64(0xB4_0004);
+        let mut record = admission(&mut rng, 1);
+        let owner = ChainPath::new(vec![[1; 32], [2; 32]]).unwrap();
+        let id = match &mut record {
+            WalRecord::RevisionAdmitted {
+                envelope, chain, ..
+            } => {
+                *chain = owner.clone();
+                envelope.changeset_id()
+            }
+            _ => unreachable!(),
+        };
+        let mv = |to: RevisionState, chain: &ChainPath| WalRecord::RevisionStateMoved {
+            repo_id: repo(),
+            changeset_id: id,
+            to,
+            chain: chain.clone(),
+            moved_at_ms: 6_000,
+        };
+        let outsider = ChainPath::new(vec![[1; 32], [9; 32]]).unwrap();
+        let log = vec![
+            (WalSeq(1), record),
+            (WalSeq(2), mv(RevisionState::Proposed, &owner)),
+            (WalSeq(3), mv(RevisionState::Verified, &owner)),
+            (WalSeq(4), mv(RevisionState::Verified, &outsider)),
+            (WalSeq(5), mv(RevisionState::Canonical, &owner)),
+        ];
+        let replayed = RevisionLedger::from_log(log);
+        assert_eq!(
+            replayed.get_revision(&repo(), id).unwrap().state,
+            RevisionState::Proposed,
+            "a forged move to Verified or Canonical changes nothing on replay"
+        );
+        assert_eq!(
+            replayed.log().len(),
+            5,
+            "kept in the log, applied as no-ops"
+        );
+    }
+}
diff --git a/crates/synapse-store/tests/a1_malformed_corpus.rs b/crates/synapse-store/tests/a1_malformed_corpus.rs
index f271f2a..3cb1154 100644
--- a/crates/synapse-store/tests/a1_malformed_corpus.rs
+++ b/crates/synapse-store/tests/a1_malformed_corpus.rs
@@ -158,6 +158,8 @@ fn length_fields(record: &WalRecord, bin: &[u8]) -> Vec<usize> {
         WalRecord::LeaseUpdated { .. } => vec![],
         // Embedded envelope v2 or marker length first (ADR 0003 B1).
         WalRecord::RevisionAdmitted { .. } | WalRecord::ObsolescenceRecorded { .. } => vec![2],
+        // repo_id length first (ADR 0003 B4).
+        WalRecord::RevisionStateMoved { .. } => vec![2],
     }
 }
 
diff --git a/crates/synapse-store/tests/b1_change_identity.rs b/crates/synapse-store/tests/b1_change_identity.rs
index 65f8813..c060b7e 100644
--- a/crates/synapse-store/tests/b1_change_identity.rs
+++ b/crates/synapse-store/tests/b1_change_identity.rs
@@ -8,7 +8,8 @@ use std::path::{Path, PathBuf};
 use synapse_core::{
     encode_did_key_ed25519, BlobDigest, ChainPath, ChangeId, ChangesetEnvelope,
     ChangesetEnvelopeV2, ChangesetId, FileMode, GitOid, IdempotencyKey, MutationOp,
-    ObsolescenceMarker, PathMutation, RefusalCode, RepoId, RevisionContent, TreeDigest, WalSeq,
+    ObsolescenceMarker, PathMutation, RefusalCode, RepoId, RevisionContent, RevisionState,
+    TreeDigest, WalSeq,
 };
 use synapse_store::codec::{decode_record, encode_record};
 use synapse_store::{
@@ -311,6 +312,10 @@ fn b1_prune_by_chain_not_dominating_creating_chain_is_refused() {
     let mut s = open(&dir, FsyncPolicy::EveryCommit);
     let a = admit(&mut s, &key(2), &c.o, b"orchestrator attempt", 1);
     let b = admit(&mut s, &key(3), &c.w1, b"worker attempt", 1);
+    // The owner shares it (ADR 0003 B4), so the other chains see it and are refused for
+    // dominance rather than as an unknown revision.
+    s.advance_revision_state(&repo(), a, RevisionState::Draft, c.o.clone(), 5_500)
+        .unwrap();
     let before = s.committed_seq();
     for (signer, chain) in [(key(3), &c.w1), (key(9), &c.x), (key(4), &c.w2)] {
         let err = s
diff --git a/crates/synapse-store/tests/b4_revision_states.rs b/crates/synapse-store/tests/b4_revision_states.rs
new file mode 100644
index 0000000..09a4cf5
--- /dev/null
+++ b/crates/synapse-store/tests/b4_revision_states.rs
@@ -0,0 +1,610 @@
+//! ADR 0003 step B4 acceptance tests (issue #28): the revision state machine (`Private`,
+//! `Draft`, `Proposed`, `Verified`, `Canonical`). Over random operation sequences no revision
+//! moves backwards; a `Private` revision is invisible to every key outside its owner chain;
+//! any move to `Canonical` outside the promotion queue is refused. Chains here are plain
+//! link-digest paths; `synapse-api` tests the same rules with real signed F1 chains.
+//!
+//! The property tests use a seeded SplitMix64 generator (no new dependency, as in F1); the
+//! seed and case counts are fixed so every run checks the same sequences.
+
+use ed25519_dalek::SigningKey;
+use std::collections::BTreeMap;
+use std::path::{Path, PathBuf};
+use synapse_core::{
+    BlobDigest, ChainPath, ChangeId, ChangesetEnvelopeV2, ChangesetId, FileMode, IdempotencyKey,
+    MutationOp, ObsolescenceMarker, PathMutation, RefusalCode, RepoId, RevisionContent,
+    RevisionState, TreeDigest,
+};
+use synapse_store::codec::{decode_record, encode_record};
+use synapse_store::{
+    AdmissionAuthority, FsyncPolicy, RecoveryPolicy, RevisionOutcome, StoreLimits, SynapseStore,
+    WalRecord,
+};
+
+const STRICT: RecoveryPolicy = RecoveryPolicy::StrictFailClosed;
+const CHANGE: ChangeId = ChangeId([0xC4; 16]);
+
+struct SplitMix64(u64);
+
+impl SplitMix64 {
+    fn next(&mut self) -> u64 {
+        self.0 = self.0.wrapping_add(0x9E37_79B9_7F4A_7C15);
+        let mut z = self.0;
+        z = (z ^ (z >> 30)).wrapping_mul(0xBF58_476D_1CE4_E5B9);
+        z = (z ^ (z >> 27)).wrapping_mul(0x94D0_49BB_1331_11EB);
+        z ^ (z >> 31)
+    }
+
+    fn below(&mut self, n: u64) -> u64 {
+        self.next() % n
+    }
+}
+
+fn temp_dir(name: &str) -> PathBuf {
+    let nanos = std::time::SystemTime::now()
+        .duration_since(std::time::UNIX_EPOCH)
+        .unwrap()
+        .as_nanos();
+    let dir =
+        std::env::temp_dir().join(format!("synapse-b4-{name}-{}-{nanos}", std::process::id()));
+    std::fs::create_dir_all(&dir).unwrap();
+    dir
+}
+
+fn open(dir: &Path, policy: FsyncPolicy) -> SynapseStore {
+    let limits = StoreLimits {
+        wal_prealloc_bytes: 64 * 1024,
+        ..Default::default()
+    };
+    SynapseStore::open(dir, policy, STRICT, limits).unwrap()
+}
+
+fn repo() -> RepoId {
+    RepoId::new("aien-spark/synapse").unwrap()
+}
+
+fn path(links: &[u8]) -> ChainPath {
+    ChainPath::new(links.iter().map(|b| [*b; 32]).collect()).unwrap()
+}
+
+/// The delegation tree: root `R` = [1]; orchestrator `O` = [1,2] under it; workers
+/// `W1` = [1,2,3] and `W2` = [1,2,4] under `O`; `W1s` = [1,2,3,5], a sub-delegate of `W1`;
+/// outsider `X` = [1,9] beside `O`. Each chain presents its own key.
+const TREE: [&[u8]; 6] = [
+    &[1],
+    &[1, 2],
+    &[1, 2, 3],
+    &[1, 2, 4],
+    &[1, 2, 3, 5],
+    &[1, 9],
+];
+
+fn key_of(links: &[u8]) -> SigningKey {
+    SigningKey::from_bytes(&[*links.last().unwrap(); 32])
+}
+
+fn auth(chain: &ChainPath) -> AdmissionAuthority {
+    AdmissionAuthority {
+        chain: chain.clone(),
+        change_scope: Vec::new(),
+    }
+}
+
+/// A revision of `change` writing `body` to `src/lib.rs`, with its blob.
+fn revision(
+    author: &SigningKey,
+    change: ChangeId,
+    body: &[u8],
+    idem: [u8; 32],
+    parents: Vec<ChangesetId>,
+) -> (ChangesetEnvelopeV2, Vec<(BlobDigest, Vec<u8>)>) {
+    let digest = BlobDigest::compute(body);
+    let content = RevisionContent {
+        change_id: change,
+        base_tree: TreeDigest([0x7E; 32]),
+        parents,
+        mutations: vec![PathMutation {
+            path: "src/lib.rs".into(),
+            op: MutationOp::Upsert {
+                mode: FileMode::Regular644,
+                blob_digest: digest,
+                size_bytes: body.len() as u64,
+            },
+        }],
+        intent_summary: "implement the task".into(),
+    };
+    let env = ChangesetEnvelopeV2::sign_new(author, repo(), content, IdempotencyKey(idem), 1_000);
+    (env, vec![(digest, body.to_vec())])
+}
+
+fn admit(s: &mut SynapseStore, links: &[u8], body: &[u8], idem: u8) -> ChangesetId {
+    let (env, blobs) = revision(&key_of(links), CHANGE, body, [idem; 32], vec![]);
+    match s
+        .admit_revision(env, &blobs, auth(&path(links)), 5_000)
+        .unwrap()
+    {
+        RevisionOutcome::Admitted { changeset_id, .. } => changeset_id,
+        other => panic!("expected an admission, got {other:?}"),
+    }
+}
+
+fn state(s: &SynapseStore, id: ChangesetId) -> RevisionState {
+    s.get_revision(&repo(), id).unwrap().state
+}
+
+/// The model the store must agree with: owner moves along the edges of section 5.3 only.
+fn model_move(
+    current: RevisionState,
+    to: RevisionState,
+    owner: bool,
+    visible: bool,
+) -> Result<RevisionState, RefusalCode> {
+    if to == RevisionState::Canonical {
+        return Err(RefusalCode::CanonicalOutsidePromotionQueue);
+    }
+    if !visible {
+        return Err(RefusalCode::ChangesetNotFound);
+    }
+    if !owner {
+        return Err(RefusalCode::AuthChainNotDominant);
+    }
+    let edge = matches!(
+        (current, to),
+        (RevisionState::Private, RevisionState::Draft)
+            | (RevisionState::Private, RevisionState::Proposed)
+            | (RevisionState::Draft, RevisionState::Proposed)
+    );
+    if edge {
+        Ok(to)
+    } else {
+        Err(RefusalCode::RevisionStateMoveInvalid)
+    }
+}
+
+/// Property (acceptance 1): over random operation sequences (admissions by random chains,
+/// moves of random revisions to random states by random chains, reopen with replay, and
+/// checkpoint with compaction), no revision ever moves backwards, none reaches `Verified` or
+/// `Canonical`, every outcome equals the model's, and a refused move writes nothing.
+#[test]
+fn b4_property_random_operation_sequences_never_move_a_revision_backwards() {
+    let mut rng = SplitMix64(0xB4_0001);
+    let mut moves_applied = 0u32;
+    let mut refusals = BTreeMap::<String, u32>::new();
+    for case in 0..12 {
+        let policy = if case % 2 == 0 {
+            FsyncPolicy::EveryCommit
+        } else {
+            FsyncPolicy::GROUP_COMMIT_DEFAULT
+        };
+        let dir = temp_dir(&format!("property-{case}"));
+        let mut s = open(&dir, policy);
+        // Every revision: (id, change, body, admission chains (the first owns it), last state).
+        let mut known: Vec<(ChangesetId, ChangeId, String, Vec<ChainPath>, RevisionState)> =
+            Vec::new();
+        let mut idem = 0u32;
+        for _op in 0..40 {
+            idem += 1;
+            let mut idem_key = [0u8; 32];
+            idem_key[..4].copy_from_slice(&idem.to_le_bytes());
+            match rng.below(10) {
+                // Admit a revision under a fresh change (no join rule in play) from a random
+                // chain, or identical content of a known revision from another chain whose
+                // grant names that change (one revision, one more witness, no new owner).
+                0..=2 => {
+                    let links = TREE[rng.below(TREE.len() as u64) as usize];
+                    let rejoin = !known.is_empty() && rng.below(3) == 0;
+                    let (change, body) = if rejoin {
+                        let k = &known[rng.below(known.len() as u64) as usize];
+                        (k.1, k.2.clone())
+                    } else {
+                        (
+                            ChangeId([(idem % 251) as u8; 16]),
+                            format!("revision {idem}"),
+                        )
+                    };
+                    let (env, blobs) =
+                        revision(&key_of(links), change, body.as_bytes(), idem_key, vec![]);
+                    let id = env.changeset_id();
+                    let authority = AdmissionAuthority {
+                        chain: path(links),
+                        change_scope: vec![change],
+                    };
+                    let out = s.admit_revision(env, &blobs, authority, 5_000).unwrap();
+                    assert!(matches!(out, RevisionOutcome::Admitted { .. }));
+                    match known.iter_mut().find(|k| k.0 == id) {
+                        Some(k) => k.3.push(path(links)),
+                        None => {
+                            assert_eq!(state(&s, id), RevisionState::Private, "starts Private");
+                            known.push((
+                                id,
+                                change,
+                                body,
+                                vec![path(links)],
+                                RevisionState::Private,
+                            ));
+                        }
+                    }
+                }
+                // Attempt a move of a random revision (or an unknown ID) to a random state.
+                3..=7 => {
+                    if known.is_empty() {
+                        continue;
+                    }
+                    let i = rng.below(known.len() as u64) as usize;
+                    let unknown = rng.below(16) == 0;
+                    let id = if unknown {
+                        ChangesetId([0xEE; 32])
+                    } else {
+                        known[i].0
+                    };
+                    let to = RevisionState::ALL[rng.below(5) as usize];
+                    let chain = path(TREE[rng.below(TREE.len() as u64) as usize]);
+                    let (cur, owners) = (known[i].4, &known[i].3);
+                    let owner = !unknown && chain.dominates(&owners[0]);
+                    let visible = !unknown && (cur != RevisionState::Private || owner);
+                    let expected = model_move(cur, to, owner, visible);
+                    let before = s.committed_seq();
+                    let got = s
+                        .advance_revision_state(&repo(), id, to, chain, 6_000)
+                        .map_err(|e| e.code);
+                    match (&expected, &got) {
+                        (Ok(want), Ok(_)) => {
+                            known[i].4 = *want;
+                            moves_applied += 1;
+                        }
+                        (Err(want), Err(code)) => {
+                            assert_eq!(want, code, "{cur:?} -> {to:?}");
+                            assert_eq!(s.committed_seq(), before, "a refusal writes nothing");
+                            *refusals.entry(format!("{code:?}")).or_default() += 1;
+                        }
+                        _ => panic!("{cur:?} -> {to:?}: model {expected:?}, store {got:?}"),
+                    }
+                }
+                // Reopen: the ledger is rebuilt by replay.
+                8 => {
+                    drop(s);
+                    s = open(&dir, policy);
+                }
+                // Checkpoint with compaction, then reopen from the checkpoint.
+                _ => {
+                    s.checkpoint_and_compact(9_000).unwrap();
+                    drop(s);
+                    s = open(&dir, policy);
+                }
+            }
+            for (id, _, _, _, last) in &mut known {
+                let now = state(&s, *id);
+                assert!(
+                    now.rank() >= last.rank(),
+                    "revision {id} moved backwards {last:?} -> {now:?}"
+                );
+                assert!(
+                    now <= RevisionState::Proposed,
+                    "revision {id} reached {now:?}"
+                );
+                assert_eq!(now, *last, "store and model agree on revision {id}");
+                *last = now;
+            }
+        }
+    }
+    // The sequences exercised every outcome.
+    assert!(moves_applied > 0);
+    for code in [
+        "CanonicalOutsidePromotionQueue",
+        "ChangesetNotFound",
+        "AuthChainNotDominant",
+        "RevisionStateMoveInvalid",
+    ] {
+        assert!(refusals.contains_key(code), "no {code} in {refusals:?}");
+    }
+}
+
+/// Acceptance 2: a `Private` revision is invisible to every key outside its owner chain
+/// (the submitting chain and the chains it descends from): not readable, not listed in its
+/// change, not nameable as a parent or in a marker, not movable, also after replay and a
+/// checkpoint. Checked for the fixed delegation tree and for random chains.
+#[test]
+fn b4_private_revision_is_invisible_to_every_key_outside_its_owner_chain() {
+    let dir = temp_dir("private");
+    let mut s = open(&dir, FsyncPolicy::EveryCommit);
+    let w1: &[u8] = &[1, 2, 3];
+    let o: &[u8] = &[1, 2];
+    // O creates the change (Draft, so the change itself is visible); W1 adds a Private one.
+    let shared = admit(&mut s, o, b"orchestrator draft", 1);
+    s.advance_revision_state(&repo(), shared, RevisionState::Draft, path(o), 5_100)
+        .unwrap();
+    let p = admit(&mut s, w1, b"worker private attempt", 1);
+    assert_eq!(state(&s, p), RevisionState::Private);
+    let unknown = ChangesetId([0xEE; 32]);
+    let not_found = s
+        .get_revision_visible_to(&repo(), unknown, &path(o))
+        .unwrap_err();
+
+    let check = |s: &mut SynapseStore, viewer: &ChainPath| {
+        let owner = viewer.dominates(&path(w1));
+        let read = s.get_revision_visible_to(&repo(), p, viewer);
+        let listed = s
+            .change_status_visible_to(&repo(), CHANGE, viewer)
+            .map(|st| st.revisions.contains(&p))
+            .unwrap_or(false);
+        if owner {
+            assert_eq!(read.unwrap().changeset_id, p, "{viewer:?} owns it");
+            assert!(listed, "{viewer:?} owns it");
+            return;
+        }
+        // Refused exactly like an unknown revision: same code, same message shape.
+        let err = read.unwrap_err();
+        assert_eq!(err.code, not_found.code, "{viewer:?}");
+        assert_eq!(
+            err.message,
+            not_found
+                .message
+                .replace(&unknown.to_string(), &p.to_string())
+        );
+        assert!(!listed, "{viewer:?} must not see it in the change");
+        let before = s.committed_seq();
+        let leaf = viewer.links().last().unwrap()[0];
+        let signer = SigningKey::from_bytes(&[leaf; 32]);
+        // Not nameable as a parent.
+        let (env, blobs) = revision(&signer, ChangeId([0x77; 16]), b"child", [leaf; 32], vec![p]);
+        assert_eq!(
+            s.admit_revision(env, &blobs, auth(viewer), 5_200)
+                .unwrap_err()
+                .code,
+            RefusalCode::ParentChangesetNotFound,
+            "{viewer:?}"
+        );
+        // Not nameable in a marker, as predecessor or successor.
+        for (pred, succ) in [(p, vec![]), (shared, vec![p])] {
+            let m = ObsolescenceMarker::sign_new(&signer, repo(), CHANGE, pred, succ, 6_000);
+            assert_eq!(
+                s.record_obsolescence(m, viewer.clone(), 6_000)
+                    .unwrap_err()
+                    .code,
+                RefusalCode::ChangesetNotFound,
+                "{viewer:?}"
+            );
+        }
+        // Not movable.
+        assert_eq!(
+            s.advance_revision_state(&repo(), p, RevisionState::Draft, viewer.clone(), 6_000)
+                .unwrap_err()
+                .code,
+            RefusalCode::ChangesetNotFound,
+            "{viewer:?}"
+        );
+        assert_eq!(s.committed_seq(), before, "nothing written");
+    };
+
+    // The fixed tree: R, O, W1 own it; W2, the sub-delegate W1s, and X do not.
+    for links in TREE {
+        check(&mut s, &path(links));
+    }
+    // Random chains over the same link alphabet.
+    let mut rng = SplitMix64(0xB4_0002);
+    for _ in 0..200 {
+        let len = 1 + rng.below(4) as usize;
+        let links: Vec<u8> = (0..len)
+            .map(|_| [1u8, 2, 3, 4, 5, 9][rng.below(6) as usize])
+            .collect();
+        check(&mut s, &path(&links));
+    }
+    // The same after replay and after a checkpoint.
+    drop(s);
+    let mut s = open(&dir, FsyncPolicy::EveryCommit);
+    for links in TREE {
+        check(&mut s, &path(links));
+    }
+    s.checkpoint_and_compact(9_000).unwrap();
+    drop(s);
+    let mut s = open(&dir, FsyncPolicy::EveryCommit);
+    for links in TREE {
+        check(&mut s, &path(links));
+    }
+    // Once its owner moves it to Draft, it is visible to every chain.
+    s.advance_revision_state(&repo(), p, RevisionState::Draft, path(w1), 9_100)
+        .unwrap();
+    for links in TREE {
+        let viewer = path(links);
+        assert_eq!(
+            s.get_revision_visible_to(&repo(), p, &viewer)
+                .unwrap()
+                .state,
+            RevisionState::Draft
+        );
+        let st = s
+            .change_status_visible_to(&repo(), CHANGE, &viewer)
+            .unwrap();
+        assert_eq!(st.revisions, vec![shared, p]);
+    }
+}
+
+/// Acceptance 3: any move to `Canonical` outside the promotion queue is refused, from every
+/// state, by every chain (owner, root, outsider), for known and unknown revisions, and
+/// nothing is written. The owner chain cannot assert `Verified` either.
+#[test]
+fn b4_any_move_to_canonical_outside_the_promotion_queue_is_refused() {
+    let dir = temp_dir("canonical");
+    let mut s = open(&dir, FsyncPolicy::EveryCommit);
+    let w1: &[u8] = &[1, 2, 3];
+    let private = admit(&mut s, w1, b"private", 1);
+    let draft = admit(&mut s, w1, b"draft", 2);
+    let proposed = admit(&mut s, w1, b"proposed", 3);
+    s.advance_revision_state(&repo(), draft, RevisionState::Draft, path(w1), 5_100)
+        .unwrap();
+    s.advance_revision_state(&repo(), proposed, RevisionState::Proposed, path(w1), 5_101)
+        .unwrap();
+    let before = s.committed_seq();
+    for id in [private, draft, proposed, ChangesetId([0xEE; 32])] {
+        for links in TREE {
+            let err = s
+                .advance_revision_state(&repo(), id, RevisionState::Canonical, path(links), 6_000)
+                .unwrap_err();
+            assert_eq!(err.code, RefusalCode::CanonicalOutsidePromotionQueue);
+        }
+    }
+    for id in [private, draft, proposed] {
+        assert_eq!(
+            s.advance_revision_state(&repo(), id, RevisionState::Verified, path(w1), 6_000)
+                .unwrap_err()
+                .code,
+            RefusalCode::RevisionStateMoveInvalid
+        );
+    }
+    assert_eq!(s.committed_seq(), before, "nothing written");
+    assert_eq!(state(&s, private), RevisionState::Private);
+    assert_eq!(state(&s, draft), RevisionState::Draft);
+    assert_eq!(state(&s, proposed), RevisionState::Proposed);
+    // Backwards and in place are refused too.
+    for to in [
+        RevisionState::Private,
+        RevisionState::Draft,
+        RevisionState::Proposed,
+    ] {
+        assert_eq!(
+            s.advance_revision_state(&repo(), proposed, to, path(w1), 6_000)
+                .unwrap_err()
+                .code,
+            RefusalCode::RevisionStateMoveInvalid
+        );
+    }
+}
+
+/// Acceptance 2, joins: a chain outside the owner chain that submits byte-identical content
+/// joins the existing `Private` revision (B1 identity) but gains no ownership of it. The
+/// owner chain is fixed by the revision's first admission. The joiner cannot read it (its
+/// witnesses and attestations stay hidden), cannot find it in the change, and cannot move
+/// it; outsiders still cannot see it. After the owner shares it, the joiner may read it but
+/// still not move it. The same holds after replay and a checkpoint.
+#[test]
+fn b4_joining_identical_content_grants_no_ownership_of_a_private_revision() {
+    let dir = temp_dir("join");
+    let mut s = open(&dir, FsyncPolicy::EveryCommit);
+    let o: &[u8] = &[1, 2];
+    let w1: &[u8] = &[1, 2, 3];
+    let x: &[u8] = &[1, 9];
+    let p = admit(&mut s, o, b"orchestrator private attempt", 1);
+    // W1 descends from the creating chain, so B1 lets it join without change scope.
+    let (env, blobs) = revision(
+        &key_of(w1),
+        CHANGE,
+        b"orchestrator private attempt",
+        [2; 32],
+        vec![],
+    );
+    match s
+        .admit_revision(env, &blobs, auth(&path(w1)), 5_000)
+        .unwrap()
+    {
+        RevisionOutcome::Admitted {
+            changeset_id,
+            joined_existing_revision,
+            ..
+        } => {
+            assert_eq!(changeset_id, p);
+            assert!(joined_existing_revision);
+        }
+        other => panic!("expected a join, got {other:?}"),
+    }
+    assert_eq!(s.get_revision(&repo(), p).unwrap().witnesses.len(), 2);
+    let check = |s: &mut SynapseStore| {
+        assert_eq!(state(s, p), RevisionState::Private);
+        for viewer in [w1, x] {
+            let viewer = path(viewer);
+            assert_eq!(
+                s.get_revision_visible_to(&repo(), p, &viewer)
+                    .unwrap_err()
+                    .code,
+                RefusalCode::ChangesetNotFound,
+                "{viewer:?} joined or is outside: not an owner"
+            );
+            assert!(s
+                .change_status_visible_to(&repo(), CHANGE, &viewer)
+                .is_err());
+            let before = s.committed_seq();
+            for to in [RevisionState::Draft, RevisionState::Proposed] {
+                assert_eq!(
+                    s.advance_revision_state(&repo(), p, to, viewer.clone(), 6_000)
+                        .unwrap_err()
+                        .code,
+                    RefusalCode::ChangesetNotFound,
+                    "{viewer:?}"
+                );
+            }
+            assert_eq!(s.committed_seq(), before, "nothing written");
+        }
+        assert_eq!(
+            s.get_revision_visible_to(&repo(), p, &path(o))
+                .unwrap()
+                .witnesses
+                .len(),
+            2
+        );
+    };
+    check(&mut s);
+    drop(s);
+    let mut s = open(&dir, FsyncPolicy::EveryCommit);
+    check(&mut s);
+    s.checkpoint_and_compact(9_000).unwrap();
+    drop(s);
+    let mut s = open(&dir, FsyncPolicy::EveryCommit);
+    check(&mut s);
+    // The owner shares it: the joiner reads it now, but moving it stays the owner's.
+    s.advance_revision_state(&repo(), p, RevisionState::Draft, path(o), 9_100)
+        .unwrap();
+    assert_eq!(
+        s.get_revision_visible_to(&repo(), p, &path(w1))
+            .unwrap()
+            .state,
+        RevisionState::Draft
+    );
+    assert_eq!(
+        s.advance_revision_state(&repo(), p, RevisionState::Proposed, path(w1), 9_200)
+            .unwrap_err()
+            .code,
+        RefusalCode::AuthChainNotDominant
+    );
+    s.advance_revision_state(&repo(), p, RevisionState::Proposed, path(o), 9_300)
+        .unwrap();
+}
+
+/// The kind 9 record round-trips byte for byte; truncated, extended, and unknown-state bytes
+/// are refused typed, never a panic.
+#[test]
+fn b4_state_move_records_round_trip_and_malformed_bytes_are_refused_typed() {
+    let record = WalRecord::RevisionStateMoved {
+        repo_id: repo(),
+        changeset_id: ChangesetId([3; 32]),
+        to: RevisionState::Proposed,
+        chain: path(&[1, 2, 3]),
+        moved_at_ms: 7,
+    };
+    let bytes = encode_record(&record).unwrap();
+    assert_eq!(record.kind_byte(), 9);
+    assert_eq!(decode_record(&bytes, 1 << 20).unwrap(), record);
+    assert_eq!(
+        encode_record(&decode_record(&bytes, 1 << 20).unwrap()).unwrap(),
+        bytes
+    );
+    for cut in 0..bytes.len() {
+        assert!(decode_record(&bytes[..cut], 1 << 20).is_err(), "cut {cut}");
+    }
+    let mut longer = bytes.clone();
+    longer.push(0);
+    assert!(decode_record(&longer, 1 << 20).is_err());
+    // The state tag sits after the codec byte, kind, repo string, and changeset ID.
+    let tag_at = 2 + 4 + repo().as_str().len() + 32;
+    assert_eq!(bytes[tag_at], RevisionState::Proposed.tag_byte());
+    for bad in [0u8, 6, 0xFF] {
+        let mut b = bytes.clone();
+        b[tag_at] = bad;
+        assert!(decode_record(&b, 1 << 20).is_err(), "state tag {bad}");
+    }
+    for i in 2..bytes.len() {
+        let mut b = bytes.clone();
+        b[i] ^= 0x41;
+        if let Ok(r) = decode_record(&b, 1 << 20) {
+            assert_ne!(r, record);
+        }
+    }
+}
diff --git a/docs/B4_REVISION_STATES.md b/docs/B4_REVISION_STATES.md
new file mode 100644
index 0000000..f686c75
--- /dev/null
+++ b/docs/B4_REVISION_STATES.md
@@ -0,0 +1,59 @@
+# B4: Revision State Machine
+
+ADR 0003 section 9 step B4 (issue aien-dev/synapse#28). Section 5.3 ("States") and need N14: a revision is `Private` (visible only to its owner's delegation chain) or `Draft` (visible within `Read` scope), then `Proposed`, then `Verified` (every claim and required action discharged on its exact tree), then `Canonical` (promoted by quorum, immutable). Revisions never change state backwards; replacing one creates a new revision and an obsolescence marker (B1). Builds on B1 (revisions, admission witnesses, chain dominance) and F1 (capability chains).
+
+Code: `crates/synapse-core/src/revision_state.rs` (`RevisionState`, the order rule, the owner-move rule), `crates/synapse-store/src/revision.rs` (state in the ledger, visibility, moves), `crates/synapse-store/src/{lib,codec}.rs` (WAL kind 9, replay, checkpoint), `crates/synapse-api/src/lib.rs` (`advance_revision_state`, `read_revision`). Tests: unit tests in `crates/synapse-core/src/revision_state.rs` and `crates/synapse-store/src/revision.rs` (`b4_tests`), `crates/synapse-store/tests/b4_revision_states.rs`, `crates/synapse-api/tests/b4_revision_states.rs`. Evidence: `evidence/b4-revision-states/`.
+
+## 1. Model and invariants
+
+* **States and order.** `Private < Draft < Proposed < Verified < Canonical`. The only moves are five forward edges: `Private -> Draft`, `Private -> Proposed`, `Draft -> Proposed`, `Proposed -> Verified`, `Verified -> Canonical`. Every edge strictly raises the rank; a move backwards, in place, or skipping a state is `RevisionStateMoveInvalid`.
+* **Owner chain.** A chain owns a revision when it is, or dominates, the chain of the revision's first admission witness (B1): the key that submitted it and the keys its grant descends from. A sub-delegate of the submitter (a chain that descends from it) is not an owner, and neither is a sibling or an outsider. Section 5.3 names "the key that submitted it" but does not say what a later identical submission (a B1 join) grants; B4 takes the most restrictive reading: a join adds a witness and an attestation, never an owner.
+* **Initial state.** Every admission starts `Private` (fails closed; see section 5 on the grant default). A second admission of identical content (B1 join) adds a witness and leaves the state and the owner chain unchanged: a joiner outside the owner chain cannot read the revision (so not the owner's witness or attestation), cannot find it in the change, and cannot move it; once the owner shares it, the joiner may read it but still not move it.
+* **Visibility.** A `Private` revision is visible only to its owner chains; any other state is visible to every chain the caller's `Read` scope allows. A revision a chain may not see behaves exactly like one that does not exist: reads, moves, parent references, and obsolescence markers naming it are refused with `ChangesetNotFound` and the same message as for an unknown revision. Change status seen by a chain lists only the revisions and markers it may see, and recomputes live, obsolete, and divergent from them.
+* **Who may move.** The owner chain may move its revision to `Draft` or `Proposed`. A move to `Verified` is refused to the owner (`RevisionStateMoveInvalid`): it needs claims (B3) and required-action receipts (E1) discharged on the exact tree, which no chain can assert by itself. Any move to `Canonical` is refused with `CanonicalOutsidePromotionQueue`, checked first, whatever the revision or chain: `Canonical` is reached only through the promotion queue's compare-and-swap (E2).
+* **Determinism and replay.** The ledger is a pure function of the kind 7, 8, and 9 records in sequence order. Kind 9 is permanently the owner-move record: `Verified` and `Canonical` come only from the evidence-bearing records of B3, E1, and E2, never from kind 9. Kind 9 records are unsigned and the WAL seal is unkeyed (CRC32C and an unkeyed hash chain detect corruption, not forgery), so replay accepts a kind 9 record only when it is an owner move: `Private -> Draft`, `Private -> Proposed`, or `Draft -> Proposed`, by a chain that is or dominates the first admission's chain. Both rules are pure functions of the log that never change, so an old log keeps its meaning. Any other record (forged or corrupt) is kept in the log and in the state root but changes nothing, so replay, a checkpoint, and a live store rebuild the same states and no record sequence moves a revision backwards or past `Proposed`.
+
+## 2. Operations
+
+| Operation | Store | API (F1 chained request) |
+|---|---|---|
+| Move | `advance_revision_state(repo, changeset_id, to, chain, now_ms) -> WalSeq` | `advance_revision_state(req, now_ms)`: capability `Propose`; payload = `RevisionStateMovePayload`; chain = the request's chain |
+| Read | `get_revision_visible_to(repo, id, viewer)`, `change_status_visible_to(repo, change_id, viewer)` | `read_revision(req, now_ms)`: capability `Read`; payload = the 32-byte `ChangesetId`; every mutation path of the revision must be in the leaf's path scope, otherwise `ChangesetNotFound` |
+| Server-side read | `get_revision(repo, id)`, `change_status(repo, change_id)` (unfiltered) | through `store()` |
+
+Move check order: `to == Canonical` (`CanonicalOutsidePromotionQueue`), then visibility (`ChangesetNotFound`), then owner chain (`AuthChainNotDominant`), then the owner-move rule (`RevisionStateMoveInvalid`). A store still writing v1 JSON records refuses moves with `EnvelopeVersionUnsupported`, as for B1 records. Nothing is written on a refusal.
+
+## 3. Canonical binary layout (principle P5)
+
+All integers little-endian; `str` = `u32 len | UTF-8`; trailing bytes refused.
+
+* State tag: `Private` = 1, `Draft` = 2, `Proposed` = 3, `Verified` = 4, `Canonical` = 5; 0 and 6..=255 are not states.
+* WAL kind 9 `RevisionStateMoved`: `repo str | changeset_id [32] | to u8 | u32 len | chain | moved_at_ms u64`. Binary only (no v1 JSON form); an unknown state tag is `CodecRefusal::UnknownTag { field: "revision state" }`.
+* `RevisionStateMovePayload`: exactly `changeset_id [32] | to u8` (33 bytes); anything else, or an unknown tag, is `EnvelopeMalformed`.
+* Checkpoint v2: the revision section of B1 now holds kind 7, 8, or 9 records.
+* State root: kind 9 records join the revision part of the root (B1) with digest input `u64 repo len | repo | changeset_id | tag | chain | moved_at_ms`; stores without revision records keep every existing root.
+
+## 4. Acceptance
+
+| Acceptance (issue #28) | Test |
+|---|---|
+| Over random operation sequences no revision moves backwards | `b4_property_random_operation_sequences_never_move_a_revision_backwards` (store: 12 seeded cases of 40 random admissions, joins, moves by any chain to any state, reopens, and checkpoint-compact-reopens, checked against a model, under the `EveryCommit` and group-commit fsync policies); `b4_property_forged_record_sequences_never_move_a_revision_backwards` (ledger: 200 seeded cases of 60 raw records including forged moves, rebuilt from the log); `b4_replay_refuses_a_forged_move_to_verified`; `b4_property_random_move_sequences_never_move_backwards` (core: 2000 cases of 32 moves) |
+| A `Private` revision is invisible to every key outside its owner chain | `b4_private_revision_is_invisible_to_every_key_outside_its_owner_chain` (read, change status, parent, marker, and move, for the delegation tree and 200 random chains, after replay and a checkpoint); `b4_api_private_revision_is_invisible_outside_its_owner_chain_with_real_f1_chains`; joins: `b4_joining_identical_content_grants_no_ownership_of_a_private_revision` (also after replay and a checkpoint), `b4_api_joining_identical_content_grants_no_ownership_of_a_private_revision` |
+| Any move to `Canonical` outside the promotion queue is refused | `b4_any_move_to_canonical_outside_the_promotion_queue_is_refused`; `b4_api_move_to_canonical_outside_the_promotion_queue_is_refused` (including a grant with `Publish` and `CanonicalViaPromotionQueue`); `b4_owner_moves_never_reach_verified_or_canonical` |
+
+Also: `b4_state_move_records_round_trip_and_malformed_bytes_are_refused_typed`, `b4_state_tags_round_trip_and_unknown_tags_are_not_states`, `b4_every_allowed_move_raises_the_rank_and_every_other_pair_is_refused`. The B1 prune tests now share the orchestrator's revision (`Private -> Draft`) before checking that other chains are refused for dominance, since a `Private` revision is now unknown to them.
+
+Red before green: each acceptance test was run against the B4 commit with one mutation that removes the behaviour it proves (`evidence/b4-revision-states/red-green/red.txt`), and fails; `green.txt` holds the passing runs. The join tests (review of PR #88) were committed before their fix and fail on the earlier implementation (`red-join.txt`); so was the replay test `b4_replay_refuses_a_forged_move_to_verified` (`red-replay.txt`).
+
+## 5. Limits and deviations
+
+* **Grant default.** Section 5.3 says the grant sets the default between `Private` and `Draft`. F1's link caveats have no such field, so every admission starts `Private` and the owner moves it to `Draft`. Adding the default needs a new F1 caveat field and link version; it is not part of B4.
+* `Verified` is not reachable yet: it is recorded when claims (B3) and required-action receipts (E1) are discharged on the exact tree. `Canonical` is reached only by the promotion queue (E2), which does not exist yet; `CanonicalPromoted` (the canonical reference head) is unchanged and does not consult revision states.
+* An identical-content admission from a chain that may not see the existing `Private` revision joins it (B1 identity covers content only) and reports `joined_existing_revision`. That reveals only that the same content already exists under the change (which the joiner already holds); the joiner gains no ownership, cannot read the owner's witnesses or attestations, and cannot publish the revision.
+* The cost of that restrictive reading: a joiner outside the owner chain cannot read, name as a parent, or mark the revision it submitted itself until the owner shares it. The reverse exposure remains: when the owner publishes, every joiner's attestation (its authorship) becomes visible with the revision without that joiner's consent; this matters only for a joiner the owner could not already see (a change-scope joiner outside the owner's subtree). Low.
+* Kind 9 records are not signed, so a forged owner move (for example publishing a `Private` revision to `Draft`) written straight into the WAL and resealed would apply on replay; it can never reach `Verified` or `Canonical` or move backwards. Signing state moves and verifying the mover at replay is issue #89. Replay does not re-verify kind 7 and 8 signatures either.
+* Change-existence oracle (B1, low): when every revision of a change is another owner's `Private` revision, a chain that neither descends from the creating chain nor names the change gets `AuthChangeOutOfScope` where an unknown change would admit it as creator. `ChangeId`s are 16 random bytes, so this needs the ID.
+* Upgrade: revisions admitted before B4 replay as `Private` (no kind 9 record), so after the upgrade they are invisible to non-owners until an owner moves them. This fails closed.
+* Store-level `get_revision` and `change_status`, and `SynapseService::store()`, are unfiltered server-side reads; callers acting for an agent use the `_visible_to` reads or `read_revision`. Subscriptions, search, and predictions (section 5.7) do not exist yet and must filter the same way when they are built.
+* Revision reads are not snapshot-bounded yet (as in B1).
+* No performance figures: B4 has no hot-path acceptance, and none were measured.
diff --git a/evidence/b4-revision-states/SHA256SUMS b/evidence/b4-revision-states/SHA256SUMS
new file mode 100644
index 0000000..1be38bf
--- /dev/null
+++ b/evidence/b4-revision-states/SHA256SUMS
@@ -0,0 +1,4 @@
+9b646db93b9478d40270919e05242bbd57ba88a3d1eb1b366f20fd47d9aa2548  red-green/green.txt
+c4d1614b0fc4b83436bedf21ebaf3a6bf04a07f3364d3dc21d3e7d9371bcb30b  red-green/red-join.txt
+9893d4c58160b80959da78d600a95e8e32fda910fa16f0ed1fb88aa69e0db92b  red-green/red-replay.txt
+85131e285b23225231363b9d3bd2736f19b6c9e95fd0f8ab723e09c592e31e61  red-green/red.txt
diff --git a/evidence/b4-revision-states/red-green/green.txt b/evidence/b4-revision-states/red-green/green.txt
new file mode 100644
index 0000000..3b94890
--- /dev/null
+++ b/evidence/b4-revision-states/red-green/green.txt
@@ -0,0 +1,43 @@
+# Green (2026-10-17, B4 commit 6ad04b9 on origin/main 3d78efe; workspace 341 passed, 0 failed, 1 ignored; clippy -D warnings and fmt clean)
+
+# Command: cargo test --locked -p synapse-core --lib b4_ -- --test-threads=1
+test revision_state::tests::b4_every_allowed_move_raises_the_rank_and_every_other_pair_is_refused ... ok
+test revision_state::tests::b4_owner_moves_never_reach_verified_or_canonical ... ok
+test revision_state::tests::b4_property_random_move_sequences_never_move_backwards ... ok
+test revision_state::tests::b4_state_tags_round_trip_and_unknown_tags_are_not_states ... ok
+test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 13 filtered out; finished
+
+# Command: cargo test --locked -p synapse-store --lib b4_ -- --test-threads=1
+test revision::b4_tests::b4_property_forged_record_sequences_never_move_a_revision_backwards ... ok
+test revision::b4_tests::b4_replay_refuses_a_forged_move_to_verified ... ok
+test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 53 filtered out; finished
+
+# Command: cargo test --locked -p synapse-store --test b4_revision_states -- --test-threads=1
+test b4_any_move_to_canonical_outside_the_promotion_queue_is_refused ... ok
+test b4_joining_identical_content_grants_no_ownership_of_a_private_revision ... ok
+test b4_private_revision_is_invisible_to_every_key_outside_its_owner_chain ... ok
+test b4_property_random_operation_sequences_never_move_a_revision_backwards ... ok
+test b4_state_move_records_round_trip_and_malformed_bytes_are_refused_typed ... ok
+test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished
+
+# Command: cargo test --locked -p synapse-api --test b4_revision_states -- --test-threads=1
+test b4_api_joining_identical_content_grants_no_ownership_of_a_private_revision ... ok
+test b4_api_move_to_canonical_outside_the_promotion_queue_is_refused ... ok
+test b4_api_private_revision_is_invisible_outside_its_owner_chain_with_real_f1_chains ... ok
+test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished
+
+# Command: cargo test --locked -p synapse-store --test b1_change_identity -- --test-threads=1
+test b1_divergence_two_live_successors_is_detected ... ok
+test b1_every_v1_changeset_id_still_resolves_to_its_record ... ok
+test b1_identical_content_two_agents_one_chain_one_change_is_one_revision_two_attestations_two_witnesses ... ok
+test b1_join_from_key_outside_creating_chain_without_change_scope_is_refused ... ok
+test b1_prune_by_chain_not_dominating_creating_chain_is_refused ... ok
+test b1_repeat_same_repo_did_idempotency_key_returns_first_wal_seq ... ok
+test b1_revision_records_round_trip_and_malformed_bytes_are_refused_typed ... ok
+test b1_rewrite_keeps_change_id_and_gets_new_changeset_id ... ok
+test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished
+
+# Command: cargo test --locked -p synapse-api --test b1_chained_revisions -- --test-threads=1
+test b1_api_join_and_prune_follow_the_creating_chain_of_real_f1_chains ... ok
+test b1_api_refuses_paths_outside_scope_foreign_authors_and_unknown_bases ... ok
+test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished
diff --git a/evidence/b4-revision-states/red-green/red-join.txt b/evidence/b4-revision-states/red-green/red-join.txt
new file mode 100644
index 0000000..acb2a5c
--- /dev/null
+++ b/evidence/b4-revision-states/red-green/red-join.txt
@@ -0,0 +1,7 @@
+# Red (2026-10-17): the join tests (review of #88, finding 1) on commit 439586b (tests only, implementation of ae6505b).
+# Command: cargo test --locked -p synapse-store --test b4_revision_states b4_joining_identical_content_grants_no_ownership_of_a_private_revision -- --exact
+thread 'b4_joining_identical_content_grants_no_ownership_of_a_private_revision' panicked at crates/synapse-store/tests/b4_revision_states.rs:516:22:
+test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 4 filtered out; finished
+# Command: cargo test --locked -p synapse-api --test b4_revision_states b4_api_joining_identical_content_grants_no_ownership_of_a_private_revision -- --exact
+thread 'b4_api_joining_identical_content_grants_no_ownership_of_a_private_revision' panicked at crates/synapse-api/tests/b4_revision_states.rs:382:31:
+test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 2 filtered out; finished
diff --git a/evidence/b4-revision-states/red-green/red-replay.txt b/evidence/b4-revision-states/red-green/red-replay.txt
new file mode 100644
index 0000000..8d8f794
--- /dev/null
+++ b/evidence/b4-revision-states/red-green/red-replay.txt
@@ -0,0 +1,6 @@
+# Red (2026-10-17): the replay test (re-review of #88) on commit f303ed9 (test only, implementation of dd8ed8d).
+# Command: cargo test --locked -p synapse-store --lib revision::b4_tests::b4_replay_refuses_a_forged_move_to_verified -- --exact
+thread 'revision::b4_tests::b4_replay_refuses_a_forged_move_to_verified' panicked at crates/synapse-store/src/revision.rs:983:9:
+  left: Verified
+ right: Proposed
+test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 54 filtered out; finished
diff --git a/evidence/b4-revision-states/red-green/red.txt b/evidence/b4-revision-states/red-green/red.txt
new file mode 100644
index 0000000..3859d5e
--- /dev/null
+++ b/evidence/b4-revision-states/red-green/red.txt
@@ -0,0 +1,62 @@
+# Red (2026-10-17): each B4 acceptance test run against the B4 commit 6f222e6 with one mutation
+# that removes the behaviour it proves; every mutation is reverted after its run (git checkout).
+
+## order rule lets a revision move backwards
+# mutation: crates/synapse-core/src/revision_state.rs may_move_to: + if to < self { return true; }
+# Command: cargo test --locked -p synapse-core --lib revision_state::tests::b4_property_random_move_sequences_never_move_backwards -- --exact
+thread 'revision_state::tests::b4_property_random_move_sequences_never_move_backwards' panicked at crates/synapse-core/src/revision_state.rs:230:17:
+test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 16 filtered out; finished in 0.00s
+error: test failed, to rerun pass `-p synapse-core --lib`
+# Command: cargo test --locked -p synapse-core --lib revision_state::tests::b4_every_allowed_move_raises_the_rank_and_every_other_pair_is_refused -- --exact
+thread 'revision_state::tests::b4_every_allowed_move_raises_the_rank_and_every_other_pair_is_refused' panicked at crates/synapse-core/src/revision_state.rs:166:25:
+test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 16 filtered out; finished in 0.00s
+error: test failed, to rerun pass `-p synapse-core --lib`
+# Command: cargo test --locked -p synapse-store --test b4_revision_states b4_property_random_operation_sequences_never_move_a_revision_backwards -- --exact
+thread 'b4_property_random_operation_sequences_never_move_a_revision_backwards' panicked at crates/synapse-store/tests/b4_revision_states.rs:260:30:
+test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 3 filtered out; finished in 0.05s
+error: test failed, to rerun pass `-p synapse-store --test b4_revision_states`
+# Command: cargo test --locked -p synapse-api --test b4_revision_states b4_api_private_revision_is_invisible_outside_its_owner_chain_with_real_f1_chains -- --exact
+thread 'b4_api_private_revision_is_invisible_outside_its_owner_chain_with_real_f1_chains' panicked at crates/synapse-api/tests/b4_revision_states.rs:301:32:
+test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.12s
+error: test failed, to rerun pass `-p synapse-api --test b4_revision_states`
+
+## revision ledger applies every kind 9 record (forged or illegal moves included)
+# mutation: crates/synapse-store/src/revision.rs apply: - if owned_by(rev, chain) && rev.state.check_owner_move(*to).is_ok() { + if true {
+# Command: cargo test --locked -p synapse-store --lib revision::b4_tests::b4_property_forged_record_sequences_never_move_a_revision_backwards -- --exact
+thread 'revision::b4_tests::b4_property_forged_record_sequences_never_move_a_revision_backwards' panicked at crates/synapse-store/src/revision.rs:918:21:
+test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 53 filtered out; finished in 0.00s
+error: test failed, to rerun pass `-p synapse-store --lib`
+
+## a Private revision is visible to every chain
+# mutation: crates/synapse-store/src/revision.rs visible_to: - rev.state != RevisionState::Private || owned_by(rev, viewer) + true || owned_by(rev, viewer)
+# Command: cargo test --locked -p synapse-store --test b4_revision_states b4_private_revision_is_invisible_to_every_key_outside_its_owner_chain -- --exact
+thread 'b4_private_revision_is_invisible_to_every_key_outside_its_owner_chain' panicked at crates/synapse-store/tests/b4_revision_states.rs:336:24:
+test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 3 filtered out; finished in 0.05s
+error: test failed, to rerun pass `-p synapse-store --test b4_revision_states`
+# Command: cargo test --locked -p synapse-api --test b4_revision_states b4_api_private_revision_is_invisible_outside_its_owner_chain_with_real_f1_chains -- --exact
+thread 'b4_api_private_revision_is_invisible_outside_its_owner_chain_with_real_f1_chains' panicked at crates/synapse-api/tests/b4_revision_states.rs:271:45:
+test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.08s
+error: test failed, to rerun pass `-p synapse-api --test b4_revision_states`
+
+## a move to Canonical accepted outside the promotion queue
+# mutation: crates/synapse-core/src/revision_state.rs check_owner_move: - Self::Canonical => Err( + Self::Canonical if false => Err(; crates/synapse-store/src/revision.rs plan_move: Canonical returns Ok(()) after the visibility check; ledger apply: owner move to Canonical applied
+# Command: cargo test --locked -p synapse-core --lib revision_state::tests::b4_owner_moves_never_reach_verified_or_canonical -- --exact
+thread 'revision_state::tests::b4_owner_moves_never_reach_verified_or_canonical' panicked at crates/synapse-core/src/revision_state.rs:182:22:
+test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 16 filtered out; finished in 0.00s
+error: test failed, to rerun pass `-p synapse-core --lib`
+# Command: cargo test --locked -p synapse-store --test b4_revision_states b4_any_move_to_canonical_outside_the_promotion_queue_is_refused -- --exact
+thread 'b4_any_move_to_canonical_outside_the_promotion_queue_is_refused' panicked at crates/synapse-store/tests/b4_revision_states.rs:442:18:
+test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 3 filtered out; finished in 1.89s
+error: test failed, to rerun pass `-p synapse-store --test b4_revision_states`
+# Command: cargo test --locked -p synapse-api --test b4_revision_states b4_api_move_to_canonical_outside_the_promotion_queue_is_refused -- --exact
+thread 'b4_api_move_to_canonical_outside_the_promotion_queue_is_refused' panicked at crates/synapse-api/tests/b4_revision_states.rs:321:58:
+test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.06s
+error: test failed, to rerun pass `-p synapse-api --test b4_revision_states`
+
+## kind 9 decoder accepts an unknown state tag
+# mutation: crates/synapse-store/src/codec.rs: unknown revision state tag decoded as Private
+# Command: cargo test --locked -p synapse-store --test b4_revision_states b4_state_move_records_round_trip_and_malformed_bytes_are_refused_typed -- --exact
+thread 'b4_state_move_records_round_trip_and_malformed_bytes_are_refused_typed' panicked at crates/synapse-store/tests/b4_revision_states.rs:503:9:
+test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 3 filtered out; finished in 0.00s
+error: test failed, to rerun pass `-p synapse-store --test b4_revision_states`
+# done