Skip to content

docs(perf_gate): drop the stale file count from the gate header - #309

Merged
argszero merged 1 commit into
mainfrom
fix/perf-gate-file-count-claim
Sep 27, 2026
Merged

argszero merged 1 commit into
mainfrom
fix/perf-gate-file-count-claim

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

src/perf_gate.rs's module header described its first positive control as asserting that the
scan "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:

const FILES: &[(&str, &str)] = &[ /* wallet.rs, ops.rs, admin.rs, org.rs, sharing.rs */ ];

assert_eq!(FILES.len(), 5, "应扫描 5 个路由文件");

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) added sharing.rs
to FILES and 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 → 5 was the other option and is deliberately not taken: the count is already
owned 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 holds
    7 and its asserts derive from TABLES.len(). Consistent, left alone.
  • src/body_limit_gate.rs — header says "≥ 20 files"; the assert is files.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

  • 功能/修复说明 — the stale claim in the gate header is removed; nothing else touched
  • 涉及配置/数据结构的改动已同步示例文件 — n/a, no config or data structure touched

Tests

  • cargo test 全部通过 — 409 passed; 0 failed (Finished, 18.88s)
  • cargo fmt --check 通过 — exit code 0
  • 新增/更新了单元测试(如适用) — n/a, comment-only change; the gate's own positive
    controls (FILES.len() == 5, per-file closed-range counts) are unchanged and still green

Also ran cargo clippy --all-targets -- -D warnings locally: exit code 0.

Checklist

  • 分支命名符合约定(feat/ /fix/ /docs/ ...) — fix/perf-gate-file-count-claim
  • Commit message 使用 Conventional Commits 格式 — docs(perf_gate): …
  • 单一职责,改动最小化 — 1 file changed, 3 insertions(+), 3 deletions(-)

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.
@argszero
argszero merged commit 45510ba into main Sep 27, 2026
2 checks passed
@argszero
argszero deleted the fix/perf-gate-file-count-claim branch September 27, 2026 11:24
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.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant