Skip to content

refactor: the inventory gate was right about both of them - #55

Merged
rodrigoteamx merged 1 commit into
mainfrom
fix/the-inventory-gate-is-right
Sep 7, 2026
Merged

refactor: the inventory gate was right about both of them#55
rodrigoteamx merged 1 commit into
mainfrom
fix/the-inventory-gate-is-right

Conversation

@rodrigoteamx

Copy link
Copy Markdown
Contributor

Greenhouse decisions/0213's gate flagged two new public members with no consumer but their own tests, and neither was a false positive.

RollbackContracts::unresolved() was public and nothing outside its own tests called it. A caller wants the FINDINGS — what a report prints and what an agent can act on — and a second public shape for the same answer is a second thing to keep true. Private now; the tests assert through findings().

EffectProfile::rollbackOperation() looked unwired for a subtler reason: the gate counts a use only when the touching file also names the member's owner, and this class reached the profile through $operation->effects?-> without ever naming EffectProfile. That rule is a good one — a bare method name proves nothing — so the fix is to say what is being read: the profile is resolved to a typed local, checked with instanceof, and the class is imported. It reads better too; the double null-safe chain was asking the same question twice.

207 tests green, phpstan clean, cs-fixer clean, docblock gate clean. The greenhouse inventory gate is back to «no creció» without re-recording anything.

Greenhouse `decisions/0213`'s gate flagged two new public members with no consumer
but their own tests, and neither was a false positive.

`RollbackContracts::unresolved()` was public and nothing outside its own tests
called it: a caller wants the FINDINGS — what a report prints and what an agent can
act on — and a second public shape for the same answer is a second thing to keep
true. It is private now, and the tests assert through `findings()`.

`EffectProfile::rollbackOperation()` looked unwired for a subtler reason: the gate
counts a use only when the touching file also NAMES the member's owner, and this
class reached the profile through `$operation->effects?->` without ever naming
`EffectProfile`. The rule is a good one — a bare method name proves nothing — so
the fix is to say what is being read: the profile is resolved to a typed local,
checked with `instanceof`, and the class is imported. It reads better too; the
double null-safe chain was asking the same question twice.
@rodrigoteamx
rodrigoteamx merged commit b4462ca into main Sep 7, 2026
2 checks passed
@rodrigoteamx
rodrigoteamx deleted the fix/the-inventory-gate-is-right branch September 7, 2026 09:49
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