perf(attribution): pin the Git shim interpreter off the pyenv shim #825
No reviewers
Labels
No labels
burndown-2026-06
burndown-2026-08
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
coherence-core
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
qa-fixture
role/advocate
role/director
role/exec
role/frontend
role/gamedev
role/human
role/platform
role/qa
role/science
role/sysadmin
state
ambient
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-flight-deck/infrastructure!825
Loading…
Reference in a new issue
No description provided.
Delete branch "aos/claude/attribution-interpreter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #823.
agent_git_attribution.pyis symlinked asgitand executed directly, so its shebang selects the interpreter on every agent Git call. Withenv python3that resolves through the pyenv shim on PATH.Measured on kais-macbook-pro, ten runs each:
/usr/bin/env python3/usr/bin/python3Provenance
The shebang change is not mine. It was diagnosed on 2026-08-12 on branch
aos/claude/git-attribution-pin-interpreterand left as an uncommitted stash entry with no issue and no commits on the branch. This adopts it so it stops living somewhere agit stash dropwould erase. The original stash is untouched and still present.I re-measured rather than trusting the stashed comment. It claimed 320ms against 43ms, I get 258 against 67. Same conclusion, different absolute numbers, so the comment now carries mine.
The guard I added
The role assumed
/usr/bin/python3exists without ever saying so. That assumption holds today becauseinventory/fleet.ymlandinventory/local.ymlboth pinansible_python_interpreterto it, so Ansible itself runs under that interpreter wherever this role converges. It breaks if a host overrides the interpreter, and the blast radius is out of proportion to the cause: the shim isgit, so a missing interpreter breaks Git for agents on that host.The assert runs before the copy. A host that cannot satisfy the pin fails the converge loudly and keeps its existing working Git, instead of receiving a shim that cannot execute.
Two alternatives considered and rejected:
env python3. Restores the 190ms with no signal that the pin never applied. Worse than failing.ansible_python_interpreterat converge time. Cleaner, and the file has no Jinja-hostile sequences so templating would work. Butscripts/agent_git_attribution_test.pyimportsfiles/agent_git_attribution.pyat that exact path throughimportlib, so it needs the test changed too. Left as a follow-up.Verification
ward exec ansible-lintpasses at the production profile.ward exec ansible-sync -- check local tags=claude-hooksruns the new stat and assert asok, and the copy diff shows the new shebang./usr/bin/python3(3.9.6). Imports are stdlib only,from __future__ import annotationsis present, and nothing evaluates annotations at runtime. Identical CLI behavior under 3.9.6 and pyenv 3.13.2.Two gaps worth stating rather than burying:
scripts/agent_git_attribution_test.pydoes not complete in an agent session, hanging past 45 seconds under both 3.9.6 and 3.13.2. That is interpreter-independent and predates this change, so it is not evidence about the pin, but it does mean the suite did not gate this.The same check-mode run reports one failure, in
claude-hooks, looking for a script under$HOME/projectsthat does not exist in the AOS sandbox home. Environmental, unrelated, and also present before this change.Note
Apple's
/usr/bin/python3is 3.9.6, end of life upstream. It runs this script correctly today. Moving to a maintained interpreter is a separate question from getting off the pyenv shim, and the newagent_git_attribution_interpreterdefault is the single place to change it.🤖 Generated with Claude Code