Skip to content

refactor(agents): drop dead API and enforce the lineage invariant - #538

Merged
Destynova2 merged 1 commit into
mainfrom
refactor/agents-prune
Aug 5, 2026
Merged

refactor(agents): drop dead API and enforce the lineage invariant#538
Destynova2 merged 1 commit into
mainfrom
refactor/agents-prune

Conversation

@Destynova2

Copy link
Copy Markdown
Contributor

Mutation testing on the newly wired slice left two survivors. Both pointed at a defect rather than 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 here: wire it or delete it.

The one worth keeping

is_self_parented detected a cyclic lineage and then stored it anyway, leaving every consumer to re-check. 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; 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.

@Destynova2
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
Destynova2 force-pushed the refactor/agents-prune branch from 8a1c7a5 to 7287b74 Compare August 5, 2026 10:48
@Destynova2
Destynova2 merged commit 0c3b181 into main Aug 5, 2026
39 checks passed
@Destynova2
Destynova2 deleted the refactor/agents-prune branch August 5, 2026 10:56
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/).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant