refactor(tuning): return seven drifted numbers home and pin the arrangement #835
No reviewers
Labels
No labels
move-to-repo
coilyco-bridge-deploy
move-to-repo
coilyco-flight-deck-agent-compose
move-to-repo
coilyco-gaming-eco-app
move-to-repo
coilysiren-inbox
move-to-repo
unknown
🔒⚠️📦⚠️🔒 SANDBOXED 🔒⚠️📦⚠️🔒
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
c#
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-gaming/sirens-echo!835
Loading…
Reference in a new issue
No description provided.
Delete branch "aos/claude/bk79-numeric-config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #829. Kai answered the open question from the first version: all of it in
config.go, all of it through one helper. Both halves are done.One file
tuning.gois gone. Its numbers live inconfig.gobeside what the deployment supplies.TestEveryTuningNumberLivesInConfigGoholds the arrangement, andTestEveryNumberInConfigGoIsInTheTablecatches a number declared in the file that skipped the helper.One helper
Every number is declared on one line binding three things:
The helper is generic over the two shapes a number takes here, a count and a duration, so a count is as settable as a timeout and neither gets a parser of its own. 72 knobs, up from 8.
The second hand-maintained table of pointers is gone. Adding a number to the table is now the only way to add one, which is what keeps the list complete, and
TestEveryKnobStartsOnItsDeclaredDefaultreads each variable back to confirm the declared default is the one it holds.One behaviour, where there were two
REQUEST_TIMEOUT,QUEUE_TIMEOUT, andSHUTDOWN_GRACEwere parsed a second time to fill aConfigfield. That second reader refused a bad value and failed the load while the table applied one silently - one name, two readers, two answers, which is the false claim the first version of this PR found in the doc.Confignow takes what the knob pass produced, so a bad value keeps the default everywhere. Silence there would read as a working override, so applied and rejected names are reported on thecapabilitieslog line at startup.The list is generated, not maintained
Seventy-two names cannot live in prose without going stale, and the workspace rule is to derive an inventory from its owner rather than keep a second copy.
ward exec knobswritesdocs/sirens-echo-knobs.mdfrom the table;ward exec knobs-checkand a unit test both fail when it is stale. The prose page explains the mechanism and links it.Two carve-outs, both narrower than before
Three derived values.
turnProgressEvery,turnLongReplyAfter, andreplyAttachmentBytesare expressions of another number, so they are set by setting their input and recomputed after the overrides land. A test drives all three.Two algorithm floors.
minNormalizedIDDigitsandminEncodedGuardBytesdecide what counts as an identifier rather than how much of one to allow. They are not configuration and no name reaches them.maxProxyToolNameBytesis no longer exempt. The previous version grouped it with those two as a security floor. It is a bound on a served tool name, not a floor on what counts as a match, and it lived intuning.gounder that file's own rule. It is a knob now. If you disagree, that is one line to put back.Worth saying plainly
Some of these are Discord's numbers rather than ours - the command-shape bounds, the history page size, the reply limit. Raising one past what Discord accepts fails at Discord as a rejected send rather than here as a startup error. They are settable because everything is, not because moving them is a good idea, and the doc says so where an operator reads it.
Verification
ward gatePASS on all six steps, on the rebased tree.go test -raceclean, which matters more than it did: seventy-two package globals are now written by the knob pass, so the override tests restore the defaults throught.Cleanuprather than by hand.The int-shaped numbers stopped being untyped constants, so seven call sites that fed them to
io.LimitReader,http.MaxBytesReader, or anint64comparison gained an explicit conversion.internal/community/config.go, with the classic env var override, update READMEmd to point at that file #829e2e03671e9ffa9cfbf90given to an engineer just now
internal/community/config.go, with the classic env var override, update READMEmd to point at that file #829