refusedWhateverTheAnswer names no heuristic now. It asks each heuristic of afterLookup that implements a new interface whether it will refuse the request whatever the lookup answers. blocklists and rateLimits implement it. The comment in heuristics.go on adding a heuristic names the interface. It also names the three places outside a heuristic's file that may change with it: waitForGeoJS, requestCanGetTag and findBesideLookup.
New names:
interface refusesWithoutLookup: a heuristic of afterLookup that can tell, before the lookup answers, that it will refuse a request whatever the answer;
method refusesWhateverTheLookupAnswers(rq, now) bool: whether the heuristic will refuse rq at now, whatever the lookup answers about its client. It changes nothing.
What the diff does not make obvious:
handler loses its blocklists and rateLimits fields. Only refusedWhateverTheAnswer read them, so both heuristics are now built inside the afterLookup list, like the others.
Behaviour is unchanged. blocklists comes before rate_limits in afterLookup, so they are asked in the same order as before. Observe mode still skips the wait for no request.
Judgement call: rateLimits.overAWholeRateLimit is renamed to the interface method, and its doc keeps the "whole rate limit" condition. blocklists keeps refusedByBlocklists, which check also uses, and adds the interface method as a one-line call to it.
Model: opus-5-5
closes https://git.eeqj.de/sneak/smallwebwaf/issues/446
`refusedWhateverTheAnswer` names no heuristic now. It asks each heuristic of `afterLookup` that implements a new interface whether it will refuse the request whatever the lookup answers. `blocklists` and `rateLimits` implement it. The comment in `heuristics.go` on adding a heuristic names the interface. It also names the three places outside a heuristic's file that may change with it: `waitForGeoJS`, `requestCanGetTag` and `findBesideLookup`.
New names:
- interface `refusesWithoutLookup`: a heuristic of `afterLookup` that can tell, before the lookup answers, that it will refuse a request whatever the answer;
- method `refusesWhateverTheLookupAnswers(rq, now) bool`: whether the heuristic will refuse `rq` at `now`, whatever the lookup answers about its client. It changes nothing.
What the diff does not make obvious:
- `handler` loses its `blocklists` and `rateLimits` fields. Only `refusedWhateverTheAnswer` read them, so both heuristics are now built inside the `afterLookup` list, like the others.
- Behaviour is unchanged. `blocklists` comes before `rate_limits` in `afterLookup`, so they are asked in the same order as before. Observe mode still skips the wait for no request.
Judgement call: `rateLimits.overAWholeRateLimit` is renamed to the interface method, and its doc keeps the "whole rate limit" condition. `blocklists` keeps `refusedByBlocklists`, which `check` also uses, and adds the interface method as a one-line call to it.
Model: opus-5-5
clawbot
self-assigned this 2026-11-19 22:59:21 +01:00
refusedWhateverTheAnswer asks each heuristic of afterLookup that
implements the new refusesWithoutLookup interface, instead of naming
blocklists and rate_limits. The comment on adding a heuristic names the
places outside its file that may change with it.
Model: opus-5-5
refusedWhateverTheAnswer now asks the heuristics of afterLookup through refusesWithoutLookup, with the same behaviour and order as before, and the comment on adding a heuristic names the remaining places outside its file, as the definition of done in #446 asks.
Model: opus-5-5
Verdict: PASS
Head: 9d3f212b0d63884d3a2c4458eaa9e2341d936a45
`refusedWhateverTheAnswer` now asks the heuristics of `afterLookup` through `refusesWithoutLookup`, with the same behaviour and order as before, and the comment on adding a heuristic names the remaining places outside its file, as the definition of done in https://git.eeqj.de/sneak/smallwebwaf/issues/446 asks.
Model: opus-5-5
clawbot
merged commit 9d008ed31a into next2026-11-19 23:28:53 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
closes #446
refusedWhateverTheAnswernames no heuristic now. It asks each heuristic ofafterLookupthat implements a new interface whether it will refuse the request whatever the lookup answers.blocklistsandrateLimitsimplement it. The comment inheuristics.goon adding a heuristic names the interface. It also names the three places outside a heuristic's file that may change with it:waitForGeoJS,requestCanGetTagandfindBesideLookup.New names:
refusesWithoutLookup: a heuristic ofafterLookupthat can tell, before the lookup answers, that it will refuse a request whatever the answer;refusesWhateverTheLookupAnswers(rq, now) bool: whether the heuristic will refuserqatnow, whatever the lookup answers about its client. It changes nothing.What the diff does not make obvious:
handlerloses itsblocklistsandrateLimitsfields. OnlyrefusedWhateverTheAnswerread them, so both heuristics are now built inside theafterLookuplist, like the others.blocklistscomes beforerate_limitsinafterLookup, so they are asked in the same order as before. Observe mode still skips the wait for no request.Judgement call:
rateLimits.overAWholeRateLimitis renamed to the interface method, and its doc keeps the "whole rate limit" condition.blocklistskeepsrefusedByBlocklists, whichcheckalso uses, and adds the interface method as a one-line call to it.Model: opus-5-5
Verdict: PASS
Head:
9d3f212b0drefusedWhateverTheAnswernow asks the heuristics ofafterLookupthroughrefusesWithoutLookup, with the same behaviour and order as before, and the comment on adding a heuristic names the remaining places outside its file, as the definition of done in #446 asks.Model: opus-5-5