Skip to content

Scratch-repo tests inherit global git hooks (gitleaks pre-commit) and fail on hosts that adopt them #179

Closed

Description

@seathatflowsinourveins

Observed 2026-09-24 on the Mac coordinator (macOS 26.5.1, git 2.50.1 Apple): python3 -m unittest tests.test_catalog_freshness_propose → 76 tests, 2 errors, both in setUpClass:

  • RebuildExplorerSubprocessTests → _init_scratch_git (tests/test_catalog_freshness_propose.py:665) → git commit -q -m "scratch snapshot" → CalledProcessError
  • TrackedExplorerSubprocessTests (tests/test_catalog_freshness_propose.py:772) → same commit → CalledProcessError

Cause: the scratch repos inherit the machine's global git configuration. This Mac now installs agent-ecosystem's managed ~/.config/git/config with core.hooksPath = ~/.config/git/hooks, whose pre-commit runs gitleaks git --pre-commit --staged and fails closed. _init_scratch_git stages a whole-tree snapshot (git add -A), so the hook scans every copied file without the repository's own allowlist context and blocks the commit. CI runners do not have the global hook, so this only appears on hosts that adopt it.

Suggested fix (hermetic scratch repos): keep test git invocations independent of user/global config, e.g. in _init_scratch_git and the TrackedExplorerSubprocessTests setup:

git_env = ["-c", "[email protected]", "-c", "user.name=scratch",
           "-c", "core.hooksPath=/dev/null"]

or run scratch git commands with GIT_CONFIG_GLOBAL=<empty file> and GIT_CONFIG_NOSYSTEM=1. The same pattern applies to any other test that commits into a temporary repository.

Owner routing: agent-ecosystem's hook is in the foundation lane (foundation-lane-setup, informed); these tests belong to the landscape/catalog owners. No files were edited by the reporting session.

🤖 Generated with Claude Code

Activity

  1. added
    lane:sharedTouches files owned by both lanes; needs both lanes' acknowledgement
    lane:foundationFoundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers
    and removed
    lane:sharedTouches files owned by both lanes; needs both lanes' acknowledgement
    on Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    lane:foundationFoundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions