Skip to content

Cloud telemetry: produce complete per-PR spend coverage observations #737

Description

@jeffhuber

Problem

Code Mower already records cost and token metadata when providers expose it, and pr_outcome supports expected-versus-reported run counts. In practice, repository syncs do not consistently join builder and reviewer attempts into a complete per-PR cost-coverage observation, so CodeMower.com correctly refuses to publish cost per PR.

Outcome

Produce defensible pr_outcome cost coverage from local builder/reviewer ledgers and GitHub outcome truth, while preserving unknown cost as unknown.

Scope

  • Join metadata-only builder and reviewer attempts to one repository/PR identity.
  • Count expected and cost-reported attempts using final configured lane posture and observed builder provenance.
  • Emit cost_coverage=complete, partial, or unknown plus expected/reported counts and observed total cost only when justified.
  • Add a safe coverage diagnostic showing missing provider/lane sources without exposing commands, paths, auth output, or secrets.
  • Keep provider-reported cost authoritative; never infer dollars from tokens unless an explicit versioned pricing source is configured.
  • Update the cloud contract, repo-sync/dogfood behavior, docs, fixtures, and tests.

Acceptance criteria

  • Complete, partial, and unknown examples produce the documented v1 pr_outcome shape.
  • Missing cost is never serialized as zero.
  • Duplicate uploads are idempotent and do not double-count attempts.
  • Existing clients and CodeMower.com remain backward-compatible.
  • CodeMower.com's paired issue is linked before merge.

Process

One focused PR, tests and docs, independent Codex and Claude final-head audits, required green gate, and metadata-only upload.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    contract-firstRequires product/data/merge contract agreement before dependent work mergesenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions