Repository navigation
fix(docs): reject hard-linked Markdown inputs in both offline link scanners - #382
Conversation
drevendev
left a comment
There was a problem hiding this comment.
Bounded exact-head content review — COMMENT (not an independent approval)
Reviewed HEAD: e90b4dc039648a4eb96ca91d1bcdbacfc6dc34aa; base ccf6a5ea01fb3cade75db497c16d132b84de8d54. This PR is open and non-draft; no prior submitted reviews or unresolved review threads were present at the final read.
Judgement: I found no blocking defect within the stated stable-checkout read-boundary change. In the two changed scanner call paths, the shared read_markdown_source() performs an lstat regular/single-link check before opening, a descriptor-level fstat check after opening, and O_NOFOLLOW where available. The HTML/fragment parser now uses that same boundary for Markdown anchor targets instead of read_text(). This is a deliberately conservative rejection policy; it is not proof against concurrent filesystem substitution, and the PR documents that limit without claiming a sandbox.
Exact-file reconciliation: the three copies of docs_links.py all have Git blob 479f8aa507605558bb3582bbde9b1bc5c6d35975; the three copies of html_navigation.py all have blob 48d887fcaf318f6edb03d5f8d97a53e2b5f02784. The bounded two-file test additions cover a linked Markdown source and an HTML anchor target; the changelog and tools documentation describe the same limited behavior.
Observed hosted evidence at this HEAD: Quality checks passed Python 3.11, Python 3.14, Python 3.14 Windows, both Action self-tests and lint. I inspected their job logs: both newly added test_hardlink_* cases report ok on Linux and Windows (not skipped); 836 unit tests were run on each interpreter job, with unrelated platform/tag skips. The unchanged normal-link self-checks also passed (621 Markdown destinations, 641 HTML/fragment destinations). Three additional HEAD-associated workflows succeeded: skills CLI copy trial, synthetic browser evidence and optional MCP smoke. This is hosted evidence inspection, not an independently executed local or adversarial-concurrency test.
Acceptance boundary: authenticated PR author and reviewer are both drevendev. This COMMENT is a source/evidence judgement only; it does not provide actor-separated approval, a provider-enforced acceptance gate, a security certification or permission to merge. A later eligible reviewer should independently make the formal acceptance decision.
andy-zen-dev
left a comment
There was a problem hiding this comment.
Independent exact-head review — APPROVE
Reviewed head: e90b4dc039648a4eb96ca91d1bcdbacfc6dc34aa (not a self-review).
I inspected the changed scanner implementation, both call sites (Markdown destinations and HTML/fragment anchor targets), new regression tests, changelog and tool documentation, plus current AGENTS.md and CONTRIBUTING.md. The shared reader rejects non-regular / multi-linked sources before open, checks the opened descriptor again, and uses O_NOFOLLOW where available. The HTML parser now uses this boundary for Markdown anchor targets. All three docs_links copies match blob 479f8aa507605558bb3582bbde9b1bc5c6d35975, and all three html_navigation copies match blob 48d887fcaf318f6edb03d5f8d97a53e2b5f02784.
Exact-head GitHub Actions Quality run https://github.com/drevendev/BeautifulRepo/actions/runs/43714262335 passed Python 3.11, Python 3.14, Windows Python 3.14, both Action self-tests, and lint. I checked Python job logs: both new hard-link regressions actually executed and passed on Windows and Linux (not skipped). The existing scanner checks also passed (621 Markdown and 641 HTML/fragment destinations); the other HEAD-associated workflows reported success.
No merge-blocking finding in the stated stable-checkout scope. This is not an adversarial-concurrent-filesystem guarantee or proof of real Claude Code/Codex agent behavior. Reviewer-local full-suite execution: not_run; this verdict uses independently inspected source and hosted exact-head evidence.
Reader-facing problem
The standalone
docs_links.pyandhtml_navigation.pyscanners opened Markdown viaPath.read_text()after source-path resolution. A hard link is an ordinary regular-file path, so an alias inside a repository can read the bytes of a file outside that checkout. The experimental MCP adapter has its own preflight, but the standalone checkers and bundled skill-local tools did not.Change
docs_links.read_markdown_source: refuse symlink/reparse, special and multi-linked files before opening; recheck the open file descriptor and useO_NOFOLLOWwhere available.Acceptance
docs_links.pycopies and all 3html_navigation.pycopies remain identicalNo user files or credentials involved. No new runtime dependencies. No provider release, admin or settings change. CI evidence on this PR is required; locally no full clone was available due DNS.