## Summary
A gateway, and the supervisor `raven web` leaves running beside it, held
memory from startup on for things they never use or may never be asked
to use. Two of them are no longer kept, and three are loaded on first
use. On a key-less gateway with a warm home and no terminal, as `raven
web` runs it, PSS 90 seconds after start goes from 257.2 MiB to 211.8
MiB, and the supervisor's from 77.3 MiB to 35.2 MiB. Nothing on the
wire, on disk or in the page changes shape.
- **The supervisor no longer imports the command table** (77.3 to 35.2
MiB). It only restarts its gateway, but it reached its loop through
typer and the table. `raven/cli/entry.py` now hands the argv that `raven
web` and `system.upgrade` start it with, `web --supervise --port N` with
N in ASCII digits, to `serve_commands.supervise_from_argv`, which calls
`_web` with the arguments the `web` command passes; a refusal ends the
process with the code the command would have exited with. Any other argv
is parsed by the table as before. Two process-wide settings stay ahead
of the fast path in the entry point: the TLS switch, as before, and,
moved there from the table's import, the switch of a Windows process's
stdout and stderr to UTF-8 with `PYTHONIOENCODING` set for its children.
The table's own setup, the saved language and the config migration
notices, is skipped with it: the supervisor prints no translated text
and never reads the config.
- **Two tokenizer copies left by litellm's import are freed** (25.3
MiB). `litellm.utils` keeps the dict it parses from the bundled
Anthropic tokenizer beside the string it re-serializes from it, and only
the string is read: the Claude tokenizer is built from it. cl100k's
registered encoding keeps a Python dict of its ranks beside the copy
tiktoken's core encodes with; tiktoken reads the Python one only to
pickle an encoding outside the registry, since a registered one pickles
by name. `import_litellm` now drops the dict, only while the string is
there, and the Python ranks. A failure is logged at debug level and
leaves the import standing.
- **A process whose terminal cannot be asked for its colours finds the
console's host modules on its first console command** (6.2 MiB).
Registering the console feature imported every CLI module to find the
ones that host console commands. `cli_socket.register_cli` now also
accepts a function, run once on the first `console_hosts()`. That covers
a process with no terminal, as the gateway `raven web` detaches has
none, and Windows, SSH, screen or tmux, and CI, which
`_theme._can_probe` rules out. Where the terminal can be asked, as from
`raven tui`, the host modules are still found at registration:
`raven.cli._styles` asks the terminal for its colours as it is imported,
and that question has to come before the Ink screen starts.
- **The RPC models build each validator on first use** (6.0 MiB).
`_Strict`, the base every model in `raven/rpc/models.py` derives from,
sets `defer_build=True`. The reason is a comment rather than the
docstring, because pydantic copies the docstring into the JSON schema.
- **Loading the deck engine's plugin no longer loads python-pptx** (7.9
MiB). `plugins-dist/ppt-engine/raven_ppt/services/state.py` imported the
template service, and with it python-pptx, so a gateway with the plugin
installed held it even with the plugin's config slice off, which is the
default. The service is now imported where a deck is read. With the
slice enabled, python-pptx is still loaded by the check that decks can
be made.
The upgrade regression tests also use the native launcher filename
(`raven.exe` on Windows, `raven` elsewhere), so the complete
relaunch-argv and supervisor-handoff assertions run on both platforms.
This follow-up changes test expectations only.
## Type
- [ ] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [x] Other
## Verification
The original author's Linux performance and suite measurements below
were recorded before the Windows test-fixture follow-up and rebase. The
seven original patches remain equivalent after rebasing; the Windows
measurements below are from the final tree. No new memory or
live-provider measurements are claimed.
- **Memory:** an isolated gateway with a key-less config and
`memory.backend` null, started without a terminal on an exported copy of
the base commit and of this head, each on its own home warmed by an
earlier start, base and head runs alternating; PSS from
`/proc/self/smaps_rollup` 90 seconds after start. The base read 257.2
MiB and this head 211.8 MiB, each within 0.1 MiB from run to run. The
figure on each change above is what taking that change back out of this
head, alone, puts back; the four add up to the difference. The
supervisor's figures are its PSS under `raven web` started on each tree.
- **Behaviour, base against this head on the same trees:**
- Token ids and counts over the repo's docs, the `raven/agent` sources
and the message catalogs, through raven's two estimators, cl100k
directly and `litellm.token_counter` for Claude, GPT, GLM, DeepSeek and
Gemini model names, with decoding, copying and pickling the encoding:
identical.
- The console: the same host modules, found at registration on the base
and on the first lookup here. On a pseudo-terminal the colour query is
written during registration on both.
- Every model in `raven/rpc/models.py`: validation and serialization
schemas, fields, and the outcome of validating the same probe payloads,
identical. On the base all but eight were built at import, here none.
Sixteen threads using every model for the first time at once: no error,
one set of answers.
- The deck engine's plugin imports without python-pptx here; on the base
it loads it.
- `raven web` end to end: it starts and serves the page; after a SIGKILL
of the gateway the supervisor brings it back on the same port with
`RAVEN_SERVE_PORT_STRICT=1`; `raven web --stop` leaves no process and no
`web.json`; `web.log` carries the same lines, and the gateway's
environment is the same key by key.
- A streamed turn and a tool-calling turn on glm-5.3-flash through a
live config's LiteLLMProvider: the same reply, the same tool call, the
same prompt usage, and the same Raven estimate.
- **New tests, against the base code:** of the 33 new or changed cases,
29 fail there. Four pass there by design: the token counts, a near-miss
argv that goes to the table, a process whose terminal can be asked
finding the host modules at registration, and the streams left alone off
Windows. All 33 pass here.
- **Mutation:** each construct was removed or bent one at a time, with
the backup outside the tree, and each mutant failed the tests written
for it:
- the supervisor: no fast path, `isdigit` as the port check, extra
arguments accepted, a refusal swallowed, every refusal ending with code
1, the port ignored;
- the Windows streams: no switch, the switch after the fast path, no
`PYTHONIOENCODING`, the switch off Windows too, strict errors, no guard
around the switch;
- the tokenizer copies: none freed, the dict dropped without its string,
the string dropped too, the ranks kept (in this process and in a fresh
one), no guard around the freeing;
- the console: the finder run on every lookup, a reset keeping a finder
that never ran, lazy everywhere, eager everywhere (in this process and
in a fresh one), registration importing one of the finder's modules;
- the validators built at import; the template service imported with the
state module.
- **Directly affected and neighbouring files:** `uv run --frozen
--python 3.12 --all-extras pytest -q -p no:cacheprovider
--idle-ceiling-strict` over the seven changed test files and
`tests/test_ppt_engine_state.py`, `tests/test_ppt_engine_prepare.py`,
`tests/test_rpc_console.py`, `tests/test_cli_tui_commands.py`,
`tests/test_cli_gateway_commands.py`,
`tests/test_rpc_contract_shapes.py`, `tests/test_cli_smoke.py`,
`tests/test_updates_upgrade.py` and `tests/test_security_tls.py`. Result
at this head: 1522 passed.
- **Full suite at this head:** `uv run --frozen --python 3.12
--all-extras pytest -q -p no:cacheprovider` (repo addopts: `-n 4`,
integration and e2e deselected; proxy variables unset). Result: 3
failed, 31663 passed, 164 skipped, 2 xfailed. The three are this box's
environment and fail the same way on an exported copy of the base
commit:
`tests/test_install_script.py::test_resolve_node_dir_answers_each_case_it_exists_for`,
`tests/test_knowledge_parser_excel.py::test_a_legacy_workbook_is_converted_and_read`
(no LibreOffice) and
`tests/test_subagent_node_runtime.py::test_what_cannot_be_read_names_nothing`
(run as root).
- **Exported trees:** the same suite on exported copies of the base
commit and of this head, compared case by case: every case they share
has the same outcome, apart from two timing-sensitive cases that failed
in the base run and pass in this head's run and on repeated runs of both
trees:
`tests/test_subagent_acp.py::test_an_interrupted_first_turn_still_binds_its_session`
and
`tests/test_subagent_cli_remote.py::test_a_cancel_ends_the_agent_s_whole_process_tree_on_the_machine`.
- **Diff coverage:** `uv run --frozen --python 3.12 python
scripts/coverage_gate.py diff --base-ref origin/main --threshold 90`
over the neighbouring run's coverage. Result: 100.00%, 50 of 50
executable changed lines. The gate measures `raven/`;
`tests/test_ppt_engine_*.py` executes both imports moved in the deck
engine.
- **Lint and gates:** `make lint-python lint-imports lint-deps
lint-types check-large-files check-source-language`, and `commitlint
--from origin/main --to HEAD --config commitlint.config.cjs` plus
`scripts/check_commit_messages.py origin/main..HEAD`. Result: all exit
0; import contracts 10 kept, 0 broken.
**Native Windows follow-up (2026-10-15):** Windows 10.0.26300, Python
3.13.12, `PYTHONUTF8=1`, isolated Raven/pytest homes and a dedicated
worktree. Setup: `uv sync --frozen --python 3.13 --all-packages --extra
dev`. Imports were verified against the tested worktree. The same frozen
sync was repeated after the rebase picked up the memory-plugin
dependency update.
- Before the fix, `uv run --frozen --no-sync pytest
tests/test_rpc_system.py -n 0 --tb=short` returned **3 failed, 40
passed**. The gateway-hosted handoff, standalone handoff and dev-flag
regression each expected `raven` where native Windows correctly selected
`raven.exe`.
- After the fix, `uv run --frozen --no-sync pytest
tests/test_rpc_system.py
tests/test_cli_serve_commands.py::TestTheSupervisorStartsWithoutTheCommandTable
tests/test_cli_system_ca.py -n 0 --idle-ceiling-strict --tb=short`
returned **66 passed, 4 skipped**.
- On the final rebased tree, the following command returned **631
passed, 4 skipped**, exit 0 with the idle ceiling enforced. The four
skips require the Linux certificate store; none are counted as Windows
passes. JUnit output paths are omitted from these commands.
```powershell
uv run --frozen --no-sync pytest tests/test_rpc_system.py tests/test_cli_serve_commands.py::TestTheSupervisorStartsWithoutTheCommandTable tests/test_cli_system_ca.py tests/test_litellm_setup.py tests/test_ppt_engine_plugin.py::test_loading_the_plugin_leaves_python_pptx_for_the_first_deck tests/test_ppt_engine_state.py tests/test_rpc_cli_dispatch.py tests/test_rpc_schema_match.py -n 0 --idle-ceiling-strict --tb=short
```
- `uv run --frozen --no-sync ruff check raven evolver agents
plugins-dist tests scripts docs-site` and the matching `ruff format
--check`: passed (2,337 files formatted).
- `uv run --frozen --no-sync lint-imports`: 10 contracts kept. `uv run
--frozen --no-sync ty check raven/cli/_console_feature.py
raven/cli/commands.py raven/cli/entry.py raven/cli/serve_commands.py
raven/providers/litellm_setup.py raven/rpc/cli_socket.py
raven/rpc/models.py
plugins-dist/ppt-engine/raven_ppt/services/state.py`: passed.
- `uv run --frozen --no-sync pre-commit run --from-ref origin/main
--to-ref HEAD`, `node node_modules/@commitlint/cli/cli.js --from
origin/main --to HEAD --config commitlint.config.cjs`, `uv run --frozen
--no-sync python scripts/check_commit_messages.py origin/main..HEAD`,
`uv run --frozen --no-sync python scripts/check_large_files.py
origin/main...HEAD`, `uv run --frozen --no-sync python
scripts/check_source_language.py origin/main...HEAD`, and `git diff
--check origin/main...HEAD`: passed.
The test correction retains the complete executable path, argv,
credentials, delayed shutdown and supervisor-handoff assertions, without
adding a skip. Upgrade spawning and the supervisor loop are substituted
in these tests. No real upgrade or resident restart, live provider call,
Windows memory measurement, full Windows suite or new Linux/macOS run
was performed by this follow-up.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed
No user-facing docs change, because no command, flag, setting or file
format does.
## Risk
User-visible behaviour changes:
- **The first console command in a process whose terminal cannot be
asked** imports the finder's modules then, once, on the event loop and
under the console's dispatch lock, instead of at startup: about 0.1 to
0.2 seconds on this box. A CLI module that fails to import then fails
each console command, where before it failed the process's startup.
- **Each RPC model builds its validator the first time it is used**, so
a method's first call pays for its own models, and a model whose fields
pydantic cannot build a validator for fails there rather than when
`raven.rpc.models` is imported.
- **An unhandled exception in the supervisor** reaches `web.log` as
Python's plain traceback rather than typer's formatted one.
- **The deck engine's template service is imported at the first deck
read** instead of when the plugin loads. A python-pptx that cannot be
imported therefore no longer stops the plugin from loading: with its
config slice enabled, the check that decks can be made withholds the
deck tools, and the turn hook's note on deck state, which logs an
unreadable state at debug level and goes on, meets the import error
there.
- **Code in the same process that reads the private `_mergeable_ranks`
off the registered cl100k encoding**, as the extension example in
tiktoken's README does, gets an `AttributeError` once raven has imported
litellm. In raven, its plugins and the locked dependencies, only
tiktoken's educational module does.
Left as today:
- **Any other supervisor argv**, for example one typed by hand with
`--port=N` or the flags reordered, goes through the command table and
keeps today's memory.
- **Freeing the tokenizer copies relies on litellm's and tiktoken's
internals.** The tests read each copy where it lives, check in a fresh
interpreter that litellm's own import registers the encoding whose ranks
are freed, and pin the token counts, so a release that moves a copy,
starts reading one or stops registering the encoding fails them.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
Rollback is a revert. Nothing written to disk or sent over the wire
changes.
## Related Issues
N/A
## Summary
Behind a TLS-inspecting corporate proxy, or against a company-hosted
gateway signed by a private CA, `raven onboard` failed with
`CERTIFICATE_VERIFY_FAILED` even with the corporate root installed in
the operating system (#637). httpx, LiteLLM and the OpenAI SDK verify
against certifi's bundled roots unless told otherwise, so the
operating-system store was never consulted on the paths that reach a
model. aiohttp, urllib and websockets read OpenSSL's defaults instead,
so one process trusted two different sets of roots depending on which
client made the call.
What changes:
- `raven/security/tls.py` (new): `use_system_ca()` injects truststore,
so every TLS context built afterwards is verified by the operating
system (CryptoAPI on Windows, the Security framework on macOS, OpenSSL's
default paths on Linux). A bundle a caller loads into a context is still
honoured: on Linux it joins the store, on macOS its roots become extra
anchors, on Windows it is tried when the system roots fail. So every
root trusted before stays trusted. `RAVEN_NO_SYSTEM_CA=1` opts out,
parsed like `RAVEN_NO_UPDATE_CHECK`.
- `raven/cli/entry.py` (new) is now the entry of both the console script
and `python -m raven`, the form the web supervisor starts its gateway
with. It switches trust before importing the CLI, because the CLI's
imports reach aiohttp (through the sub-agent backends), and aiohttp
builds its default context when it is imported. `raven/cli/commands.py`
no longer starts the CLI when run as a script, which skipped the switch;
pointing it at the entry would not have helped, since by then its own
imports have built aiohttp's context.
- The provider probe names a certificate that fails verification
`certificate_untrusted` instead of `network_error`. It checks for that
ahead of the proxy branch: through a proxy that answered the tunnel, a
refused certificate used to be reported as `proxy_unreachable`. The
Codex check (its backend's list of the account's models), MiniMax's
token renewal (which reported `oauth_token_missing`) and the sub-agent
key prompt's probe name it too. LiteLLM's Copilot token exchange and its
ChatGPT renewal drop the handshake error before Raven sees it, so those
still read as the credential.
- The three surfaces that read the probe say so. `raven onboard` and
`raven provider test` no longer send the reader to check the network,
proxy or VPN; their hints name the three causes: a CA to add to the
system certificate store; macOS and Windows refusing a certificate by
their own rules even when `SSL_CERT_FILE` trusts its CA, which
`RAVEN_NO_SYSTEM_CA=1` turns off; and an expired certificate, or one for
another host, which is the server's to fix. `raven onboard` offers the
menu a network error gets (re-entering the key cannot fix a
certificate); the web Settings page has its own line, in English and
Chinese, in `i18n/messages.json` and the TUI's catalogue generated from
it.
- The RPC contract's description of the model catalogue's `status`
(`rpc-schema/openrpc.json` and both generated clients) now lists the
probe's real words. It named `unauthorized`, which the probe never
returns (a 401 or 403 is `invalid_key`), and missed `proxy_unreachable`
as well as the new status.
- The Codex provider no longer retries a request whose certificate
failed verification with verification turned off (`verify=False`). The
second attempt carried the ChatGPT OAuth bearer token and the whole
conversation to whoever presented the certificate (a captive portal, a
hostile network, a proxy that re-signs TLS), and on a network like the
one in #637 it is what would keep Codex working unverified while every
other provider fails. The retry dates from the initial import;
`_request_codex` loses the `verify` parameter that existed only to carry
it.
- `raven upgrade` and the page's Update verify against the same store as
the release lookup. The upgrade helper runs on the base interpreter,
outside the tool environment that holds truststore, and fetched the
release lists with urllib's default context; uv fetched the rest with
its bundled roots. When the spawning process itself verifies against the
system store, it now copies truststore into a fresh temporary directory
and hands the helper its path, as it hands over the marker path; one
that opted out, or never went through `cli.entry`, hands over nothing
and needs no truststore to say so. The helper loads the copy before its
first download and deletes it, and gives `UV_SYSTEM_CERTS` (and
`UV_NATIVE_TLS`, which older uv reads) to uv's own calls only, so the
Raven it relaunches inherits neither. A copy, because
`inject_into_ssl()` imports requests and urllib3 wherever it finds them,
and the tool environment's belong to what uv is about to rewrite.
- Quick Start, in both languages, gains a section on corporate proxies
and private CAs: WSL2 does not see the Windows store, and the EverOS
memory server and Node-based agents run as separate programs that need
`SSL_CERT_FILE` and `NODE_EXTRA_CA_CERTS` in the shell profile.
`SSL_CERT_FILE` must name a complete bundle that exists, since httpx
refuses to start with a missing one:
`/etc/ssl/certs/ca-certificates.crt` on Debian, Ubuntu and WSL, and one
built from `/etc/ssl/cert.pem` on macOS. A note says macOS and Windows
apply their own certificate policy and names `RAVEN_NO_SYSTEM_CA=1` as
the way back.
The LiteLLM warning in the issue ("Failed to fetch remote model cost map
... CERTIFICATE_VERIFY_FAILED", with `SSL_CERT_FILE` exported) is not
LiteLLM building its own store. That fetch is a plain `httpx.get`, which
reads `SSL_CERT_FILE`, and the variable replaces the whole trusted set:
with a corporate-only PEM the gateway verifies while
raw.githubusercontent.com, signed by a public root, no longer does.
Measured with a private CA: corporate-only PEM, warning; certifi plus
the corporate root, remote fetch succeeds.
Not covered, by construction: the EverOS server is a separate `everos`
executable and Node-based agents are not Python, so an injection in this
process cannot reach them. The new docs section gives them their
environment variables.
`uv.lock`: adding truststore re-resolved the lock (uv 0.11.25, revision
3 kept). Besides the truststore entries, five packages' dependency edges
lose a marker: matrix-nio, h2, aiohttp-socks, aiologic and culsans. Each
dropped marker is implied by the only path that reaches its package
(matrix-nio, and through it h2 and aiohttp-socks, only where
`sys_platform != 'win32'`; culsans and aiologic only below Python 3.13),
so the resolved set is unchanged on every platform. uv 0.12.23 produces
the same edges and also rewrites the lock to revision 5, so it was not
used; both versions accept the committed lock under `uv lock --locked`.
## Type
- [x] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [ ] Other
## Verification
Red first, on the base: the end-to-end `raven provider test custom`
against a gateway whose root only the stand-in system store holds exits
1 with `network_error ... unable to get local issuer certificate` under
both launch forms, and its opted-out twin prints "Check network /
firewall / VPN settings"; the probe test returns `network_error`, and
through a CONNECT proxy `proxy_unreachable`; the onboarding menu offers
`rekey` for a certificate failure; the web note falls to
`probe_unknown`; and the Codex test's endpoint receives `Bearer
tok-secret`, with the captured log line `SSL certificate verification
failed for Codex API; retrying with verify=False`.
Mutations, each applied and then restored byte for byte:
- the entry no longer switching trust: both end-to-end trust cases fail;
- the switch moved after the CLI import: only
`test_trust_is_settled_before_the_cli_builds_a_context` fails;
- the classifier accepting any `ssl.SSLError`: the plain-HTTP case
fails;
- the certificate check placed after the proxy branch: the proxy case
fails.
Review round two, red first at the round-one head: against an endpoint
signed by a root no store holds, the Codex check returned
`network_error`, MiniMax's token renewal `oauth_token_missing` and the
sub-agent key probe `network_error`; both hint tests failed on the
missing opt-out; the guard scan found `raven/cli/commands.py`; and the
upgrade tests found nothing handed over. Round-two mutations, each
applied and then restored byte for byte:
- the classifier matching `CERTIFICATE_VERIFY_FAILED` in the message:
the new macOS and Windows cases fail (282 of 282 stayed green before
them);
- 17 single-construct mutants of the upgrade hand-over (not switching,
not putting the copy on the path, keeping it, hiding a failed load,
leaving the path in the environment, not telling uv, overwriting a uv
setting the user made, dropping the older uv name, telling uv without a
copy, uv not given its environment, passing on an inherited path,
importing truststore instead of reading whether this process switched,
handing over without that check, handing over always, handing over no
copy, and keeping a copy no helper started, at each spawn site): each
fails at least one test;
- the copy failure's warning and its cleanup: each fails the
copy-failure test.
Commands and results, at the head after rebasing onto `main`. The
commits `main` gained since round one touch none of this branch's lines:
`git range-diff` shows every commit unchanged, and the aggregate
patch-id is the same before and after.
- The touched Python test files (`tests/test_security_tls.py`,
`tests/test_cli_system_ca.py`, `tests/test_config_update_providers.py`,
`tests/test_cli_onboard_commands.py`,
`tests/test_cli_provider_commands.py`,
`tests/test_cli_subagent_setup.py`, `tests/test_updates_upgrade.py`,
`tests/test_openai_codex_provider.py`), the Codex provider's neighbours
(`tests/test_providers_first_byte_budget.py`,
`tests/test_provider_protocol.py`) and the i18n tests, in full: 1010
passed.
- Full suite with branch coverage, `pytest -q -p no:randomly --cov=raven
--cov=raven_everos --cov-branch` on the all-extras environment with the
box proxy variables unset: 2 failed, 27750 passed, 119 skipped. Both
failures fail the same way on a clean tree of the new merge base under
the same interpreter, so neither is introduced; they are local to this
box (an `npm` on its PATH, and running as root):
-
`tests/test_install_script.py::test_resolve_node_dir_answers_each_case_it_exists_for`
-
`tests/test_subagent_node_runtime.py::test_what_cannot_be_read_names_nothing`
- `scripts/coverage_gate.py diff --base-ref origin/main --threshold 90`
over that run: 100.00% (57/57 executable changed lines).
- `tests/integration/test_cli_upgrade_real_uv.py`, which CI runs only in
the Windows self-upgrade job (`--noconftest`): 3 passed locally. Its
fixture calls the handoff without `cli.entry`; the `system store`
variant switches first, as `cli.entry` does, so that job runs the whole
hand-over on Windows, and the fixture prints what it handed over so
neither variant passes without its branch running.
- `ruff check`, `ruff format --check`, `ty check` over the changed
modules, `lint-imports` (10 contracts kept), `deptry raven`: clean.
- Repository gates over `origin/main...HEAD`:
`check_source_language.py`, `check_large_files.py` and
`check_commit_messages.py` exit 0.
- Generated files on the rebased tree, where `main` had also changed the
RPC schema, the message catalogue and their generated copies:
`gen-i18n.mjs --check` and `gen-rpc-types.mjs --check` (ui-tui) and
`gen-rpc-client.mjs --check` (ui-web) exit 0.
- Round two changes no file under `ui-web`, `ui-tui` or `rpc-schema`;
these were measured at round one:
- ui-web, `node node_modules/vitest/vitest.mjs run
src/features/settings/SetupBodies.test.tsx
scripts/gates/i18n-keys.test.mjs`: 33 passed; `scripts/gates`: 46 files,
205 passed; `tsc --noEmit` clean, its `--listFiles` resolving the edited
files inside this tree; ESLint clean on the three files.
- ui-tui, the steps of TUI checks: ESLint 0 errors; `lint:rpc` and
`lint:i18n` pass; `tsc --noEmit` clean; the build passes; `vitest run`
has 9 failures in 4 files (renderer and typing-burst tests), the same 9
that fail on a clean worktree of the merge base on this box, so none is
introduced.
- RPC contract: `node scripts/gen-rpc-client.mjs --check` (ui-web) and
`node scripts/gen-rpc-types.mjs --check` (ui-tui) exit 0, each generated
file differing from the base by the one description line; the 9 Python
test files that read the schema, 798 passed.
- Docs: `mkdocs build --strict` clean, with the new paragraphs on the
English and Chinese pages; `tests/test_docs_site.py` and
`tests/test_living_docs.py` pass in the full suite.
The end-to-end cases run on Linux only. They stand the system store in
with OpenSSL's directory store through `SSL_CERT_DIR`, and name a bundle
of public roots in `SSL_CERT_FILE` so that httpx cannot pass by reading
`SSL_CERT_DIR` itself. Verification on macOS and Windows was read from
truststore 0.10.4's source, not run. The upgrade helper's tests share
the limit: on Linux truststore and the standard library read the same
store, so they show the hand-over (the copy loads on the base
interpreter under `-I` before the first download, and uv alone is told),
not the Keychain difference it exists for.
- [x] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [x] User-facing docs or screenshots are updated when needed
## Risk
- Every Raven process started as `raven` or `python -m raven` now trusts
the operating system's roots in addition to what each library bundles.
For those processes `SSL_CERT_FILE` adds to the trusted set instead of
replacing it; someone using it to narrow trust to one private root keeps
that root but also trusts the system store.
- On macOS and Windows the system verifier applies its own certificate
policy as well. A private certificate that OpenSSL accepted from
`SSL_CERT_FILE` can be refused there if it breaks that policy;
`RAVEN_NO_SYSTEM_CA=1` restores OpenSSL's verification.
- On macOS and Windows truststore also verifies the client's chain on
server-side contexts, refusing a client that sends none. Raven builds no
server-side TLS context: it serves plain HTTP on localhost.
- Upgrades verify their downloads the way the release lookup does: on
macOS that includes Apple's certificate policy, which the helper's
OpenSSL did not apply. uv is told to use the system store only for the
upgrade's own calls, and a `UV_SYSTEM_CERTS` or `UV_NATIVE_TLS` the user
set is kept.
- Behind a proxy that re-signs TLS, Codex requests now fail with the
certificate error instead of continuing unverified. Trusting the proxy's
root, in the system store or in a complete bundle named by
`SSL_CERT_FILE`, is the remedy.
- Startup: about 100 ms warm and 270 ms cold, measured on Linux, mostly
truststore importing urllib3 and requests to patch their references.
- Rollback: `RAVEN_NO_SYSTEM_CA=1` restores the previous trust per
process, and an upgrade started under it hands its helper and uv
nothing; the Codex change has no switch, by design. Reverting the squash
commit removes both.
- [x] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes
## Related Issues
Fixes#637
---------
Co-authored-by: Claude (claude-opus-5-5[1m]) <noreply@anthropic.com>