Repository navigation
Remove a node property from the CLI (node update --unset-property) - #4400
Merged
Merged
Conversation
Contributor
Author
|
Follow-up commit c51d381 addresses review:
Sync pull path (read only, nodespace-sync origin/main |
… batch unset_properties A properties patch only merges, so null left the key in place. UpdateNode and BatchUpdateItem carry unset_properties; core removes the keys after the patch merges, on every update path, so validation, the version check and events are those of any other update. The CLI checks the node it gets back and fails when an older daemon ignored the field. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…field update_node returns the node unchanged, with no write, version bump or event, when the update only unsets keys the node does not hold (a stale version still conflicts, a refused key is still refused). The other paths mark the properties changed only when a key was removed. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
mstomar125
force-pushed
the
issue-4390-unset-property
branch
from
November 27, 2026 06:46
c51d381 to
4a5f21c
Compare
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.
What
node update --property key=nullstores a null and the key stays, because properties are deep-merged. There was no way to remove a key from the CLI.unset_properties(repeated string) onUpdateNodeRequest(field 11) andBatchUpdateItem(field 6);NodeUpdate/UpdateNodeInputcarry it. Core removes the keys right after the properties patch is merged and before validation, on every update path (prepare_updatefor the version-checked update and dry run,update_node_unchecked, the two_in_txpaths,bulk_update), so validation, the version check and theNodeUpdatedevent (the removal shows as a change with no new value) are those of any other update. The key is removed from every type bucket the node holds, so an inherited field in its declaring ancestor's bucket goes too.node update --unset-property <key>(repeatable) andunset_properties(array of keys) per item innode batch-update --updates. The same key in--unset-propertyand--property/--propertiesis refused. Help text andpackages/skill/references/cli.md(regenerated) document both.relationship delete --type --from --toalready exists on main (overDeleteRelationship); no code change. I added the missing tests: delete removes the edge, the reverse name (blocked_by) no longer lists it, and deleting an edge that is not there succeeds withdeleted: false(documented behaviour, the command reports "no-op").Decisions: an unset of a key the node does not hold is a no-op, not an error (so a cleanup over many nodes can be re-run).
_-prefixed keys, empty keys and any key on a schema node are refused with a clear error. A required field cannot be removed (validation refuses it).New CLI against an old daemon (release compatibility)
proto3 ignores a field the old daemon does not know, so an old daemon would silently do nothing for an unset-only update. The CLI therefore reads the node back (the update response, and the existing post-batch read-back for
batch-update) and fails with " still has '': the daemon did not remove it. A daemon older than this CLI ignores --unset-property; update NodeSpace..." when a requested key is still there. For batch-update the other items have already been written by then (the error comes after the batch). An old CLI against a new daemon is unaffected (the field is simply never sent).--dry-runwith--unset-propertyon an old daemon would predict as if nothing were unset.Tests and mutation checks
unset_property_test(10): key removed and no null in storage, ops path, absent key no-op, patch+unset in one write at one version bump, OCC conflict, required field refused,_/empty keys refused, event reports the removal, unchecked update, bulk update.an_unset_removes_the_key_on_every_write_pathruns all five internal paths including the inherited field.node update, absent key, set+unset conflict, batch per-item unset, malformedunset_properties, relationship delete (+ reverse edge, + missing edge)._guard, empty-key guard,is_emptyignoring unset, CLI never sending the field, batch parse dropping it, daemon update and batch handlers ignoring the field (this is the old-daemon behaviour, and it fails the CLI round trip), the CLI old-daemon check for update, the batch old-daemon helper, the set+unset conflict check.batch_update(the helper itself is unit tested, the three-line wiring is not).quality:fixclean (unrelated webview_bridge_tests.rs reformat reverted),gen:types(one optional field in node-update.ts),skill:gen,test:changedpassed.The agent crate only gains
..Default::default()on itsUpdateNodeInputliterals (owner sign-off for this batch).Closes #4390
🤖 Generated with Claude Code