Skip to content

JVNAUTOSCI-2587 restore represented relation-family retrieval - #320

Merged
witbrock merged 1 commit into
mainfrom
agent/jvnautosci-2587-reconcile-relation-recovery
Jul 28, 2026
Merged

witbrock merged 1 commit into
mainfrom
agent/jvnautosci-2587-reconcile-relation-recovery

Conversation

@witbrock

Copy link
Copy Markdown
Member

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.

  • reads represented inverse and relation-family predicate metadata generically from Vontology
  • projects focal-relative direction, related entity identity/name/type, and compacts duplicate neighbour assertions
  • makes the entity-information workflow query all relation directions and consume the generic family affordance
  • uses an exact, bounded canonical predicate query when the derived relationship-extent index is unavailable, and batches related-concept previews
  • preserves the general canonical fallback for unresolved predicate labels

Validation

  • 151 passed, 2 warnings across opportunity-preservation, structured-calling, model-fallback, relation, workflow-authority, and new family tests
  • Ruff, workflow JSON parse, and git diff --check pass
  • live Vontology read-back confirms the published workflow defaults and response contract
  • isolated actor-scoped task-code probe expands the represented supervision family and returns five unique related entities, with four direct/inverse PhD-student records plus one correctly typed reified event for downstream type filtering
  • exact and nearby authenticated replays both discover/invoke the correct represented workflow; terminal execution remains blocked by linked JVNAUTOSCI-2588 (20 s KB read deadlines and port-5001 durable-worker/Atlas timeouts), and test instances were cancelled with canonical read-back

Security 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.

Copilot AI review requested due to automatic review settings July 28, 2026 13:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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),
@witbrock
witbrock merged commit 73fac2b into main Jul 28, 2026
5 checks passed
@witbrock
witbrock deleted the agent/jvnautosci-2587-reconcile-relation-recovery branch July 28, 2026 13:29
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.

2 participants