Repository navigation
Rename relationship get's JSON key from related_nodes to nodes - #2913
Merged
Merged
Conversation
Every other list-returning CLI command (node query, search, schema
list) wraps results as {"count": N, "nodes": [...]}. relationship get
was the one exception, nesting under related_nodes instead — a caller
parsing `.nodes[]` against it got silent empty output rather than an
error.
Also updates scripts/eval/graph.ts's readRelatedIds, the only
downstream consumer that parses the CLI's relationship get --json
output directly, so the eval harness's edge snapshotting keeps
working under the new key.
Closes #2811
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
Author
Address-Review Summary
Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: The review found no issues and no code was changed as a result of it. The PR is unchanged from what was already reviewed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nodespace relationship get --jsonnested its results underrelated_nodes, while every other list-returning command (node query,search,schema list) wraps results as{"count": N, "nodes": [...]}. Becausejqsilently returns nothing for a missing key, a caller parsing.nodes[]againstrelationship getgot empty output instead of an error — indistinguishable from "no edges exist."Changes
packages/cli/src/commands/relationship.rs: renamed the JSON output key fromrelated_nodestonodes, matching every other list-returning command.scripts/eval/graph.ts(readRelatedIds) and its test inscripts/eval/end-state.test.ts: this is the one downstream consumer that parses the CLI'srelationship get --jsonoutput directly (used by the agent-matrix eval harness to snapshot graph edges) — updated to read thenodeskey in lockstep so it doesn't silently stop finding edges.Scope notes
node_id,relationship_name,count) were left snake_case, unchanged — no wider casing sweep.packages/agent/src/local_agent/tools.rs'sget_related_nodestool already emits{"count": N, "nodes": [...]}— it was already correct and needed no change. (Also: this is Michael's-lane territory underpackages/agent/src/local_agent/, so I checked it rather than touching it.)RelatedNodesOutput.related_nodes(packages/core/src/ops/rel_ops.rs) and the gRPC wire fieldrelated_nodes_json(daemon↔CLI transport) are unrelated internal names, not observed by external callers of the CLI's--jsonoutput, and are out of scope for this rename.packages/skill/references/cli.mdalready documents the general list-command shape as{"count": N, "nodes": [...]}and explicitly includesrelationship getunder it — the docs were already correct; only the code was inconsistent with them, so no doc changes were needed.Test plan
cargo check -p nodespace-clicargo test -p nodespace-cli --test cli_integration relationship(4 passed)bun run test:scripts(587 passed, includes the updatedreadRelatedIdsfixtures)bun run quality:fixcleantest:all+cargo build --bin nodespaced+test:e2e) passedCloses #2811
🤖 Generated with Claude Code