Files
codex/codex-rs/ext/guardian-v3/BUILD.bazel
T
felixxia-oai d0b140efb5 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
2026-11-26 15:22:56 +00:00

17 lines
544 B
Python

load("//:defs.bzl", "codex_rust_crate")
codex_rust_crate(
name = "guardian-v3",
crate_name = "codex_guardian_v3",
extra_binaries = ["//codex-rs/linux-sandbox:codex-linux-sandbox"],
integration_compile_data_extra = ["//codex-rs/message-board:tests/common/mod.rs"],
run_tests_with_wine_exec = True,
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",
],
)