Repository navigation
fix(config): reject a zero frame-memory budget or per-IP cap (#996) - #997
chappie-daemon wants to merge 8 commits into
Conversation
…it as the default
… the sentence it replaced
🦋 Changeset detectedLatest commit: d0d8a3f The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
[Medium impact] The PR appears safe to merge; no actionable issues were found.
|
Coverage Report for CI Build 40183229062Warning No base build found for commit Coverage: 73.979%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats💛 - Coveralls |
#989 gave
0a new meaning — use the compiled default — and enforced it with a test. That was the wrong answer, and this PR reverses it: a stated0is a validator issue on both keys, and absent is the only route to the default.The record says so itself. The ADR's own predecessor text is "A zero budget or a zero cap is a literal the operator wrote; policing it is a settings decision this job does not own" — a sentence written against the default reading, and a deferral this PR spends.
Closes #996. Stacked: base is #995's branch, which bases on #990 — see the end.
Why rejection, not fallback
A
0meaning default is a fourth meaning for a numeral that already carries two here: disabled (limits.client.subscription,if max_subscriptions > 0) and invalid (the adaptive-pow numbers). These two bounds belong to neither — a zero budget or a zero cap is a relay that cannot serve.And rejection is the only option whose failure is loud and early. The app names the key and refuses the file:
A fallback turns a typo —
0where1048576was meant — into a relay that budgets 256 MiB and says nothing, leaving the operator to infer it from a reading of a file they did not write.What changed
from_settings> 0guard goes; a present value is used as written,Noneis the compiled defaultvalidate_documentperiodMs/targetEventsPerSecondshape, one per keyBoundRefusal::ZeroAboveCeilingare byte-identical to base## What 0 means, bothCONFIGURATION.mdrows, the two YAML comments, the guided labelsOne subtlety worth the reviewer's time: the first attempt guarded the new rules on
to_number, which mapsnull,falseand"0"to0.0— so those documents printed two issues for one key. The rule now enters only on a JSON number, and a string, a null,abcand a boolean each print the shape message alone. Both doors agree.The three surfaces, measured
--check: the issue, thensettings invalid: N issues, exit 2.continuing on the shipped defaults (N issue(s) in the user settings), exit 0 — an operator is told their relay is up and on which numbers.config validate: the issue, then the invalid verdict, exit 2.These are the sentences the ADR carries, one bullet each, anchored to the lines that print them.
Verification
All five repository commands green;
validator59,config_defaults8,check_flag9,settings_gate3,config_cli7; workspace 940 tests over 57 targets, 0 failures. Per-key mutation: each rule removed alone fails only its own test.BoundRefusal::Zeroand0 means the defaultare gone from the tree. Nine protected paths —sink.rs,connection_cap.rs,settings.rs,ts_parity.rs,ts-issues.json,nostreamd/src/main.rs,acceptor.rs,settings_gate.rs,nostream-cli/src/config.rs— have an emptygit diff --statagainst the base.Two disclosures
The ADR quotes a base that no longer exists here, and says so. Reason 1 quotes
0008:369-371as superseded — those are the base tree's lines, resolved withgit show 60aa7e9:<path>, and the text is marked as the position this PR replaces. The sentence being restored is quoted from7f16351:228-229, where the ADR first wrote it. Both were read back verbatim against their trees by hand; the audit tools resolve line numbers, not meaning.scripts/citation-meaning.py— added by #995 — cannot resolve a bare filename, so five citations in this document needed a path prefix to keep it green. That is a tool limitation recorded rather than fixed here; the prefix is correct for a reader anyway.What this $1.03 is the price of
This job exists because a policy answer arrived after #989's build had started: 017 shipped
0as use the compiled default and enforced it with a test, and the operator rejected thatduring review. The change here is 60 lines and one ADR paragraph; the cost is a sequencing
failure, not a large change. The rule recorded for both sides of the queue: a manager checks the
queue for an existing answer before asking, and an operator checks the job's stage before
answering a question it has already moved past — a policy answer that lands after the build is a
new job.
Base
This PR bases on
factory/017-frame-budget-settings(#995), which bases onfactory/016-frame-memory-budget(#990). Merge order is #990 → #995 → this, and nothing retargets automatically — GitHub moves a pull request only when its base branch is deleted:Each step: retarget, then rebase if the merge added anything.