Skip to content

L8: parent-aware graphdb_attr creators + create_relationship_attribute_pair rename#30

Merged
david-w-t merged 6 commits into
davidwt-com:mainfrom
david-w-t:develop
Jun 1, 2026
Merged

L8: parent-aware graphdb_attr creators + create_relationship_attribute_pair rename#30
david-w-t merged 6 commits into
davidwt-com:mainfrom
david-w-t:develop

Conversation

@david-w-t
Copy link
Copy Markdown
Contributor

Summary

Generalizes graphdb_attr so 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.

  • Canonical general creators: create_value_attribute/4 (single node;
    AttrType :: name | literal | relationship) and
    create_relationship_attribute_pair/4 (reciprocal pair). The named
    functions (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/1 gates both write paths: a parent that doesn't
    exist or isn't kind=attribute is rejected ({error,{parent_not_found,_}}
    / {error,{parent_not_attribute,_}}) before any nref/rel-id is consumed.
  • do_create_value_attribute/5 enforces the TypeArgs contract via
    clause heads (bad_type_args / bad_attribute_type; total, no
    function_clause).
  • Rename: create_relationship_attributecreate_relationship_attribute_pair
    across the one production caller (graphdb_mgr) and all CT suites.
  • Seeding is untouched (init/1 uses internal ensure_seed/2
    do_create_attribute/3, bypassing the public path).
  • Docs: apps/graphdb/CLAUDE.md, ARCHITECTURE.md, TASKS.md (L8
    RESOLVED), 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 failures
  • New CT cases: explicit-parent placement (single node + pair), parent
    validation errors, TypeArgs validation, back-compat default parents

🤖 Generated with Claude Code

david-w-t and others added 6 commits May 31, 2026 11:25
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>
Copy link
Copy Markdown
Contributor Author

@david-w-t david-w-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good

@david-w-t david-w-t merged commit 52d1bb1 into davidwt-com:main Jun 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant