Repository navigation
Name the Fetched main in the Audit Run Stamp - #4260
Conversation
The run stamp named the hub checkout's HEAD, while the canonicals, their history, and the hub's tracked paths are read from a freshly fetched main. From a checkout not at that main, the stamp named one commit and the tree, verbatim, and hub-only findings judged against another. The stamp now adds "| main <sha>" wherever the fetched main differs from HEAD, and "| main unknown" where the fetch fails. AUDIT.md and RESYNC.md say which reads come from which commit. Closes #4238 Co-Authored-By: Claude Opus 5.5 <[email protected]>
A fetch failure the stamp recorded as "main unknown" could succeed on a later read's retry, so findings would judge against a main the stamp called unknown. The fetch result, failure included, is now cached once per run. A stamp with neither commit resolvable now keeps both fields. AUDIT.md says the spec and registry are read from the checkout's working tree, and what "main unknown" means. Co-Authored-By: Claude Opus 5.5 <[email protected]>
spec/audit.py now holds one short_rev helper, which the run stamp and spec/workflow_reuse.py's report stamp both call. The audit tests seed their hub fixture through one GitRepoCase helper, and the stamp test's git call names its encoding. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 20 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
A recorded local strict-review pass covers head |
Every read but the canonicals, their history, and the tracked paths comes from the checkout's working tree, so uncommitted changes there were not in the commit the stamp named. The hub field now takes a -dirty suffix where tracked files hold uncommitted changes. AUDIT.md names repo-config among the working-tree reads, and RESYNC.md says to quote any main field with the stamp. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Active findings show the audit provenance contract omits repo-config inputs and fails to mark uncommitted changes, leaving snapshot stamps potentially inaccurate.
3 open issues
What changed in this PR
This PR updates audit run stamps to identify both the hub checkout revision and the freshly fetched main revision when they differ, improving provenance for audit findings.
Changes:
- Cache fetched-
mainresults, including failures, for each run. - Share abbreviated-revision formatting between audit and workflow reports.
- Add coverage for trailing checkouts, matching revisions, fetch failures, and unavailable checkouts.
- Update audit and resync documentation for the two-commit stamp.
| File | Description |
|---|---|
| tests/test_audit_helpers.py | Adds shared hub fixtures and coverage for audit stamp behavior across fetched, matching, failed, and unavailable revision scenarios. |
| spec/workflow_reuse.py | Reuses the audit module's shared abbreviated-revision helper for workflow report stamps. |
| spec/audit.py | Implements cached fetched-main resolution, dual-revision audit stamps, and shared revision formatting. |
| RESYNC.md | Requires derived findings to quote the complete audit run stamp. |
| AUDIT.md | Documents which revisions supply audit inputs and how those revisions are represented in run stamps. |
Review effort: Lite
hub_head now names the checkout's HEAD with its -dirty suffix, and both the audit run stamp and spec/workflow_reuse.py's report stamp call it. The audit computes its stamp after the --issue usage check, so a usage error no longer waits on a fetch of main. Co-Authored-By: Claude Opus 5.5 <[email protected]>
hub_head now checks only the working-tree paths its caller reads, untracked files included. The audit passes its spec, registry, repo-config, and scripts trees, and workflow_reuse passes its two workflow trees and the registry. AUDIT.md says the fetched main is the field the stamp adds. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4260 +/- ##
===========================================
+ Coverage 78.20% 78.46% +0.26%
===========================================
Files 42 42
Lines 15415 15434 +19
===========================================
+ Hits 12055 12110 +55
+ Misses 3360 3324 -36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
A recorded local strict-review pass covers head |
The report's numbers come from code under spec/ as well as from the workflow trees and the registry. So an uncommitted edit there now marks the report's hub stamp dirty too, and a test holds that caller's paths. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
@coderabbitai review |
|
/review |
Action not completed
|
…trap Secret Restore (#4255) ## Summary Promotes `develop` to `main`. It carries nine changes: - [#4247](#4247): retires the `CLAUDE.md` pointer file, the second half of #4074. The hub's copy and its `spec/files.json` entry are gone, and a `retire` gap records why. The audit now reports a retired path the hub no longer tracks. A copy matching a past hub revision is reported for deletion, and any other copy is reported for the maintainer. It merged on the maintainer's go-ahead after reading its diff, which touches `host-setup/agent-safety/README.md`. - [#4256](#4256): that match compares line endings alone, so a retired copy differing in an action pin or a `needs:` list goes to the maintainer. It answers a Copilot finding on this promotion. - [#4260](#4260): the audit run stamp names the commits it read. HEAD carries `-dirty` where the read paths differ from it, and `main <sha>` is added where the fetched `main` differs. - [#4259](#4259): `pr-review-conduct` states the `pr_review.py` spelling rule once for every call a fleet skill prints. Under a restricted uv cache, a merge or a branch delete is reported to the maintainer as a blocked write. - [#4261](#4261): `validate-task.yml` takes a `test-matrix-file` input, read through the same validation as `test-matrix`. - [#4257](#4257): the pre-commit snippet says to exclude `hub_fetch_run.py` from a repository's own ruff with `force-exclude = true`. The short-form `AUDIT.md` snippet drops its two hub-audit authority sentences. - [#4246](#4246): `bootstrap.sh --secrets` and `bootstrap.ps1 -Secrets` restore named secret buckets, on their own or as a step of a `--host` or `--dev` stand-up. - [#4250](#4250): `host-*` buckets in `scripts/secrets_sync.py` may each hold the same home-relative title. - [#4258](#4258): a dry run with no 1Password account is refused rather than enrolling one, and the root-refused secrets tests skip on a root runner. It answers two CodeRabbit findings on this promotion. Hosts already carry the load-both setting the retirement relies on, from the 2.0.1483 kit. Closes #4074 Closes #4236 Closes #4238 Closes #4239 Closes #4242 Closes #4243 Closes #4248 Closes #4249 🤖 Generated with [Claude Code](https://claude.com/claude-code)


Closes #4238
Problem
spec/audit.pystamped a run with the hub checkout'sHEAD. The checks read two sources, though. The spec and the registry come from the checkout. The canonicals, their history, and the hub's tracked paths come from_hub_main_rev(), a freshly fetchedmain. That covers thetree:,verbatim:, andhub-only:findings. From a checkout not at thatmain, the stamp named one commit while those findings judged against another.Fix
The stamp now names both commits where they differ:
At the fetched
mainit readsaudit run <UTC> | hub <sha>as before. Where the fetch fails it reads| main unknown. The--issuebody carries the same stamp.The
hubfield takes a-dirtysuffix where the working tree under the paths the run reads differs fromHEAD, untracked files included. The fetch result is cached once per run, a failure included. So a fetch the stamp called unknown is never retried into amainthe stamp did not name. A newhub_headhelper serves both this stamp andspec/workflow_reuse.py's report stamp, each with its own read paths,specamong them for the report's code. The stamp is computed after the--issueusage check, so a usage error never waits on a fetch.AUDIT.mdsection 8 now says which reads come from which commit.RESYNC.mdsays to quote the whole stamp.Why not the refusal
The issue suggested refusing a checkout not at freshly fetched
origin/main, asscripts/carry.pyverify_hubdoes. That would not make the stamp truthful on its own:RESYNC.mdtells a run for an entry not yet onmainto use a hub checkout atdevelop.verify_huballows that too. The canonicals there still readmain, so the stamp would still name one commit while the findings read another.mainfor its canonicals deliberately, so a run fromdevelopnever judges a carrier against unpromoted content. A refusal would end every run fromdevelopor a feature branch, which hub development relies on.Naming both commits keeps every supported run working and makes each stamp say what it measured.
Verification
tests/test_audit_helpers.pyHubStampCasebuilds a hub clone one commit behind itsorigin/mainand runsaudit.mainin sweep and--issuemodes. It asserts the stamp names both commits, namesHEADalone atmain, and readsmain unknownwhen the fetch fails. The trailing-checkout case fails against the unfixedspec/audit.py.HubStampCasealso holds a failed fetch for the rest of the run, keeps both fields outside a checkout, marks a dirty read path, and ignores a change outside the read paths.ShallowCloneCasenow clears the fetch cache it can fill, so a later test never reads that test's commit. It andHubStampCaseshare oneGitRepoCase.seed_hubfixture.spec/validate.py, the prose gate, ruff, and mypy pass.spec/audit.pyis 2957 lines.Local-review findings
Every
introducedfinding the local passes raised is fixed on this branch. None stays open.🤖 Generated with Claude Code