Skip to content

chore: commit-identity gate + two latent breaks it surfaced - #178

Open
rctruta wants to merge 3 commits into
mainfrom
chore/commit-identity-gate
Open

chore: commit-identity gate + two latent breaks it surfaced#178
rctruta wants to merge 3 commits into
mainfrom
chore/commit-identity-gate

Conversation

@rctruta

@rctruta rctruta commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Identity gate (the ask)

Commits must use the masked GitHub address. Global git config already set it correctly; the failure mode was a tool passing a per-command -c user.email= override, which bypasses config silently and leaked a real address into commits on a public repo.

Appended to .githooks/pre-commit, so the existing branch-protection check is preserved — it fired and blocked the first attempt at this very commit. Verified live: a commit with a non-masked email is refused.

Two latent breaks this surfaced

Running the suite in a clean environment (uv sync prunes to the lock) turned up two things that had nothing to do with the gate:

  1. litellm was undeclared. Imported by agent_specialist.py and scripts/autonomous_agent.py, present in neither pyproject.toml nor uv.lock. It survived only as an ad-hoc install — so the agent tests were one clean checkout away from red, and uv sync took them there.

  2. run.sh called a bare python (since 2025-12-19). That resolves only with a venv activated; macOS ships python3 only. test_golden_capsule spawns the script unactivated and got exit 127. The pre-push hook had been papering over this by prepending the venv bin to PATH. Now the script resolves its own interpreter and fails loudly if it can't.

  3. test_run_sh_lock stubbed run.sh by exact string literal. Fixing (2) made the str.replace no-op, so the lock tests silently ran the real experiment runner. Now pattern-matched with an assertion that exactly one substitution applied — a stub that can quietly no-op is the actual defect.

Verification

699 passed, 0 failed, with no venv activated. Pushed through the pre-push gate, no --no-verify.

rctruta added 3 commits July 28, 2026 08:15
Commits must use the masked GitHub address. Global git config already sets it;
the failure mode was a tool overriding it per-command, which leaked a real
address into commits on a public repo.

Appended to the existing pre-commit hook so the branch-protection check is
preserved. Verified: a commit with a non-masked email is refused.
Two latent breaks, both surfaced by running the suite in a clean environment.

litellm is imported by agent_specialist.py and scripts/autonomous_agent.py but
was declared in neither pyproject.toml nor uv.lock. It survived only as an
ad-hoc install, so any 'uv sync' (which prunes to the lock) took the agent
tests red. An undeclared runtime import is a break in any fresh checkout.

run.sh invoked a bare 'python', which resolves only when a venv is activated
in the calling shell; macOS ships python3 only. Callers that spawn the script
without activation -- including test_golden_capsule.py -- got exit 127. Now
resolves the repo venv, falls back to python3, and fails loudly with neither.

Verified: 699 passed with no venv activated (was 698 passed, 1 failed).
test_run_sh_lock built its mock by str.replace on the literal
'python run_experiment.py "$@"'. When run.sh changed the interpreter, the
replace matched nothing and returned the content unchanged -- so the lock
tests spawned the REAL experiment runner instead of a sleep, and failed with
an argparse usage error that points nowhere near the cause.

Match by pattern and assert exactly one substitution applied. A stub that can
silently no-op is the defect; a miss is now a loud error naming the fix.
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