Census: the bridge's inert test grant takes the file's one capability pair (#228 follow-up) - #259
Merged
Merged
Conversation
#228 (QA-E F4) added `inert_grant_for_test()` to bridge.rs with an inline `CallCapability::public_enforced()`. `tests/privacy_capability.rs` counts that constructor line by line, `#[cfg(test)]` code included, and this file's row allows exactly one — the `test_capability()` helper every grant the file's own tests build takes its pair from. The second spelling turned `the_sites_that_decide_how_far_a_caller_reaches_are_exactly_these` red on main, which is the drift that row's own documentation warns about. The helper decides nothing a caller reaches: it builds a grant whose dispatcher returns an error, for tests that need a `BridgeGrant` to hold a recorded result and need no Tokio runtime. So it earns no census row of its own — it now takes its pair from `tests::test_capability()`, made `pub(super)` because the helper sits outside `mod tests` (the claude_code and codex mirror tests reach it through `lease_holding_for_test`). The row, its count and its description are unchanged and true again. ⚠ A plain `grep -c` finds three hits in this file; the census sees two. `bridge.rs:2485` is the doc comment on `test_capability()`, and the census skips `//` lines — it is not a site, and it predates #228 (638e4c7, already in this branch's base 7c96d79). A row written from the grep count would have left the census red. No census file is touched: the remaining difference on main is `workspace_inspector.rs`'s second `CallCapability::sample(` from #244, which is getting its row separately.
Collaborator
Author
|
Measured: #258 + #259 together make the census green. Neither is green alone, so this is the only state that can be verified before merging. Scratch branch = Row state in the combined tree — one row per file, which the census requires since
⚠ Expect each PR's own |
This was referenced Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the half of the privacy-capability census that PR #228 (QA-E F4) broke. It touches only
bridge.rs—crates/biorouter/tests/privacy_capability.rsis deliberately not edited, so it cannot conflict with the PR adding theworkspace_inspector.rsrow (#244's site, being handled separately).The one-sentence answer
public_enforcedwas not needed at the site F4 added, so the site is gone rather than given a row.What was wrong
inert_grant_for_test()(bridge.rs:1086, added by #228) inlinedCallCapability::public_enforced(). The census counts that constructor line by line,#[cfg(test)]code included, and this file's row allows exactly one — thetest_capability()helper every grant the file's own tests build takes its pair from. That row's own documentation names this exact drift:So the fix is the one the census asks for: the helper takes its pair from
tests::test_capability(), nowpub(super)because the helper sits outsidemod tests(theclaude_codeandcodexmirror tests reach it vialease_holding_for_test). The row, its count and its description are unchanged and true again.It earns no row of its own because it decides nothing a caller reaches: it builds a
BridgeGrantwhose dispatcher returns an error, for tests that need a grant to hold a recorded result and need no Tokio runtime.⚠ A plain grep overcounts this file: three hits, two sites
The report that flagged this listed three lines. The census sees two:
inert_grant_for_test()— added by #228test_capability()//lines (privacy_capability.rs:487-488), and it predates #228 (638e4c7c, already in this PR's base7c96d796)test_capability()itselfA row written from
grep -c(3) would have left the census red.Verification
cargo test -p biorouter --test privacy_capabilityon this branch.bridge.rsnow matches its row exactly, and the only remaining difference is the other PR's:cargo test -p biorouter --lib -- providers::coding_agent providers::claude_code providers::codexpasses (the helper's callers), andcargo fmtis clean. This binary is one CI does run since #239, so the census will start blocking as soon as the load-flaky esbuild test above it settles.🤖 Generated with Claude Code