docs(perf_gate): drop the stale file count from the gate header - #309
Merged
Merged
Conversation
The header listed its first positive control as asserting that the scan "found 4 files", but the roster it describes holds five entries and the assert that pins the roster reads five (assert_eq!(FILES.len(), 5, "应扫描 5 个路由文件")). The two numbers agreed when 93b2ebd wrote both; 199566c added sharing.rs to FILES and updated only the assert, leaving the header behind. The count is already owned by that assert, so restating it in the header is a second carrier of one fact that can drift unnoticed: drop the number and point at the mechanism instead of refreshing it.
8 tasks
argszero
added a commit
that referenced
this pull request
Sep 27, 2026
… claims (#310) The i18n section of ui/README.md described counters and guard states the code has moved past: a reader today learns numbers the gates no longer report and reads about a missing guard that in fact exists. - The pack size was frozen as "806 keys x2". That was true when 5183e41 (#249) wrote it; the positive-control constants in src/i18n_pack.rs own the real value now and fail loudly whenever the packs change. - The next line restated three more counts at once — "431 T() literals", "305 data-i18n*", "681-key union". The first two came from 818ed88 (#248) and fcff194 (#170); the 681 has no owner at all, neither a constant nor the smoke-test file it names. - The nested-data-i18n A/B note claimed orphan keys were unguarded ("today nobody guards them, 60-odd unreachable keys"), but every_pack_key_reaches_a_consumer landed two PRs later (a4cb622, #266), so the competing fix m_drop_parent is in fact rejected today: it makes the key unreachable while the sunset list stays put, and that gate compares the two exactly. The note also contradicted the section below it, which documents that very gate. - In the same section, shrinking the sunset list was still described as a follow-up round, although 77b2a82 (#270) landed it. A number a gate already owns is a second carrier of one fact, and restating it is how this drift happened; so the counts are dropped and the text points at the mechanism instead — the same treatment 45510ba (#309) gave the perf-gate header. The 681 is simply removed, since nothing carries it. No gate is added for prose: this repository has already ruled that documentation claims are corrected as data, not fenced in by a new test.
This was referenced Sep 27, 2026
argszero
added a commit
that referenced
this pull request
Sep 28, 2026
`ui/README.md`'s "设置 / 管理 / 运营布局约定(v1.22)" section still calls the operator overview's key card "上游 key 健康" and lists its three pills as "健康 / N 个异常 / 全部失败". That was true when `7d9b56e` (PR #174) wrote the line; C2158 (#269, `e5ee178`) then renamed the card and rewrote the pills, because the data has no health signal at all — `/api/ops/runtime` only returns `total` / `on` / `off`. #269 updated only the section it added itself further down this same file (`:1080`, which says the opposite), leaving this line behind, and its edit sheet (4 files / 7 edits) never listed it. Correct the wording to what the code ships: the title is `ops.keys.title` ("上游 key 状态") and the pills are `ops.keys.allOn` / `someOff` / `allOff` ("全部启用 / N 个停用 / 全部停用"). No gate: this is prose restating an implementation name, and the repo's standing decision for that axis is to fix the data, not to guard the prose (see PRs #309, #310, #312–#315). Verified on the branch tree: `cargo test` 417 passed / 0 failed (unchanged baseline), `cargo fmt --check` and `cargo clippy --all-targets -D warnings` both clean. The other claims on the same line were re-checked and are still true (`version` ← `env!("CARGO_PKG_VERSION")`, the five `uptime_*` fields, `split_uptime`, `fmtUptime`'s top-two-nonzero units, `ops.uptime.*`, `today_hours` zero-filled 0–23). The one remaining occurrence of the old wording (`:1084`) is the C2158 section quoting it as history and is left untouched.
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/perf_gate.rs's module header described its first positive control as asserting that thescan "found 4 files". The roster it describes holds five entries, and the assert that
pins the roster reads five — the same file already says so one screen further down:
So the header advertised a positive control that no longer exists in the shape it describes.
The numbers agreed when
93b2ebd(#234) wrote the module;199566c(#243) addedsharing.rsto
FILESand updated only the assert, leaving the header behind.Changes
src/perf_gate.rs: drop the count from that header clause and name the mechanism(
FILES.len()compared against the expected value) instead of restating a number.Refreshing
4→5was the other option and is deliberately not taken: the count is alreadyowned by the assert, which fails loudly when the roster changes. A header restating it is a
second carrier of one fact that can drift again unnoticed — which is exactly what happened here.
This follows the repo's existing treatment of stale counts in gate comments (see #180,
docs(i18n): drop the stale per-update count log from the gate comment).Comment-only; no behaviour, no test, no roster change.
Sibling gates re-checked in the same family
src/table_gate.rs— header says 7 tables / 7 empty states / 7 failure states; the roster holds7 and its asserts derive from
TABLES.len(). Consistent, left alone.src/body_limit_gate.rs— header says "≥ 20 files"; the assert isfiles.len() >= 20.Consistent, left alone. (Its "今日 0 处" note is explicitly scoped as a known limitation.)
Related Issue
None — no open issue covers this (the repository currently has no open issues).
Changes
Tests
cargo test全部通过 — 409 passed; 0 failed (Finished, 18.88s)cargo fmt --check通过 — exit code 0controls (
FILES.len() == 5, per-file closed-range counts) are unchanged and still greenAlso ran
cargo clippy --all-targets -- -D warningslocally: exit code 0.Checklist
fix/perf-gate-file-count-claimdocs(perf_gate): …