Skip to content

test(ingest): compare the symlink target against what readlink returned before - #4442

Closed
bercedev wants to merge 1 commit into
Graphify-Labs:v8from
bercedev:fix/readlink-test-windows
Closed

bercedev wants to merge 1 commit into
Graphify-Labs:v8from
bercedev:fix/readlink-test-windows

Conversation

@bercedev

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #4435.

test_binary_captures_skip_existing_entries ends its symlink cases with occupied.readlink() == sentinel. On Windows readlink() returns the target in extended-length form (\\?\C:\...), so that comparison is false for dangling_link-False, dangling_link-True and live_link-True, even though the capture left the link alone.

The test now reads the target right after it creates the link and compares against that value at the end. That is what "the existing link is untouched" means, and it doesn't depend on how a platform spells the path, so there is no prefix stripping and no separate UNC case.

Test only, no change under graphify/.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Tests or CI
  • Refactor
  • Security fix

Verification & Invariants

The test still fails if ingest replaces the link (is_symlink() goes false) or repoints it (readlink() changes).

  • Read the CONTRIBUTING.md guide.
  • Reproduced the issue and identified the invariant.
  • Made the smallest fix necessary.
  • Added a regression test (if bug fix) or isolated boundary test.
  • Kept the PR description synchronized with the final implementation.
  • Documented any limitations / unsupported cases explicitly.

Limitation: I don't have a Windows machine, so I have not run this there. The failure is the one described in the issue, and the new comparison uses the same call on both sides.

How was this tested?

uv run --frozen pytest tests/test_ingest_url_type.py -q
40 passed

Linux, Python from the repo's uv.lock.

Graphify-specific checklist

  • I updated generated skill artifacts (uv run python -m tools.skillgen --bless) when changing their source fragments.
  • I confirmed that AST/structural extraction remains deterministic (no ambient state dependencies like ENV variables).
  • I reviewed changes for security implications (no unsafe interpolation into shell/Python).
  • I confirmed no API keys or local-only graph data are included.
  • (If applicable) I disclosed AI authorship in my commit messages.

Note: I used Claude Code while working on this fix. I reviewed and ran all of it myself.

…ed before (Graphify-Labs#4435)

On Windows readlink() returns the target as \\?\C:\..., so comparing it to
the plain sentinel path failed three parameters of
test_binary_captures_skip_existing_entries even though the capture left the
link alone. Read the target right after creating the link and compare against
that, which is what "untouched" means on every platform.
@bercedev
bercedev requested a review from safishamsi as a code owner October 13, 2026 22:11
@github-actions

Copy link
Copy Markdown

Thanks for the pull request, @bercedev. 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.10 and 3.13, and that the change keeps extraction deterministic.

@github-actions github-actions Bot added the contributor Pull request from a returning community contributor label Oct 13, 2026

@graphify-labs graphify-labs Bot 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.

Graphify reviewed this change.

Code graph out of date: Health delta baseline: last indexed commit e8eb76e, 18 commit(s) behind this PR's base. Impact and hotspot numbers below may be wrong.

No verdict: the code graph is out of date. Static checks found no blocking issues, but they compared against an outdated graph. The next push after the repository re-indexes gets a full review.

Not checked: tests were not run; no formal proof of the changed code.


Graphify review — findings

Fixes the symlink case of test_binary_captures_skip_existing_entries on Windows by recording the link target right after creating it and asserting it is unchanged. The old check compared against sentinel directly, but Windows reads targets back as \\?\C:\..., which never matches.

No blocking issues surfaced.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 19 functions depend on the 19 functions this change touches.

Health — grade A; no new coupling hotspots.

Verification — 19 functions in the blast radius were not formally verified this run (proofs are advisory here).

Health delta baseline: last indexed commit e8eb76e, 18 commit(s) behind this PR's base.

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 19 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

1 of 412 test file(s) selected (0%) via static blast radius.

  • tests/test_ingest_url_type.py — changed-test

Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.

safishamsi added a commit that referenced this pull request Oct 14, 2026
Eight community PRs: Windows MCP-stdio hang (#4441), Rust use->declaration
(#4443), JS/TS file-scope callback param shadowing (#4457), sibling-file-id
symbol retention (#4452), TS class-field receiver scoping (#4297), Ollama
/api/chat num_ctx (#4414), cluster label retention on majority overlap (#4451),
and an ingest symlink test fix (#4442). AST cache schema bumped to 16.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@safishamsi

Copy link
Copy Markdown
Member

Landed in 0.9.91 as e7772b2 (cherry-picked with your authorship preserved, so it shows on your contributions). Thanks @bercedev! Released to PyPI: https://pypi.org/project/graphifyy/0.9.91/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor Pull request from a returning community contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_binary_captures_skip_existing_entries fails on Windows: readlink() returns a \\?\ extended-length path

2 participants