refactor: delete the dead trait mocks and four redundant docs - #543
Merged
Conversation
Destynova2
enabled auto-merge (squash)
August 6, 2026 07:13
Two audits, one on src/ and one on docs/, both read-only. Code: `traits::mocks` (151 LOC, 7 mock impls) has zero call sites outside its own file. agentgrep for all seven names returns 14 matches, every one of them inside traits.rs. Modules that need a mock define their own locally (registry.rs:668, retry.rs:955, dispatch/mod.rs:1065). The `test-util` feature stays because `providers::mocks` is genuinely used. Docs: `openai-compatibility.md` and `responses-api-compatibility.md` are 60-73% duplicated into `api-compatibility.md`, which already documents all three endpoints section by section. The two DCI reports were point-in-time audit notes describing the creation of files this commit deletes. Stale claims fixed: quickstart listed four presets that do not exist (`medium`, `cheap`, `fast`, `local`); AGENTS.md told you to apply `medium`. The README called grob a '6 MB single binary' -- 6 MB is the musl container image, the binary is 17 MB. Verified: 1727 tests pass, clippy clean, doctests pass, fmt clean.
Destynova2
force-pushed
the
refactor/drop-dead-trait-mocks
branch
from
August 6, 2026 07:14
59c7739 to
84ffbc4
Compare
Merged
Destynova2
added a commit
that referenced
this pull request
Aug 6, 2026
## 🤖 New release * `grob`: 0.36.95 -> 0.36.96 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.36.96](v0.36.95...v0.36.96) - 2026-08-06 ### Other - delete the dead trait mocks and four redundant docs ([#543](#543)) - *(compliance)* correct AI Act article numbers and scope NIS2 honestly ([#542](#542)) - *(agents)* guard the streaming attribution path ([#541](#541)) - *(agents)* record the request path and the mutation findings ([#540](#540)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/).
Destynova2
added a commit
that referenced
this pull request
Aug 6, 2026
…pe docs (#544) Second pass of the audit. #543 removed the dead mocks; this removes the abstraction they existed to serve, fixes every broken doc link, and collapses the duplicated docs. ## Code: the five single-impl traits `DlpPipeline`, `RequestRouter`, `AuditWriter`, `EventTap`, `SpendTracking` each had **exactly one implementation**, and every method in it delegated straight to the concrete type. Four of the five were never used as `dyn` or as a generic bound anywhere. The concrete type was already the field type in `AppState`: | Trait | `AppState` field | Actual type | |---|---|---| | `RequestRouter` | `router` | `Router` | | `AuditWriter` | `audit_log` | `Option<Arc<AuditLog>>` | | `EventTap` | `tap_sender` | `Option<Arc<TapSender>>` | | `DlpPipeline` | (n/a) | `DlpEngine` | `SpendTracking` was the one real `Box<dyn>`, at `server/mod.rs:152`, but also had a single implementor. It becomes `Mutex<SpendTracker>`. Its default method bodies existed only so test mocks could no-op, and those mocks went in #543. **`Tracer` and `ProviderAvailability` stay.** Each has two real implementations and is genuinely polymorphic at `server/mod.rs:406-411`. `traits.rs`: 458 to 120 lines. ## Docs: 49 broken intra-doc links to zero Every one was a dead reference in published API documentation. Failure modes: links from a module-level `//!` block to an item in that same module (rustdoc needs an absolute path there), enum variants written as bare names, links to private items from public docs, and two bare URLs in clap help text. Two were simply wrong, pointing at functions on types that do not exist. Adds `deny(broken_intra_doc_links)` and `deny(private_intra_doc_links)`. A warning nobody reads is not a signal; a dead link now fails the build the way `missing_docs` already does. ## Docs: two entry points became one - `docs/README.md` and `docs/index.md` were both indexes of the same directory. Nothing linked to README, and the two had drifted. Merged the eight links only README carried, then deleted it. - `tutorials/quickstart.md` was a strict subset of `getting-started.md` and had gone stale, claiming the `perf` preset configures "Anthropic + OpenAI + Gemini" when it is Anthropic OAuth with no fallback. The three-command path is now an "In a hurry" section of the one remaining tutorial. - The ADR table in `index.md` was hand-maintained and wrong in five places (0018 and 0019 marked proposed though accepted, 0004 and 0028 not shown as superseded, 0027/0028/0029 missing). Regenerated from each ADR's `status` field. - Linked four docs no index reached: protocol fidelity matrix, OTLP exemplars, `design/`, and the hedge-billing protocol ADR-0020 depends on. ## ADR-0018 Carried 378 lines of sprint material after the decision: target schemas for a schema that does not exist, an RE-0..RE-8 flowchart, effort estimates in LoC, pseudocode, migration examples. Nothing references any of it. Kept context, drivers, options, decision, consequences, references, glossary, open questions. 805 to 427 lines. ## Usage: one command instead of two `grob completions <shell>` printed to stdout; `grob setup-completions` detected the shell and installed. A new user had to read both help texts to find out which they wanted. The shell argument is now optional. `setup-completions` stays as a hidden alias, so nothing breaks. 25 visible root commands become 24. ## Deliberately not done - **Unifying the two circuit breakers.** Not duplicates: `security::CircuitBreakerRegistry` is per provider and backs `ProviderAvailability`; `routing::circuit_breaker` is per endpoint with lock-free atomics on the hot path. Different granularities, both live. - **Embedding `ProviderBase` in `GeminiProvider`.** Worth ~40 LOC, but Gemini's `api_key` is `Option<SecretString>` where `ProviderBase`'s is `SecretString`. Making a shared field optional to suit one provider costs more than the duplication. ## Verification 1727 tests pass; clippy clean with `--all-features --all-targets` and `--no-default-features`; doctests pass; **`cargo doc` emits zero warnings** (was 49); fmt and markdownlint clean; both completion paths exercised by hand.
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.
Why
Two read-only audits, one on
src/, one ondocs/. This PR applies only the zero-risk findings; the rest are listed below for later.Code
traits::mocks(151 LOC, 7 mock impls) has zero call sites outside its own file. Searching all seven names returns 14 matches, every one insidetraits.rs. Modules that need a mock define their own locally (registry.rs:668,retry.rs:955,dispatch/mod.rs:1065).The
test-utilfeature stays:providers::mocksbehind the same gate is used (registry.rs:657,dispatch/mod.rs:1216).Docs
reference/openai-compatibility.mdandreference/responses-api-compatibility.mdare 60-73% duplicated intoreference/api-compatibility.md, which already documents all three endpoints section by section, in the same order. Deleted, links redirected.dci-report-*.mdfiles were point-in-time audit notes whose content describes the creation of the files this PR deletes. Deleted.Stale claims fixed
quickstart.mdadvertised four presets that do not exist:medium,cheap,fast,local. Real list isperf,ultra-cheap,eu-eco,eu-pro,eu-max,gdpr,eu-ai-act.AGENTS.mdtold you to runpreset apply medium, which fails.Not done here, worth a look
security/circuit_breaker.rs387 LOC +routing/circuit_breaker.rs421 LOC), both live, overlapping concepts. Unifying is a behavioral change with two config surfaces to migrate. Needs its own PR.AppState(DlpPipeline,RequestRouter,AuditWriter,EventTap,SpendTracking). About 290 LOC.TracerandProviderAvailabilityare genuinely polymorphic and must stay.GeminiProviderre-implementsProviderBase(is_oauth,supports_model, header loops), about 40 LOC.Verification
1727 tests pass, clippy clean with all features, doctests pass, fmt clean, lychee link check passes.