Add relationship indexing, graph traversal, and activity tracking#15
Merged
mgoldsborough merged 2 commits intomainfrom Mar 27, 2026
Merged
Add relationship indexing, graph traversal, and activity tracking#15mgoldsborough merged 2 commits intomainfrom
mgoldsborough merged 2 commits intomainfrom
Conversation
Write-time reverse index at _index/relations.json enables efficient
relationship queries without full entity scans. Three new graph
traversal methods on UpjackApp: query_by_relationship, get_related,
and get_composite. Activity tracking is opt-in via manifest flag,
using regular entities with a subject relationship.
New MCP tools auto-registered per entity type:
query_{plural}_by_relationship, get_related_{name},
get_{name}_composite, plus global rebuild_index and activity tools.
Closes #12
- _matches_filter now raises ValueError on unsupported dict/operator filters instead of silently skipping them - get_composite returns a shallow copy with _related instead of mutating the original entity dict
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
_index/relations.jsonenables O(1) relationship lookups. Auto-rebuilds from entity files if missing or corrupt. Atomic writes via temp file +os.replace.UpjackApp:query_by_relationship,get_related(forward/reverse),get_composite(entity + all related in one call with_relatedkey)"activities": truein manifest. Activities are regular entities (prefixact) withlog_activityandget_activitiesconvenience methods using the reverse index.on_relationships_changedcallback on create/update/delete, auto-wired by UpjackApp to maintain the indexquery_{plural}_by_relationship,get_related_{name},get_{name}_composite. Global:rebuild_index,log_activity,get_activitiesTest plan
make check)Closes #12