Repository navigation
fix(core): structure_service 业务异常回执 + 写入前可读尺寸校验 - #1150
Closed
STARDUSTLC666 wants to merge 3 commits into
Closed
STARDUSTLC666 wants to merge 3 commits into
STARDUSTLC666 wants to merge 3 commits into
Conversation
- event_history/structure_history:limit 必须是 1..200 整数(bool 也拒), before_rowid/before_revision 必须是正整数或 None;不再让 SQLite 类型序把 字符串游标判为恒真(静默回第一页)、NaN 绑 NULL、超大整数 OverflowError。 - get_proposal/target_status/approve/review 的 id/aggregate_key 过 _text; review(note=None)、propose(event_id='')、record_version_result(instance_id=123) 等不再穿透成 sqlite3.IntegrityError/ProgrammingError。 - load_service 的 grant 解析提取为 _parse_grant:capabilities/instances 必须是 字符串数组;字符串不再被 frozenset() 拆成单字符集(授权面反转),缺字段/ 非数组启动即拒(fail-closed)。 - 新增 tests/test_issue1107_structure_service_validation.py:24 断言 + 3 定点变异; 基线 2/24、修复后 24/24;structure 相关回归 49 passed / 2 skipped。
- dispatch 捕获 OverflowError/RecursionError(都不是 ValueError 子类)并转 WriteError;_receive 捕获深层 JSON 的 RecursionError、非法 JSON;_send 捕获深层响应的 RecursionError——不再让业务异常穿过 handler 静默关连接。 - structure_writer 新增 _require_readable:record_event/propose 在事务内按 读取视图估算响应尺寸,超过 MAX_RECORD_BYTES(1 MiB − 4 KiB)即 WriteError 并回滚,保证「可写入集合 ⊆ 可读出集合」。 - 新增 tests/test_issue1106_structure_service_bounds.py:10 断言 + 3 定点变异; 基线 2/10、修复后 10/10;structure 回归 49 passed / 2 skipped。
Owner
维护侧处置(值守第 147 轮)你的修复已采纳并以镜像方式合并:PR #1155(合并提交 0c1ca2e)——三处异常边界与 _require_readable 均为你的净增量原样(署名与致谢见 #1106 关闭帖)。 未直接合并 #1150 的原因:你的分支基线早于维护侧 #1138/#1143/#1146/#1153/#1154,直接合并会回退已合工作——已按净增量摘取重放到最新 main 之上。 本端读数:你的守卫在镜像分支 10/10;基线 3 钉红(鉴别力);structure 邻接 33 passed 无回归;CI 4/4 绿。 感谢高质量修复——「合法 JSON 触发 OverflowError」的现象甄别与「写入前按读取视图校验尺寸」的对称性修法都很到位。 |
Owner
|
净增量已镜像合并(PR #1155,0c1ca2e)——本 PR 关闭以避免与已落地内容重复。感谢贡献。 |
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.
修复 #1106(high×2,
core/structure_service):改了什么 / 为什么
dispatch捕获OverflowError/RecursionError并转WriteError(两者都不是ValueError子类,旧 handler 的except (WriteError, ValueError, UnicodeError)接不住,连接被静默关闭,客户端只收到 EOF)。_receive捕获深层 JSON 的RecursionError与json.JSONDecodeError;_send捕获深层响应的RecursionError,统一返回结构化错误回执。structure_writer新增_require_readable:record_event/propose在事务内按读取视图估算响应尺寸,超过MAX_RECORD_BYTES(1 MiB − 4 KiB)即WriteError并回滚——保证「可写入集合 ⊆ 可读出集合」。验证方式与读数
3552ec3occurred_at时区越界具名反面对照(--mutate)
dispatch的except (OverflowError, RecursionError)⇒ A01 + E02 红。_require_readable([item], "event")⇒ B01 + E01 红(大 payload 写入成功)。_receive的RecursionError捕获 ⇒ A02 红。三条变异各自恰好命中期望红集;变异后源码字节级还原。
边界与不做项
_send会返回小错误回执,不再静默断连)。dispatch/_receive/_send与 writer 事务回滚);全量 CI。Fixes #1106