Skip to content

docs: narrow the stale PHP LIMITATION comment - #1486

Merged
vitali87 merged 1 commit into
mainfrom
fix/php-limitation-comment-stale
Aug 27, 2026
Merged

docs: narrow the stale PHP LIMITATION comment#1486
vitali87 merged 1 commit into
mainfrom
fix/php-limitation-comment-stale

Conversation

@vitali87

@vitali87 vitali87 commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Follow-up to #1484.

The problem

That PR made this comment false. It says cgr "does not track the namespace declaration" — which stopped being true the moment #1484 merged: php_module_namespaces records it, and _php_target_for_namespace_import binds through it.

The comment lives in _is_external_import, a different code path from the one the fix touched, so it survived the change and now asserts the opposite of code a few hundred lines away.

A comment contradicting its own module is worse than no comment — it is exactly the artifact a reader trusts when deciding whether a capability exists. It was also the comment I cited as motivation when opening #1185, so leaving it would misdirect the next person twice over.

Narrowed, not deleted

A real gap remains and is worth naming: a target whose namespace no indexed module declares is still indistinguishable from a first-party one the resolver could not place, and both defer to the trie. Deferring stays correct there — treating it as external would suppress the trie fallback and drop the call.

Verified rather than reasoned

declared namespace (App.Text)  -> ('Function', 'proj.text.format')
UNdeclared namespace (Vendor)  -> None   (defers to the trie)

Comment-only change; no behaviour is touched.

Noted for completeness: ty check fails in this fresh worktree on unresolvable optional imports (numpy, qdrant_client, pymilvus). Zero of those errors are in the changed file — same worktree-venv gap seen on #1484, which passed once the extras were installed.

Summary by CodeRabbit

  • Documentation
    • Clarified internal documentation for PHP use function imports and namespace resolution.
    • Documented how unresolved namespace targets continue to use simple-name matching.

#1185 stage 1 made this comment false. It says cgr "does not track the
`namespace` declaration", which stopped being true when #1484 merged --
`php_module_namespaces` records it and `_php_target_for_namespace_import`
binds through it.

The comment sits in `_is_external_import`, a different path from the one the
fix touched, so it survived the change and now asserts the opposite of the
code a few hundred lines away. A comment contradicting its own module is
worse than no comment: it is the artifact a reader trusts when deciding
whether the capability exists.

Narrowed rather than deleted, because a real gap remains and is worth
naming: a target whose namespace NO indexed module declares is still
indistinguishable from a first-party one the resolver could not place, and
both defer to the trie.

Verified rather than reasoned:

    declared namespace (App.Text)  -> ('Function', 'proj.text.format')
    UNdeclared namespace (Vendor)  -> None   (defers to the trie)
@vitali87 vitali87 added the claimed An agent/session is actively working this — check before taking it over label Aug 27, 2026
@vitali87

Copy link
Copy Markdown
Owner Author

claimed by feat-duplicates-clickable-locations

@vitali87

Copy link
Copy Markdown
Owner Author

@greptileai review ac7517f

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eec6476b-a65d-4484-ad1e-a3c0fb579d07

📥 Commits

Reviewing files that changed from the base of the PR and between adfd124 and ac7517f.

📒 Files selected for processing (1)
  • codebase_rag/parsers/call_resolver.py

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change rewrites a comment in _is_external_import to document PHP namespace tracking and use function resolution. No code logic, control flow, or error handling changed.

Changes

PHP import resolution

Layer / File(s) Summary
Clarify PHP namespace import behavior
codebase_rag/parsers/call_resolver.py
The comment documents namespace tracking through import_processor.php_module_namespaces, binding through _php_target_for_namespace_import, and trie fallback for unresolved namespaces.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to ac751

This is a narrowly scoped documentation correction with no runtime behavior change, so no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the documentation-only change and follows the Conventional Commits format.
Description check ✅ Passed The description is detailed and covers the problem, narrowed scope, related issue, validation results, and test limitations. It does not use all template headings or checklist items, but it provides t…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is detailed and covers the problem, narrowed scope, related issue, validation results, and test limitations. It does not use all template headings or checklist items, but it provides the required context for this comment-only change.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/php-limitation-comment-stale

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@vitali87

Copy link
Copy Markdown
Owner Author

@greptileai review ac7517f

The previous attempt errored out rather than producing a verdict (reference 2ef4e931-aed2-4dd2-bb52-2f1055487658), so the Greptile 5/5 Gate is polling for a scored review that will never arrive. Re-requesting against the current head.

Everything else on this PR is green: zero failures, zero unresolved threads, and SonarCloud reports 0 issues analysed at ac7517f8 — the exact head, not a stale zero.

The change is comment-only. It narrows a LIMITATION note that #1484 falsified: the comment claims cgr "does not track the namespace declaration", which stopped being true when that PR merged. It survived because it sits in _is_external_import, a different code path from the one the fix touched.

Narrowed rather than deleted, because a real smaller gap remains and is worth naming — a target whose namespace no indexed module declares still defers to the trie. Verified by execution rather than reasoning:

declared namespace (App.Text)  -> ('Function', 'proj.text.format')
UNdeclared namespace (Vendor)  -> None   (defers to the trie)

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This comment-only change updates the PHP import-resolution limitation note to reflect current behavior. Direct execution confirmed that a use function import resolves to proj.text.format when its namespace is declared by an indexed module, while an undeclared namespace returns None and remains available to the existing trie fallback. No defects were found.

Confidence Score: 5/5

Safe to merge: the revised comment matches the observed PHP namespace-resolution behavior, and no executable code changed.

The focused resolver probe ran successfully against both the parent revision and the current revision, producing the expected declared- and undeclared-namespace results with no behavioral difference.

Files Needing Attention: None. codebase_rag/parsers/call_resolver.py was the only modified file and its updated documentation was verified.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the focused PHP namespace resolver probe under Python 3.12 against the parent revision 426075f.
  • Ran the same probe against the current revision using the same Python 3.12 environment.
  • Both runs returned a declared namespace of proj.text.format and an undeclared namespace of None, with the caller's trie fallback remaining available.
  • Compared the commit diff and confirmed it changes comment lines only, introducing no runtime behavior change.
  • Validation confirmed that declared_namespace_target binds a unique function and undeclared_namespace_target declines to bind, while the commit introduces no user-impacting runtime regression.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "docs: narrow the stale PHP LIMITATION co..." | Re-trigger Greptile

@vitali87
vitali87 merged commit bccc336 into main Aug 27, 2026
48 of 50 checks passed
@vitali87
vitali87 deleted the fix/php-limitation-comment-stale branch August 27, 2026 08:07
@vitali87 vitali87 removed the claimed An agent/session is actively working this — check before taking it over label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant