The tracking plan said "implemented". The dashboard says otherwise. I built a CLI that detects plan↔code drift using only AST.
Description and use
The plan‑drift CLI detects drift between a JSON tracking plan and Python implementation, reporting unexpected events, unimplemented events, property mismatches, and dynamic cases deterministically without LLMs.
Problem
Analytics tracking code often drifts from the intended tracking plan, causing silent data quality issues that are hard to detect with IDEs or tests.
Outcome
The CLI identifies all mismatches between the tracking plan and code, enabling teams to correct drift before dashboards are corrupted.
Workflow
- 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.
Evidence
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.
- Record date: 2026-09-21T17:15:13.308Z