refactor(core): 清理骨架库与格式适配器并并轨导出回写逻辑

This commit is contained in:
lianjianwei2024
2026-11-08 23:51:38 +08:00
parent dca72bdea4
commit 1869d49bfd
21 changed files with 2386 additions and 1951 deletions

View File

@@ -492,7 +492,10 @@ _QCACHE = {} # (db_path, sid) -> {"mtime": float, "maps": {uw_id: {码:
def _qpath_mt(sc):
"""(库文件路径, mtime);:memory: 路径为空 → 调用方旁路缓存。"""
"""(库文件路径, mtime);:memory: 路径为空 → 调用方旁路缓存。
决策 288 修(2026-11-08):会话库是 **WAL**——提交只写 -wal 文件、主库 mtime 不动,
只看主库会误判「缓存仍新鲜」(实测时好时坏/导出指纹漂移的根);mtime 取 主库与 -wal
两者较大值,任何提交都换戳。"""
path = ""
try:
for r in sc.execute("PRAGMA database_list").fetchall():
@@ -505,6 +508,8 @@ def _qpath_mt(sc):
if path:
try:
mt = os.path.getmtime(path)
if os.path.exists(path + "-wal"):
mt = max(mt, os.path.getmtime(path + "-wal"))
except OSError:
mt = 0.0
return path, mt