Skip to content

Close the seams a fleet audit found, and publish the four Go ids - #18

Merged
HackingGate merged 1 commit into
mainfrom
fix/fleet-audit-seams
Aug 13, 2026
Merged

Close the seams a fleet audit found, and publish the four Go ids#18
HackingGate merged 1 commit into
mainfrom
fix/fleet-audit-seams

Conversation

@HackingGate

Copy link
Copy Markdown
Owner

Closes #12. Addresses the live remainder of #2.

What #2 actually found

The audit was written against a pre-1.1.1 checkout. Thirty-three of its items are already answered in the released tree by 0a2da20 and e437d86 — every one re-verified here with file:line evidence rather than "fixed" a second time. src/selection.rs's deadlock, .flatten(), index selection and out-of-repo include; src/main.rs's argv panic and root discovery; all three src/audit.rs items; src/text.rs; src/config.rs; and the whole of section G — the Python reconciler's policy reader is gone and scripts/check_hook_pins.py was deleted in 0a2da20.

What follows is the remainder, reproduced live before it was changed.

Guards

no-private-repo-names-staged named the file but never the line. It reads the patch hunk by hunk now and carries the line number. Auditing the other git diff call sites for the same defect found two more — and a filter that dropped an added line whose text begins ++. All three now pass --no-ext-diff --no-textconv, so a difftastic or delta setup in a user's global config cannot silently turn the guard off. Owner-derived regexes are built once per judgement rather than once per candidate line, which is what makes reading every line affordable.

Pins

A tree in which zero hook configurations were found was a pass; it is exit 2 now. Where configurations were read but none names a remote pin, that is a note rather than a refusal — repo: local, repo: meta and a lefthook config with no remotes: block pin nothing, and the reader should hear which of the two happened. Unchecked pins travel with the finding instead of being printed and dropped.

Shim

A [[shim]] no checker rule claims used to collect a subject, check it with nothing, and run the command anyway. Exit 2 now.

An option the shim's table cannot classify leaves the subcommand in doubt only where the two readings disagree about which word it is. git log -1 --oneline is log either way, and reporting that as a could-not-look puts a refusal on the terminal for every ordinary command — which trains the reader to ignore the one where the doubt is real. Caught during consumer verification on VitaGate.

no-published-host-identity now stands in front of bare npm rather than npm publish: the shim matches pack:* too, because a tarball's metadata is built by pack and merely uploaded by publish.

The four Go ids (#12)

uphold-gofmt, uphold-go-vet, uphold-go-build, uphold-go-test — published for both runners, gated on (\.go|go\.mod|go\.sum)$, language: system so they add no toolchain.

Across one superproject's 39 submodules these were hand-copied 24, 24, 24 and 22 times, byte-identical but for one variant: two repositories declare a gofmt entry that cannot exit nonzero, because gofmt -l prints what it would reformat and exits 0 regardless. Twenty-two copies enforce; two report a pass over unformatted code. The published id is written once, correctly — test -z "$(gofmt -l .)". A pinned id can drift only in its rev, and that dimension already has a guard.

consumer_check.sh gains a ninth question that drives all four. Publishing an id the parity harness never runs would recreate the hole the publishing was meant to close.

Distribution

Dependabot has no ecosystem that reads a lefthook config, so the one version a lefthook consumer pins is watched by nothing. Stated in dependabot.yml and README.md rather than papered over.

Verified on consumers

Read-only, against five sibling repositories on one machine — FinanceGate (39 submodules, 36G), ghostkey, GroundGate, RouterPlane, VitaGate. scan byte-identical old vs new, exit 0 everywhere. FinanceGate pre-push over 744 commits: 0.30s, no hang. A submodule with .git and no policy refuses rather than climbing into the superproject. The lefthook-only install path was driven on a fixture, since no consumer here has a top-level lefthook.yml.

357 Rust tests, 79 Python tests, clippy under the crate's own lint profile.

Not in scope

Section I (rule halves that did not survive the port) and section J (the base-sets proposal) are design work, not defects. #11 and #13 untouched.

Issue #2 audited this binary against 65 consuming repositories. Most of
what it found was already closed by 0a2da20 and e437d86 -- it was written
against a pre-1.1.1 checkout, and thirty-three of its items are answered
in the released tree. What follows is the remainder, verified live.

Guards:

`no-private-repo-names-staged` named the file but never the line. It now
reads the patch hunk by hunk and carries the line number a finding is on,
which is the half of `path:line` a reader can act on. Auditing the other
`git diff` call sites for the same defect found two more, and a filter
that dropped an added line whose text began `++` -- all three now pass
`--no-ext-diff --no-textconv`, so a difftastic or delta setup in a user's
global config cannot silently turn the guard off. The owner-derived
regexes are built once per judgement rather than once per candidate line,
which is what makes reading every line affordable.

Pins:

A tree in which ZERO hook configurations were found was a pass. It is
exit 2 now: a guard that read no pins established nothing, and saying so
is the whole contract. Where configurations WERE read but none names a
remote pin, that is a note rather than a refusal -- `repo: local`,
`repo: meta` and a lefthook config with no `remotes:` block pin nothing,
and the reader should hear which of the two happened. Unchecked pins now
travel with the finding instead of being printed and dropped.

Shim:

A `[[shim]]` no checker rule claims used to collect a subject, check it
with nothing, and run the command anyway. It refuses at exit 2 now.
An option this shim's table cannot classify leaves the subcommand in
doubt only where the two readings disagree about which word it is --
`git log -1 --oneline` is `log` either way, and reporting that as a
could-not-look puts a refusal on the terminal for every ordinary command,
which trains the reader to ignore the one where the doubt is real.

`no-published-host-identity` now stands in front of bare `npm` rather
than `npm publish`: the shim matches `pack:*` too, because a tarball's
metadata is built by `pack` and merely uploaded by `publish`, and a
matched invocation no checker claims is the exit 2 above.

The four Go ids (#12):

`uphold-gofmt`, `uphold-go-vet`, `uphold-go-build` and `uphold-go-test`
are published for both runners. Across one superproject's 39 submodules
these were hand-copied 24, 24, 24 and 22 times, byte-identical but for
one variant: two repositories declare a `gofmt` entry that cannot exit
nonzero, because `gofmt -l` prints what it would reformat and exits 0
regardless. Twenty-two copies enforce and two report a pass over
unformatted code. The published id is written once, correctly. A pinned
id can drift only in its rev, and that dimension already has a guard.

`consumer_check.sh` gains a ninth question that drives all four, because
publishing an id the parity harness never runs recreates the hole the
publishing was meant to close.

Distribution:

Dependabot has no ecosystem that reads a lefthook config, so the one
version a lefthook consumer pins is watched by nothing. That exclusion is
stated in dependabot.yml and README.md rather than papered over.
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@HackingGate, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 110 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fa59763c-3a86-4d1b-93b0-bfc5a80922d3

📥 Commits

Reviewing files that changed from the base of the PR and between acbd68f and dda1021.

📒 Files selected for processing (21)
  • .github/dependabot.yml
  • .github/workflows/test.yml
  • .pre-commit-hooks.yaml
  • README.md
  • docs/REFERENCE.md
  • hooks/lefthook.yml
  • policy/principles.toml
  • policy/upheld.toml
  • scripts/consumer_check.sh
  • src/guard/names.rs
  • src/pins.rs
  • src/shim.rs
  • tests/config_cli.rs
  • tests/guard_cli.rs
  • tests/hook_pins_cli.rs
  • tests/root_cli.rs
  • tests/shim_cli.rs
  • tests/shim_handoff_cli.rs
  • tests/test_uphold_check.py
  • tests/text_cli.rs
  • uphold_check.py

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.75071% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.48%. Comparing base (acbd68f) to head (dda1021).

Files with missing lines Patch % Lines
src/shim.rs 92.30% 13 Missing ⚠️
src/guard/names.rs 98.13% 2 Missing ⚠️

❌ Your patch status has failed because the patch coverage (95.75%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #18      +/-   ##
==========================================
+ Coverage   87.98%   88.48%   +0.50%     
==========================================
  Files          25       25              
  Lines        7583     7835     +252     
==========================================
+ Hits         6672     6933     +261     
+ Misses        911      902       -9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@HackingGate
HackingGate merged commit 646dbfa into main Aug 13, 2026
12 checks passed
@HackingGate
HackingGate deleted the fix/fleet-audit-seams branch August 13, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

24 byte-identical go-test declarations are 24 chances to fork, and one already has

2 participants