fix(web): use const for unused-reassign inference ledger receipt
The staging quality gate already passed 2006 frontend tests, then ESLint failed on prefer-const in the BUG-367 test helper. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5531,6 +5531,22 @@
|
||||
- 复发自:无
|
||||
- 修复版本:未修复
|
||||
|
||||
## BUG-370 | staging 质量门测试全绿后被 prefer-const ESLint 挡住
|
||||
|
||||
- 状态:resolved(本地修复,待提交与发布)
|
||||
- 首次发现:2026-08-25
|
||||
- 最近更新:2026-08-25
|
||||
- 影响面:Gitea `backend-quality-gate.yml` validate 的 `npm run lint --prefix frontend`、`frontend/tests/rectification-inference-machine.test.ts`、staging 发布
|
||||
- 用户现象:向 `staging` 推送 `76743683` 后 quality gate run `2057` 失败。前端测试 2006/2006 通过,随后 lint 以 exit 1 结束。`publish` 未构建镜像。
|
||||
- 触发条件:`npm run lint --prefix frontend`。推断 ledger 测试夹具用 `let engineReceipt` 且从未再赋值。
|
||||
- 根因:BUG-367 引入的 ledger helper 写成 `let`,`prefer-const` 报 error。BUG-369 只修了测试合同,没有跑 lint。既有 16 条 warning 不阻断;这一条 error 会。
|
||||
- 修复:改为 `const engineReceipt`。不改生产代码,不放宽 ESLint。
|
||||
- 验证:对该测试文件跑 `eslint` 与 `tsx --test`。
|
||||
- 防复发:生时纠正合同改动在推 staging 前必须跑 `npm run lint --prefix frontend`,不能只跑聚焦测试。
|
||||
- 相关记录:BUG-339、BUG-367、BUG-369
|
||||
- 复发自:BUG-339(质量门在测试之后跑 lint;本次是 `prefer-const` 而不是 effect setState)
|
||||
- 修复版本:待发布
|
||||
|
||||
## BUG-369 | staging 质量门 2003/2006:计费合同、思考轨迹与业务表清单未跟上 367/368
|
||||
|
||||
- 状态:resolved
|
||||
|
||||
@@ -553,7 +553,7 @@ function createLedger(seed: ReturnType<typeof buildInferenceState>) {
|
||||
const rows: LedgerRow[] = [];
|
||||
const evidenceFp = "e".repeat(64);
|
||||
const caseId = "case-1";
|
||||
let engineReceipt: Record<string, unknown> = { inference_state: seed };
|
||||
const engineReceipt: Record<string, unknown> = { inference_state: seed };
|
||||
return {
|
||||
evidenceFp,
|
||||
append(input: {
|
||||
|
||||
Reference in New Issue
Block a user