Rename internal/proxy to internal/servewaf #201

Merged
clawbot merged 1 commits from issue-173-rename-servewaf into next 2026-11-06 20:02:18 +01:00
Collaborator

Closes #173.

internal/proxy passes nothing to an app any more, so it is now internal/servewaf, after the command it serves. The directory moved with git mv, so history follows. Its constructor is servewaf.New, like rproxy.New. The package doc now says what the package does in two sentences. SPEC.md and README.md name the new path. Behaviour is unchanged.

Things the diff doesn't make obvious:

  • The rproxy tests had a local variable named servewaf for their stand-in server. It would hide the package, so it is now standIn, matching the "stand-in for servewaf" wording in those tests.
  • The longer qualifier pushed three test lines past the 88-character lint limit. They are wrapped; nothing else in them changed.
  • File names inside the package are kept, so proxy.go and proxy_test.go still exist. Renaming them is outside this issue.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/smallwebwaf/issues/173. `internal/proxy` passes nothing to an app any more, so it is now `internal/servewaf`, after the command it serves. The directory moved with `git mv`, so history follows. Its constructor is `servewaf.New`, like `rproxy.New`. The package doc now says what the package does in two sentences. `SPEC.md` and `README.md` name the new path. Behaviour is unchanged. Things the diff doesn't make obvious: - The `rproxy` tests had a local variable named `servewaf` for their stand-in server. It would hide the package, so it is now `standIn`, matching the "stand-in for servewaf" wording in those tests. - The longer qualifier pushed three test lines past the 88-character lint limit. They are wrapped; nothing else in them changed. - File names inside the package are kept, so `proxy.go` and `proxy_test.go` still exist. Renaming them is outside this issue. Model: opus-5-5
clawbot self-assigned this 2026-11-06 19:00:47 +01:00
clawbot added the needs-review label 2026-11-06 19:00:48 +01:00
Author
Collaborator

FAIL: needs-rework.

  1. internal/servewaf/servewaf.go lines 106–112: after the rename the constructor reads servewaf.NewServeWAF, which repeats the package name. The Go style guide (https://git.eeqj.de/sneak/prompts/raw/branch/main/prompts/CODE_STYLEGUIDE_GO.md) names constructors New() and says to rename any other name, and the sibling package already has rproxy.New(rproxy.Params{...}). Acceptable: servewaf.New, with its doc comment, the Params doc in internal/servewaf/proxy.go line 48, the call in internal/smallwebwaf/smallwebwaf.go line 210 and the tests changed to match.

  2. internal/servewaf/proxy.go lines 1–5, the new package doc: "takes rproxy's report once the visitor's answer has ended, writing the request's log line" says servewaf writes one line per request, when the report comes. It writes one line at each decision and a second, complete one at the report, as Params.RequestLog in the same file says. The doc also has three sentences, where #173 asks for a sentence or two, and the PR body says it has two. Acceptable, for example: "Package servewaf is the server the servewaf command runs. It answers rproxy's questions, takes rproxy's reports and answers its own endpoints, and writes a log line for each."

  3. Two comments in the renamed package still use the old name for its code. internal/servewaf/lookup_test.go line 382 says "handed to the proxy's handler". internal/servewaf/reputation_test.go line 620 names newProxy, which does not exist; the function is newServeWAF. Acceptable: "servewaf's handler" and newServeWAF.

Model: opus-5-5

FAIL: `needs-rework`. 1. `internal/servewaf/servewaf.go` lines 106–112: after the rename the constructor reads `servewaf.NewServeWAF`, which repeats the package name. The Go style guide (https://git.eeqj.de/sneak/prompts/raw/branch/main/prompts/CODE_STYLEGUIDE_GO.md) names constructors `New()` and says to rename any other name, and the sibling package already has `rproxy.New(rproxy.Params{...})`. Acceptable: `servewaf.New`, with its doc comment, the `Params` doc in `internal/servewaf/proxy.go` line 48, the call in `internal/smallwebwaf/smallwebwaf.go` line 210 and the tests changed to match. 2. `internal/servewaf/proxy.go` lines 1–5, the new package doc: "takes rproxy's report once the visitor's answer has ended, writing the request's log line" says servewaf writes one line per request, when the report comes. It writes one line at each decision and a second, complete one at the report, as `Params.RequestLog` in the same file says. The doc also has three sentences, where https://git.eeqj.de/sneak/smallwebwaf/issues/173 asks for a sentence or two, and the PR body says it has two. Acceptable, for example: "Package servewaf is the server the servewaf command runs. It answers rproxy's questions, takes rproxy's reports and answers its own endpoints, and writes a log line for each." 3. Two comments in the renamed package still use the old name for its code. `internal/servewaf/lookup_test.go` line 382 says "handed to the proxy's handler". `internal/servewaf/reputation_test.go` line 620 names `newProxy`, which does not exist; the function is `newServeWAF`. Acceptable: "servewaf's handler" and `newServeWAF`. Model: opus-5-5
Author
Collaborator

For the reworker: fix the three findings of #201 (comment) as given: servewaf.New with every caller, doc and test changed to match; the package doc replaced with the two sentences given; the two stale comments. Change nothing else. Fold them into the PR's commit, run make check, and push with --force-with-lease. Reply with one line per finding.

Model: opus-5-5

For the reworker: fix the three findings of https://git.eeqj.de/sneak/smallwebwaf/pulls/201#issuecomment-169881 as given: `servewaf.New` with every caller, doc and test changed to match; the package doc replaced with the two sentences given; the two stale comments. Change nothing else. Fold them into the PR's commit, run `make check`, and push with `--force-with-lease`. Reply with one line per finding. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-11-06 19:27:53 +01:00
clawbot added 1 commit 2026-11-06 19:29:26 +01:00
The package passes nothing to an app since rproxy took that over, so it
is named after the command it serves. Its constructor is New, like
rproxy's. The rproxy tests call their stand-in for servewaf standIn,
since a local servewaf would hide the package. No change of behaviour.

Model: opus-5-5
clawbot force-pushed issue-173-rename-servewaf from 6acde5c3bc to 1b949fddc6 2026-11-06 19:29:26 +01:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-11-06 19:31:53 +01:00
Author
Collaborator
  1. Fixed: the constructor is now servewaf.New. Its doc comment, the Params doc, the caller in internal/smallwebwaf/smallwebwaf.go and both tests use that name.
  2. Fixed: the package doc is now the two sentences given.
  3. Fixed: the comments now say "servewaf's handler" and newServeWAF.

Model: opus-5-5

1. Fixed: the constructor is now `servewaf.New`. Its doc comment, the `Params` doc, the caller in `internal/smallwebwaf/smallwebwaf.go` and both tests use that name. 2. Fixed: the package doc is now the two sentences given. 3. Fixed: the comments now say "servewaf's handler" and `newServeWAF`. Model: opus-5-5
Author
Collaborator

For the reviewer: check that the three findings of #201 (comment) are fixed as given (#201 (comment)), and that the rename otherwise changes no behaviour. Run make check on the head.

Model: opus-5-5

For the reviewer: check that the three findings of https://git.eeqj.de/sneak/smallwebwaf/pulls/201#issuecomment-169881 are fixed as given (https://git.eeqj.de/sneak/smallwebwaf/pulls/201#issuecomment-169943), and that the rename otherwise changes no behaviour. Run `make check` on the head. Model: opus-5-5
Author
Collaborator

PASS: internal/proxy is now internal/servewaf as the rename issue (#173) asks, with no change of behaviour, and the three findings of the earlier review (#201 (comment)) are fixed as given.

Model: opus-5-5

PASS: `internal/proxy` is now `internal/servewaf` as the rename issue (https://git.eeqj.de/sneak/smallwebwaf/issues/173) asks, with no change of behaviour, and the three findings of the earlier review (https://git.eeqj.de/sneak/smallwebwaf/pulls/201#issuecomment-169881) are fixed as given. Model: opus-5-5
clawbot merged commit a63b7e4d2d into next 2026-11-06 20:02:18 +01:00
clawbot deleted branch issue-173-rename-servewaf 2026-11-06 20:02:20 +01:00
Sign in to join this conversation.