Repository navigation
fix(scoring): 口径常量下沉 core + repositories 逆向依赖门禁 + 前端口径镜像门禁 (#113 #112) - #123
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
两个技术债 issue 一次收口,各配一道机器门禁(防线在门禁不在 issue 状态):
#113 分层逆向 import 清剿
scoring_caliber.py/tag_normalization.py(两个零依赖口径单一事实源模块)从app/services/搬app/core/,11 处 import 跟改;content_repo.py三处逆向 import(:598/:870/:912)全部消除check_layering.py新规则:repositories 禁止 import app.services(AST 全扫,函数体内局部 import 同样抓——content_repo 存在 repositories→services 逆向 import(分层既有违例) #113 的违例全部藏在函数体里);analysis_repo.py仅剩两个评分编排 import 进显式 allowlist(引用 analysis_repo 评分编排上移 services(清空 layering allowlist) #122,只减不增棘轮)tests/test_check_layering.py(8 例)+ AGENTS.md §2.2 同步#112 前端口径镜像门禁
scripts/check_scoring_mirror.py:对比recommendation.ts镜像数字 82/45 与 CONFIG;RISK_HIGH=75是前端自创展示档位(后端无对应),行内强制带「前端自有」标记——标记被删也红,动豁免必须是有意识的决定scoring-mirror(七项检查);make lint链新增scoring-mirror目标;recommendation.ts注释补锁死说明(代码零改动)tests/test_check_scoring_mirror.py(7 例)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—— 全过Verifier verdict
纯结构移动 + 门禁新增,无行为变更:CONFIG 数值与内容零改动(git 记录 rename 100%),全量后端测试与前端测试绿即行为等价证据。两道新门禁的杀/放路径均有回归测试与真实触发记录。
Closes #113
Closes #112