Skip to content

fix(scoring): 口径常量下沉 core + repositories 逆向依赖门禁 + 前端口径镜像门禁 (#113 #112) - #123

Merged
fxbin merged 2 commits into
mainfrom
issue-113-scoring-caliber-to-core
Oct 18, 2026
Merged

fxbin merged 2 commits into
mainfrom
issue-113-scoring-caliber-to-core

Conversation

@fxbin

@fxbin fxbin commented Oct 18, 2026

Copy link
Copy Markdown
Owner

What

两个技术债 issue 一次收口,各配一道机器门禁(防线在门禁不在 issue 状态):

#113 分层逆向 import 清剿

#112 前端口径镜像门禁

  • 新脚本 scripts/check_scoring_mirror.py:对比 recommendation.ts 镜像数字 82/45 与 CONFIG;RISK_HIGH=75 是前端自创展示档位(后端无对应),行内强制带「前端自有」标记——标记被删也红,动豁免必须是有意识的决定
  • CI 新作业 scoring-mirror(七项检查);make lint 链新增 scoring-mirror 目标;recommendation.ts 注释补锁死说明(代码零改动)
  • 回归测试 tests/test_check_scoring_mirror.py(7 例)
  • 方案取舍:接口下发被否决(为一年一变的常量引入 fetch/加载态/失败面不成比例);注释豁免单独不足(漂移只有门禁拦得住)

Verification

  • make test-backend(一次性 PG 容器)—— 1146 个测试,0 失败
  • make layering —— 102 文件双目录通过(api/v1 + repositories)
  • make scoring-mirror —— 通过(开发过程中该门禁先正确红了一次:标记未加;补上后转绿,杀/放路径都被真实走过)
  • cd frontend && npx tsc --noEmit + npm run test:coverage —— 199 全过,覆盖率门禁过
  • uv run ruff check . && ruff format --check(改动文件)+ scripts/check_agent_docs.py —— 全过
  • CI 七项检查

Verifier verdict

纯结构移动 + 门禁新增,无行为变更:CONFIG 数值与内容零改动(git 记录 rename 100%),全量后端测试与前端测试绿即行为等价证据。两道新门禁的杀/放路径均有回归测试与真实触发记录。

Closes #113
Closes #112

@fxbin
fxbin merged commit fc26985 into main Oct 18, 2026
7 checks passed
@fxbin
fxbin deleted the issue-113-scoring-caliber-to-core branch October 18, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant