Skip to content

docs(ui): name the operator card the way the code names it - #319

Merged
argszero merged 1 commit into
mainfrom
docs/ops-card-name-in-the-ui-readme
Sep 28, 2026
Merged

argszero merged 1 commit into
mainfrom
docs/ops-card-name-in-the-ui-readme

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

ui/README.md's "设置 / 管理 / 运营布局约定(v1.22)" section still describes the
operator overview's key card with the wording C2158 replaced:

…与上游 key 健康 .mini-list(key_health 按厂商聚合 total/on/off,三态 pill:健康 / N 个异常 / 全部失败)…

That sentence was true when it was written (7d9b56e, PR #174). C2158 (PR #269,
squash e5ee178) then renamed the card 上游 key 健康 → 上游 key 状态 and rewrote the
three pills 健康 / {n} 个异常 / 全部失败 → 全部启用 / {n} 个停用 / 全部停用, because the
data carries no health signal at all — /api/ops/runtime only returns total / on / off
(off = total − on), so a user pausing their own key (a normal action) was being rendered as a
red failure state.

#269 changed the key names, both language packs, the static fallback in ui/index.html and the
render site in ui/js/app.js — and added a new section to this very file that says the opposite
(:1080, "后端不产出任何健康信号"). It left this line untouched, and its edit sheet
(4 files / 7 edits) never listed it. So today the document contradicts itself: the old section
promises a card the code no longer ships.

Changes

  • ui/README.md: in the operator-layout bullet, the card is named 上游 key 状态 and its
    three pills are 全部启用 / N 个停用 / 全部停用, with a pointer to the C2158 section below.

One line (+1 / −1). The other claims on that same bullet 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.{days,hours,minutes,seconds}, and
today_hours zero-filled 0–23.

The single remaining occurrence of the old wording (ui/README.md:1084) is the C2158 section
quoting it as history ("这张卡曾把「停用」渲染成…") and is deliberately left untouched —
editing it would erase the record of the defect. Hence a whole-line replacement rather than a
token-level one.

No gate. This is prose restating an implementation name, and the repository's standing
decision on that axis is to fix the data, not to guard the prose (precedents: PRs #309, #310,
#312–#315). No cache-bust token: ui/README.md is not a served asset.

Related Issue

Tests

  • cargo test — 417 passed / 0 failed (unchanged baseline; the change touches no tested byte)
  • cargo fmt --check — clean
  • cargo clippy --all-targets -- -D warnings — clean
  • Independent check that the corrected line agrees with the shipped values: the line contains
    ops.keys.title zh ("上游 key 状态") and ops.keys.allOn / allOff zh values, and no longer
    carries any of the three old pill words. ui/README.md is part of the corpus consumed by
    i18n_pack::every_pack_key_reaches_a_consumer, and that test still passes — the new wording
    introduces no i18n key token.

Checklist

  • 分支命名符合约定(docs/)
  • Commit message 使用 Conventional Commits 格式
  • 单一职责,改动最小化

`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.
@argszero

Copy link
Copy Markdown
Owner Author

✅ LGTM (self-review — allow_self_merge is enabled for this task; GitHub does not let an author approve their own PR, so this is a plain comment).

What I checked:

  1. The claim is reproducible on the branch tree. The corrected line now carries the shipped values:
    ops.keys.title zh = 上游 key 状态, and ops.keys.allOn / allOff zh = 全部启用 / 全部停用. The three
    old pill words (健康 / 异常 / 全部失败) no longer appear on that line.
  2. Provenance is drift, not a choice. git log -L 385,385:ui/README.md shows the line last touched by
    7d9b56e (PR feat(ops): show service version and uptime on the operator overview #174) — not by C2158's PR fix(ui): stop reading a key's status count as a health verdict #269, even though fix(ui): stop reading a key's status count as a health verdict #269 did edit this file. fix(ui): stop reading a key's status count as a health verdict #269's edit sheet
    (4 files / 7 edits) never listed the line, so it was forgotten rather than rejected.
  3. The one remaining occurrence is intentional. ui/README.md:1084 quotes the old wording as history
    inside the C2158 section. A token-level replacement would have erased that record; the change is a
    whole-line replacement, so only :385 moved. Verified: 上游 key 健康 count went 2 → 1.
  4. The rest of the bullet is still true — version ← env!("CARGO_PKG_VERSION"), the five uptime_*
    fields, split_uptime, fmtUptime's top-two-nonzero units, ops.uptime.* (both packs), today_hours
    zero-filled 0–23. Not a stale bullet overall, just one wrong card name.
  5. No gate, by the repo's own standing decision. doc-comment-claims axis = fix the data, not guard the
    prose (precedents docs(perf_gate): drop the stale file count from the gate header #309, docs(ui): stop restating the i18n counters and correct two stale gate claims #310, fix(admin): state the refusal a deleted model now meets, not the old zero bill #312–docs(ui): name only the bump sites, test and hint the code still has #315). ui/README.md is not a served asset, so no cache-bust token.
  6. Corpus interaction checked. ui/README.md is part of the corpus read by
    i18n_pack::every_pack_key_reaches_a_consumer; the new wording adds no i18n key token, and that test
    still passes.
  7. Suite on the branch tree: cargo test 417 passed / 0 failed (unchanged baseline), cargo fmt --check
    clean, cargo clippy --all-targets -- -D warnings clean. PR CI: test / fmt / clippy pass (2m28s) and
    msrv pass (26s).

@argszero
argszero merged commit 0ff829a into main Sep 28, 2026
2 checks passed
@argszero
argszero deleted the docs/ops-card-name-in-the-ui-readme branch September 28, 2026 04:30
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