waf: the server's types and constructor in waf.go, active_ban in its own file (closes #435) #480

Merged
clawbot merged 1 commits from issue-435-waf-file-layout into next 2026-11-20 03:26:58 +01:00
Collaborator

Closes #435.

Moves only, in internal/waf. No identifier is renamed and no code line changes.

  • waf.go now holds what was in proxy.go (package comment, endpoint paths, Params, CoreRuleSetInspector, Server, newHandler, handler), plus New, ServeHTTP and the constants they use.
  • proxy.go is gone.

New files:

  • questionsandreports.go: how waf answers rproxy's questions and takes its reports (answerQuestion, readQuestion, allow, deny, handleReport, finishWith and their helpers).
  • activeban.go: the heuristic active_ban.

Lines that changed and are not moves:

  • Imports.
  • The file comment of bans.go. It named both active_ban and banMaker, so it is split between bans.go and activeban.go.

Disclosures:

  • ServeHTTP stays in waf.go with handler, its type. It is not in questionsandreports.go.
  • The endpoint paths and CoreRuleSetInspector stay in waf.go, where proxy.go's content went.
  • proxy_test.go, the tests' shared helpers, keeps its name. The issue moves no test file.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/smallwebwaf/issues/435. Moves only, in `internal/waf`. No identifier is renamed and no code line changes. - `waf.go` now holds what was in `proxy.go` (package comment, endpoint paths, `Params`, `CoreRuleSetInspector`, `Server`, `newHandler`, `handler`), plus `New`, `ServeHTTP` and the constants they use. - `proxy.go` is gone. New files: - `questionsandreports.go`: how waf answers rproxy's questions and takes its reports (`answerQuestion`, `readQuestion`, `allow`, `deny`, `handleReport`, `finishWith` and their helpers). - `activeban.go`: the heuristic `active_ban`. Lines that changed and are not moves: - Imports. - The file comment of `bans.go`. It named both `active_ban` and `banMaker`, so it is split between `bans.go` and `activeban.go`. Disclosures: - `ServeHTTP` stays in `waf.go` with `handler`, its type. It is not in `questionsandreports.go`. - The endpoint paths and `CoreRuleSetInspector` stay in `waf.go`, where `proxy.go`'s content went. - `proxy_test.go`, the tests' shared helpers, keeps its name. The issue moves no test file. Model: opus-5-5
clawbot added the needs-review label 2026-11-20 01:29:29 +01:00
clawbot self-assigned this 2026-11-20 01:29:29 +01:00
Author
Collaborator

Verdict: FAIL
Head: f9cb1f9c6b

  1. internal/waf/questionsandreports.go, refusedWhateverTheAnswer: it decides whether a request skips the wait for GeoJS, and its only caller is startLookUp in lookup.go. It is not question or report code, so the new file's name does not say all the file holds, which is what #435 sets out to fix, and the PR body's description of the file does not cover it. Acceptable: refusedWhateverTheAnswer moved unchanged to lookup.go, beside startLookUp.
  • Deviation: finding 1 is fixed on the branch in 02f9134a05bb108ffba68fac5a1d5ee3b93b3029. The verdict is posted because my brief requires one.
  • Judgement call: the architecture review leaves new file names to sneak; I took the issue's requirement, that the PR body lists them, as the bar for questionsandreports.go and activeban.go.

Model: opus-5-5

Verdict: FAIL Head: f9cb1f9c6b3cdba8ba56878b86e1e4632a709de4 1. `internal/waf/questionsandreports.go`, `refusedWhateverTheAnswer`: it decides whether a request skips the wait for GeoJS, and its only caller is `startLookUp` in `lookup.go`. It is not question or report code, so the new file's name does not say all the file holds, which is what https://git.eeqj.de/sneak/smallwebwaf/issues/435 sets out to fix, and the PR body's description of the file does not cover it. Acceptable: `refusedWhateverTheAnswer` moved unchanged to `lookup.go`, beside `startLookUp`. - Deviation: finding 1 is fixed on the branch in `02f9134a05bb108ffba68fac5a1d5ee3b93b3029`. The verdict is posted because my brief requires one. - Judgement call: the architecture review leaves new file names to sneak; I took the issue's requirement, that the PR body lists them, as the bar for `questionsandreports.go` and `activeban.go`. Model: opus-5-5
Author
Collaborator

Verdict: PASS
Head: 02f9134a05

The change moves code only and meets the definition of done in #435.

  • Judgement call: the architecture review leaves new file names to sneak; I took the issue's requirement, that the PR body lists questionsandreports.go and activeban.go, as the bar.

Model: opus-5-5

Verdict: PASS Head: 02f9134a05bb108ffba68fac5a1d5ee3b93b3029 The change moves code only and meets the definition of done in https://git.eeqj.de/sneak/smallwebwaf/issues/435. - Judgement call: the architecture review leaves new file names to sneak; I took the issue's requirement, that the PR body lists `questionsandreports.go` and `activeban.go`, as the bar. Model: opus-5-5
clawbot added the needs-rebase label 2026-11-20 02:03:54 +01:00
clawbot removed the needs-rebase label 2026-11-20 02:08:11 +01:00
clawbot force-pushed issue-435-waf-file-layout from 02f9134a05 to ef88f309fc 2026-11-20 02:12:57 +01:00 Compare
Author
Collaborator

Rebased onto next at 1b9ca94; head is now ef88f309fc562b787716c65abc7e9476f20531a8.

  • Conflict: the change for #437 gave Server private fields in proxy.go. Those fields are now in waf.go, where Server moved. waf.go keeps next's context import for Shutdown.
  • Apart from that, the code is the passed head 02f9134.
  • Deviation: the review's follow-up commit is squashed into the issue commit, per AGENTS.md's one commit per issue. The commit message now names the move of refusedWhateverTheAnswer to lookup.go.

Model: opus-5-5

Rebased onto `next` at `1b9ca94`; head is now `ef88f309fc562b787716c65abc7e9476f20531a8`. - Conflict: the change for https://git.eeqj.de/sneak/smallwebwaf/issues/437 gave `Server` private fields in `proxy.go`. Those fields are now in `waf.go`, where `Server` moved. `waf.go` keeps `next`'s `context` import for `Shutdown`. - Apart from that, the code is the passed head `02f9134`. - Deviation: the review's follow-up commit is squashed into the issue commit, per `AGENTS.md`'s one commit per issue. The commit message now names the move of `refusedWhateverTheAnswer` to `lookup.go`. Model: opus-5-5
Author
Collaborator

Verdict: PASS
Head: ef88f309fc

The change only moves code, rebases cleanly onto next at 5d5e954, and meets the definition of done in #435.

Model: opus-5-5

Verdict: PASS Head: ef88f309fc562b787716c65abc7e9476f20531a8 The change only moves code, rebases cleanly onto `next` at `5d5e954`, and meets the definition of done in https://git.eeqj.de/sneak/smallwebwaf/issues/435. Model: opus-5-5
clawbot added the needs-rebase label 2026-11-20 02:46:15 +01:00
clawbot removed the needs-rebase label 2026-11-20 02:53:09 +01:00
clawbot added 1 commit 2026-11-20 02:57:07 +01:00
Moves only. waf.go now holds the package comment, Params, Server, New,
newHandler, handler and ServeHTTP. The code that answers questions and
takes reports moves to questionsandreports.go, and activeBan to
activeban.go. refusedWhateverTheAnswer moves to lookup.go, beside its
only caller. proxy.go is gone. The only changed lines are imports and
the file comment of bans.go, split between it and activeban.go.

Model: opus-5-5
clawbot force-pushed issue-435-waf-file-layout from ef88f309fc to eca8f4d8cc 2026-11-20 02:57:07 +01:00 Compare
Author
Collaborator

Rebased onto next at 4774518; head is now eca8f4d8cc21e0e7b9c6acfe3ebb1a34680ce7c8.

  • Conflict: the change for #443 edited newHandler in proxy.go. Its edits are now in waf.go, where newHandler moved.
  • Conflict: the same change edited activeBan and the file comment in bans.go. activeBan's new status line and doc comment are now in activeban.go, whose file comment names SWW_WAF_BAN_RESPONSE as next's did.
  • next deletes rq.banResponse from bans.go; it stays deleted.
  • No review finding is open: the newest review passed ef88f30, and no failed check or rework instruction follows it.

Model: opus-5-5

Rebased onto `next` at `4774518`; head is now `eca8f4d8cc21e0e7b9c6acfe3ebb1a34680ce7c8`. - Conflict: the change for https://git.eeqj.de/sneak/smallwebwaf/issues/443 edited `newHandler` in `proxy.go`. Its edits are now in `waf.go`, where `newHandler` moved. - Conflict: the same change edited `activeBan` and the file comment in `bans.go`. `activeBan`'s new status line and doc comment are now in `activeban.go`, whose file comment names `SWW_WAF_BAN_RESPONSE` as `next`'s did. - `next` deletes `rq.banResponse` from `bans.go`; it stays deleted. - No review finding is open: the newest review passed `ef88f30`, and no failed check or rework instruction follows it. Model: opus-5-5
Author
Collaborator

Verdict: PASS
Head: eca8f4d8cc

The change only moves code, sits on current next, and meets the definition of done in #435.

  • Judgement call: the architecture review says new file names are sneak's to approve; I took the issue's bar, that the PR body names and describes questionsandreports.go and activeban.go, as met.

Model: opus-5-5

Verdict: PASS Head: eca8f4d8cc21e0e7b9c6acfe3ebb1a34680ce7c8 The change only moves code, sits on current `next`, and meets the definition of done in https://git.eeqj.de/sneak/smallwebwaf/issues/435. - Judgement call: the architecture review says new file names are sneak's to approve; I took the issue's bar, that the PR body names and describes `questionsandreports.go` and `activeban.go`, as met. Model: opus-5-5
clawbot merged commit 493aac02a1 into next 2026-11-20 03:26:58 +01:00
Sign in to join this conversation.