OpenProgram / agentic DAG / implementation handoff

DAG 持久化失败可观察性

基线:4f8649d1。范围仅限 agentic/traced function 的 DAG entry append 与 exit update。

确定方案。 DAG 是执行记录,不是用户函数的成功条件:append/update 失败继续保持 best-effort,不改变返回值或原始异常;但必须通过本地 logger 输出一次结构化 warning 和 traceback,使磁盘、权限、序列化错误可诊断。

01 · 合同

阶段失败语义诊断字段
entry / store.append不中止函数;函数照常执行。phase=entry、node id、exception type、traceback。
exit / store.update不覆盖函数返回值或函数自身异常。phase=exit、node id、exception type、traceback。
无 store / hidden保持静默 no-op。不记录 warning。

02 · 信任边界与取舍

03 · 验收

场景断言
entry append 抛异常被装饰函数仍返回原结果;恰一 warning 包含 entry、node id、exception type 和 traceback。
exit update 抛异常被装饰函数仍返回原结果;恰一 warning 包含 exit、node id、exception type 和 traceback。
函数自身抛异常且 exit update 失败调用方收到函数原始异常,不能被 persistence 异常覆盖。
hidden / no store无 persistence warning。

04 · 排除项

不修改 DAG schema、SessionStore、wrapper 生命周期、usage context、tool registration、Windows、credential store 或孤儿文件。

05 · 实现与证据

openprogram/agentic_programming/function.py 提供共享诊断;tests/agentic_programming/test_function_dag_persistence_observability.py 覆盖公共 decorator 行为。

已实现并完成独立审查。 实现提交:74a0bbbcccb19f2495772852e9f4f7a6。规格与质量审查均通过;最终 gate 见任务台账。