Skip to content

fix: restore global as the default git scope; guard core.hooksPath - #370

Merged
bordumb merged 2 commits into
mainfrom
fix/git-scope-default
Jul 17, 2026
Merged

bordumb merged 2 commits into
mainfrom
fix/git-scope-default

Conversation

@bordumb

@bordumb bordumb commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Owning a mistake

I merged #369 while its E2E checks were red. The wait loop settled and I merged unconditionally without re-reading the result. 3 E2E tests were failing on main (No signature found). This fixes them.

What I got wrong

Epic 4 flipped auths init --non-interactive to scope git signing locally, reasoning that a scripted init shouldn't rewrite ~/.gitconfig. That was an over-correction, and two suites told me before I listened:

  1. Golden-path smoke (caught pre-merge, "fixed" by making the default conditional): end_to_end.py:241 inits from a home directory — git config --local there is an error.
  2. E2E (caught post-merge): conftest.py:99 inits in one repo and commits in another — repo-scoped signing left those commits unsigned.

The deeper error: auths init's own description is "Create your signing identity and configure Git", and its interactive default is already "All repositories". I made the scripted path disagree with the prompted one. Setting up signing for one repo and silently not the next is its own surprise.

The default is global again.

What was actually wrong in W4

Not the default — that the scope was unchooseable. --non-interactive hard-returned Global with no override, so a scripted, CI or agent init had no way to keep its hands off ~/.gitconfig. --git-scope local|global|skip closes that, and stays.

The harm I hadn't fixed, now fixed

core.hooksPath replaces .git/hooks entirely. Pointing it at ours when husky/pre-commit/prek already own it silently disables every hook they installed — experienced as "my pre-commit checks stopped running", with nothing tying it to auths init.

enable_commit_trailers now refuses, naming the occupying path and both ways out:

core.hooksPath is already set to /repo/.husky (a hook manager … owns it). Auths will not overwrite it: core.hooksPath replaces .git/hooks entirely, so doing so would silently disable every hook it installed. Copy the auths hooks from … into …, or re-run with --git-scope skip…

This needed a get on GitConfigProvider. A port that could only write is how this went unnoticed — there was no way to ask what was already there.

(This repo is itself living with the bug: its prek pre-commit and pre-commit pre-push hooks are currently bypassed by a global core.hooksPath.)

Tests

The two I "fixed" in bbc5b889 to match the over-correction are restored — they were right the first time. Added coverage for what's genuinely new:

  • test_init_git_scope_local_leaves_global_config_alone — ~/.gitconfig byte-identical
  • test_init_git_scope_skip_touches_no_git_config — and still pins the root
  • enable_refuses_to_clobber_a_hook_managers_hooks_path — incl. the message being actionable, not just a refusal
  • enable_is_idempotent_when_hooks_path_is_already_ours

Verification

gate result
golden-path smoke 60/60
e2e git-signing + key-rotation (the 3 that broke main) 9/9
cli integration 69 passed
cli lib 157 passed
sdk lib 180 passed
clippy 0 errors

I over-corrected in 3c21e0c, and two suites said so before I listened. Reverting
the default and fixing the thing that was actually harmful.

`auths init`'s own description is "Create your signing identity and configure
Git", and its *interactive* default is already "All repositories". Making
--non-interactive default to something else made the scripted path disagree with
the prompted one, and broke two real flows: the golden-path smoke test inits from
a home directory (where `git config --local` is an error), and the E2E suite inits
in one repo and commits in another (so repo-scoped signing left commits unsigned —
"No signature found", 3 tests, which I merged in #369 before noticing).

Setting up signing for one repo and silently not the next is its own surprise. The
default is global again.

What was genuinely wrong in W4 was never the default — it was that the scope was
**unchooseable**: `--non-interactive` hard-returned Global with no override, so a
scripted, CI or agent init had no way to keep its hands off ~/.gitconfig.
`--git-scope local|global|skip` closes that, and stays.

And the actual harm — clobbering `core.hooksPath` — is now guarded. It replaces
.git/hooks entirely, so pointing it at ours when husky/pre-commit/prek already own
it silently disables every hook they installed; the user experiences that as "my
pre-commit checks stopped running" with nothing tying it to `auths init`.
`enable_commit_trailers` refuses, naming the occupying path and the two ways out.
Needed a `get` on GitConfigProvider — a port that could only write was how this
went unnoticed.

Tests: the two I "fixed" in bbc5b88 to match the over-correction are restored,
plus new coverage for the capability that is actually new (`--git-scope local`
leaves ~/.gitconfig byte-identical; `skip` touches nothing but still pins the
root), and two SDK tests for the clobber guard including its message being
actionable rather than merely a refusal.

Verified: golden-path smoke 60/60 · e2e git-signing + key-rotation 9/9 · cli
integration 69 · cli lib 157 · sdk lib 180 · clippy 0 errors.
@vercel

vercel Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
auths Ready Ready Preview, Comment Jul 17, 2026 2:38pm

@github-actions

Copy link
Copy Markdown

Auths Commit Verification

Commit Status Details
20e354d0 ❌ Failed Commit carries no Auths-Id/Auths-Device trailer. The prepare-commit-msg hook installed by auths init adds these on every commit — if this repo sets its own core.hooksPath (e.g. husky), the hook is bypassed; run auths doctor to check. Backfill existing commits with auths sign <ref> (rewrites the commit).

Result: ❌ 0/1 commits verified


How to fix

Commit 20e354d0 has no Auths signature (no Auths-Id/Auths-Device trailer).

1. Install auths

macOS: brew install auths
Linux: Download from releases

2. One-time setup (creates your identity and configures Git)

auths init

3. Sign this branch and push

auths sign origin/main..HEAD
git push --force-with-lease

For CI to verify the signer, commit an identity bundle:

auths id export-bundle --alias main --output .auths/ci-bundle.json --max-age-secs 31536000

Quickstart →

`in_git_repository` and its import became unused when the git-scope default went
back to global. CI builds with `-D warnings`, so dead code is an error there and
merely a warning locally — which is why this passed my `cargo build` and failed
Clippy, MSRV, smoke and KERI conformance all at once.
@github-actions

Copy link
Copy Markdown

Auths Commit Verification

Commit Status Details
a6b374aa ❌ Failed Commit carries no Auths-Id/Auths-Device trailer. The prepare-commit-msg hook installed by auths init adds these on every commit — if this repo sets its own core.hooksPath (e.g. husky), the hook is bypassed; run auths doctor to check. Backfill existing commits with auths sign <ref> (rewrites the commit).
20e354d0 ❌ Failed Commit carries no Auths-Id/Auths-Device trailer. The prepare-commit-msg hook installed by auths init adds these on every commit — if this repo sets its own core.hooksPath (e.g. husky), the hook is bypassed; run auths doctor to check. Backfill existing commits with auths sign <ref> (rewrites the commit).

Result: ❌ 0/2 commits verified


How to fix

Commit a6b374aa has no Auths signature (no Auths-Id/Auths-Device trailer).

1. Install auths

macOS: brew install auths
Linux: Download from releases

2. One-time setup (creates your identity and configures Git)

auths init

3. Sign this branch and push

auths sign origin/main..HEAD
git push --force-with-lease

For CI to verify the signer, commit an identity bundle:

auths id export-bundle --alias main --output .auths/ci-bundle.json --max-age-secs 31536000

Quickstart →

@bordumb
bordumb merged commit 586bf9a into main Jul 17, 2026
24 of 25 checks passed
@bordumb
bordumb deleted the fix/git-scope-default branch July 17, 2026 14:50

This branch was successfully deployed

1 active deployment
Preview — a6b374aa Deployed Jul 17, 2026 by vercel[bot]
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