Repository navigation
JVNAUTOSCI-2587 restore represented relation-family retrieval - #320
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Restores represented inverse + relation-family predicate retrieval from Vontology and updates the entity-information workflow/tool shaping to treat relation results as “unique related entities” across both incoming and outgoing directions, with a bounded canonical fallback when derived extent indexes are unavailable.
Changes:
- Introduces a Vontology-backed predicate-family expander (inverse + family membership + focal/related roles + reified relation types), preferring the relationship-extent index and falling back to an exact bounded canonical query when needed.
- Updates relation retrieval + LLM-facing shaping to better support bidirectional relation discovery, include source previews in both directions, and compact duplicate neighbour assertions into unique related-entity records.
- Updates the entity-information workflow seed/prompt defaults to query
argument_index: "any"and to enable predicate-family expansion; adds targeted test coverage for the new behaviours and fallbacks.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/backend/services/predicate_family_vontology_service.py |
Adds the new service to expand predicate filters via represented inverse + relation-family schema with bounded fallbacks. |
src/backend/services/concept_relation_service.py |
Enhances bidirectional relation retrieval: incoming-side exact predicate fallback when extent index is unavailable, and preview batching for incoming sources. |
src/backend/integrations/internal_mcp/orchestrator.py |
Expands find_relations_with_argument predicate filters via Vontology family expansion and reshapes relation hits into unique related-entity projections (direction/name/type/predicate compaction). |
src/backend/workflows/repo_seed_bundles/entity_information_retrieval_workflow_seed_bundle.json |
Updates workflow defaults (argument_index: "any") and enables bounded predicate-family expansion in find_relations_with_argument. |
src/backend/workflows/repo_seed_bundles/entity_information_retrieval_prompt_seed.md |
Aligns prompt/tool guidance with argument_index: "any" and the new related-entity fields (related_concept_id, direction, types). |
tests/backend/test_predicate_family_vontology_service.py |
Adds unit tests for family expansion via index, canonical fallback, and soft-failure behaviour. |
tests/backend/test_concept_relation_service_extent_index.py |
Adds tests for bidirectional previews, batched incoming preview loading, exact predicate fallback, and preserving the general aggregation fallback for unresolved predicate labels. |
tests/backend/test_concept_relation_service_uncertainty.py |
Updates access-control expectations to validate batch filtering of target concept IDs. |
tests/backend/test_internal_mcp_orchestrator_context_limits.py |
Adds tests for unique related-entity projection/compaction and for turn-scoped predicate-family expansion support. |
tests/backend/test_entity_information_retrieval_workflow_vontology_service.py |
Updates workflow seed materialisation tests to reflect the new defaults and response-contract text. |
Comment on lines
+610
to
+617
| _prime_concept_preview_cache( | ||
| [ | ||
| resolved_concept_id, | ||
| *(source_id for source_id, _, _, _ in incoming_candidates), | ||
| ], | ||
| include_preview=include_concept_preview, | ||
| preview_cache=preview_cache, | ||
| ) |
Comment on lines
+21024
to
+21027
| if len(selected_hits) >= max_hits: | ||
| continue | ||
| selected_hits.append(hit) | ||
|
|
| monkeypatch.setattr( | ||
| service, | ||
| "filter_accessible_concept_ids", | ||
| lambda concept_ids: set(concept_ids), |
| monkeypatch.setattr( | ||
| service, | ||
| "filter_accessible_concept_ids", | ||
| lambda concept_ids: set(concept_ids), |
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.
Outcome
Restores the current-main portion of JVNAUTOSCI-2587 without reviving the obsolete selector/completion-gate or replay-sampler code from the old recovery commit.
Validation
151 passed, 2 warningsacross opportunity-preservation, structured-calling, model-fallback, relation, workflow-authority, and new family testsgit diff --checkpassSecurity note: an unrelated diagnostic mistake exposed a credential in tool output during this work; it was not committed, but the credential must be revoked/rotated.