Telemetry & Provenance Standards

Metric provenance classifications, confidence scoring, and dual-engine telemetry principles.

Qodewk's core architecture is built upon a fundamental tenet:

The Prime Directive:
Git tells Qodewk what changed. Provider telemetry, when available, tells Qodewk what was consumed. Qodewk must never present an inference as exact usage.

Provenance Classifications

Every token count, dollar figure, and model attribution generated by Qodewk is tagged with an explicit provenance level:

Provenance LevelDescriptionTypical Confidence
verifiedCryptographically signed or provider-attested via official billing API.1.0
observedParsed directly from local agent transcripts, session databases, or response JSONL streams.0.9 – 0.99
importedIngested from external CI/CD artifacts or secondary telemetry adapters.0.8 – 0.9
estimatedReconstructed via AST syntax diffs, file complexity, and multi-model token heuristics.0.4 – 0.7
unknownInsufficient git or transcript footprint to establish reliable attribution.< 0.3

Confidence Scoring

In all schemas and UI components, confidence is represented as a strict numeric float between 0.0 and 1.0.

When displaying estimated costs to users:

  • Never present an estimated figure without a tilde prefix (~) or confidence interval.
  • When confidence is below 0.75, receipts display both lower-bound and upper-bound heuristic cost ranges.

Dual-Engine Telemetry System

To ensure 100% telemetry coverage across all coding agents and workflows, Qodewk employs a dual-engine architecture:

Engine A: Deterministic Footprint Harvester

When a supported coding agent (such as Claude Code, Cursor, Codex, Windsurf, or Aider) is active:

  • Qodewk scans local session transcripts and SQLite state databases in the workspace or home directory.
  • Matches agent file touches and timestamps against Git commit timestamps.
  • Extracts exact provider token consumption (input, output, cache_read, cache_write).
  • Provenance is marked as observed.

Engine B: AST Multiplier Fallback

When direct provider logs are unavailable (e.g. proprietary agents or pruned log directories):

  • Qodewk analyzes the raw Git tree (git diff-tree --numstat).
  • Computes language token density multipliers (e.g. Python vs TypeScript vs Markdown).
  • Evaluates AST cyclomatic and structural complexity of added lines.
  • Computes estimated token burn based on model rate cards.
  • Provenance is marked as estimated.

Local Telemetry Audit

You can audit exactly what metrics Qodewk captures locally before anything is published or committed:

# Print current session telemetry in formatted JSON
qodewk audit --json