Repository navigation
Move the conversation service into a nessa-conversation crate (S5, part 2) - #1338
Conversation
) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcBpmTQfWyxdsN2yxEJM26
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d2431d433
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The default log filter named only nessa_server, nessa_sdk and nessa_gateway_endpoint. A filter of named targets drops every target it does not name, errors included, so each crate split out of the gateway (the S4 feature crates on main, and nessa-conversation here) went silent. Name every Nessa crate the gateway is built from, and test that the manifest's Nessa crates each have a directive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcBpmTQfWyxdsN2yxEJM26
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcBpmTQfWyxdsN2yxEJM26
|
Windows Generated by Claude Code |
#1341) **Before:** Nothing a person sees changes. After S5, `nessa-server` still held the whole request path (sockets, product, HTTP routes, agents, devices, CLI, core) next to composition, so any edit to a socket handler rebuilt and retested composition too, and composition could reach into any module. **After:** Nothing a person sees changes. The request path is its own `nessa-gateway` crate. `nessa-server` is composition only: it wires the gateway to its stores and features and starts it, and re-exports the gateway's modules under the old paths (`crate::product`, `crate::core`, and so on). Closes #1313 (S6 of #1307). ## Background #1307 moves the gateway toward a small core: domain crates that know nothing about sockets or the desktop, with `nessa-server` doing only composition. S5 (#1336, #1338) took the conversation service out. S6 takes out the rest of the request path. ## The problem `nessa-server` mixed two jobs: serving requests and composing the process. Every change to either rebuilt both, the gateway's 1,100 library tests and composition's 600 ran in one binary, and nothing kept the request path from depending on composition. ```mermaid sequenceDiagram participant Edit as An edit to a socket handler participant Server as nessa-server (request path + composition) Edit->>Server: rebuild sockets, product, agents, CLI and composition Server->>Server: one library test binary runs both ``` ## The solution `crates/nessa-gateway` now holds everything that was in `nessa-server/src` except `composition/`, `bootstrap.rs`, `main.rs` and the backup binaries. `build.rs` moved with it. ```mermaid sequenceDiagram participant Main as nessa (nessa-server main) participant Boot as nessa_server::run (bootstrap) participant Comp as composition::CompositionRoot participant GW as nessa-gateway participant Conv as nessa-conversation Main->>Boot: start Boot->>GW: core::logging::init, log_file::bound Boot->>Comp: serve Comp->>GW: build product, sockets, routes GW->>Conv: conversation service Comp-->>Boot: Result<(), RunError> Boot->>GW: core::ending::report ``` The move keeps behaviour as it was: - Items that composition reaches went from `pub(crate)`/`pub(super)` to `pub`. Nothing else in their code changed. - Two items had to move to obey the orphan rule and the architecture check: the `CallerKindSource` impl for `LocalCredentialStore` (now `agents/infrastructure/caller_kinds.rs`) and `REVIEW_WAIT` (now in `limits.rs`, same 5 minutes). - Test hooks that composition tests use are behind `#[cfg(any(test, feature = "test-support"))]`. The product socket fixture the composition tests share is a `route_fixture` module, lifted verbatim from the socket tests. - Tests moved with their code. Tests that drive composition (backup restore, webhook product delivery, configuration, bootstrap) stay in `nessa-server`. - The lease protocol fingerprint covers the bytes of its listed sources, and one of them changed visibility, so it is re-pinned with a history comment, as in S3 to S5. The frames do not change. The guard that every lease source names the protocol now scans `nessa-gateway/src` too. - `nessa-server`'s manifest drops the dependencies only the gateway uses. The gateway declares them with the same versions and features, so the binary's merged features are unchanged. Logs: the default filter names `nessa_gateway`, so the moved code's lines (now `nessa_gateway::…` targets) keep reaching `gateway.log`. A new server test reads the binary's own manifest and fails if `nessa_server` or any Nessa dependency lacks a directive. CI and scripts follow the crate: - `-p nessa-gateway` was added to the local-auth workflow, `package.json`, the CI plan's Rust package list and the client-core dependency denylist. - `cargo-test-parallel.mjs` plans the server cases on the gateway library. Composition's library runs in `server-other`. - `check-changed.mjs` maps `crates/nessa-gateway/` and `crates/nessa-conversation/` to the server checks. - Docs, state pages, the architecture check and stress scripts point at the new paths. Recorded evidence keeps its original paths. ## How we checked it - **Tests:** `nessa-conversation`, `nessa-gateway` and `nessa-server` pass, apart from the 3 tests that fail on main in this sandbox because it runs as root (a Codex status-cleanup test and two native-hook tests). Server + gateway hold 1,909 `#[test]`/`#[tokio::test]` before and 1,910 after: the one new test is the server log test. - **Lint:** clippy with `-D warnings` is clean for the three crates on Linux, on Windows through `x86_64-pc-windows-gnu`, and for the gateway with only `test-support` on. - **Scripts:** the architecture check and the node script tests pass. - **Stress (gate 19):** the close step now also checks that the gateway log carries the conversation service's lines for the thread it closed. Its first full run failed: the VM background step swaps in a test-binary gateway that never set up logging, so every later step's lines were missing. That gateway now sets up logging like the binary, and VM background followed by close holds on 3 seeds. The full run held 73/73. The check fails with `RUST_LOG=nessa_server=info` and passes with the default filter. - **Chaos:** 2/2. One earlier run missed once on the known follower event-count race, then held on re-run. - **Logs:** the server log test fails when `nessa_server=info` is taken out of the filter. - **Review:** three independent read-only review rounds. Every actionable finding is fixed, for example the lease guard's scan, recorded evidence the path rewrite had touched, stale docs, and unused dependencies. ## Tradeoffs and follow-ups - Many gateway items are `pub` now that composition is a separate crate. A later pass can narrow them to what composition uses. - Server tests that need gateway test hooks build the gateway with `test-support`. - The partition script accepts zero composition test executables, as it does for nessa-conversation. A workflow that drops `-p nessa-server` would skip composition tests silently. ## Rollout Nothing special. Nothing stored or sent over the wire changes, so a plain merge or revert is enough. --- --- _Generated by [Claude Code](https://claude.ai/code/session_01JcBpmTQfWyxdsN2yxEJM26)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
<!-- claude-projects-attribution: {"github_login":"Varuas37"} -->
_Requested by **Saurav** · [project
thread](https://claude.ai/code/project/chan_01UZaufydjNk2K88KGgoAfmr?thread=cmsg_01UZaufydjNk2K88KGgoAfmrX5YyyUXBGeQoMRRr3igVbS)_
**Before:** Of the 11 changes merged to main in the last day, two fixes
had no check in CI. A sidebar row losing its hover fill under its
actions (#1337), or onboarding asking for the vault passphrase (#1340),
could come back unnoticed.
**After:** The conversation stress suite (run by every PR's CI) fails if
either comes back. 2 gaps closed, no issues opened.
## Background
The daily test-gap run reviews what merged to main in the last 26 hours.
For each fix it puts the bug back and checks that a test CI runs fails.
A fix only a local script checks counts as a gap.
## The problem
- **#1337 (row hover).** When the pointer moved from a sidebar row onto
its trailing action (a channel's settings), the row lost its highlight.
Only `shared-controls.mjs --only rows` checked this, and no CI job runs
that script.
- **#1340 (onboarding vault).** The setup window opened the vault's
unlock dialog on its own. The stress `onboarding` step already refused a
vault dialog, but it ran over an unlocked vault. There the old code drew
no dialog either, so the step passed with the bug put back.
## The solution
All in `verification/desktop/scripts/conversation-stress.mjs`:
1. **`channel` step.** Once two channels exist, it finds the channel row
that is not selected (its rest and hover fills differ). It points at the
row, then at its settings beside it, and requires the same hover fill
both times.
2. **`onboarding` step.** It locks the vault through its native session,
as after a restart. Then it opens the setup window, which already
refuses any vault dialog. It unlocks the vault again afterwards.
## How we checked it
| Entry | Bug | What holds it now |
| --- | --- | --- |
| #1353 | A VM creation whose answer was lost never finished | Existing:
2 allocation tests fail with it put back |
| #1351 | A voice call ended when its chat left the panes | Existing: 2
VoiceController V16 tests fail with it put back |
| #1337 | Row hover dropped under its trailing actions | **New**
channel-step check: fails with the CSS put back (`rgba(0, 0, 0, 0), not
oklab(0.985 0 0 / 0.05)`), holds on main |
| #1340 | Onboarding asked for the passphrase | **New** locked vault in
the onboarding step: fails with the fix put back ("the setup window
opened a vault dialog on its own"), holds on main |
| #1350 #1346 #1339 #1332 | Features, copy, and SDK guard naming | Not
fixes |
| #1341 #1338 #1336 #1334 | Crate moves and refactors | Not fixes |
- Stress `--only onboarding,passphrase,channel,stop` in Chromium held
9/9 on this branch. `verification/desktop/scripts/lib/*.test.mjs` passed
698 tests. eslint and prettier are clean.
- Not run: WebKit (it cannot be downloaded in the cloud sandbox).
## Tradeoffs and follow-ups
- The hover check needs an unselected channel row. In the `stop` step
only one channel exists, and it is selected, so the check runs in the
`channel` step.
- The onboarding step briefly locks the shared vault. It unlocks it
again in a `finally`, so later steps see it unlocked.
## Rollout
Nothing special. Test-only change.
---
_Generated by [Claude
Code](https://claude.ai/code/session_018rccRX3nxAcKBWu6gcEXWB)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
Before: Nothing a person sees changes. The conversation service, with its workspaces, MCP server use cases and timer, lived inside
nessa-server, so every change there rebuilt and retested the whole gateway.After: Nothing a person sees changes. That code is now its own
nessa-conversationcrate.nessa-serverdepends on it and re-exports it under the old paths (crate::conversation,crate::workspaces,crate::timer, and so on), so the gateway's code reads as before. The gateway log again carries the lines of the crates split out of it, which the default log filter had been dropping since S4.Closes #1312 (S5 of #1307). Part 1 was #1336.
Background
#1307 moves the gateway toward a small core: domain crates that know nothing about sockets or the desktop, with
nessa-serverdoing only composition. S5 takes the biggest piece, the conversation service, out ofnessa-server.The problem
nessa-serverheld about 200,000 lines. Most of them were the conversation service and what it alone uses. Any edit to a socket handler rebuilt all of it, and the server's library test binary ran all 3,600 tests together. Nothing kept the conversation code from reaching into server-only modules either.sequenceDiagram participant Edit as An edit anywhere in nessa-server participant Server as nessa-server (one crate) Edit->>Server: rebuild sockets, composition, conversation, workspaces, MCP Server->>Server: one library test binary runs every testThe solution
crates/nessa-conversationnow holds:application,domain,infrastructure), which wasnessa-server/src/conversation;workspaces(application, domain, infrastructure), the timer, settings inheritance and the limit log;composition;The move keeps behaviour as it was:
pub(crate)topub. Nothing else in their code changed.#[cfg(any(test, feature = "test-support"))]. The crate'stest-supportfeature turns on the matching features of its dependencies. Private test helpers staycfg(test).nessa-serverand use small fixtures the crate exports (owner_phone_test_support,service_with_command_hosts).sequenceDiagram participant Edit as An edit to a socket handler participant Server as nessa-server (composition + product) participant Conv as nessa-conversation Edit->>Server: rebuild the server only Server->>Conv: uses the built crate as it is Note over Conv: its own test binary runs in the server-conversation CI partitionThe default log filter now names every Nessa crate the gateway is built from. It named only
nessa_server,nessa_sdkandnessa_gateway_endpoint, and a filter of named targets drops every target it does not name, errors included. So this split would have silenced the conversation service. The S4 feature crates already on main (attachments, peer gateways, device pairing, env serve, agent install, backup) have been silent since S4. They are named now too. A test reads this crate's manifest and fails if a Nessa dependency has no directive. Other Nessa libraries stay off, as before.CI and scripts follow the crate:
-p nessa-conversationwas added to the local-auth workflow,package.json, and the CI plan's Rust package list.cargo-test-parallel.mjsruns the crate's test binary in theserver-conversationpartition.../<other>/srcas depending on it.How we checked it
nessa-conversationpassed 1,882.nessa-serverlib passed 1,712 of 1,715, and its integration suites passed. The 3 failures are a Codex status-cleanup test and two native-hook tests. They fail on main in this sandbox too, because it runs as root.-D warningsis clean for both crates on Linux, and on Windows throughx86_64-pc-windows-gnu.handoffstep was extended in Keep each conversation's gates and owed state in one record (S5, part 1) #1336, which is the S5 stress addition; this half adds no new behaviour to cover.nessa_conversation=infois taken out of the filter, and pass with it.Tradeoffs and follow-ups
pubinstead ofpub(crate), because the server is a separate crate. S6 can narrow what the gateway needs.test-support.nessa-gatewayand leavesnessa-serveras composition only.Rollout
Nothing special. Nothing stored or sent over the wire changes, so a plain merge or revert is enough. The gateway log gets the split crates' lines back, at the levels they had before S4.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JcBpmTQfWyxdsN2yxEJM26