Repository navigation
refactor: route CLI request_pack through kimetsu_sdk (ADR 0001 §5) - #76
Conversation
Co-authored-by: Rodrigo <rodrigo.ccordoba@hotmail.com>
RodCor
left a comment
There was a problem hiding this comment.
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.
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
left a comment
There was a problem hiding this comment.
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 280df89is 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 requestand 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.
Routes the CLI
request_packpath through thekimetsu_sdk::request_packfacade (ADR 0001 §5) instead of calling the bus directly incrates/kimetsu-cli/src/network.rs.Changes
crates/kimetsu-cli/src/network.rs: the request/import path now goes throughkimetsu_sdk::request_pack.crates/kimetsu-cli/tests/network_loopback.rs:two_nodes_invite_join_share_request_then_leavenow runskimetsu network requestend 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: removedcli_request_pack_imports_through_the_sdk. It never executed the CLI path and duplicatedsdk_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
Follow-up: once this lands, the §5 gap line in the ADR 0001 doc refresh (#75) needs a one-line update.