run-governor
Skill52 starsChanged 8 months agoMITView on GitHub
Govern run-level execution policy: mode selection, durable run tracking, long-action watch/resume policy, stage reporting, and safety allowances. TRIGGER when: starting a non-trivial research task (set mode + run_id), switching local/remote target, creating a new run, or mode-aware policy decisions needed. DO NOT TRIGGER when: trivial single-step tasks, pure info queries, or run already initialized with no policy change needed.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- deep-researchSkill
- experiment-executionSkill
- human-checkpointSkill
- memory-managerSkill
- paper-writingSkill
- project-contextSkill
- research-planSkill
- research-workflowSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
60 rules. About 0 are common, 38 are distinctive, and 22 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈38
Distinctive · estimate
This author's own choices. Worth a look.
22
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Ask only for hard blockers or major safety risks.
- Distinctive: line 22
Keep ownership until compiled success criteria are met, or a true blocker/safety gate requires interruption.
- Distinctive: line 27
Ask when path is unclear.
- Distinctive: line 28
Ask before high-resource actions.
- Distinctive: line 32
If the user explicitly asks to switch mode, switch immediately.
- Very specific: line 33
If the user says "just do it" or equivalent, treat as a temporary switch to full-auto behavior.
- Very specific: line 34
If mode selection is pending, keep the run in pending-confirmation and do not initialize run artifacts.
- Distinctive: line 35
Never auto-default mode from timeout.
- Very specific: line 36
After mode is selected, do not auto-continue after confirmation timeouts in non-full-auto modes.
- Distinctive: line 41
When the user expresses persistence or target-seeking intent, compile it into run policy rather than treating it as stylistic wording.
- Very specific: line 64
If user intent is persistent-optimization, one edit/test cycle is never sufficient reason to stop.
- Distinctive: line 70
If the target is aspirational but measurable, store both the stretch target and the current promotion gate.
- Distinctive: line 71
If the user asked to preserve strong variants, snapshot best-so-far artifacts before higher-risk changes.
- Distinctive: line 79
If built-in tool is unavailable, degrade to concise plain-text questions.
- Very specific: line 86
ask whether this run executes on local or remote
- Very specific: line 87
if remote, load existing remote fields from project-context
- Distinctive: line 88
ask user whether to reuse stored remote fields for this run
- Distinctive: line 89
if not reused or incomplete, collect only missing remote-required fields
- Very specific: line 91
if shared-memory retrieval/export is in scope, persist resolved shared repo metadata from project-context into the run manifest
- Distinctive: line 106
Before creating any run files or directories, collect and confirm both fields from the user:
- Very specific: line 113
If either confirmation is missing, mark status blocked-awaiting-user-confirmation.
- Distinctive: line 117
If user asks to proceed without specifying values, ask a direct clarification question and remain blocked.
- Distinctive: line 123
Before transitioning from initialization to execution workflow:
- Very specific: line 126
Ensure one memory-manager bootstrap operation is complete:
- Very specific: line 128
If bootstrap is missing, mark status blocked-awaiting-memory-bootstrap.
- Distinctive: line 133
Treat long waits as first-class runtime state, not as something the model should silently "keep waiting" for.
- Very specific: line 145
create an action record under actions/<action_id>.yaml
- Very specific: line 160
if the command is launched locally, capture pid and log path
- Very specific: line 162
if the current session remains active, use a poll loop (model chooses sleep -> watch/poll -> inspect state -> model chooses next sleep)
- Distinctive: line 163
if the action may outlive the current turn, start an external watch loop or automation before ending the turn
- Very specific: line 164
never mark a long_action done without an explicit poll/reconcile step
- Distinctive: line 169
keep ownership after launch
- Distinctive: line 171
after every poll, the agent must continue with monitoring, diagnosis, recovery, result collection, or replan
- Distinctive: line 172
do not hand the task back to the user only because the job is long-running
- Very specific: line 198
if next_poll_at <= now, reconcile action state before planning unrelated work
- Distinctive: line 199
do not assume a long-running command completed only because chat output paused
- Very specific: line 200
if a process ended without a success or failure signal, mark stalled and inspect before continuing
- Very specific: line 201
treat next_poll_at as the model-provided wake-up hint for watchers.
- Very specific: line 202
do not treat a running record as a reason to stop work.
- Very specific: line 208
read active run metadata and the latest working/state.yaml
- Distinctive: line 210
update each action with fresh liveness evidence
- Distinctive: line 213
only continue unrelated planning after active-action handling is complete or explicitly delegated
- Distinctive: line 217
Use one run identifier:
- Distinctive: line 234
Do not mirror heavy runtime artifacts back to local logs by default.
- Distinctive: line 271
Default to one run bound to one primary project.
- Distinctive: line 273
If a user request appears mostly unrelated to the current objective, ask whether to start a new run.
- Distinctive: line 274
If user clearly states "new project/topic", ask to switch run.
- Distinctive: line 278
When a risky action is encountered, provide choices:
- Distinctive: line 285
Treat potential large file deletion as major safety risk.
- Distinctive: line 291
Use approximate decision bands:
- Very specific: line 297
Before any L2 or L3 action:
- Distinctive: line 299
run targeted memory retrieval for relevant procedures and episodes
- Distinctive: line 300
create a long-action record if the job will not finish immediately
- Distinctive: line 304
after launch, remain responsible for monitoring and post-poll handling until a true blocker or completion condition exists
- Very specific: line 311
Update reports/index.md status and timestamp.
- Distinctive: line 313
Do not require user reply just because a stage report was emitted.
- Distinctive: line 338
If initialization occurred before required confirmation:
- Distinctive: line 341
Ask whether to keep or clean the created artifacts.
- Very specific: line 342
Do not continue execution until user re-confirms mode and execution_target.
- Distinctive: line 345
If a long action was launched without a persisted action record:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Run Governor
Mission
Set and enforce run-level execution policy so research runs stay consistent, auditable, durable across long waits, and mode-aware.
Mode Selection Policy
At the start of a research run, ask the user to choose one mode:
full-auto- Minimize user interruptions.
- Ask only for hard blockers or major safety risks.
- Keep ownership until compiled success criteria are met, or a true blocker/safety gate requires interruption.
moderate(recommended)- Confirm during plan finalization.
- Confirm before high-resource actions.
detailed- Ask when path is unclear.
- Ask before high-resource actions.
Additional rules:
- If the user explicitly asks to switch mode, switch immediately.
- If the user says "just do it" or equivalent, treat as a temporary switch to
full-autobehavior. - If mode selection is pending, keep the run in
pending-confirmationand do not initialize run artifacts. - Never auto-default mode from timeout. A mode must be explicitly confirmed by the user before initialization.
- After mode is selected, do not auto-continue after confirmation timeouts in non-
full-automodes. - While confirmation is pending, read-only intake, code inspection, and evidence gathering are allowed; creating run artifacts or launching jobs is not.
Persistent Completion Policy
When the user expresses persistence or target-seeking intent, compile it into run policy rather than treating it as stylistic wording.
Trigger phrases include examples such as:
- "keep iterating"
- "do not stop"
- "until target"
- "try many iterations"
- "optimize until it works"
- "reach 90%/100%" or similar target metrics
Required policy fields:
execution_intent:single-pass|persistent-optimizationcompletion_policy:normal|until-target-or-hard-blockerdone_guard:normal|forbid_done_if_target_unmetpromotion_gates: ordered thresholds such as "pass 30-case regression before 100-case sweep"non_regression_guards: conditions that must not degrade materiallybackup_policy: when to snapshot best-so-far prompts/configs/code/results
Rules:
full-autocontrols interruption frequency; it does not weaken persistence requirements.- If user intent is
persistent-optimization, one edit/test cycle is never sufficient reason to stop. - In
full-autopluspersistent-optimization, remain in the execution loop until one of these is true:- compiled hard targets are met
- a true hard blocker remains after reasonable recovery attempts
- a major safety/resource gate requires approval
- the user explicitly stops or changes the objective
- If the target is aspirational but measurable, store both the stretch target and the current promotion gate.
- If the user asked to preserve strong variants, snapshot best-so-far artifacts before higher-risk changes.
Interaction Transport Policy
For user confirmations required by run initialization:
- Route confirmation requests through
human-checkpoint. - In
moderateordetailed, prefer built-in user-question tool (request_user_input). - If built-in tool is unavailable, degrade to concise plain-text questions.
- Record the channel as
interaction_transport=request_user_input|plain-text-fallback.
Execution Target Bootstrap
During run initialization, decide execution target before planning launch steps:
- ask whether this run executes on
localorremote - if
remote, load existing remote fields fromproject-context - ask user whether to reuse stored remote fields for this run
- if not reused or incomplete, collect only missing remote-required fields
- persist the final decision and resolved paths into run manifest and project-context
- if shared-memory retrieval/export is in scope, persist resolved shared repo metadata from
project-contextinto the run manifest
Remote-required fields:
execution.runtime_hostexecution.runtime_project_rootcluster.schedulerwhen scheduler-based launch is selected
Mode rules:
full-auto: if stored remote fields are complete, reuse by default; ask only on hard blockers.moderateanddetailed: explicitly confirm reuse choice.
Mandatory Human Confirmation Gate
Before creating any run files or directories, collect and confirm both fields from the user:
user_confirmed_modein{full-auto|moderate|detailed}user_confirmed_execution_targetin{local|remote}
Hard constraints:
- If either confirmation is missing, mark status
blocked-awaiting-user-confirmation. - While blocked, do not create
run_id, run directories, manifests, policy files, working files, reports, runtime snapshots, or background watchers. moderateis only a recommendation label and cannot be applied unless user-confirmed.- For
moderateordetailed, ask via built-in question tool first; if unavailable, use plain-text fallback. - If user asks to proceed without specifying values, ask a direct clarification question and remain blocked.
- Confirmation collection must be mediated by
human-checkpoint. - Any assumption for mode/target is non-compliant, even when likely.
Memory Bootstrap Gate
Before transitioning from initialization to execution workflow:
- Set
memory_policy=experience-first-continuousunless user explicitly overrides. - Ensure one
memory-managerbootstrap operation is complete:retrieveorinit-workingfor current project/task context.
- If bootstrap is missing, mark status
blocked-awaiting-memory-bootstrap. - This gate enforces bootstrap plus retrieval policy declaration; ongoing retrieval cadence is enforced by
research-workflowandmemory-manager.
Durable Execution Policy
Treat long waits as first-class runtime state, not as something the model should silently "keep waiting" for.
Classify an action as long_action when any is true:
- expected duration is over 5 minutes
- action launches training, evaluation, inference batches, indexing, or remote jobs
- action uses
sleep, async polling, or scheduler submission - action is high-resource (
L2orL3) - action likely outlives the current model turn
For every long_action, do all of the following before waiting:
- create an action record under
actions/<action_id>.yaml - persist:
action_idstatuskindcommandcwdexpected_duration_secondspoll_interval_secondslaunch_timelast_heartbeatnext_poll_atsuccess_signalfailure_signalresume_step
- if the command is launched locally, capture
pidand log path - immediately enter
watch mode- if the current session remains active, use a poll loop (
model chooses sleep -> watch/poll -> inspect state -> model chooses next sleep) - if the action may outlive the current turn, start an external watch loop or automation before ending the turn
- if the current session remains active, use a poll loop (
- never mark a
long_actiondone without an explicit poll/reconcile step - choose an initial poll interval, but keep control with the model
- scripts may store the chosen interval and suggested next poll time
- scripts must not become the primary owner of polling strategy
- the model may shorten or lengthen the next sleep after each poll
- keep ownership after launch
- launching a job is not sufficient completion
- after every poll, the agent must continue with monitoring, diagnosis, recovery, result collection, or replan
- do not hand the task back to the user only because the job is long-running
Allowed liveness states:
pendingrunningstalledfailedcompletedcancelled
Active Run Registry
Maintain these durable records in <codex-cwd>/logs/runs/<run_id>/:
actions/index.json- list of active and historical
action_ids - last sweep time
- list of active and historical
actions/<action_id>.yaml- one persisted record per long action
actions/watch.log- optional watcher loop output
Registry rules:
- scan the registry before each new planning cycle
- if
next_poll_at <= now, reconcile action state before planning unrelated work - do not assume a long-running command completed only because chat output paused
- if a process ended without a success or failure signal, mark
stalledand inspect before continuing - treat
next_poll_atas the model-provided wake-up hint for watchers; do not busy-wait - do not treat a
runningrecord as a reason to stop work; it is a reason to stay in watch mode
Resume Gate
At the start of every resumed run or fresh model turn:
- read active run metadata and the latest
working/state.yaml - reconcile all
pending|running|stalledactions - update each action with fresh liveness evidence
- restore the next safe step from
resume_steporworking.next_step - immediately branch into watch continuation, result collection, diagnosis, or replan based on reconciled action state
- only continue unrelated planning after active-action handling is complete or explicitly delegated
Run Identity and Directories
Use one run identifier:
run_id = <YYYYMMDD_HHMMSS>-<query-slug>
Prerequisite:
run_idcreation is allowed only afteruser_confirmed_modeanduser_confirmed_execution_targetare present.
Create and maintain:
- Control logs and reports:
<codex-cwd>/logs/runs/<run_id>/
- Runtime execution outputs:
<runtime_project_root>/runs/<run_id>/
- Project context state:
<local_project_root>/.project_local/<project_slug>/
Do not mirror heavy runtime artifacts back to local logs by default.
Run Files
Maintain these files in <codex-cwd>/logs/runs/<run_id>/:
run_policy.yaml- mode
- execution intent and completion policy
- compiled target gates and non-regression guards
- done guard and backup policy
- high-resource heuristic bands
- safety policy notes
- per-run action allowances
- watch policy
run_manifest.yaml- local project root
- runtime project root
- runtime output root
- execution target (
local|remote) - runtime host (if remote)
- shared memory repo path/url/branch/sync policy when configured
- optional additional project roots
- output directory mapping
working/state.yaml- objective, current phase, hypothesis, blockers, next step, active action ids
working/todo.yamltodo_active,todo_done,todo_blocked
actions/index.json- active action registry
actions/<action_id>.yaml- durable long-action state
reports/index.md- stage list with status (
done|running|blocked), file paths, and last update time
- stage list with status (
Multi-Project and New-Topic Policy
- Default to one run bound to one primary project.
- Allow multiple project roots in one run only when they serve the same objective.
- If a user request appears mostly unrelated to the current objective, ask whether to start a new run.
- If user clearly states "new project/topic", ask to switch run.
Safety and Allowance Policy
When a risky action is encountered, provide choices:
- allow once
- allow same action type for this run
- disallow and stop
- user-defined handling
Treat potential large file deletion as major safety risk.
In full-auto, do not interrupt for non-major risks. Continue and record rationale in stage reports.
High-Resource Heuristic
Use approximate decision bands:
L1low: typically under 2 GPU-hours and under 20 USD equivalent.L2medium: roughly 2-10 GPU-hours or 20-100 USD equivalent.L3high: over 10 GPU-hours, over 100 USD equivalent, or long multi-node runs.
Before any L2 or L3 action:
- run targeted memory retrieval for relevant procedures and episodes
- create a long-action record if the job will not finish immediately
- persist a watch plan and a model-selected poll interval
- in
moderateanddetailed, confirm before launch - in
full-auto, proceed unless major safety risk is present - after launch, remain responsible for monitoring and post-poll handling until a true blocker or completion condition exists
Stage Reporting Contract
At each stage completion:
- Save one stage report file under
reports/. - Update
reports/index.mdstatus and timestamp. - In chat, provide a detailed stage summary plus report path.
- Do not require user reply just because a stage report was emitted.
- Include active long-action status when the stage depends on background work.
Required Output for Run-Governor Operations
For each run-governor action, emit:
Run: run_id and active modeAction: initialize, switch-mode, update-policy, new-topic-check, resume, watch-update, or stage-reportDecision: what was chosen and whyExecution: local/remote choice and reuse decisionPaths: affected control/output/context pathsCompletion: execution intent, completion policy, done guard, and active promotion gateNext: next actionable stepConfirmation:user_confirmed_mode,user_confirmed_execution_target, and whether initialization is permitted (YES|NO)Compliance:gate_status=pass|blocked, with blocked reason when applicableInteraction:interaction_transportand optionalfallback_reasonMemory:memory_policyandmemory_bootstrap_done=YES|NOLiveness: active action count, newly launched action ids, and whether reconciliation is clean (YES|NO)Watch:watch_mode=session-loop|external-loop|noneand next poll time when applicablePolling: current interval, next poll time, and whether the model revised the interval this cycleFollowup:continue-watch|collect-results|diagnose-stall|diagnose-failure|replan|checkpoint
Violation Recovery Policy
If initialization occurred before required confirmation:
- Immediately acknowledge non-compliance.
- Ask whether to keep or clean the created artifacts.
- Do not continue execution until user re-confirms
modeandexecution_target. - Record the incident and recovery choice in the next stage report.
If a long action was launched without a persisted action record:
- Stop normal planning.
- Reconstruct and persist the missing action record immediately.
- Reconcile log, pid, and latest output before continuing.
- Record the recovery step in the next stage report.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

