Cap evidence stored on Guardian v3 shadow boards (#64166)

## Why

Shadow routing can store the same evidence in multiple channels. A per-root
limit bounds how much evidence each shadow board accumulates.

## What changed

- Default to 32 MiB of serialized evidence per root shadow board and count
  each stored channel copy. Allow users to set
  `features.guardianv3.shadow_board_limit_mib` in user config. Ignore project
  overrides of the limit and discard positional Guardian v3 project settings
  that could bypass filtering for user-only fields.
- Reject batches that would exceed the limit before creating channels or
  appending posts. Skip the routing call when even one copy of the first
  source would exceed the remaining budget.
- Signal root and child shadow reviewers when intake stops, independently of
  reviewer cancellation. Record channel counts, post counts, and evidence
  bytes after successful batches, and tag worker failures by stage.

## Testing

Tests cover byte accounting across distinct destinations, overflow before and
after routing, an unchanged board after a rejected batch, intake stop signals
for root and child reviewers, and project config filtering.

GitOrigin-RevId: 9d908ceb6f33ba69eed2a07223b3f9177afbe11e
This commit is contained in:
felixxia-oai
2026-11-26 15:22:56 +00:00
committed by copyberry
parent 42c320991e
commit d0b140efb5
14 changed files with 386 additions and 14 deletions
+15 -3
View File
@@ -1375,18 +1375,30 @@ fn sanitize_project_config(
{
ignored_keys.push("features.shell_snapshot".to_string());
}
// Serde also accepts positional arrays for these structs. Project overrides
// must use named settings so the user-only fields below can be filtered.
if features.get("guardianv3").is_some_and(TomlValue::is_array) {
features.remove("guardianv3");
ignored_keys.push("features.guardianv3".to_string());
}
if let Some(guardian) = features
.get_mut("guardianv3")
.and_then(TomlValue::as_table_mut)
{
if guardian.remove("max_instruction_tokens").is_some() {
ignored_keys.push("features.guardianv3.max_instruction_tokens".to_string());
for key in ["max_instruction_tokens", "shadow_board_limit_mib"] {
if guardian.remove(key).is_some() {
ignored_keys.push(format!("features.guardianv3.{key}"));
}
}
for (section, key) in [
("housekeeper", "routing_instructions"),
("reviewer", "retrieval_instructions"),
] {
if let Some(settings) = guardian.get_mut(section).and_then(TomlValue::as_table_mut)
if guardian.get(section).is_some_and(TomlValue::is_array) {
guardian.remove(section);
ignored_keys.push(format!("features.guardianv3.{section}"));
} else if let Some(settings) =
guardian.get_mut(section).and_then(TomlValue::as_table_mut)
&& settings.remove(key).is_some()
{
ignored_keys.push(format!("features.guardianv3.{section}.{key}"));
+33 -1
View File
@@ -1310,10 +1310,11 @@ async fn local_layers_keep_raw_paths_order_and_legacy_requirements() {
}
#[test]
fn project_config_cannot_supply_guardian_v3_prompts_or_their_cap() {
fn project_config_cannot_override_guardian_v3_prompts_or_limits() {
let mut project: TomlValue = toml::toml! {
[features.guardianv3]
max_instruction_tokens = 1
shadow_board_limit_mib = 512
[features.guardianv3.housekeeper]
routing_instructions = "Use project routing"
batch_timeout_ms = 15000
@@ -1340,6 +1341,7 @@ fn project_config_cannot_supply_guardian_v3_prompts_or_their_cap() {
ignored,
[
"features.guardianv3.max_instruction_tokens",
"features.guardianv3.shadow_board_limit_mib",
"features.guardianv3.housekeeper.routing_instructions",
"features.guardianv3.reviewer.retrieval_instructions",
]
@@ -1358,6 +1360,36 @@ fn project_config_cannot_supply_guardian_v3_prompts_or_their_cap() {
);
}
#[test]
fn project_config_ignores_positional_guardian_v3_settings() {
let mut project: TomlValue =
toml::from_str("features.guardianv3 = [512, true, true, {}, {}, 1]").unwrap();
let sanitize = |project: &mut TomlValue| {
sanitize_project_config(project, CredentialBrokerProjectState::Unconfigured, &[])
};
assert_eq!(sanitize(&mut project), ["features.guardianv3"]);
assert!(project["features"].get("guardianv3").is_none());
let mut project: TomlValue = toml::toml! {
[features.guardianv3]
enabled = true
housekeeper = ["Use project routing", 15000]
reviewer = ["Use project retrieval"]
}
.into();
assert_eq!(
sanitize(&mut project),
[
"features.guardianv3.housekeeper",
"features.guardianv3.reviewer"
]
);
assert_eq!(
project,
toml::toml! { [features.guardianv3] enabled = true }.into()
);
}
#[test]
fn project_config_cannot_change_protected_features() {
for key in [
+6
View File
@@ -2558,6 +2558,12 @@
},
"reviewer": {
"$ref": "#/definitions/GuardianV3ReviewerConfigToml"
},
"shadow_board_limit_mib": {
"description": "Maximum evidence per root shadow board in MiB. Defaults to 32. Ignored in project config.",
"format": "uint32",
"minimum": 1.0,
"type": "integer"
}
},
"type": "object"
+2
View File
@@ -61,6 +61,8 @@ pub fn reviewer_headers(config: &crate::config::Config) -> crate::CodexResponses
/// Kept out of the authoritative reviewer slot so routing and prewarming stay unchanged.
pub struct ShadowReviewer {
pub reviewer: std::sync::Arc<dyn AttachedReviewer>,
/// Blocks new shadow reviews after intake exits. Never cancels an admitted verdict.
pub intake_stopped: tokio_util::sync::CancellationToken,
/// Stops this actor when it shuts down or the root leaves Auto Review.
pub cancellation: tokio_util::sync::CancellationToken,
}
+1
View File
@@ -9,6 +9,7 @@ codex_rust_crate(
test_tags = ["no-sandbox"],
unit_test_srcs = [
"src/host_tests.rs",
"src/shadow_metrics_tests.rs",
"tests/common/board_host.rs",
"//codex-rs/message-board:tests/common/mod.rs",
],
+37 -4
View File
@@ -47,6 +47,9 @@ use crate::Housekeeper;
use crate::LiveDelivery;
use crate::local_board;
use crate::local_board_options;
use crate::shadow_metrics::BoardSize;
use crate::shadow_metrics::PayloadLimit;
use crate::shadow_metrics::ShadowMetrics;
#[path = "shadow.rs"]
mod shadow;
@@ -145,6 +148,7 @@ enum BoardStorage {
pub(super) struct TreeDelivery {
pub(super) delivery: OnceLock<Arc<LiveDelivery>>,
stop: CancellationToken,
shadow_intake_stopped: CancellationToken,
actors: Mutex<Vec<Weak<ActorReviewer>>>,
}
@@ -290,10 +294,13 @@ impl Host {
let _ = wake.try_send(None);
}
let shadow = self.shadow;
let intake_guard = shadow.then(|| tree.shadow_intake_stopped.clone().drop_guard());
let metrics = thread.get::<ShadowMetrics>();
let manager = self.manager.clone();
let settings = Arc::clone(&self.housekeeper);
let cancellation = lifetime.cancellation.clone();
lifetime.tasks.spawn(async move {
let mut failure_stage = "housekeeper";
let work = async {
let board = Arc::new(board);
let mut housekeeper = None;
@@ -321,6 +328,7 @@ impl Host {
continue;
};
let snapshot = cursor.snapshot(records).inspect_err(|error| {
failure_stage = "capture";
tracing::warn!(root_thread_id = %root, %error, "Guardian intake rejected stored evidence");
})?;
if !snapshot.source_advanced() {
@@ -347,13 +355,20 @@ impl Host {
let startup = async {
let manager = manager.upgrade().context("Guardian host stopped")?;
let parent = manager.get_thread(root).await?;
Housekeeper::new(
let mut worker = Housekeeper::new(
board.clone(),
Arc::clone(&delivery),
&parent,
&manager,
&settings,
).await
).await?;
if shadow {
let config = parent.config().await;
let limit = config.guardian_v3.as_ref()
.and_then(|v3| v3.shadow_board_limit_mib);
worker.shadow_size = Some(BoardSize::new(limit));
}
anyhow::Ok(worker)
};
let Some(worker) = cancellation.run_until_cancelled(startup).await else {
break;
@@ -362,7 +377,11 @@ impl Host {
}
};
// route_next drains accepted appends before honoring cancellation.
while housekeeper.route_next(&snapshot, &cancellation).await? != 0 {}
while housekeeper.route_next(&snapshot, &cancellation).await? != 0 {
if let (Some(size), Some(metrics)) = (housekeeper.shadow_size, &metrics) {
size.record(metrics);
}
}
finish();
tracing::debug!(
name: "guardian_v3.housekeeping_routed",
@@ -373,7 +392,18 @@ impl Host {
}
anyhow::Ok(())
};
if work.await.is_err() && !cancellation.is_cancelled() {
let result = work.await;
drop(intake_guard);
if let Err(error) = result
&& !cancellation.is_cancelled()
{
if let Some(metrics) = metrics {
metrics.stopped(if error.is::<PayloadLimit>() {
"payload_limit"
} else {
failure_stage
});
}
// Provider error messages can quote the evidence being routed.
tracing::warn!(%root, "Guardian housekeeping stopped");
}
@@ -403,6 +433,9 @@ impl ThreadLifecycleContributor<Config> for Host {
if self.shadow {
// Observe settings changes even before the root is ready.
input.thread_store.insert(shadow::Enrollment::default());
if let Some(metrics) = input.extension_metrics {
input.thread_store.insert(ShadowMetrics(metrics));
}
} else {
// Only authoritative GV3 needs evidence writes to survive interruption.
input.thread_store.insert(PreserveReviewWrites);
+120 -5
View File
@@ -506,8 +506,13 @@ async fn committed_posts_reach_current_subscribers_once_across_channel_retries()
Ok(())
}
#[test_case::test_case(None; "capture_failure_and_reenrollment")]
#[test_case::test_case(Some((20, 1)); "two_copies_exceed_the_limit")]
#[test_case::test_case(Some((40, 0)); "one_copy_exceeds_the_limit_without_sampling")]
#[tokio::test]
async fn shadow_intake_enrolls_only_new_opted_in_roots() -> anyhow::Result<()> {
async fn shadow_intake_enrolls_only_new_opted_in_roots(
overflow: Option<(usize, usize)>,
) -> anyhow::Result<()> {
use codex_core::ConfigRefreshOutcome;
use codex_core::InheritedSessionId;
use codex_core::config::Config;
@@ -554,7 +559,7 @@ async fn shadow_intake_enrolls_only_new_opted_in_roots() -> anyhow::Result<()> {
let mut settings = ExtensionRegistryBuilder::default();
settings.config_contributor(Arc::clone(&unavailable.config_contributors()[0]));
settings.config_contributor(Arc::new(RecordReviewerChange));
let test = test_codex()
let mut builder = test_codex()
.with_extensions(Arc::new(settings.build()))
.with_config(|config| {
config.features.enable(Feature::GuardianV2).unwrap();
@@ -567,9 +572,19 @@ async fn shadow_intake_enrolls_only_new_opted_in_roots() -> anyhow::Result<()> {
.set(AskForApproval::OnRequest)
.unwrap();
})
.with_history_mode(ThreadHistoryMode::Paginated)
.build_with_auto_env(&server)
.await?;
.with_history_mode(ThreadHistoryMode::Paginated);
if overflow.is_some() {
builder = builder
.with_config(|config| {
Arc::make_mut(config.guardian_v3.get_or_insert_with(Arc::default))
.shadow_board_limit_mib = std::num::NonZeroU32::new(1);
})
.with_model_info_override("gpt-5.6-luna", |model| {
model.truncation_policy =
codex_protocol::openai_models::TruncationPolicyConfig::bytes(64 * 1024);
});
}
let test = builder.build_with_auto_env(&server).await?;
let root = test.session_configured.thread_id;
let session = ExtensionData::new(root.to_string());
let thread = test.codex.thread_extension_data();
@@ -676,8 +691,107 @@ async fn shadow_intake_enrolls_only_new_opted_in_roots() -> anyhow::Result<()> {
let child_reviewer = child_store
.get::<ShadowReviewer>()
.context("child reviewer")?;
if let Some((message_kib, expected_calls)) = overflow {
use serde_json::json;
let append = async |order, kib: usize| -> anyhow::Result<()> {
let item = RolloutItem::ResponseItem(ResponseItemEnvelope {
item: user_message_item(&"x".repeat(kib * 1024)),
metadata: Some(CodexHarnessMetadata {
user_input_order: Some(order),
..Default::default()
}),
});
test.thread_store
.append_items(AppendThreadItemsParams {
thread_id: root,
items: vec![item],
})
.await?;
test.thread_store.flush_thread(root).await?;
super::wake_worker(thread);
Ok(())
};
// Sixteen 62 KiB copies leave just under 32 KiB after source metadata.
let channels: Vec<_> = (0..16).map(|i| format!("topic-{i}")).collect();
let descriptions: Vec<_> = channels
.iter()
.map(|name| json!({"channel": name, "description": "Seed"}))
.collect();
let seed = json!({"routes": [channels], "descriptions": descriptions});
let _seed = mount_sse_once(
&server,
sse(vec![
ev_assistant_message("seed", &seed.to_string()),
ev_completed("seed"),
]),
)
.await;
let mut routed = NamedTraceEvents::subscribe("guardian_v3.housekeeping_routed");
append(/*order*/ 1, /*kib*/ 62).await?;
routed.next().await?;
let query = codex_message_board::ChannelQuery {
query: None,
direction: codex_message_board::SortDirection::OldestFirst,
page: Default::default(),
};
let worker = thread.get::<super::RootWorker>().context("shadow board")?;
let board = &worker.reader;
let before = board.list_channels(root, query.clone()).await?;
assert_eq!(before.channels.results.len(), 16);
let route = mount_sse_once(
&server,
sse(vec![
ev_assistant_message(
"overflow",
r#"{"routes":[["topic-0","new"]],"descriptions":[{"channel":"new","description":"New topic"}]}"#,
),
ev_completed("overflow"),
]),
).await;
append(/*order*/ 2, message_kib).await?;
tokio::time::timeout(
Duration::from_secs(10),
old_reviewer.intake_stopped.cancelled(),
)
.await?;
assert!(child_reviewer.intake_stopped.is_cancelled());
assert_eq!(route.requests().len(), expected_calls);
// Channel summaries include post counts and the last message ID.
assert_eq!(board.list_channels(root, query).await?, before);
lifecycle
.on_thread_stop(ThreadStopInput {
thread_store: thread,
session_store: &session,
})
.await;
child.shutdown_and_wait().await?;
test.codex.shutdown_and_wait().await?;
return Ok(());
}
assert!(child_store.get::<super::RootWorker>().is_none());
// A terminal capture error closes admission for the whole board, even without metrics.
test.thread_store
.append_items(AppendThreadItemsParams {
thread_id: root,
items: vec![RolloutItem::ResponseItem(ResponseItemEnvelope::new(
user_message_item("Missing provenance"),
))],
})
.await?;
test.thread_store.flush_thread(root).await?;
super::wake_worker(thread);
tokio::time::timeout(
Duration::from_secs(10),
old_reviewer.intake_stopped.cancelled(),
)
.await?;
assert!(child_reviewer.intake_stopped.is_cancelled());
assert!(!old_reviewer.cancellation.is_cancelled());
assert!(!child_reviewer.cancellation.is_cancelled());
let refresh = async |requirements: &str, expected: ApprovalsReviewer| -> anyhow::Result<()> {
let loader = CloudConfigBundleFixture::loader_with_enterprise_requirement(requirements);
let policy = load_guardian_policy_snapshot(
@@ -746,6 +860,7 @@ async fn shadow_intake_enrolls_only_new_opted_in_roots() -> anyhow::Result<()> {
assert!(!Arc::ptr_eq(&old_worker.reader, &new_worker.reader));
assert!(!Arc::ptr_eq(&old_reviewer.reviewer, &new_reviewer.reviewer));
assert!(!new_reviewer.cancellation.is_cancelled());
assert!(!new_reviewer.intake_stopped.is_cancelled());
lifecycle
.on_thread_stop(ThreadStopInput {
thread_store: thread,
@@ -63,6 +63,7 @@ pub struct Housekeeper {
sampler: HousekeeperSampler,
batch_timeout: Duration,
stopped: bool,
pub(super) shadow_size: Option<crate::shadow_metrics::BoardSize>,
delivery: Arc<LiveDelivery>,
}
@@ -96,6 +97,7 @@ impl Housekeeper {
Duration::from_millis(u64::from(ms.get()))
}),
stopped: false,
shadow_size: None,
delivery,
})
}
@@ -174,6 +176,12 @@ impl Housekeeper {
for source in pending {
// Preserve the existing board's post-size limit, including source metadata.
let text = to_json_string_bounded(source, 64 * 1024)?;
// Every valid batch must route the first original to at least one channel.
if texts.is_empty()
&& let Some(size) = self.shadow_size
{
size.check_capacity(text.len() as u64)?;
}
let added_bytes = text.len() + usize::from(!texts.is_empty());
if added_bytes > input_budget.saturating_sub(input_bytes) {
break;
@@ -221,6 +229,16 @@ impl Housekeeper {
valid,
"housekeeper returned invalid source routes or descriptions"
);
let next_size = self
.shadow_size
.map(|size| {
let added = descriptions
.keys()
.filter(|name| !catalog.contains_key(*name))
.count();
size.with_batch(catalog.len() + added, &output.routes, &texts)
})
.transpose()?;
for (channel_name, description) in descriptions {
if catalog.get(&channel_name).and_then(Option::as_deref)
== Some(description.as_str())
@@ -272,6 +290,7 @@ impl Housekeeper {
}
self.delivery.acknowledge(snapshot, /*count*/ 1)?;
}
self.shadow_size = next_size;
self.sampler.commit(batch);
Ok(sources.len())
};
+1
View File
@@ -11,6 +11,7 @@ use codex_state::SqliteConfig;
mod actor;
mod conversation;
mod shadow_metrics;
pub use actor::ActorReviewer;
pub use actor::PreparedReviewer;
mod delivery;
+5
View File
@@ -122,6 +122,7 @@ impl Host {
thread.insert_arc(Arc::clone(&reviewer));
thread.insert(ShadowReviewer {
reviewer: reviewer.clone(),
intake_stopped: tree.shadow_intake_stopped.clone(),
cancellation,
});
if identity.actor == identity.root {
@@ -159,6 +160,7 @@ impl Host {
};
let tree = self.tree_delivery(root);
*state = State::Running(Arc::clone(&tree));
let metrics = thread.get::<crate::shadow_metrics::ShadowMetrics>();
let host = self.clone();
let current = Arc::clone(&enrollment);
enrollment.tasks.spawn(async move {
@@ -203,6 +205,9 @@ impl Host {
if !tree.stop.is_cancelled() {
*state = State::PendingStart(start);
drop(state);
if let Some(metrics) = metrics {
metrics.stopped("intake");
}
tracing::warn!(%root, "Guardian shadow intake unavailable until the next turn");
}
}
@@ -0,0 +1,111 @@
//! Logical size of a fresh, single-writer shadow board. Count each stored copy of
//! serialized evidence, excluding SQLite metadata, indexes and search text.
use std::collections::BTreeSet;
use std::fmt;
use std::num::NonZeroU32;
use std::sync::Arc;
use codex_extension_api::ExtensionMetrics;
const DEFAULT_BOARD_LIMIT_MIB: u32 = 32;
pub(super) struct ShadowMetrics(pub(super) Arc<dyn ExtensionMetrics>);
impl ShadowMetrics {
pub(super) fn stopped(&self, stage: &'static str) {
self.0.counter(
"codex.guardian_v3.shadow.worker_failure",
/*inc*/ 1,
&[("stage", stage)],
);
}
}
#[derive(Debug)]
pub(super) struct PayloadLimit;
impl fmt::Display for PayloadLimit {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("Guardian shadow board payload limit exceeded")
}
}
impl std::error::Error for PayloadLimit {}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub(super) struct BoardSize {
channels: usize,
posts: usize,
payload_bytes: u64,
limit_bytes: u64,
}
impl BoardSize {
pub(super) fn new(limit_mib: Option<NonZeroU32>) -> Self {
Self {
channels: 0,
posts: 0,
payload_bytes: 0,
limit_bytes: u64::from(limit_mib.map_or(DEFAULT_BOARD_LIMIT_MIB, NonZeroU32::get))
* 1024
* 1024,
}
}
pub(super) fn check_capacity(&self, bytes: u64) -> Result<(), PayloadLimit> {
if bytes > self.limit_bytes - self.payload_bytes {
return Err(PayloadLimit);
}
Ok(())
}
// Preflight the entire validated batch before creating channels or appending posts.
// The sampler can select fewer sources than were serialized.
pub(super) fn with_batch(
mut self,
channels: usize,
routes: &[Vec<String>],
texts: &[String],
) -> Result<Self, PayloadLimit> {
self.channels = channels;
for (destinations, text) in routes.iter().zip(texts) {
let copies = destinations.iter().collect::<BTreeSet<_>>().len();
let bytes = (text.len() as u64).saturating_mul(copies as u64);
self.check_capacity(bytes)?;
self.payload_bytes += bytes;
self.posts += copies;
}
Ok(self)
}
pub(super) fn record(&self, metrics: &ShadowMetrics) {
let counts = &[
1., 2., 5., 10., 20., 50., 100., 200., 500., 1000., 5000., 10000.,
];
metrics.0.histogram_with_boundaries(
"codex.guardian_v3.shadow.board.channels",
self.channels as i64,
counts,
&[],
);
metrics.0.histogram_with_boundaries(
"codex.guardian_v3.shadow.board.posts",
self.posts as i64,
counts,
&[],
);
metrics.0.histogram_with_boundaries(
"codex.guardian_v3.shadow.board.payload_bytes",
self.payload_bytes as i64,
&[
1024., 4096., 16384., 65536., 262144., 1048576., 4194304., 8388608., 16777216.,
33554432.,
],
&[],
);
}
}
#[cfg(test)]
#[path = "shadow_metrics_tests.rs"]
mod tests;
@@ -0,0 +1,29 @@
#![cfg(test)]
use super::BoardSize;
use pretty_assertions::assert_eq;
use std::num::NonZeroU32;
#[test_case::test_case(None, 32 * 1024 * 1024; "default limit")]
#[test_case::test_case(NonZeroU32::new(1), 1024 * 1024; "configured limit")]
fn budget_counts_utf8_copies_for_distinct_destinations_only(limit: Option<NonZeroU32>, bytes: u64) {
let size = BoardSize {
channels: 1,
posts: 1000,
payload_bytes: bytes - 4,
..BoardSize::new(limit)
};
let routes = [vec!["old".into(), "new".into(), "new".into()]];
let texts = ["é".into(), "deferred".into()];
let full = size.with_batch(/*channels*/ 2, &routes, &texts).unwrap();
assert_eq!(
full,
BoardSize {
channels: 2,
posts: 1002,
payload_bytes: bytes,
..size
}
);
assert!(full.with_batch(/*channels*/ 2, &routes, &texts).is_err());
}
+3
View File
@@ -338,6 +338,9 @@ where
#[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, Eq, JsonSchema)]
#[serde(deny_unknown_fields)]
pub struct GuardianV3ConfigToml {
/// Maximum evidence per root shadow board in MiB. Defaults to 32. Ignored in project config.
#[serde(skip_serializing_if = "Option::is_none")]
pub shadow_board_limit_mib: Option<NonZeroU32>,
/// Keep each fresh root's Guardian board in memory until the runtime closes. Defaults to false.
#[serde(skip_serializing_if = "Option::is_none")]
pub message_board_in_memory: Option<bool>,
+4 -1
View File
@@ -257,6 +257,7 @@ fn guardian_v3_prompt_settings_do_not_implicitly_enable_the_feature() {
r#"
[guardianv3]
message_board_in_memory = true
shadow_board_limit_mib = 32
[guardianv3.housekeeper]
routing_instructions = "Group related deployment evidence."
batch_timeout_ms = 15000
@@ -270,6 +271,7 @@ retrieval_instructions = "Search before assessing deployments."
assert_eq!(
features.guardianv3,
Some(FeatureToml::Config(crate::GuardianV3ConfigToml {
shadow_board_limit_mib: std::num::NonZeroU32::new(32),
enabled: None,
message_board_in_memory: Some(true),
housekeeper: Some(crate::GuardianV3HousekeeperConfigToml {
@@ -285,7 +287,8 @@ retrieval_instructions = "Search before assessing deployments."
}
#[test]
fn guardian_v3_rejects_a_zero_batch_timeout() {
fn guardian_v3_rejects_zero_limits() {
assert!(toml::from_str::<FeaturesToml>("[guardianv3]\nshadow_board_limit_mib = 0").is_err());
assert!(
toml::from_str::<FeaturesToml>("[guardianv3.housekeeper]\nbatch_timeout_ms = 0").is_err()
);