Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions .github/workflows/codex-backend-linux.yml

This file was deleted.

16 changes: 11 additions & 5 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Verify account, job, persistence and operations boundaries without models
run: bun scripts/frontend.ts run bunx vitest run --maxWorkers=4 tests/webAuth.test.ts tests/webSignup.test.ts tests/webAuthPolicy.test.ts tests/webQuota.test.ts tests/webAdmission.test.ts tests/webAdmissionRace.test.ts tests/webProviderCheck.test.ts tests/webI18n.test.ts tests/webFonts.test.ts tests/webKeyVault.test.ts tests/webJobs.test.ts tests/webLifecyclePersistence.test.ts tests/webCollaboration.test.ts tests/webConversations.test.ts tests/webExplain.test.ts tests/webPersistence.test.ts tests/webFormalizations.test.ts tests/webExplanation.test.ts tests/webExplanationServer.test.ts tests/webServer.test.ts tests/webRunStream.test.ts tests/webRunner.test.ts tests/webPrecheck.test.ts tests/webOperations.test.ts tests/webOperationsApi.test.ts tests/webOperationsScheduled.test.ts tests/webOperationsMonitor.test.ts
- name: Verify isolated provider routing and usage accounting without models
run: bun scripts/frontend.ts run bunx vitest run --maxWorkers=4 tests/formalizationRelay.test.ts tests/formalizationReviewIsolation.test.ts tests/webFormalizationWorker.test.ts tests/codexSession.test.ts tests/codexSessionLifecycle.test.ts tests/codexSessionCheckpoint.test.ts tests/codexStreamIdle.test.ts tests/codexSessionNotifications.test.ts tests/mathProcess.test.ts tests/mathRuntimeLease.test.ts tests/mathRuntimeLeaseProcess.test.ts tests/formalization.test.ts tests/formalizationRecovery.test.ts tests/formalizationWorkflow.test.ts tests/formalizationLimits.test.ts tests/formalizationFidelityReference.test.ts
run: bun scripts/frontend.ts run bunx vitest run --maxWorkers=4 tests/formalizationRelay.test.ts tests/formalizationReviewIsolation.test.ts tests/webFormalizationWorker.test.ts tests/codexSession.test.ts tests/codexSessionLifecycle.test.ts tests/codexStreamIdle.test.ts tests/codexSessionNotifications.test.ts tests/mathProcess.test.ts tests/mathRuntimeLease.test.ts tests/mathRuntimeLeaseProcess.test.ts tests/formalization.test.ts tests/formalizationRecovery.test.ts tests/formalizationWorkflow.test.ts tests/formalizationLimits.test.ts tests/formalizationFidelityReference.test.ts
- name: Verify research recovery, participation and shared run snapshots
run: bun scripts/frontend.ts run bunx vitest run --maxWorkers=4 tests/webRunSnapshot.test.ts tests/webResearchProjects.test.ts tests/webResearchApi.test.ts tests/webResearchAssets.test.ts tests/webResearchMathematics.test.ts tests/libraryPacks.test.ts tests/leanSource.test.ts
- name: Verify direct formalization and independent background review without models
Expand Down Expand Up @@ -170,19 +170,25 @@ jobs:
- name: Install Lean 4.33.0 for historical source recovery fixtures
if: matrix.lean == '4.36.0'
run: elan toolchain install leanprover/lean4:v4.33.0
- name: Verify recovery, proof checking and Codex team handoffs without models
- name: Verify recovery, proof checking and historical source recovery without models
if: matrix.lean == '4.36.0'
run: |
THEOREMOS_TEST_REFERENCE_LEAN=1 bunx vitest run tests/informalizationLean.test.ts
THEOREMOS_TEST_RECOVERY_LEAN=1 bunx vitest run tests/recovery.test.ts
THEOREMOS_TEST_SEED_LEAN=1 bunx vitest run tests/singleContinuationSeed.test.ts
bunx vitest run tests/agentTeamWorkspace.test.ts tests/agentTeamNativeControl.test.ts tests/agentTeamNativeLifecycle.test.ts tests/agentTeamSourceRecovery.test.ts
bunx vitest run tests/solverCompactProjection.test.ts tests/taskSourceProjection.test.ts tests/exactSourceIntegration.test.ts tests/leanDeclarationIdentity.test.ts tests/agentTeamProof.test.ts tests/solverSourceRecovery.test.ts
bunx vitest run tests/solverCompactProjection.test.ts tests/taskSourceProjection.test.ts tests/exactSourceIntegration.test.ts tests/leanDeclarationIdentity.test.ts tests/declarationArtifacts.test.ts tests/solverSourceRecovery.test.ts
- name: Verify dependency snapshots and receipt cache bindings
run: bunx vitest run --maxWorkers=4 tests/verifierSealedEnvironmentCache.test.ts tests/mathProofEnvironment.test.ts tests/leanProbeSnapshot.test.ts
- name: Install the standard Codex CLI used by the Web worker
if: matrix.lean == '4.36.0'
run: |
npm install --prefix "$RUNNER_TEMP/codex" @openai/codex@0.172.0
"$RUNNER_TEMP/codex/node_modules/.bin/codex" --version
echo "THEOREMOS_TEST_STOCK_CODEX=$RUNNER_TEMP/codex/node_modules/.bin/codex" >> "$GITHUB_ENV"
echo "TMPDIR=$RUNNER_TEMP" >> "$GITHUB_ENV"
- name: Verify sealed roles, native team sessions and historical inspection without models
if: matrix.lean == '4.36.0'
run: bunx vitest run --maxWorkers=1 tests/formalizationSandbox.test.ts tests/formalizationAudit.test.ts tests/agentSessionPlan.test.ts tests/codexSession.test.ts tests/skillRunInspection.test.ts tests/workflowHarness.test.ts tests/agentTeamTransportFallback.test.ts tests/codexSessionAgentControl.test.ts
run: bunx vitest run --maxWorkers=1 tests/formalizationSandbox.test.ts tests/formalizationAudit.test.ts tests/agentSessionPlan.test.ts tests/codexSession.test.ts tests/skillRunInspection.test.ts tests/workflowHarness.test.ts tests/agentTeamTransportFallback.test.ts tests/agentTeamSolver.test.ts tests/codexSessionCheckpoint.test.ts
- name: Verify projected proof contracts and retained source contexts
run: bunx vitest run --maxWorkers=4 tests/taskTypeContract.test.ts tests/projectionNotation.test.ts tests/taskSourceImplicitInstances.test.ts tests/taskSourceMacroProjection.test.ts tests/taskSourceNotationHints.test.ts tests/taskSourceNotationContext.test.ts
- name: Verify search tools, failure reuse and completed research delivery
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Keep the CLI and mathematics proof behavior independent of the original DeepScie

The CLI, solver, and workbench use the TypeScript runtime. The standalone Rust CLI and its build live on the migration/rust branch.

`src/math` owns mathematics services. `src/solver/run.ts` prepares and evaluates proof runs, `src/solver/research.ts` runs researcher sessions with shared budgets and checkpoints, and `src/solver/agentTeam.ts` connects Codex collaboration to isolated proof writers and checked handoffs. Codex Lead assigns responsibilities using the pinned Skill. `src/solver/archive.ts` owns S1 records and `src/solver/evaluation.ts` owns fixed S3 final acceptance. `src/runtime/codexSession.ts` connects to Codex through stdio. Keep historical collaboration records readable. Resume and reproduce retired host scheduling workflows with their pinned historical runtime. Do not reintroduce the original Core, Team services, HTTP services, role queues, or MCP orchestration into the runtime. S2 learning remains a future extension.
`src/math` owns mathematics services. `src/solver/run.ts` prepares and evaluates proof runs, `src/solver/research.ts` runs researcher sessions with shared budgets and checkpoints. The Codex Lead and its team share one solver checkout. Codex Lead assigns responsibilities using the pinned Skill. `src/solver/archive.ts` owns S1 records and `src/solver/evaluation.ts` owns fixed S3 final acceptance. `src/runtime/codexSession.ts` connects to Codex through stdio. Keep historical collaboration records readable. Resume and reproduce retired host scheduling workflows with their pinned historical runtime. Do not reintroduce the original Core, Team services, HTTP services, role queues, or MCP orchestration into the runtime. S2 learning remains a future extension.

Preserve frozen problem/source identities, isolated solver worktrees, Lean receipts, independent evaluation, and resumable runs. A model's completed message is never proof acceptance.
Preserve frozen problem/source identities, per-run solver worktrees, Lean receipts, independent evaluation, and resumable runs. A model's completed message is never proof acceptance.

New formalization requests and proof runs default to `high` reasoning. Web records can freeze a separate `researchEffort`; explicit effort selections, saved drafts and frozen tasks retain their configuration, including `max`. Older records without this field inherit their original effort; CLI resumes without `--effort` keep their frozen effort. Both use `deepseek-flash` through the local sub2api gateway (`http://127.0.0.1:8080/v1`) and the profile at `~/.config/deepscientist/math-sol-codex`. This local profile uses an auth command to read the existing Sub2API Westlake pool key; generated per-attempt Sub2API profiles require `SUB2API_WESTLAKE_API_KEY`. The previous direct Westlake profile is preserved as `~/.config/deepscientist/math-sol-codex-westlake`, and the `my_codex` / `gpt-6.1-sol` profile as `~/.config/deepscientist/math-sol-codex-my_codex`, for resuming older runs via `CODEX_HOME`. Do not copy credentials, alter global Codex configuration, or call real models merely to validate a local extraction.

Expand Down
2 changes: 1 addition & 1 deletion LICENSES/project-scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ On 2026-11-23, the project maintainer confirmed authority to publish the contrib
## Materials with separate terms

- The [44 enumerated Lean modules and their listed adaptations](../resources/theorem-os-library/REDISTRIBUTION.md) have a separate AGPL-3.0-only grant. It does not relicense other contents of the upstream library, cited papers, or a research archive containing copies.
- DeepScientist and AionUi credits, the Apache-licensed files, and the modified OpenAI Codex backend retain their applicable notices. See [NOTICE](../NOTICE) and the [Codex backend attribution](../scripts/codex-backend/README.md).
- DeepScientist and AionUi credits, the Apache-licensed files, and the modified OpenAI Codex backend retain their applicable notices. See [NOTICE](../NOTICE) and the Codex backend notices on `archive/isolated-codex-teams`.
- Problems, datasets, proofs supplied by third parties, fonts, icons and third-party packages remain subject to their respective terms. A recorded source URL, checksum, or author name identifies provenance; it does not itself grant redistribution rights.

When distributing copies or operating a modified network-accessible version, consult the license, particularly sections 4–6 and 13, for notice and corresponding-source obligations. Forks may identify their origin; they should not claim official endorsement.
3 changes: 2 additions & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ Third-party components:
The modified Codex backend is based on OpenAI Codex. The pinned
revision, TheoremOS modifications and upstream notices, including
Ratatui credits, are in scripts/codex-backend/README.md,
LICENSE.codex and NOTICE.codex in that directory.
LICENSE.codex and NOTICE.codex in that directory on the
archive/isolated-codex-teams branch (c9439d06).

The First Proof batch 3 problem texts have their own attribution and
CC BY-SA 4.0 terms in examples/first-proof/batch3/DATA-LICENSE.md.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Lean rejects the first candidate on `0 + n = n`. The second uses `Nat.zero_add`
| --- | --- |
| Submit a problem, inspect diagnostics or resume a run | [CLI guide](docs/usage.md) · [Web workbench](docs/web-workbench.md) |
| Review a formal statement before proving it | [Formalization](docs/formalization.md) · [Statement fidelity](docs/formalization-fidelity.md) |
| Understand how the solver works | [Run lifecycle](src/solver/run.ts) · [Research team](src/solver/agentTeam.ts) · [Final acceptance](src/solver/evaluation.ts) |
| Understand how the solver works | [Run lifecycle](src/solver/run.ts) · [Research sessions](src/solver/research.ts) · [Final acceptance](src/solver/evaluation.ts) |
| Change a research policy or run a benchmark | [M1–M5 interfaces](docs/solver-modules.md) · [Examples](examples/README.md) |
| Make and test a change | [Contributing](CONTRIBUTING.md) · [CI workflow](.github/workflows/verify.yml) |

Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ bun run math inspect --run "$THEOREMOS_REPLAY/result.json"
| --- | --- |
| 提交题目、读诊断、恢复运行 | [CLI 指南](docs/usage.md) · [网页工作台](docs/web-workbench.md) |
| 在证明前核对形式化题意 | [形式化流程](docs/formalization.md) · [题意保持](docs/formalization-fidelity.md) |
| 阅读求解器代码 | [运行入口](src/solver/run.ts) · [研究团队](src/solver/agentTeam.ts) · [最终验收](src/solver/evaluation.ts) |
| 阅读求解器代码 | [运行入口](src/solver/run.ts) · [研究会话](src/solver/research.ts) · [最终验收](src/solver/evaluation.ts) |
| 替换研究策略、复验基准 | [M1–M5 模块接口](docs/solver-modules.md) · [示例索引](examples/README.md) |
| 修改代码并运行检查 | [贡献指南](CONTRIBUTING.zh-CN.md) · [CI 工作流](.github/workflows/verify.yml) |

Expand Down
23 changes: 1 addition & 22 deletions apps/web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
FROM oven/bun:1.4.0 AS bun
FROM docker:29-cli AS docker-cli

# Compile against the worker's libc; a binary from the development host may
# require a newer glibc even when the Codex source and architecture match.
FROM rust:1.99.1-bookworm AS codex-backend
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 curl cmake pkg-config libssl-dev libcap-dev libasound2-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY scripts/build-codex-backend.sh scripts/build-codex-backend.sh
COPY scripts/codex-backend/ scripts/codex-backend/
ARG CODEX_BUILD_JOBS=4
RUN --mount=type=cache,id=theoremos-codex-registry,target=/usr/local/cargo/registry,sharing=locked \
--mount=type=cache,id=theoremos-codex-git,target=/usr/local/cargo/git,sharing=locked \
--mount=type=cache,id=theoremos-bookworm-codex-target,target=/build/artifacts/target,sharing=locked \
bash scripts/build-codex-backend.sh --source /build/upstream --downloads /build/downloads \
--output /build/artifacts --jobs "$CODEX_BUILD_JOBS"

FROM node:22-bookworm-slim AS base
COPY --from=bun /usr/local/bin/bun /usr/local/bin/bun
RUN apt-get update && apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -104,13 +88,8 @@ ENV DEEPSCIENTIST_MATH_PROOF_ENVIRONMENT_SOURCE_SEED=/opt/theoremos-proof-source
ARG THEOREMOS_SOURCE_COMMIT=unknown
LABEL org.opencontainers.image.revision=$THEOREMOS_SOURCE_COMMIT
ENV THEOREMOS_SOURCE_COMMIT=$THEOREMOS_SOURCE_COMMIT
COPY --from=codex-backend /build/artifacts/bin/codex /opt/theoremos-codex-backend/codex
COPY --from=codex-backend /build/artifacts/bin/codex-code-mode-host /opt/theoremos-codex-backend/codex-code-mode-host
ENV THEOREMOS_CODEX_BACKEND_EXECUTABLE=/opt/theoremos-codex-backend/codex
USER 10001:10001
RUN timeout 30s python3 scripts/codex-backend/check-capabilities.py "$THEOREMOS_CODEX_BACKEND_EXECUTABLE"
LABEL org.theoremos.native-agent-control=v1
LABEL org.theoremos.native-team-workflow=v1
LABEL org.theoremos.native-team-workflow=v2
LABEL org.theoremos.team-profile-preferences=v1
LABEL org.theoremos.team-expert-cards=v1
LABEL org.theoremos.worker-control=v1
Expand Down
4 changes: 2 additions & 2 deletions apps/web/i18n/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export const errors: Record<string, string> = {
'原生团队由一名 Lead 自主派工,不能与宿主协作或自定义模块方案一起使用。':
'The Lead coordinates the native team. Host collaboration and custom module plans are unavailable with native teams.',
'此研究安排不支持计划审批。': 'This research mode does not support plan approval.',
'当前运行镜像未安装支持原生团队与路线审批的 worker,请更新运行镜像。':
'Update the worker image to support native teams and route approval.',
'当前运行镜像不支持共享工作区团队与路线审批,请更新运行镜像。':
'Update the worker image to support teams sharing one workspace and route approval.',
'这次运行的 Codex 模型服务已不在配置中。': 'This run’s Codex model provider is no longer configured.',
'旧协作任务请使用对应的历史版本继续。新建多人研究使用 Codex 原生团队。':
'Continue old collaboration runs from the matching historical release. New multi-agent runs use Codex native teams.',
Expand Down
Loading
Loading