feat(ui): 目录树把手加竖轨连线、行垂直居中,并落实决策 321/316补十一 导出与勘察修复
This commit is contained in:
@@ -1578,8 +1578,19 @@ def _chain_survey_repair(sc, sid, hc=None):
|
||||
(sid,)):
|
||||
problems.append({"kind": "same_code_diff_lme", "code": r["code"]})
|
||||
_scope = "session:%d" % sid
|
||||
# 决策 321(2026-11-13 覆盖矩阵实测抓到):勘察清单**重建时保留非勘察条目**——拆码不猜登记
|
||||
# (code_identity._migrate_pack 写的「拆码 XX→XX:N 条源件上级边无单位归属」字符串条目)
|
||||
# 写在前、勘察重建在后,直接覆盖=登记被抹(不猜失去留痕)。勘察只 OWN 两类结构化条目,
|
||||
# 其余条目原样保留排在最前。
|
||||
_old_row = sc.execute("SELECT v FROM s_settings WHERE scope=? AND k='chain_problems'",
|
||||
(_scope,)).fetchone()
|
||||
try:
|
||||
_kept = [e for e in (json.loads(_old_row[0] or "[]") if _old_row else [])
|
||||
if not (isinstance(e, dict) and e.get("kind") in ("missing_source", "same_code_diff_lme"))]
|
||||
except Exception:
|
||||
_kept = []
|
||||
sc.execute("INSERT INTO s_settings(scope,k,v) VALUES(?,?,?) ON CONFLICT(scope,k) DO UPDATE SET v=excluded.v",
|
||||
(_scope, "chain_problems", json.dumps(problems, ensure_ascii=False)))
|
||||
(_scope, "chain_problems", json.dumps(_kept + problems, ensure_ascii=False)))
|
||||
sc.execute("INSERT INTO s_settings(scope,k,v) VALUES(?,?,?) ON CONFLICT(scope,k) DO UPDATE SET v=excluded.v",
|
||||
(_scope, "chain_repair_log", json.dumps(repaired, ensure_ascii=False)))
|
||||
return {"repaired": len(repaired), "problems": len(problems)}
|
||||
|
||||
Reference in New Issue
Block a user