Repository navigation
B4 follow-up: fold remaining 11 CollectionService::new daemon sites into core (collection_ops) - #1261
Conversation
…tion_ops (closes #1243) Introduces `packages/core/src/ops/collection_ops.rs` with typed input/output structs and thin async functions wrapping `CollectionService`. Each of the 11 collection RPC handlers in the daemon now delegates to a single `collection_ops::*` call instead of constructing `CollectionService` inline, consistent with the ADR-031 thin-adapter rule. Co-Authored-By: Claude <[email protected]>
Code Review SummaryThis PR correctly addresses all 11 acceptance criteria sites. Every daemon collection RPC handler now delegates to a Two targeted improvements are worth addressing before merge: a leaked store bypass that defeats the abstraction for one handler, and inconsistently-typed error semantics in the two mutation ops. FindingsSuggested Improvements[Improvement]
The handler calls The The current output type is also a semantic mismatch with its sibling: [Improvement]
The ops functions return
The correct fix is to add an NitpicksNit: All input/output structs are missing Nit:
Nit:
|
…complete recursive op - Add OpsError::AlreadyExists variant; map to Status::already_exists in ops_error_to_status, eliminating the fragile ValidationFailed special-cases in create_collection and rename_collection - Move get_nodes_by_ids batch-fetch inside collection_ops::get_collection_members_recursive so the daemon handler receives Vec<Node> directly; output is now consistent with get_collection_members - Add #[derive(Debug)] to all collection_ops input/output structs - Add unit tests for duplicate-name guard and self-rename pass-through in collection_ops Co-Authored-By: Claude <[email protected]>
…nto core (collection_ops) (#1261) * B4 follow-up: fold 11 CollectionService::new daemon sites into collection_ops (closes #1243) Introduces `packages/core/src/ops/collection_ops.rs` with typed input/output structs and thin async functions wrapping `CollectionService`. Each of the 11 collection RPC handlers in the daemon now delegates to a single `collection_ops::*` call instead of constructing `CollectionService` inline, consistent with the ADR-031 thin-adapter rule. Co-Authored-By: Claude <[email protected]> * Address review findings: AlreadyExists error variant, Debug derives, complete recursive op - Add OpsError::AlreadyExists variant; map to Status::already_exists in ops_error_to_status, eliminating the fragile ValidationFailed special-cases in create_collection and rename_collection - Move get_nodes_by_ids batch-fetch inside collection_ops::get_collection_members_recursive so the daemon handler receives Vec<Node> directly; output is now consistent with get_collection_members - Add #[derive(Debug)] to all collection_ops input/output structs - Add unit tests for duplicate-name guard and self-rename pass-through in collection_ops Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Michael Libio <[email protected]> Co-authored-by: Claude <[email protected]>
Closes #1243