v1.0.108: advisory lock + NFKC + ID-суррогаты + обогащение ops именами
This commit is contained in:
@@ -212,6 +212,19 @@ class Handler(BaseHTTPRequestHandler):
|
||||
llm_result = result[0]
|
||||
ops = llm_result.get("ops", [])
|
||||
mode = llm_result.get("mode", "partial")
|
||||
|
||||
# Маппинг target_id (r1, r2...) → target_hash из current_spec
|
||||
id_map = {f"r{i+1}": r["hash"] for i, r in enumerate(current_spec)}
|
||||
# Обогащение ops: target_id → target_hash + имя из current_spec
|
||||
spec_names = {r["hash"]: r["name"] for r in current_spec}
|
||||
for op in ops:
|
||||
tid = op.get("target_id")
|
||||
if tid and tid in id_map:
|
||||
op["target_hash"] = id_map[tid]
|
||||
# Добавить имя для UPDATE/DELETE из spec_current
|
||||
th = op.get("target_hash")
|
||||
if th and th in spec_names and not op.get("new_row", {}).get("name"):
|
||||
op.setdefault("new_row", {})["name"] = spec_names[th]
|
||||
self._sse({"type": "llm_done", "supplement_id": sid, "filename": s["filename"],
|
||||
"ops_count": len(ops), "mode": mode, "time_s": elapsed})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user