gapfill G3: unify all 5 private row_get onto peer_messages.row_get (approvals, automations, marker_tools, todos, wait_ops; resident import retargeted); semantics identical on None/dict/sqlite3.Row, identity tests added

This commit is contained in:
host committed 2026-11-04 09:06:27 +00:00
1 parent 5ca642c86e
commit aa6179b5e1
7 files changed
+58 -52

No files matched your search

+1 -10
View File
@@ -74,6 +74,7 @@ import json
import time
import uuid
from cloud.peer_messages import row_get
from cloud.timeouts import APPROVAL_DEFAULT_SECONDS as _APPROVAL_DEFAULT
from cloud.timeouts import expires_at_for as _expires_at_for
from cloud.timeouts import resolve_module_timeout as _resolve_timeout
@@ -86,16 +87,6 @@ MAX_SUMMARY_CHARS = 2000
MAX_DETAIL_CHARS = 20000
def row_get(row, name):
"""行取值容错:sqlite3.Row 缺列报 IndexError、dict 缺键报
KeyError、空行报 TypeError,一律回 None(与 peer_messages
的同名函数同款,模块独立所以这里自带一份)。"""
try:
return row[name]
except (KeyError, IndexError, TypeError):
return None
def ensure_approvals_table(conn):
"""幂等建审批队列表。调用方负责 commit(服务端入口在写
操作后统一 commit;本函数自己不 commit,避免半截事务)。"""