codeburn icon indicating copy to clipboard operation
codeburn copied to clipboard

Expose privacy-safe artifact timestamps in doctor JSON

Open lghupan opened this issue 3 months ago • 0 comments

Problem

codeburn doctor --json can discover provider artifacts even when codeburn sessions --period lifetime --format json produces no reportable session rows. The doctor response currently exposes discovery and parse counts, but no dates.

A downstream inventory consumer can therefore know that provider artifacts exist without knowing when those artifacts were last modified. Substituting the doctor collection time would incorrectly imply recent use.

This is reproducible with CodeBurn 0.9.19 for providers such as Antigravity, Copilot, and Cursor: doctor discovers candidate sources, while the lifetime session report has no rows for those providers.

Also, parsedOk currently means that a parser completed without throwing. It does not mean that the parser yielded a reportable usage call, so it cannot be used as proof of usage.

Proposed contract

Add optional, explicitly named fields to each provider in doctor --json:

  • artifactEarliestModifiedAt
  • artifactLatestModifiedAt

Both would be UTC ISO 8601 timestamps aggregated over the unique real files represented by discoverSessions(). Virtual source suffixes would resolve to their underlying file before statting and deduplication.

Semantics:

  • These are artifact modification times, not installation or usage times.
  • Omit them when no discovered file has a usable timestamp.
  • Do not emit new artifact paths or per-artifact records.
  • Keep native session start and end timestamps in the sessions report as the stronger usage evidence.

An alternative would be a dedicated privacy-safe inventory --format json command if maintainers prefer not to expand the doctor contract.

Downstream use

ADR currently invokes CodeBurn through its CLI boundary. It would use native session timestamps first, then these artifact timestamps with an explicit artifact_mtime basis when session dates are unavailable. It would never treat generatedAt as a usage date.

Planned validation

  • Deterministic fixture mtimes
  • Earliest and latest aggregation
  • Virtual-source path deduplication
  • Missing and unstatable files
  • JSON contract coverage
  • No new path disclosure in the timestamp fields

I can implement this after maintainers confirm the preferred command and field names.

lghupan avatar Aug 25 '26 05:08 lghupan