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

View File

@@ -1,6 +1,6 @@
# Shared reporting and PromptKit v0.20.0 implementation plan
Status: implementation in progress; Stages 1–18 complete.
Status: implementation in progress; Stages 1–19 complete.
## Scope, authority, and execution
@@ -680,6 +680,10 @@ source files again to recover evidence.
## Stage 19: Detailed differences and assertion outcomes
**Complete.** Detailed native difference reports and opt-in assertion status
are implemented. Root, ckconfig, and ckprompt workspace suites passed with Go
1.27.0, including concealed changes, null versus absence, and delivery failures.
Reuse existing Scope.Compare and native Difference records. Keep concise
additions/changes/deletions as default and add `--details`. The detailed report
is `{scope, differences: [...]}`; entries carry native `path`, `before`, `after`,