Skip to content

refactor: route CLI request_pack through kimetsu_sdk (ADR 0001 §5) - #76

Merged
RodCor merged 3 commits into
mainfrom
cursor/cli-sdk-request-pack-7ed0
Nov 13, 2026
Merged

RodCor merged 3 commits into
mainfrom
cursor/cli-sdk-request-pack-7ed0

Conversation

@RodCor

@RodCor RodCor commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Routes the CLI request_pack path through the kimetsu_sdk::request_pack facade (ADR 0001 §5) instead of calling the bus directly in crates/kimetsu-cli/src/network.rs.

Changes

  • crates/kimetsu-cli/src/network.rs: the request/import path now goes through kimetsu_sdk::request_pack.
  • crates/kimetsu-cli/tests/network_loopback.rs: two_nodes_invite_join_share_request_then_leave now runs kimetsu network request end to end and asserts the imported row lands on the repo mount only. The user and org mounts must have 0 memories and 0 proposals, invalidated rows included, so contamination fails the test.
  • crates/kimetsu-bus/tests/f2_exit.rs: removed cli_request_pack_imports_through_the_sdk. It never executed the CLI path and duplicated sdk_request_pack_reaches_the_bus.

The SDK facade is a pass-through, so no test can fail when the CLI swap alone is reverted. The CLI-crate loopback test pins the observable behavior instead: a CLI request imports to the right mount without contamination.

Verification

  • Head 280df89 (main 7629ef2 merged in with a merge commit): all CI checks green, cargo-audit included.

Follow-up: once this lands, the §5 gap line in the ADR 0001 doc refresh (#75) needs a one-line update.

Co-authored-by: Rodrigo <rodrigo.ccordoba@hotmail.com>

@RodCor RodCor left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

fail against the adr bar. the §5 cli swap is in the right place, but the new test does not prove it.

crates/kimetsu-cli/src/network.rs line 558 now calls kimetsu_sdk::request_pack. both cmd_request and mcp_request go through that request fn, and no BusEndpoint::request_pack is left in the cli. the sdk facade is a straight forward to endpoint.request_pack, so errors, the repo write grant, destination MountLevel::Repo, trust, blake3+ed25519 verify-before-sql, and the contamination rule are unchanged. open_endpoint still binds iroh; no llm is on this path. the diff stays inside §5. base is main, one commit c535ebb on 19112da, no force-push. ci on that head is all green (test ubuntu/macos/windows, embeddings, clippy, rustfmt, cargo-audit, codeql, ts sdk, and the other completed checks).

must-fix: cli_request_pack_imports_through_the_sdk never runs cli code. kimetsu-bus does not depend on kimetsu-cli (and cannot: the cli depends on the bus). the include_str! sniff is a source lint, and the runtime half only compares BusEndpoint::request_pack to kimetsu_sdk::request_pack, which sdk_request_pack_reaches_the_bus already covers. because the sdk is a thin wrapper, a revert of the network.rs swap would still pass this test. put the proof in the cli crate: unit tests in crates/kimetsu-cli/src/network.rs, or extend crates/kimetsu-cli/tests/network_loopback.rs, which already drives kimetsu network request.

Comment thread crates/kimetsu-bus/tests/f2_exit.rs Resolved
cursoragent and others added 2 commits November 13, 2026 16:30
Drive kimetsu network request on loopback and check the imported row
is on the repo mount, with nothing written to user or org. Remove the
source-text check that never ran the CLI.

Co-authored-by: Rodrigo <rodrigo.ccordoba@hotmail.com>

@RodCor RodCor left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

pass against the adr 0001 bar at 280df89.

  • merge: 280df89 is a true merge (parents 60e267d + main 7629ef2). git produced it on its own with no hand-resolved conflicts: the tree matches git merge-tree 60e267d 7629ef2. git diff 7629ef2 280df89 is byte-for-byte the pr's own diff from 19112da to 60e267d. it touches only network.rs and network_loopback.rs. the merge brings in no test files, and Cargo.lock/Cargo.toml match main (#78, msrv 1.94.1). no force-push.
  • must-fix r4565759936: closed. the cli loopback test drives kimetsu network request and asserts the import lands on the repo mount only, with 0 user or org rows. it passes locally on 1.94.1 and in CI on ubuntu, macos, and windows.
  • ci: 17/17 green on 280df89, cargo-audit included.
  • pr body: matches the diff. the f2_exit.rs bullet is history (that test was added and then removed inside this pr), so it isn't in the net diff. nit only.

no open findings.

@RodCor
RodCor merged commit eaf8016 into main Nov 13, 2026
21 checks passed
@RodCor
RodCor deleted the cursor/cli-sdk-request-pack-7ed0 branch November 13, 2026 18:32
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.

2 participants