1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! Visibility of persisted entities under an explicit statement snapshot.
//! Host authorization, tenant and provider policy remain outside this module.
use ;
use crate;
use Value;
/// Reserved row field that carries a row's moderation visibility state.
///
/// A row that committed but is hidden from normal reads carries this
/// field; a fully-cleared (allowed) row does not. Two values are used:
/// * [`MODERATION_STATUS_PENDING`] — quarantine-pending (provider was
/// down at write time under fail-open; awaiting async re-moderation),
/// * [`MODERATION_STATUS_REJECTED`] — re-moderated to a reject; the row
/// is tombstoned-and-retained for audit/appeal.
///
/// It is a reserved system field (see the host reserved-field registry) so users
/// cannot declare or set it, and the read-path visibility helpers hide any
/// row that carries it from normal SELECT/scan reads (ADR 0057).
pub const MODERATION_STATUS_FIELD: &str = "__moderation_status";
/// Value of [`MODERATION_STATUS_FIELD`] for a quarantine-pending row.
pub const MODERATION_STATUS_PENDING: &str = "pending";
/// Value of [`MODERATION_STATUS_FIELD`] for a rejected-tombstone row.
pub const MODERATION_STATUS_REJECTED: &str = "rejected";
/// Whether `entity` carries a moderation status that must hide it from
/// normal reads (quarantine-pending or rejected-tombstone).
///
/// This is consulted on the hot read path for *every* table-row candidate,
/// so it is a single, allocation-free field probe. Non-row entities and
/// rows without the marker are never hidden by moderation.
/// Apply moderation markers, captured MVCC state and serializable read tracking.
/// With no snapshot this retains the native raw-visibility helper's behavior;
/// collection scans additionally hide superseded physical versions.