ScienceDiscovery是专为科学研究打造的一站式AI科研工作台。依托该平台,科研人员能够一站式高效完成“文献阅读、假设提出、代码编写、实验试错、参数调优”这一极为繁琐的科研探索流程。
| Files | Last commit | Last update |
|---|---|---|
ci: measure judge tokens, session tokens and tool calls for real cases The daily/release case table reads the staged projection, and the projection keeps only the numbers executionMeasurements returns. Judge tokens were never among them for DeepResearchBench: the scorecard records every judge call with its provider usage under evaluation.judge_calls, but nothing summed it, and staging then dropped the ledger. Tool calls were absent for every non-Biomni case, because no case recorded them. Judge tokens now fall back, after the existing measured sources, to the sum of evaluation.judge_calls[].usage.total_tokens, and only when every recorded call reports a non-negative safe integer. A missing value leaves the cell empty rather than a partial sum, and an empty ledger is not 0. Real cases with a Session collect shared measurements before cleanup through test/helpers/case-measurements.ts, from the public API the Web client uses: - generated and total tokens from GET /api/sessions/:id/usage, call by call, only when every invocation is reported with all three token counts. The summary's bucket totals skip unreported calls, so the same rule now also applies when a metrics document carries the raw summary; - tool calls as distinct trace.id of tool.started/tool.completed in each run's events and toolCallId of tool steps in each subagent stream (and evolve run events for the PUCT search). Every stream read and no tool call gives 0; a missing stream, a truncated history, an unidentifiable tool event, or a catalog tool step no stream recorded leaves it empty. Invocation count is never used as a tool count. Collection never throws and runs outside the test's own time budget, so it cannot change a case's outcome. DeepResearchBench, TC-E2E-01 and PUCT-COMPRESS add the fields to their existing metrics document; the basic, runner recovery, inline cards and J5 journeys write case-metrics.json, which holds the plan case id, the tagged key and the numbers only. A case matched by two metrics documents shows no measurements, so each case keeps exactly one. The staging allowlist and the table's file match include the new name. Peak memory, the score column, the table's scope and every gate stay as they were. Replaying the raw evidence of a recent Nightly run through the new projection fills judge tokens for the four scored DeepResearchBench cases (739.6K, 744.3K, 185.1K, 146.6K) and leaves every other cell and count unchanged. | 2 days ago | |
fix(ci): let a decision outrank a transport break in the same text vetoesCase tested the status-less transport break before the authentication and rate-limit answers, while detectProviderFault tests the decision first. A retrying gateway client aggregates its attempts, so one message can carry attempt 1: … 401 beside attempt 2: read ECONNRESET; the case veto then read only the break, and a sibling 503 classified a credential or quota answer as an outage. The veto now keeps the per-text order, and a .ci case pins the aggregated log beside a 503, with and without a 429 first attempt. | 15 hours ago | |
first commit | 2 months ago | |
fix(health): answer an unauthenticated caller with liveness only The API's /health and /api/health served the Runner's whole record — its platform, version, execution user, sandbox egress allowlist and the workspace quotas — to any caller that could reach the port, and the Runner's own /health served the same record directly. Both routes answer ahead of the token gate on purpose, because the container health checks have no token, so the detail was reachable by anyone the deployment published itself to. Keep the routes public and reduce the unauthenticated answer to liveness — {service, status} on the API, {status} on the Runner — and return the detail to a caller that presents a valid bearer token. A missing and a wrong token both receive liveness only, so the route no longer distinguishes them. Reader changes that follow the contract: - RunnerClient.health() sends its token and keeps learning the clock offset from the same response, so signed execution still has an offset before it starts, and an older Runner that answers the detail regardless keeps working. - The desktop self-check reads the same detail through its authenticated client, and its tip says what the credential it already holds unlocks. - The Docker deployment contract generates a job-scoped token, forwards it as SCIENCE_AGENT_AUTH_TOKEN and authenticates the diagnostic read; the public liveness poll and the Runner assertions are unchanged. - The real E2E helpers and the desktop L3 suite send the configured token; a stack that answers liveness only because the token is missing or wrong now reports that instead of reading an empty detail. - English and Chinese documentation state the public contract. Tests pin the exact public key set on both API routes and on the Runner, the missing/wrong/valid token cases, and the authenticated capability reads. | 3 hours ago | |
docs(health): name the liveness field in the two contract comments Both comments still described the public answer as {service, status} — the field confusion this branch removes. They now name liveness, and HealthReport declares it, so a future reader has the public shape in front of them instead of the detail's field. | 3 hours ago | |
fix(gateway): pick the article PDF, sort versions by integer, and scope outage attribution #1049 review findings, all four: - A version directory can hold supplements (srep32040-s1.pdf, mmc1.pdf, peerj-*.pdf) that sort after the article basename, so "take the last PDF" handed the supplement to the reader. The candidate now requires the article key (<PMCID>.<n>/<PMCID>.<n>.pdf) and only falls back within that set. - "Newest version" was a string sort, so PMC123.10 lost to PMC123.2. It now selects the largest integer revision. - The 40-key window was unchecked. A truncated listing is now refused rather than silently hiding a newer version. - aise_for_status classified every 404/405/410 as endpoint-wide, which turned "no such record" from PDB/Reactome into an outage. Endpoint scope is now explicit via ixed_endpoint=True at the call sites that point at fixed service paths (the PMC bucket, eutils elink, Reactome analysis); record lookups keep their NOT_FOUND. - Dropped the now-unread pmc_ftp_https_prefix config key. services/gateway/tests/test_public_biomed_mcp.py is 38/38, including new cases for supplement preference, integer version sort, truncated listing, and the endpoint-vs-record scope split. | 3 hours ago | |
fix(agent): claim the effective turn bound only where it is enforced Review round 1 on #1113. - effectiveMaxTurns was stamped on every child, but only the native loop clamps to the engine ceiling. JiuwenSwarm and a specialist's external runtime enforce the configured value through the turn_start observer, so the record and subagent_turn_budget.effective described a 128-turn bound that never applied, and a child the observer stopped at 300 could be reported as Subagent exceeded maxTurns=128. The stamp is now written only when the native loop will run the child. - A failing saveSubagentResult sink no longer takes the handoff down with it: the error is caught, the ref is omitted, and the marked truncated body still reaches the parent, which is how ToolOutputGuard already treats a sink. - Restored the runtime-ceiling comment datacenter mangling: runTimeoutMs / runIdleTimeoutMs were corrupted and split across lines by an earlier edit. - Removed the now-unused MAX_MODEL_TURNS alias and a leftover probe in the runtime test, and dropped brief?: from the result shape that nothing fills. - Documented the English result contract alongside the Chinese one, and added coverage for the engine's own /maxTurns=/ message plus a negative case. | 1 hour ago | |
fix: stabilize intermittent mocked workflows | 1 day ago | |
test(agent): type-check the new cases instead of only transpiling them CI's check:typecheck slice caught what tsx had quietly allowed: - AgentLoop.state is private, so the three assertions that read it after a bounded stop now use the public snapshot(). - The over-limit workspace case passed only the two options it used; WorkspaceToolOptions requires enabledConnectorIds and executePython, and its Subagent literal was missing timeoutSeconds. No production code changes: the same behaviour, now checked by the compiler. | 1 hour ago | |
fix(api): refuse a bad budget before the socket, and read it after .env Three findings from the review of 7192f229, all in this commit. **F1 — a bad budget aborted startup after listen.** createMemoryWatch resolved heapBudget() after the server was listening, so a value like 4096MB rejected into the entry point's catch, which only logs and sets process.exitCode: the socket stayed open, /api/health answered 200, and neither the memory watch nor the SIGTERM handler was ever registered. startApiServer now resolves the budget and the trajectory event count before createApiServer, so the same value exits non-zero with no listener — verified: exit 1, no listener, no api.log. **F2 — a budget set only in .env was ignored.** start-stack.sh resolved it at script load, before prepare_local sources .env, so the launch used the default while the child inherited the operator's value and only logged that it was ignored. Resolution is now resolve_api_heap_budget(), called at the end of prepare_local and in prepare_docker. Probe: before-dotenv=3072, after-dotenv=4096. Both variables are now documented in .env.example. **F3 — the empty-override assertion never ran.** A literal \n inside a // comment swallowed the next line, and the helper printed only CONTINUED, so the assertion could not have matched either. The helper now prints the resolved value (CONTINUED budget=%s), the comment is on its own lines, and the case asserts budget=3072 for an empty override, budget=4096 for a real one. The shell resolver is a function now, so the guard test extracts its body instead of a line range; breaking its case subject back to case "" in still turns the case red (got '3072'). | 2 hours ago | |
fix(store): keep the recorded turn ceiling across a reload normalizePersistedSubagent builds an explicit field list and had no reader for effectiveMaxTurns, so the bound written by createSubagent survived only in the running process. store.ts runs that normalizer over every subagent row on each load, so after any restart the field was gone and everything downstream fell back to the configured budget: subagent_turn_budget reported {configured: 300, effective: 300} and the classifier wrote Subagent exceeded maxTurns=300 for a child the engine stopped at 128 — the #1106 mismatch returning through the reload path. The field now round-trips like its neighbours, and a case covers it: create at 300 with a recorded 128, normalize, then reload a second store and read the row back. Verified: tsc over services/api and over this test file in the tagged tests project, plus an ad-hoc run of both paths against the real store and the real codexAgentFactory on this host (the suites are os:linux-tagged, so they are skipped here and CI is what executes them). | 1 hour ago | |
fix(desktop): carry a stalled design, say when it stops, and count its checkpoints Three ways a no-confirm design came to rest with nothing to do: - A turn that ended with no auto card and no create_evolve_run was left alone, because the client only carried a turn that ended on a card. It now sends one sentence per design — only for a design started without pauses, only before the session has a search, and only when there is a turn to read. - A step that ended twice was refused silently, leaving a folded record with nothing to press. The trailing auto card now carries 已停止自动续跑 (data-auto-continue="stopped") and what to reply. - The card's header counted the checkpoints a reader answers while its confirm button sent the design's step total, so one card said 2/3 and answered 2/4. Both now count askedCheckpoints, and the skill's example matches. The pace comes from the transcript — the latest /evolve-design command, including one still being sent — rather than from a remembered switch, so a design started with pauses is never pushed forward, in this window or another. | 22 hours ago | |
fix(health): give the liveness answer its own field, not the detail's status The public answer spelled its verdict status: "ok", the same field and the same value the authenticated detail derives from the Runner. Every reader that gates on status === "ok" therefore passed without having read the detail, so a wrong token looked exactly like a healthy stack: requireRealStack could no longer tell "no credential" from "Runner not ready" and proceeded instead of skipping with a reason. The public answer now carries liveness (ok, or starting on the 503), a field the detail never uses, and the readers separate the two: the API health tests, test/helpers/e2e.ts, the desktop real-E2E gate and both REST docs. A liveness answer is a skip that names why, never a pass. | 3 hours ago | |
docs(health): name the liveness field in the two contract comments Both comments still described the public answer as {service, status} — the field confusion this branch removes. They now name liveness, and HealthReport declares it, so a future reader has the public shape in front of them instead of the detail's field. | 3 hours ago | |
chore: empty file to exercise the merge-request CI trigger Verifies that .gitcode/workflows/ci.yml fires on pull_request, which has only ever been confirmed via explicit workflow_dispatch. Delete this file before merging; the change carries no product content. | 2 months ago | |
fix(docker): restore workspace features on macOS | 1 month ago | |
fix(swarm): require explicit owned runtime overrides | 13 days ago | |
fix(api): refuse a bad budget before the socket, and read it after .env Three findings from the review of 7192f229, all in this commit. **F1 — a bad budget aborted startup after listen.** createMemoryWatch resolved heapBudget() after the server was listening, so a value like 4096MB rejected into the entry point's catch, which only logs and sets process.exitCode: the socket stayed open, /api/health answered 200, and neither the memory watch nor the SIGTERM handler was ever registered. startApiServer now resolves the budget and the trajectory event count before createApiServer, so the same value exits non-zero with no listener — verified: exit 1, no listener, no api.log. **F2 — a budget set only in .env was ignored.** start-stack.sh resolved it at script load, before prepare_local sources .env, so the launch used the default while the child inherited the operator's value and only logged that it was ignored. Resolution is now resolve_api_heap_budget(), called at the end of prepare_local and in prepare_docker. Probe: before-dotenv=3072, after-dotenv=4096. Both variables are now documented in .env.example. **F3 — the empty-override assertion never ran.** A literal \n inside a // comment swallowed the next line, and the helper printed only CONTINUED, so the assertion could not have matched either. The helper now prints the resolved value (CONTINUED budget=%s), the comment is on its own lines, and the case asserts budget=3072 for an empty override, budget=4096 for a real one. The shell resolver is a function now, so the guard test extracts its body instead of a line range; breaking its case subject back to case "" in still turns the case red (got '3072'). | 2 hours ago | |
feat: integrate validated configuration and live chat continuation Reuse shared execution waits for Jiuwen configuration and keep execution approval separate. Retain bounded bridge deadlines, Stop fences, and deterministic expiry regression coverage. | 13 days ago | |
feat(win-desktop): Electron shell, packaged stack startup, and Windows runtime support - Import the Electron shell as win_desktop/: bootstrap wizard, tray lifecycle, single-instance lock, and first-run bytecode precompilation fallback - Local-mode stack orchestrator with the desktop venv sitecustomize; Windows native startup platform and the JiuwenSwarm launcher (override opt-in env) - OS adaptation facades for api/runner/cas/scripts; Windows execution consumers (execution router, micromamba, permissions); DPAPI-encrypted model secret master key - Startup hardening and concurrent MCP stdio connects; build/extra files landed at resources top level; desktop skill selection wired to the JiuwenSwarm backend Squashed from the win-suite-combined history. Incorporates review fixes from HongyeZhou's codex/pr644-ci branch (upstream #694): AgentDescent/MIT licensing attribution, mandatory platform/arch test tags, agent-run delegation guidance, and the empty skill-selection reconciliation. fix included: strip the UTF-8 BOM from micromamba-releases.json - the Windows-side edit introduced a leading U+FEFF that breaks JSON.parse in fetch-managed-micromamba.mjs and the binary-release payload builds. | 12 days ago | |
fix(docs): close report-writer skill fence and lint skills/** Add the missing opening fence on the Default Report Template in skills/report-writer/SKILL.md so code fences pair correctly, and include skills/**/*.md in markdownlint globs so docs:check covers skill docs. Also resolve incidental MD012/MD031/MD040 findings under skills/ that the expanded glob would otherwise fail L1 on. Closes #558 | 15 days ago | |
first commit | 2 months ago | |
feat(sizeopt): slim the Windows installer 797.6 -> ~584 MiB; merge 6 envs into 2 The ~ is deliberate: 578.0 MiB is what was measured at the last buildable head, and un-sweeping babel afterwards adds compressed weight on top of it, which makes 583.6 MiB a projection rather than a measurement. Everything else in this log is measured. See SIZE NUMBERS below for what the projection rests on and for the correction of an earlier, wrong reason for it. Squashed from 25 commits on sizeopt/f26-6to2 (issue #808, design #807). The pre-squash head is tagged backup/pr834-before-squash2-20261105, and the 25 original messages are transcribed at the end of this log so nothing that was decided along the way is lost by the compaction. Hard constraints held throughout: offline double-click install, zero network on first launch, and no first-launch slowdown. The W15 full-pyc precompile is untouched, and assemble now FAILS HARD if precompilation fails. WAVES (each shipped as its own verified build) W1 - JW dead-weight removal + codex vendor strip: 797.6 -> 613.4 MiB (measured) extras collapse (~238 MB), lint toolchain, transitive-dep sweep, and removal of the vendored @openai/codex native toolchain (~437 MB). JW patch 0018 moves playwright/uv out of the main dependencies. W2 - five sidecar venvs -> one uv workspace (6->2, step 1): 613.4 -> 583.3 MiB Single lock, 68 packages resolved to the highest requirement of the set (fastapi 0.162 / pydantic 2.14). W3 - version alignment. Root uv.lock carries websockets 17.4 and no google-genai; the JW lock stays at 15.0.1 because google-genai 1.73.1 pins websockets<17.0,>=13.0.0 (dist-info METADATA:28). Patch 0019 edits the specifier (>=12.0,<16 -> >=12.0,<18) AND re-runs uv lock - the patch carries +100/-83 upload-time lines (millisecond PyPI timestamps) and the numpy 2.4.6/2.5.4 and pandas 3.1.0 moves, which no hand edit produces. The relaxed <18 cap is above 17, so it never reaches google-genai's constraint and JW still resolves 15.0.1. Note the two locks are different projects and must not be read as one. Hardlink de-duplication was measured and REJECTED (7z window mechanics + venv isolation); it is off. W4 - assemble gates + Electron locales 55->3 pak: -> 578.0 MiB (measured) Four gates: JW precompile hard-fail, payload import self-check, RequiredFiles manifest, size always printed. Patch chain manifest: 13 -> 16 (0018-desktop-slim-deps, 0019-align-workspace- versions, 0020 lazy observability import + verifyPatches fingerprint cache). WHAT REVIEW CHANGED (all of these shipped as regressions or no-ops before review caught them; each is now pinned by a test or a build gate) * babel was swept under a rule whose justification read "jinja2 hard dep" - but jinja2 is not installed in the JW venv at all. The real chain is openjiuwen html_compressor.py:55 (lazy, unguarded import_module("trafilatura")) -> trafilatura -> courlan -> babel at MODULE scope (courlan/filters.py:11). compress() swallows ModuleNotFoundError and falls back to beautifulsoup, so this shipped with no error, no log and exit 0 - just title/author/date all None on every HTML compression. The rule is gone and probe assertion 4 runs the product's own compressor and fails the build unless extractor is "trafilatura". Deleting babel/locale-data to "save" the bytes was also measured and rejected: Locale.parse then raises FileNotFoundError for EVERY valid locale, which courlan's except (TypeError, UnknownLocaleError) at filters.py:185 does not catch, turning a silent degradation into a crash. * Both install-dir guards cancelled with Abort, which in a custom page CREATOR only skips the page - the wizard advanced to InstFiles and installed into the root the user had just declined, while the MessageBox said it would return to the directory page. Now Quit. And because a bare Quit in a page creator exits 0 (measured: .onInit gives 2, page creator gives 0, page position irrelevant), each is preceded by SetErrorLevel 1 so a declined unattended run no longer reports success. * The codex vendor sweep targeted a path the flattener cannot produce, so the 437 MB win was a no-op. It now enumerates every reachable shape, and the descent is NOT gated on the name - a platform package winning primaryOf nests the wrapper under @openai/codex-sdk, which the gated walk never entered. * The A1b runtime probe only proved that what the sweep KEPT still works, so a rule that silently stopped matching shipped its dead weight back with every gate green. The probe now also asserts the package table (onnxruntime and kubernetes ABSENT; babel/courlan/trafilatura/chromadb/openjiuwen PRESENT), and the codex vendor sweep gets an independent post-check that matches on CONTENT (codex-package.json, unique to a vendored toolchain) rather than reusing the sweep's own name rule - a check sharing the rule would go blind exactly when the rule does. * nsh-syntax-check's third discovery tier was dead code: a bare catch {} also swallowed a ReferenceError from execFileSync never having been imported, so a programming error reported itself as "makensis not found". It now whitelists only the two measured not-on-PATH shapes. * W2 deleted the five per-service services/<member>/uv.lock files - one root lock now resolves every member - but scripts/start-stack.sh still backed up "$project_dir/uv.lock" in its custom-index path. Under set -euo pipefail that cp fails first, so ANY local start with SCIENCE_AGENT_PYPI_INDEX set died before reaching uv; the .mjs twin already passed repositoryRoot (start-stack.mjs:269-297) and only the shell one was left behind. It now backs up and restores the workspace root's lock, which is also the file uv sync actually rewrites when run inside a member (it walks up to the workspace). Pinned by scripts/start-stack-lock.test.mjs, which slices the real function out of the launcher rather than restating a copy - a copy would keep passing after the launcher regressed - and runs it under bash with a fake uv that walks up and rewrites whatever lock it finds. Three cases: the mirror path leaves the root lock pristine and removes its backup; a mutation guard that reverts the path to $project_dir must fail; and with no mirror configured --locked is still passed through. * Review then found a defect IN that fix (F15). The backup/restore pair was two sequential statements with no trap between them, and a mirror uv sync runs for tens of seconds to minutes, so Ctrl-C / terminal close / CI timeout kill inside that window skipped the restore entirely: uv.lock kept mirror-resolved content and an untracked uv.lock.stack-backup stayed in the repository root. Worse, the NEXT run copied that dirty lock over the backup first, so even a clean sync afterwards restored dirty content and froze it as the baseline - contradicting docs/{en,zh}/reference/configuration.md's promise that the script backs up and restores the lockfile without touching the workspace. The restore is now trap-driven. Two traps, not one: an INT trap does NOT terminate the script by itself, it only interrupts the foreground child, so a bare trap restore EXIT INT TERM would restore and then carry on starting the stack after Ctrl-C. INT/TERM therefore go through a handler that restores and then exits 130/143, while EXIT keeps the plain restore (the interrupt path has already cleared the backup, so the EXIT re-entry is a no-op). Paths are globals, not the caller's locals, because an EXIT trap can fire after uv_sync_project has returned and a local would be out of scope. Restore is copy-then-remove, never rename: renaming the lockfile away would leave the tree with no lockfile at all if the process were killed outside the trap, and on Windows a rename onto a target uv still holds a handle to fails outright. The .mjs twin needed the same fix but the FIRST attempt at it was dead code, and review caught that: it published the active pair and restored it from cleanup(), yet cleanup() was only reachable via the SIGINT/SIGTERM/exit handlers registered at what was then line 494 - while all three uvSyncProject calls run at top level inside if (!options.noBuild), at lines 357/384/400, i.e. BEFORE any handler existed. Inside that window Node's default SIGINT behaviour terminates the process, so the async finally never ran and the restore was unreachable exactly where it was written to cover. An earlier revision of this log claimed the handlers "all reach" the restore; that was false and is corrected here. Both halves are now fixed: the handler block is registered above the build block (verified: SIGINT at 343, build block at 347, syncs at 357/384/400), and the finally calls the synchronous idempotent restoreActiveLockfile() instead of clearing the global and then awaiting copyFile - clearing first left a gap where a signal found the pair forgotten but unrestored, and an awaited restore can be abandoned by the very process.exit the handlers call. Two static tests pin both invariants, and each was mutation-verified: moving the handlers back below the build block turns the ordering test red (SIGINT 364 vs build 344), and restoring the clear-then-await finally turns the other one red. Two more cases pin the bash side: a fake uv that rewrites the lock, signals the launcher, then dies of SIGINT itself (both halves needed - bash defers a trapped signal until its child exits, and only takes the shell down once the child is seen to have died of SIGINT), and a mutation guard that removes the trap armament and must then reproduce the dirty-lock-plus-stray-backup state. * A comment in assemble-backend.mjs's A5 budget block named the compileall temp suffix as "<pid>". It is not the pid: measured on this machine, compile_dir over 40 files produced 40/40 temp names of the form "<name>.cpython-313.pyc.<13 digits>" - a 14-char suffix - while that run's pid was 23144, five digits. The suffix is id(path) of the target, which is what _write_atomic uses. Only the label was wrong, not the number: 14 is measured, and COMPILEALL_TEMP_MARGIN stays 19 as a deliberately wide upper bound, since id()'s decimal length is not contractual and erring wide only tightens A5. Reconciling the constant DOWN to the measured 14 would narrow the budget by 5 characters in the unsafe direction, so the comment now says so explicitly. * Install root separated from the data dir (both used to default to the same literal, so uninstalling deleted envs/, secrets/ and every session), and path checks made platform-independent (win32.isAbsolute + win32.parse). SIZE NUMBERS - MEASURED VS PROJECTED (lesson L32: never present a projection as a measurement) 797.6 MiB f26 baseline measured 613.4 MiB after W1 measured 583.3 MiB after W2 measured 578.0 MiB after W4 measured 583.6 MiB after un-sweeping babel PROJECTED, not measured The last line is a projection. Its inputs are measured: 578.0 MiB actual, plus babel's compressed weight (29.38 MiB uncompressed, of which locale-data is 28.50 MiB - 97% apparent, 96.3% compressed). Reporting the uncompressed figure as the saving would overstate it by ~5x. CORRECTION of the reason an earlier revision gave for this projection. That revision said the C: drive had 2.4 GB free against a 5 GB MIN_FREE_BYTES gate, so pnpm dist could not run here, and a reviewer accepted that premise. It was wrong. MIN_FREE_BYTES (win_desktop/src/wizard-data-dir.ts:8) is the FIRST-RUN data-directory wizard's runtime floor; build.mjs and assemble-backend.mjs contain no free-space check at all, and every artefact lands on E: (141 GB free). Having said so publicly, the build was retried and the real blocker turned out to be PATH LENGTH, not disk space: compileall writes each .pyc as "<name>.pyc.<pid>" before renaming it, and with A5's measured maxRel=192 that 14-char suffix made the longest payload path 60+192+14=266 against Windows' 259 usable characters, so the JW venv precompile died with FileNotFoundError - caught by this PR's own new hard-fail gate. A short build root gives 12+192+14=218 (margin 41), which is how release5 was built (release5-assemble.log:3, "out = X:\p5"). The same arithmetic binds one level later and tighter: electron-builder copies the payload into <output>\win-unpacked\resources\..., so the in-tree default output dir makes it 62+14+192=268 - OVER the limit - while a short output dir gives 240. A5 measures the payload root and does not cover that copy. QUALITY EVIDENCE (all re-measured at this head, not carried over) win_desktop suite 159 tests / 159 pass / 0 fail probeDataDir's disk-space case now passes too (C: has 13.81 GiB free against its 5 GB MIN_FREE_BYTES floor); the earlier revision reported it failing at 2.4 GB free, and that was the ONE place a free-space number was relevant - it is this wizard's own runtime check, not a build gate. start-stack-lock 7 tests / 7 pass / 0 fail, run through a forced- registration copy: the file's tags are os:linux/os:macos because CI's ut job runs on ubuntu, and test/support/tagged/compat.mjs:47-49 returns inapplicable() - which turns test() into a no-op - when the tags do not name the host OS. On Windows that reports "# tests 1 # pass 1": the file itself counted as one passing test with zero of its own cases executed. Green there means nothing, so the numbers reported here are from that copy. 4 of the 7 are mutation guards and each was verified to actually go red on the reverted code: (a) reverting the lockfile path to $project_dir, (b) removing the bash trap armament, (c) moving the .mjs handler block back below the build block, (d) restoring the .mjs clear-then-await-copyFile finally. A guard that passes means the harness stopped reproducing the bug, which would make the green cases beside it prove nothing - that is why (c) and (d) were mutation-checked rather than assumed. typecheck win_desktop tsc -p tsconfig.json --noEmit exit 0 / 0 errors; root tsc -p tsconfig.tests.json exit 0 / 0 errors. The full npm run typecheck (which starts with pnpm --recursive typecheck) cannot run on this machine - pnpm's dependency-status check invokes wmic.exe, blocked by the local security policy - so CI's L1 static checks covers it and was green at the previous head. The files this PR changes under scripts/ are .sh and .mjs, neither of which tsc reads, so the type layer is unaffected either way. Note that a bare root tsc -p tsconfig.json reports thousands of errors because it pulls in apps/desktop/e2e- real and the e2e specs, which carry their own tsconfigs; that is not the command npm run typecheck runs and not what CI runs. nsh-syntax-check exit 0, 95.4 KiB artefact, 7 warnings, 0 unexpected probe vs the babel-regression payload exit 1, names babel probe vs a dev tree, default mode exit 1, names onnxruntime+kubernetes probe vs a dev tree, SD_PROBE_DEV_TREE=1 exit 0, PROBE_OK mutation harnesses 6/6 CAUGHT (3 for the installer guard, 3 for the sweep verification), each restoring a byte-identical tree and re-running green Not re-verified at this head, stated so nobody has to guess: evolve's 33 failures remain a Windows-no-sandbox baseline (an artefact was produced but not re-run here), and which downstream consumers were re-run is recorded per wave in the original messages below rather than re-derived. Real-machine evidence, restated to match what was actually asked for last. An earlier revision of this log said a recorded install-to-first-launch run and screenshots could not be produced "for the same disk-space reason" - that reason was the wrong one corrected above, so the claim is withdrawn along with it. What is genuinely still outstanding, narrowed to the items that were kept as blocking rather than waived: 1. one clean-machine install, with the first-launch duration recorded; 2. actually hitting the over-long-path rejection, and recording what the dialog says and whether confirming returns to the picker or aborts; 3. the uninstall-preserves-data branch, walked once. Text and stills satisfy these; a screen recording is not required. The reviewer waived the bilingual screenshot set, the evolve regression comparison, and the codex-vendor blind spot as non-blocking, and asked only that patch 0019's description be corrected in prose rather than re-done in code - that correction is in the W3 section above. Remaining hard requirements on the PR itself are the CLA signature (author-only) and a fresh code-owner approval, neither of which is a code change. --- The 25 commits this was squashed from, oldest first: 6f76d71e perf(instrumentation): millisecond-level startup timeline marks across shell/stack/jw e8d90708 feat(sizeopt): W1 slim JW payload + codex vendor strip (v0.2: 797.6 -> 613.4 MiB) fe935066 feat(sizeopt): W2 merge five sidecar venvs into one uv workspace (6->2 step 1) 1837d8b1 feat(sizeopt): W3 version alignment + W4 assemble gates 9d73cca0 perf(jiuwen_swarm): patch 0020 lazy observability import + verifyPatches fingerprint cache bcd70b0a fix(win_desktop): reject incomplete paths in the data-dir wizard before touching the filesystem 4333cea8 fix(win_desktop): keep the payload inside MAX_PATH - shorten layout and install root, add two gates 9d2b9b07 fix(docker): give uv the whole workspace manifest set, not one member's lock f9c5bc79 fix(ci): point tagged-test python paths at the per-member venvs uv creates 54baf639 fix(swarm-patches): treat root build metadata as wheel-optional e46e6804 fix(ci): give the swarm contract check pytest back on the slim venv 955d32ce fix(scripts): sync the jiuwenswarm.mjs setup slim, like the .sh twin 5da96e8a fix(sizeopt): pin the workspace interpreter at the repository root 459ff84d fix(win_desktop): enumerate every codex vendor dir instead of one guessed path 3225b0cd fix(launcher): re-export the Evolve dependency lock from the unified root lock b4212c1f fix(scripts): export the paper interpreter on the dev stack c49bd681 fix(win_desktop): descend codex vendor sweep unconditionally, not only under matched dirs e8e3b40f fix(win_desktop): separate the install root from the data dir; keep upgrades in place; make path checks platform-independent a161208a test(win_desktop): guard the installer's cross-file couplings statically, and compile installer.nsh on demand eb99ee2e docs(win_desktop): correct the F4 evidence denominator to distinct dirs 164a0b46 fix(win_desktop): make the install-dir guards actually cancel; unbreak nsh-syntax-check's PATH tier 03e12c2d fix(win_desktop): stop sweeping babel - it silently degraded the shipped HTML compressor 4d63f303 fix(win_desktop): make a declined install exit non-zero, not 0 6a852bd6 fix(win_desktop): prove the sweep actually swept, in both directions 4d0cf516 fix(scripts): back up the workspace-root lock in the bash mirror path Each of those carried its own reasoning in its body; the full transcript is kept locally and any of them can still be read from the backup tag. The squash itself was tree-preserving: git reset --soft onto upstream/main and a single git commit produced a tree byte-identical to the 2-commit head 4d0cf516 (tag backup/pr834-before-squash2-20261105-122529, tree 0c8582b3). Review then raised three findings, all amended into this same commit, so the tree at THIS head differs from 4d0cf516 by exactly those four files (git diff --numstat 4d0cf516 HEAD): scripts/start-stack-lock.test.mjs +196 -8 F15/F17 tests scripts/start-stack.mjs +52 -14 F15 fix (.mjs twin) scripts/start-stack.sh +52 -2 F15 fix (bash) win_desktop/scripts/assemble-backend.mjs +2 -1 F17, COMMENT ONLY (302 insertions, 25 deletions total). The assemble-backend.mjs hunk changes no executable line - it is two comment lines inside the A5 budget's "// Model (problems W6, lesson L29)" block, and COMPILEALL_TEMP_MARGIN is still 19, so no payload, JW, sweep, gate or installer behaviour moved and every measured size and gate number above still describes the shipped artefact. The three scripts/ files are the dev-stack launcher and its test, which are not part of the payload either. | 6 days ago | |
chore: replace code owner with Yuan Zhou on both hosts | 7 days ago | |
ci: separate PR builds from merge queue E2E | 2 days ago | |
feat(sizeopt): slim the Windows installer 797.6 -> ~584 MiB; merge 6 envs into 2 The ~ is deliberate: 578.0 MiB is what was measured at the last buildable head, and un-sweeping babel afterwards adds compressed weight on top of it, which makes 583.6 MiB a projection rather than a measurement. Everything else in this log is measured. See SIZE NUMBERS below for what the projection rests on and for the correction of an earlier, wrong reason for it. Squashed from 25 commits on sizeopt/f26-6to2 (issue #808, design #807). The pre-squash head is tagged backup/pr834-before-squash2-20261105, and the 25 original messages are transcribed at the end of this log so nothing that was decided along the way is lost by the compaction. Hard constraints held throughout: offline double-click install, zero network on first launch, and no first-launch slowdown. The W15 full-pyc precompile is untouched, and assemble now FAILS HARD if precompilation fails. WAVES (each shipped as its own verified build) W1 - JW dead-weight removal + codex vendor strip: 797.6 -> 613.4 MiB (measured) extras collapse (~238 MB), lint toolchain, transitive-dep sweep, and removal of the vendored @openai/codex native toolchain (~437 MB). JW patch 0018 moves playwright/uv out of the main dependencies. W2 - five sidecar venvs -> one uv workspace (6->2, step 1): 613.4 -> 583.3 MiB Single lock, 68 packages resolved to the highest requirement of the set (fastapi 0.162 / pydantic 2.14). W3 - version alignment. Root uv.lock carries websockets 17.4 and no google-genai; the JW lock stays at 15.0.1 because google-genai 1.73.1 pins websockets<17.0,>=13.0.0 (dist-info METADATA:28). Patch 0019 edits the specifier (>=12.0,<16 -> >=12.0,<18) AND re-runs uv lock - the patch carries +100/-83 upload-time lines (millisecond PyPI timestamps) and the numpy 2.4.6/2.5.4 and pandas 3.1.0 moves, which no hand edit produces. The relaxed <18 cap is above 17, so it never reaches google-genai's constraint and JW still resolves 15.0.1. Note the two locks are different projects and must not be read as one. Hardlink de-duplication was measured and REJECTED (7z window mechanics + venv isolation); it is off. W4 - assemble gates + Electron locales 55->3 pak: -> 578.0 MiB (measured) Four gates: JW precompile hard-fail, payload import self-check, RequiredFiles manifest, size always printed. Patch chain manifest: 13 -> 16 (0018-desktop-slim-deps, 0019-align-workspace- versions, 0020 lazy observability import + verifyPatches fingerprint cache). WHAT REVIEW CHANGED (all of these shipped as regressions or no-ops before review caught them; each is now pinned by a test or a build gate) * babel was swept under a rule whose justification read "jinja2 hard dep" - but jinja2 is not installed in the JW venv at all. The real chain is openjiuwen html_compressor.py:55 (lazy, unguarded import_module("trafilatura")) -> trafilatura -> courlan -> babel at MODULE scope (courlan/filters.py:11). compress() swallows ModuleNotFoundError and falls back to beautifulsoup, so this shipped with no error, no log and exit 0 - just title/author/date all None on every HTML compression. The rule is gone and probe assertion 4 runs the product's own compressor and fails the build unless extractor is "trafilatura". Deleting babel/locale-data to "save" the bytes was also measured and rejected: Locale.parse then raises FileNotFoundError for EVERY valid locale, which courlan's except (TypeError, UnknownLocaleError) at filters.py:185 does not catch, turning a silent degradation into a crash. * Both install-dir guards cancelled with Abort, which in a custom page CREATOR only skips the page - the wizard advanced to InstFiles and installed into the root the user had just declined, while the MessageBox said it would return to the directory page. Now Quit. And because a bare Quit in a page creator exits 0 (measured: .onInit gives 2, page creator gives 0, page position irrelevant), each is preceded by SetErrorLevel 1 so a declined unattended run no longer reports success. * The codex vendor sweep targeted a path the flattener cannot produce, so the 437 MB win was a no-op. It now enumerates every reachable shape, and the descent is NOT gated on the name - a platform package winning primaryOf nests the wrapper under @openai/codex-sdk, which the gated walk never entered. * The A1b runtime probe only proved that what the sweep KEPT still works, so a rule that silently stopped matching shipped its dead weight back with every gate green. The probe now also asserts the package table (onnxruntime and kubernetes ABSENT; babel/courlan/trafilatura/chromadb/openjiuwen PRESENT), and the codex vendor sweep gets an independent post-check that matches on CONTENT (codex-package.json, unique to a vendored toolchain) rather than reusing the sweep's own name rule - a check sharing the rule would go blind exactly when the rule does. * nsh-syntax-check's third discovery tier was dead code: a bare catch {} also swallowed a ReferenceError from execFileSync never having been imported, so a programming error reported itself as "makensis not found". It now whitelists only the two measured not-on-PATH shapes. * W2 deleted the five per-service services/<member>/uv.lock files - one root lock now resolves every member - but scripts/start-stack.sh still backed up "$project_dir/uv.lock" in its custom-index path. Under set -euo pipefail that cp fails first, so ANY local start with SCIENCE_AGENT_PYPI_INDEX set died before reaching uv; the .mjs twin already passed repositoryRoot (start-stack.mjs:269-297) and only the shell one was left behind. It now backs up and restores the workspace root's lock, which is also the file uv sync actually rewrites when run inside a member (it walks up to the workspace). Pinned by scripts/start-stack-lock.test.mjs, which slices the real function out of the launcher rather than restating a copy - a copy would keep passing after the launcher regressed - and runs it under bash with a fake uv that walks up and rewrites whatever lock it finds. Three cases: the mirror path leaves the root lock pristine and removes its backup; a mutation guard that reverts the path to $project_dir must fail; and with no mirror configured --locked is still passed through. * Review then found a defect IN that fix (F15). The backup/restore pair was two sequential statements with no trap between them, and a mirror uv sync runs for tens of seconds to minutes, so Ctrl-C / terminal close / CI timeout kill inside that window skipped the restore entirely: uv.lock kept mirror-resolved content and an untracked uv.lock.stack-backup stayed in the repository root. Worse, the NEXT run copied that dirty lock over the backup first, so even a clean sync afterwards restored dirty content and froze it as the baseline - contradicting docs/{en,zh}/reference/configuration.md's promise that the script backs up and restores the lockfile without touching the workspace. The restore is now trap-driven. Two traps, not one: an INT trap does NOT terminate the script by itself, it only interrupts the foreground child, so a bare trap restore EXIT INT TERM would restore and then carry on starting the stack after Ctrl-C. INT/TERM therefore go through a handler that restores and then exits 130/143, while EXIT keeps the plain restore (the interrupt path has already cleared the backup, so the EXIT re-entry is a no-op). Paths are globals, not the caller's locals, because an EXIT trap can fire after uv_sync_project has returned and a local would be out of scope. Restore is copy-then-remove, never rename: renaming the lockfile away would leave the tree with no lockfile at all if the process were killed outside the trap, and on Windows a rename onto a target uv still holds a handle to fails outright. The .mjs twin needed the same fix but the FIRST attempt at it was dead code, and review caught that: it published the active pair and restored it from cleanup(), yet cleanup() was only reachable via the SIGINT/SIGTERM/exit handlers registered at what was then line 494 - while all three uvSyncProject calls run at top level inside if (!options.noBuild), at lines 357/384/400, i.e. BEFORE any handler existed. Inside that window Node's default SIGINT behaviour terminates the process, so the async finally never ran and the restore was unreachable exactly where it was written to cover. An earlier revision of this log claimed the handlers "all reach" the restore; that was false and is corrected here. Both halves are now fixed: the handler block is registered above the build block (verified: SIGINT at 343, build block at 347, syncs at 357/384/400), and the finally calls the synchronous idempotent restoreActiveLockfile() instead of clearing the global and then awaiting copyFile - clearing first left a gap where a signal found the pair forgotten but unrestored, and an awaited restore can be abandoned by the very process.exit the handlers call. Two static tests pin both invariants, and each was mutation-verified: moving the handlers back below the build block turns the ordering test red (SIGINT 364 vs build 344), and restoring the clear-then-await finally turns the other one red. Two more cases pin the bash side: a fake uv that rewrites the lock, signals the launcher, then dies of SIGINT itself (both halves needed - bash defers a trapped signal until its child exits, and only takes the shell down once the child is seen to have died of SIGINT), and a mutation guard that removes the trap armament and must then reproduce the dirty-lock-plus-stray-backup state. * A comment in assemble-backend.mjs's A5 budget block named the compileall temp suffix as "<pid>". It is not the pid: measured on this machine, compile_dir over 40 files produced 40/40 temp names of the form "<name>.cpython-313.pyc.<13 digits>" - a 14-char suffix - while that run's pid was 23144, five digits. The suffix is id(path) of the target, which is what _write_atomic uses. Only the label was wrong, not the number: 14 is measured, and COMPILEALL_TEMP_MARGIN stays 19 as a deliberately wide upper bound, since id()'s decimal length is not contractual and erring wide only tightens A5. Reconciling the constant DOWN to the measured 14 would narrow the budget by 5 characters in the unsafe direction, so the comment now says so explicitly. * Install root separated from the data dir (both used to default to the same literal, so uninstalling deleted envs/, secrets/ and every session), and path checks made platform-independent (win32.isAbsolute + win32.parse). SIZE NUMBERS - MEASURED VS PROJECTED (lesson L32: never present a projection as a measurement) 797.6 MiB f26 baseline measured 613.4 MiB after W1 measured 583.3 MiB after W2 measured 578.0 MiB after W4 measured 583.6 MiB after un-sweeping babel PROJECTED, not measured The last line is a projection. Its inputs are measured: 578.0 MiB actual, plus babel's compressed weight (29.38 MiB uncompressed, of which locale-data is 28.50 MiB - 97% apparent, 96.3% compressed). Reporting the uncompressed figure as the saving would overstate it by ~5x. CORRECTION of the reason an earlier revision gave for this projection. That revision said the C: drive had 2.4 GB free against a 5 GB MIN_FREE_BYTES gate, so pnpm dist could not run here, and a reviewer accepted that premise. It was wrong. MIN_FREE_BYTES (win_desktop/src/wizard-data-dir.ts:8) is the FIRST-RUN data-directory wizard's runtime floor; build.mjs and assemble-backend.mjs contain no free-space check at all, and every artefact lands on E: (141 GB free). Having said so publicly, the build was retried and the real blocker turned out to be PATH LENGTH, not disk space: compileall writes each .pyc as "<name>.pyc.<pid>" before renaming it, and with A5's measured maxRel=192 that 14-char suffix made the longest payload path 60+192+14=266 against Windows' 259 usable characters, so the JW venv precompile died with FileNotFoundError - caught by this PR's own new hard-fail gate. A short build root gives 12+192+14=218 (margin 41), which is how release5 was built (release5-assemble.log:3, "out = X:\p5"). The same arithmetic binds one level later and tighter: electron-builder copies the payload into <output>\win-unpacked\resources\..., so the in-tree default output dir makes it 62+14+192=268 - OVER the limit - while a short output dir gives 240. A5 measures the payload root and does not cover that copy. QUALITY EVIDENCE (all re-measured at this head, not carried over) win_desktop suite 159 tests / 159 pass / 0 fail probeDataDir's disk-space case now passes too (C: has 13.81 GiB free against its 5 GB MIN_FREE_BYTES floor); the earlier revision reported it failing at 2.4 GB free, and that was the ONE place a free-space number was relevant - it is this wizard's own runtime check, not a build gate. start-stack-lock 7 tests / 7 pass / 0 fail, run through a forced- registration copy: the file's tags are os:linux/os:macos because CI's ut job runs on ubuntu, and test/support/tagged/compat.mjs:47-49 returns inapplicable() - which turns test() into a no-op - when the tags do not name the host OS. On Windows that reports "# tests 1 # pass 1": the file itself counted as one passing test with zero of its own cases executed. Green there means nothing, so the numbers reported here are from that copy. 4 of the 7 are mutation guards and each was verified to actually go red on the reverted code: (a) reverting the lockfile path to $project_dir, (b) removing the bash trap armament, (c) moving the .mjs handler block back below the build block, (d) restoring the .mjs clear-then-await-copyFile finally. A guard that passes means the harness stopped reproducing the bug, which would make the green cases beside it prove nothing - that is why (c) and (d) were mutation-checked rather than assumed. typecheck win_desktop tsc -p tsconfig.json --noEmit exit 0 / 0 errors; root tsc -p tsconfig.tests.json exit 0 / 0 errors. The full npm run typecheck (which starts with pnpm --recursive typecheck) cannot run on this machine - pnpm's dependency-status check invokes wmic.exe, blocked by the local security policy - so CI's L1 static checks covers it and was green at the previous head. The files this PR changes under scripts/ are .sh and .mjs, neither of which tsc reads, so the type layer is unaffected either way. Note that a bare root tsc -p tsconfig.json reports thousands of errors because it pulls in apps/desktop/e2e- real and the e2e specs, which carry their own tsconfigs; that is not the command npm run typecheck runs and not what CI runs. nsh-syntax-check exit 0, 95.4 KiB artefact, 7 warnings, 0 unexpected probe vs the babel-regression payload exit 1, names babel probe vs a dev tree, default mode exit 1, names onnxruntime+kubernetes probe vs a dev tree, SD_PROBE_DEV_TREE=1 exit 0, PROBE_OK mutation harnesses 6/6 CAUGHT (3 for the installer guard, 3 for the sweep verification), each restoring a byte-identical tree and re-running green Not re-verified at this head, stated so nobody has to guess: evolve's 33 failures remain a Windows-no-sandbox baseline (an artefact was produced but not re-run here), and which downstream consumers were re-run is recorded per wave in the original messages below rather than re-derived. Real-machine evidence, restated to match what was actually asked for last. An earlier revision of this log said a recorded install-to-first-launch run and screenshots could not be produced "for the same disk-space reason" - that reason was the wrong one corrected above, so the claim is withdrawn along with it. What is genuinely still outstanding, narrowed to the items that were kept as blocking rather than waived: 1. one clean-machine install, with the first-launch duration recorded; 2. actually hitting the over-long-path rejection, and recording what the dialog says and whether confirming returns to the picker or aborts; 3. the uninstall-preserves-data branch, walked once. Text and stills satisfy these; a screen recording is not required. The reviewer waived the bilingual screenshot set, the evolve regression comparison, and the codex-vendor blind spot as non-blocking, and asked only that patch 0019's description be corrected in prose rather than re-done in code - that correction is in the W3 section above. Remaining hard requirements on the PR itself are the CLA signature (author-only) and a fresh code-owner approval, neither of which is a code change. --- The 25 commits this was squashed from, oldest first: 6f76d71e perf(instrumentation): millisecond-level startup timeline marks across shell/stack/jw e8d90708 feat(sizeopt): W1 slim JW payload + codex vendor strip (v0.2: 797.6 -> 613.4 MiB) fe935066 feat(sizeopt): W2 merge five sidecar venvs into one uv workspace (6->2 step 1) 1837d8b1 feat(sizeopt): W3 version alignment + W4 assemble gates 9d73cca0 perf(jiuwen_swarm): patch 0020 lazy observability import + verifyPatches fingerprint cache bcd70b0a fix(win_desktop): reject incomplete paths in the data-dir wizard before touching the filesystem 4333cea8 fix(win_desktop): keep the payload inside MAX_PATH - shorten layout and install root, add two gates 9d2b9b07 fix(docker): give uv the whole workspace manifest set, not one member's lock f9c5bc79 fix(ci): point tagged-test python paths at the per-member venvs uv creates 54baf639 fix(swarm-patches): treat root build metadata as wheel-optional e46e6804 fix(ci): give the swarm contract check pytest back on the slim venv 955d32ce fix(scripts): sync the jiuwenswarm.mjs setup slim, like the .sh twin 5da96e8a fix(sizeopt): pin the workspace interpreter at the repository root 459ff84d fix(win_desktop): enumerate every codex vendor dir instead of one guessed path 3225b0cd fix(launcher): re-export the Evolve dependency lock from the unified root lock b4212c1f fix(scripts): export the paper interpreter on the dev stack c49bd681 fix(win_desktop): descend codex vendor sweep unconditionally, not only under matched dirs e8e3b40f fix(win_desktop): separate the install root from the data dir; keep upgrades in place; make path checks platform-independent a161208a test(win_desktop): guard the installer's cross-file couplings statically, and compile installer.nsh on demand eb99ee2e docs(win_desktop): correct the F4 evidence denominator to distinct dirs 164a0b46 fix(win_desktop): make the install-dir guards actually cancel; unbreak nsh-syntax-check's PATH tier 03e12c2d fix(win_desktop): stop sweeping babel - it silently degraded the shipped HTML compressor 4d63f303 fix(win_desktop): make a declined install exit non-zero, not 0 6a852bd6 fix(win_desktop): prove the sweep actually swept, in both directions 4d0cf516 fix(scripts): back up the workspace-root lock in the bash mirror path Each of those carried its own reasoning in its body; the full transcript is kept locally and any of them can still be read from the backup tag. The squash itself was tree-preserving: git reset --soft onto upstream/main and a single git commit produced a tree byte-identical to the 2-commit head 4d0cf516 (tag backup/pr834-before-squash2-20261105-122529, tree 0c8582b3). Review then raised three findings, all amended into this same commit, so the tree at THIS head differs from 4d0cf516 by exactly those four files (git diff --numstat 4d0cf516 HEAD): scripts/start-stack-lock.test.mjs +196 -8 F15/F17 tests scripts/start-stack.mjs +52 -14 F15 fix (.mjs twin) scripts/start-stack.sh +52 -2 F15 fix (bash) win_desktop/scripts/assemble-backend.mjs +2 -1 F17, COMMENT ONLY (302 insertions, 25 deletions total). The assemble-backend.mjs hunk changes no executable line - it is two comment lines inside the A5 budget's "// Model (problems W6, lesson L29)" block, and COMPILEALL_TEMP_MARGIN is still 19, so no payload, JW, sweep, gate or installer behaviour moved and every measured size and gate number above still describes the shipped artefact. The three scripts/ files are the dev-stack launcher and its test, which are not part of the payload either. | 6 days ago | |
first commit | 2 months ago | |
docs: rewrite README for v0.3.0 | 12 days ago | |
docs: rewrite README for v0.3.0 | 12 days ago | |
fix(deps): move katex to 0.18.10 past CVE-2026-103923 katex 0.16.47 is inside the affected range of CVE-2026-103923: renderer options, the trust setting and namespace lookup read inherited properties as if the caller had set them, so a polluted prototype can switch trust on for a formula. 0.18.2 fixes it. 0.18.10 is the newest release that can be taken as-is. 0.18.11 is deprecated upstream as accidentally published with a breaking change, and 0.19.0 is that change: missing character metrics are reported through strict, which alters warnings and strict-mode errors. apps/web is not the only consumer. rehype-katex 7.0.1, which renders the formulas, and micromark-extension-math 3.1.0, which remark-math pulls in, are both at their latest release and still ask for katex ^0.16, so a version bump alone leaves 0.16.47 in the lock. A workspace override puts the whole tree on one katex. That matters beyond the advisory: 0.18 prefixed KaTeX's internal classes (base became katex-base, strut became katex-strut, and so on), and the stylesheet comes from apps/web's copy while the markup comes from rehype-katex's. A 0.16 renderer under the 0.18 stylesheet would lose those rules. rehype-katex only calls renderToString, which 0.18 keeps. katex now ships its own type declarations and apps/web only imports its stylesheet, so the direct @types/katex dev dependency goes. @types/katex 0.16.8 stays in the lock as a declared dependency of rehype-katex and micromark-extension-math; it is type declarations only and has no newer release. The third-party notice tracks katex and its commander dependency, which moves from 8.3.0 to 15.0.0 with it. | 25 days ago | |
fix(swarm): require explicit owned runtime overrides | 13 days ago | |
feat(connectors): add read-only local LLM Wiki integration | 2 months ago | |
test(e2e): migrate the Playwright suite onto the shared plan The eleven quarantined specs now carry E2E-META blocks, import the mocked network guard and register their own loopback model stubs, so their 41 identities are status:reviewed and part of the shared e2e slice. With no spec left to quarantine, the legacy Playwright project, ci:e2e:legacy, CI_ALLOW_LEGACY and the test:legacy* scripts are removed. The narrow, mobile and three-viewport journeys are kept: the stylesheet implements dedicated layouts below 960px, so the composer matrix at 1366/1440/1920, the 500/600px composer sanity case, the 390x844 settings and gateway cases and the mobile steps of the Stop and componentization journeys stay in the suite. The plan freezes at 174 identities. The stub models own the request context that cleans them up, clear the default model they created, cancel and delete the Sessions that still reference them, and surface a failed deletion instead of swallowing it. Two UI defects the journeys surfaced are fixed: switching or deleting a project now drops the Session selected in the old project, and Escape inside the proxy URL guide no longer closes the System configuration dialog under it. Part of #817. | 3 days ago | |
feat: unify conversational configuration workflows | 1 day ago | |
fix(deps): move katex to 0.18.10 past CVE-2026-103923 katex 0.16.47 is inside the affected range of CVE-2026-103923: renderer options, the trust setting and namespace lookup read inherited properties as if the caller had set them, so a polluted prototype can switch trust on for a formula. 0.18.2 fixes it. 0.18.10 is the newest release that can be taken as-is. 0.18.11 is deprecated upstream as accidentally published with a breaking change, and 0.19.0 is that change: missing character metrics are reported through strict, which alters warnings and strict-mode errors. apps/web is not the only consumer. rehype-katex 7.0.1, which renders the formulas, and micromark-extension-math 3.1.0, which remark-math pulls in, are both at their latest release and still ask for katex ^0.16, so a version bump alone leaves 0.16.47 in the lock. A workspace override puts the whole tree on one katex. That matters beyond the advisory: 0.18 prefixed KaTeX's internal classes (base became katex-base, strut became katex-strut, and so on), and the stylesheet comes from apps/web's copy while the markup comes from rehype-katex's. A 0.16 renderer under the 0.18 stylesheet would lose those rules. rehype-katex only calls renderToString, which 0.18 keeps. katex now ships its own type declarations and apps/web only imports its stylesheet, so the direct @types/katex dev dependency goes. @types/katex 0.16.8 stays in the lock as a declared dependency of rehype-katex and micromark-extension-math; it is type declarations only and has no newer release. The third-party notice tracks katex and its commander dependency, which moves from 8.3.0 to 15.0.0 with it. | 25 days ago | |
feat(sizeopt): slim the Windows installer 797.6 -> ~584 MiB; merge 6 envs into 2 The ~ is deliberate: 578.0 MiB is what was measured at the last buildable head, and un-sweeping babel afterwards adds compressed weight on top of it, which makes 583.6 MiB a projection rather than a measurement. Everything else in this log is measured. See SIZE NUMBERS below for what the projection rests on and for the correction of an earlier, wrong reason for it. Squashed from 25 commits on sizeopt/f26-6to2 (issue #808, design #807). The pre-squash head is tagged backup/pr834-before-squash2-20261105, and the 25 original messages are transcribed at the end of this log so nothing that was decided along the way is lost by the compaction. Hard constraints held throughout: offline double-click install, zero network on first launch, and no first-launch slowdown. The W15 full-pyc precompile is untouched, and assemble now FAILS HARD if precompilation fails. WAVES (each shipped as its own verified build) W1 - JW dead-weight removal + codex vendor strip: 797.6 -> 613.4 MiB (measured) extras collapse (~238 MB), lint toolchain, transitive-dep sweep, and removal of the vendored @openai/codex native toolchain (~437 MB). JW patch 0018 moves playwright/uv out of the main dependencies. W2 - five sidecar venvs -> one uv workspace (6->2, step 1): 613.4 -> 583.3 MiB Single lock, 68 packages resolved to the highest requirement of the set (fastapi 0.162 / pydantic 2.14). W3 - version alignment. Root uv.lock carries websockets 17.4 and no google-genai; the JW lock stays at 15.0.1 because google-genai 1.73.1 pins websockets<17.0,>=13.0.0 (dist-info METADATA:28). Patch 0019 edits the specifier (>=12.0,<16 -> >=12.0,<18) AND re-runs uv lock - the patch carries +100/-83 upload-time lines (millisecond PyPI timestamps) and the numpy 2.4.6/2.5.4 and pandas 3.1.0 moves, which no hand edit produces. The relaxed <18 cap is above 17, so it never reaches google-genai's constraint and JW still resolves 15.0.1. Note the two locks are different projects and must not be read as one. Hardlink de-duplication was measured and REJECTED (7z window mechanics + venv isolation); it is off. W4 - assemble gates + Electron locales 55->3 pak: -> 578.0 MiB (measured) Four gates: JW precompile hard-fail, payload import self-check, RequiredFiles manifest, size always printed. Patch chain manifest: 13 -> 16 (0018-desktop-slim-deps, 0019-align-workspace- versions, 0020 lazy observability import + verifyPatches fingerprint cache). WHAT REVIEW CHANGED (all of these shipped as regressions or no-ops before review caught them; each is now pinned by a test or a build gate) * babel was swept under a rule whose justification read "jinja2 hard dep" - but jinja2 is not installed in the JW venv at all. The real chain is openjiuwen html_compressor.py:55 (lazy, unguarded import_module("trafilatura")) -> trafilatura -> courlan -> babel at MODULE scope (courlan/filters.py:11). compress() swallows ModuleNotFoundError and falls back to beautifulsoup, so this shipped with no error, no log and exit 0 - just title/author/date all None on every HTML compression. The rule is gone and probe assertion 4 runs the product's own compressor and fails the build unless extractor is "trafilatura". Deleting babel/locale-data to "save" the bytes was also measured and rejected: Locale.parse then raises FileNotFoundError for EVERY valid locale, which courlan's except (TypeError, UnknownLocaleError) at filters.py:185 does not catch, turning a silent degradation into a crash. * Both install-dir guards cancelled with Abort, which in a custom page CREATOR only skips the page - the wizard advanced to InstFiles and installed into the root the user had just declined, while the MessageBox said it would return to the directory page. Now Quit. And because a bare Quit in a page creator exits 0 (measured: .onInit gives 2, page creator gives 0, page position irrelevant), each is preceded by SetErrorLevel 1 so a declined unattended run no longer reports success. * The codex vendor sweep targeted a path the flattener cannot produce, so the 437 MB win was a no-op. It now enumerates every reachable shape, and the descent is NOT gated on the name - a platform package winning primaryOf nests the wrapper under @openai/codex-sdk, which the gated walk never entered. * The A1b runtime probe only proved that what the sweep KEPT still works, so a rule that silently stopped matching shipped its dead weight back with every gate green. The probe now also asserts the package table (onnxruntime and kubernetes ABSENT; babel/courlan/trafilatura/chromadb/openjiuwen PRESENT), and the codex vendor sweep gets an independent post-check that matches on CONTENT (codex-package.json, unique to a vendored toolchain) rather than reusing the sweep's own name rule - a check sharing the rule would go blind exactly when the rule does. * nsh-syntax-check's third discovery tier was dead code: a bare catch {} also swallowed a ReferenceError from execFileSync never having been imported, so a programming error reported itself as "makensis not found". It now whitelists only the two measured not-on-PATH shapes. * W2 deleted the five per-service services/<member>/uv.lock files - one root lock now resolves every member - but scripts/start-stack.sh still backed up "$project_dir/uv.lock" in its custom-index path. Under set -euo pipefail that cp fails first, so ANY local start with SCIENCE_AGENT_PYPI_INDEX set died before reaching uv; the .mjs twin already passed repositoryRoot (start-stack.mjs:269-297) and only the shell one was left behind. It now backs up and restores the workspace root's lock, which is also the file uv sync actually rewrites when run inside a member (it walks up to the workspace). Pinned by scripts/start-stack-lock.test.mjs, which slices the real function out of the launcher rather than restating a copy - a copy would keep passing after the launcher regressed - and runs it under bash with a fake uv that walks up and rewrites whatever lock it finds. Three cases: the mirror path leaves the root lock pristine and removes its backup; a mutation guard that reverts the path to $project_dir must fail; and with no mirror configured --locked is still passed through. * Review then found a defect IN that fix (F15). The backup/restore pair was two sequential statements with no trap between them, and a mirror uv sync runs for tens of seconds to minutes, so Ctrl-C / terminal close / CI timeout kill inside that window skipped the restore entirely: uv.lock kept mirror-resolved content and an untracked uv.lock.stack-backup stayed in the repository root. Worse, the NEXT run copied that dirty lock over the backup first, so even a clean sync afterwards restored dirty content and froze it as the baseline - contradicting docs/{en,zh}/reference/configuration.md's promise that the script backs up and restores the lockfile without touching the workspace. The restore is now trap-driven. Two traps, not one: an INT trap does NOT terminate the script by itself, it only interrupts the foreground child, so a bare trap restore EXIT INT TERM would restore and then carry on starting the stack after Ctrl-C. INT/TERM therefore go through a handler that restores and then exits 130/143, while EXIT keeps the plain restore (the interrupt path has already cleared the backup, so the EXIT re-entry is a no-op). Paths are globals, not the caller's locals, because an EXIT trap can fire after uv_sync_project has returned and a local would be out of scope. Restore is copy-then-remove, never rename: renaming the lockfile away would leave the tree with no lockfile at all if the process were killed outside the trap, and on Windows a rename onto a target uv still holds a handle to fails outright. The .mjs twin needed the same fix but the FIRST attempt at it was dead code, and review caught that: it published the active pair and restored it from cleanup(), yet cleanup() was only reachable via the SIGINT/SIGTERM/exit handlers registered at what was then line 494 - while all three uvSyncProject calls run at top level inside if (!options.noBuild), at lines 357/384/400, i.e. BEFORE any handler existed. Inside that window Node's default SIGINT behaviour terminates the process, so the async finally never ran and the restore was unreachable exactly where it was written to cover. An earlier revision of this log claimed the handlers "all reach" the restore; that was false and is corrected here. Both halves are now fixed: the handler block is registered above the build block (verified: SIGINT at 343, build block at 347, syncs at 357/384/400), and the finally calls the synchronous idempotent restoreActiveLockfile() instead of clearing the global and then awaiting copyFile - clearing first left a gap where a signal found the pair forgotten but unrestored, and an awaited restore can be abandoned by the very process.exit the handlers call. Two static tests pin both invariants, and each was mutation-verified: moving the handlers back below the build block turns the ordering test red (SIGINT 364 vs build 344), and restoring the clear-then-await finally turns the other one red. Two more cases pin the bash side: a fake uv that rewrites the lock, signals the launcher, then dies of SIGINT itself (both halves needed - bash defers a trapped signal until its child exits, and only takes the shell down once the child is seen to have died of SIGINT), and a mutation guard that removes the trap armament and must then reproduce the dirty-lock-plus-stray-backup state. * A comment in assemble-backend.mjs's A5 budget block named the compileall temp suffix as "<pid>". It is not the pid: measured on this machine, compile_dir over 40 files produced 40/40 temp names of the form "<name>.cpython-313.pyc.<13 digits>" - a 14-char suffix - while that run's pid was 23144, five digits. The suffix is id(path) of the target, which is what _write_atomic uses. Only the label was wrong, not the number: 14 is measured, and COMPILEALL_TEMP_MARGIN stays 19 as a deliberately wide upper bound, since id()'s decimal length is not contractual and erring wide only tightens A5. Reconciling the constant DOWN to the measured 14 would narrow the budget by 5 characters in the unsafe direction, so the comment now says so explicitly. * Install root separated from the data dir (both used to default to the same literal, so uninstalling deleted envs/, secrets/ and every session), and path checks made platform-independent (win32.isAbsolute + win32.parse). SIZE NUMBERS - MEASURED VS PROJECTED (lesson L32: never present a projection as a measurement) 797.6 MiB f26 baseline measured 613.4 MiB after W1 measured 583.3 MiB after W2 measured 578.0 MiB after W4 measured 583.6 MiB after un-sweeping babel PROJECTED, not measured The last line is a projection. Its inputs are measured: 578.0 MiB actual, plus babel's compressed weight (29.38 MiB uncompressed, of which locale-data is 28.50 MiB - 97% apparent, 96.3% compressed). Reporting the uncompressed figure as the saving would overstate it by ~5x. CORRECTION of the reason an earlier revision gave for this projection. That revision said the C: drive had 2.4 GB free against a 5 GB MIN_FREE_BYTES gate, so pnpm dist could not run here, and a reviewer accepted that premise. It was wrong. MIN_FREE_BYTES (win_desktop/src/wizard-data-dir.ts:8) is the FIRST-RUN data-directory wizard's runtime floor; build.mjs and assemble-backend.mjs contain no free-space check at all, and every artefact lands on E: (141 GB free). Having said so publicly, the build was retried and the real blocker turned out to be PATH LENGTH, not disk space: compileall writes each .pyc as "<name>.pyc.<pid>" before renaming it, and with A5's measured maxRel=192 that 14-char suffix made the longest payload path 60+192+14=266 against Windows' 259 usable characters, so the JW venv precompile died with FileNotFoundError - caught by this PR's own new hard-fail gate. A short build root gives 12+192+14=218 (margin 41), which is how release5 was built (release5-assemble.log:3, "out = X:\p5"). The same arithmetic binds one level later and tighter: electron-builder copies the payload into <output>\win-unpacked\resources\..., so the in-tree default output dir makes it 62+14+192=268 - OVER the limit - while a short output dir gives 240. A5 measures the payload root and does not cover that copy. QUALITY EVIDENCE (all re-measured at this head, not carried over) win_desktop suite 159 tests / 159 pass / 0 fail probeDataDir's disk-space case now passes too (C: has 13.81 GiB free against its 5 GB MIN_FREE_BYTES floor); the earlier revision reported it failing at 2.4 GB free, and that was the ONE place a free-space number was relevant - it is this wizard's own runtime check, not a build gate. start-stack-lock 7 tests / 7 pass / 0 fail, run through a forced- registration copy: the file's tags are os:linux/os:macos because CI's ut job runs on ubuntu, and test/support/tagged/compat.mjs:47-49 returns inapplicable() - which turns test() into a no-op - when the tags do not name the host OS. On Windows that reports "# tests 1 # pass 1": the file itself counted as one passing test with zero of its own cases executed. Green there means nothing, so the numbers reported here are from that copy. 4 of the 7 are mutation guards and each was verified to actually go red on the reverted code: (a) reverting the lockfile path to $project_dir, (b) removing the bash trap armament, (c) moving the .mjs handler block back below the build block, (d) restoring the .mjs clear-then-await-copyFile finally. A guard that passes means the harness stopped reproducing the bug, which would make the green cases beside it prove nothing - that is why (c) and (d) were mutation-checked rather than assumed. typecheck win_desktop tsc -p tsconfig.json --noEmit exit 0 / 0 errors; root tsc -p tsconfig.tests.json exit 0 / 0 errors. The full npm run typecheck (which starts with pnpm --recursive typecheck) cannot run on this machine - pnpm's dependency-status check invokes wmic.exe, blocked by the local security policy - so CI's L1 static checks covers it and was green at the previous head. The files this PR changes under scripts/ are .sh and .mjs, neither of which tsc reads, so the type layer is unaffected either way. Note that a bare root tsc -p tsconfig.json reports thousands of errors because it pulls in apps/desktop/e2e- real and the e2e specs, which carry their own tsconfigs; that is not the command npm run typecheck runs and not what CI runs. nsh-syntax-check exit 0, 95.4 KiB artefact, 7 warnings, 0 unexpected probe vs the babel-regression payload exit 1, names babel probe vs a dev tree, default mode exit 1, names onnxruntime+kubernetes probe vs a dev tree, SD_PROBE_DEV_TREE=1 exit 0, PROBE_OK mutation harnesses 6/6 CAUGHT (3 for the installer guard, 3 for the sweep verification), each restoring a byte-identical tree and re-running green Not re-verified at this head, stated so nobody has to guess: evolve's 33 failures remain a Windows-no-sandbox baseline (an artefact was produced but not re-run here), and which downstream consumers were re-run is recorded per wave in the original messages below rather than re-derived. Real-machine evidence, restated to match what was actually asked for last. An earlier revision of this log said a recorded install-to-first-launch run and screenshots could not be produced "for the same disk-space reason" - that reason was the wrong one corrected above, so the claim is withdrawn along with it. What is genuinely still outstanding, narrowed to the items that were kept as blocking rather than waived: 1. one clean-machine install, with the first-launch duration recorded; 2. actually hitting the over-long-path rejection, and recording what the dialog says and whether confirming returns to the picker or aborts; 3. the uninstall-preserves-data branch, walked once. Text and stills satisfy these; a screen recording is not required. The reviewer waived the bilingual screenshot set, the evolve regression comparison, and the codex-vendor blind spot as non-blocking, and asked only that patch 0019's description be corrected in prose rather than re-done in code - that correction is in the W3 section above. Remaining hard requirements on the PR itself are the CLA signature (author-only) and a fresh code-owner approval, neither of which is a code change. --- The 25 commits this was squashed from, oldest first: 6f76d71e perf(instrumentation): millisecond-level startup timeline marks across shell/stack/jw e8d90708 feat(sizeopt): W1 slim JW payload + codex vendor strip (v0.2: 797.6 -> 613.4 MiB) fe935066 feat(sizeopt): W2 merge five sidecar venvs into one uv workspace (6->2 step 1) 1837d8b1 feat(sizeopt): W3 version alignment + W4 assemble gates 9d73cca0 perf(jiuwen_swarm): patch 0020 lazy observability import + verifyPatches fingerprint cache bcd70b0a fix(win_desktop): reject incomplete paths in the data-dir wizard before touching the filesystem 4333cea8 fix(win_desktop): keep the payload inside MAX_PATH - shorten layout and install root, add two gates 9d2b9b07 fix(docker): give uv the whole workspace manifest set, not one member's lock f9c5bc79 fix(ci): point tagged-test python paths at the per-member venvs uv creates 54baf639 fix(swarm-patches): treat root build metadata as wheel-optional e46e6804 fix(ci): give the swarm contract check pytest back on the slim venv 955d32ce fix(scripts): sync the jiuwenswarm.mjs setup slim, like the .sh twin 5da96e8a fix(sizeopt): pin the workspace interpreter at the repository root 459ff84d fix(win_desktop): enumerate every codex vendor dir instead of one guessed path 3225b0cd fix(launcher): re-export the Evolve dependency lock from the unified root lock b4212c1f fix(scripts): export the paper interpreter on the dev stack c49bd681 fix(win_desktop): descend codex vendor sweep unconditionally, not only under matched dirs e8e3b40f fix(win_desktop): separate the install root from the data dir; keep upgrades in place; make path checks platform-independent a161208a test(win_desktop): guard the installer's cross-file couplings statically, and compile installer.nsh on demand eb99ee2e docs(win_desktop): correct the F4 evidence denominator to distinct dirs 164a0b46 fix(win_desktop): make the install-dir guards actually cancel; unbreak nsh-syntax-check's PATH tier 03e12c2d fix(win_desktop): stop sweeping babel - it silently degraded the shipped HTML compressor 4d63f303 fix(win_desktop): make a declined install exit non-zero, not 0 6a852bd6 fix(win_desktop): prove the sweep actually swept, in both directions 4d0cf516 fix(scripts): back up the workspace-root lock in the bash mirror path Each of those carried its own reasoning in its body; the full transcript is kept locally and any of them can still be read from the backup tag. The squash itself was tree-preserving: git reset --soft onto upstream/main and a single git commit produced a tree byte-identical to the 2-commit head 4d0cf516 (tag backup/pr834-before-squash2-20261105-122529, tree 0c8582b3). Review then raised three findings, all amended into this same commit, so the tree at THIS head differs from 4d0cf516 by exactly those four files (git diff --numstat 4d0cf516 HEAD): scripts/start-stack-lock.test.mjs +196 -8 F15/F17 tests scripts/start-stack.mjs +52 -14 F15 fix (.mjs twin) scripts/start-stack.sh +52 -2 F15 fix (bash) win_desktop/scripts/assemble-backend.mjs +2 -1 F17, COMMENT ONLY (302 insertions, 25 deletions total). The assemble-backend.mjs hunk changes no executable line - it is two comment lines inside the A5 budget's "// Model (problems W6, lesson L29)" block, and COMPILEALL_TEMP_MARGIN is still 19, so no payload, JW, sweep, gate or installer behaviour moved and every measured size and gate number above still describes the shipped artefact. The three scripts/ files are the dev-stack launcher and its test, which are not part of the payload either. | 6 days ago | |
build: keep test sources out of the product build tsconfig.base.json now excludes **/*.test.ts and **/*.test.tsx. Every package tsconfig extends it and none declares its own exclude, so one line reaches all of them: no tsc run compiles a test file into dist/, and pnpm build never resolves test/support/tagged/compat.mjs. Needing that adapter inside the image is what forced the previous commit to carve a hole in .dockerignore; the hole is gone and test/ is excluded whole again. The runtime stage is COPY --from=builder /app /app, so this is also what keeps the journeys, fixtures and helpers out of a shipped image. Two things had to follow. Type checking. tsconfig.tests.json at the root owns exactly the files the base config drops — 207 of them, every *.test.ts under packages/*/src and services/*/src — and pnpm typecheck runs it after the per-package pass. Nothing emits; the project exists to fail. Its .test.tsx patterns match nothing today and are there so a first one cannot land unchecked. apps/web is deliberately absent: its tests live in tests/, which its own include (src/**) never reached, so the base exclude takes nothing away from it. Package test commands. Twenty-nine packages ran node --test dist/*.test.js, which now matches nothing. They run the sources instead: node --import tsx --test "src/**/*.test.ts" The quotes matter: the shell must not expand the pattern, because Node's test runner does its own matching, and a pattern it never receives would silently become zero tests and a zero exit. The file sets are identical rather than merely similar — expanding each old dist/ pattern the way sh expands it and mapping it back to src/ yields the same files the new pattern yields, package by package, 207 in total. services/runner keeps its second pattern for scripts/*.test.mjs. No test was deleted and no tag was weakened. The shared plan reads sources and never read dist/, so it is untouched: 3205 identities, the same as before. Verified locally: pnpm build, with test/ moved aside exit 0, 0 x TS2307, 0 x "error TS" docker build context export 0 files under test/ — no test/ at all docker build --target builder exit 0; the image has no /app/test and no *.test.js anywhere outside node_modules pnpm typecheck exit 0 (packages, then the tests project) tsc -p tsconfig.tests.json exit 0, 207 files checked pnpm test exit 0 — binary 29/29, then 31 packages, 2625 tests, 2625 pass, 0 fail, 0 skipped pnpm --filter @sciencediscovery/api test 902 tests, 902 pass, 0 fail (was node --test dist/*.test.js dist/**/*.test.js, 96 files either way) pnpm ci:st planned 1, executed 1, passed 1, PASS | 1 month ago | |
feat(desktop): add the desktop workbench foundation Add apps/desktop, a React/Vite workbench built from the v0.1 design and intended to replace apps/web. This layer covers the surfaces every later feature builds on: - Boot gate: token entry, health check, offline screen and the first-run wizard, which configures a provider, tests a model and writes the global default before the shell is reachable. - Session workspace: one flat, recency-ordered session list, click-time session creation (so a draft never duplicates a listed session), rename and delete through the row menu, and a transcript that keeps the run in flight after the persisted messages. - Stream handling: fetch-based SSE with frame buffering and a replay cursor; the reducer folds deltas, snapshots, terminal status and failures into one run state. - Bilingual infrastructure: TEXT is a proxy over the active dictionary, zh.ts is the source of truth for the English dictionary, and <html lang> is set before the first paint. The panel, settings dialog, permissions, run folding, previews and launch resume are deliberately not part of this change. | 20 days ago | |
build: keep test sources out of the product build tsconfig.base.json now excludes **/*.test.ts and **/*.test.tsx. Every package tsconfig extends it and none declares its own exclude, so one line reaches all of them: no tsc run compiles a test file into dist/, and pnpm build never resolves test/support/tagged/compat.mjs. Needing that adapter inside the image is what forced the previous commit to carve a hole in .dockerignore; the hole is gone and test/ is excluded whole again. The runtime stage is COPY --from=builder /app /app, so this is also what keeps the journeys, fixtures and helpers out of a shipped image. Two things had to follow. Type checking. tsconfig.tests.json at the root owns exactly the files the base config drops — 207 of them, every *.test.ts under packages/*/src and services/*/src — and pnpm typecheck runs it after the per-package pass. Nothing emits; the project exists to fail. Its .test.tsx patterns match nothing today and are there so a first one cannot land unchecked. apps/web is deliberately absent: its tests live in tests/, which its own include (src/**) never reached, so the base exclude takes nothing away from it. Package test commands. Twenty-nine packages ran node --test dist/*.test.js, which now matches nothing. They run the sources instead: node --import tsx --test "src/**/*.test.ts" The quotes matter: the shell must not expand the pattern, because Node's test runner does its own matching, and a pattern it never receives would silently become zero tests and a zero exit. The file sets are identical rather than merely similar — expanding each old dist/ pattern the way sh expands it and mapping it back to src/ yields the same files the new pattern yields, package by package, 207 in total. services/runner keeps its second pattern for scripts/*.test.mjs. No test was deleted and no tag was weakened. The shared plan reads sources and never read dist/, so it is untouched: 3205 identities, the same as before. Verified locally: pnpm build, with test/ moved aside exit 0, 0 x TS2307, 0 x "error TS" docker build context export 0 files under test/ — no test/ at all docker build --target builder exit 0; the image has no /app/test and no *.test.js anywhere outside node_modules pnpm typecheck exit 0 (packages, then the tests project) tsc -p tsconfig.tests.json exit 0, 207 files checked pnpm test exit 0 — binary 29/29, then 31 packages, 2625 tests, 2625 pass, 0 fail, 0 skipped pnpm --filter @sciencediscovery/api test 902 tests, 902 pass, 0 fail (was node --test dist/*.test.js dist/**/*.test.js, 96 files either way) pnpm ci:st planned 1, executed 1, passed 1, PASS | 1 month ago | |
feat(sizeopt): slim the Windows installer 797.6 -> ~584 MiB; merge 6 envs into 2 The ~ is deliberate: 578.0 MiB is what was measured at the last buildable head, and un-sweeping babel afterwards adds compressed weight on top of it, which makes 583.6 MiB a projection rather than a measurement. Everything else in this log is measured. See SIZE NUMBERS below for what the projection rests on and for the correction of an earlier, wrong reason for it. Squashed from 25 commits on sizeopt/f26-6to2 (issue #808, design #807). The pre-squash head is tagged backup/pr834-before-squash2-20261105, and the 25 original messages are transcribed at the end of this log so nothing that was decided along the way is lost by the compaction. Hard constraints held throughout: offline double-click install, zero network on first launch, and no first-launch slowdown. The W15 full-pyc precompile is untouched, and assemble now FAILS HARD if precompilation fails. WAVES (each shipped as its own verified build) W1 - JW dead-weight removal + codex vendor strip: 797.6 -> 613.4 MiB (measured) extras collapse (~238 MB), lint toolchain, transitive-dep sweep, and removal of the vendored @openai/codex native toolchain (~437 MB). JW patch 0018 moves playwright/uv out of the main dependencies. W2 - five sidecar venvs -> one uv workspace (6->2, step 1): 613.4 -> 583.3 MiB Single lock, 68 packages resolved to the highest requirement of the set (fastapi 0.162 / pydantic 2.14). W3 - version alignment. Root uv.lock carries websockets 17.4 and no google-genai; the JW lock stays at 15.0.1 because google-genai 1.73.1 pins websockets<17.0,>=13.0.0 (dist-info METADATA:28). Patch 0019 edits the specifier (>=12.0,<16 -> >=12.0,<18) AND re-runs uv lock - the patch carries +100/-83 upload-time lines (millisecond PyPI timestamps) and the numpy 2.4.6/2.5.4 and pandas 3.1.0 moves, which no hand edit produces. The relaxed <18 cap is above 17, so it never reaches google-genai's constraint and JW still resolves 15.0.1. Note the two locks are different projects and must not be read as one. Hardlink de-duplication was measured and REJECTED (7z window mechanics + venv isolation); it is off. W4 - assemble gates + Electron locales 55->3 pak: -> 578.0 MiB (measured) Four gates: JW precompile hard-fail, payload import self-check, RequiredFiles manifest, size always printed. Patch chain manifest: 13 -> 16 (0018-desktop-slim-deps, 0019-align-workspace- versions, 0020 lazy observability import + verifyPatches fingerprint cache). WHAT REVIEW CHANGED (all of these shipped as regressions or no-ops before review caught them; each is now pinned by a test or a build gate) * babel was swept under a rule whose justification read "jinja2 hard dep" - but jinja2 is not installed in the JW venv at all. The real chain is openjiuwen html_compressor.py:55 (lazy, unguarded import_module("trafilatura")) -> trafilatura -> courlan -> babel at MODULE scope (courlan/filters.py:11). compress() swallows ModuleNotFoundError and falls back to beautifulsoup, so this shipped with no error, no log and exit 0 - just title/author/date all None on every HTML compression. The rule is gone and probe assertion 4 runs the product's own compressor and fails the build unless extractor is "trafilatura". Deleting babel/locale-data to "save" the bytes was also measured and rejected: Locale.parse then raises FileNotFoundError for EVERY valid locale, which courlan's except (TypeError, UnknownLocaleError) at filters.py:185 does not catch, turning a silent degradation into a crash. * Both install-dir guards cancelled with Abort, which in a custom page CREATOR only skips the page - the wizard advanced to InstFiles and installed into the root the user had just declined, while the MessageBox said it would return to the directory page. Now Quit. And because a bare Quit in a page creator exits 0 (measured: .onInit gives 2, page creator gives 0, page position irrelevant), each is preceded by SetErrorLevel 1 so a declined unattended run no longer reports success. * The codex vendor sweep targeted a path the flattener cannot produce, so the 437 MB win was a no-op. It now enumerates every reachable shape, and the descent is NOT gated on the name - a platform package winning primaryOf nests the wrapper under @openai/codex-sdk, which the gated walk never entered. * The A1b runtime probe only proved that what the sweep KEPT still works, so a rule that silently stopped matching shipped its dead weight back with every gate green. The probe now also asserts the package table (onnxruntime and kubernetes ABSENT; babel/courlan/trafilatura/chromadb/openjiuwen PRESENT), and the codex vendor sweep gets an independent post-check that matches on CONTENT (codex-package.json, unique to a vendored toolchain) rather than reusing the sweep's own name rule - a check sharing the rule would go blind exactly when the rule does. * nsh-syntax-check's third discovery tier was dead code: a bare catch {} also swallowed a ReferenceError from execFileSync never having been imported, so a programming error reported itself as "makensis not found". It now whitelists only the two measured not-on-PATH shapes. * W2 deleted the five per-service services/<member>/uv.lock files - one root lock now resolves every member - but scripts/start-stack.sh still backed up "$project_dir/uv.lock" in its custom-index path. Under set -euo pipefail that cp fails first, so ANY local start with SCIENCE_AGENT_PYPI_INDEX set died before reaching uv; the .mjs twin already passed repositoryRoot (start-stack.mjs:269-297) and only the shell one was left behind. It now backs up and restores the workspace root's lock, which is also the file uv sync actually rewrites when run inside a member (it walks up to the workspace). Pinned by scripts/start-stack-lock.test.mjs, which slices the real function out of the launcher rather than restating a copy - a copy would keep passing after the launcher regressed - and runs it under bash with a fake uv that walks up and rewrites whatever lock it finds. Three cases: the mirror path leaves the root lock pristine and removes its backup; a mutation guard that reverts the path to $project_dir must fail; and with no mirror configured --locked is still passed through. * Review then found a defect IN that fix (F15). The backup/restore pair was two sequential statements with no trap between them, and a mirror uv sync runs for tens of seconds to minutes, so Ctrl-C / terminal close / CI timeout kill inside that window skipped the restore entirely: uv.lock kept mirror-resolved content and an untracked uv.lock.stack-backup stayed in the repository root. Worse, the NEXT run copied that dirty lock over the backup first, so even a clean sync afterwards restored dirty content and froze it as the baseline - contradicting docs/{en,zh}/reference/configuration.md's promise that the script backs up and restores the lockfile without touching the workspace. The restore is now trap-driven. Two traps, not one: an INT trap does NOT terminate the script by itself, it only interrupts the foreground child, so a bare trap restore EXIT INT TERM would restore and then carry on starting the stack after Ctrl-C. INT/TERM therefore go through a handler that restores and then exits 130/143, while EXIT keeps the plain restore (the interrupt path has already cleared the backup, so the EXIT re-entry is a no-op). Paths are globals, not the caller's locals, because an EXIT trap can fire after uv_sync_project has returned and a local would be out of scope. Restore is copy-then-remove, never rename: renaming the lockfile away would leave the tree with no lockfile at all if the process were killed outside the trap, and on Windows a rename onto a target uv still holds a handle to fails outright. The .mjs twin needed the same fix but the FIRST attempt at it was dead code, and review caught that: it published the active pair and restored it from cleanup(), yet cleanup() was only reachable via the SIGINT/SIGTERM/exit handlers registered at what was then line 494 - while all three uvSyncProject calls run at top level inside if (!options.noBuild), at lines 357/384/400, i.e. BEFORE any handler existed. Inside that window Node's default SIGINT behaviour terminates the process, so the async finally never ran and the restore was unreachable exactly where it was written to cover. An earlier revision of this log claimed the handlers "all reach" the restore; that was false and is corrected here. Both halves are now fixed: the handler block is registered above the build block (verified: SIGINT at 343, build block at 347, syncs at 357/384/400), and the finally calls the synchronous idempotent restoreActiveLockfile() instead of clearing the global and then awaiting copyFile - clearing first left a gap where a signal found the pair forgotten but unrestored, and an awaited restore can be abandoned by the very process.exit the handlers call. Two static tests pin both invariants, and each was mutation-verified: moving the handlers back below the build block turns the ordering test red (SIGINT 364 vs build 344), and restoring the clear-then-await finally turns the other one red. Two more cases pin the bash side: a fake uv that rewrites the lock, signals the launcher, then dies of SIGINT itself (both halves needed - bash defers a trapped signal until its child exits, and only takes the shell down once the child is seen to have died of SIGINT), and a mutation guard that removes the trap armament and must then reproduce the dirty-lock-plus-stray-backup state. * A comment in assemble-backend.mjs's A5 budget block named the compileall temp suffix as "<pid>". It is not the pid: measured on this machine, compile_dir over 40 files produced 40/40 temp names of the form "<name>.cpython-313.pyc.<13 digits>" - a 14-char suffix - while that run's pid was 23144, five digits. The suffix is id(path) of the target, which is what _write_atomic uses. Only the label was wrong, not the number: 14 is measured, and COMPILEALL_TEMP_MARGIN stays 19 as a deliberately wide upper bound, since id()'s decimal length is not contractual and erring wide only tightens A5. Reconciling the constant DOWN to the measured 14 would narrow the budget by 5 characters in the unsafe direction, so the comment now says so explicitly. * Install root separated from the data dir (both used to default to the same literal, so uninstalling deleted envs/, secrets/ and every session), and path checks made platform-independent (win32.isAbsolute + win32.parse). SIZE NUMBERS - MEASURED VS PROJECTED (lesson L32: never present a projection as a measurement) 797.6 MiB f26 baseline measured 613.4 MiB after W1 measured 583.3 MiB after W2 measured 578.0 MiB after W4 measured 583.6 MiB after un-sweeping babel PROJECTED, not measured The last line is a projection. Its inputs are measured: 578.0 MiB actual, plus babel's compressed weight (29.38 MiB uncompressed, of which locale-data is 28.50 MiB - 97% apparent, 96.3% compressed). Reporting the uncompressed figure as the saving would overstate it by ~5x. CORRECTION of the reason an earlier revision gave for this projection. That revision said the C: drive had 2.4 GB free against a 5 GB MIN_FREE_BYTES gate, so pnpm dist could not run here, and a reviewer accepted that premise. It was wrong. MIN_FREE_BYTES (win_desktop/src/wizard-data-dir.ts:8) is the FIRST-RUN data-directory wizard's runtime floor; build.mjs and assemble-backend.mjs contain no free-space check at all, and every artefact lands on E: (141 GB free). Having said so publicly, the build was retried and the real blocker turned out to be PATH LENGTH, not disk space: compileall writes each .pyc as "<name>.pyc.<pid>" before renaming it, and with A5's measured maxRel=192 that 14-char suffix made the longest payload path 60+192+14=266 against Windows' 259 usable characters, so the JW venv precompile died with FileNotFoundError - caught by this PR's own new hard-fail gate. A short build root gives 12+192+14=218 (margin 41), which is how release5 was built (release5-assemble.log:3, "out = X:\p5"). The same arithmetic binds one level later and tighter: electron-builder copies the payload into <output>\win-unpacked\resources\..., so the in-tree default output dir makes it 62+14+192=268 - OVER the limit - while a short output dir gives 240. A5 measures the payload root and does not cover that copy. QUALITY EVIDENCE (all re-measured at this head, not carried over) win_desktop suite 159 tests / 159 pass / 0 fail probeDataDir's disk-space case now passes too (C: has 13.81 GiB free against its 5 GB MIN_FREE_BYTES floor); the earlier revision reported it failing at 2.4 GB free, and that was the ONE place a free-space number was relevant - it is this wizard's own runtime check, not a build gate. start-stack-lock 7 tests / 7 pass / 0 fail, run through a forced- registration copy: the file's tags are os:linux/os:macos because CI's ut job runs on ubuntu, and test/support/tagged/compat.mjs:47-49 returns inapplicable() - which turns test() into a no-op - when the tags do not name the host OS. On Windows that reports "# tests 1 # pass 1": the file itself counted as one passing test with zero of its own cases executed. Green there means nothing, so the numbers reported here are from that copy. 4 of the 7 are mutation guards and each was verified to actually go red on the reverted code: (a) reverting the lockfile path to $project_dir, (b) removing the bash trap armament, (c) moving the .mjs handler block back below the build block, (d) restoring the .mjs clear-then-await-copyFile finally. A guard that passes means the harness stopped reproducing the bug, which would make the green cases beside it prove nothing - that is why (c) and (d) were mutation-checked rather than assumed. typecheck win_desktop tsc -p tsconfig.json --noEmit exit 0 / 0 errors; root tsc -p tsconfig.tests.json exit 0 / 0 errors. The full npm run typecheck (which starts with pnpm --recursive typecheck) cannot run on this machine - pnpm's dependency-status check invokes wmic.exe, blocked by the local security policy - so CI's L1 static checks covers it and was green at the previous head. The files this PR changes under scripts/ are .sh and .mjs, neither of which tsc reads, so the type layer is unaffected either way. Note that a bare root tsc -p tsconfig.json reports thousands of errors because it pulls in apps/desktop/e2e- real and the e2e specs, which carry their own tsconfigs; that is not the command npm run typecheck runs and not what CI runs. nsh-syntax-check exit 0, 95.4 KiB artefact, 7 warnings, 0 unexpected probe vs the babel-regression payload exit 1, names babel probe vs a dev tree, default mode exit 1, names onnxruntime+kubernetes probe vs a dev tree, SD_PROBE_DEV_TREE=1 exit 0, PROBE_OK mutation harnesses 6/6 CAUGHT (3 for the installer guard, 3 for the sweep verification), each restoring a byte-identical tree and re-running green Not re-verified at this head, stated so nobody has to guess: evolve's 33 failures remain a Windows-no-sandbox baseline (an artefact was produced but not re-run here), and which downstream consumers were re-run is recorded per wave in the original messages below rather than re-derived. Real-machine evidence, restated to match what was actually asked for last. An earlier revision of this log said a recorded install-to-first-launch run and screenshots could not be produced "for the same disk-space reason" - that reason was the wrong one corrected above, so the claim is withdrawn along with it. What is genuinely still outstanding, narrowed to the items that were kept as blocking rather than waived: 1. one clean-machine install, with the first-launch duration recorded; 2. actually hitting the over-long-path rejection, and recording what the dialog says and whether confirming returns to the picker or aborts; 3. the uninstall-preserves-data branch, walked once. Text and stills satisfy these; a screen recording is not required. The reviewer waived the bilingual screenshot set, the evolve regression comparison, and the codex-vendor blind spot as non-blocking, and asked only that patch 0019's description be corrected in prose rather than re-done in code - that correction is in the W3 section above. Remaining hard requirements on the PR itself are the CLA signature (author-only) and a fresh code-owner approval, neither of which is a code change. --- The 25 commits this was squashed from, oldest first: 6f76d71e perf(instrumentation): millisecond-level startup timeline marks across shell/stack/jw e8d90708 feat(sizeopt): W1 slim JW payload + codex vendor strip (v0.2: 797.6 -> 613.4 MiB) fe935066 feat(sizeopt): W2 merge five sidecar venvs into one uv workspace (6->2 step 1) 1837d8b1 feat(sizeopt): W3 version alignment + W4 assemble gates 9d73cca0 perf(jiuwen_swarm): patch 0020 lazy observability import + verifyPatches fingerprint cache bcd70b0a fix(win_desktop): reject incomplete paths in the data-dir wizard before touching the filesystem 4333cea8 fix(win_desktop): keep the payload inside MAX_PATH - shorten layout and install root, add two gates 9d2b9b07 fix(docker): give uv the whole workspace manifest set, not one member's lock f9c5bc79 fix(ci): point tagged-test python paths at the per-member venvs uv creates 54baf639 fix(swarm-patches): treat root build metadata as wheel-optional e46e6804 fix(ci): give the swarm contract check pytest back on the slim venv 955d32ce fix(scripts): sync the jiuwenswarm.mjs setup slim, like the .sh twin 5da96e8a fix(sizeopt): pin the workspace interpreter at the repository root 459ff84d fix(win_desktop): enumerate every codex vendor dir instead of one guessed path 3225b0cd fix(launcher): re-export the Evolve dependency lock from the unified root lock b4212c1f fix(scripts): export the paper interpreter on the dev stack c49bd681 fix(win_desktop): descend codex vendor sweep unconditionally, not only under matched dirs e8e3b40f fix(win_desktop): separate the install root from the data dir; keep upgrades in place; make path checks platform-independent a161208a test(win_desktop): guard the installer's cross-file couplings statically, and compile installer.nsh on demand eb99ee2e docs(win_desktop): correct the F4 evidence denominator to distinct dirs 164a0b46 fix(win_desktop): make the install-dir guards actually cancel; unbreak nsh-syntax-check's PATH tier 03e12c2d fix(win_desktop): stop sweeping babel - it silently degraded the shipped HTML compressor 4d63f303 fix(win_desktop): make a declined install exit non-zero, not 0 6a852bd6 fix(win_desktop): prove the sweep actually swept, in both directions 4d0cf516 fix(scripts): back up the workspace-root lock in the bash mirror path Each of those carried its own reasoning in its body; the full transcript is kept locally and any of them can still be read from the backup tag. The squash itself was tree-preserving: git reset --soft onto upstream/main and a single git commit produced a tree byte-identical to the 2-commit head 4d0cf516 (tag backup/pr834-before-squash2-20261105-122529, tree 0c8582b3). Review then raised three findings, all amended into this same commit, so the tree at THIS head differs from 4d0cf516 by exactly those four files (git diff --numstat 4d0cf516 HEAD): scripts/start-stack-lock.test.mjs +196 -8 F15/F17 tests scripts/start-stack.mjs +52 -14 F15 fix (.mjs twin) scripts/start-stack.sh +52 -2 F15 fix (bash) win_desktop/scripts/assemble-backend.mjs +2 -1 F17, COMMENT ONLY (302 insertions, 25 deletions total). The assemble-backend.mjs hunk changes no executable line - it is two comment lines inside the A5 budget's "// Model (problems W6, lesson L29)" block, and COMPILEALL_TEMP_MARGIN is still 19, so no payload, JW, sweep, gate or installer behaviour moved and every measured size and gate number above still describes the shipped artefact. The three scripts/ files are the dev-stack launcher and its test, which are not part of the payload either. | 6 days ago |
ScienceDiscovery
The all-in-one AI research workspace built for science. · Visit the official website →
Read the literature, form hypotheses, write and run code, conduct experiments, and tune parameters — all in one place. Every step leaves a record, and every result is traceable.
English · 简体中文
Download · Product tour · Documentation · Contributing · Get slides
Why ScienceDiscovery
ScienceDiscovery runs locally: the agent reads the literature, writes and runs code, and delivers reports, tables, and figures, while the workspace keeps every result together with the evidence behind it.
- Scientific MCP: one place for your scattered research tools. Papers and data are retrieved and downloaded through Scientific MCP — no code to write, no API keys to wire up, no hopping between a dozen websites. Say what you need and the files land in your workspace.
- Protein 3D structures, one click away. Drop a PDB file into the workspace and the artifact preview opens an interactive 3D structure: rotate, zoom, a sequence panel, and protein, pocket and ligand atoms colored automatically by layer (the built-in Mol* viewer).
- Self-evolving artifacts (RSI): auto-tune with fewer tokens. Hand over something measurable — a program, a parameter table, even a prompt — and it generates variants, scores each one, validates the winner on held-out data and returns the best version. Every variant keeps its code, score and run record, so you can roll back.
- Result provenance: trace any result back to its source. Runs, artifacts and claims all carry their version and provenance: open a claim and see which run, which dataset and which code produced it, along with the inputs and outputs from that moment.
- A research environment that runs locally. ScienceDiscovery runs locally against your own files, and model keys stay on your machine. Python, R, and shell run inside a sandbox, scientific environments are provisioned and pinned for you, and long analyses keep running in the background. Connect a preset provider or any compatible endpoint — requests go only to the provider you configure.
Product Tour
1. Flexible MCP selection: plug in what you need
Enable scientific MCP connectors on demand in System settings — PubMed, arXiv, Europe PMC, PDB, UniProt, Reactome and more — or add your own MCP servers. Tools join the same session, with permissions and governance applied.

2. View protein 3D structures in place
Drop a PDB file into the workspace and the artifact preview opens an interactive 3D structure: rotate, zoom, a sequence panel, with protein, pocket and ligand atoms colored automatically by layer.

3. Self-evolving artifacts: auto-tune and keep the trail
Hand over something measurable — a program, a parameter table, even a prompt — and it generates variants, scores each one, validates the winner on held-out data and returns the best version; every variant keeps its code, score and run record, so you can roll back.

4. Trace every artifact: click to inspect
Runs, artifacts and claims all carry their version and provenance: open the artifact's Provenance tab to see which run, dataset and code produced the result, along with the inputs and outputs from that run.

Evaluation Results
BiomniBench-DA — 77.4 with GLM-5.2 (August 2026). In this biomedical data-analysis benchmark, ScienceDiscovery scored 77.4. In the same media-reported comparison, Claude Code with Opus 4.7 scored 73.3 — the configuration the report labels as the previous industry SOTA — and Claude Code with GLM-5.2 scored 69.
| Configuration | BiomniBench-DA score |
|---|---|
| ScienceDiscovery + GLM-5.2 | 77.4 |
| Claude Code + Opus 4.7 (labelled the previous industry SOTA in the report) | 73.3 |
| Claude Code + GLM-5.2 | 69 |

The chart and scores come from the published report (Machine Heart, 2026-08-16).
Quick Start
ScienceDiscovery is available for Windows and Linux. Download the Windows installer ScienceDiscovery-<version>-win-x64-setup.exe, or the Linux executable ScienceDiscovery-<version>-linux-x86_64 (x86_64) / ScienceDiscovery-<version>-linux-aarch64 (arm64), from the Releases page. See the official installation guide for detailed installation and startup steps.
Connect a model
ScienceDiscovery does not bundle a model; you connect your own model API. On Linux, open System configuration at the bottom of the left sidebar, choose Model registry, select a preset provider or add one manually, enter its details and API key, then choose Save & connect. The first model also becomes the default task model; change it later under Global default task model. Protocol support and connection-check costs are documented in Model API compatibility.
Run your first task
Create a Project and a Session, drop a CSV or a PDF into the workspace, and describe the analysis you want. Approve the first execution when the permission card appears, follow tool calls and their results in the timeline, and open the files the task declares as Artifacts from the workspace panel.
Requirements
| Path | System requirements |
|---|---|
| Windows desktop app | Windows 10 or later on x64; about 5 GB of free disk space; no Node.js, Python, or WSL required |
| Linux binary | glibc-based Linux x86_64 or aarch64, including WSL 2; Bubblewrap 0.6+ with unprivileged user namespaces; no system Python, R, or conda required |
Managed scientific environments run on a pinned micromamba, so Python and R dependencies are prepared for you.
Community
Join the ScienceDiscovery community on Slack or Feishu to ask questions, share results, and shape the roadmap.
| Slack | Feishu |
|---|---|
![]() |
![]() |
Bug reports and feature ideas are welcome on GitHub Issues, and contributions are described in CONTRIBUTING.md. If ScienceDiscovery helps your work, a star on the repository helps more researchers find it.
License
Apache License 2.0. ScienceDiscovery is open source and self-hosted.
This product serves solely as a workflow orchestration tool and does not embed any AI model capabilities. When users integrate AI models for specific business scenarios, they shall bear full responsibility for compliance obligations under the EU AI Act and other relevant regulatory frameworks.
Introduction
ScienceDiscovery是专为科学研究打造的一站式AI科研工作台。依托该平台,科研人员能够一站式高效完成“文献阅读、假设提出、代码编写、实验试错、参数调优”这一极为繁琐的科研探索流程。
Customize your domain

