ratelimit.New takes one ratelimit.Params in place of two arguments by position.
The process logger moves out of requestlog into a new package, internal/processlog. Its constructor is processlog.New(processlog.Params). Its two tests move with it; only their constructor calls changed.
geojs.GeoJS keeps its params whole, as reputation.DNSBL, reputation.AbuseIPDB and routewatch.Client do.
SPEC.md (Architecture) and README.md (Packages) list the new package. The README bullet that chained four packages is now one bullet each.
New names:
internal/processlog: builds the logger for the process's own messages, the JSON lines marked "type":"process".
processlog.Params: what processlog.New needs.
Output: where the lines are written.
InstanceName: each line's instance, SWW_WAF_INSTANCE_NAME.
Level: the least severe level written, SWW_WAF_LOG_LEVEL.
processlog.New: returns that logger.
ratelimit.Params: what ratelimit.New needs.
Limits: what each client's requests and bytes are counted against.
MaxClients: the most clients the table holds, SWW_WAF_MAX_TRACKED_CLIENTS.
GeoJS.params: the Params it was built with.
Overlaps with open PRs:
#463 edits the same GeoJS struct. Whichever lands second rebases.
No PR for the SQLite state store (#217) is open, so this PR changes ratelimit.New.
Judgement call: the moved tests use a constant for the instance name in their two constructor calls, because goconst flags the string once it appears three times in one file. The assertion keeps its literal.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/smallwebwaf/issues/450
- `ratelimit.New` takes one `ratelimit.Params` in place of two arguments by position.
- The process logger moves out of `requestlog` into a new package, `internal/processlog`. Its constructor is `processlog.New(processlog.Params)`. Its two tests move with it; only their constructor calls changed.
- `geojs.GeoJS` keeps its `params` whole, as `reputation.DNSBL`, `reputation.AbuseIPDB` and `routewatch.Client` do.
- `SPEC.md` (Architecture) and `README.md` (Packages) list the new package. The README bullet that chained four packages is now one bullet each.
New names:
- `internal/processlog`: builds the logger for the process's own messages, the JSON lines marked `"type":"process"`.
- `processlog.Params`: what `processlog.New` needs.
- `Output`: where the lines are written.
- `InstanceName`: each line's `instance`, `SWW_WAF_INSTANCE_NAME`.
- `Level`: the least severe level written, `SWW_WAF_LOG_LEVEL`.
- `processlog.New`: returns that logger.
- `ratelimit.Params`: what `ratelimit.New` needs.
- `Limits`: what each client's requests and bytes are counted against.
- `MaxClients`: the most clients the table holds, `SWW_WAF_MAX_TRACKED_CLIENTS`.
- `GeoJS.params`: the `Params` it was built with.
Overlaps with open PRs:
- https://git.eeqj.de/sneak/smallwebwaf/pulls/463 edits the same `GeoJS` struct. Whichever lands second rebases.
- No PR for the SQLite state store (https://git.eeqj.de/sneak/smallwebwaf/issues/217) is open, so this PR changes `ratelimit.New`.
Judgement call: the moved tests use a constant for the instance name in their two constructor calls, because `goconst` flags the string once it appears three times in one file. The assertion keeps its literal.
Model: opus-5-5
clawbot
self-assigned this 2026-11-19 18:43:55 +01:00
internal/geojs/geojs.go conflicts with next now that #463 (ending the asks to GeoJS at the stop) has landed. Rebase the branch onto next. The one conflicting line, in ask, becomes if g.asking || g.stopped || g.params.Now().Before(g.retryAt) {, which keeps both changes; that line is the whole resolution.
Disclosure: SPEC.md's package list said internal/requestlog writes "one JSON line per request", but SPEC's "The log" section gives a request three lines. It is fixed on the branch in 9bc631315d. Keep that commit through the rebase.
Model: opus-5-5
Verdict: FAIL
Head: 1002433c3593f6e2a517f063417a3eea93fa601c
1. `internal/geojs/geojs.go` conflicts with `next` now that https://git.eeqj.de/sneak/smallwebwaf/pulls/463 (ending the asks to GeoJS at the stop) has landed. Rebase the branch onto `next`. The one conflicting line, in `ask`, becomes `if g.asking || g.stopped || g.params.Now().Before(g.retryAt) {`, which keeps both changes; that line is the whole resolution.
- Disclosure: `SPEC.md`'s package list said `internal/requestlog` writes "one JSON line per request", but SPEC's "The log" section gives a request three lines. It is fixed on the branch in https://git.eeqj.de/sneak/smallwebwaf/commit/9bc631315db61416dfbd87d42afa114ebe6419e0. Keep that commit through the rebase.
Model: opus-5-5
ratelimit.New takes ratelimit.Params (Limits, MaxClients) in place of
two arguments by position. The process logger moves out of requestlog
into internal/processlog, whose New takes Params (Output, InstanceName,
Level); its two tests move with it unchanged. geojs.GeoJS keeps its
params whole, as DNSBL, AbuseIPDB and routewatch.Client do. SPEC and
README list the new package.
Model: opus-5-5
The package list said requestlog writes one JSON line per request. SPEC's
"The log" section gives a request waf answers three request log lines.
Model: opus-5-5
Rebased onto next; the conflicting line in ask is now if g.asking || g.stopped || g.params.Now().Before(g.retryAt) {. Head: 5667661dd8
Disclosure: the SPEC.md commit is kept, now 5667661dd8
Model: opus-5-5
1. Rebased onto `next`; the conflicting line in `ask` is now `if g.asking || g.stopped || g.params.Now().Before(g.retryAt) {`. Head: 5667661dd8464717bb8470d56f3635c34508180a
- Disclosure: the `SPEC.md` commit is kept, now https://git.eeqj.de/sneak/smallwebwaf/commit/5667661dd8464717bb8470d56f3635c34508180a
Model: opus-5-5
ratelimit.New and the process logger each take one Params, geojs.GeoJS keeps its params whole, and the change meets the definition of done of #450.
Deviation: the requestlog package doc, which this change rewrote, still said the request log is one JSON object per request; that sentence is fixed on the branch in e52edb9f62, and the new head goes to a fresh review.
Model: opus-5-5
Verdict: PASS
Head: 5667661dd8464717bb8470d56f3635c34508180a
`ratelimit.New` and the process logger each take one `Params`, `geojs.GeoJS` keeps its `params` whole, and the change meets the definition of done of https://git.eeqj.de/sneak/smallwebwaf/issues/450.
- Deviation: the `requestlog` package doc, which this change rewrote, still said the request log is one JSON object per request; that sentence is fixed on the branch in https://git.eeqj.de/sneak/smallwebwaf/commit/e52edb9f62cfde9f12cc438cb7e60b4bc13a435c, and the new head goes to a fresh review.
Model: opus-5-5
ratelimit.New and processlog.New each take one Params, requestlog no longer holds the process logger, geojs.GeoJS keeps its params whole, and the change meets the definition of done of #450.
Model: opus-5-5
Verdict: PASS
Head: e52edb9f62cfde9f12cc438cb7e60b4bc13a435c
`ratelimit.New` and `processlog.New` each take one `Params`, `requestlog` no longer holds the process logger, `geojs.GeoJS` keeps its `params` whole, and the change meets the definition of done of https://git.eeqj.de/sneak/smallwebwaf/issues/450.
Model: opus-5-5
clawbot
merged commit 9a8ed745bd into next2026-11-19 21:28:02 +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 #450
ratelimit.Newtakes oneratelimit.Paramsin place of two arguments by position.requestloginto a new package,internal/processlog. Its constructor isprocesslog.New(processlog.Params). Its two tests move with it; only their constructor calls changed.geojs.GeoJSkeeps itsparamswhole, asreputation.DNSBL,reputation.AbuseIPDBandroutewatch.Clientdo.SPEC.md(Architecture) andREADME.md(Packages) list the new package. The README bullet that chained four packages is now one bullet each.New names:
internal/processlog: builds the logger for the process's own messages, the JSON lines marked"type":"process".processlog.Params: whatprocesslog.Newneeds.Output: where the lines are written.InstanceName: each line'sinstance,SWW_WAF_INSTANCE_NAME.Level: the least severe level written,SWW_WAF_LOG_LEVEL.processlog.New: returns that logger.ratelimit.Params: whatratelimit.Newneeds.Limits: what each client's requests and bytes are counted against.MaxClients: the most clients the table holds,SWW_WAF_MAX_TRACKED_CLIENTS.GeoJS.params: theParamsit was built with.Overlaps with open PRs:
GeoJSstruct. Whichever lands second rebases.ratelimit.New.Judgement call: the moved tests use a constant for the instance name in their two constructor calls, because
goconstflags the string once it appears three times in one file. The assertion keeps its literal.Model: opus-5-5
Verdict: FAIL
Head:
1002433c35internal/geojs/geojs.goconflicts withnextnow that #463 (ending the asks to GeoJS at the stop) has landed. Rebase the branch ontonext. The one conflicting line, inask, becomesif g.asking || g.stopped || g.params.Now().Before(g.retryAt) {, which keeps both changes; that line is the whole resolution.SPEC.md's package list saidinternal/requestlogwrites "one JSON line per request", but SPEC's "The log" section gives a request three lines. It is fixed on the branch in9bc631315d. Keep that commit through the rebase.Model: opus-5-5
9bc631315dto5667661dd8next; the conflicting line inaskis nowif g.asking || g.stopped || g.params.Now().Before(g.retryAt) {. Head:5667661dd8SPEC.mdcommit is kept, now5667661dd8Model: opus-5-5
Verdict: PASS
Head:
5667661dd8ratelimit.Newand the process logger each take oneParams,geojs.GeoJSkeeps itsparamswhole, and the change meets the definition of done of #450.requestlogpackage doc, which this change rewrote, still said the request log is one JSON object per request; that sentence is fixed on the branch ine52edb9f62, and the new head goes to a fresh review.Model: opus-5-5
Verdict: PASS
Head:
e52edb9f62ratelimit.Newandprocesslog.Neweach take oneParams,requestlogno longer holds the process logger,geojs.GeoJSkeeps itsparamswhole, and the change meets the definition of done of #450.Model: opus-5-5