test(limits): three numbers that are not dials #667

Merged
coilyco-ops merged 1 commit from qa/protocol-limits-are-not-dials into main 2026-08-13 18:23:45 +00:00
Member

#659 proposes moving every numeric constant into tuning.go, and #660 proposes an env override for each. I measured the remaining set on 659: 22 constants outside that file, and five of them are not tuning values at all. They are fixed by a system this service does not own.

Three of the five can be checked. This checks them.

discordReplyLimit     must stay under Discord's 2000
threadNameRunes       Discord refuses a longer name outright
threadArchiveMinutes  auto_archive_duration is an enum, not a duration

The third is the one that matters

60 looks exactly like a dial. 45 is the edit someone makes, and Discord refuses it rather than rounding — so the failure arrives as a thread that will not create, in a guild, rather than as a shorter archive.

That risk is not hypothetical: putting these beside turnProgressEvery in a file called tuning.go, then adding an env override for every value in it, is a direct path to someone setting THREAD_ARCHIVE_MINUTES=45 and finding out from a member.

Mutation checked

Each failure names the external contract rather than the assertion:

1990 -> 2400   discordReplyLimit is 2400 and Discord refuses above 2000. This is not a
               tuning value: raising it makes every long reply fail to send

100  -> 140    threadNameRunes is 140 and Discord refuses above 100, so a thread would
               fail to create rather than get a longer name

60   -> 45     threadArchiveMinutes is 45 and Discord accepts only 60, 1440, 4320 or
               10080. A value between them is refused, not rounded

What this deliberately does not do

It does not move them, and it does not annotate them in place. Where they live is a layout decision on 659 and belongs to whoever takes it. These assertions hold either way — and if the five do move into tuning.go, this is what stops the file's name from making them look adjustable.

maxProxyToolNameBytes = 64 is the fourth of the five and carries no comment saying whether 64 is Agent Proxy's limit or a choice. I have not asserted it, because I would be guessing at the contract. Worth a comment from whoever knows.

Test-only. No production change.

Refs #659, #660

https://forgejo.coilysiren.me/coilyco-gaming/sirens-echo/issues/659 proposes moving every numeric constant into `tuning.go`, and https://forgejo.coilysiren.me/coilyco-gaming/sirens-echo/issues/660 proposes an env override for each. I measured the remaining set on 659: **22 constants outside that file, and five of them are not tuning values at all.** They are fixed by a system this service does not own. Three of the five can be checked. This checks them. ``` discordReplyLimit must stay under Discord's 2000 threadNameRunes Discord refuses a longer name outright threadArchiveMinutes auto_archive_duration is an enum, not a duration ``` ## The third is the one that matters `60` looks exactly like a dial. **`45` is the edit someone makes**, and Discord refuses it rather than rounding — so the failure arrives as a thread that will not create, in a guild, rather than as a shorter archive. That risk is not hypothetical: putting these beside `turnProgressEvery` in a file called `tuning.go`, then adding an env override for every value in it, is a direct path to someone setting `THREAD_ARCHIVE_MINUTES=45` and finding out from a member. ## Mutation checked Each failure names the external contract rather than the assertion: ``` 1990 -> 2400 discordReplyLimit is 2400 and Discord refuses above 2000. This is not a tuning value: raising it makes every long reply fail to send 100 -> 140 threadNameRunes is 140 and Discord refuses above 100, so a thread would fail to create rather than get a longer name 60 -> 45 threadArchiveMinutes is 45 and Discord accepts only 60, 1440, 4320 or 10080. A value between them is refused, not rounded ``` ## What this deliberately does not do **It does not move them, and it does not annotate them in place.** Where they live is a layout decision on 659 and belongs to whoever takes it. These assertions hold either way — and if the five do move into `tuning.go`, this is what stops the file's name from making them look adjustable. `maxProxyToolNameBytes = 64` is the fourth of the five and carries **no comment** saying whether 64 is Agent Proxy's limit or a choice. I have not asserted it, because I would be guessing at the contract. Worth a comment from whoever knows. Test-only. No production change. Refs https://forgejo.coilysiren.me/coilyco-gaming/sirens-echo/issues/659, https://forgejo.coilysiren.me/coilyco-gaming/sirens-echo/issues/660
test(limits): three numbers that are not dials
All checks were successful
ci / image-build (pull_request) Successful in 24s
ci / test (pull_request) Successful in 41s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
d623f2f1b9
sirens-echo#659 proposes moving every numeric constant into tuning.go and
sirens-echo#660 proposes an env override for each. Of the 22 constants still
outside that file, five are not tuning values at all: they are fixed by a
system this service does not own.

Three of those five can be checked, so this checks them:

  discordReplyLimit     must stay under Discord's 2000
  threadNameRunes       Discord refuses a longer name outright
  threadArchiveMinutes  auto_archive_duration is an enum, not a duration

The third is the one that matters. 45 is the edit someone makes believing it
is a dial, and Discord refuses it rather than rounding, so the failure arrives
as a thread that will not create rather than as a shorter archive.

Mutation checked, each naming the external contract:

  1990 -> 2400   discordReplyLimit is 2400 and Discord refuses above 2000
  100  -> 140    a thread would fail to create rather than get a longer name
  60   -> 45     Discord accepts only 60, 1440, 4320 or 10080

Not moved and not annotated in place, because where they live is a layout
decision on 659 and this holds either way. If they do move into tuning.go these
tests are what stops the file's name from making them look adjustable.

maxProxyToolNameBytes is the fourth and carries no comment saying whether 64 is
a fact or a choice, so nothing here asserts it.

Refs sirens-echo#659, sirens-echo#660

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-gaming/sirens-echo!667
No description provided.