Skip to content

442 auto commit inverse smartlinks during relationship persistence commit pass 2#445

Open
owleyeview wants to merge 6 commits intomainfrom
442-auto-commit-inverse-smartlinks-during-relationship-persistence-commit-pass-2
Open

442 auto commit inverse smartlinks during relationship persistence commit pass 2#445
owleyeview wants to merge 6 commits intomainfrom
442-auto-commit-inverse-smartlinks-during-relationship-persistence-commit-pass-2

Conversation

@owleyeview
Copy link
Copy Markdown
Collaborator

@owleyeview owleyeview commented Apr 10, 2026

Auto-commit inverse SmartLinks during relationship persistence (Pass 2)

Summary

  • Extends commit_functions::commit() Pass 2 to automatically resolve and persist inverse SmartLinks whenever a declared forward relationship is committed, enforcing the MAP schema contract that all declared relationships are bidirectional and materialized
  • Adds resolve_inverse_relationship_name() which traverses the type graph (DescribedBy → InstanceRelationships → match TypeName → HasInverse → inverse TypeName) to derive the inverse relationship name from staged or persisted schema
  • Adds commit_inverse_smartlinks() which writes reversed-endpoint SmartLinks for each local target, skipping external targets
  • Introduces AssertRelatedHolons test step as the preferred replacement for QueryRelationships body assertions, comparing related-member sets by sorted identity (key + HolonId)
  • Adds inverse_smartlink_fixture end-to-end test proving bidirectional traversal after commit with staged schema
  • Documents the loader/commit boundary: the loader stages only declared relationships, commit materializes inverses

Test plan

  • inverse_smartlink_test validates forward (Book → AuthoredBy → [Person1, Person2]) and inverse (Person1 → Authors → [Book], Person2 → Authors → [Book]) traversal after commit
  • Full npm run sweetest suite passes — no regressions in simple_add_remove_related_holons_fixture (undescribed holons) or loader_client_fixture (bootstrap schema)
  • CI green

Out of scope

Closes #442

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.

Auto-Commit Inverse SmartLinks During Relationship Persistence (Commit Pass 2)

2 participants