From b0a06aac63413d84569e4803452374a0e9976187 Mon Sep 17 00:00:00 2001 From: clawbot <35+clawbot@noreply.example.org> Date: Tue, 17 Nov 2026 04:47:47 +0000 Subject: [PATCH] waf: rename the heuristic list last, a name that said nothing The list that runs tag_deny the second time was named last(). The bare word does not say what it holds or when it runs, a local variable in rulefiles.go shadows it, and its doc read "the heuristics of last run". It is now afterBesideLookup, beside the other lists named for when they run. Model: opus-5-5 --- internal/waf/besidelookup.go | 4 ++-- internal/waf/heuristics.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/waf/besidelookup.go b/internal/waf/besidelookup.go index 23ab30a..d1edf44 100644 --- a/internal/waf/besidelookup.go +++ b/internal/waf/besidelookup.go @@ -48,7 +48,7 @@ type besideLookupFindings struct { // once, and what the other found is dropped. besideLookup has // besideLookupTimeLimit; past it, the request is refused as // ActionChecksTimedOut. Once both have let the request through, the heuristics -// of last run. ctx is the request's own context. +// of afterBesideLookup run. ctx is the request's own context. func (rq *request) runBesideLookup( ctx context.Context, lookedUp <-chan lookupResult, ) *verdict { @@ -92,7 +92,7 @@ func (rq *request) runBesideLookup( return v } - return rq.runHeuristics(ctx, last(), rq.h.now()) + return rq.runHeuristics(ctx, afterBesideLookup(), rq.h.now()) } // findBesideLookup does the work of the heuristics of besideLookup on the diff --git a/internal/waf/heuristics.go b/internal/waf/heuristics.go index a246103..9fb7e59 100644 --- a/internal/waf/heuristics.go +++ b/internal/waf/heuristics.go @@ -77,10 +77,10 @@ func besideLookup() []heuristic { } } -// last are the heuristics that run once both lists above have let the request -// through. tag_deny runs a second time, on the tag rule_files and -// core_rule_set can add. -func last() []heuristic { +// afterBesideLookup are the heuristics that run once afterLookup and +// besideLookup have both let the request through. tag_deny runs a second time, +// on the tag rule_files and core_rule_set can add. +func afterBesideLookup() []heuristic { return []heuristic{ tagDeny{}, }