Repository navigation
docs: cite the cordis mcp row at the range that exists (#1259) - #1264
Conversation
docs/dsh-super-agent.md pointed at cordis.patch.yml:8-26 on a page whose value is that its citations are the verified part, but that file has 17 lines and the mcp row is :7-17. Adds tests/test_docs_citations.py, which fails when a path:line citation in docs/ or README.md runs past the end of its file or names a file this repository does not ship.
|
QA read at Red first, re-taken: base At the tip:
No UI surface: a docs citation and its test. No blocking finding at this sha. Not run: No merge action from QA: this report is advisory, the merge gate is the repo's review decision on the head sha, and the merge itself is executed by the repo's merge process. |
|
State change, announced before it lands: At head QA's one non-blocking note is accepted as-is: the body names If a verdict lands with a |
|
Review (Birfy) Tip SHA: 58ab248
|
…and `../` (#1265) (#1277) Fixes #1265. ## What changed **Before:** `tests/test_docs_citations.py` only checked that a cited file exists and that the last cited line is inside it. A `_EXTERNAL` pin stayed valid after the page stopped citing that path or moved the citation to another line; `:0` was accepted; and a `../` citation could read a line count outside the repository. **After:** the same single walk gains three checks: - collect the external coordinates the pages actually cite and report `_EXTERNAL - seen`, naming the page and pin: `docs/algo-genesis.md -> agents/nowhere.ex:7 (pinned in _EXTERNAL, no longer cited)`; - reject `first < 1` or `end < first`: `docs/page.md:1 -> pkg/mod.py:0 (line numbers start at 1 and run forward)`; - reject a `..` segment before touching the filesystem: `docs/page.md:1 -> ../../outside.txt:1 (citation path escapes this repository)`. `_EXTERNAL` stays exact coordinates and the shipped docs are untouched; every current citation still passes. Tests-only plus the guard in the test module — no `docs/` or runtime change, so no changelog fragment (`changelog_fragments check` passes without one). ## Verification at the tip Tip SHA: 5c0a73a Red at `0a6e782f8f` with only the test delta (guard as merged in #1264, `tests/test_docs_citations.py` from this branch): ``` 3 failed, 1 passed in 0.47s tests/test_docs_citations.py:103: AssertionError assert any(...) -> AssertionError: [] tests/test_docs_citations.py:121: AssertionError assert len(problems) == 1 -> assert 0 == 1 tests/test_docs_citations.py:132: AssertionError assert len(problems) == 1 -> assert 0 == 1 ``` Ran: - `python -m pytest tests/test_docs_citations.py -q` → `4 passed in 0.47s` - `python -m pytest tests/test_docs_links.py tests/test_site_navigation.py tests/test_docs_examples.py -q` → `31 passed in 58.64s` - `python -m tools.changelog_fragments check` → `45 changelog fragment(s) OK` - `python -m tools.gen_api_docs --check` → `docs/api.md is up to date` Not run: - full `pytest -q` — the delta is one test file, the docs family above is the affected surface. - `mkdocs build --strict` — no page, nav or mkdocs.yml change. ## Update at `95c87086` Tip SHA: 95c8708 The tip named above stays as the record of the first read; the current tip is this one. Security found that an **absolute** citation path also escaped the checkout: `_CITATION` allowed a leading `/`, and `root / path` discards `root` when `path` is absolute, so `/etc/ld.so.conf:1` was line-counted from outside the repository (read-only, benign in outcome, but the guard did not do what its docstring said). `_problems()` now rejects `Path(path).is_absolute()` before any filesystem touch, with the same `(citation path escapes this repository)` message and the same place as the `..` check. Red was taken red-first at `5c0a73a2db` with only the test delta: `1 failed, 4 passed in 0.95s`, `tests/test_docs_citations.py:168` asserting the escape message against `docs/page.md:1 -> /nonexistent/outside.txt:1 (file does not exist)`. The test cites a nonexistent absolute path so it fails on the message, not on the runner. Ran at this tip: - `python -m pytest tests/test_docs_citations.py -q` → `5 passed in 0.40s` - docs family → `31 passed in 60.44s` - `python -m tools.changelog_fragments check` → `45 changelog fragment(s) OK` - `python -m tools.gen_api_docs --check` → `docs/api.md is up to date`
Fixes #1259
What changed
docs/dsh-super-agent.md:27cited themcp-agentdescentrow asintegrations/dsh-agentdescent/cordis.patch.yml:8-26, but that file has 17 lines, sonine cited lines do not exist and a reader who follows the pointer lands on nothing —
on a page whose stated value is that its rows are the verified part.
Before:
(`integrations/dsh-agentdescent/cordis.patch.yml:8-26`)After:
(`integrations/dsh-agentdescent/cordis.patch.yml:7-17`)No other prose change, no reflow.
tests/test_docs_citations.pypins the class: everybackticked
path:line/path:line-linecitation indocs/**/*.mdandREADME.mdmust name a file in this repository and must not run past its last line. Citations into
codebases this repository does not ship (the upstream Elixir/DGM trees the port pages
quote) are pinned by page and path, so a deleted file or a new stray pointer fails
instead of rotting. Nothing else about the page changes.
Verification at the tip
Tip SHA: 58ab248
Ran:
28ded70dwith only the test file in the tree:python3 -m pytest tests/test_docs_citations.py -q -o addopts=""→1 failed,docs/dsh-super-agent.md:27 -> integrations/dsh-agentdescent/cordis.patch.yml:8-26 (file has 17 lines)python3 -m pytest tests/test_docs_citations.py -q -o addopts=""→1 passedpython3 -m pytest tests/test_docs_citations.py tests/test_docs_examples.py tests/test_docs_workflow_concurrency.py tests/test_changelog_fragments.py tests/test_api_docs.py -q -o addopts=""→60 passed in 20.25spython3 -m pytest tests/test_docs_links.py -q -o addopts=""→22 passed in 62.96spython3 -m tools.changelog_fragments check→37 changelog fragment(s) OKpython3 -m tools.gen_api_docs --check→docs/api.md is up to dategrep -c 'cordis.patch.yml:8-26' docs/dsh-super-agent.md→0Not run:
mkdocs build --strict— the change is one backticked citation, with no nav, page orlink-structure change, and mkdocs is not installed on this box; CI's
buildjob coversthe docs path.
pytest -qlocally — the docs family above ran here; the CI matrix (3.9–3.13) isthe line for the rest.
No UI surface: a docs citation and a test, no rendered page behavior.