fix: push@c559ab4 SOLID 审查补丁 — economy SQL/? 绑定 + service 契约对齐#14
Closed
cursor[bot] wants to merge 3 commits into
Closed
fix: push@c559ab4 SOLID 审查补丁 — economy SQL/? 绑定 + service 契约对齐#14cursor[bot] wants to merge 3 commits into
cursor[bot] wants to merge 3 commits into
Conversation
sql-template-strings 插值表名会变成 FROM ?,触发 near "?": syntax error, 导致新注册的 economy.* handlers 全部不可用。表名改为信任常量嵌入 SQL, 值继续参数化。 同时修正 dailyTasks.list/submit 与消费方契约(LSP),以及 DispatchError 透传 domain status,避免 insufficient_funds 等被压成 500 internal。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
dispatch 已允许提供方调自己的 service 免 requires,但 TxRunner.doService 在进 dispatch 前硬拦,导致 HTTP service.get 与 tx.call 契约不一致(DRY/LSP)。 通过 getProvider() 共用提供方身份判断。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
- feature-chat:@sfmc/types → @sfmc/sdk/contracts(权威类型源 DRY) - claimRedPacket/land-transfer:不再在 db.tx 录制器回调内按 get 结果分支 - core-gui:声明 requires feature-land-gui(与 MainMenu 实际 import 对齐) Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
This was referenced Jul 22, 2026
Member
3 tasks
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.
背景
审查
mainpusha254973..c559ab4(feature-chat v2 / economy service bridge / 删除 v1 路由 / host-config 合并 / 外迁 afk 等 4 模块)。ootbCI 对本 push 已通过;本 PR 修的是本轮引入/恶化的 DRY · OCP · DIP · LSP · LoD 高置信运行时契约问题。与已有 #13(config
?moduleId=+ service HTTP 权限门)互补,不重复其改动。已修复
domain/economy.ts用SQL\...${TABLE}...`把表名绑成?→near "?": syntax error`,新注册的 7 个 economy handlers 全挂?绑定economy.dailyTasks.list返回裸数组、submit丢ok,与feature-daily-task消费契约不一致;业务失败抛 Error → 500,物品已扣却无法走!ok退还{tasks};submit→{ok,...};领域失败DispatchError保留 statusServiceRegistry允许提供方自调用免 requires,但TxRunner.doService在进 dispatch 前硬拦getProvider()+ 同款自调用跳过feature-chatimport 不存在的@sfmc/types@sfmc/sdk/contractsclaimRedPacket/land-transfer在db.tx录制器回调内按tx.get结果分支(恒 null)db.get校验后再录写步骤core-gui实际 importfeature-land-gui但 requires/catalog 未声明仍未修(需更大改动,见 #13 报告)
installHostBootstrap仍不注入set*ModuleContext→ v2 db/service 鉴权端到端未通db.tx录制器语义本身(call→undefined)index.ts硬编码接线/api/sfmc/economy/*路径(且路径形态本就与历史 v1 路由不一致)——等 module-auth 注入后再迁service.get验证
npm run build --workspaces --if-present通过ensureEconomyAccount/ credit / insufficient_funds(409) / dailyTasks 信封 / DispatchError 透传 OKnode tools/check-catalog.js→ OK (15 modules)