Task 8: scaffold nref constants → shared graphdb_nrefs.hrl header#23
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
scaffold_spec/0 enumerates all 36 scaffold+permanent nrefs as
{MacroName, Nref, Kind, ExpectedName} tuples. verify/0 reads each
from Mnesia and confirms kind + name AVP match.
CT suite: verify_returns_ok passes; bootstrap_module_unloaded fails
(expected -- unloading not yet implemented, pending Task 4).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
After rebuild_and_verify_caches() succeeds, verify/0 confirms every
scaffold nref has the expected kind and name AVP in Mnesia. A
mismatch is a fatal startup error (throws {error, ...}).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
code:delete/1 + code:purge/1 in graphdb_mgr:init/1 removes the module from the code server immediately after a successful load. Erlang reloads it from the code path on demand (e.g. CT suite restarts). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace inline scaffold-nref -define blocks in five source files with
-include_lib("graphdb/include/graphdb_nrefs.hrl") and rename all
usages to the canonical macro names (NREF_*, NAME_ATTR_*, ARC_*).
graphdb_attr : PARENT_NAMES/LITERALS/RELATIONSHIPS, NAME_ATTR_FOR_ATTRIBUTE,
ATTR_CHILD/PARENT_ARC, TEMPLATE_AVP_NREF
graphdb_class : CLASSES_CATEGORY, NAME_ATTR_FOR_CLASS, CLASS_CHILD/PARENT_ARC
graphdb_instance: NAME_ATTR_FOR_INSTANCE, INST_CHILD/PARENT_ARC,
CLASS/INSTANCE_MEMBERSHIP_ARC, TEMPLATE_AVP_NREF
graphdb_language: PARENT_LITERALS/CLASSES, HUMAN_LANGS, NAME_ATTR_FOR_*,
ATTR/CLASS/INST arc macros, CLASS/INSTANCE_MEMBERSHIP_ARC
graphdb_mgr : PARENT_ARCS updated to use arc macros; CLASS_MEMBERSHIP_ARC
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add -include_lib("graphdb/include/graphdb_nrefs.hrl") to 7 test files
and replace all raw scaffold nref integers with named macros:
attribute => 17/18/19/20/31 → ?NAME_ATTR_CATEGORY/ATTRIBUTE/CLASS/INSTANCE, ?ARC_TEMPLATE
characterization/reciprocal → ?ARC_CAT/ATTR/CLS/INST_* arc macros
mnesia:read(nodes, N) → named macros
10000 (English nref) → ?NREF_ENGLISH
language subcategory tuples → ?NREF_HUMAN_LANGS etc.
NamesGroup / RelGroup lists → full macro expansion
320 tests (217 CT + 103 EUnit), all green.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <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
apps/graphdb/include/graphdb_nrefs.hrlwith 36 named macros covering all scaffold nrefs 1–35 (NREF_*,NAME_ATTR_*,ARC_*) and the permanent English instance nref 10000 (NREF_ENGLISH)graphdb_nrefs.erlwithscaffold_spec/0andverify/0— verifies every scaffold nref exists in Mnesia with correct kind and name at bootstrap timegraphdb_nrefs:verify/0intographdb_bootstrap:do_load/0as a fatal post-bootstrap checkcode:delete/purgeofgraphdb_bootstrapingraphdb_mgr:init/1immediately after successful bootstrap-defineblocks in five source files (graphdb_attr,graphdb_class,graphdb_instance,graphdb_language,graphdb_mgr) with the shared headergraphdb_nrefs_SUITEwith two CT tests:verify_returns_okandbootstrap_module_unloadedTest plan
graphdb_nrefs_SUITE:verify_returns_ok—graphdb_nrefs:verify/0returnsokafter full bootstrapgraphdb_nrefs_SUITE:bootstrap_module_unloaded—graphdb_bootstrapmodule is not loaded aftergraphdb_mgrstarts🤖 Generated with Claude Code