Repository navigation
fix: record dirty checkout state in operation provenance - #216
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused changes preserve release-ID compatibility, cover key failure paths, and have no unresolved review findings.
Review effort: Balanced
Findings: None
What changed in this PR
Corrects checkout provenance for #149 by recording dirty state consistently across the CLI and shared service, without adding deployment restrictions.
Changes:
- Centralizes Git-state detection and omits provenance when inspection fails.
- Preserves dirty markers in safe release IDs and aligned audit output.
- Adds regression coverage and documents provenance limits.
| File | Description |
|---|---|
| site/src/content/docs/explanation/evidence-not-declaration.mdx | Explains dirty markers and evidence limits. |
| internal/release/release.go | Converts +dirty to ID-safe -dirty. |
| internal/release/release_test.go | Tests dirty IDs and unsafe inputs. |
| internal/onebox/service.go | Uses shared Git-state detection. |
| internal/onebox/git_test.go | Covers checkout states and inspection failures. |
| internal/gitinfo/revision.go | Implements shared checkout provenance. |
| internal/engine/audit.go | Sizes the Git column dynamically. |
| internal/engine/audit_test.go | Checks marker preservation and alignment. |
| cmd/ob/git_test.go | Tests CLI dirty-state reporting. |
| cmd/ob/commands.go | Uses shared Git-state detection. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Record
SHA+dirtyfor a checkout with modified, staged, deleted, or untracked files instead of silently recording a clean HEAD. The CLI and shared Onebox service now use one Git-state implementation. If HEAD or status cannot be read, provenance is omitted rather than reported as clean.Release IDs render the same marker as
SHA-dirtywithin their existing safe alphabet, and the audit table accommodates the longer revision. The website explains the marker and its limits: ignored files are excluded, and the staged-payload digest remains separate evidence.Closes #149.
Why this is correct
Regression tests failed against the original service and CLI helpers. Tests exercise clean and dirty states, user settings hiding untracked files, a corrupted index, unavailable/unborn repositories, cancellation, ignored files, unsafe ID inputs, valid rollback/retention IDs, and preservation/alignment in human and structured audit output. Real submodule tests verify ignored files remain clean, while tracked/untracked changes and advanced commits remain dirty even when user preferences hide submodule changes. Status uses normal untracked mode because provenance only needs to know whether changes exist, without enumerating every file. Independent local agent review found no remaining issues.
Validation: targeted regressions and
just cipass locally, including all Go tests, vet, lint, vulnerability/workflow checks, generated references, and website build. All five GitHub CI checks pass on the updated head, including Docker E2E and native Linux/macOS/Windows smoke tests. Copilot's final Lite review reports no findings and recommends approval. Docker/remote-host E2E was not run locally.Effect on the safety envelope
Corrects misleading provenance without adding a deploy refusal or policy. Existing clean IDs remain unchanged; dirty IDs stay recognizable by rollback and retention.
Checklist
just checkpasses locally (included injust ci).just checkverifies this).