Skip to content

session: regenerate the SessionStart hook from the updated canonical - #184

Merged
Jammy2211 merged 1 commit into
mainfrom
claude/mobile-performance-review-5qwv8r
Aug 26, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
claude/mobile-performance-review-5qwv8r

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Generated file, one file changed. PyAutoMind/policy/session_start_hook.sh is the source; repos_sync.py --write installs it here. PyAutoLabs/PyAutoMind#341 changes that source, so this copy went stale the moment it landed — this is the tool's output, not a hand edit.

Why the source changed

Claude Code registers project hooks from the session's project directory. That equals the repo only when a session holds exactly one repo. A session scoped to several organs clones them side by side under that directory, so the project directory is their parent — not a repo, no .claude/, and no repo's hook registered at all. Those sessions ran on the container's Python 3.11: one minor below this organism's floor and below every CI leg, with mypy and flake8 reading the interpreter and judging code against 3.11 rules. It surfaced as local-green/CI-red, with nothing pointing at the cause.

The canonical hook now:

  • derives its repo from the hook's own path instead of $CLAUDE_PROJECT_DIR;
  • self-installs a workspace-root fan-out when it detects that layout, so the next session in the container starts correctly;
  • unshallows the session's clones — a shallow clone makes git merge-base --is-ancestor report "not an ancestor" for a commit whose ancestry is merely absent, and the ship/close-out procedures act on that answer;
  • runs the git and hook-reachability legs before, and independently of, the interpreter legs, so a container that cannot build the venv still gets honest ancestry and a hook that fires next time. PYAUTO_SESSION_SKIP_PYTHON=1 is the documented seam its tests use.

How this was caught

PyAutoMind's firewall_gate.yml checks all four organ mains against the canonical. The Mind PR's own run went red naming this repo and PyAutoHands — the drift check doing exactly its job. Merging this (and the Hands counterpart) is what turns that leg green.

Nothing in this repo is touched beyond the generated hook.

🤖 Generated with Claude Code

https://claude.ai/code/session_012PDoeCuecjutdnwkxsTqg7


Generated by Claude Code

Generated file — `PyAutoMind/policy/session_start_hook.sh` is the source and
`repos_sync.py --write` installs it. PyAutoMind#341 changes that source; this is
the resulting copy, produced by the tool, not hand-edited.

What the source gained:

- the repo is derived from the hook's own path rather than $CLAUDE_PROJECT_DIR,
  which is the session's project directory and equals the repo only when the
  session holds exactly ONE repo. A session holding several organs clones them
  side by side *under* that directory, so no repo's hook was registered at all
  and the session ran on the container's Python 3.11 — below this organism's
  floor and below every CI leg;
- a workspace-root fan-out is self-installed in that layout, so the next session
  in the container starts correctly;
- shallow session clones are unshallowed, because `merge-base --is-ancestor`
  reports "not an ancestor" for a commit whose ancestry is merely absent;
- the git and hook-reachability legs run before, and independently of, the
  interpreter legs, with PYAUTO_SESSION_SKIP_PYTHON=1 as the tests' seam.

Caught by PyAutoMind's `firewall_gate.yml`, which checks all four organ mains
against the canonical: this repo's copy was stale the moment the source changed.
Nothing else here is touched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012PDoeCuecjutdnwkxsTqg7
@Jammy2211
Jammy2211 merged commit 36ba02f into main Aug 26, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the claude/mobile-performance-review-5qwv8r branch August 26, 2026 20:06
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.

2 participants