Proof Orchestrator
Role
Run proof work across three interfaces:
- Internal: Codex owns the local search, falsification, correctness audit,
notation audit, exposition, and run record. Complete every concrete local next
action that remains justified and feasible.
- External: When the internal search is operationally exhausted, package
the verified setting, attempted routes, strongest partial results, and
smallest unresolved blocker for an external solver. No provider is the
default.
- User: Keep the user informed at meaningful decision points and preserve
their authority over theorem changes, source disclosure, provider choice,
uploads, browser operation, and paid calls.
External help follows the Internal Exhaustion Gate below, unless the user
explicitly requests earlier consultation. In either case, first prepare an
audit-ready local account of what is known and what remains unresolved.
For GPT Pro, Claude/Fable, or any other external solver, use an available authorized adapter or give the user a manual handoff. If the user selects GPT Pro and asks Codex to perform the call, load call-gpt-pro.
Run Directory And Canonical Record
Keep each run under:
mindflows/<YYMMDDHH-num>/
Use only the files needed by the run:
task.md # precise theorem or proof obligation
materials.md # definitions, givens, notation, and source excerpts
local-proof.md # Codex's proof attempt or isolated blocker
approach-registry.md # optional route portfolio for difficult proof searches
sources/ # stable local source snapshots
source-manifest.md # source role, disclosure status, and external filename
external-brief.md # provider-neutral problem and evidence package
provider-prompt.md # optional provider/interface-specific rendering
handoff.md # chosen route, authority, transfer order, and status
external-output.md # returned answer, kept as raw evidence
audit.md # correctness and source-alignment audit
final.md # verified, simplified, user-facing proof
codex-ledger.md # run state and provenance, optional
next.md # next narrow obligation, optional
Use only the files the run needs. external-brief.md is the canonical,
provider-neutral handoff. Create provider-prompt.md only when a selected
provider or interface requires a distinct rendering.
Do not create provider-specific prompts, handoff.md, or remote project state
before the local attempt unless the user explicitly requests an external
handoff. Preparing a local external-brief.md after the Internal Exhaustion
Gate passes does not itself authorize external contact.
Continuing a Project
Treat an existing run, next*.md, redo*.md, or continuation artifact as a project continuation. First read any prior next/redo/continuation files that exist. Treat completed run artifacts and prior external conversations as append-only evidence; do not overwrite them.
Always create a new run directory for new proof work. Record the prior run ID, the exact files read, inherited proved/conjectural/rejected claims, preserved sources, and the single current obligation.
When inheriting an approach registry, preserve family identities and blocker-strength classifications. Keep a blocked route blocked unless the new run records a valid novelty key under references/portfolio-search.md.
If a continuation reaches external consultation, prepare a new
external-brief.md for the current obligation. Reuse prior sources only after
checking that they still match the frozen target. Prefer a fresh external
conversation unless handoff.md explains why prior context is required.
Status Labels
Use these labels in codex-ledger.md, audit.md, or handoff.md:
INTERNAL_ATTEMPT
INTERNAL_PROVED
INTERNAL_EXHAUSTED
INTERNAL_STOPPED_WITH_ACTIONS_REMAINING
ASK_USER
READY_FOR_EXTERNAL_BRIEF
READY_FOR_MANUAL_HANDOFF
READY_FOR_AUTHORIZED_DISPATCH
WAITING_FOR_EXTERNAL_OUTPUT
EXTERNAL_OUTPUT_RECEIVED
NEEDS_EXTERNAL_FOLLOWUP
AUDIT_FAILED
READY_FOR_USER
Notation Gate
When the user asks about notation or symbols, when the proof is theorem-heavy, or when one proof step contains at least five nonstandard symbols, read references/notation-audit.md and include this exact scorecard in audit.md or the user-facing audit:
Core semantic objects retained: <retained>/<declared> (<percent>)
Undefined symbols: <count>
Symbol collisions: <count>
One-use definitions: <count>/<all new symbols> (<percent>)
Maximum parallel representations of one object: <count>
Maximum alias-chain depth: <count>
Maximum active nonstandard symbols in one proof step: <count>
Do not rename, merge, omit, or replace these lines with other useful findings. Report logical gaps, domain errors, and irrelevant notation after the fixed scorecard. Core-object retention must be 100%, and undefined symbols and collisions must both be zero before READY_FOR_USER.
Never improve the scorecard by inventing a definition, domain, assumption, identity, or relation that the source does not supply. If an undefined symbol or missing implication cannot be resolved from authoritative material, keep it in the audit, mark the proof AUDIT_FAILED or ASK_USER, and rewrite only the valid fragment or the diagnosis.
Derivation Structure Gate
For every nontrivial derivation, organize the user-facing proof from the target downward, even if the proof was discovered bottom-up:
- State the target and its role: "To prove A, it is enough to establish B, C, and D," together with the lemma, identity, or inference that makes those subgoals sufficient.
- Derive each immediate subgoal and state where it comes from: an assumption, definition, prior lemma, or an explicitly shown calculation.
- If a subgoal has its own dependencies, expand it in the same target-first form. Order dependent subgoals by their true dependency relation rather than presenting a misleading flat list.
- Recombine the established subgoals and explicitly return to the original target.
This is an exposition rule, not a license to reverse an implication or hide a gap. Check that the dependency graph is acyclic, every reduction is justified, and no subgoal silently assumes the target. Do not force this scaffold onto a one-step argument where it would add more ceremony than clarity.
Record Top-down derivation structure: PASS, FAIL, or NOT_APPLICABLE in audit.md. A nontrivial derivation cannot be READY_FOR_USER while this gate is FAIL.
Search Portfolio Gate
For a research-level, open-ended, or repeatedly stalled obligation, read
references/portfolio-search.md before committing to one proof route. Create
approach-registry.md, compare routes by their mathematical mechanism, classify
the strength of every central blocker, and run task-specific adversarial checks.
For a routine proof with a direct path, skip this gate and do not create the
registry.
An expected answer is a search direction, not a proof premise. Do not assume a
theorem is true merely because the user, benchmark, or prior model output says a
proof exists. Use independent workers only when they are explicitly authorized
and available; the gate must also work as a sequential local search.
Three-Interface Contract
Internal Interface
The local run is the canonical source of truth. Follow the Search Portfolio and
Internal Exhaustion Gates where applicable, record both positive and negative
evidence, and perform Codex's own correctness audit. A second model never
substitutes for that audit.
External Interface
External interaction begins from the provider-neutral external-brief.md
specified in the External Handoff Contract. Choose a provider only after the
mathematical role is clear. The provider may
be GPT Pro, Claude/Fable, another model, a human expert, a theorem prover, or a
specialized service. Record the choice and reason in handoff.md. Provider-
specific connection instructions belong in the selected adapter or
provider-prompt.md; they must not determine the core proof workflow.
User Interface
Report ambiguity, missing information, a genuine blocker, justified external
help, and the audited external result. Ask before changing the theorem,
disclosing non-approved material, choosing materially different external routes,
operating a browser, uploading files, sending messages, or spending credit. If
user information is the blocker, mark ASK_USER. Before external contact,
provide the decision record required in workflow step 6.
Internal Exhaustion Gate
INTERNAL_EXHAUSTED means operationally exhausted under the frozen target,
available local tools and sources, and any explicit user budget. It does not
claim that no proof exists or that all mathematics has been searched.
The gate passes only when all of the following are recorded in audit.md or
codex-ledger.md:
- The exact target, assumptions, quantifiers, conventions, and allowed sources
are frozen; missing user choices or sources have been separated from proof
difficulty.
- Codex attempted the actual completion task and audited every claimed result,
rather than stopping after a difficulty probe or delegating the original
theorem unchanged.
- For a routine task, the direct route and its natural repairs were completed,
rejected, or reduced to an exact blocker. For a research-level, open-ended,
or repeatedly stalled task, the Search Portfolio Gate was applied.
- Every approach family is
CANDIDATE, BLOCKED, or REJECTED; each blocked
family has a smallest blocker, blocker-strength classification, and attempted
falsification. No family remains merely EXPLORING.
- No concrete local next action remains that is both relevant and feasible.
Unused actionable ideas, unchecked hypotheses, or unrun decisive checks mean
the gate fails.
- The strongest locally proved result, the exact residual obligation, and
Equivalent-strength blocker: <YES|NO|UNKNOWN> are recorded.
- The reason for stopping is epistemic rather than cosmetic: additional local
work would require a new mechanism, a missing authoritative source, a user
decision, unavailable capability, or effort beyond an explicit budget.
If work stops because of a user or environment budget while concrete actions
remain, use INTERNAL_STOPPED_WITH_ACTIONS_REMAINING, list those actions, and
do not claim exhaustion. External consultation may still be offered if the user
requests it, but the handoff must disclose that local search was truncated.
If the user explicitly requests external consultation before this gate passes,
honor the request within its authorization boundary, but mark the exception in
handoff.md and include the untried local actions in external-brief.md.
Workflow
Default route: freeze target -> maintain evidence -> exhaust actionable internal
work -> local correctness audit -> exposition edit -> final. When the Internal
Exhaustion Gate passes: prepare a provider-neutral external brief -> report the
decision record to the user -> use the user-selected manual or authorized route
-> ingest raw output -> return to internal proof and audit -> final.
- Freeze the target.
- Decide whether the request is new or a continuation.
- State the exact theorem, assumptions, quantifiers, and allowed sources.
- Do not broaden or repair the theorem silently.
- Maintain local evidence.
- Read only the files needed to understand the target.
- Copy stable, directly relevant snapshots into
sources/ when the original may change or cannot be referred to reliably.
- Keep private run materials in the run directory, never in the skill package.
- Run the internal proof search.
- Try to complete the actual proof, disproof, counterexample, or diagnosis; do not stop at a difficulty probe.
- Check definitions, boundary cases, domains, support, topology, quantifiers, and imported theorem hypotheses.
- Write
local-proof.md with the conclusion, proof attempt, dependencies, and any unresolved gap.
- Apply the Search Portfolio Gate when it applies, and continue while a relevant, feasible concrete next action remains.
- Audit and classify the internal result.
- Verify every theorem, lemma, reduction, equality, bound, constant, and quantifier against the stated assumptions and local sources.
- Distinguish proved, imported, conjectural, repaired, and unsupported statements.
- For an unresolved run, record
Equivalent-strength blocker: YES, NO, or UNKNOWN in audit.md or codex-ledger.md and justify the classification.
- If the exact target passes audit, mark
INTERNAL_PROVED and continue to exposition.
- If information or a theorem choice is missing, mark
ASK_USER and present the smallest question that changes the proof state.
- Otherwise apply the Internal Exhaustion Gate and use its status rules. If it does not pass, return to step 3. Optional external review remains additional evidence, not a substitute for Codex's audit.
- Edit the proof for exposition.
- Apply the Notation and Derivation Structure Gates when they apply.
- Lead with the conclusion, preserve each core semantic object, and retain every non-obvious logical dependency.
- Prefer a short direct argument to decorative formalism; do not polish an unresolved gap into an apparently complete proof.
- Prepare the external brief only when justified.
- Proceed only under the condition and exception rules in the Internal Exhaustion Gate.
- Complete the External Handoff Contract below and mark
READY_FOR_EXTERNAL_BRIEF.
- Before contact, present what is proved locally, what was tried, what remains, why further local work is not actionable, what would be shared, and the available manual or authorized-dispatch routes. If a consequential choice remains open, mark
ASK_USER while retaining the readiness event.
- Select and authorize the external route.
- Record the route and authority in
handoff.md as required by the External Handoff Contract.
- For a manual route, provide transfer instructions and mark
READY_FOR_MANUAL_HANDOFF; after transfer, mark WAITING_FOR_EXTERNAL_OUTPUT.
- For Codex-operated dispatch, require explicit current authority, mark
READY_FOR_AUTHORIZED_DISPATCH, and load the relevant adapter skill. After sending, mark WAITING_FOR_EXTERNAL_OUTPUT.
- Ingest the returned material as evidence.
- Save user-pasted or Codex-retrieved text as
external-output.md or the provider-specific filename recorded in handoff.md.
- Mark
EXTERNAL_OUTPUT_RECEIVED and apply only the formatting repairs allowed below before mathematical auditing.
- Record the provider, conversation or task identifier when available, files actually disclosed, prompt actually sent, and whether the response is complete.
- Re-enter the internal loop.
- Audit every external claim against the frozen target and authoritative sources; use only valid ideas as new local proof actions.
- If the target passes, return to step 5;
final.md may be clearer than the raw answer but must preserve necessary logic and epistemic labels. If a gap remains, first pursue the new local actions it creates; mark NEEDS_EXTERNAL_FOLLOWUP only after isolating the residual blocker and recording the applicable exhaustion or early-consultation exception.
External Handoff Contract
- Keep authoritative copies under
sources/ with stable generic filenames.
- Write
source-manifest.md with, for each source:
- local relative path;
- external-visible filename;
- why it is needed and whether it is authoritative or contextual;
- whether it must be transferred separately or is faithfully summarized in
materials.md;
- disclosure status:
approved, not-approved, needs-user-approval, or not-needed;
- readiness status:
ready, missing, optional, or returned-by-user.
- Make
external-brief.md self-contained and provider-neutral. Include, in this order:
- exact target, assumptions, quantifiers, object conventions, and allowed sources;
- definitions and source filenames the solver will see;
- locally verified results and their dependencies;
- attempted approach families, concrete failures, counterexamples, and blocker strengths;
- the smallest unresolved blocker and its relation to the original target;
- any concrete local actions left untried because the user requested early consultation or a budget stopped the run;
- exact requested output, permitted theorem imports, verification expectations, and a completion marker such as
END_EXTERNAL_OUTPUT.
- If a provider or interface needs special formatting, derive
provider-prompt.md from external-brief.md. Do not weaken assumptions, omit failed routes that prevent repetition, or promote conjectures to facts. Keep connection mechanics out of the canonical brief.
- Make
handoff.md record the selected solver and rationale, authority granted, approved disclosures, files and prompt actually sent, transfer order, return path, status, and any deviation from the canonical brief.
If a required source or disclosure decision is missing, mark ASK_USER or the
handoff blocked rather than silently replacing it with memory. A narrow blocker
is the default request. Ask for the full theorem only when independent search or
whole-proof verification is the explicit external role, and say why that wider
scope is useful.
External Output Preservation And Repair
Keep external-output.md or the recorded provider-specific output file
recognizable as raw external evidence. Formatting repair may fix copy corruption
but must not change claims, constants, assumptions, theorem status, or proof
order.
Required checks:
- Confirm the requested completion marker is present.
- Balance display-math delimiters and inspect suspicious blank lines.
- Repair obvious escaped-brace corruption such as
\left{ to \left\{ and \right} to \right\} only when the intended delimiter is unambiguous.
- Remove residual interface or copy separators only when their intended role is clear; otherwise flag them in
audit.md.
- Scan for malformed operators, stray Markdown markers, and broken right delimiters.
Record nontrivial repairs in audit.md or codex-ledger.md. Perform substantive clarity and notation editing in final.md, after the correctness audit, rather than rewriting the raw output.
Guardrails
- Never invent missing citations, source statements, assumptions, or proof steps to avoid a blocker or make a handoff look complete.
- Never treat invoking this skill as authority for browser control, uploads, remote messages, API spending, provider selection, or another external turn.
- Never disclose a source marked
not-approved or needs-user-approval.
- Do not reuse prior authorization, silently switch providers, or infer a paid/API fallback after another route fails.
- Do not present a comparable, equivalent, or stronger missing lemma as routine progress. Reopen a blocked route only when
references/portfolio-search.md supplies a valid novelty key.
- Audit before simplifying. Preserve any step whose removal would make a non-obvious inference unverifiable.
- Treat an external answer as raw evidence. Re-enter local search and audit before accepting it, pursue any new local actions before requesting a follow-up, and obtain new authorization before every dispatch.
- If correctness and elegance conflict, preserve correctness and state the remaining exposition issue explicitly.
1---2name: proof-orchestrator3description: Coordinate proof runs across three interfaces: exhaust actionable local proof work first, package exact unresolved obligations for a provider-neutral external solver only when justified, and keep the user informed and in control of consequential choices.4---56# Proof Orchestrator78## Role910Run proof work across three interfaces:11121. **Internal:** Codex owns the local search, falsification, correctness audit,13 notation audit, exposition, and run record. Complete every concrete local next14 action that remains justified and feasible.152. **External:** When the internal search is operationally exhausted, package16 the verified setting, attempted routes, strongest partial results, and17 smallest unresolved blocker for an external solver. No provider is the18 default.193. **User:** Keep the user informed at meaningful decision points and preserve20 their authority over theorem changes, source disclosure, provider choice,21 uploads, browser operation, and paid calls.2223External help follows the Internal Exhaustion Gate below, unless the user24explicitly requests earlier consultation. In either case, first prepare an25audit-ready local account of what is known and what remains unresolved.2627For GPT Pro, Claude/Fable, or any other external solver, use an available authorized adapter or give the user a manual handoff. If the user selects GPT Pro and asks Codex to perform the call, load `call-gpt-pro`.2829## Run Directory And Canonical Record3031Keep each run under:3233```text34mindflows/<YYMMDDHH-num>/35```3637Use only the files needed by the run:3839```text40task.md # precise theorem or proof obligation41materials.md # definitions, givens, notation, and source excerpts42local-proof.md # Codex's proof attempt or isolated blocker43approach-registry.md # optional route portfolio for difficult proof searches44sources/ # stable local source snapshots45source-manifest.md # source role, disclosure status, and external filename46external-brief.md # provider-neutral problem and evidence package47provider-prompt.md # optional provider/interface-specific rendering48handoff.md # chosen route, authority, transfer order, and status49external-output.md # returned answer, kept as raw evidence50audit.md # correctness and source-alignment audit51final.md # verified, simplified, user-facing proof52codex-ledger.md # run state and provenance, optional53next.md # next narrow obligation, optional54```5556Use only the files the run needs. `external-brief.md` is the canonical,57provider-neutral handoff. Create `provider-prompt.md` only when a selected58provider or interface requires a distinct rendering.5960Do not create provider-specific prompts, `handoff.md`, or remote project state61before the local attempt unless the user explicitly requests an external62handoff. Preparing a local `external-brief.md` after the Internal Exhaustion63Gate passes does not itself authorize external contact.6465## Continuing a Project6667Treat an existing run, `next*.md`, `redo*.md`, or continuation artifact as a project continuation. First read any prior next/redo/continuation files that exist. Treat completed run artifacts and prior external conversations as append-only evidence; do not overwrite them.6869Always create a new run directory for new proof work. Record the prior run ID, the exact files read, inherited proved/conjectural/rejected claims, preserved sources, and the single current obligation.7071When inheriting an approach registry, preserve family identities and blocker-strength classifications. Keep a blocked route blocked unless the new run records a valid novelty key under `references/portfolio-search.md`.7273If a continuation reaches external consultation, prepare a new74`external-brief.md` for the current obligation. Reuse prior sources only after75checking that they still match the frozen target. Prefer a fresh external76conversation unless `handoff.md` explains why prior context is required.7778## Status Labels7980Use these labels in `codex-ledger.md`, `audit.md`, or `handoff.md`:8182- `INTERNAL_ATTEMPT`83- `INTERNAL_PROVED`84- `INTERNAL_EXHAUSTED`85- `INTERNAL_STOPPED_WITH_ACTIONS_REMAINING`86- `ASK_USER`87- `READY_FOR_EXTERNAL_BRIEF`88- `READY_FOR_MANUAL_HANDOFF`89- `READY_FOR_AUTHORIZED_DISPATCH`90- `WAITING_FOR_EXTERNAL_OUTPUT`91- `EXTERNAL_OUTPUT_RECEIVED`92- `NEEDS_EXTERNAL_FOLLOWUP`93- `AUDIT_FAILED`94- `READY_FOR_USER`959697## Notation Gate9899When the user asks about notation or symbols, when the proof is theorem-heavy, or when one proof step contains at least five nonstandard symbols, read `references/notation-audit.md` and include this exact scorecard in `audit.md` or the user-facing audit:100101```text102Core semantic objects retained: <retained>/<declared> (<percent>)103Undefined symbols: <count>104Symbol collisions: <count>105One-use definitions: <count>/<all new symbols> (<percent>)106Maximum parallel representations of one object: <count>107Maximum alias-chain depth: <count>108Maximum active nonstandard symbols in one proof step: <count>109```110111Do not rename, merge, omit, or replace these lines with other useful findings. Report logical gaps, domain errors, and irrelevant notation after the fixed scorecard. Core-object retention must be 100%, and undefined symbols and collisions must both be zero before `READY_FOR_USER`.112113Never improve the scorecard by inventing a definition, domain, assumption, identity, or relation that the source does not supply. If an undefined symbol or missing implication cannot be resolved from authoritative material, keep it in the audit, mark the proof `AUDIT_FAILED` or `ASK_USER`, and rewrite only the valid fragment or the diagnosis.114115## Derivation Structure Gate116117For every nontrivial derivation, organize the user-facing proof from the target downward, even if the proof was discovered bottom-up:1181191. State the target and its role: "To prove A, it is enough to establish B, C, and D," together with the lemma, identity, or inference that makes those subgoals sufficient.1202. Derive each immediate subgoal and state where it comes from: an assumption, definition, prior lemma, or an explicitly shown calculation.1213. If a subgoal has its own dependencies, expand it in the same target-first form. Order dependent subgoals by their true dependency relation rather than presenting a misleading flat list.1224. Recombine the established subgoals and explicitly return to the original target.123124This is an exposition rule, not a license to reverse an implication or hide a gap. Check that the dependency graph is acyclic, every reduction is justified, and no subgoal silently assumes the target. Do not force this scaffold onto a one-step argument where it would add more ceremony than clarity.125126Record `Top-down derivation structure: PASS`, `FAIL`, or `NOT_APPLICABLE` in `audit.md`. A nontrivial derivation cannot be `READY_FOR_USER` while this gate is `FAIL`.127128## Search Portfolio Gate129130For a research-level, open-ended, or repeatedly stalled obligation, read131`references/portfolio-search.md` before committing to one proof route. Create132`approach-registry.md`, compare routes by their mathematical mechanism, classify133the strength of every central blocker, and run task-specific adversarial checks.134For a routine proof with a direct path, skip this gate and do not create the135registry.136137An expected answer is a search direction, not a proof premise. Do not assume a138theorem is true merely because the user, benchmark, or prior model output says a139proof exists. Use independent workers only when they are explicitly authorized140and available; the gate must also work as a sequential local search.141142## Three-Interface Contract143144### Internal Interface145146The local run is the canonical source of truth. Follow the Search Portfolio and147Internal Exhaustion Gates where applicable, record both positive and negative148evidence, and perform Codex's own correctness audit. A second model never149substitutes for that audit.150151### External Interface152153External interaction begins from the provider-neutral `external-brief.md`154specified in the External Handoff Contract. Choose a provider only after the155mathematical role is clear. The provider may156be GPT Pro, Claude/Fable, another model, a human expert, a theorem prover, or a157specialized service. Record the choice and reason in `handoff.md`. Provider-158specific connection instructions belong in the selected adapter or159`provider-prompt.md`; they must not determine the core proof workflow.160161### User Interface162163Report ambiguity, missing information, a genuine blocker, justified external164help, and the audited external result. Ask before changing the theorem,165disclosing non-approved material, choosing materially different external routes,166operating a browser, uploading files, sending messages, or spending credit. If167user information is the blocker, mark `ASK_USER`. Before external contact,168provide the decision record required in workflow step 6.169170## Internal Exhaustion Gate171172`INTERNAL_EXHAUSTED` means operationally exhausted under the frozen target,173available local tools and sources, and any explicit user budget. It does not174claim that no proof exists or that all mathematics has been searched.175176The gate passes only when all of the following are recorded in `audit.md` or177`codex-ledger.md`:1781791. The exact target, assumptions, quantifiers, conventions, and allowed sources180 are frozen; missing user choices or sources have been separated from proof181 difficulty.1822. Codex attempted the actual completion task and audited every claimed result,183 rather than stopping after a difficulty probe or delegating the original184 theorem unchanged.1853. For a routine task, the direct route and its natural repairs were completed,186 rejected, or reduced to an exact blocker. For a research-level, open-ended,187 or repeatedly stalled task, the Search Portfolio Gate was applied.1884. Every approach family is `CANDIDATE`, `BLOCKED`, or `REJECTED`; each blocked189 family has a smallest blocker, blocker-strength classification, and attempted190 falsification. No family remains merely `EXPLORING`.1915. No concrete local next action remains that is both relevant and feasible.192 Unused actionable ideas, unchecked hypotheses, or unrun decisive checks mean193 the gate fails.1946. The strongest locally proved result, the exact residual obligation, and195 `Equivalent-strength blocker: <YES|NO|UNKNOWN>` are recorded.1967. The reason for stopping is epistemic rather than cosmetic: additional local197 work would require a new mechanism, a missing authoritative source, a user198 decision, unavailable capability, or effort beyond an explicit budget.199200If work stops because of a user or environment budget while concrete actions201remain, use `INTERNAL_STOPPED_WITH_ACTIONS_REMAINING`, list those actions, and202do not claim exhaustion. External consultation may still be offered if the user203requests it, but the handoff must disclose that local search was truncated.204205If the user explicitly requests external consultation before this gate passes,206honor the request within its authorization boundary, but mark the exception in207`handoff.md` and include the untried local actions in `external-brief.md`.208209## Workflow210211Default route: freeze target -> maintain evidence -> exhaust actionable internal212work -> local correctness audit -> exposition edit -> final. When the Internal213Exhaustion Gate passes: prepare a provider-neutral external brief -> report the214decision record to the user -> use the user-selected manual or authorized route215-> ingest raw output -> return to internal proof and audit -> final.2162171. Freeze the target.218 - Decide whether the request is new or a continuation.219 - State the exact theorem, assumptions, quantifiers, and allowed sources.220 - Do not broaden or repair the theorem silently.2212. Maintain local evidence.222 - Read only the files needed to understand the target.223 - Copy stable, directly relevant snapshots into `sources/` when the original may change or cannot be referred to reliably.224 - Keep private run materials in the run directory, never in the skill package.2253. Run the internal proof search.226 - Try to complete the actual proof, disproof, counterexample, or diagnosis; do not stop at a difficulty probe.227 - Check definitions, boundary cases, domains, support, topology, quantifiers, and imported theorem hypotheses.228 - Write `local-proof.md` with the conclusion, proof attempt, dependencies, and any unresolved gap.229 - Apply the Search Portfolio Gate when it applies, and continue while a relevant, feasible concrete next action remains.2304. Audit and classify the internal result.231 - Verify every theorem, lemma, reduction, equality, bound, constant, and quantifier against the stated assumptions and local sources.232 - Distinguish proved, imported, conjectural, repaired, and unsupported statements.233 - For an unresolved run, record `Equivalent-strength blocker: YES`, `NO`, or `UNKNOWN` in `audit.md` or `codex-ledger.md` and justify the classification.234 - If the exact target passes audit, mark `INTERNAL_PROVED` and continue to exposition.235 - If information or a theorem choice is missing, mark `ASK_USER` and present the smallest question that changes the proof state.236 - Otherwise apply the Internal Exhaustion Gate and use its status rules. If it does not pass, return to step 3. Optional external review remains additional evidence, not a substitute for Codex's audit.2375. Edit the proof for exposition.238 - Apply the Notation and Derivation Structure Gates when they apply.239 - Lead with the conclusion, preserve each core semantic object, and retain every non-obvious logical dependency.240 - Prefer a short direct argument to decorative formalism; do not polish an unresolved gap into an apparently complete proof.2416. Prepare the external brief only when justified.242 - Proceed only under the condition and exception rules in the Internal Exhaustion Gate.243 - Complete the External Handoff Contract below and mark `READY_FOR_EXTERNAL_BRIEF`.244 - Before contact, present what is proved locally, what was tried, what remains, why further local work is not actionable, what would be shared, and the available manual or authorized-dispatch routes. If a consequential choice remains open, mark `ASK_USER` while retaining the readiness event.2457. Select and authorize the external route.246 - Record the route and authority in `handoff.md` as required by the External Handoff Contract.247 - For a manual route, provide transfer instructions and mark `READY_FOR_MANUAL_HANDOFF`; after transfer, mark `WAITING_FOR_EXTERNAL_OUTPUT`.248 - For Codex-operated dispatch, require explicit current authority, mark `READY_FOR_AUTHORIZED_DISPATCH`, and load the relevant adapter skill. After sending, mark `WAITING_FOR_EXTERNAL_OUTPUT`.2498. Ingest the returned material as evidence.250 - Save user-pasted or Codex-retrieved text as `external-output.md` or the provider-specific filename recorded in `handoff.md`.251 - Mark `EXTERNAL_OUTPUT_RECEIVED` and apply only the formatting repairs allowed below before mathematical auditing.252 - Record the provider, conversation or task identifier when available, files actually disclosed, prompt actually sent, and whether the response is complete.2539. Re-enter the internal loop.254 - Audit every external claim against the frozen target and authoritative sources; use only valid ideas as new local proof actions.255 - If the target passes, return to step 5; `final.md` may be clearer than the raw answer but must preserve necessary logic and epistemic labels. If a gap remains, first pursue the new local actions it creates; mark `NEEDS_EXTERNAL_FOLLOWUP` only after isolating the residual blocker and recording the applicable exhaustion or early-consultation exception.256257## External Handoff Contract2582591. Keep authoritative copies under `sources/` with stable generic filenames.2602. Write `source-manifest.md` with, for each source:261 - local relative path;262 - external-visible filename;263 - why it is needed and whether it is authoritative or contextual;264 - whether it must be transferred separately or is faithfully summarized in `materials.md`;265 - disclosure status: `approved`, `not-approved`, `needs-user-approval`, or `not-needed`;266 - readiness status: `ready`, `missing`, `optional`, or `returned-by-user`.2673. Make `external-brief.md` self-contained and provider-neutral. Include, in this order:268 - exact target, assumptions, quantifiers, object conventions, and allowed sources;269 - definitions and source filenames the solver will see;270 - locally verified results and their dependencies;271 - attempted approach families, concrete failures, counterexamples, and blocker strengths;272 - the smallest unresolved blocker and its relation to the original target;273 - any concrete local actions left untried because the user requested early consultation or a budget stopped the run;274 - exact requested output, permitted theorem imports, verification expectations, and a completion marker such as `END_EXTERNAL_OUTPUT`.2754. If a provider or interface needs special formatting, derive `provider-prompt.md` from `external-brief.md`. Do not weaken assumptions, omit failed routes that prevent repetition, or promote conjectures to facts. Keep connection mechanics out of the canonical brief.2765. Make `handoff.md` record the selected solver and rationale, authority granted, approved disclosures, files and prompt actually sent, transfer order, return path, status, and any deviation from the canonical brief.277278If a required source or disclosure decision is missing, mark `ASK_USER` or the279handoff blocked rather than silently replacing it with memory. A narrow blocker280is the default request. Ask for the full theorem only when independent search or281whole-proof verification is the explicit external role, and say why that wider282scope is useful.283284## External Output Preservation And Repair285286Keep `external-output.md` or the recorded provider-specific output file287recognizable as raw external evidence. Formatting repair may fix copy corruption288but must not change claims, constants, assumptions, theorem status, or proof289order.290291Required checks:292293- Confirm the requested completion marker is present.294- Balance display-math delimiters and inspect suspicious blank lines.295- Repair obvious escaped-brace corruption such as `\left{` to `\left\{` and `\right}` to `\right\}` only when the intended delimiter is unambiguous.296- Remove residual interface or copy separators only when their intended role is clear; otherwise flag them in `audit.md`.297- Scan for malformed operators, stray Markdown markers, and broken right delimiters.298299Record nontrivial repairs in `audit.md` or `codex-ledger.md`. Perform substantive clarity and notation editing in `final.md`, after the correctness audit, rather than rewriting the raw output.300301## Guardrails302303- Never invent missing citations, source statements, assumptions, or proof steps to avoid a blocker or make a handoff look complete.304- Never treat invoking this skill as authority for browser control, uploads, remote messages, API spending, provider selection, or another external turn.305- Never disclose a source marked `not-approved` or `needs-user-approval`.306- Do not reuse prior authorization, silently switch providers, or infer a paid/API fallback after another route fails.307- Do not present a comparable, equivalent, or stronger missing lemma as routine progress. Reopen a blocked route only when `references/portfolio-search.md` supplies a valid novelty key.308- Audit before simplifying. Preserve any step whose removal would make a non-obvious inference unverifiable.309- Treat an external answer as raw evidence. Re-enter local search and audit before accepting it, pursue any new local actions before requesting a follow-up, and obtain new authorization before every dispatch.310- If correctness and elegance conflict, preserve correctness and state the remaining exposition issue explicitly.