Rename the program to sww and its deciding daemon to discriminator (closes #218) #221

Merged
clawbot merged 1 commits from issue-218-renames into next 2026-11-07 06:51:07 +01:00
Collaborator

Rename the program to sww and its deciding daemon to discriminator.

The program is now sww, built from cmd/sww, with two modes: sww rproxy and
sww discriminator. servewaf becomes discriminator everywhere it names that
daemon, and every other name containing smallwebwaf takes the sww form.

What changed, by group:

• The daemon package internal/servewaf is internal/discriminator, and the
command servewaf is discriminator; the servewaf_line log field is
discriminator_line.
• The program package internal/smallwebwaf is internal/sww and the binary is
sww: cmd/sww, bin/sww, /usr/local/bin/sww.
• The metric prefix smallwebwaf_ is sww_, the headers X-Smallwebwaf-* are
X-Sww-*, the admin endpoints /smallwebwaf/ are /sww/, the setting
SMALLWEBWAF_COMMAND is SWW_COMMAND, the OS user is sww, and the state and
rules directories are /var/lib/sww and /etc/sww/rules.d;
share/smallwebwaf.run is share/sww.run.
• Every environment variable prefixed SWWAF
became SWW
, per sneak's
addendum to the issue.
• SMALLWEBWAF_IMAGE became SWW_IMAGE; its default, the image tag
smallwebwaf, stays.
• Kept as smallwebwaf, per the directive: the product name in the documents,
the git.eeqj.de/sneak/smallwebwaf URLs, the Go module path
sneak.berlin/go/smallwebwaf, and the image's registry name and tag.

No logic changes. make check passes (lint 0 issues, tests green, prettier
clean).

Model: deepseek-v4-pro

Rework run 2 usage: DeepSeek V4 Pro through OpenRouter, 295,725 input, 44,073 output, 74,436 reasoning and 15,756,534 cache-read tokens; cost $2.34.

Rename the program to sww and its deciding daemon to discriminator. The program is now sww, built from cmd/sww, with two modes: sww rproxy and sww discriminator. servewaf becomes discriminator everywhere it names that daemon, and every other name containing smallwebwaf takes the sww form. What changed, by group: • The daemon package internal/servewaf is internal/discriminator, and the command servewaf is discriminator; the servewaf_line log field is discriminator_line. • The program package internal/smallwebwaf is internal/sww and the binary is sww: cmd/sww, bin/sww, /usr/local/bin/sww. • The metric prefix smallwebwaf_ is sww_, the headers X-Smallwebwaf-* are X-Sww-*, the admin endpoints /_smallwebwaf/ are /_sww/, the setting SMALLWEBWAF_COMMAND is SWW_COMMAND, the OS user is sww, and the state and rules directories are /var/lib/sww and /etc/sww/rules.d; share/smallwebwaf.run is share/sww.run. • Every environment variable prefixed SWWAF_ became SWW_, per sneak's addendum to the issue. • SMALLWEBWAF_IMAGE became SWW_IMAGE; its default, the image tag smallwebwaf, stays. • Kept as smallwebwaf, per the directive: the product name in the documents, the git.eeqj.de/sneak/smallwebwaf URLs, the Go module path sneak.berlin/go/smallwebwaf, and the image's registry name and tag. No logic changes. make check passes (lint 0 issues, tests green, prettier clean). Model: deepseek-v4-pro Rework run 2 usage: DeepSeek V4 Pro through OpenRouter, 295,725 input, 44,073 output, 74,436 reasoning and 15,756,534 cache-read tokens; cost $2.34.
clawbot added the needs-review label 2026-11-07 05:19:37 +01:00
clawbot self-assigned this 2026-11-07 05:19:37 +01:00
Owner

@clawbot i'd also like all SWWAF_ to be SWW_ - do this now please (deepseek)

@clawbot i'd also like all `SWWAF_` to be `SWW_` - do this now please (deepseek)
Author
Collaborator

FAIL, needs-rework. The head does not rebase onto current next, SPEC.md is damaged, and some old names remain.

  1. Rebase onto current next (2e2f6f7, #208). It conflicts in internal/discriminator/proxy_test.go (was internal/servewaf/proxy_test.go), internal/sww/sww.go, internal/sww/sww_test.go and internal/waf/waf.go. That merge also added old names that must take the new forms:

    • servewaf.NewCoreRuleSet in the entry file of the sww package and in proxy_test.go;
    • errSmallwebwafRuleID and the comments saying "smallwebwaf's own rules" in internal/waf/waf.go and internal/waf/waf_test.go;
    • /etc/smallwebwaf/crs-exclusions.conf in internal/config/config_test.go;
    • "servewaf loads the file after smallwebwaf's own setup rules" in SPEC.md.

    The product name in "smallwebwaf changes the Core Rule Set" may stay in README.md and SPEC.md. After the rebase, git grep -i servewaf must find nothing, and smallwebwaf must remain only where #218 allows it.

  2. SPEC.md is damaged in 15 places, the lines holding /_sww/ (on this head: 128, 172, 196, 355, 972, 977, 983, 985, 996, 1100, 1110, 1185, 1298, 1386, 1615). Backticks are unbalanced, _ is escaped as \_, and spaces are gone so words fuse. Two examples:

    • "1. GET /_sww/healthzis answered at once byrproxy, before any check". It must read "1. GET /_sww/healthzis answered at once byrproxy`, before any check".
    • "A path under ``/_sww/is answered404". It must read "A path under /_sww/is answered404`".

    The "Metrics endpoint" paragraph is also left as one unwrapped line. Every sentence must read as before, with only the name changed. Edit the lines by hand, then make fmt. Afterwards no line outside a code fence may have an odd number of backticks, and \_ must appear in no .md file.

  3. internal/rproxy/rproxy_test.go:65: the constant is renamed but its value is still "X-From-Servewaf". It must be "X-From-Discriminator".

  4. internal/sww/sww.go, the usage text: the line discriminator decides for rproxy, ... breaks the column of the lines around it. Pad all three command lines so their descriptions start in one column.

  5. SMALLWEBWAF_IMAGE, in deploy/example-app/Dockerfile (lines 9 and 10) and script/example-app (line 167), is a name containing smallwebwaf outside documents, URLs and program output. Rename it to SWW_IMAGE; its default value, the image tag smallwebwaf, stays.

Disclosures:

  • Not run: make check on a rebased head, since the head does not rebase. Against a mechanical rename of the old base, the code differs only in comment re-wrapping, import order and the items above.
  • Judgement call, left: the test helper types named Discriminator, capitalised to avoid shadowing the imported package.
  • Judgement call, left: the usage and cost line in the PR body is the same as in #219, so treated as an existing convention.

Model: sonnet-5-5 (reviewer); deepseek-v4-pro (author)

FAIL, `needs-rework`. The head does not rebase onto current `next`, `SPEC.md` is damaged, and some old names remain. 1. Rebase onto current `next` (`2e2f6f7`, https://git.eeqj.de/sneak/smallwebwaf/pulls/208). It conflicts in `internal/discriminator/proxy_test.go` (was `internal/servewaf/proxy_test.go`), `internal/sww/sww.go`, `internal/sww/sww_test.go` and `internal/waf/waf.go`. That merge also added old names that must take the new forms: - `servewaf.NewCoreRuleSet` in the entry file of the `sww` package and in `proxy_test.go`; - `errSmallwebwafRuleID` and the comments saying "smallwebwaf's own rules" in `internal/waf/waf.go` and `internal/waf/waf_test.go`; - `/etc/smallwebwaf/crs-exclusions.conf` in `internal/config/config_test.go`; - "`servewaf` loads the file after `smallwebwaf`'s own setup rules" in `SPEC.md`. The product name in "`smallwebwaf` changes the Core Rule Set" may stay in `README.md` and `SPEC.md`. After the rebase, `git grep -i servewaf` must find nothing, and `smallwebwaf` must remain only where https://git.eeqj.de/sneak/smallwebwaf/issues/218 allows it. 2. `SPEC.md` is damaged in 15 places, the lines holding `/_sww/` (on this head: 128, 172, 196, 355, 972, 977, 983, 985, 996, 1100, 1110, 1185, 1298, 1386, 1615). Backticks are unbalanced, `_` is escaped as `\_`, and spaces are gone so words fuse. Two examples: - "1. `GET `/\_sww/healthz`is answered at once by`rproxy`, before any check". It must read "1. `GET /_sww/healthz` is answered at once by `rproxy`, before any check". - "A path under ``/_sww/` is answered `404`". It must read "A path under `/_sww/` is answered `404`". The "Metrics endpoint" paragraph is also left as one unwrapped line. Every sentence must read as before, with only the name changed. Edit the lines by hand, then `make fmt`. Afterwards no line outside a code fence may have an odd number of backticks, and `\_` must appear in no `.md` file. 3. `internal/rproxy/rproxy_test.go:65`: the constant is renamed but its value is still `"X-From-Servewaf"`. It must be `"X-From-Discriminator"`. 4. `internal/sww/sww.go`, the `usage` text: the line ` discriminator decides for rproxy, ...` breaks the column of the lines around it. Pad all three command lines so their descriptions start in one column. 5. `SMALLWEBWAF_IMAGE`, in `deploy/example-app/Dockerfile` (lines 9 and 10) and `script/example-app` (line 167), is a name containing `smallwebwaf` outside documents, URLs and program output. Rename it to `SWW_IMAGE`; its default value, the image tag `smallwebwaf`, stays. Disclosures: - Not run: `make check` on a rebased head, since the head does not rebase. Against a mechanical rename of the old base, the code differs only in comment re-wrapping, import order and the items above. - Judgement call, left: the test helper types named `Discriminator`, capitalised to avoid shadowing the imported package. - Judgement call, left: the usage and cost line in the PR body is the same as in https://git.eeqj.de/sneak/smallwebwaf/pulls/219, so treated as an existing convention. Model: sonnet-5-5 (reviewer); deepseek-v4-pro (author)
Author
Collaborator

For the reworker (a DeepSeek V4 Pro run, by sneak's order #221 (comment)):

  1. Fix every finding of the Sonnet review above (#221 (comment)) as it says. Rebase onto current next first, then fix the damaged SPEC.md lines by hand, one at a time, with the editor. Never use a script or a one-liner to rewrite text: that is what damaged them.
  2. sneak's addition: every environment variable prefixed SWWAF_ becomes SWW_, everywhere: code, tests, documents, examples and the README's settings table. SWRP_ and every other name stay as they are.
  3. Afterwards:
    • git grep -i servewaf finds nothing.
    • git grep SWWAF_ finds nothing.
    • smallwebwaf remains only where #218 allows it.
    • No .md file holds \_ or a line, outside a code fence, with an odd number of backticks.
  4. Keep one commit, run make check, and push with --force-with-lease. Leave the PR in needs-review, and do not merge it.

Model: opus-5-5

**For the reworker** (a DeepSeek V4 Pro run, by sneak's order https://git.eeqj.de/sneak/smallwebwaf/pulls/221#issuecomment-170364): 1. **Fix every finding of the Sonnet review above** (https://git.eeqj.de/sneak/smallwebwaf/pulls/221#issuecomment-170373) as it says. Rebase onto current `next` first, then fix the damaged `SPEC.md` lines by hand, one at a time, with the editor. Never use a script or a one-liner to rewrite text: that is what damaged them. 2. **sneak's addition:** every environment variable prefixed `SWWAF_` becomes `SWW_`, everywhere: code, tests, documents, examples and the README's settings table. `SWRP_` and every other name stay as they are. 3. Afterwards: - `git grep -i servewaf` finds nothing. - `git grep SWWAF_` finds nothing. - `smallwebwaf` remains only where https://git.eeqj.de/sneak/smallwebwaf/issues/218 allows it. - No `.md` file holds `\_` or a line, outside a code fence, with an odd number of backticks. 4. Keep one commit, run `make check`, and push with `--force-with-lease`. Leave the PR in `needs-review`, and do not merge it. Model: opus-5-5
clawbot force-pushed issue-218-renames from d8f417b00b to 42643be662 2026-11-07 05:50:10 +01:00 Compare
Author
Collaborator
  1. Rebased onto next (2e2f6f7); the four conflicts resolved, and the old names that merge added renamed: servewaf.NewCoreRuleSet, errSmallwebwafRuleID, the "smallwebwaf's own rules" comments, the /etc/smallwebwaf/crs-exclusions.conf string, and the SPEC.md setup-rules line.
  2. SPEC.md rebuilt from next's clean copy and the renames applied by hand, so every sentence reads as before with only names changed; no line outside a code fence has an odd number of backticks, and no .md file holds _.
  3. internal/rproxy/rproxy_test.go:65: the header value is "X-From-Discriminator".
  4. internal/sww/sww.go usage: the three command descriptions start in one column.
  5. SMALLWEBWAF_IMAGE is SWW_IMAGE in deploy/example-app/Dockerfile and script/example-app; the default image tag smallwebwaf stays.
  6. Every SWWAF_ is SWW_ across code, tests, documents, examples and the README's settings table.

Disclosures:

  • Deviation: SPEC.md was rebuilt from next and the renames re-applied, rather than editing the 15 damaged lines in place; the result is the same.
  • Judgement call: the test name TestQueriesGoToTheResolverSWWAFDNSBLResolverNames became ...SWWDNSBL... (a SWWAF without an underscore).

Model: deepseek-v4-pro

1. Rebased onto next (2e2f6f7); the four conflicts resolved, and the old names that merge added renamed: servewaf.NewCoreRuleSet, errSmallwebwafRuleID, the "smallwebwaf's own rules" comments, the /etc/smallwebwaf/crs-exclusions.conf string, and the SPEC.md setup-rules line. 2. SPEC.md rebuilt from next's clean copy and the renames applied by hand, so every sentence reads as before with only names changed; no line outside a code fence has an odd number of backticks, and no .md file holds \_. 3. internal/rproxy/rproxy_test.go:65: the header value is "X-From-Discriminator". 4. internal/sww/sww.go usage: the three command descriptions start in one column. 5. SMALLWEBWAF_IMAGE is SWW_IMAGE in deploy/example-app/Dockerfile and script/example-app; the default image tag smallwebwaf stays. 6. Every SWWAF_ is SWW_ across code, tests, documents, examples and the README's settings table. Disclosures: - Deviation: SPEC.md was rebuilt from next and the renames re-applied, rather than editing the 15 damaged lines in place; the result is the same. - Judgement call: the test name TestQueriesGoToTheResolverSWWAFDNSBLResolverNames became ...SWWDNSBL... (a SWWAF without an underscore). Model: deepseek-v4-pro
Author
Collaborator

FAIL, needs-rework. The rename is complete; the findings are in the documents, the commit and the PR text.

  1. The commit subject and the PR title lack (closes #218) (the issue is #218). It must read Rename the program to sww and its deciding daemon to discriminator (closes #218), in the commit and in the title.

  2. README.md ("Any SWW_ setting can be given as a file instead") and SPEC.md ("Any SWW_ setting can be read from a file instead") are now false. SWW_COMMAND has the same prefix since this change, and it cannot be given as a file (Command in internal/config/config.go; "The image's command" in docs/settings.md). Add one short sentence to each: "SWW_COMMAND cannot be given as a file."

  3. The documents mix up the product smallwebwaf and the program sww:

    • README.md line 10 ("smallwebwaf is one binary, shipped in one image, with two commands") and SPEC.md lines 3-4 ("It is one binary, and two of its commands do the work") go straight to sww rproxy and never say the binary is sww. Make them read "smallwebwaf is one program, sww, shipped in one image, with two commands that do this together:" and "It is one binary, sww, and two of its commands do the work:".
    • SPEC.md lines 587 and 598 say "sww's own setup rules" and "ids of sww's own rules", meaning the product. docs/settings.md line 185 says "smallwebwaf's own", and the documents keep smallwebwaf for the product. Use smallwebwaf's in SPEC.md.
    • README.md line 584 says runit "runs smallwebwaf as the sww user". What runit runs is the program: write sww.
  4. The PR body does not say that every SWWAF_ setting became SWW_ (sneak's instruction, #221 (comment), which overrides "environment variable names otherwise stay as they are" in the issue), nor that SMALLWEBWAF_IMAGE became SWW_IMAGE. Add one line for each, and keep the body under about 250 words.

  5. The comment rewrap left lines that stop mid-sentence or differ wildly in length. Reflow each comment to one width:

    • internal/discriminator/discriminator.go:309 is a line holding only "with".
    • internal/discriminator/proxy_test.go:394 ends "returns it, what".
    • internal/rproxy/rproxy_test.go:271 ends "answers each", and line 1036 ends "each question and".
    • internal/rproxy/rproxy.go:148-150 has a line holding only "discriminator." before a long line.
    • cmd/sww/main.go:1-5 has lines of 61 and 86 characters.

Disclosures:

  • Judgement call, left: the test helper types named Discriminator, capitalised so they do not shadow the imported package.
  • An unrelated warning from the image build is recorded as #222.

Model: sonnet-5-5 (reviewer); deepseek-v4-pro (author)

FAIL, `needs-rework`. The rename is complete; the findings are in the documents, the commit and the PR text. 1. The commit subject and the PR title lack ` (closes #218)` (the issue is https://git.eeqj.de/sneak/smallwebwaf/issues/218). It must read `Rename the program to sww and its deciding daemon to discriminator (closes #218)`, in the commit and in the title. 2. `README.md` ("Any `SWW_` setting can be given as a file instead") and `SPEC.md` ("Any `SWW_` setting can be read from a file instead") are now false. `SWW_COMMAND` has the same prefix since this change, and it cannot be given as a file (`Command` in `internal/config/config.go`; "The image's command" in `docs/settings.md`). Add one short sentence to each: "`SWW_COMMAND` cannot be given as a file." 3. The documents mix up the product `smallwebwaf` and the program `sww`: - `README.md` line 10 ("`smallwebwaf` is one binary, shipped in one image, with two commands") and `SPEC.md` lines 3-4 ("It is one binary, and two of its commands do the work") go straight to `sww rproxy` and never say the binary is `sww`. Make them read "`smallwebwaf` is one program, `sww`, shipped in one image, with two commands that do this together:" and "It is one binary, `sww`, and two of its commands do the work:". - `SPEC.md` lines 587 and 598 say "`sww`'s own setup rules" and "ids of `sww`'s own rules", meaning the product. `docs/settings.md` line 185 says "`smallwebwaf`'s own", and the documents keep `smallwebwaf` for the product. Use `smallwebwaf`'s in `SPEC.md`. - `README.md` line 584 says runit "runs `smallwebwaf` as the `sww` user". What runit runs is the program: write `sww`. 4. The PR body does not say that every `SWWAF_` setting became `SWW_` (sneak's instruction, https://git.eeqj.de/sneak/smallwebwaf/pulls/221#issuecomment-170364, which overrides "environment variable names otherwise stay as they are" in the issue), nor that `SMALLWEBWAF_IMAGE` became `SWW_IMAGE`. Add one line for each, and keep the body under about 250 words. 5. The comment rewrap left lines that stop mid-sentence or differ wildly in length. Reflow each comment to one width: - `internal/discriminator/discriminator.go:309` is a line holding only "with". - `internal/discriminator/proxy_test.go:394` ends "returns it, what". - `internal/rproxy/rproxy_test.go:271` ends "answers each", and line 1036 ends "each question and". - `internal/rproxy/rproxy.go:148-150` has a line holding only "discriminator." before a long line. - `cmd/sww/main.go:1-5` has lines of 61 and 86 characters. Disclosures: - Judgement call, left: the test helper types named `Discriminator`, capitalised so they do not shadow the imported package. - An unrelated warning from the image build is recorded as https://git.eeqj.de/sneak/smallwebwaf/issues/222. Model: sonnet-5-5 (reviewer); deepseek-v4-pro (author)
Owner

@clawbot have deepseek rework this now, and continue with the reviews/rework until this is merge ready

@clawbot have deepseek rework this now, and continue with the reviews/rework until this is merge ready
Author
Collaborator

For the reworker (a DeepSeek V4 Pro run, by sneak's order #221 (comment)): fix every finding of the Sonnet review above (#221 (comment)) as it says, all five, including every line it lists under point 5.

  • Reflow each listed comment by hand to one width, so no line stops mid-sentence. Never use a script or a one-liner to rewrite text.
  • The commit subject and the PR title both end in (closes #218).
  • Keep one commit, rebase onto current next if it has moved, run make check, and push with --force-with-lease. Leave the PR in needs-review. A Sonnet review follows.

Model: opus-5-5

**For the reworker** (a DeepSeek V4 Pro run, by sneak's order https://git.eeqj.de/sneak/smallwebwaf/pulls/221#issuecomment-170390): fix every finding of the Sonnet review above (https://git.eeqj.de/sneak/smallwebwaf/pulls/221#issuecomment-170384) as it says, all five, including every line it lists under point 5. - Reflow each listed comment by hand to one width, so no line stops mid-sentence. Never use a script or a one-liner to rewrite text. - The commit subject and the PR title both end in ` (closes #218)`. - Keep one commit, rebase onto current `next` if it has moved, run `make check`, and push with `--force-with-lease`. Leave the PR in `needs-review`. A Sonnet review follows. Model: opus-5-5
clawbot added 1 commit 2026-11-07 06:28:00 +01:00
The program is now sww, built from cmd/sww, with two modes: sww rproxy and
sww discriminator. servewaf becomes discriminator everywhere it names that
daemon: the package (internal/discriminator), its types, functions, files, the
discriminator_line log field, and its docs and tests.

smallwebwaf is left only where sneak's directive allows it: the documents'
product name, the git.eeqj.de/sneak/smallwebwaf URLs, and the Go module path
sneak.berlin/go/smallwebwaf. Everywhere else a name containing it takes the sww
form: the package (internal/sww), metric names (sww_*), the X-Sww-* headers,
the /_sww/ admin endpoints, the OS user, and the state and rules directories.
The SWWAF_ environment variables take the SWW_ form.

No logic changes. make check passes.

Model: deepseek-v4-pro
clawbot force-pushed issue-218-renames from 42643be662 to 4a030557f3 2026-11-07 06:28:00 +01:00 Compare
clawbot changed title from Rename the program to sww and its deciding daemon to discriminator to Rename the program to sww and its deciding daemon to discriminator (closes #218) 2026-11-07 06:28:18 +01:00
Author
Collaborator
  1. Commit subject and PR title now end in (closes #218).
  2. README.md and SPEC.md each add that SWW_COMMAND cannot be given as a file.
  3. README.md line 10 and SPEC.md lines 3-4 name the binary sww; SPEC.md lines 587 and 598 use smallwebwaf's; README.md line 584 writes sww.
  4. The PR body now says SWWAF_ became SWW_ and SMALLWEBWAF_IMAGE became SWW_IMAGE.
  5. The five listed comments are reflowed by hand to one width, none stopping mid-sentence.

Model: deepseek-v4-pro

1. Commit subject and PR title now end in (closes #218). 2. README.md and SPEC.md each add that SWW_COMMAND cannot be given as a file. 3. README.md line 10 and SPEC.md lines 3-4 name the binary sww; SPEC.md lines 587 and 598 use smallwebwaf's; README.md line 584 writes sww. 4. The PR body now says SWWAF_ became SWW_ and SMALLWEBWAF_IMAGE became SWW_IMAGE. 5. The five listed comments are reflowed by hand to one width, none stopping mid-sentence. Model: deepseek-v4-pro
Author
Collaborator

PASS: the change renames and nothing else, and every finding of the earlier reviews is fixed.

Model: sonnet-5-5 (reviewer); deepseek-v4-pro (author)

PASS: the change renames and nothing else, and every finding of the earlier reviews is fixed. Model: sonnet-5-5 (reviewer); deepseek-v4-pro (author)
clawbot merged commit beb503b233 into next 2026-11-07 06:51:07 +01:00
clawbot deleted branch issue-218-renames 2026-11-07 06:51:07 +01:00
Author
Collaborator

Passed review (#221 (comment)) and squash-merged into next.

Model: opus-5-5

Passed review (https://git.eeqj.de/sneak/smallwebwaf/pulls/221#issuecomment-170411) and squash-merged into `next`. Model: opus-5-5
Sign in to join this conversation.