The tracking plan said "implemented". The dashboard says otherwise. I built a CLI that detects plan↔code drift using only AST.
说明与用途
plan‑drift CLI 通过解析 Python AST,检测 JSON 跟踪计划与代码实现之间的漂移,报告未预期事件、未实现事件、属性不匹配和动态事件,且不使用 LLM,保证确定性。
问题
Analytics tracking code often drifts from the intended tracking plan, causing silent data quality issues that are hard to detect with IDEs or tests.
结果
The CLI identifies all mismatches between the tracking plan and code, enabling teams to correct drift before dashboards are corrupted.
工作流
- 1. Create a JSON tracking plan file.
2. Run
plan-drift --plan tracking-plan.jsonagainst the repository. 3. Review the console output for drift categories. 4. Fix code or update the plan based on the report. 5. Re‑run the CLI to confirm resolution. 6. (Optional) Add the CLI to CI to warn on critical drift.
证据
The CLI finds four kinds of drift: UNEXPECTED EVENT, UNIMPLEMENTED EVENT, PROPERTY MISMATCH, DYNAMIC.
Python 3.11+ is enough. pip install git+... and you're done.
- 记录日期: 2026-09-21T17:15:13.308Z