Skip to content

design: prov log --json envelope discriminator (point vs whole-file) #13

Description

@mattfogel

Severity: P2 (API contract clarity)
Source: Phase 1 code review

Problem

crates/prov-cli/src/commands/log.rs:333-464prov log <file>:<line> --json returns PointJson ({file, line, status, prompt?, ...}). prov log <file> --json returns WholeFileJson ({file, edits[], history[]}). Two structurally incompatible shapes with no envelope discriminator.

A consumer (planned U12 Skill, U13 GitHub Action) must know in advance which shape to expect. There's no kind: "point" | "file" field to branch on.

Suggested fix

Add an envelope-level discriminator:

{ "kind": "point", "prov_version": "...", "data": { /* point fields */ } }
{ "kind": "file",  "prov_version": "...", "data": { /* file fields */ } }

This is a breaking JSON contract change, so it should land with a versioned envelope rather than ad-hoc. Coordinate with U12/U13 work.

Why deferred

Breaking change to a consumer-facing surface; needs a versioned-envelope migration story.

Metadata

Metadata

Assignees

No one assigned

    Labels

    phase-1-followupFollow-up from Phase 1 code review

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions