From 154a5788b72ee16dab8cf29ec6aa11e94cfe4417 Mon Sep 17 00:00:00 2001 From: argszero Date: Mon, 14 Sep 2026 01:26:56 +0800 Subject: [PATCH] docs(citations): replace stale cross-file line-number citations with symbol references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Comments in three files pointed at `file:line` positions that no longer hold the construct they name, so a reader following the pointer lands on unrelated code. This is the line-number sibling of the `§`-reference drift fixed in C2022/C2023, and line numbers are the more fragile citation form. - ui/js/app.js: the wallet.rs:230-232 / 403-405 / 473 list (the direction CASE expression / signed_pts_expr) now names `TX_INCOME_TYPES` / `TX_EXPENSE_TYPES`, the single source the SQL is rendered from. - src/routes/mod.rs: the ops.rs:101/:175 pair (where `total_txs` is computed and returned) now names `ops.rs::runtime`. - src/i18n_pack.rs: the api.js:66 provenance note is no longer resolvable (api.js was rewritten after C2028), so the line number is dropped. Only stale citations are touched: the five that still resolve (ops.rs:94/103 and the three ui/README.md ones) are deliberately left as the negative control. Comment-only change, no behaviour, no test change (217 passed). --- src/i18n_pack.rs | 2 +- src/routes/mod.rs | 2 +- ui/index.html | 2 +- ui/js/app.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/i18n_pack.rs b/src/i18n_pack.rs index 8d088aa..0a7ea0a 100644 --- a/src/i18n_pack.rs +++ b/src/i18n_pack.rs @@ -934,7 +934,7 @@ mod tests { fn api_js_checker_detects_injected_defects() { let LanguagePacks { zh, en, .. } = packs(); - // ① 中文原文(原封不动地模拟 C2028 修前的 `api.js:66` 那一行)必须被判为违规 + // ① 中文原文(原封不动地模拟 C2028 修前 `api.js` 里的那一行)必须被判为违规 let bad = "throw { status: 0, message: mapErr(\"网络不可用,请检查后端服务是否启动\") };"; assert!( !strip_js_comments(bad).is_ascii(), diff --git a/src/routes/mod.rs b/src/routes/mod.rs index 741cb20..4c9474d 100644 --- a/src/routes/mod.rs +++ b/src/routes/mod.rs @@ -2387,7 +2387,7 @@ mod tests { /// `total_txs` —— 运营概览「交易量」卡的数据源。 /// - /// 这个字段自 `85982e8`(PR #80)起就在算、就在返回(`ops.rs:101`/`:175`), + /// 这个字段自 `85982e8`(PR #80)起就在算、就在返回(`ops.rs::runtime` 内计算并作为 `total_txs` 返回), /// 但**两侧都没有任何断言**:v1.22 的零 mock 重构(`89963f3`)删掉 mock 分支的 /// 那张卡后,前端漏了重接,而这个字段照旧返回,于是谁都发现不了。 /// 本测试把「返回了」与「口径是全库 / 累计全部类型」同时钉住。 diff --git a/ui/index.html b/ui/index.html index a890cc9..e917731 100644 --- a/ui/index.html +++ b/ui/index.html @@ -845,6 +845,6 @@

使用模型

- + diff --git a/ui/js/app.js b/ui/js/app.js index 4d4e62e..e181f60 100644 --- a/ui/js/app.js +++ b/ui/js/app.js @@ -1018,7 +1018,7 @@ // 点数方向由 `type` 决定,不由 `pts` 的符号决定(C2047): // 账本按 type 编码方向,所有生产 writer 都把 pts 存成非负数 —— `billing::settle` 的 // consume 行存正数、随后的 earn 行也存正数(src/billing.rs),符号只表示「数值」,不表示「收支」。 - // 服务端每个聚合都是按 type 判方向(src/routes/wallet.rs:230-232 / 403-405 / 473、src/routes/ops.rs:94/103), + // 服务端每个聚合都是按 type 判方向(src/routes/wallet.rs 的 TX_INCOME_TYPES / TX_EXPENSE_TYPES、src/routes/ops.rs:94/103), // 前端必须用同一约定,否则「消费」在汇总卡里是支出(`expense_pts`)、在明细行里却被渲染成绿色的 `+3.7`。 const PTS_INCOME_TYPES = { earn: true, topup: true, gift: true }; const signedPts = (type, pts) => (PTS_INCOME_TYPES[type] === true ? pts : -pts);