L8: parent-aware graphdb_attr creators + create_relationship_attribute_pair rename#30
Merged
Merged
Conversation
Purely mechanical, behaviour-preserving rename of the public API function to better reflect that it creates a reciprocal pair of arc-label nodes. Updates export, doc banner, public clause, gen_server message atom, handle_call head, and all call sites in graphdb_mgr.erl and the four CT suites. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds create_relationship_attribute_pair/4 taking an explicit ParentNref;
/3 delegates to /4 with the default ?NREF_RELATIONSHIPS parent.
Parameterizes do_create_relationship_attribute_pair/3 -> /4 so all six
former hard-coded ?NREF_RELATIONSHIPS occurrences become the ParentNref
parameter. Adds validate_parent/1 (dirty read, runs server-side before
any write) that rejects nonexistent nrefs with {parent_not_found, Nref}
and non-attribute-kind nodes with {parent_not_attribute, Kind}.
Two new CT cases cover the under_parent and bad_parent paths; all 380
tests pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… wrappers Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Update apps/graphdb/CLAUDE.md graphdb_attr API list to reflect parent-aware creator signatures post-L8. Fix stale create_relationship_attribute/3 reference in ARCHITECTURE.md to create_relationship_attribute_pair/4 and add parent-validation contract sentence. Add L8 RESOLVED entry to TASKS.md Engineering Hygiene section. Append P1 unblock update note to F4 §10.1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The L8 §10.1 note already records P1 as resolved; this removes the contradicting PINNED marker on the §3.1 seed-table row and the bare old-name references in F4 §10.1 and resiliency-notes R2b, so the F4 design is internally consistent with its own L8 update. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Generalizes
graphdb_attrso every attribute creator takes an explicit,validated parent nref, and renames the reciprocal-pair creator to say what
it does. Removes the F4 §10.1 P1 placement blocker by construction.
create_value_attribute/4(single node;AttrType :: name | literal | relationship) andcreate_relationship_attribute_pair/4(reciprocal pair). The namedfunctions (
create_name_attribute/1,2,create_literal_attribute/2,3,create_relationship_type/1,2,create_relationship_attribute_pair/3)become thin wrappers preserving the historical default parents (nref
6/7/8).
validate_parent/1gates both write paths: a parent that doesn'texist or isn't
kind=attributeis rejected ({error,{parent_not_found,_}}/
{error,{parent_not_attribute,_}}) before any nref/rel-id is consumed.do_create_value_attribute/5enforces theTypeArgscontract viaclause heads (
bad_type_args/bad_attribute_type; total, nofunction_clause).create_relationship_attribute→create_relationship_attribute_pairacross the one production caller (
graphdb_mgr) and all CT suites.init/1uses internalensure_seed/2→do_create_attribute/3, bypassing the public path).apps/graphdb/CLAUDE.md,ARCHITECTURE.md,TASKS.md(L8RESOLVED), F4 §10.1 P1 unblock note + §3.1 row un-pin, resiliency-notes
R2b resolved. Design at
docs/designs/l8-graphdb-attr-placement-design.md.Test Plan
./rebar3 compile— zero warnings./rebar3 ct— 283 CT passed./rebar3 eunit— 101 EUnit passed, 0 failuresvalidation errors,
TypeArgsvalidation, back-compat default parents🤖 Generated with Claude Code