refactor(gate): decide the tripwire-accessor collision, and retire two convenience methods (#1271) - #1280
Merged
Merged
Conversation
…o convenience methods (#1271) CLAUDE.md's cross-cutting checklist REQUIRES a runtime tripwire asserted from the production path; the standing rule forbids exporting API for an instrument. Seven ModemEngine accessors sat in the reachability baseline because of that collision — four with no rationale at all until #1272 — so the contradiction had never been decided, only gone quiet. Reviewed before implementing, and the review overturned the proposal. I had proposed wiring the notch/AGC state into the control plane via GetConfig so the accessors became production-reachable. It would not have: GetConfig is handled on the client task, whose ClientCtx holds Arc<Mutex> mirrors and no engine, so it would have added a daemon-side shadow and paid none of the debt. Only the main loop's MetricsSnapshot seam reads the engine. That is now #1276. Three claims in the issue were wrong: the "other crate" forcing `pub` is Cargo's integration-test model, not the daemon, so the collision is a placement fact; no test asserts any tripwire through `server::run`, so the daemon assertion it was justified by does not exist; and `agc_gain_db` is a readout, not a tripwire, by its own docstring and by what the tests calling it assert. Changes: - delete the redundant `notch_blocks_processed() > 0` daemon assertion. Verified redundant by reading both sites: the counter increments on the line immediately before `apply_rx_notch` is called, and `notch_in_band_interferers` is populated only inside it, so a non-empty list strictly implies the counter moved. - separate four TRIPWIRE counters from three READOUT items in the baseline, the latter bound to #1276 rather than labelled as instruments they are not. - retire `add_trusted`/`add_revoked` rather than baseline them: `add_entry(.., Full)` and `(.., Revoked)` verbatim, 17 call sites. A baseline label for a ten-minute change contradicts that file's own "shrink this list" header. One correction from doing it: `PublicKeyTrustLevel` lives in `openpulse_core::trust`, not `::handshake`, which the convenience methods had hidden from every call site. The resulting build error read "enum PublicKeyTrustLevel is private" and nearly convinced me the two methods were a deliberate facade over a private type and the deletion should be reverted. It was my import path. Results: core 355+9+5+6+20+7+2+6 pass, daemon lib 134 pass, workspace clippy clean, REACH: PASS (2301 items, 507 unreferenced, 0 new). The baseline lost four entries: the two retired, plus decode_signed/encode_signed, which left by the better route — #1252 gave them a production caller. Refactors: CAP-77 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0188ATCj6DZ9aRVQ2vSirua6
…oposal Refactors: CAP-77 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0188ATCj6DZ9aRVQ2vSirua6
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 #1271.
The collision, and why it had never been decided
CLAUDE.md's cross-cutting checklist requires a runtime tripwire asserted from the productionpath. The standing rule forbids exporting API for an instrument. Seven
ModemEngineaccessorssat in the reachability baseline because of that — four of them with no rationale at all until
#1272 — so the contradiction had gone quiet rather than been decided.
The proposal was reviewed before implementing, and rejected
I proposed wiring the notch/AGC state into the control plane via
GetConfig, on the reasoning thatit would make the accessors production-reachable and retire the baseline entries.
It would not have.
GetConfigis handled on the client task, whoseClientCtxholdsArc<Mutex>mirrors and no engine. That change would have added a daemon-side shadow of enginestate — correct for the panel, but
is_notch_enabled()would still have zero production callers andstay in the baseline. It would have paid none of the debt it claimed to. The only seam that reads the
engine for clients is the main loop's
MetricsSnapshot. Correctly scoped as #1276.Three claims in my own issue text were wrong
pub." The other crate is Cargo'sintegration-test model, not the daemon. The collision is a placement fact, not a principle.
tree asserts a tripwire through
server::run.agc_gain_dbis not a tripwire. Its own docstring calls it "a readout of the active-span loopstate" where the counters' say "tripwire", and the tests calling it assert behaviour (gain > 6 dB
on a quiet input) while using
agc_blocks_processedas the tripwire in the same test.What this PR does
notch_blocks_processed() > 0in the daemon cannot fail whenthe
in_band_interferers()assertion two lines above passes: the counter increments on the lineimmediately before
apply_rx_notchis called, andnotch_in_band_interferersis populated onlyinside that function. Verified by reading both sites; the surviving assertion's message now says
what it subsumes.
Five front-end toggles are write-only, and two of them make a default install display the opposite of the truth #1276 rather than mislabelled as instruments they are not.
add_trusted/add_revokedrather than baselining them —add_entry(.., Full)and(.., Revoked)verbatim, 17 call sites. A permanent baseline label for a ten-minute changecontradicts that file's own "shrink this list" header.
pubunder the TRIPWIRE label. That is a legitimate end state: thechecklist requires the export, and the ratchet exists to catch new gold-plating, not a labelled
category.
One correction that came from doing it, not from review
Deleting the two methods produced
error: enum PublicKeyTrustLevel is private, and I brieflyconcluded the enum really was private, that the two methods were a deliberate façade over it, and
that the deletion should be reverted. It was my import path — the type lives in
openpulse_core::trust, not::handshake, which the convenience methods had hidden from every callsite. A misleading compiler message nearly reversed a correct decision; what settled it was checking
how other crates name the type, not re-reading the declaration.
Results
The baseline lost four entries: the two retired, plus
decode_signed/encode_signed, which leftby the better route — #1252 gave them a real production caller.
Split out
opposite of the truth at cold start:
notch_enabled/cessb_enableddefault true, the panel'sshadow bools default false and are never seeded.
engine.rsexports: a Cargoinstrumentsfeature the compiler enforces, with classifying the 65 as the first deliverable.
#[doc(hidden)] pubplus a ratchet exemption was considered and rejected: it converts a gate into a conventionand removes the friction that caught test(probe): measure idle ρ from a rig capture through the shipped veto (#1060) #1121.
Review: docs/dev/reviews/2026-09-05-1271-tripwire-accessors.md
🤖 Generated with Claude Code
https://claude.ai/code/session_0188ATCj6DZ9aRVQ2vSirua6