audit support of evaluate or program.execute method(Support for execution tracing and variable-level audit logs)
还没有人认领这个 Issue。
评估
调研方向
从 evaluate 和 program.execute 入口开始,检查诸如 .exists() 之类的集合宏如何处理其元素。定义 trace 或 audit-log API,包括匹配的值、索引、表达式片段和失败说明,然后添加覆盖测试,证明请求的结果和 trace 会一起返回。
由索引模型根据 Issue 内容生成。
描述
Currently, the common-expression-language library evaluates expressions but provides limited or no visibility into the evaluation process. Specifically, there is:
No built-in execution trace.
No automatic "why it failed" explanation for complex logic.
No variable-level audit log to identify which specific part of the context triggered a result.
When dealing with collection-based macros like .exists(), etc,. it is difficult to debug which specific element in a list caused the expression to return True or False.
I would like a mechanism that returns a trace or an audit log. This trace should identify which value in the context resulted in the final pass, fail, or result.
Additional context (Example)
Consider the following scenario:
Expression: value.exists(v, v.x == 5)
Context: {"value": [{"x": 7}, {"x": 15}, {"x": 5}]}
The Issue:
The library correctly returns True because the third element matches the condition. However, there is no built-in way to programmatically identify that {"x": 5} was the specific element that satisfied the condition. In more complex real-world scenarios, knowing "why" or "which" value triggered the result is critical for auditing and debugging.
Suggested Output/API:
It would be helpful if the library could provide an output similar to:
{
"result": true,
"trace": {
"matched_element": {"x": 5},
"index": 2,
"expression_part": "v.x == 5"
}
}
Thanks in advance, please let me know if any more information or details needed.
- 主要语言
- Python
- 星标
- 43
- 派生
- 4
- 平均合并
- 12 小时 37 分钟
- 30 天内合并 PR
- 11
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
hardbyte/python-common-expression-language 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
-
enhancement
难度 4/5 3-5 天 新手友好度 45/100
-
难度 5/5 一周以上 新手友好度 35/100
-
enhancement
难度 4/5 3-5 天 新手友好度 48/100
-
enhancement
难度 5/5 一周以上 新手友好度 45/100
查看 hardbyte/python-common-expression-language 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
stephrobert/dsoxlab#238 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
sublimehq/package_control#1780 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 70/100
nwg-piotr/nwg-displays#145 ·