test(knobs): find a stray number by shape, not by its name #876
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-gaming/sirens-echo!876
Loading…
Reference in a new issue
No description provided.
Delete branch "aos/claude/hs68-knob-guard"
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?
The sweep in #835 put every drifted number back in
internal/community/config.goand leftTestEveryTuningNumberLivesInConfigGobehind them. This closes the gap in that guard, which is the half of #829 that was not done.The problem
The guard matched a candidate by its name, against
^(max|min|default)[A-Z]and nine suffixes. It reported a stray only when the author happened to spell it one of those ways.That failed twice on the very sweep it was written for. #835's own comment records four of seven numbers found only after its regex was widened. And after the widening it was still silent on one:
A send budget under Discord's 1990-rune interaction bound. A cap by AGENTS.md's own list, outside
config.go, settable by nobody, and named neithermax*nor any of the nine.A pattern that gets widened every time someone names a number a new way is not holding a line. It is describing the names already used.
The change
The guard parses the package with
go/astand reports every package-level numericconstandvaroutsideconfig.go. A number is a stray unlesselsewhereByDesignnames it with a reason. A local inside a function body still never reaches it, which is whyworkers := 1injobrunner.gois not swept up.Verified against the three shapes the old regex could not see, by dropping a probe file into the package and running the test:
All three reported. All three were invisible before. The probe was removed.
mcpsReplyBudgetmoves into the table asSIRENS_ECHO_MCPS_REPLY_BUDGET, defaulting to 1800, anddocs/sirens-echo-knobs.mdregenerates throughjust knobs.The exemptions, and the trade
Inverting the default costs a written reason for every genuine non-knob. There are seven, in three families:
minNormalizedIDDigits,minEncodedGuardBytes,opaqueSecretRunes. Lowering one changes what counts as an identifier or a credential, not how much of a match is allowed.scratchPermissions,scratchFilePermissions,workspacePermissions. Text-only is enforced by denying the execute bit, so a deployment able to grant it could undo the property.unboundedReplyis the absence of a ceiling rather than one.The first two families were already correct; three of them survived on naming luck rather than on a recorded decision. Now they have a sentence a reviewer can disagree with, which is the deliberate half of the trade: an exemption is something someone wrote, where a pattern miss is silence that reads exactly like a pass.
Docs
docs/sirens-echo-knob-guard.mdis new and carries the reasoning.docs/sirens-echo-tuning.mdpoints at it and stays under its line cap.AGENTS.md's Where numbers live gains one sentence, since that is the file agents actually read.No
docs/FEATURES.mdentry: this is validation hardening, which that file's own rule excludes.Not in scope
Step 2 of #361, the collapse. It stays
consultand Kai's, and it is easier to judge now that the inventory cannot be quietly incomplete.just gatepasses: build, policy-check, vet, test, test-skips, pre-commit.closes #829
internal/community/config.go, with the classic env var override, update READMEmd to point at that file #829