Skip to content

fix: add git-scrub and macbash, and clear the open issue residuals - #70

Merged
catinspace-au merged 4 commits into
mainfrom
fix/add-git-scrub-to-contributor
Aug 30, 2026
Merged

fix: add git-scrub and macbash, and clear the open issue residuals#70
catinspace-au merged 4 commits into
mainfrom
fix/add-git-scrub-to-contributor

Conversation

@catinspace-au

@catinspace-au catinspace-au commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Started as "add git-scrub to the installer", then grew because we went to check whether the open issues were still true and mostly they were not. Four commits: two new tools, and the residuals that survived the check.

The two tools

git-scrub and macbash both go in contributor, not soe, so an outside contributor gets them and soe inherits through meta/dependencies. Snipeable as --tags git-scrub and --tags macbash.

  • git-scrub is what clears a gitleaks failure -- gitleaks scans FULL history, so a secret removed from HEAD still fails the gate.
  • macbash is what CONTRIBUTING.md already asks for on every shell change. It was never installed by anything.
  • macbash verifies a published .sha256, which is also what makes it idempotent -- the asset name carries no version, so nothing else would notice a republished binary.

The issue residuals

We checked each open issue against the code before touching anything, and none of them was true as filed:

Two extras found on the way: all four XDG_RUNTIME_DIR sites derived the uid from the CONNECTING user, and the sccache enable/start both swallowed failures with no warning.

Done when a converge installs both tools, a second run is green, and a stuck build lock warns instead of hanging.

Verified

  • Two consecutive LIVE runs of every touched tag, second one green -- git-scrub, macbash and rust-governor all report ok with the install steps skipping.
  • --tags typescript --check went from fatal: 'pnpm_env' is undefined to failed=0.
  • Token helper passes all four env combinations; a playbook mirroring the real become shape gives token=[] before the fix and the token after.
  • Governor: shellcheck clean, macbash clean, bash -n under real bash 3.2 (docker bash:3.2). Timeout test degrades at exactly 4s instead of hanging. The macOS mkdir branch was forced via a stripped PATH -- uncontended, stale-holder-cleared and live-holder-timeout all correct.
  • cargo --version runs through the updated deployed shim on a real box.
  • Regression sweep --tags contributor --check: 152 ok, failed=0. tools/ci/run-tests.sh: all available checks passed.

Not verified

macOS, at all -- no Mac in reach. That covers the macbash brew tap, the alint PATH fix, and the macOS lock branch beyond the forced-PATH simulation. Three of those changes are macOS-only, so they want a look on real hardware before anyone trusts them.

Caught in review, worth knowing

An earlier draft of the governor wrote exec 9>"$LOCK" 2>/dev/null. On the success path that redirect persists and silences the build's own stderr -- every compiler error from every cargo build, gone. A test printing to both streams returned only stdout, which is how it was found. Removed.

We use git-scrub to rewrite AI residue and leaked secrets out of git
history, but nothing in the installer put it on a box -- everyone was
fetching it by hand.

It goes in contributor rather than soe because it is what clears a
gitleaks failure, and gitleaks scans full history: a secret removed from
HEAD still fails the gate. soe inherits it through meta/dependencies.
Snipeable on its own with --tags git-scrub.

GitHub release tarball on every platform. That is the only rung going --
it is not on crates.io, downloads.hyperi.io serves no git-scrub path, and
the release ships a git-scrub.rb that is not in our tap yet, so macOS
takes the darwin asset until someone taps it.

The tarball is kept rather than deleted, and that is what makes the role
idempotent: get_url re-reports ok for an unchanged asset so the extract
and install stay skipped on a converged box. We cannot ask the binary its
version instead -- v1.0.2 reports itself as "git-scrub 1.0.1".
CONTRIBUTING.md asks for macbash on every shell change, and the installer
never put it on a box. Same placement as git-scrub: contributor, so an
outside contributor gets it and soe inherits it.

Linux takes the bare binary from downloads.hyperi.io rather than the
.deb/.rpm beside it. Those carry the version in their filename and would
need a release lookup; the bare asset does not, so this path makes no
GitHub API call at all. macOS taps hyperi-io/tap and installs the formula.

Upstream publishes a .sha256 next to each asset, so we verify the digest
instead of trusting the transport. That is also what makes it idempotent
-- the asset name has no version in it, so nothing else would notice a
republished binary.

The two single-tool verify blocks we would now have are folded into one
loop over git-scrub and macbash.
Every Ansible call site already carries hyperi_github_headers -- checked
one by one, and the counts match. hyperi-rust-setup was the one caller
the uri module's headers could never cover: it does its own sccache
release lookup and had no token handling at all, so it burned anonymous
quota on the shared egress address mid-converge.

Two halves, because the script alone is not enough. An exported token
survives become to the SAME user but is stripped becoming a different
one, which is exactly the fleet shape hyperi-infra connects in -- so the
task has to hand it over explicitly. hyperi_github_env is the process
-environment twin of hyperi_github_headers, empty when no token is set,
so a single-laptop install is unchanged.

Left alone deliberately: hyperi-update-linux.sh makes the same
unauthenticated lookups, but hyperi-update.service runs as actual_user
with no Environment=, so patching the script would change nothing until
we decide where a fleet box gets a token from.
#59)

Four things that all showed up while checking whether the open issues
were still true. Most of them were not, so these are the residuals.

The build lock waited forever. hyperi-rust-govern is ~/.local/bin/cargo
on every SOE box, so a daemon that inherits fd 9 and never lets go wedges
every later cargo command with no log line at all. It now waits
HYPERI_RUST_GOVERN_LOCK_WAIT (30 min) and then builds unserialised,
naming the holder. Serialisation is an optimisation, so degrading beats
hanging. The macOS mkdir branch had the same unbounded shape and gets the
same bound. An unopenable lock file is now reported as that, rather than
as contention.

init.yml was being skipped. The include carried tags: ['always'] but no
apply block, so the include ran and its tasks kept no tags of their own
-- under any narrow --tags run, every fact it sets silently vanished.
That is the real reason --tags typescript died on an undefined pnpm_env,
and pnpm_env moves into init.yml where the other shared facts live.

XDG_RUNTIME_DIR pointed at the wrong user. All four sites derived it from
ansible_facts['user_uid'], which is the CONNECTING user -- so on a
split-user machine the systemd --user calls targeted an account with no
session. It comes from actual_user via getent now.

sccache enable and start both had failed_when: false and appended no
warning, so a failure said nothing at all -- the exact silence that would
hide the lock wedge coming back.

alint installs through cargo with no distribution gate, so it runs on
macOS with a PATH that lacked /opt/homebrew/opt/rustup/bin. brew's rustup
never links its shims into /opt/homebrew/bin, so no cargo resolved there.
@catinspace-au catinspace-au changed the title fix: install git-scrub with the contributor toolchain fix: add git-scrub and macbash, and clear the open issue residuals Aug 30, 2026
@catinspace-au
catinspace-au merged commit 06035f1 into main Aug 30, 2026
16 checks passed
@catinspace-au
catinspace-au deleted the fix/add-git-scrub-to-contributor branch August 30, 2026 23:19
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.

1 participant