Repository navigation
fix(格局): 四化加分项按星曜 siHua 判定,不再查不存在的「化X」星名 - #58
Merged
Merged
Conversation
四化挂在 Star.siHua 上,盘上没有叫「化禄 / 化权 / 化科」的星。府相朝垣「命宫见禄」、 阳梁昌禄与机月同梁「再会化科」、杀破狼「三方有化禄或化权」却用 hasStar / sanFangAllStars 按星名查,永远查不到,这几条加分项从未出现过(1990 年逐日午时 扫盘:杀破狼 61 盘、机月同梁 44 盘、阳梁昌禄 7 盘本该带上加分项)。 改为与同文件双禄朝垣、三奇加会一致的 siHua 判定;只影响加分项展示, 不改格局成立与否、不改等级、不改排盘结果。新增回归 patterns-sihua-bonus。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
审查验证记录(第三方核对)逐行核对 + 本地完整重建仓库实跑,结论:推荐合并。 核对过程
一个非阻塞注意点
不阻塞合并。 |
|
@Renhuai123 @kjgggggg 审查验证已完成,结论:通过,建议合并(详细核对记录见上一条评论)。 要点:
@Renhuai123 合并需要仓库写权限,请点 Squash and merge。 |
kjgggggg
force-pushed
the
fix/patterns-sihua-bonus
branch
from
October 29, 2026 04:24
1874b27 to
1d43320
Compare
# Conflicts: # package.json
# Conflicts: # package.json
Owner
|
非常感谢!诊断准确,四化挂在 |
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.
改了什么、为什么
lib/ziwei/patterns.ts里有 4 处加分项按星名查四化:hasStar(ming, '化禄')sanFangSet.has('化科')sanFangSet.has('化科')sanFangSet.has('化禄') || sanFangSet.has('化权')可四化是挂在
Star.siHua字段上的({ name: '天机', siHua: '科' }),盘上从来没有叫「化禄 / 化权 / 化科」的星,所以这几条加分项从来不会出现。同一个文件里的双禄朝垣、三奇加会、化禄入命等用的都是s.siHua === '禄',这 4 处跟它们不一致。这次加了两个小工具函数
palaceHasSiHua/sanFangHasSiHua,把这 4 处改成按siHua判断。只影响格局卡片 / 命盘摘要里显示的加分项:格局成不成立、等级(等级只看破格项)、排盘结果都不变。影响面:1990 年逐日午时男命扫一遍,本该带上加分项、修之前却没有的盘:杀破狼 61 张、机月同梁 44 张、阳梁昌禄 7 张。
自查
npm test,全部通过(含新增回归);npm run typecheck里新改的文件没有报错(说明见下)scripts/regression/patterns-sihua-bonus.test.ts,已登记到package.json的test回归测试的做法:1990 全年逐日午时排盘,对上面四个格局逐盘断言「加分项有没有出现」要和「三方四正 / 命宫里有没有带对应 siHua 的星」一致,并且要求每个格局至少触发一次。在旧代码上跑,第一张盘就断言失败(
1990-01-02 午时 杀破狼「三方有化禄或化权(动得有力)」应为 true)。patterns.ts里有import 'server-only',可这个包不在依赖里(Next 构建时才有)。所以测试先用module.registerHooks把它解析成空模块,然后再 import。registerHooks要求 Node 22.15+,CI 用的是 Node 22,我在 Node 22.23.4 和 24.22.0 上都跑通了。🤖 Generated with Claude Code