feat(chv): 架构与代码质量 9.5+ 提升——长函数清零、WarmPool facade、#215 对齐、审计计数、只读 VM 字段、ADR-8~11
This commit is contained in:
1 parent
c908a0147a
commit
42de20da68
15 files changed
+840
-345
No files matched your search
@@ -1826,6 +1826,16 @@ def _task_to_dict(row, attachments=None, total_tokens=None):
|
||||
# 列表接口由 _task_tokens_map 一次聚合传入;其它调用方
|
||||
# 不传时为 None(前端显示占位),绝不把“未算”写成 0。
|
||||
"total_tokens": total_tokens,
|
||||
# feat-chv-arch95plus 只读字段:仅当 CHV 任务且 worker
|
||||
# 已把 VM 死亡写进 interrupted_reason 时才出现,值为
|
||||
# True;其它情形一律不返回该字段(绝不把“未报告死亡”
|
||||
# 写成“VM 活着”,live VM 状态不在 server 进程里,
|
||||
# server 没有 VM 登记表,编不出来也不编)。
|
||||
**({"chv_vm_dead": True}
|
||||
if _row_get(row, "executor") == "cloud-hypervisor"
|
||||
and _row_get(row, "interrupted_reason")
|
||||
and "VM 中途死亡" in str(_row_get(row, "interrupted_reason"))
|
||||
else {}),
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user