Skip to content

codex hooks: register the scheduler action guard for PyAutoBrain - #520

Merged
Jammy2211 merged 2 commits into
mainfrom
chore/scheduler-guard-codex-hook
Oct 31, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
chore/scheduler-guard-codex-hook

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

This registers the scheduler action guard for Codex, the last step of hpc-campaign p5c (PyAutoBrain#547). The guard merged in PyAutoBrain#548, and you approved registration on 2026-10-31.

  • CODEX_HOOK_DEFINITIONS gains scheduler-action-guard, with the matcher Bash. It uses the same PreToolUse payload contract as mind-commit-guard.
  • Brain's codex_hooks in repos.yaml opts in, beside mind-commit-guard.
  • After merge, session_hook_propagate.yml regenerates Brain's .codex/hooks.json. Codex then asks you to trust the new hook hash with /hooks.
  • Claude is already registered in the workspace-root .claude/settings.json, which is local. It was live-tested: a raw scancel was denied.

Tests: tests/test_codex_hook_sync.py, 8 passed.

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits October 31, 2026 11:53
…-campaign p5c)

Human-approved 2026-10-31 (PyAutoBrain#547): the guard merged in
PyAutoBrain#548 refuses raw sbatch/scancel/srun/salloc/mutating scontrol/
autofit.campaign submit outside hpc/sync act. Same payload contract as
mind-commit-guard, so Brain opts in beside it. The Claude registration is
in the workspace-root .claude/settings.json (local).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s the adapters

A PR that adds a Codex hook (this one) or opts a repo in cannot make the
installed .codex/hooks.json on the cloned mains match: session_hook_propagate
writes them after merge, so the leg was red by construction. The fourth
skip, same shape as the hook / where-to-file / organism-map ones (human
pick 2026-10-31):
- a codexpr step renders every repo's adapter from the PR's base tree and
  its head (scripts/codex_hooks_render.py) and sets codex_pr only when they
  differ — never guessed from the changed-file list;
- the compensating control runs test_codex_hook_sync.py and refuses a
  render error; the drift step drops 'generated Codex hooks' with a loud
  banner; on push to main nothing is skipped.
Pinned workflow tests updated; full suite 711 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 01366ca into main Oct 31, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the chore/scheduler-guard-codex-hook branch October 31, 2026 12:38
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