From de1cf965e78e378acfc88c206a2927b91e643a2c Mon Sep 17 00:00:00 2001 From: Zhenhao Liu <176368005+LikC1606@users.noreply.github.com> Date: Mon, 23 Nov 2026 20:04:13 +0800 Subject: [PATCH 1/2] Fix CI proof replays and frozen-library task dispatch --- apps/web/i18n/process.ts | 24 ++++++++++++++++- docs/solver-modules.md | 2 ++ scripts/test-web-discovery-invites.ts | 2 +- scripts/test-web-proof-thinking.ts | 11 ++++---- scripts/test-web-solve-process.ts | 8 +++--- src/solver/cooperation.ts | 2 +- src/solver/modules/moduleIdentity.ts | 2 +- src/solver/taskTypePreflight.ts | 25 ++++++++++++----- tests/helpers/cooperation.ts | 5 ++++ tests/helpers/webCheckedLeanFixture.ts | 13 +++++++++ tests/solverConditionalIntegration.test.ts | 5 ++-- tests/solverConditionalLibraryImports.test.ts | 9 +++++-- tests/solverProofReadyIntake.test.ts | 3 ++- tests/taskTypePreflight.test.ts | 27 +++++++++++++++++++ tests/webBackgroundReviewWorkflow.test.ts | 8 +++--- tests/webModuleIdentity.test.ts | 24 ++++++++--------- 16 files changed, 130 insertions(+), 40 deletions(-) create mode 100644 tests/helpers/webCheckedLeanFixture.ts diff --git a/apps/web/i18n/process.ts b/apps/web/i18n/process.ts index a7d3dc7f..f024b1c9 100644 --- a/apps/web/i18n/process.ts +++ b/apps/web/i18n/process.ts @@ -49,6 +49,8 @@ export const process: Record = { "平台检查": "Host check", "平台检查 {0}": "Host check {0}", "自查通过": "The self-check passed", + "源码预检失败": "Source precheck failed", + "Lean 环境或工具出错": "Lean environment or tool error", // The independent acceptance "没有进行独立验收": "No independent acceptance was run", "在干净环境里重新检查完整原题": "Rechecking the whole problem in a clean environment", @@ -75,13 +77,33 @@ export const process: Record = { "在路线图中查看": "Open in the roadmap", "在路线图中查看这项任务": "Open this task in the roadmap", "指导这项任务": "Guide this task", + "成员任务": "Member assignment", + "等待派工启动": "Waiting for dispatch", + "准备工作区": "Preparing the workspace", + "推进中,已有发现": "In progress, findings recorded", + "推进中,尚无发现记录": "In progress, no findings recorded yet", + "已暂停并保留任务": "Paused, assignment retained", + "等待写入停止": "Waiting for writes to stop", + "宿主正在检查交付": "Host is checking the delivery", + "交付检查未通过": "Delivery check failed", + "已采纳": "Adopted", + "交付已核验": "Delivery checked", + "交付证据未记录": "Delivery evidence unavailable", + "研究已返回": "Research findings returned", + "已返回,成果未记录": "Returned with no result recorded", + "任务失败": "Task failed", + "会话已中断": "Session interrupted", + "任务已取消": "Task canceled", "当前 Lean 陈述": "Current Lean statement", "当前候选": "Current candidate", "复制片段": "Copy excerpt", "下载片段": "Download excerpt", "源码片段": "Source excerpt", "下载失败,请重试。": "Download failed. Please try again.", - "这份文件在这次检查之后又改过,Lean 指出的行可能已经移动。": "This file changed after the check, so the lines Lean names may have moved.", + "Lean 诊断与版本": "Lean diagnostics and version", + "待证目标": "Proof goal", + "检查环境": "Check environment", + "诊断产物": "Diagnostic artifact", "这次检查的文件没有单独保存,下面是任务当前的文件。": "This check kept no file of its own; below is the task's current file.", "文件较长,后面的部分没有保存。": "The file is long; the rest was not saved.", "另有 {0} 条消息对不上这份文件的行": "{0} more messages do not match lines of this file", diff --git a/docs/solver-modules.md b/docs/solver-modules.md index 7c45ecae..8398cccc 100644 --- a/docs/solver-modules.md +++ b/docs/solver-modules.md @@ -360,6 +360,8 @@ Lead 的三个自动检索目标先覆盖当前证据排序的首选路线,剩 M5 在 typed helper 的当前源码投影完成后、正式分配和模型调用前执行同一预检。仅完整查询自身的明确类型或解析错误记为 `invalid`,阻塞该接口并给 Lead 精确反馈,不增加模型尝试数或数学失败数。heartbeat、递归深度、内部异常、IO 和未分类错误不判无效,也不缓存。尚不存在的引理依赖、不支持的局部作用域、输入变化和不完整错误记为 `deferred`;工具或环境不可用记为 `unavailable`,均允许原流程继续。当前查询未重建的活动 `set_option`(包括 `maxHeartbeats` / `maxRecDepth`)保守 defer。预检等待期间其他独立任务仍能分配,宿主不将其误报为路线空闲。 +若 Lean 报某个限定名不存在,而本题冻结库快照将该名称列为尚未导入模块的公开声明,且模块摘要与题目回执一致,预检记为 `deferred` 并给出具体的 `import`。成员仍须在候选源码中加入所需导入并通过证明检查。拼错的名称、仅在其他库找到的名称及已导入后仍存在的这类错误继续记为 `invalid`。 + 预检仅在当前运行进程和同一真实 worker 项目根内复用,最多保留 64 条实际检查结果,绑定合同、依赖、完整源码和配置、实际工具、环境、作用域及调用方原有预算。缓存存取复制结果,避免其他调用方修改缓存记录;命中前及调用方等待后都核对原诊断产物仍存在且摘要匹配,产物损坏或丢失会重新检查。检查点里的结果只用于解释;恢复后重新检查。等待结束会再次核对任务、canonical、worker 角色及归属、路线、模型准入和原预算,过期结果不会派发。`Infinity` 原样保持,不新增解题截止时间。嵌套类型副本直接绑定同一固定依赖根并核对环境身份,不回退到陈旧的 worker package link。 类型展开成功后,只有完整证明擦除投影、模块顺序和映射、查询命令及其余合同和环境输入完全相同时,后续证明体修改才可复用该成功结果。投影摘要和实际副本写入共用同一构造函数;本次原始源码仍形成新的输入摘要并完整核对当前性。原 artifact 保持原样,另用 `projectionReuse` 记录原检查输入、原源码、本次源码和共同投影摘要,不生成新的 Lean 回执。无效类型仍只复用完全相同的原始输入;投影索引随原检查结果一起淘汰,连续证明修改不会增加保留结果数。该复用仅省去重复的 advisory 类型展开,不提供任何证明验收。 diff --git a/scripts/test-web-discovery-invites.ts b/scripts/test-web-discovery-invites.ts index f8aeced6..41bbfadd 100644 --- a/scripts/test-web-discovery-invites.ts +++ b/scripts/test-web-discovery-invites.ts @@ -102,7 +102,7 @@ try { phase = `task-discovery-${width}`; await page.goto(`${origin}/library.html?${entry}`); const discovery = page.locator('[data-library-discovery]'); await discovery.waitFor(); await discovery.getByRole('heading', { name: tx('这一步已有的前提', 'Premises recorded for this step'), exact: true }).waitFor(); - assert.ok(await discovery.locator('.katex').count(), 'Task formulas render as mathematics'); + await discovery.locator('.katex').first().waitFor(); assert.equal(await page.locator('[data-library-environment]').inputValue(), 'target'); await page.locator(`[data-library-match="${standard.id}"]`).waitFor(); assert.equal(await page.locator(`[data-library-match="${mathlib.id}"]`).count(), 0, 'Mathlib asset stays outside the standard task environment'); diff --git a/scripts/test-web-proof-thinking.ts b/scripts/test-web-proof-thinking.ts index eb904ecd..50a73ec8 100644 --- a/scripts/test-web-proof-thinking.ts +++ b/scripts/test-web-proof-thinking.ts @@ -16,6 +16,7 @@ import { webLimits, type WebAgentAction, type WebAgentActionBody, type WebEventD import { extendTrajectory, recordedTrajectory, trajectoryPage } from '../apps/web/trajectory'; import { proofOutline } from '../apps/web/verificationKit'; import { taskVersion } from '../src/solver/tasks'; +import { webCheckedLeanFixture } from '../tests/helpers/webCheckedLeanFixture'; import { audit } from './web-a11y'; import { freePort, preferFullCollaboration, settled } from './web-scenario'; import { openChatResultDetails } from './web-ui-controls'; @@ -563,9 +564,9 @@ try { touch(); summary('engineer', 'proof-summary', copy.engineerSummary, true); touch(); run.artifact = { source: failedSource, workerId: 'engineer', status: 'candidate', capturedAt: run.updatedAt }; action({ workerId: 'engineer', itemId: 'proof-check-1', kind: 'command', phase: 'completed', status: 'failed', exitCode: 1, - command: 'theorem-os check-lean --file Submission.lean', output: checkOutput, lean: { passed: false, messages: [ + command: 'theorem-os check-lean --file Submission.lean', output: checkOutput, lean: webCheckedLeanFixture(failedSource, false, [ { severity: 'warning', line: 4, text: warning }, { severity: 'error', line: 5, column: 9, text: diagnostic }, - ] } }); + ]) }); await page.goto(`${origin}/?chat=${conversation.id}`, { timeout: 0 }); await contains(copy.engineerSummary.split('\n')[1]!); await failedCheck.waitFor(); await settled(page); assert.equal(await detail(), null, 'A new browser has made no choice'); @@ -1454,9 +1455,9 @@ try { action({ workerId: 'engineer', itemId: 'public-commentary', kind: 'message', textSource: 'commentary', phase: 'completed', status: 'done', text: copy.commentary }); run.artifact = { source: failedSource, workerId: 'engineer', status: 'candidate', capturedAt: run.updatedAt }; action({ workerId: 'engineer', itemId: 'proof-check-1', kind: 'command', phase: 'completed', status: 'failed', exitCode: 1, - command: 'theorem-os check-lean --file Submission.lean', output: checkOutput, lean: { passed: false, messages: [ + command: 'theorem-os check-lean --file Submission.lean', output: checkOutput, lean: webCheckedLeanFixture(failedSource, false, [ { severity: 'error', line: 5, column: 9, text: diagnostic }, { severity: 'warning', line: 4, text: warning }, { severity: 'info', line: 5, text: info }, - ] } }); + ]) }); await contains(copy.commentary); assert.equal(await thinking.locator('[data-thinking-work="research"][data-thinking-task="research"]').count(), 1, 'A matching delivery replaces the same task version\'s finding instead of repeating it'); @@ -1480,7 +1481,7 @@ try { diff: '@@ -4,2 +4,4 @@\n theorem ui_fixture_add_identity (n : Nat) : n + 0 = n ∧ 0 + n = n := by\n- exact Nat.add_zero n\n+ constructor\n+ · exact Nat.add_zero n\n+ · exact Nat.zero_add n' }] }); run.artifact = { source: correctedSource, workerId: 'engineer', status: 'candidate', capturedAt: run.updatedAt }; action({ workerId: 'engineer', itemId: 'proof-check-2', kind: 'command', phase: 'completed', status: 'done', exitCode: 0, - command: 'theorem-os check-lean --file Submission.lean', output: 'Synthetic check passed. No Lean process ran.', lean: { passed: true, messages: [] } }); + command: 'theorem-os check-lean --file Submission.lean', output: 'Synthetic check passed. No Lean process ran.', lean: webCheckedLeanFixture(correctedSource, true) }); await contains(copy.revision.split('\n')[1]!); const passedCheck = thinking.locator('[data-thinking-detail="check:p:engineer:proof-check-2"]'); await page.waitForFunction(source => document.querySelector('[data-thinking-detail="check:p:engineer:proof-check-2"] .thinking-source pre code')?.textContent === source, correctedSource); diff --git a/scripts/test-web-solve-process.ts b/scripts/test-web-solve-process.ts index ce0d8f94..329074c3 100644 --- a/scripts/test-web-solve-process.ts +++ b/scripts/test-web-solve-process.ts @@ -13,6 +13,7 @@ import type { WebRunner } from '../apps/web/runner'; import type { WorkerFormalizationInput, WorkerFormalizationMessage } from '../apps/web/formalizationTypes'; import type { WorkerInput, WorkerMessage } from '../apps/web/shared'; import { localeStorageKey } from '../apps/web/i18n'; +import { webCheckedLeanFixture } from '../tests/helpers/webCheckedLeanFixture'; import { webFormalizationEvidence, webFormalizationStatement } from '../tests/helpers/webFormalizationFixture'; import { audit } from './web-a11y'; import { deferred, freePort, settled, startBrowser } from './web-scenario'; @@ -44,11 +45,12 @@ const runner: WebRunner = { progress('research_action', '直接求解', { workerId: 'solver', operation: 'direct' }); await sleep(20); progress('turn_started', '第 1 轮', { workerId: 'solver', turn: 1 }); - // The Agent's file is saved as a candidate before it checks it, so the check arrives with the source Lean named its error in. - send({ type: 'artifact', artifact: { source: statement, workerId: 'solver', capturedAt: new Date().toISOString(), status: 'candidate' } } as WorkerMessage); + const checkedText = statement.replace('sorry', 'unknown_tactic'); + send({ type: 'artifact', artifact: { source: checkedText, workerId: 'solver', capturedAt: new Date().toISOString(), status: 'candidate' } } as WorkerMessage); action({ workerId: 'solver', itemId: '1:c1', phase: 'started', kind: 'command', status: 'running', command: "theorem-os check-lean --file 'Submission.lean'" }); action({ workerId: 'solver', itemId: '1:c1', phase: 'completed', kind: 'command', status: 'failed', exitCode: 1, - command: "theorem-os check-lean --file 'Submission.lean'", output: 'error: unknown tactic', lean: lean(false, 2) }); + command: "theorem-os check-lean --file 'Submission.lean'", output: 'error: unknown tactic', + lean: webCheckedLeanFixture(checkedText, false, [{ severity: 'error', line: 2, text: 'unknown tactic' }]) }); progress('proof_check_started', 'Lean 检查', { workerId: 'solver', turn: 1 }); const held = deferred(); releaseRun = held.resolve; await Promise.race([held.promise, new Promise(resolve => signal.addEventListener('abort', () => resolve(), { once: true }))]); diff --git a/src/solver/cooperation.ts b/src/solver/cooperation.ts index a060fb45..b77533f3 100644 --- a/src/solver/cooperation.ts +++ b/src/solver/cooperation.ts @@ -924,7 +924,7 @@ export class CooperativeResearch extends CooperationInputs { projectRoot: project, // A family type never names its own members, which do not exist in source until they are proved. dependencies: this.dependencies(task).map(item => item.task).filter(input => input.familyMember !== task.id), environmentDigest: environment, - env: workerAccess.environment, signal, + env: workerAccess.environment, installedLibrary: workerAccess.installedLibrary, signal, timeoutMs: this.input.timeoutMs ?? Infinity }) : { result: { status: 'unavailable', inputDigest: mathDigest(canonicalMathJson([taskDigest, environment, 'worker-environment-unavailable'])), taskDigest, reason: 'worker-environment-unavailable', evidence: 'advisory-type-elaboration', proofAcceptance: 'not-assessed' }, diff --git a/src/solver/modules/moduleIdentity.ts b/src/solver/modules/moduleIdentity.ts index 5e2224c7..0739db0a 100644 --- a/src/solver/modules/moduleIdentity.ts +++ b/src/solver/modules/moduleIdentity.ts @@ -11,7 +11,7 @@ export const directSolverModuleIdentity: SolverModuleIdentity = { M2: 'lean-kernel-v14/declaration-prefix-projection-v1/task-root-references-v1/conditional-child-changes-v1/scoped-conditional-projection-v1/exact-input-failure-reuse-v1/conditional-projection-identity-v1/attributed-batch-evidence-v1/fixed-candidate-references-v1/exact-projection-cache-v1/shared-source-index-v1/host-consumer-connection-v1/content-projection-reuse-v1/ready-integration-batches-v1/coded-lean-diagnostics-v1/live-exact-projection-recheck-v1/lean-diagnostic-word-classification-v1/advisory-scratch-checkout-v1/host-tactic-battery-v1/definition-tasks-v1/battery-vacuity-probe-v1/untouched-seed-request-failure-v1/isolated-module-builds-v1/frozen-library-modules-v1/host-family-assembly-v1/projection-dependency-diagnostics-v1/installed-library-application-v1/installed-library-candidate-pool-v1/installed-library-iff-application-v1/installed-library-equality-application-v1/installed-library-named-requests-v1/installed-library-rewrite-v1/installed-library-lemma-pool-v1/installed-library-premise-application-v1/installed-library-premise-retrieval-v1/installed-library-fair-premise-pool-v1/installed-library-composed-applications-v1/import-closure-diagnostics-cache-v1/proof-import-before-theorem-v1/typed-helper-command-rejection-v1/installed-library-conclusion-relevance-v1/notation-source-inputs-v1/implicit-instance-cleanup-v1/persistent-tactic-failure-reuse-v1/notation-quotation-context-v1/static-notation-analysis-v1/conditional-source-context-v1/universe-polymorphic-conditional-projection-v1/original-definition-kind-canonical-check-v1/conditional-lemma-macro-normalization-v1', M3: 'route-budget-v12/blocker-or-routes-v1/structured-provider-failure-v1/assignable-work-v1/advisory-settlement-v3/goal-scoped-advancement-v1/early-route-checks-v1/ready-consumers-v1/evidence-ranked-routes-v2/capacity-free-ranking-v1/active-or-frontier-v1/context-overflow-recovery-v1/pending-validation-v1/trusted-local-stop-v1/host-consumer-connection-v1/definition-task-readiness-v1/scoped-next-checks-v1/yielded-advisory-proof-frontier-v1/consumer-goal-attribution-v1', M4: 'task-interface-context-v31/original-goal-frontier-v3/finished-objective-refs-v1/work-contract-v2/research-handoff-batches-v3/resume-drafts-v1/assignment-knowledge-hints-v1/deferred-handoff-inputs-v1/mathematical-route-planning-v1/complete-research-findings-v1/consumer-interfaces-v1/current-feedback-v1/complete-checkpoints-v1/early-feasibility-v1/parallel-questions-v2/local-attempt-feedback-v1/compact-handoff-sources-v1/exact-interface-diversity-v1/bounded-route-focus-v1/compact-inline-manifest-v1/adopted-research-use-v1/bounded-knowledge-metadata-v1/interface-idf-v1/overflow-optional-budget-v1/initial-planning-budget-v1/required-research-challenges-v1/initial-plan-publication-v1/scoped-route-findings-v1/observed-knowledge-use-v1/lean-json-diagnostics-v1/host-consumer-connection-v1/finite-boolean-evidence-v1/live-research-publication-v1/current-residual-goal-v1/continuation-attachments-v1/accepted-consumer-knowledge-v1/single-delivery-protocol-v1/route-focused-knowledge-v1/independent-goal-knowledge-batch-v1/route-finding-batch-v1/primary-led-removed-v1/assigned-proof-only-diagnostics-v1/lean-prover-v1/host-capacity-exploration-v1/explicit-handoff-publication-v1/advisory-scratch-roots-v1/exact-gap-checkpoint-context-v1/lead-continuation-context-v1/shared-new-helper-ownership-v1/compact-proof-role-context-v1/precise-gap-correction-context-v1/full-plan-adoption-context-v1/coordination-first-context-v1/explicit-research-source-context-v1/short-challenge-assessments-v1/live-plan-rejection-feedback-v1/request-scoped-checkpoint-feedback-v1/worker-checkpoint-feedback-v1/lead-planning-inputs-v1/plan-revision-context-v1/lead-inbox-context-v1/definition-task-context-v1/reference-search-context-v1/definition-knowledge-context-v1/math-tools-context-v1/kernel-certificates-v1/goal-path-review-v1/blueprint-fields-v1/theory-modules-v1/definition-sanity-lemmas-v1/goal-path-decisions-context-v1/owned-declaration-index-v1/library-packs-v1/task-families-v1/team-progress-review-context-v1/source-dependency-review-context-v1/atomic-observations-and-application-hints-v1/scoped-relation-pool-v1/executable-next-check-v1/proof-search-context-v1/installed-library-retrieval-v1/installed-library-application-context-v1/reusable-knowledge-index-v1/installed-library-named-requests-v1/conclusion-focused-knowledge-v1/agent-full-library-context-v1/critical-premise-context-v1/executable-initial-plan-context-v1/bounded-owned-declaration-lookup-v1/continuation-query-batches-v1/critical-inference-guidance-v1/plan-connection-guidance-v1/warm-lead-plan-rejection-v1/host-library-context-revalidation-v1/knowledge-candidate-refill-v1/mathematical-knowledge-ranking-v1/scoped-finding-relevance-v1/decorated-quantifier-fallback-v1/bounded-mathematical-reference-recall-v1', - M5: 'route-cooperation-v33/persistent-failed-input-v1/continuous-frontier-input-v1/research-handoff-batches-v3/assignable-work-v1/resumable-lead-drafts-v1/assignment-deliveries-v1/scoped-research-drafts-v1/review-dispatches-v1/recoverable-delivery-cursors-v1/recoverable-human-edits-v1/recoverable-proof-integration-v1/deferred-handoff-reactivation-v1/concurrent-frontier-recovery-v1/complete-research-findings-v1/consumer-interface-projection-v1/independent-feasibility-v1/ranked-assignment-v1/local-checkpoint-evidence-v1/stable-handoff-inputs-v1/local-attempt-identity-v1/exact-inflight-questions-v1/description-source-recheck-v1/conditional-restore-v1/live-capacity-exploration-v1/snapshot-statement-review-reuse-v1/concurrent-merged-check-v1/adopted-research-use-v1/fixed-candidate-statement-scope-v1/semantic-dependency-review-v1/nonblocking-plan-validation-v1/exact-projection-cache-v1/required-research-challenges-v1/initial-plan-publication-v1/observed-knowledge-use-v1/host-consumer-connection-v1/live-research-publication-v1/typed-helper-preflight-v1/stale-preflight-cancellation-v1/type-projection-preflight-reuse-v1/stale-plan-recheck-stop-v1/shared-statement-preparation-v1/scoped-statement-types-v1/empty-route-list-v1/route-evidence-obligations-v1/primary-led-removed-v1/source-contract-local-repair-v1/unlimited-dispatch-recovery-v1/assignment-condition-snapshot-v1/conditional-dependency-order-v1/original-goal-capacity-coverage-v1/assigned-source-diagnostic-preflight-v1/current-batch-projection-v1/stalled-plan-continuous-recovery-v1/actual-dependency-invalidation-v1/lean-prover-v1/host-capacity-exploration-v1/explicit-handoff-publication-v1/semantic-lead-checkpoints-v1/continuation-handoff-provenance-v1/advisory-stagnation-recovery-v1/explicit-mathematical-gap-recovery-v1/shared-responsibility-assessment-v1/recorded-dispatch-waits-v1/full-plan-explicit-adoption-v1/scoped-delivery-correction-chain-v1/legacy-research-without-finding-v1/research-source-snapshots-v1/source-bound-mathematical-gap-v1/large-delivery-lines-v1/executable-work-assessment-v1/lead-planning-only-v1/plan-revision-patches-v1/lead-inbox-v1/stopped-worker-release-v1/definition-task-dependencies-v1/goal-path-stall-wake-v1/goal-path-answer-coverage-v1/substantive-goal-path-decisions-v1/source-dependency-connect-v1/active-goal-progress-review-v1/executable-goal-review-v1/host-search-checkpoint-v1/executable-next-check-v1/installed-library-dispatch-v1/ascii-forall-statement-shapes-v1/missing-declaration-environment-stability-v1/fresh-goal-progress-v1/missing-research-delivery-recovery-v1/superseded-reservation-release-v1/reseeded-connection-permission-v1/question-bound-advisory-blockers-v1/plan-helper-type-contract-v1/library-probe-advisory-feedback-v1/conditional-research-screening-v1/typed-connection-draft-resume-v1/task-draft-continuation-v1/checkpoint-research-handoff-v1/canonical-dependency-snapshots-v1/verified-canonical-publication-v1/saved-research-transfer-v1/retained-notes-attribution-v1/host-definition-contract-checks-v1/negative-outcome-decisions-v1/definite-type-parser-errors-v1/retained-source-input-discovery-isolation-v1/source-bound-feasibility-drafts-v1/lead-plan-rejection-inbox-v1/checkpointed-connection-prerequisite-yield-v1/fresh-conditional-continuation-reuse-v1', + M5: 'route-cooperation-v33/persistent-failed-input-v1/continuous-frontier-input-v1/research-handoff-batches-v3/assignable-work-v1/resumable-lead-drafts-v1/assignment-deliveries-v1/scoped-research-drafts-v1/review-dispatches-v1/recoverable-delivery-cursors-v1/recoverable-human-edits-v1/recoverable-proof-integration-v1/deferred-handoff-reactivation-v1/concurrent-frontier-recovery-v1/complete-research-findings-v1/consumer-interface-projection-v1/independent-feasibility-v1/ranked-assignment-v1/local-checkpoint-evidence-v1/stable-handoff-inputs-v1/local-attempt-identity-v1/exact-inflight-questions-v1/description-source-recheck-v1/conditional-restore-v1/live-capacity-exploration-v1/snapshot-statement-review-reuse-v1/concurrent-merged-check-v1/adopted-research-use-v1/fixed-candidate-statement-scope-v1/semantic-dependency-review-v1/nonblocking-plan-validation-v1/exact-projection-cache-v1/required-research-challenges-v1/initial-plan-publication-v1/observed-knowledge-use-v1/host-consumer-connection-v1/live-research-publication-v1/typed-helper-preflight-v1/stale-preflight-cancellation-v1/type-projection-preflight-reuse-v1/stale-plan-recheck-stop-v1/shared-statement-preparation-v1/scoped-statement-types-v1/empty-route-list-v1/route-evidence-obligations-v1/primary-led-removed-v1/source-contract-local-repair-v1/unlimited-dispatch-recovery-v1/assignment-condition-snapshot-v1/conditional-dependency-order-v1/original-goal-capacity-coverage-v1/assigned-source-diagnostic-preflight-v1/current-batch-projection-v1/stalled-plan-continuous-recovery-v1/actual-dependency-invalidation-v1/lean-prover-v1/host-capacity-exploration-v1/explicit-handoff-publication-v1/semantic-lead-checkpoints-v1/continuation-handoff-provenance-v1/advisory-stagnation-recovery-v1/explicit-mathematical-gap-recovery-v1/shared-responsibility-assessment-v1/recorded-dispatch-waits-v1/full-plan-explicit-adoption-v1/scoped-delivery-correction-chain-v1/legacy-research-without-finding-v1/research-source-snapshots-v1/source-bound-mathematical-gap-v1/large-delivery-lines-v1/executable-work-assessment-v1/lead-planning-only-v1/plan-revision-patches-v1/lead-inbox-v1/stopped-worker-release-v1/definition-task-dependencies-v1/goal-path-stall-wake-v1/goal-path-answer-coverage-v1/substantive-goal-path-decisions-v1/source-dependency-connect-v1/active-goal-progress-review-v1/executable-goal-review-v1/host-search-checkpoint-v1/executable-next-check-v1/installed-library-dispatch-v1/ascii-forall-statement-shapes-v1/missing-declaration-environment-stability-v1/fresh-goal-progress-v1/missing-research-delivery-recovery-v1/superseded-reservation-release-v1/reseeded-connection-permission-v1/question-bound-advisory-blockers-v1/plan-helper-type-contract-v1/library-probe-advisory-feedback-v1/conditional-research-screening-v1/typed-connection-draft-resume-v1/task-draft-continuation-v1/checkpoint-research-handoff-v1/canonical-dependency-snapshots-v1/verified-canonical-publication-v1/saved-research-transfer-v1/retained-notes-attribution-v1/host-definition-contract-checks-v1/negative-outcome-decisions-v1/definite-type-parser-errors-v1/retained-source-input-discovery-isolation-v1/source-bound-feasibility-drafts-v1/lead-plan-rejection-inbox-v1/checkpointed-connection-prerequisite-yield-v1/fresh-conditional-continuation-reuse-v1/frozen-import-preflight-v1', }, }; diff --git a/src/solver/taskTypePreflight.ts b/src/solver/taskTypePreflight.ts index 371c97e0..90fad999 100644 --- a/src/solver/taskTypePreflight.ts +++ b/src/solver/taskTypePreflight.ts @@ -7,6 +7,7 @@ import { leanScopeCommands, leanScopeNamespace, maskLeanCommentsAndStrings, upda import { checkLeanType, leanTypeDiagnosticProjection } from '../math/leanTypeDiagnostics'; import { formalVerificationToolIdentity } from '../math/verifier'; import { renderLeanDiagnosticMessage } from '../math/leanDiagnosticMessages'; +import type { KnowledgeContextSnapshot } from './knowledgeContext'; import { proofReuseEnvironment } from './proofReuse'; import type { SolverProblem } from './problem'; import { taskVersion, type CooperativeTask } from './tasks'; @@ -19,7 +20,7 @@ export type TaskTypePreflight = { projectionReuse?: { originInputDigest: string; originSourceDigest: string; sourceDigest: string; projectionDigest: string }; }; type Input = { problem: SolverProblem; task: CooperativeTask; projectRoot: string; dependencies: readonly CooperativeTask[]; - environmentDigest: string; env: NodeJS.ProcessEnv; signal?: AbortSignal; timeoutMs: number }; + environmentDigest: string; env: NodeJS.ProcessEnv; signal?: AbortSignal; timeoutMs: number; installedLibrary?: KnowledgeContextSnapshot }; /** Later independent source edits must not reopen an unchanged invalid canonical contract. */ export function taskTypePreflightEnvironmentIdentity(projectRoot: string, env: NodeJS.ProcessEnv): string | undefined { @@ -43,9 +44,11 @@ function unsupportedScope(source: string, offset: number): boolean { return frames.some(Boolean); } +const unknownIdentifier = (message: string) => /^unknown (?:identifier|constant) `([^`\n]+)`/iu.exec(message.trim())?.[1]; + /** Imports do not restore aliases for private declarations in the queried file. */ function privateLookupError(source: string, context: string, offset: number, namespace: string, message: string): boolean { - const unknown = /^unknown (?:identifier|constant) `([^`\n]+)`/iu.exec(message.trim())?.[1]; + const unknown = unknownIdentifier(message); if (!unknown) return false; const prefixes = (name: string) => ['', ...name.split('.').filter(Boolean).map((_, index, parts) => parts.slice(0, index + 1).join('.'))]; const lookups = new Set(prefixes(namespace)), lookupScopes: LeanScope[] = []; @@ -120,6 +123,7 @@ function prepare(input: Input) { file: input.task.proofPath!, context: anchor.qualifiedName, type: input.task.type! }) : undefined; const binding = { project, taskDigest, context: anchor?.qualifiedName, dependencies: input.dependencies.map(task => [task.id, taskVersion(task)]), environmentDigest: input.environmentDigest, + installedLibraryDigest: input.installedLibrary?.digest, timeoutMs: Number.isFinite(input.timeoutMs) ? input.timeoutMs : 'unlimited', environment: environment.digest ?? mathDigest(canonicalMathJson(environment.env)), tools: tools ?? null }; const key = mathDigest(canonicalMathJson({ ...binding, sourceDigest })); @@ -136,7 +140,15 @@ function prepare(input: Input) { canonicalMathJson(files.filter(file => configs.includes(file))); } catch { return false; } }; - return { key, projectionKey, projection, project, taskDigest, sourceDigest, environment, tools, context: anchor?.qualifiedName, reason, current, + const missingFrozenImport = (message: string) => { + const name = unknownIdentifier(message)?.replace(/^_root_\./u, ''), library = input.installedLibrary; + if (!name?.includes('.') || !library) return; + // The installed index contains public declarations only. A worker can import a pinned module outside the current closure. + const entry = library.base.entries.find(item => item.name === name && !files.includes(item.file) && + input.problem.frozenFiles?.[item.file] && input.problem.frozenFiles[item.file] === library.base.contexts[item.contextDigest]?.[item.file]); + return entry?.file.slice(0, -'.lean'.length).replaceAll('/', '.'); + }; + return { key, projectionKey, projection, project, taskDigest, sourceDigest, environment, tools, context: anchor?.qualifiedName, reason, current, missingFrozenImport, privateLookupError: (message: string) => Boolean(anchor && privateLookupError(source, anchor.qualifiedName, anchor.startOffset, anchor.namespace, message)) }; } @@ -245,9 +257,10 @@ export class TaskTypePreflightCache { checked.firstBlocking.file && path.basename(checked.firstBlocking.file) === 'TypeDiagnostic.lean' && definiteTypeError(checked.firstBlocking.message) && checked.diagnosticArtifacts.length > 0 && checked.diagnosticArtifacts.every(item => item.captureComplete === true)) { - const privateContext = snapshot.privateLookupError(checked.firstBlocking.message); - value = result(privateContext ? 'deferred' : 'invalid', - (privateContext ? 'declaration-private-context-not-reproducible\n' : '') + + const missingImport = snapshot.missingFrozenImport(checked.firstBlocking.message); + const defer = missingImport ? `declaration-needs-frozen-import: import ${missingImport}` : + snapshot.privateLookupError(checked.firstBlocking.message) ? 'declaration-private-context-not-reproducible' : undefined; + value = result(defer ? 'deferred' : 'invalid', (defer ? defer + '\n' : '') + renderLeanDiagnosticMessage(checked.firstBlocking), { artifact: checked.artifact }); } else value = result(checked.exitCode === 1 && !checked.timedOut ? 'deferred' : 'unavailable', checked.firstBlocking ? renderLeanDiagnosticMessage(checked.firstBlocking) : 'type-check-inconclusive', { artifact: checked.artifact }); diff --git a/tests/helpers/cooperation.ts b/tests/helpers/cooperation.ts index 8f3c35f9..c07f1cd9 100644 --- a/tests/helpers/cooperation.ts +++ b/tests/helpers/cooperation.ts @@ -7,6 +7,11 @@ import type { SolverRunState } from '../../src/solver/archive'; type Input = ConstructorParameters[0]; +// Worker-delivery fixtures must keep their helper open even when real Lean can solve it at dispatch. +export const workerDeliveryModules: Input['modules'] = { + ...directSolverModules, M2: { ...directSolverModules.M2, closeTask: undefined }, +}; + /** Access for every worker with an empty environment and a shared retrieval root. */ export function workerAccess(workers: readonly ResearchWorker[], retrievalRoot: string): Map { return new Map(workers.map(worker => [worker.id, { environment: {}, retrievalRoot }])); diff --git a/tests/helpers/webCheckedLeanFixture.ts b/tests/helpers/webCheckedLeanFixture.ts new file mode 100644 index 00000000..0383023e --- /dev/null +++ b/tests/helpers/webCheckedLeanFixture.ts @@ -0,0 +1,13 @@ +import type { WebAgentLeanCheck, WebLeanMessage } from '../../apps/web/shared'; +import { mathDigest } from '../../src/math/mathRuntimeIo'; + +/** A synthetic check bound to the source version the browser should display. */ +export function webCheckedLeanFixture(source: string, passed: boolean, diagnostics: WebLeanMessage[] = []): WebAgentLeanCheck { + const file = 'Submission.lean', digest = mathDigest(source); + const sourceDigest = mathDigest(JSON.stringify({ [file]: digest })), environmentDigest = mathDigest('fixture environment'); + const messages = diagnostics.map(message => ({ file, ...message })); + const artifact = mathDigest(JSON.stringify({ sourceDigest, environmentDigest, passed, messages })); + return { passed, classification: passed ? 'success' : 'lean', sourceDigest, environmentDigest, messages, + artifacts: [{ path: '.lake/diagnostic-artifacts/' + artifact + '.json', digest: artifact, sourceDigest, environmentDigest }], + checkedSource: { file, digest, text: source, artifact } }; +} diff --git a/tests/solverConditionalIntegration.test.ts b/tests/solverConditionalIntegration.test.ts index be613241..fae3e6cf 100644 --- a/tests/solverConditionalIntegration.test.ts +++ b/tests/solverConditionalIntegration.test.ts @@ -9,7 +9,7 @@ import { readCooperationPlan, type CooperativeResearch } from '../src/solver/coo import type { ResearchWorker } from '../src/solver/modules/organization'; import { committedSource, commitSolverSources, git, readSolverProblem, type SolverProblem } from '../src/solver/problem'; import type { CooperativeAction, CooperativeTask } from '../src/solver/tasks'; -import { cooperativeResearch } from './helpers/cooperation'; +import { cooperativeResearch, workerDeliveryModules } from './helpers/cooperation'; import { leadWorker, localExample, peerWorker, solverState } from './helpers/solver'; import { failedBatch, verifiedBatch } from './helpers/verifier'; @@ -37,7 +37,8 @@ describe('conditional proof declaration ownership', () => { const node = (id: string) => state.cooperation!.tasks.find(node => node.task.id === id)!; const create = () => { const controller = new AbortController(); - const cooperative = cooperativeResearch({ state, workers, retrievalRoot: directory, signal: controller.signal }); + const cooperative = cooperativeResearch({ state, workers, retrievalRoot: directory, signal: controller.signal, + modules: workerDeliveryModules }); instances.push({ cooperative, controller }); return cooperative; }; diff --git a/tests/solverConditionalLibraryImports.test.ts b/tests/solverConditionalLibraryImports.test.ts index ca0c9d3c..92bc4c14 100644 --- a/tests/solverConditionalLibraryImports.test.ts +++ b/tests/solverConditionalLibraryImports.test.ts @@ -5,10 +5,11 @@ import { bootstrapLeanTask } from '../src/math/leanTask'; import { LIBRARY_PACK_SCHEMA } from '../src/math/libraryPacks'; import type { MathematicsVerifierBatchRequest } from '../src/math/verifier'; import type { CooperativeResearch } from '../src/solver/cooperation'; +import { readInstalledLibrarySnapshot } from '../src/solver/installedLibraryContext'; import { committedSource, commitSolverSources, readSolverProblem, withSolverWorktree } from '../src/solver/problem'; import { applyTaskChanges, createTaskSourceProjector } from '../src/solver/cooperativeProof'; import { taskVersion, type CooperativeTask } from '../src/solver/tasks'; -import { cooperativeResearch } from './helpers/cooperation'; +import { cooperativeResearch, workerAccess, workerDeliveryModules } from './helpers/cooperation'; import { temporaryDirectory } from './helpers/files'; import { leadWorker, peerWorker, solverState } from './helpers/solver'; import { verifiedBatch } from './helpers/verifier'; @@ -64,7 +65,11 @@ describe('conditional consumer with an older library import context', () => { return verifiedBatch(request, { sessionId: 'conditional-library-fixture' }); }); const controller = new AbortController(); - const cooperative = cooperativeResearch({ state, workers, retrievalRoot: directory, signal: controller.signal }); + const access = workerAccess(workers, directory); + const library = readInstalledLibrarySnapshot(problem, state.environmentDigest); + for (const grant of access.values()) grant.installedLibrary = library; + const cooperative = cooperativeResearch({ state, workers, access, modules: workerDeliveryModules, + retrievalRoot: directory, signal: controller.signal }); instances.push({ controller, cooperative }); await cooperative.restore(); const budget = { maxTurns: Infinity, remainingMs: Infinity }; diff --git a/tests/solverProofReadyIntake.test.ts b/tests/solverProofReadyIntake.test.ts index e9be1065..9f2714e0 100644 --- a/tests/solverProofReadyIntake.test.ts +++ b/tests/solverProofReadyIntake.test.ts @@ -9,7 +9,7 @@ import { commitSolverSources, git, type SolverProblem } from '../src/solver/prob import type { ResearchWorker } from '../src/solver/modules/organization'; import { proofReadyRecordSchema } from '../src/solver/proofReady'; import { setWorkerResearchPhase, WorkerProofLifecycle } from '../src/solver/workerProofLifecycle'; -import { cooperativeResearch } from './helpers/cooperation'; +import { cooperativeResearch, workerDeliveryModules } from './helpers/cooperation'; import { leadWorker, localExample, peerWorker, solverState } from './helpers/solver'; import { verifiedBatch } from './helpers/verifier'; import { deferred } from './helpers/async'; @@ -29,6 +29,7 @@ describe('host-owned proof readiness intake', () => { const create = () => { const controller = new AbortController(); const value = cooperativeResearch({ state, workers, retrievalRoot: directory, signal: controller.signal, + modules: workerDeliveryModules, save: () => saves.push(structuredClone(state)), emit: (event, details) => events.push({ event, details }) }); instances.push({ cooperative: value, controller }); return value; }; diff --git a/tests/taskTypePreflight.test.ts b/tests/taskTypePreflight.test.ts index ca051f0a..95aad155 100644 --- a/tests/taskTypePreflight.test.ts +++ b/tests/taskTypePreflight.test.ts @@ -316,6 +316,33 @@ describe('content-bound typed helper preflight', () => { await cache.check(request()); expect(check).toHaveBeenCalledOnce(); }); + it.each([ + ['Frozen.value', 'available', 'deferred'], ['_root_.Frozen.value', 'available', 'deferred'], + ['Frozen.typo', 'available', 'invalid'], ['value', 'available', 'invalid'], + ['Frozen.value', 'not-frozen', 'invalid'], ['Frozen.value', 'different-digest', 'invalid'], + ['Frozen.value', 'transitively-imported', 'invalid'], + ])('classifies an unknown name %s against the %s library as %s', async (name, context, status) => { + const file = 'Submission/Library/Bounds.lean', module = 'Submission.Library.Bounds'; + const frozen = 'namespace Frozen\ndef value : Nat := 0\nend Frozen\n', digest = mathDigest(frozen); + fs.mkdirSync(path.join(root, 'Submission/Library'), { recursive: true }); + fs.writeFileSync(path.join(root, file), frozen); + if (context === 'transitively-imported') { + fs.writeFileSync(path.join(root, 'Base.lean'), `import ${module}\n`); + fs.writeFileSync(path.join(root, 'Submission.lean'), 'import Base\n' + source); + } + const type = `${name} = 0`, input = { task: { ...task, type }, problem: { ...problem, + frozenFiles: context === 'not-frozen' ? {} : { [file]: digest } } }; + const library = { digest, base: { entries: [{ name: 'Frozen.value', file, contextDigest: 'ctx' }], + contexts: { ctx: { [file]: context === 'different-digest' ? mathDigest('other') : digest } } } }; + check.mockImplementation(async () => failure({ projectionDigest: projection(root, type).digest, firstBlocking: { + severity: 'error', format: 'lean-json', file: 'TypeDiagnostic.lean', message: `Unknown identifier \`${name}\`` } })); + // A cached error before the installed snapshot arrived must not hide a newly identified legal import. + expect((await cache.check(request(input))).result.status).toBe('invalid'); + const { result } = await cache.check(request({ ...input, installedLibrary: library })); + expect(result).toMatchObject({ status, proofAcceptance: 'not-assessed' }); + if (status === 'deferred') expect(result.reason).toContain(`import ${module}`); + }); + it.each(['(deterministic) timeout at `whnf`, maximum number of heartbeats (200000) has been reached', 'maximum recursion depth has been reached; use set_option maxRecDepth to increase the limit', 'internal exception: unreachable code', 'IO error: failed to read object file', diff --git a/tests/webBackgroundReviewWorkflow.test.ts b/tests/webBackgroundReviewWorkflow.test.ts index 7aba309d..460a5634 100644 --- a/tests/webBackgroundReviewWorkflow.test.ts +++ b/tests/webBackgroundReviewWorkflow.test.ts @@ -79,15 +79,15 @@ beforeAll(async () => { service = http.createServer(async (request, response) => { const pathname = new URL(request.url!, 'http://fixture').pathname; const bundle = bundles.get(pathname); - if (bundle) { response.writeHead(200, { 'Content-Type': pathname.endsWith('.css') ? 'text/css' : 'text/javascript' }); response.end(bundle); return; } + if (bundle) { response.writeHead(200, { 'Content-Type': pathname.endsWith('.css') ? 'text/css; charset=utf-8' : 'text/javascript; charset=utf-8' }); response.end(bundle); return; } if (pathname === '/chat-fixture.html') { - response.writeHead(200, { 'Content-Type': 'text/html' }); + response.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' }); response.end('
'); return; } - if (pathname === '/theme.js') { response.writeHead(200, { 'Content-Type': 'text/javascript' }); response.end(); return; } + if (pathname === '/theme.js') { response.writeHead(200, { 'Content-Type': 'text/javascript; charset=utf-8' }); response.end(); return; } const file = pathname === '/formalize.html' ? 'formalize.html' : pathname.slice(1); if (['formalize.html', 'app.css', 'formalize.css', 'research-conversation.css'].includes(file)) { - response.writeHead(200, { 'Content-Type': file.endsWith('.html') ? 'text/html' : 'text/css' }); response.end(await fs.readFile(path.join(client, file))); return; + response.writeHead(200, { 'Content-Type': file.endsWith('.html') ? 'text/html; charset=utf-8' : 'text/css; charset=utf-8' }); response.end(await fs.readFile(path.join(client, file))); return; } response.writeHead(204); response.end(); }); diff --git a/tests/webModuleIdentity.test.ts b/tests/webModuleIdentity.test.ts index 8317efb6..052b4c3f 100644 --- a/tests/webModuleIdentity.test.ts +++ b/tests/webModuleIdentity.test.ts @@ -14,16 +14,14 @@ const custom: CustomResearchModule[] = [ describe('one frozen identity for executable research modules and the optional web registry', () => { it('pins the remediation behavior digests for both executable modules and shared identity functions', () => { - // Freeze mathematical knowledge ranking, scoped findings, conservative quantifier - // reading, bounded academic reference recall and fresh conditional continuation - // reuse with the inherited repaired runtime (2026-11-11). + // This dispatch identity also distinguishes helpers waiting for an import from an invalid helper type. const original: [ResearchModulePlan['scheduler'], ResearchModulePlan['context'], string][] = [ - ['plan', 'full', '76c27331296579387232021bb8dea9cdce1ac2df3365fa556f8156e602c1f3bf'], - ['plan', 'essential', '717f4188908d18e89ea9ee3f6d2f45e1783db383aa837ec2a97221664d9769e0'], - ['critical-path', 'full', '5468fafd3a2638e9c7a136aba2fcb88ed45ca50900ecda6fccf19972cd94e7fa'], - ['critical-path', 'essential', '9c031f6c6b9ba60f85403ff511f6a63a84b6d12125f1c4ba072118e8094dc81c'], - ['continuation', 'full', 'f25d2e16dad7312f19a3f69e69e59e305c15403b46c0ed00d373cf2620348cf8'], - ['continuation', 'essential', '3a47676e63fb62f257848aea1030966eb256f2b2b3ee547f92f7465ff4d5e612'], + ['plan', 'full', '421fc70c06eed10a212ee2f3b13e8d37c28095a27157ab1f42a496cee19a9adb'], + ['plan', 'essential', '00c168b3db6f8a2bd0d242f2673991e84fdc4aa142b68249e924981c41cfc4a8'], + ['critical-path', 'full', 'becd449760ce0d67f0d722534b22f16308ec20be56180430a8b4a95513520a53'], + ['critical-path', 'essential', '3a759e8f5c302ddf969c7250e7ed1594d1d75629895547eec14a4bb68c198fc4'], + ['continuation', 'full', 'f5f4f89fc4ba82c1eb057a51081ed13c3094faf81819fb6893a16edfff643275'], + ['continuation', 'essential', 'c975f77ffd38fc1c301f206b2217b961294d239914667a39f11d2dbebc8b8332'], ]; for (const [scheduler, context, digest] of original) { const plan = { scheduler, context, custom: [] }; @@ -31,10 +29,10 @@ describe('one frozen identity for executable research modules and the optional w expect(solverIdentityMethodDigest(configuredResearchModuleIdentity(plan).identity, 'cooperative')).toBe(digest); } const advised: ['cooperative' | 'independent', number, string][] = [ - ['cooperative', 1, '87bbf4c6ba3fac2a373d67be9368830d2f61acf717685c2fc783f679ffeba985'], - ['cooperative', 4, '626229e3d947baf3b392736ede4673928ecbef6e369496c0b679931b3b885da0'], - ['independent', 1, '76b64496327851b864dec27ebdc169c6c25bb5f5b36ee61b5abd8295d147df18'], - ['independent', 4, '76b64496327851b864dec27ebdc169c6c25bb5f5b36ee61b5abd8295d147df18'], + ['cooperative', 1, '504c0d88e0e8005452b8f8e54c691034c08fa5cb827503fd3fbc33726f5c4f27'], + ['cooperative', 4, 'f55f4e90f5df4634f95827d6c630ee0309afd16e9cab81dd0a69440bb0194787'], + ['independent', 1, '1e7143fafeb5b2ad3adabbef022b9e3ec6187f2a11058aef42f8f63a786307eb'], + ['independent', 4, '1e7143fafeb5b2ad3adabbef022b9e3ec6187f2a11058aef42f8f63a786307eb'], ]; for (const [coordination, workers, digest] of advised) { const plan: ResearchModulePlan = { scheduler: 'continuation', context: 'essential', custom }; From d8b61ae1edba003c79e394cefa06bbda520acda4 Mon Sep 17 00:00:00 2001 From: Zhenhao Liu <176368005+LikC1606@users.noreply.github.com> Date: Mon, 23 Nov 2026 20:40:53 +0800 Subject: [PATCH 2/2] Exercise the default proof reading through its visible disclosure --- .github/workflows/verify.yml | 3 +++ scripts/test-web-proof-thinking.ts | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 2ad765c0..8be512d3 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -37,6 +37,9 @@ jobs: 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 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/test-web-proof-thinking.ts --simple-reading - name: Verify the browser's login and research flows with local fixtures run: bun run test:web-login && bun run test:web-natural-first && 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-plan-recovery && bun run test:web-plan-ownership && bun run test:web-explain && bun run test:web-explain-recovery - name: Verify research account switching and interrupted frontend operations diff --git a/scripts/test-web-proof-thinking.ts b/scripts/test-web-proof-thinking.ts index 50a73ec8..f7ea6021 100644 --- a/scripts/test-web-proof-thinking.ts +++ b/scripts/test-web-proof-thinking.ts @@ -568,6 +568,9 @@ try { { severity: 'warning', line: 4, text: warning }, { severity: 'error', line: 5, column: 9, text: diagnostic }, ]) }); await page.goto(`${origin}/?chat=${conversation.id}`, { timeout: 0 }); + const resultDetails = page.locator('[data-chat-result-more]'); + assert.equal(await resultDetails.getAttribute('open'), null, 'Simple reading starts with proof progress folded'); + await openChatResultDetails(page); await contains(copy.engineerSummary.split('\n')[1]!); await failedCheck.waitFor(); await settled(page); assert.equal(await detail(), null, 'A new browser has made no choice'); assert.equal(await thinking.getAttribute('data-detail'), 'simple', 'A new browser reads the conversation in 简洁'); @@ -629,7 +632,10 @@ try { assert.equal(await group.count(), 1); assert.equal(await group.locator(':scope > details').getAttribute('open'), null, 'Returning to 简洁 folds again'); assert.equal(await failedCheck.getAttribute('open'), null); assert.equal(await brief.count(), 1); assert.equal(await process.getAttribute('open'), null); - await page.reload({ timeout: 0 }); await failedCheck.waitFor(); await settled(page); + await page.reload({ timeout: 0 }); + assert.equal(await resultDetails.getAttribute('open'), null, 'Reloading simple reading folds proof progress again'); + await openChatResultDetails(page); + await failedCheck.waitFor(); await settled(page); assert.equal(await thinking.getAttribute('data-detail'), 'simple', 'The choice survives a refresh'); // A long task shows its latest twelve rows; the rest is one click away.