Clean up graph resolve feature and infra labels#982
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughInfra topology traversal now matches a revised predicate set, graph view inline relations map ChangesInfra/Feature Predicate Separation
Possibly related issues: #981 — The changes separate feature predicates from infra topology routing and update the expected include labels accordingly. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
📋 Issue PlannerBuilt with CodeRabbit's Coding Plans for faster development and fewer bugs. View plan used: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
potpie/context-engine/application/readers/infra_topology.py (1)
37-47: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winAdd
EXPOSESto the infra-topology predicate set.
infra_topology.service_neighborhoodnow advertisesEXPOSESinpotpie/context-engine/domain/graph_views.py, but_INFRA_PREDICATESwill never read that relation. That leaves the view contract and the reader out of sync, soinfra_topologyrequests can silently miss service exposure edges the graph view says are available.Suggested fix
_INFRA_PREDICATES: tuple[str, ...] = ( "DEFINED_IN", "DEPLOYED_TO", "DEPENDS_ON", "USES", "USES_ADAPTER", "CONFIGURES", "DEPLOYED_WITH", "HOSTED_ON", "OWNED_BY", + "EXPOSES", )🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@potpie/context-engine/application/readers/infra_topology.py` around lines 37 - 47, Add EXPOSES to the infra-topology predicate whitelist so the reader and graph view stay aligned. Update _INFRA_PREDICATES in infra_topology.py to include EXPOSES alongside the existing relation names, and make sure infra_topology.service_neighborhood can now read that edge type just like the others.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@potpie/context-engine/tests/unit/test_graph_views.py`:
- Around line 66-69: The neighborhood view test only verifies that PROVIDES was
removed, so it can still pass if EXPOSES is missing too. Update
test_neighborhood_declares_depth_direction_environment to also assert that
EXPOSES is present in spec.inline_relations, ensuring the relation swap is fully
covered when checking infra_topology.service_neighborhood via view_spec.
---
Outside diff comments:
In `@potpie/context-engine/application/readers/infra_topology.py`:
- Around line 37-47: Add EXPOSES to the infra-topology predicate whitelist so
the reader and graph view stay aligned. Update _INFRA_PREDICATES in
infra_topology.py to include EXPOSES alongside the existing relation names, and
make sure infra_topology.service_neighborhood can now read that edge type just
like the others.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: d4cb68f1-41b9-4245-a6b2-d1521c573975
📒 Files selected for processing (5)
potpie/context-engine/application/readers/infra_topology.pypotpie/context-engine/domain/agent_context_port.pypotpie/context-engine/domain/graph_views.pypotpie/context-engine/tests/unit/test_graph_views.pypotpie/context-engine/tests/unit/test_read_orchestrator.py
💤 Files with no reviewable changes (1)
- potpie/context-engine/domain/graph_views.py
Summary
Fix
potpie resolveso feature-related claims are returned underfeaturesinstead of being surfaced throughinfra_topology. This change keeps the include labels semantically clean for top-level resolve output. Feature predicates such asPROVIDESandIMPLEMENTED_INnow stay in the feature path, whileinfra_topologyremains limited to topology-oriented claims.Closes #981
What Changed
featuresto the default include set for thefeatureintentinfra_topologyreaderinfra_topology.service_neighborhoodno longer advertisesPROVIDESWhy
Previously, top-level resolve could return feature claims under
infra_topology, which made the include labels misleading even when the underlying context was useful.This PR corrects that semantic boundary so downstream users and agents can trust the include family more accurately.
Validation
Notes
Focused automated validation is passing.
A separate manual local-graph inconsistency was observed while creating ad hoc fixture data for CLI verification: a committed feature claim did not surface in live reads even though the mutation plan recorded it as accepted.
That behavior appears unrelated to the resolve-labeling change in this PR and is not part of this fix.