Repository navigation
Cortex pull reads campaign digests; scheduler allowlist + action guard (hpc-campaign p5c) - #548
Merged
Merged
Conversation
…d (hpc-campaign p5c) - cortex pull: a row with campaign_file runs `<sync_cli> status <campaign_file>` in place of `jobs` (squeue), and a row with digest prints what Cortex `sync-runs <key> --dry-run` would change from the pulled digest. Still writes nothing; recording is `cortex.py sync-runs <key>` (decision 64). - AUTONOMY.md "Scheduler actions": `hpc/sync act` is the only way a campaign's jobs start or change (submit, resubmit, hold, release, throttle, update-pending, cancel); submit/push-submit sbatch one hand-written script; read verbs free; actions.log audit contract. - bin/scheduler_action_guard.py: PreToolUse(Bash) hook source for Claude and Codex refusing raw sbatch, scancel, mutating scontrol and `autofit.campaign submit` (direct, over ssh, bash -c/eval, wrappers, chains, substitutions, heredocs fed to a shell). `scontrol show` stays allowed. Source and tests only; not registered. Interfaces: autolens_assistant 271f939 (hpc/sync act), PyAutoCortex#83 (sync-runs). Refs #547 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tch as prefix) Independent review of 2c4b24f: - the trigger pre-filter now reads the command with quotes and backslashes removed, so s\batch / "sb""atch" reach the parser; - ssh options after the host are skipped (ssh ral -t "sbatch j"); - the escape hatch excuses only the clause it prefixes, not a mention anywhere (echo / commit message); - --help/--usage/--version/sbatch --test-only only read and are allowed; - find -exec and parallel are unwrapped. Human rulings 2026-10-31: srun and salloc are refused too; the escape hatch stays; pull stays write-nothing; registration approved, done after merge. Cortex skill names the digest path hpc/sync pulls to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fies skills/hpc_campaign.md CI on #548: the tenant firewall flagged a library name in a comment in _cortex.py. autolens_assistant#174's boundary check (which reads this profile from main) had no side for the new hpc_campaign skill; it is domain content like hpc/* and init-slam. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #547. Merge after autolens_assistant#173 and #174: this PR uses their verb names.
What changes
pull. For a project row withcampaign_file:, it runshpc/sync status <campaign_file>instead ofjobs/squeue. For a row withdigest:, it previewscortex sync-runs <key> --dry-run(PyAutoCortex#83). Pull still writes nothing; recording stays a separatesync-runsstep, by your ruling.hpc/sync act <submit|resubmit|hold|release|throttle|update-pending|cancel>, logged to<project_root>/campaign/<name>/actions.log.hpc/sync submit|push-submitsbatch one hand-written script, outside any campaign. Reading is free.bin/scheduler_action_guard.pyis a PreToolUse(Bash) hook for Claude and Codex. Its I/O contract is the same asmind_commit_guard.py's.sbatch,scancel,srun,salloc, anyscontrolthat changes things, and a rawautofit.campaign submit. That covers the same calls over ssh, inbash -c/eval, behind env/wrappers (xargs,parallel,find -exec), chained, substituted, or in heredocs fed to a shell, and quote/backslash spellings the shell reads as the bare word.scontrol show, help, usage, version,sbatch --test-only, and mentions such as commit messages orgrep.PYAUTO_SKIP_SCHEDULER_GUARD=1stays (your ruling). It works from the environment or as the leading assignment of the command it excuses; a mention elsewhere excuses nothing.test_hygiene_conductor(6) andtest_skill_install(10), which already fail on main da6743f.Not in this PR: registration
You approved registration on 2026-10-31. It follows the merge, because the guard has to exist on main first:
.claude/settings.jsonBash hooksscheduler-action-guardentry toPyAutoMind/scripts/repos_sync.pyCODEX_HOOK_DEFINITIONSand Brain'scodex_hooksinrepos.yamlReview
Independent review (a different model from the author's) found 4 items, no blockers:
sbatchflags were deniedAll 4 are fixed, with tests. The review also confirmed the hook I/O contract, the Cortex CLI and field names, and the pre-existing failures.
Under the Heart RED development override for hpc-campaign phase 5 (2026-10-30). Merge only with green CI and your /prm; no release.
🤖 Generated with Claude Code