Skip to content

refactor(core): generalize the dependent-node resolver out of uniqueness - #10246

Draft
polmichel wants to merge 1 commit into
pmi-ifc-2946-relationship-reached-narrowingfrom
pmi-ifc-2946-generalize-dependent-resolver
Draft

refactor(core): generalize the dependent-node resolver out of uniqueness#10246
polmichel wants to merge 1 commit into
pmi-ifc-2946-relationship-reached-narrowingfrom
pmi-ifc-2946-generalize-dependent-resolver

Conversation

@polmichel

@polmichel polmichel commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Stacked on #10262.

What

The reverse "which nodes reference these changed peers through a relationship" traversal is generic; it lived in validators/uniqueness/ only because that was its first caller. This moves it to a neutral home so the selective-regeneration narrowing depends on a general component rather than the uniqueness validators.

  • DependentNodeResolver (+ interface) → core/relationship/ (its domain).
  • DependentNodesQuerycore/query/ (it is a query, alongside the existing relationship queries).
  • Uniqueness callers repointed; behavior unchanged.

The import cycle

Moving the resolver into core/relationship/ surfaced a latent import cycle in that package. Its root: relationship_schema imported the Relationship class only to read Relationship.rel_type through a get_class() that nothing else calls. Dropping the dead get_class() and reading the edge type from DatabaseEdgeType.IS_RELATED removes relationship_schema's dependency on the relationship package and breaks the cycle at its root.

Tests

Uniqueness scope/determiner and the relocated resolver component tests stay green; the resolver imports in isolation without triggering the cycle.

🤖 Generated with Claude Code

Review in cubic

The reverse "which nodes reference these changed peers through a relationship"
traversal is generic and lived in validators/uniqueness only because that was
its first caller. Move it to its domain so post-merge selective regeneration
depends on a neutral component instead of the uniqueness validators:

- DependentNodeResolver (+ interface) -> core/relationship
- DependentNodesQuery -> core/query
- uniqueness callers repointed; behavior unchanged.

Moving the resolver into core/relationship exposed a latent import cycle in
that package. Its root: relationship_schema imported the Relationship class
only to read Relationship.rel_type via a get_class() that nothing else calls.
Drop the dead get_class() and read the edge type from DatabaseEdgeType.IS_RELATED,
which removes relationship_schema's dependency on the relationship package.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@polmichel
polmichel requested a review from a team as a code owner August 13, 2026 13:34
@github-actions github-actions Bot added the group/backend Issue related to the backend (API Server, Git Agent) label Aug 13, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 9 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Pure refactor: renames and relocates a resolver/query, removes dead get_class(), and breaks an import cycle; behavior is unchanged and existing tests cover the moved component.

Re-trigger cubic

@polmichel
polmichel marked this pull request as draft August 13, 2026 13:42
@codspeed-hq

codspeed-hq Bot commented Aug 13, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 13 untouched benchmarks


Comparing pmi-ifc-2946-generalize-dependent-resolver (3b2ee04) with pmi-ifc-2946-relationship-reached-narrowing (f370f5b)1

Open in CodSpeed

Footnotes

  1. No successful run was found on pmi-ifc-2946-relationship-reached-narrowing (a42926b) during the generation of this report, so fa0e030 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@polmichel
polmichel force-pushed the pmi-ifc-2946-generalize-dependent-resolver branch from d6ce2cc to e5a2eed Compare August 13, 2026 15:28
@polmichel
polmichel force-pushed the pmi-ifc-2946-generalize-dependent-resolver branch from e5a2eed to 3b2ee04 Compare August 14, 2026 10:12
@polmichel
polmichel requested a review from ajtmccarty August 14, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

group/backend Issue related to the backend (API Server, Git Agent)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant