refactor(agents): drop dead API and enforce the lineage invariant - #538
Merged
Conversation
Destynova2
enabled auto-merge (squash)
August 5, 2026 10:31
Mutation testing on the wired slice left two survivors. Both pointed at the same defect rather than at a missing test: `Display for AgentId` and `is_identified` had no caller outside the tests that asserted on them. Tests written against otherwise-unused API only prove the API exists. Deleting it is the honest fix, and it is the rule the wiring guard already applies to everything else in this slice: wire it or delete it. `is_self_parented` was the interesting one. It detected a cyclic lineage and then stored it anyway, leaving every consumer to re-check. That is a validation that does not validate. `from_headers` now drops the impossible parent at the boundary, where the rest of this slice already validates: the identity survives, so spend stays attributable, and only the lineage that would make a hierarchy non-terminating is discarded. 16 mutants, 16 caught, 0 missed. 1916 tests with --all-features, clippy clean. Running cargo-mutants locally left its artifacts untracked and they nearly got committed; .gitignore now covers them.
Destynova2
force-pushed
the
refactor/agents-prune
branch
from
August 5, 2026 10:48
8a1c7a5 to
7287b74
Compare
Merged
Destynova2
added a commit
that referenced
this pull request
Aug 5, 2026
## 🤖 New release * `grob`: 0.36.94 -> 0.36.95 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.36.95](v0.36.94...v0.36.95) - 2026-08-05 ### Other - *(agents)* drop dead API and enforce the lineage invariant ([#538](#538)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/).
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.
Mutation testing on the newly wired slice left two survivors. Both pointed at a defect rather than a missing test:
Display for AgentIdandis_identifiedhad no caller outside the tests that asserted on them.Tests written against otherwise-unused API only prove the API exists. Deleting it is the honest fix, and it is the rule the wiring guard already applies to everything else here: wire it or delete it.
The one worth keeping
is_self_parenteddetected a cyclic lineage and then stored it anyway, leaving every consumer to re-check. A validation that does not validate.from_headersnow drops the impossible parent at the boundary, where the rest of this slice already validates. The identity survives, so spend stays attributable; only the lineage that would make a hierarchy non-terminating is discarded.Evidence
16 mutants, 16 caught, 0 missed. 1916 tests with
--all-features, clippy clean.