Repository navigation
CLI coverage gap: surface remaining knowledge-graph operations so skills+scripts can replace MCP - #1232
Conversation
Code Review — PR #1232: CLI Coverage GapVerdict: Approve with minor improvements noted. This is a well-scoped, net-positive change that cleanly closes the CLI coverage gap without introducing any significant architectural debt or security issues. The implementation is straightforward thin-client plumbing as the issue intended, the test suite is solid, and the docs are materially improved. The findings below are minor; none are blockers. SummaryThe PR surfaces six new knowledge-graph operations via the CLI (query, export, batch-get, batch-update, mention CRUD, schema read), adds three new RPC handlers in the daemon, and expands SKILL.md into a genuine agent reference. The architecture is consistent with the existing CLI pattern: stateless gRPC thin-clients with Findings[Improvement]
|
malibio
left a comment
There was a problem hiding this comment.
Review posted above. One improvement (N+1 batch fetch in get_nodes_batch daemon handler) and one stale comment (SurrealDB reference in proto) are the most substantive items. The rest are minor polish. Net positive change — safe to merge after addressing the batch handler.
Code Review SummaryThis PR is a clean, well-scoped surfacing of six previously-unreachable daemon operations at the CLI layer. The architecture is consistent with existing patterns throughout the codebase, and the changes are appropriately thin — no new business logic, pure gRPC client plumbing. The PR closes the primary blocker (#1227) for skill-based agent integration replacing MCP. A few issues worth addressing before merge, and one meaningful architectural observation about the batch handlers. FindingsCritical Issues[Critical/Blocker]
The existing The same applies to // core/node_batch.rs line 136-137
tracing::warn!(
"OCC bypassed: version parameter not provided for batch update (race condition possible)"
);The new daemon handler omits this warn entirely, meaning version-less batch updates will silently bypass OCC without any log signal. Recommendation: Delegate both daemon handlers to the functions in Suggested Improvements[Improvement]
let markdown = result["markdown"].as_str().unwrap_or("").to_string();
let node_count = result["node_count"].as_u64().unwrap_or(0) as u32;If [Improvement]
[Improvement] Lines 749–751: Err(e) => {
tracing::warn!("get_nodes_batch: error fetching {}: {}", node_id, e);
not_found.push(node_id);
}A transient DB error (lock contention, I/O error) is silently folded into the NitpicksNit: Nit: Nit: Nit: The Acceptance Criteria Check
Overall VerdictNet positive change — the CLI surface gap is closed and the implementation is consistent with existing patterns. The DRY violation in the batch handlers is the one issue I'd want resolved before merge since it creates two maintenance surfaces for the same logic and drops the OCC bypass warning that the original author deliberately added. All other findings are improvement-grade or below. |
malibio
left a comment
There was a problem hiding this comment.
Requesting changes on the batch handler duplication / OCC bypass warning omission — see the detailed review comment above. All other findings are improvement-grade or nits. Happy to approve once the delegation to core::node_batch is in place.
Review addressedAll findings from the pragmatic code review have been addressed: 🔴 Critical fixed:
🟡 Important fixed:
🟢 Nits fixed:
⏭️ Skipped:
|
3d8c649 to
1f26275
Compare
…#1227) - proto: add ExportMarkdown, GetNodesBatch, UpdateNodesBatch RPCs + messages - daemon: implement all three new RPC handlers in NodeServiceImpl - export_markdown: delegates to core::markdown::handle_get_markdown_from_node_id - get_nodes_batch / update_nodes_batch: OCC-aware, max 100 items, error-per-item - CLI new subcommands: - nodespace node query (QueryNodesSimple — type/content/title/mentioned-by filters) - nodespace node export (markdown export with OCC comments, depth control) - nodespace node batch-get / batch-update (JSON array input for batch-update) - nodespace mention create/delete/outgoing/incoming - nodespace schema list/get - Integration tests: 4 new tests covering all new command paths - SKILL.md: remove stale "SurrealDB with RocksDB" fact; add SQLite/libsql note; document all new commands with examples - insert-at-index / move-to-index CLI commands deferred pending #1216 InsertPosition Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…ale comments
- get_nodes_batch: delegate to NodeService::get_nodes (single SQL batch query)
instead of N individual get_node calls; surface store errors as Status::internal
rather than silently folding into not_found
- update_nodes_batch: restore tracing::warn! on OCC bypass path (was present in
core::node_batch but dropped in the daemon re-implementation)
- export_markdown: replace .unwrap_or("") / .unwrap_or(0) with ok_or_else so
shape changes in handle_get_markdown_from_node_id fail loudly
- proto: fix stale "SurrealDB (LIMIT/START AT)" comment → SQLite/OFFSET
- SKILL.md: replace --type note examples with --type text (note is not a core type)
- mention.rs: drop unnecessary .clone() on moved args.from / args.to
Skipped: --no-children flag refactor (works correctly, out of scope);
schema get integration test (no seeded schema ID available in bare test daemon)
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1f26275 to
d51116b
Compare
…lls+scripts can replace MCP (#1232) * Add CLI coverage for query, export, batch, mention, schema ops (closes #1227) - proto: add ExportMarkdown, GetNodesBatch, UpdateNodesBatch RPCs + messages - daemon: implement all three new RPC handlers in NodeServiceImpl - export_markdown: delegates to core::markdown::handle_get_markdown_from_node_id - get_nodes_batch / update_nodes_batch: OCC-aware, max 100 items, error-per-item - CLI new subcommands: - nodespace node query (QueryNodesSimple — type/content/title/mentioned-by filters) - nodespace node export (markdown export with OCC comments, depth control) - nodespace node batch-get / batch-update (JSON array input for batch-update) - nodespace mention create/delete/outgoing/incoming - nodespace schema list/get - Integration tests: 4 new tests covering all new command paths - SKILL.md: remove stale "SurrealDB with RocksDB" fact; add SQLite/libsql note; document all new commands with examples - insert-at-index / move-to-index CLI commands deferred pending #1216 InsertPosition Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * Address review: fix batch handlers, export fallbacks, OCC warning, stale comments - get_nodes_batch: delegate to NodeService::get_nodes (single SQL batch query) instead of N individual get_node calls; surface store errors as Status::internal rather than silently folding into not_found - update_nodes_batch: restore tracing::warn! on OCC bypass path (was present in core::node_batch but dropped in the daemon re-implementation) - export_markdown: replace .unwrap_or("") / .unwrap_or(0) with ok_or_else so shape changes in handle_get_markdown_from_node_id fail loudly - proto: fix stale "SurrealDB (LIMIT/START AT)" comment → SQLite/OFFSET - SKILL.md: replace --type note examples with --type text (note is not a core type) - mention.rs: drop unnecessary .clone() on moved args.from / args.to Skipped: --no-children flag refactor (works correctly, out of scope); schema get integration test (no seeded schema ID available in bare test daemon) Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Michael Libio <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Closes #1227