The shop rule calls the door the way the door is written - #806
Closed
sridharkalaibala wants to merge 1 commit into
Closed
sridharkalaibala wants to merge 1 commit into
sridharkalaibala wants to merge 1 commit into
Conversation
The auto accept / auto cancel rule has never decided anything.
decideOnOrder takes { saleId, decision, reason }. The sweep called it as
decideOnOrder(saleId, decision, reason), so saleId was undefined, the
guard answered "Enter must correct order id", and every decision was
refused before it began.
Nothing looked wrong from any angle. The read-back added for an unrelated
reason saw the order had not moved and quietly moved on, so no alarm was
falsely silenced and no order was wrongly cancelled - the rule simply did
nothing at all, which is indistinguishable from a shop that never
configured one.
The tests passed throughout because the fake repository took three
positional arguments too. A fake that speaks a language the real thing
does not is a test proving the caller agrees with itself.
So the contract is pinned against the real module: one test spies on the
actual decideOnOrder and asserts it is handed ONE object carrying saleId,
and another calls the real function the old way and asserts it refuses -
which is exactly what it did, in silence, on every order, for as long as
the feature existed. Both fail if the old call comes back; verified by
putting it back and watching six tests go red.
Same family as the AI availability typo: pin call sites against real
exports, because a feature test proves the code works and can never prove
anybody calls it correctly.
Contributor
Author
|
Closing as redundant, not as wrong. #807 landed the same fix from another session while this was open, and covers it slightly better: it also carries Verified on
So the rule now actually decides orders, which it never did. Nothing from this branch is needed; rebasing it would only replay a duplicate through a conflict. |
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.
The auto accept / auto cancel rule from #795 has never decided anything. Found while
checking the code-scanning alert on #805.
decideOnOrdertakes{ saleId, decision, reason }. The sweep called it asdecideOnOrder(saleId, decision, reason), sosaleIdwasundefined, the guardanswered "Enter must correct order id", and every decision was refused before it began.
Why nothing looked wrong
The read-back I added for an unrelated reason saw the order had not moved and quietly
moved on. So no alarm was falsely silenced and no order was wrongly cancelled - the
rule simply did nothing at all, which is indistinguishable from a shop that never
configured one. That is the only good news here.
The tests passed throughout because the fake repository took three positional arguments
too. A fake that speaks a language the real thing does not is a test proving the caller
agrees with itself.
How it is pinned now
Two tests, both against the real module rather than a fake:
decideOnOrderand asserts it is handed one object carryingsaleId;what it did, in silence, on every order, for as long as the feature existed.
Verified by putting the old call back and watching six tests go red.
Same family as the
ai.availability/ai.availabletypo: pin call sites against realexports. A feature test proves the code works and can never prove anybody calls it
correctly.
Checks
api: 379 suites, 10,892 testsnpm run check: 7/7