Skip to content

Move the conversation service into a nessa-conversation crate (S5, part 2) - #1338

Merged
Varuas37 merged 3 commits into
mainfrom
claude/project-thread-9om5pz
Nov 14, 2026
Merged

Varuas37 merged 3 commits into
mainfrom
claude/project-thread-9om5pz

Conversation

@Varuas37

@Varuas37 Varuas37 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

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-conversation crate. nessa-server depends 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-server doing only composition. S5 takes the biggest piece, the conversation service, out of nessa-server.

The problem

nessa-server held 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 test
Loading

The solution

crates/nessa-conversation now holds:

  • the conversation service (application, domain, infrastructure), which was nessa-server/src/conversation;
  • workspaces (application, domain, infrastructure), the timer, settings inheritance and the limit log;
  • the MCP server use cases and the conversation tools, which were in server composition;
  • the conversation's halves of desktop runtime, device pairing and attachments.

The move keeps behaviour as it was:

  • Items that the server reaches went from pub(crate) to pub. Nothing else in their code changed.
  • Test hooks that server tests use are behind #[cfg(any(test, feature = "test-support"))]. The crate's test-support feature turns on the matching features of its dependencies. Private test helpers stay cfg(test).
  • Tests moved with their code. Tests that drive the server's sockets or composition stayed in nessa-server and use small fixtures the crate exports (owner_phone_test_support, service_with_command_hosts).
  • Two tests that spanned both sides were split at the line. For example, the SSH login handoff test now checks the crate's lease in the crate and the server's log line in the server.
  • The lease protocol fingerprint covers the bytes of its listed source files, so it is re-pinned with a history comment, as in S3 and S4. The image id and the frames do not change.
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 partition
Loading

The default log filter now names every Nessa crate the gateway is built from. It named only nessa_server, nessa_sdk and nessa_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-conversation was added to the local-auth workflow, package.json, and the CI plan's Rust package list.
  • cargo-test-parallel.mjs runs the crate's test binary in the server-conversation partition.
  • The CI plan's workspace graph treats a crate whose sources point at ../<other>/src as depending on it.
  • The architecture check and dependency graphs know the new crate. Client core may not depend on it.
  • Docs, state pages and stress scripts point at the new paths.

How we checked it

  • Tests:
    • nessa-conversation passed 1,882.
    • nessa-server lib 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.
  • Lint: clippy with -D warnings is clean for both crates on Linux, and on Windows through x86_64-pc-windows-gnu.
  • Scripts: the architecture check passed, and so did the node script tests (new tests cover the partition and the workspace graph).
  • Stress and chaos: the conversation stress check held 73/73 and the chaos check held 2/2. The handoff step 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.
  • Logs: the two new logging tests fail when nessa_conversation=info is taken out of the filter, and pass with it.
  • Review: three independent read-only review rounds. Every finding is fixed in the first commit, for example test hooks that were missing under the feature, CI filters that still named the old module paths, and state-doc paths split across YAML lines.
  • Rebase: rebased onto Split the Boat account from each VM's spec; record why an opening failed #1332, which changed workspace files that moved here. Its edits were reapplied to the moved files.

Tradeoffs and follow-ups

  • Many items are now pub instead of pub(crate), because the server is a separate crate. S6 can narrow what the gateway needs.
  • Server tests that need crate test hooks build the crate with test-support.
  • Next: S6 (nessa-gateway and a thin server (smaller core S6) #1313) moves the gateway's socket and product code into nessa-gateway and leaves nessa-server as 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

@Varuas37
Varuas37 marked this pull request as ready for review November 14, 2026 17:13
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5e0c22c4-7066-4e6a-9206-f423f82f7cfd
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T17:16:22.945528Z 8d2431d Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread crates/nessa-conversation/Cargo.toml Resolved
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

Copy link
Copy Markdown
Contributor Author

Windows server-conversation failed on one test: a_fetch_whose_lease_ends_mid_transfer_is_refused_lease_ended hit its 5 s wall-clock timeout (Elapsed) at leases.rs:5281. The other 1,519 tests in that binary passed. The test moved here unchanged, and this shard has flaked on a different wall-clock test from run to run on main too. The binary took 1,139 s, so the runner was heavily loaded. I'll re-run the failed job once the run finishes. If it fails again, I'll treat it as a real failure.


Generated by Claude Code

@Varuas37
Varuas37 merged commit cde23d9 into main Nov 14, 2026
25 of 27 checks passed
@Varuas37
Varuas37 deleted the claude/project-thread-9om5pz branch November 14, 2026 19:05
Varuas37 added a commit that referenced this pull request Nov 14, 2026
#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>
Varuas37 added a commit that referenced this pull request Nov 18, 2026
<!-- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

One record per conversation, nessa-conversation crate (smaller core S5)

2 participants