perf(cli): rig send checks an issued sender without the hook bridge or, for a seat, the database #4213
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #4213"
general
weight: 0.35
openrig-review
The problem
Every
rig sendthat isn't--rawasks whether its sender is a conversation OpenRig issued an address to, for its reply hint (#4141). Since then,rig sendcosts more to start than it did in 0.7.26. Agents send all the time, so this matters. It comes from two things:isIssuedConversationAddress, came through@openrig/daemon/conversation-key. Evaluating that surface also evaluates the openrig plugin's hook bridge script beside it: about 60 KB of CommonJS that Node reads for its named exports at every load.- In a fresh process, importing the surface took a median 21.8 ms, against 2.7 ms for the check's own module (30 runs each).
daemon.json, loadingbetter-sqlite3, the open, the query and the close.- That took a median 15.0 ms in a fresh process, after the imports.
What changes
@openrig/daemon/issued-conversation-addressexports onlyhasIssuedAddressShapeandisIssuedConversationAddress.rig sendimports it, and the conversation-key surface no longer re-exports the check, sincesendwas its only user. The check is still implemented once.conversation-<12 hex>@kernel, fromissuedReturnAddress. A route carried from another host keeps it with that host after it (…@kernel@<host>). SoisIssuedConversationSenderreturns false, without opening the database, for a sender with neither shape, which nearly always means a seat.- A host-qualified issued address is checked against the database as before. A forwarded route keeps its host and its basis on the receiving host, and
rig send's SSH relay names its sender there by that same origin. So an issued conversation that sends across hosts keeps its reply hint.- One definition of the format:
issuedReturnAddressnow lives beside the shape indomain/issued-conversation-address.tsand is still re-exported fromreturn-route.ts. The prefix, the rig and the hash length are each written once. Arig sendprocess already loadsnode:crypto, so this adds nothing to its start.- A test ties 500 generated addresses, alone and carried from another host, to the shape.
senddoes is unchanged. An issued sender still gets the hint, and every other sender still doesn't, apart from the case under Limits.How it was checked
main:- the new start-up test fails with "rig send loaded the conversation key";
- the sender tests fail because
isIssuedConversationSenderisn't exported (TypeError);- the shape test can't find the new surface.
conversation-3f2a9c1b7e44@kernel@host-a (issued): expected false to be true"), and it opened the database twice for four senders with the shape; the shape test refused an address carried from another host.sendfile, the MCP server and network-request files, the lazy program, the bin wrapper and the queue start-up), 332 passed.npm run lintpassed.mainas packed (M) andmainwith this change (F). Each sent 100 rounds of a non-rawrig sendfrom a sender session to a seat that doesn't exist, the order rotating each round. This was measured at the first head. The later change doesn't touch a seat's path: a seat's name still fails the shape before any database read.| | A | M | F |
|---|---|---|---|
| Child CPU, median | 387.5 ms | 430.4 ms (M/A 1.111) | 396.4 ms (F/A 1.023, F−M −34.0) |
| Wall, median | 310.4 ms | 331.1 ms (M/A 1.066) | 317.3 ms (F/A 1.022, F−M −13.8) |
| JS files opened (
strace) | 134 | 155, the hook bridge and the database included | 139, neither |- What F still opens beyond A: the check's small surface and module, and
daemon-lifecycle's bind-plan import (three files), which every read command has loaded since an earlier change. Its CPU spread overlaps A's.Limits
rig senddoesn't recognize a sender by that name as issued: only a database read could, and that read is the cost this removes from every seat's send. Such a sender gets the ordinary reply hint ("Reply: rig send …", or "has no session"), not the queue one. Delivery is unchanged.rig send) still opens the database, as it must to answer.daemon-lifecycleis left as it is here, as it was in #4211.🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Issued conversation addresses now follow a consistent format and can include a host component. The address format is recognized across supported workflows.
Bug Fixes
* The send command now checks whether a sender matches the issued-address format before checking local conversation records. Invalid or unmatched senders are treated as not issued, and database lookup failures are handled safely.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->