Skip to content

feat(governance): gate provenance in every report (G7) - #25

Merged
lostmartian merged 1 commit into
mainfrom
feat/g7-provenance
Aug 24, 2026
Merged

lostmartian merged 1 commit into
mainfrom
feat/g7-provenance

Conversation

@lostmartian

Copy link
Copy Markdown
Collaborator

What

Every AgentDiff report now self-describes its rules: Gate: max_divergence=0.3, max_loops=0, max_cost_delta=10.0% - source: agentdiff.toml — in the terminal summary panel, the JSON (gate_provenance field), and the PR comment footer.

Why

G7 from the release plan. A diff that doesn't say which thresholds judged it forces reviewers to open the config; with provenance embedded, 'what rules judged me?' is answered in place — pairs with G6's change warnings.

How

  • governance.provenance_line(cfg, config_path) — resolves effective gates, names the source (agentdiff.toml path or defaults)
  • CLI diff: computes provenance once, surfaces in terminal (dim panel line), JSON (DiffReport.gate_provenance — additive optional field), PR footer (<sub>)
  • Auto-discovered config path shown via find_config_file()

Testing

6 new tests (339 total): defaults vs config source, opt-in recovery-ratio appears, all three formats, explicit --config path shown.

- provenance_line(): one-line self-describing gate summary (thresholds +
  source: agentdiff.toml path or defaults)
- surfaced in terminal summary panel, JSON gate_provenance field, PR
  comment footer — every diff answers 'what rules judged me?'
- 6 new tests (339 total)
@lostmartian
lostmartian merged commit 951da4d into main Aug 24, 2026
7 checks passed
@lostmartian
lostmartian deleted the feat/g7-provenance branch August 24, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant