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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.git
node_modules
out
out/*
!out/web
!out/web-report
.frontend-source
runtime
.state
coverage
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,31 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Read the frontend revision
id: frontend
if: matrix.target == 'web'
run: |
revision=$(cat frontend-revision)
[[ "$revision" =~ ^[0-9a-f]{40}$ ]]
echo "revision=$revision" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
if: matrix.target == 'web'
with:
repository: HuggingMath/TheoremOS
ref: ${{ steps.frontend.outputs.revision }}
path: .frontend-source
persist-credentials: false
- uses: oven-sh/setup-bun@v2
if: matrix.target == 'web'
with:
bun-version: 1.4.0
- run: rustup toolchain install 1.95.0 --profile minimal && rustup override set 1.95.0
if: matrix.target == 'web'
- run: bun install --frozen-lockfile
if: matrix.target == 'web'
- name: Build the workbench from the pinned frontend
if: matrix.target == 'web'
run: bun .frontend-source/frontend/build.ts "$PWD" "$PWD/out" web
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,28 +117,28 @@ jobs:
- run: bun run format:check
- run: bun run typecheck && bun run typecheck:web && bun run typecheck:site
- name: Verify account, job, persistence and operations boundaries without models
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
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: 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/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
- name: Verify research recovery, participation and shared run snapshots
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
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
run: bunx vitest run --maxWorkers=4 tests/directFormalizationEvidence.test.ts tests/directFormalizationWorkflow.test.ts tests/formalizationCoverage.test.ts tests/formalizationAudit.test.ts tests/formalizationContext.test.ts tests/formalizationPackagesWarmup.test.ts tests/mathProofEnvironmentSeed.test.ts tests/webFormalizationAuditWorker.test.ts tests/webFormalizationBackgroundReview.test.ts tests/webBackgroundReview.test.ts tests/webFormalizationProgress.test.ts tests/webThinkingProcess.test.ts tests/codexSessionInstructions.test.ts
run: bun scripts/frontend.ts run bunx vitest run --maxWorkers=4 tests/directFormalizationEvidence.test.ts tests/directFormalizationWorkflow.test.ts tests/formalizationCoverage.test.ts tests/formalizationAudit.test.ts tests/formalizationContext.test.ts tests/formalizationPackagesWarmup.test.ts tests/mathProofEnvironmentSeed.test.ts tests/webFormalizationAuditWorker.test.ts tests/webFormalizationBackgroundReview.test.ts tests/webBackgroundReview.test.ts tests/webFormalizationProgress.test.ts tests/webThinkingProcess.test.ts tests/codexSessionInstructions.test.ts
- name: Verify session, draft, budget and archive recovery without models
run: bunx vitest run --maxWorkers=4 tests/webSessionCookies.test.ts tests/webResearchSession.test.ts tests/webDraft.test.ts tests/webLongRun.test.ts tests/researchPlanApproval.test.ts tests/archiveRecordNavigation.test.ts tests/globalTrajectory.test.ts tests/webChatDraft.test.ts tests/archiveSourceLocation.test.ts tests/taskPlanEditorAccess.test.ts
run: bun scripts/frontend.ts run bunx vitest run --maxWorkers=4 tests/webSessionCookies.test.ts tests/webResearchSession.test.ts tests/webDraft.test.ts tests/webLongRun.test.ts tests/researchPlanApproval.test.ts tests/archiveRecordNavigation.test.ts tests/globalTrajectory.test.ts tests/webChatDraft.test.ts tests/archiveSourceLocation.test.ts tests/taskPlanEditorAccess.test.ts
- run: bun run build && bun run build:web
- run: bunx playwright install --with-deps chromium
- name: Verify proof progress in the default simple reading
timeout-minutes: 5
run: bun scripts/e2e/test-web-proof-thinking.ts --simple-reading
run: bun scripts/frontend.ts run bun scripts/e2e/test-web-proof-thinking.ts --simple-reading
- name: Verify login and the first research flow with local fixtures
run: bun run test:web-login && bun run test:web-natural-first
- name: Verify native team creation, approval and library continuation with local fixtures
run: bun scripts/e2e/test-web-native-team.ts && bun run test:web-plan-approval && bunx vitest run tests/webLibraryResearch.test.ts
run: bun scripts/frontend.ts run bun scripts/e2e/test-web-native-team.ts && bun run test:web-plan-approval && bun scripts/frontend.ts run bunx vitest run tests/webLibraryResearch.test.ts
- name: Verify paper drafting and download with local fixtures
run: bun scripts/e2e/test-web-paper.ts
run: bun scripts/frontend.ts run bun scripts/e2e/test-web-paper.ts
- name: Verify formalization progress and background review in the browser
run: bun scripts/e2e/test-web-formalization-progress.ts && bunx vitest run tests/webBackgroundReviewWorkflow.test.ts
run: bun scripts/frontend.ts run bun scripts/e2e/test-web-formalization-progress.ts && bun scripts/frontend.ts run bunx vitest run tests/webBackgroundReviewWorkflow.test.ts
- name: Verify chat, saved keys, proof runs and explanations in the browser
if: github.event_name == 'workflow_dispatch' || inputs.full
run: bun run test:web-chat-session && bun run test:web-chat-cancel-recovery && bun run test:web-key-memory && bun run test:web-saved-key && bun run test:web-solve-process && bun run test:web-review-regressions && bun run test:web-explain && bun run test:web-explain-recovery
Expand All @@ -162,7 +162,7 @@ jobs:
run: bun run test:frontend-round10
- name: Verify the complete proof thinking workflow in the browser
if: github.event_name == 'workflow_dispatch' || inputs.full
run: bun scripts/e2e/test-web-proof-thinking.ts
run: bun scripts/frontend.ts run bun scripts/e2e/test-web-proof-thinking.ts

verify-research-workflows:
runs-on: ubuntu-24.04
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ coverage/
.state/
*.runtime/
.taste-skill/

.frontend-source/
.theoremos-frontend-*/
/target/
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Standalone mathematics runtime

Keep the CLI and mathematics proof behavior independent of the original DeepScientist checkout. The optional `apps/web` workbench is a separate BYOK HTTP service and Docker supervisor; it must not become a dependency of the CLI or mathematics services. There is no Electron or desktop build.
Keep the CLI and mathematics proof behavior independent of the original DeepScientist checkout. The optional `apps/web` workbench is a separate BYOK HTTP service and Docker supervisor; it must not become a dependency of the CLI or mathematics services. Browser assets and their tests live in the product repository at the revision in `frontend-revision`. There is no Electron or desktop build.

`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.

Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Native proof checks need Lean. On Linux x86_64 or aarch64, [install-elan.sh](scr
| CLI and proof runs | [CLI entry](bin/math.ts), [solver](src/solver/). Start with [run.ts](src/solver/run.ts) for the run lifecycle and [evaluation.ts](src/solver/evaluation.ts) for final acceptance. |
| Mathematics and model sessions | [Mathematics services](src/math/) own formalization, retrieval and verification; [runtime](src/runtime/) owns model connections. |
| Web workbench | [apps/web/](apps/web/) contains the optional service and its client. The CLI and mathematics services must work without it. |
| Public website | [docs/web/](docs/web/) contains the site source; the build writes to `out/site/`. Screenshot tools live in [scripts/capture/](scripts/capture/). |
| Tests | [tests/](tests/) contains Vitest suites; [scripts/e2e/](scripts/e2e/) contains browser scenarios and shared helpers. |
| Public website | Source and build instructions are in the [product repository](https://github.com/HuggingMath/TheoremOS/tree/main/frontend). |
| Tests | Backend tests live in `tests/`. The browser tests are in the [product repository](https://github.com/HuggingMath/TheoremOS/tree/main/frontend/scripts/e2e). |
| Research and proof tools | [skills/](skills/) contains pinned research instructions, [resources/](resources/) contains proof environments and library inputs, and [research/](research/) holds protocols and decisions. See [examples/](examples/) for worked runs and adapters. |

## Check a change
Expand All @@ -42,16 +42,16 @@ This checks local Markdown file links in the main guides, checks formatting, typ
| CLI or solver runtime boundaries | Run the affected tests and `bun run build` (headless CLI bundle). |
| Solver reliability with native Lean | `bun run test:solver-reliability`. See the **verify-solver** job in [CI](.github/workflows/verify.yml) for the Lean versions and Linux sandbox prerequisites. |
| Workbench behavior | `bun run build:web`, then the relevant Playwright scenario, for example `bun run test:web-login`. Install the test browser with `bunx playwright install chromium` if needed. |
| Public website | `bun run build:site`. See the [website guide](docs/website.md) for previews and screenshot capture. |
| Public website | Source and build instructions are in the [product repository](https://github.com/HuggingMath/TheoremOS/tree/main/frontend). |

CI runs selected Vitest suites, builds, native checks and browser scenarios. Extended browser suites run on manual dispatch or when a calling workflow requests the full set. When adding a browser scenario, put it in [scripts/e2e/](scripts/e2e/), reuse the scenario helpers and add a corresponding test script to [package.json](package.json).

## Preserve evidence and generated assets

- Keep published archive paths and bytes stable: `accepted/`, `submitted/`, `in-progress/`, `results/` and `theoremos-review/`. Keep existing proofs, notes, run records, and the paths and versions quoted in historical documents intact.
- Keep `tests/fixtures/`, `docs/assets/` and the evidence in `examples/knowledge-reuse/` out of formatting passes. The [format exclusions](.prettierignore) also protect generated sources and byte-compared CSS.
- Regenerate the frozen library search data with [generate-web-library-search.ts](scripts/generate-web-library-search.ts). Preserve the font declarations in [app.css](apps/web/client/app.css); [webFonts.test.ts](tests/webFonts.test.ts) compares them. For a change to the empty workbench heading, update the character set in [subset-workbench-heading.py](scripts/subset-workbench-heading.py), run it with FontTools and Brotli installed, rebuild the workbench and check the rendered heading. The [library host guide](docs/LIBRARY-HOST-CONFIG.md) covers automated replay.
- Keep the wrappers [web-scenario.ts](scripts/web-scenario.ts) and [web-ui-controls.ts](scripts/web-ui-controls.ts): the archived [reproduction script](theoremos-review/web-main/reproduce.ts) imports those paths.
The frontend styles and browser regression tests are maintained in the product repository.


For maintenance, reproduce issues in isolation and fix the shared mechanism. Leave active proofs, researcher assignments, run progress and submissions to the solver unless explicitly authorized. Keep credentials out of commits.

Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ bun install --frozen-lockfile
| CLI 与证明运行 | [CLI 入口](bin/math.ts)、[求解器](src/solver/)。从 [run.ts](src/solver/run.ts) 看运行生命周期,从 [evaluation.ts](src/solver/evaluation.ts) 看最终验收。 |
| 数学服务与模型连接 | [src/math/](src/math/) 负责形式化、检索和检查;[src/runtime/](src/runtime/) 连接模型。 |
| 网页工作台 | [apps/web/](apps/web/) 包含可选服务及其客户端。CLI 和数学服务必须能独立运行。 |
| 官网 | 源码在 [docs/web/](docs/web/),构建产物在 `out/site/`,截图工具在 [scripts/capture/](scripts/capture/)。 |
| 测试 | [tests/](tests/) 是 Vitest 测试;[scripts/e2e/](scripts/e2e/) 是浏览器测试及共用模块。 |
| 官网 | 源码和构建说明在[产品仓](https://github.com/HuggingMath/TheoremOS/tree/main/frontend)。 |
| 测试 | 后端测试在 `tests/`,浏览器测试在[产品仓](https://github.com/HuggingMath/TheoremOS/tree/main/frontend/scripts/e2e)。 |
| 研究与证明工具 | [skills/](skills/) 存放固定的研究指令,[resources/](resources/) 存放证明环境和数学库输入,[research/](research/) 存放研究协议和决策。[examples/](examples/) 里有运行实例与基准适配。 |

## 怎样验证改动
Expand All @@ -42,16 +42,16 @@ bun run check
| CLI 或求解运行时边界 | 运行受影响的测试,并执行 `bun run build` 构建独立 CLI。 |
| 依赖真实 Lean 的求解可靠性 | `bun run test:solver-reliability`。Lean 版本和 Linux 隔离环境要求见 [CI](.github/workflows/verify.yml) 中的 **verify-solver** 作业。 |
| 网页工作台行为 | 用 `bun run build:web` 构建,再跑对应的 Playwright 场景,例如 `bun run test:web-login`。缺少浏览器时运行 `bunx playwright install chromium`。 |
| 官网 | 用 `bun run build:site` 构建。预览和截图见[官网开发说明](docs/website.md)。 |
| 官网 | 源码和构建说明在[产品仓](https://github.com/HuggingMath/TheoremOS/tree/main/frontend)。 |

CI 会选跑 Vitest 测试,构建项目,并检查原生 Lean 和浏览器场景。扩展浏览器测试在手动触发或上游工作流要求全量检查时运行。新增浏览器测试放在 [scripts/e2e/](scripts/e2e/),复用其中的公共模块,并在 [package.json](package.json) 中添加对应的测试命令。

## 哪些文件需要原样保留

- 保留公开归档的路径和文件内容:`accepted/`、`submitted/`、`in-progress/`、`results/`、`theoremos-review/`。已有证明、研究笔记和运行记录是历史证据;历史文档中的路径和版本号也应保留原貌。
- 格式化跳过 `tests/fixtures/`、`docs/assets/` 和 `examples/knowledge-reuse/` 中的证据。[忽略清单](.prettierignore) 也排除了生成的源码和按字节比对的 CSS。
- 冻结的库检索数据由 [generate-web-library-search.ts](scripts/generate-web-library-search.ts) 生成。[app.css](apps/web/client/app.css) 中的字体声明由 [webFonts.test.ts](tests/webFonts.test.ts) 比对。修改空白工作台标题时,同步更新 [subset-workbench-heading.py](scripts/subset-workbench-heading.py) 的字表,用 FontTools 和 Brotli 重新生成字体,然后构建工作台并在页面上确认标题。自动库宿主回放见[宿主配置说明](docs/LIBRARY-HOST-CONFIG.md)。
- 保留 [web-scenario.ts](scripts/web-scenario.ts) 和 [web-ui-controls.ts](scripts/web-ui-controls.ts) 两个兼容入口;归档中的[复现脚本](theoremos-review/web-main/reproduce.ts) 仍从这些路径导入。
工作台样式和浏览器回归测试在产品仓维护。


做维护时,先在隔离环境复现,再修正通用机制。未经明确授权,不得直接指导正在求解的研究者、改证明与责任分配、改进度或替题目提交。不要将凭据放进提交。

Expand Down
Loading
Loading