Repository navigation
feat(repos_sync): session-hook exclusions, denominator and push-triggered propagation - #372
Merged
Merged
Conversation
…d propagation (#369) The canonical SessionStart hook is generated into every checked-out manifest repo, but the only CI leg that drift-checks it holds four organs and skips absent repos by design, so a canonical hook edit re-staled the other thirty twice in a row (2026-08-26/27) and no gate saw it. - repos.yaml: `session_hook: false` records euclid_assistant and admin_jammy as manifest exclusions (personal namespace, categories already outside the org-wide sweeps, never had a .claude/). Every other repo keeps the hook. - repos_sync.py: the hook leg skips excluded repos and its status line now carries the denominator — `OK (34 of 35 checked out, 2 excluded)` — so a four-repo session can see it is seeing four. - firewall_gate.yml: policy/session_start_hook.sh joins the paths filter; an edit to the hook did not trigger the gate at all. - session_hook_propagate.yml (new): on push to main touching the hook or the generator, clone every in-scope repo with PAT_PYAUTOLABS, regenerate via write_session_hooks, and push a bot commit of the two hook files where they changed; dry_run dispatch input; untracked/ignored .claude/ reported as a failure rather than "current"; generator crash fails the job. - 10 tests: exclusion, denominator, mismatch+denominator, workflow names. Closes #369
This was referenced Aug 29, 2026
… 9c) The new propagation workflow needs the PAT_PYAUTOLABS org secret and pushes bot commits into sibling repos by name, the org-coupled shape rule 9b/9c already refuse. Caught by test_no_tracked_file_is_unmatched_by_mind_rules on the PR — the local suite ran while the file was still untracked. Refs #369 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BLDU66PSXgjWJTjpcTraXY
Collaborator
Author
|
Corrective commit 5c6c350: |
Jammy2211
added a commit
that referenced
this pull request
Sep 9, 2026
Jammy2211
added a commit
that referenced
this pull request
Sep 9, 2026
PyAutoBrain#371 merged (ec354a7), so _path_tokens is on main and the worktree claim cleared. Moves the row from planned.md to active.md. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FKSwTBuNwcJc2FPNpSCrkp
Jammy2211
added a commit
that referenced
this pull request
Sep 9, 2026
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FKSwTBuNwcJc2FPNpSCrkp
Jammy2211
added a commit
that referenced
this pull request
Sep 9, 2026
…R#373 + 3) Merged: PyAutoBrain#373 (11aa3f83), euclid_strong_lens_modeling_pipeline#59 (da9ff852), subhalo_validation#1 (ab4bf323), slope_hierarchy_scale#1 (be6e88da). Issue #372 closed. Shadow-window row appended (tier notify, stage 1, merged-unchanged) — count 3/40. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FKSwTBuNwcJc2FPNpSCrkp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
repos_sync.py --writeinstalls the canonical SessionStart hook into every checked-out manifest repo (34), but the only CI leg that drift-checks it (firewall_gate.yml) holds the four organs and skips absent repos by design. Two canonical-hook edits (2026-08-26/27) therefore re-staled the other thirty with nothing seeing it. The thirty were regenerated by hand on 2026-08-28; this PR is the decision record and the mechanism so it does not recur.Decisions recorded (issue #369): non-organ repos keep the hook (a library or workspace opened alone in a web session needs 3.12 like an organ);
euclid_assistantandadmin_jammyare manifest exclusions (session_hook: false) — personal namespace, categories already excluded from the org-wide sweeps, never had a.claude/.What changes:
repos.yaml—session_hook: falseon the two entries, documented besidepackage:.scripts/repos_sync.py—session_hook_excluded,session_hook_counts; the hook leg skips exclusions and prints its denominator:check session-start hooks (generated): OK (34 of 35 checked out, 2 excluded)(on this workspace;autoreduce_workspaceis the one absent in-scope repo)..github/workflows/firewall_gate.yml—policy/session_start_hook.shjoins bothpaths:filters (an edit to the hook did not trigger the gate at all)..github/workflows/session_hook_propagate.yml(new) — on push tomaintouching the hook / the generator / itself, derives the in-scope repos fromrepos.yaml, shallow-clones each withPAT_PYAUTOLABS, callswrite_session_hooksover that tree, and pushes agithub-actions[bot]commit of the two hook files where they changed;workflow_dispatchwithdry_run; a repo whose.gitignoreswallows.claude/is reported failed, not "current"; a generator crash fails the job (caught in simulation — withset -eoff, the loop otherwise reported every clone "already current" and exited 0). The one deviation from the issue plan, callingwrite_session_hooksdirectly rather than the CLI--write, is explained at the call site (the CLI would also rewrite AGENTS.md blocks, run every drift leg on a half-workspace, and print credentialed remotes).euclid_assistant/.claude/left by an earlier--writewas removed from the canonical checkout (nothing was ever on origin).Closes #369. Member of bundle
mind-workflow.API Changes
Internal (Mind organ script, not a released package).
repos_sync.pygainssession_hook_excluded(repo_spec)andsession_hook_counts(root, repos) -> (checked_out, in_scope, excluded);check_session_hooks/write_session_hooksskipsession_hook: falseentries; the manifest schema gains the optional booleansession_hook.See full details below.
Test Plan
python3 -m pytest -q -n auto→ 291 passed (10 new intests/test_session_hook_sync.py;test_repo_that_is_not_checked_out_is_skippeduntouched)python3 scripts/repos_sync.py --check --root ~/Code/PyAutoLabs→ all 14 legs OK, hook leg decorated with the denominatorpython3 scripts/lifecycle.py check→ OKdry_runpushed nothing,.gitignored.claude/reported failedgh workflow run session_hook_propagate.yml -f dry_run=trueonce, read the step summary (expect every repo "already current")Full API Changes (for automation & release notes)
Added
repos_sync.session_hook_excluded(repo_spec)— True for a manifest entry withsession_hook: falserepos_sync.session_hook_counts(root, repos)—(checked_out, in_scope, excluded)for the hook leg's denominatorrepos.yamlper-repo keysession_hook: false(optional boolean)session_hook_propagate.ymlChanged Behaviour
check_session_hooks/write_session_hooksskip excluded repos--checkoutput for thesession-start hooks (generated)leg carries(N of M checked out, K excluded)firewall_gate.ymlalso runs onpolicy/session_start_hook.shGenerated by the PyAutoLabs agent workflow.