Repository navigation
Commit 08040c7
committed
feat(#922): pin the resolved commit SHA in ground-check output
Grounding has a shelf life: a check runs against a tree that keeps moving,
and the old output could not say which tree. `ref` echoed the raw CLI
string — a moving name like a branch, or null in working-tree mode — so a
consumer reading the JSON later had no way to tell whether the
confirmation was stale.
`GroundCheckResult` now carries `resolvedSha`: the full SHA of `ref`
resolved via `git rev-parse --verify`, or of HEAD in working-tree mode
(where `ref: null` continues to signal that uncommitted changes may sit
on top). An unresolvable ref pins null rather than silently reporting
HEAD as if it were the requested ref, mirroring `buildRepoIndex`'s
empty-index degrade.
This is the Phase-A-safe slice of @zeweihan's shelf-life review point on
the issue: no gate is wired (AC-3 recommends against), but the surviving
on-demand checker now emits drift-detectable provenance for free, so any
future consumer gets "when and against what" without a schema change.
Mutation-verified: deleting `resolvedSha` from the result object fails
exactly the four new assertions (working-tree pin, historical-ref pin,
HEAD-vs-base distinction, unresolvable-ref null); restored.
Refs #9221 parent 81f2107 commit 08040c7
2 files changed
Lines changed: 41 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
| |||
144 | 147 | | |
145 | 148 | | |
146 | 149 | | |
| 150 | + | |
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| |||
160 | 164 | | |
161 | 165 | | |
162 | 166 | | |
163 | | - | |
| 167 | + | |
| 168 | + | |
164 | 169 | | |
165 | 170 | | |
166 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
167 | 176 | | |
168 | 177 | | |
169 | 178 | | |
| |||
175 | 184 | | |
176 | 185 | | |
177 | 186 | | |
178 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
179 | 192 | | |
180 | 193 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
80 | 89 | | |
81 | 90 | | |
82 | 91 | | |
| |||
644 | 653 | | |
645 | 654 | | |
646 | 655 | | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
647 | 672 | | |
648 | 673 | | |
649 | 674 | | |
| |||
684 | 709 | | |
685 | 710 | | |
686 | 711 | | |
| 712 | + | |
687 | 713 | | |
688 | 714 | | |
689 | 715 | | |
| |||
0 commit comments