Repository navigation
Label create_relationship writes by the stored edge (closes #3106) - #3176
Conversation
Pragmatic Code Review: PR #3176Review Type: Initial review. No earlier reviews or comments on the PR. Head Requirements Check (#3106)
Code Review Findings🟡 The agent-layer seam has no test for an inbound write. 🟡 The daemon test's fixture reverses the shipped schema. 🟢 Removing
🟢 The gRPC and CLI output now reports the stored edge (a contract change). 🟢 Nit: the model now sees the forward name for an inbound write. 🟢 Nit: playbook actions still echo their arguments. 🟢 Standards and design. The Recommendation: APPROVEThe fix is correct and minimal: it makes the store the only source of truth for how an edge is spelled. The two 🟡 items concern test fidelity, not correctness, and are cheap to address before merge. |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Review addressed (6f57a08)✅ Addressed (3)
⏭️ Skipped (2)
🧪 Agent Re-review: not needed. The changes are tests and one proto comment; no production logic changed. |
A write through an inbound (`in`-declaration) name is stored as the forward
edge, and a later eviction's `replaced` entry names it that way — but the
write's own label echoed the call's inbound spelling, so the two never
matched and restoring the evicted edge was refused as a duplicate.
- core: create_relationship(_in_tx) returns CreatedRelationship { edge,
replaced }, where `edge` is the stored forward edge; ReplacedEdge is
renamed StoredEdge
- rel_ops::CreateRelOutput reports the stored edge, not the input
- agent create_relationship result reports the stored edge as nodespace://
URIs, the same form as its `replaced` entries
- daemon builds the write label from the result; canonical_args still
comes from the call's arguments, so guard identity is unchanged; the
edge_key scheme-stripping shim is gone since both sides now agree
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- agent: create_relationship_through_in_name_reports_the_stored_edge drives a real `in` declaration through GraphToolExecutor and checks the result's edge equals the later write's `replaced` entry byte-for-byte - daemon: the inbound-eviction test used person `tasks` as an `in` name, but it is the forward name; switch to the ADR supersedes/superseded_by pair - proto: document that CreateRelationshipResponse reports the stored edge Skipped: the model seeing the forward name (the reviewer said no change needed) and playbook add_relationship echoing its args (out of scope; no consumer compares that output). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
6f57a08 to
587ea1d
Compare
Problem
A
create_relationshipwrite through an inbound (in-declaration) name is stored as the forward edge, and a later eviction'sreplacedentry names it in that forward form. The write's own label, though, echoed the call's inbound spelling. The two never matched, so "put it back on Alice" was refused as a duplicate of a write that no longer stood.Changes
create_relationship/create_relationship_in_txreturnCreatedRelationship { edge, replaced }, whereedgeis the stored forward edge.ReplacedEdgeis renamedStoredEdge, since it now describes both.rel_ops::CreateRelOutputreports the stored edge, not the input.create_relationshipresult reports the stored edge asnodespace://URIs, the same form as itsreplacedentries. (The CLI and Tauri responses also now show an inbound-name write in its forward form.)canonical_argsstill comes from the call's arguments, so the guard's identity for a write is unchanged. Theedge_keyscheme-stripping shim is deleted, since both sides now agree on one spelling.Tests
write_through_in_name_reports_the_stored_edge: the rel_ops output is in forward form, and a later eviction names it identically.an_edge_written_through_an_in_name_is_released_by_its_eviction: assign via the inbound name, evict, recreate. The recreation isn't refused, and its identity matches the original.Ran: daemon
local_agent_servicetests (85 pass) and corerelationship_in_name_normalization_test(18 pass).test:changednever ran: it sat queued behind other gates for the machine slot, so the full run is left tobun run merge.🤖 Generated with Claude Code