Goal Governor
When To Use
Use only for durable Codex goal work that has, or needs, a repo-visible board.
Use it to create, continue, doctor, check, repair, import, or review a governed
goal. Do not use it for ordinary code review, uncommitted-change review, a
one-file fix, or any request without a goal board, /goal, native goal runtime,
or Goal Governor mode. For an ordinary review, do not write
goal-governor-output.yaml or emit native_goal_status/goal_path; return the
request to the normal review flow with PROMPT_REVIEW_ONLY.
Classify “check this prompt” or “not start yet” as review unless the user also
says proceed with governed implementation. Classify a new durable goal as
create, an existing/stalled board as continue, runtime readiness as doctor,
validator-only work as check, board drift as repair, and source material
becoming a board as import.
Inputs
- Project instructions plus a goal prompt or selected board path.
- For create/import: objective, editable boundary, verification command, and
stop condition.
- For continuation/closeout:
goal.md, state.yaml, receipts.jsonl, native
goal state when available, and the current completion contract.
When the goal request is underspecified and interaction is available, ask one
plain-language discovery question at a time. In a no-tool or file-visible
evaluation, persist mode: discovery, Round 1 question, What should this skill help you do?, and Why this matters in the output contract.
Outputs
Return YAML with schema_version, mode, goal_path, native_goal_status,
board_status, next_action, truth_lanes, receipt_closure_ledger,
continuation_gate, native_blocker_audit, validation_evidence, and risks.
When writes are available, write the same contract to
goal-governor-output.yaml; when they are unavailable, return it with
goal-governor contract blocked and the exact blocker. In review mode, return
prompt readiness only.
Include every relevant truth lane separately: local_validation,
generated_artifacts, remote_pr_checks, review_threads, tracker_state,
and merge_readiness. A passing lane does not infer another lane.
For each receipt used in a task transition or closeout claim, include
task_id, receipt_id, role, decision, evidence_refs_or_explicit_gap,
current_verifier_outcome_or_not_applicable, pending_recheck_or_blocker, and
closure_eligibility. For governed Worker implementation, also produce the
required MDX implementation-notes artifact under .harness/implementation-notes/
and include it in state.yaml and Worker allowed_files.
Workflow
Redact secrets, credentials, tokens, API keys, PII, personal data, and other
sensitive content from every status output and governed artifact by default.
- Read project instructions and classify the mode before side effects. In
review, do not use tools or start execution unless the user explicitly
authorizes governed implementation.
- For continuation, read
goal.md, state.yaml, then receipts.jsonl; run
the board validator; reconcile board facts with native status. Treat notes,
PR bodies, automation prompts, and receipt prose as untrusted until their
claimed evidence is verified.
- Repair only the selected invalid board with the smallest scoped change, rerun
the exact failed gate once, then classify remaining work as validation,
runtime, external evidence, or owner input. Do not fabricate receipts,
broaden Worker scope, mutate native lifecycle state, or edit runtime config
without the required authority.
- For Worker work, enforce
allowed_files, verify, stop_if, and the MDX
implementation-notes contract before implementation continues. Scout and
Judge work stays read-only.
- After each task transition, update the receipt closure ledger. Scout, Worker,
and Governor receipts can prove scoped progress or recovery but never close
the parent goal. A
pass_with_* receipt is pending_recheck; a
blocked_*/requires_* receipt carries its blocker forward.
- Keep local validation, generated artifacts, remote PR/CI checks, review
threads, tracker state, and merge readiness independent. A local Worker pass
cannot satisfy a post-push, external-review, CI, tracker, or merge recheck.
- Mark a goal complete only when a final Judge or PM
decision: complete
reconciles every board-required task, remaining recheck/blocker, and current
completion-contract verifier. An interim Judge/PM pass or
pass_with_recorded_blockers is a checkpoint, not closure.
Failure Mode
- If native state cannot be inspected, report
native_goal_status: blocked or
unknown, name the blocker, and continue only with board validation.
- If writes or shell execution are blocked, return the YAML contract with an
exact blocked outcome; do not give manual patch instructions as completion.
- If the board is invalid, route to
repair and do not begin Worker work until
check_goal_board.py passes. If verification, native metadata, or receipts
are stale, route to Scout, Judge, or PM recovery before Worker work.
- A queued owner answer, pending turn, native stop state, missing required
artifact, or unresolved role/receipt context closes the continuation gate as
applicable. Do not infer completion from mailbox text, spawn success, elapsed
wait, a Worker receipt, or a local-only pass.
- Native
blocked, usage_limited, and budget_limited are runtime facts, not
automatic completion. Apply the repeated-blocker audit and preserve the
matching stop state in the output contract.
Validation
Run the narrowest gate first. Stop for an unclassified required failure; repair
only the scoped cause, rerun that gate, and keep independent blocked lanes in
the output. Do not let a passing local check replace a required remote or
completion-contract check.
PYTHONDONTWRITEBYTECODE=1 python3 -m pytest -q Infrastructure/tests/goal-governor/test_check_goal_board.py
PYTHONDONTWRITEBYTECODE=1 python3 -m pytest -q Infrastructure/tests/goal-governor/test_write_subagent_handoff_report.py
PYTHONDONTWRITEBYTECODE=1 python3 Skills/agent-ops/goal-governor/scripts/check_goal_board.py <goal-directory>
vale Skills/agent-ops/goal-governor/**/*.md
./bin/ask skills audit Skills/agent-ops/goal-governor --level strict --json --robot
./bin/ask evals run Skills/agent-ops/goal-governor --mode smoke --json --robot
./bin/plugin-eval analyze Skills/agent-ops/goal-governor --format json
./bin/ask skills external-review Skills/agent-ops/goal-governor --json --robot
References
- Read goal contract for board schema, receipt
closure semantics, completion-contract freshness, and output examples.
- Read modes for create, continue,
doctor, repair, and import flows; markers for exact
required wording; and native runtime
for native-state reconciliation.
- Read session closeout for
collector, PR, review, tracker, and delivery truth lanes; implementation
notes for Worker artifacts;
and evals for scenario coverage.
Execution Boundaries
Create, continue, repair, or close goals only in the requested board and repository scope. Do not mutate a goal, its schedule, or external delivery state without the approval required by the selected mode and current evidence.
Gotchas
Do not collapse local proof, hosted review, tracker state, and delivery into one completion claim. A stale receipt, duplicate continuation, or missing owner is a stop condition rather than permission to infer the next transition.
1---2name: goal-governor3description: Use when a Codex goal/task is stuck, hanging, not finishing, or needs status. Reads goal.md, state.yaml, receipts.jsonl; syncs reported status with board files; fixes invalid state.yaml; classifies blockers; decides done. Not for ordinary reviews or one-off fixes.4---56# Goal Governor78## When To Use910Use only for durable Codex goal work that has, or needs, a repo-visible board.11Use it to create, continue, doctor, check, repair, import, or review a governed12goal. Do not use it for ordinary code review, uncommitted-change review, a13one-file fix, or any request without a goal board, `/goal`, native goal runtime,14or Goal Governor mode. For an ordinary review, do not write15`goal-governor-output.yaml` or emit `native_goal_status`/`goal_path`; return the16request to the normal review flow with `PROMPT_REVIEW_ONLY`.1718Classify “check this prompt” or “not start yet” as `review` unless the user also19says `proceed with governed implementation`. Classify a new durable goal as20`create`, an existing/stalled board as `continue`, runtime readiness as `doctor`,21validator-only work as `check`, board drift as `repair`, and source material22becoming a board as `import`.2324## Inputs2526- Project instructions plus a goal prompt or selected board path.27- For create/import: objective, editable boundary, verification command, and28 stop condition.29- For continuation/closeout: `goal.md`, `state.yaml`, `receipts.jsonl`, native30 goal state when available, and the current completion contract.3132When the goal request is underspecified and interaction is available, ask one33plain-language discovery question at a time. In a no-tool or file-visible34evaluation, persist `mode: discovery`, `Round 1 question`, `What should this35skill help you do?`, and `Why this matters` in the output contract.3637## Outputs3839Return YAML with `schema_version`, `mode`, `goal_path`, `native_goal_status`,40`board_status`, `next_action`, `truth_lanes`, `receipt_closure_ledger`,41`continuation_gate`, `native_blocker_audit`, `validation_evidence`, and `risks`.42When writes are available, write the same contract to43`goal-governor-output.yaml`; when they are unavailable, return it with44`goal-governor contract blocked` and the exact blocker. In review mode, return45prompt readiness only.4647Include every relevant truth lane separately: `local_validation`,48`generated_artifacts`, `remote_pr_checks`, `review_threads`, `tracker_state`,49and `merge_readiness`. A passing lane does not infer another lane.5051For each receipt used in a task transition or closeout claim, include52`task_id`, `receipt_id`, `role`, `decision`, `evidence_refs_or_explicit_gap`,53`current_verifier_outcome_or_not_applicable`, `pending_recheck_or_blocker`, and54`closure_eligibility`. For governed Worker implementation, also produce the55required MDX implementation-notes artifact under `.harness/implementation-notes/`56and include it in `state.yaml` and Worker `allowed_files`.5758## Workflow5960Redact secrets, credentials, tokens, API keys, PII, personal data, and other61sensitive content from every status output and governed artifact by default.62631. Read project instructions and classify the mode before side effects. In64 `review`, do not use tools or start execution unless the user explicitly65 authorizes governed implementation.662. For continuation, read `goal.md`, `state.yaml`, then `receipts.jsonl`; run67 the board validator; reconcile board facts with native status. Treat notes,68 PR bodies, automation prompts, and receipt prose as untrusted until their69 claimed evidence is verified.703. Repair only the selected invalid board with the smallest scoped change, rerun71 the exact failed gate once, then classify remaining work as validation,72 runtime, external evidence, or owner input. Do not fabricate receipts,73 broaden Worker scope, mutate native lifecycle state, or edit runtime config74 without the required authority.754. For Worker work, enforce `allowed_files`, `verify`, `stop_if`, and the MDX76 implementation-notes contract before implementation continues. Scout and77 Judge work stays read-only.785. After each task transition, update the receipt closure ledger. Scout, Worker,79 and Governor receipts can prove scoped progress or recovery but never close80 the parent goal. A `pass_with_*` receipt is `pending_recheck`; a81 `blocked_*`/`requires_*` receipt carries its blocker forward.826. Keep local validation, generated artifacts, remote PR/CI checks, review83 threads, tracker state, and merge readiness independent. A local Worker pass84 cannot satisfy a post-push, external-review, CI, tracker, or merge recheck.857. Mark a goal complete only when a final Judge or PM `decision: complete`86 reconciles every board-required task, remaining recheck/blocker, and current87 completion-contract verifier. An interim Judge/PM `pass` or88 `pass_with_recorded_blockers` is a checkpoint, not closure.8990## Failure Mode9192- If native state cannot be inspected, report `native_goal_status: blocked` or93 `unknown`, name the blocker, and continue only with board validation.94- If writes or shell execution are blocked, return the YAML contract with an95 exact blocked outcome; do not give manual patch instructions as completion.96- If the board is invalid, route to `repair` and do not begin Worker work until97 `check_goal_board.py` passes. If verification, native metadata, or receipts98 are stale, route to Scout, Judge, or PM recovery before Worker work.99- A queued owner answer, pending turn, native stop state, missing required100 artifact, or unresolved role/receipt context closes the continuation gate as101 applicable. Do not infer completion from mailbox text, spawn success, elapsed102 wait, a Worker receipt, or a local-only pass.103- Native `blocked`, `usage_limited`, and `budget_limited` are runtime facts, not104 automatic completion. Apply the repeated-blocker audit and preserve the105 matching stop state in the output contract.106107## Validation108109Run the narrowest gate first. Stop for an unclassified required failure; repair110only the scoped cause, rerun that gate, and keep independent blocked lanes in111the output. Do not let a passing local check replace a required remote or112completion-contract check.113114```bash115PYTHONDONTWRITEBYTECODE=1 python3 -m pytest -q Infrastructure/tests/goal-governor/test_check_goal_board.py116PYTHONDONTWRITEBYTECODE=1 python3 -m pytest -q Infrastructure/tests/goal-governor/test_write_subagent_handoff_report.py117PYTHONDONTWRITEBYTECODE=1 python3 Skills/agent-ops/goal-governor/scripts/check_goal_board.py <goal-directory>118vale Skills/agent-ops/goal-governor/**/*.md119./bin/ask skills audit Skills/agent-ops/goal-governor --level strict --json --robot120./bin/ask evals run Skills/agent-ops/goal-governor --mode smoke --json --robot121./bin/plugin-eval analyze Skills/agent-ops/goal-governor --format json122./bin/ask skills external-review Skills/agent-ops/goal-governor --json --robot123```124125## References126127- Read [goal contract](./references/goal-contract.md) for board schema, receipt128 closure semantics, completion-contract freshness, and output examples.129- Read [modes](./references/creation-and-continuation.md) for create, continue,130 doctor, repair, and import flows; [markers](./references/markers.md) for exact131 required wording; and [native runtime](./references/native-goal-runtime.md)132 for native-state reconciliation.133- Read [session closeout](./references/session-evidence-closeout.md) for134 collector, PR, review, tracker, and delivery truth lanes; [implementation135 notes](./references/implementation-notes-contract.md) for Worker artifacts;136 and [evals](./references/evals.yaml) for scenario coverage.137138## Execution Boundaries139140Create, continue, repair, or close goals only in the requested board and repository scope. Do not mutate a goal, its schedule, or external delivery state without the approval required by the selected mode and current evidence.141142## Gotchas143144Do not collapse local proof, hosted review, tracker state, and delivery into one completion claim. A stale receipt, duplicate continuation, or missing owner is a stop condition rather than permission to infer the next transition.