The CLI and Web use the same proof workflow for new runs. The host freezes the problem and Lean environment, then gives the Lead and its native Codex subagents one shared checkout. The host independently verifies the original targets after the team stops. The pinned project Skill supplies research methods and role guidance. See Codex configuration.
Build the runtime normally with bun run build --state-root EXTERNAL_BUILD_DIRECTORY. Use its manifest when preparing a new isolated run:
bun bin/math.ts run \
--workspace NEW_PROBLEM_WORKSPACE --task-file TASK_FILE \
--output NEW_RESULT_FILE --build-manifest BUILD_MANIFESTNew Codex runs start one Lead who can delegate up to seven members in the shared checkout. Set --agent-team N to change capacity or --workers 1 to run solo. Choose --plan-approval to have Lead wait for approval of the initial route before starting proof work.
The --resume command continues solo runs and native teams with their saved research mode, Skill loading, provider and environment. The host checks the frozen identities before resuming the thread. New runs save researchSkillWorkflow: full and an execution plan. Historical single-researcher checkpoints without that marker keep their original workflow. Inspect older host-scheduled archives with the current CLI and use the original pinned runtime to resume them. A new strategy can start a separate run from the saved artifacts.
The Codex provider connectivity probe runs during --startup-only and doctor. Ordinary solves and resumes handle provider errors when they need a model request. Local proof attempts and recovery of frozen proof checks can proceed without a provider connection.
For Codex sessions metered by upstream request receipts, the host sends excludeTurns: true on resume. Codex restores the thread internally and returns metadata without sending the full transcript over stdio. Direct providers whose budget gate uses native thread totals still request turn history so Codex can replay saved usage. If that reply exceeds the 8 MiB stdio frame limit, the host reopens the thread once with excludeTurns: true; the next turn's cumulative total still includes the skipped replay. In continuous cooling, an oversized frame that recurs after one cooldown stops the run instead of cooling again.
New standalone Codex runs with --workers 1 use a short Lean prompt and a local reference to the pinned Skill. They keep the same native process for ordinary incomplete drafts. The host stops the writer before freezing a candidate, checking a nominated declaration or closing an ordinary terminal turn. Team runs and explicitly selected --skill-loading native check Codex discovery and send native skill input on ordinary host turns. --skill-loading file explicitly directs Codex to read the same pinned file. In historical AgentControl runs, native child communication carries the host's frozen context and explicit pinned-file reading instructions; its execution plan records file loading because Codex's typed input cannot combine an inter-agent communication with a skill input. Discovery and an accepted request do not prove that a provider followed the skill; that requires separate execution evidence.
The adapter uses Codex's native shell, process polling, patches, tool-error feedback, Skill loading, thread resume and compaction. Shell settings are supplied once in the thread's developer instructions. Rejected arguments return through Codex's own tool output; the host no longer polls rollout files, counts refusals or injects duplicate corrections into later turns.
Ordinary declaration lookup uses native shell rg over the saved declaration index and source files. The host still generates the index and preserves frozen package identities. Catalog operations remain available for dependency metadata and archived evidence; the historical declaration-search CLI remains compatible with saved Skill instructions.
File handoffs use native fs/watch on the existing parent directory before the writer starts, fs/changed notifications and fs/unwatch during cleanup. There is no host polling timer. Codex 0.169.0 debounces watch events by 200ms and may fall back to a noop watcher; request admission and terminal completion therefore still read the output synchronously. Already validated output is checked by digest after the turn settles so a validator with submission side effects is not invoked twice. Content validation and independent proof acceptance stay with the host.
New Codex report workflows prefer native outputSchema and the final response bound to the completed turn. The host closes the session, validates the response and saves the frozen output file. outputDelivery freezes this choice; older requests without the field retain their file protocol and instruction hashes. Replay, other harnesses, the DeepSeek/Westlake Chat bridge and early proof handoffs retain file delivery. The audit reads the session's final-response record instead of collecting a second copy of agent messages.
The non-Skill solo path uses native thread/compact/start between settled turns before rotating a thread for context capacity. The adapter waits for the contextCompaction item and the successful terminal event before it resumes research. Its maintenance requests are accounted for separately from proof turns. Failed compaction retains the existing fresh-thread recovery. Skill research keeps Codex's own automatic compaction behavior.
Real installed-Codex tests with local fixed Responses replies cover native shell refusal/correction and concurrent advisory injection, preservation of parallel tool results, and idle injection without model work. These verify transport and lifecycle behavior; no mathematical speedup is inferred from them.
To set the capacity of a new Codex team, pass --agent-team:
bun bin/math.ts run --agent-team 3 \
--workspace NEW_PROBLEM_WORKSPACE --task-file TASK_FILE \
--output NEW_RESULT_FILE --build-manifest BUILD_MANIFEST--agent-team sets the capacity from 2 to 8, including Lead, and defaults to 4. Lead delegates and communicates with Codex's native tools. --plan-approval gives Lead a read-only planning turn before proof work. Other harnesses can start solo runs.
Before starting a team, optionally select preferred roles in the Web form or pass a comma-separated list, e.g. --skill-preferred-profiles researcher,engineer,D011. Work roles and domain specialties come from the pinned Skill catalogue; a domain ID or its slug is accepted. A preference tells the Lead what expertise you would like considered. It does not reserve seats, start members, restrict other roles, or mark any expertise as used. The run saves these preferences for resume. Leave the list empty for ordinary autonomous selection.
You can also select a released personal Skill or Agent as a source of expertise. The web service checks access and freezes the selected version, including relevant material from its referenced Skills. It uses descriptions, areas, inputs, outputs and examples. To make a source available to an expert, include its citation or link in one of those fields. Legacy steps, execution instructions, module overrides, model and staffing choices are not imported. Put knowledge that you want to reuse from an old instruction block in the description or examples and publish a new version.
For CLI runs, --skill-expert-cards-file FILE freezes a JSON array of cards with string fields assetId, version, digest (the release SHA-256), name, summary and knowledge. Lead can read the cards in the local tool help and point a member to relevant material. Cards supply background.
Lead assigns at most one writer to each file at a time. When the problem has one editable proof file, one member or Lead writes it while others can research or review. Members use separate scratch files for probes, run local Lean checks and send their findings through Codex. The sources are already in the shared checkout when a member returns. Lead waits for the remaining members to finish or interrupts them before returning. Once the host confirms the writer process namespace stopped, it freezes the sources and runs independent Lean acceptance on the original targets.
--max-turns counts the host's dispatches to Lead. The elapsed-time limit applies to the whole run. A finite shared token budget requires a metered Responses profile such as the default Sub2API profile or the Web relay. They count Lead and member requests and block new ones when the threshold is reached. Requests already admitted can finish. A direct Responses profile can run a team without a finite token budget and reports incomplete usage. The direct Westlake Chat bridge supports solo runs.
Current TheoremOS can inspect archived teams and read their checked evidence. To resume or reproduce a saved AgentControl run, use the revision and executable pinned by that run. The local branch archive/isolated-codex-teams (c9439d06) preserves the per-member worktree implementation, patched Codex build, license notices and test suite.
skills/theoremos-research/SKILL.md contains stable research methods with references loaded as needed. It has no specific problem answers or universal task graph. The full directory, including references, participates in build and run identity. A run gets its own copy under .agents/skills/theoremos-research; the host checks its identity before dispatch and after writer shutdown. Only a host-pinned projection is allowed by source ownership. Legacy runs do not gain a new editable directory.
First installation copies into advisory scratch, checks the complete directory identity, freezes its files and atomically moves it into the final location. An interrupted copy leaves no partially installed skill, so a restart can retry. An existing installed projection with changed bytes is still rejected rather than overwritten.
Precise command examples are generated at .scratch/theoremos-help.md, using the existing local-help implementation. References route to this help and existing command --help; they do not maintain a second tool registry. Research sources, probes and public notes stay in the existing worktree and scratch storage. Internal chain of thought is neither required nor treated as an artifact.
Skill, team and native-baseline preparation save the Lean project location at .scratch/worker-project.json, so check-lean --worktree and other shared project tools work without a cooperative assignment. Older cooperative workspaces retain their COOPERATION.json fallback. The location is advisory; canonical paths, frozen source policies and environment validation still apply. Team help omits the cooperative-only research-observe entry point. It describes shared checkout collaboration.
Single Skill research, complete Skill workflows and common-guidance/native comparisons generate optional tool references through the same researchToolGuide.ts implementation. It selects the actual projected executable and available corpus, knowledge and library resources. Complete workflows reuse the existing context compiler for tasks, consumers, required feedback, routes, definitions, families and fixed-source review. Workflow guidance and comparison guidance retain distinct purposes. The shared reference does not enable native delegation. The durable writer avoids rewriting unchanged help bytes.
Cooperative sessions keep role, delivery and source rules in their session instructions. The pinned cooperation reference describes the stable formats for Skill sessions. Same-thread continuations carry the current assignment, contract, inbox and feedback. A worker sees checkOutcome when assigned a pending check. Lead receives nextCheckDecisions with the outcomes that need a decision. Unanswered human guidance is referenced by ID in the prompt and available in that worker's COOPERATION.json. Pending correction receipt indexes remain mandatory even when their full details exceed the optional context budget.
At a freeze boundary the host saves source and notes after confirmed writer shutdown. Native resume, request recovery, compaction handling, leases, cumulative usage and the existing dispatch budget remain shared infrastructure. A missing shutdown confirmation quarantines that workspace before any new writer, freeze or acceptance. Unfinished original proofs do not trigger a full original-target compilation after every research turn. A complete candidate still goes through the original strict check and S3 evaluation of every frozen original target.
In new solo runs, the model hands off a candidate by returning or by running a successful check-lean on all original proof files once they have no holes. The host checks that candidate after stopping the writer and freezing the source. Older runs with savedEditChecks keep their edit-triggered precheck on resume.
After the frozen research responsibility has actually been dispatched to a native thread, later turns in the same host process use a compact continuation instead of repeating the full task and statement. Current source/check feedback, declaration feedback and saved-work references remain present; the developer source and acceptance rules are unchanged. The first dispatch, a new responsibility/thread, the first dispatch after native context compaction and the first dispatch after a host restart all retain the full task. Both standalone skill and common-guidance comparison paths use this behavior and the existing context byte accounting.
The full solo Skill prompt gives the original statement, assumptions, target names and Lean file paths. The solver finds source context in its worktree and can retrieve the original bytes by commit. Historical attachment indexes and suggested reference passages appear in the full prompt and remain available to the same thread. Later turns carry current feedback and checkpoints. The host keeps the context manifest on disk.
For a single Skill researcher, after confirmed writer shutdown the host durably records pendingResearchFreeze before committing sources. It binds the prior HEAD, owned-source digest, problem receipt and environment. Recovery accepts only those unchanged source bytes at the prior HEAD or its single host checkpoint, then completes freezing and check delivery before admitting another model turn. A crash after the source commit but before creating a pending proof check therefore does not require another model turn. An unconfirmed writer stop still quarantines the workspace.
Complete original candidates also acquire a host-owned pendingProofCheck after writer shutdown and source freeze, before helper processing or original-target verification. It binds the commit, owned-source digest, problem receipt and environment. Resume completes any pending helper processing and verifies the frozen original candidate before admitting another model turn, even after the turn/token allowance is exhausted. Verification checkpoints retain their normal retry allowance; unavailable verification or host storage errors retain the candidate. A deterministic mathematical rejection clears this pending check and returns its feedback for correction. Persisted successful acceptance can finish pending cleanup without repeating verification; a changed candidate or environment is rejected.
To preserve a reusable helper before the whole problem is solved, the researcher writes .scratch/declaration-submission.json, then stops editing and returns:
{
"declarations": [
{
"file": "Submission.lean",
"name": "Qualified.helper",
"type": "COMPLETE_CLOSED_LEAN_TYPE"
}
]
}The request accepts up to 32 declarations, with optional descriptions and explicit premises. The host confirms writer shutdown, freezes actual bytes, checks the exact declaration and full type in an isolated projection, and preserves source, environment, checked commit, Lean receipts and references. Other original goals can remain unfinished. A helper depending on their unproved bodies or on new axioms cannot acquire unconditional evidence. Ordinary diagnostics remain advisory.
Successful evidence is stored in the host runtime directory's declarations.json; feedback goes to .scratch/declaration-feedback.json. Invalid submissions and failed proofs receive correctable feedback. Cancellation, resumable verification checkpoints and unavailable environments retain the request and their distinct failure meaning. Resume rechecks the frozen commit and request bytes before any new model admission, even when the model turn or token budget is exhausted. If that candidate also completes the original problem, the host checks all original targets in the same recovery without another model turn. An independent helper does not mark the original problem accepted.
Small archives keep the v1 manifest. When the next write would exceed 4096 records or 32 MiB, the host preserves the records in content-addressed segments and atomically publishes a v2 root in declarations.json. Each segment retains both limits and its run/problem/environment identity; the reader verifies its digest, record count and unique record identities. Segment persistence precedes root replacement, so an interrupted append leaves the previous archive readable and can be retried. The writer can migrate an old v1 count overflow that still fits within 32 MiB; an already oversized legacy file or a single oversized record remains an explicit storage error. Historical records in either format still require fresh consumer checks.
After successful host persistence, consumption is marked completed in host-owned state before removing the request. Recovery can finish either side of that removal without repeating completed verification. A missing request is permitted only for that saved completion phase; changed source or an existing request with changed bytes remains an error. The worker-editable feedback file cannot grant completion. Host evidence-storage failures retain the pending request and propagate as infrastructure failures instead of being consumed as mathematical rejections.
Only explicitly classified submission-content errors and deterministic proof failures produce correctable rejection feedback. Host filesystem, Git, source-integrity and verifier-initialization exceptions propagate with the pending request retained; they do not consume the helper or start a mathematical correction turn.
The existing knowledge interface imports this sidecar alongside legacy cooperative records:
bun bin/math.ts knowledge build --state RESULT.runtime/state.json \
--output NEW_CATALOG --report NEW_IMPORT_REPORTCatalog records retain their complete source and provenance, are labeled recorded evidence, and require a fresh check in each consumer. inspect and the Web observation types understand the new mode without creating fake tasks, routes or Lead progress. Declaration inspection reports recorded evidence, not fresh acceptance. Library extraction without a legacy canonical record continues to require an explicit commit.
Start a new native team or solo Skill run with --continuation-source-run OLD_RESULT_OR_STATE. The importer pins the old canonical commit, preserves worker drafts, research notes, old costs and historical proof snapshots separately, and checks available helpers in the new run. The history attachment records source identity and usage. To use a personal expert in the new team, select its release for that run. Same-run --resume retains its frozen configuration. A failed or conditional historical claim remains advisory.
When the source was a native team, a same-problem Skill continuation can also
search members' archived RESEARCH.md notes. Use the continuation search command
shown in the assignment with --kind research-notes. Read the original
hypotheses and the scoped claim before reusing a counterexample or abandoning a
route. These notes do not create an assignment or mark any proof as checked.
Initialization can resume from its frozen capture after interruption. It rejects changed destination research or configuration instead of overwriting new work. Live source drafts are captured with explicit stability checks and labeled as separate observations, not as a globally atomic snapshot. This command does not stop or migrate the old run.
Use the pinned revision of the original experiment to prepare and execute host scheduling comparisons. The current CLI can read and check their saved reports.
compare --skill-baseline native|file --phase prepare ... replaces the legacy single arm with skill research. Preparation freezes skill identity in the plan and launch files without starting a model. The existing independent and cooperative arms share the planned model, tools, environment and total token allowance. Reports retain all planned attempts and missing usage.
The --skill-baseline comparisons remain system-mode comparisons: legacy prompts contain additional mathematical guidance, so commonGuidanceFrozen and strategyIsolation are false. In the historical runtime, --common-research-skill native|file pins the same mathematical skill and minimal host contracts in all three arms. This isolates host strategy choices while preserving their actual coordination and delivery protocols. --dataset lean-task --source-file FILE --task-file FILE admits a frozen local statement without importing old answers or human-assisted research history. Plans, launches and reports retain the guidance, model, provider, effort, environment, knowledge and total resource identities. One diagnostic problem establishes that the comparison runs; it cannot establish an efficiency advantage.
Comparison preparation and solver startup share resource binding for the retrieval corpus, installed mathematics tools and proof-search backend before computing the environment digest. Changed pinned resource bytes remain an error. The first preregistered three-arm diagnostic exposed the previous missing tools binding: all three observations were rejected for an environment identity mismatch and had already stopped at their dispatch allowance. Their frozen plan and raw report remain unchanged. Observed consumption was 8,733 tokens for skill, 17,583 for independent and 11,285 for cooperative; these are costs of invalid attempts, not accepted comparison results. The repair is checked with disposable startup processes without rerunning the observed paid sample.
Saved records of the old fixed task graph, host-tools teams and theoremos_investigate remain available for inspection and export. Use the run's original runtime to execute those methods again. The cooperation fields in an old archive describe what happened in that run.
New collaborative Web proof requests use the shared Codex team on a worker image labeled org.theoremos.native-team-workflow=v2. The runner starts the verified image ID. Historical v1 images are used with their archived runtime. The owner can enable initial route approval for direct Lean input and after natural-language formalization. Historical cooperative requests can still be viewed with their saved plan and approval records. Resuming them requires the original service and worker versions.
The Skill view displays the researcher and declaration source, full type, premises, checked commit, environment and receipt references. Recorded evidence requires a fresh consumer check. Large collections report omitted declaration records. Single researchers keep their declaration workflow. Capture and archive remain supported. Context builders use the host-projected agent tools, including when Docker hides application source.
| Work | Verified result | Remaining boundary |
|---|---|---|
| Actual skill execution | An isolated real provider read the pinned native/file skill and reference, reproduced their hashes and a fresh tag, resumed each saved thread, and confirmed all four stops. A separate native compaction also completed. | Raw reports retain their captured runtime hashes. Subsequent delegation guard changes are covered by local regressions; the reports are not relabeled as a test of different bytes. |
| Process recovery and context continuity | Twelve isolated Linux process-death cases cover preparation, request acknowledgment, tool writes, freeze, pending helper verification, both declaration-consumption windows and complete original candidates before/after source commit and independent verification, using actual SIGKILL, flock, adapter processes and durable state. A separate SIGKILL case interrupts first skill projection. Unknown usage blocks replay; pending helpers and original candidates use real Lean. | Protocol peers control model responses; this is not a prolonged paid-provider resilience benchmark. |
| Knowledge consumption | Three real Lean cases exercise a separate consumer searching, reading, adapting and independently checking a saved declaration, including rejection of changed premises and stale evidence. | A measured research-performance gain from transferred knowledge still needs a matched experiment. |
| Historical comparisons | After a resource-binding repair in the historical runtime, a fresh plan and three startup-only runs had matching environment identities and zero model turns. The rejected earlier diagnostic and its actual costs remain recorded. | A repaired paid comparison has yet to be run. |
| Historical read-only investigation | The retired host-mediated tool was verified with Codex 0.169.0 and local fixed replies, covering independent read-only threads, cold resume, denied writes and process cleanup. | Use the historical runtime to reproduce those checks. |
| Web workflow | Creation, draft restoration, configuration freezing, declaration display, supported controls and translated desktop/mobile browser flows are covered. A private image derived from an immutable baseline rebuilt the branch's headless runtime and agent tools; native/file startup-only, statement elaboration and pinned skill projection pass. A separate offline probe runs the image's actual Codex 0.162.0 and adapter: native discovery, both actual shell readbacks, bundled tool usage and confirmed stops pass with application source hidden. | The packaged probe binds that immutable image, before the later recovery fixes. Its provider replies are fixed loopback data; actual provider authentication, metered relay behavior and mathematical performance inside the image remain untested. |
The single researcher shares session execution and accounting in research.ts. Its source freeze, declaration delivery and pending-proof recovery live in skillProofLifecycle.ts. Recovery runs before another model dispatch, including when the model allowance is exhausted. Current verification covers the retained solo and native team paths. Historical scheduling comparisons remain tied to the builds used by their original runs.
Focused tests exercise native skill requests and discovery errors, full-directory identity, CLI opt-in/resume, writer quarantine, declaration delivery, helper import, old-run continuation, inspection and comparison identity. Declaration tests include real isolated Lean verification for successful helpers and rejection of incorrect types, dependence on unproved goals and unapproved axioms. Ordinary regressions use protocol peers and disposable workspaces. Explicit provider acceptance is a separate opt-in script, scripts/mathematics/validateSkillProvider.ts, with per-round request/token accounting, missing-usage rejection, estimated in-flight reservation and readback evidence. An observed dispatch allowance is not a hard cap on tokens generated by a request already in flight.
The 2026-11-16 real-model Putnam 1963 A4 diagnostic used runtime 7284f3b, deepseek-flash/high, a 1200-second run allowance and a 300-second hard turn limit. It created no child and completed no proof: the first turn was interrupted at 300 seconds, and the final request had no usage receipt, so finite-budget admission stopped the run. That observation informed early collaboration guidance and earlier host coordination checkpoints, which current team execution no longer uses. Collaboration decisions now stay with Lead as described above. Local regressions and the native transport test do not replace a separately recorded real-model retest.
Historical archives can retain coordination decisions, observations and presentation identities. These remain recorded data and advance neither an inbox cursor nor a Lead decision. Current team execution does not use them to require acknowledgments, restrict tools or schedule coordination-only handoffs.
Deterministic source-policy rejection is corrective feedback, including exact outside-ownership paths when available. Lead receives the source-policy feedback and can correct the shared workspace. Git, I/O and environment faults retain their error behavior.