审查 + 修复:v2 模块协议重构高置信 BLOCKER(main@34e658b)#3
Merged
Conversation
审查 main@34e658b 的 v2 平台层/SDK/land·land-gui·afk 迁移。含构建+启动+冒烟+接口运行时验证。结论:存在多个 BLOCKER(鉴权闭环未打通、configs/all 回归 401、db:write:* 权限自相矛盾、tx 结果不可回传、service provider 未实现、land-gui 未登记 catalog),当前尚不符合要求。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
1) v2 路由此前读 req._body(从未赋值)→ 所有 db/config/service 请求体恒空;改为复用已预读缓存的 body(req)。 2) GET /api/sfmc/configs/all 是 SAPI 启动一次性拉配置的旧端点,被 v2 模块鉴权命名空间遮蔽成 401,导致插件端起不来;显式豁免。 3) setModuleEnabled 另读新 lock 副本写盘,但 buildModuleList 读的是启动缓存的 lockFile → 启停后 enabled 不翻转;改为回写共享缓存。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
此前 /db/tx 从请求体取 moduleId:既可持 A 的 token 冒用 B 的权限越权,也导致客户端只发 {steps} 时 moduleId 缺失、事务恒被拒。改为强制 moduleId=auth.id。
Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
run() 开头无条件断言 db:write:*,但该通配无法通过 permission-gate 校验(模块声明它会启动失败),导致所有事务(含只读)恒被拒。删除该断言;读写权限由每个 step 的 requireTableRead/Write 按具体表精确 gate。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
1) finalize() 从未被调用 → 模块表永不落地、insert/query 全部 no such table;改为 define 即幂等建表(碰撞检测已按内存表完成)。 2) buildColumnClause 把 _deleted_at/_version 追加进每个列子句且无逗号分隔 → softDelete 表建表 SQL 语法错误;抽出 buildColumnList 在表级追加一次。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
land-gui 已迁 v2 但未登记 catalog → 永不装载、requires 顺序不被约束。补上条目(requires feature-land)。 Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
Tanya7z
marked this pull request as ready for review
July 21, 2026 17:02
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Tanya7z
added a commit
that referenced
this pull request
Jul 21, 2026
Reflects today's 6-session work: - 6 v2 modules now online (added afk, chat-sounds, spawn-protect, feature-area consolidation merging fly+peace+creative+survival+clean) - v2 protocol runtime fixes (PR #3): body parsing, /configs/all auth exemption, tx moduleId spoofing, db:write:* assertion, schema finalize/softDelete SQL, land-gui catalog registration, enabled-flip regression - tools/smoke-modules.js now passes 100% - 15 v1 modules remaining (was 21, minus the 5 consolidated into feature-area and the 1 already at chat-sounds) - Permission regex bug fixed (2-segment service:<name>) - URL normalization finalized; author fields restored to Shiroha7z Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
这是什么
对另一个 agent 推到
main的 v2 模块协议重构(34e658b)的审查,并直接修复了其中高置信度、可端到端验证的 BLOCKER。含一份完整审查报告docs/reviews/v2-module-protocol-review.md+ 6 个源码修复提交(仅改db-server/src与catalog.json,未碰模块业务逻辑)。已修复(附运行时验证)
用「模拟真实模块 · 按
module-auth派生 token」端到端验证:req._body从未赋值)index.tsGET /configs/all被 v2 鉴权遮蔽 401(SAPI 启动必用)index.tsenabled不翻转(读启动缓存 lock)index.ts/db/tx从 body 取moduleId→ 越权 + 事务恒拒db-routes.tsdb:write:*断言恒失败 → 所有事务被拒tx-runner.tsfinalize()从未调用 → 表永不落地;softDelete 建表 SQL 语法错误schema-registry.tsland-gui未登记 catalog → 永不装载catalog.json验证结果
仍未修复(需提交方更大改动,已在报告详述)
tx()录制-回放拿不到服务端生成的 id/结果 → 步骤间依赖失效。land的 12 个provides全是空操作。这三项属于 SAPI 侧/协议级改动,须结合 Bedrock 运行时验证,不在本安全外科修复范围内。另有多个 MAJOR/MINOR(update/delete 按 rowid 定位、软删未过滤读、借贷方向反、land-gui 直查 land 私有表、afk
afterWorldLoad时机、clean-break 残留等)与规则偏离,清单见docs/reviews/v2-module-protocol-review.md。