Skip to content

fix(pascal): resolve units from dispatched corpus - #5289

Draft
adity982 wants to merge 3 commits into
Graphify-Labs:v8from
adity982:fix/5287-pascal-corpus-unit-resolution
Draft

adity982 wants to merge 3 commits into
Graphify-Labs:v8from
adity982:fix/5287-pascal-corpus-unit-resolution

Conversation

@adity982

@adity982 adity982 commented Nov 17, 2026 •

Copy link
Copy Markdown

What does this PR do?

Fixes #5287. Pascal uses relationships now resolve against the Pascal files selected for the active extraction batch, so a Delphi project under Projects/App/ can resolve units in sibling directories. Missing and duplicate unit names remain unresolved, avoiding guesses from unrelated or ambiguous vendor copies. The same corpus index reaches parallel workers while existing extraction helper call signatures remain unchanged.

Type of change

  • Bug fix
  • Tests or CI

Verification & Invariants

  • Read CONTRIBUTING.md and reproduced the reported failure.
  • Added regression tests for cross-directory resolution, ambiguous names, and parallel workers.
  • Missing and ambiguous names remain unresolved.
  • No generated files or local graph data are included.
  • AI authorship disclosed in commit metadata.

How was this tested?

  • uv run pytest tests/test_pascal_resolution.py tests/test_cache.py tests/test_terraform_modules.py tests/test_zero_node_no_cache.py plus four targeted extraction helper compatibility tests — 135 passed, 11 skipped.
  • uv run pytest tests/test_pascal_resolution.py tests/test_cache.py plus the four helper compatibility tests after the final signature-preserving change — 89 passed, 8 skipped.
  • uv run ruff check . and git diff --check — passed.
  • Pre-fix reproduction — the new cross-directory regression failed on the original v8 code.
  • uv run graphify update . — completed; optional parsers for other languages are absent in this environment.
  • uv run pyright graphify/extract.py graphify/extractors/resolution.py — 192 existing diagnostics in these large modules; none were on the changed lines.
  • Full suite on the preceding commit: 10,956 passed, 543 skipped, 62 failed, 1 xfailed. Four extraction-helper failures from that run are fixed and pass in the targeted rerun. Nine Pascal singleton-resolution failures reproduce on the original v8 base; other failures include tests that require bash, which is unavailable in this Windows environment.

Limitations

A unit name with zero or multiple matching files in the dispatched corpus remains a symbolic unresolved reference. This deliberately avoids choosing a file based on filesystem traversal order.

Resolve Pascal imports against the files selected for the current extraction batch so conventional Delphi layouts can link across project directories without scanning unrelated vendor trees. Leave missing or duplicate unit names unresolved to preserve deterministic, fail-closed behavior. Add sequential, ambiguity, and multiprocessing regressions.

Co-Authored-By: Codex <[email protected]>
@github-actions

Copy link
Copy Markdown

Thanks for the pull request, @adity982. A maintainer will review it soon.

Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions.

A couple of things that speed up review: make sure the test suite passes on Python 3.11 and 3.13, and that the change keeps extraction deterministic.

adity982 and others added 2 commits November 17, 2026 22:54
Scope the Pascal corpus context in sequential extraction so the existing three-argument extraction helper remains compatible with wrappers and tests.

Co-Authored-By: Codex <[email protected]>
Scope the dispatched corpus in a context variable so parallel and sequential helper APIs retain their existing signatures. Process workers still receive the same selected corpus through their initializer.

Co-Authored-By: Codex <[email protected]>

This branch has not been deployed

No deployments
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.

Pascal: _pascal_project_root stops at the project subdirectory in the conventional Delphi layout, so cross-directory uses never resolve

1 participant