* Revert "completions: check reference visibility through typed list hooks only (#5244)"
This reverts commit 94c5a21229.
* Revert "completions: answer only references the caller can list (#5240)"
This reverts commit 0959c275c1.
* tests: guard completion against middleware side effects
The reverted visibility checks regressed twice in ways the completion
tests did not catch: 4.0.6 made generic middleware see extra list
requests per completion, and 4.0.7 let a response cache store an
unfiltered listing that other clients were served. These tests pin the
restored behavior so a future visibility check cannot bring either back.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KfHgVhbYEhBCC5eSeqGiuG
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>