Skip to content

feat: emit provenance metadata in ModuleGraph output (Constitution III) #24

Description

@jflowers

What Changed

Emit provenance metadata alongside the ModuleGraph JSON output: producer name,
producer version, generation timestamp, and input identity (analyzed path +
resolved module path).

Why It Matters

Constitution III (Observable Quality) requires all artifacts to include
provenance: producer, version, timestamp, input. The current ModuleGraph
(metrics/graph.go) carries none of these. This was explicitly deferred as a
Non-Goal in openspec/changes/go-analyze/design.md and recorded as PARTIAL
in the go-analyze proposal's Constitution Alignment table.

Without provenance, a CI system consuming vibe-check JSON cannot verify which
tool version produced a metrics report or when — undermining reproducibility and
auditability of architectural-drift tracking.

Proposed Shape (for discussion)

  • Add an optional provenance object to ModuleGraph, kept omitempty for
    backward compatibility (or a top-level envelope wrapping the graph).
  • Fields: producer (e.g. "vibe-check"), version (from build info / ldflags),
    generatedAt (RFC3339 UTC), input (analyzed path + module path).
  • Additive schema bump; update metrics/modulegraph.schema.json and the
    validator to accept the new field.

Determinism Note

AGENTS.md requires metric computations to be deterministic. A wall-clock
timestamp is inherently non-deterministic, so provenance must be treated as
metadata, not a metric. Provide a way to keep output reproducible — e.g. a
--no-provenance / --reproducible flag, or omit the timestamp under a
deterministic mode — so the determinism guarantee for the metric payload holds.

Acceptance Criteria

  • analyze output includes populated provenance fields.
  • Metric payload remains deterministic; timestamp non-determinism is
    documented and optionally suppressible.
  • Schema + validator updated; backward compatible with schema 1.0/1.1 consumers.
  • Constitution III alignment upgradable from PARTIAL to PASS.

References

Note: this issue should be labeled enhancement once that label exists.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions