Add detailed comparison assertions

This commit is contained in:
2026-11-07 04:49:40 +00:00
parent 65b454b2ab
commit 1986c44f49
6 changed files with 184 additions and 2 deletions

View File

@@ -511,8 +511,21 @@ example config diff --config before.yml --against-config after.yml
example config diff --config base.yml --against-overlay candidate
example config diff --config base.yml --overlay current --against-overlay ""
example config diff --scope promptkit --config before.yml --against-config after.yml
example config diff --config before.yml --against-config after.yml --details --check
```
`--details` replaces the concise report with `{scope, differences}`, containing
one entry per native difference. Each entry has `path`, `before`, `after`, and
`hidden_changed`; each snapshot has `present`, `redacted`, and `value`. An
absent snapshot has `present: false` and a null value, distinct from a present
null. Empty comparisons contain `differences: []`.
`--check` returns status `3` when native differences exist and `0` when they do
not. Without it, a completed comparison succeeds even when differences exist.
Usage errors retain status `2`, and operational failures retain status `1`.
The report is still delivered in check mode; a presentation failure remains
separate evidence and does not replace a nonzero difference outcome.
For ConfigKit-backed scopes, ConfigKit compares frozen effective typed values
after defaults and resolution; source or provenance differences alone do not
create a change. PromptKit delegates its native comparison to ConfigKit. The