Skip to content

docs: cite the cordis mcp row at the range that exists (#1259) - #1264

Merged
Birfy merged 1 commit into
mainfrom
agent/1259-cordis-citation
Nov 25, 2026
Merged

Birfy merged 1 commit into
mainfrom
agent/1259-cordis-citation

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1259

What changed

docs/dsh-super-agent.md:27 cited the mcp-agentdescent row as
integrations/dsh-agentdescent/cordis.patch.yml:8-26, but that file has 17 lines, so
nine 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.py pins the class: every
backticked path:line / path:line-line citation in docs/**/*.md and README.md
must 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:

  • red first, at base 28ded70d with 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)
  • at the tip, python3 -m pytest tests/test_docs_citations.py -q -o addopts="" → 1 passed
  • at the tip, python3 -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.25s
  • at the tip, python3 -m pytest tests/test_docs_links.py -q -o addopts="" → 22 passed in 62.96s
  • python3 -m tools.changelog_fragments check → 37 changelog fragment(s) OK
  • python3 -m tools.gen_api_docs --check → docs/api.md is up to date
  • grep -c 'cordis.patch.yml:8-26' docs/dsh-super-agent.md → 0

Not run:

  • mkdocs build --strict — the change is one backticked citation, with no nav, page or
    link-structure change, and mkdocs is not installed on this box; CI's build job covers
    the docs path.
  • full pytest -q locally — the docs family above ran here; the CI matrix (3.9–3.13) is
    the line for the rest.

No UI surface: a docs citation and a test, no rendered page behavior.

@HugoXK HugoXK added area:docs Documentation site (docs/, mkdocs.yml) and README documentation Improvements or additions to documentation labels Nov 24, 2026
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.
@HugoXK

HugoXK commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

QA read at 58ab248e980acdd3a8958bd3fea721e541218e41 (API head read at Date 22:14:18 GMT and 22:21:11 GMT; draft, base e6c01493371a9a1f9cf921705fd8c9f9f49b609f, 3 files +89/−1). Fresh shallow clone of head and base; the head is the tree measured. Body Tip SHA: matches the head.

Red first, re-taken: base e6c01493 with only tests/test_docs_citations.py added → 1 failed in 2.45s, message verbatim docs/dsh-super-agent.md:27 -> integrations/dsh-agentdescent/cordis.patch.yml:8-26 (file has 17 lines). Non-blocking note: the body names 28ded70d as its red base; that is the parent of the PR base (one CI-workflow commit apart), and the test fails identically at the current base.

At the tip:

  • integrations/dsh-agentdescent/cordis.patch.yml is 17 lines and the mcp-agentdescent row spans lines 7-17, so the new citation names the row exactly. grep -c 'cordis.patch.yml:8-26' docs/dsh-super-agent.md → 0; the page now cites :7-17. The docs diff is that single line, no reflow.
  • pytest tests/test_docs_citations.py → 1 passed in 5.97s
  • family the body names → 60 passed in 12.53s (claim 60)
  • changelog_fragments check → 37 changelog fragment(s) OK (claim 37); the fragment describes the fix and the guard
  • gen_api_docs --check → docs/api.md is up to date
  • the guard bites on new rot, not only this line: in a scratch tree at the head, adding agentdescent/nope.py:3 and agentdescent/dataloader.py:90000 to a page → 1 failed, reporting file does not exist and file has 494 lines; restored → 1 passed.

No UI surface: a docs citation and its test.

No blocking finding at this sha.

Not run: tests/test_docs_links.py and full pytest -q (markdown is not installed here), mkdocs build --strict (mkdocs is not installed).

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.

@HugoXK

HugoXK commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

State change, announced before it lands: draft true → false on this PR. No push, no rebase, no body edit.

At head 58ab248e980acdd3a8958bd3fea721e541218e41 the gate set is complete: 12/12 checks green (test ×5 success, build, otel-wire, risk tier, reviewed tip, plan; deploy + apply labels skipped), QA read comment 7146135039 with no blocking finding at this sha, security review no finding at this head.

QA's one non-blocking note is accepted as-is: the body names 28ded70d as its red base, which is the parent of this PR's base e6c01493; the red row was re-taken on the current base and fails identically, so nothing in the body is false and it is not being rewritten.

If a verdict lands with a file:line finding at this head, the fix goes on this same branch and the new sha comes with a fresh request.

@HugoXK
HugoXK marked this pull request as ready for review November 24, 2026 22:23
@github-actions github-actions Bot added risk:T1 Risk tier T1 (tests, examples, changelog.d), set by the controller from the diff agent-pr Pull request opened by an agent labels Nov 24, 2026
@Birfy

Birfy commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Review (Birfy)

Tip SHA: 58ab248
Ran:

  • .github/scripts/risk_gate.py --repo ThinkFlowLab/agentdescent --pr 1264 → T1
  • cherry-pick of this tip onto current main 2dd92cb0a6d5f8cd55ec6bd64dfd39415f5991e9 applied cleanly
  • pytest -q -o addopts='' 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 tests/test_docs_links.py on that tree → 82 passed
  • python -m tools.changelog_fragments check → 44 changelog fragment(s) OK
  • python -m tools.gen_api_docs --check → docs/api.md is up to date
    Not run:
  • Full offline suite locally — the CI test matrix is the line
  • mkdocs build --strict — no nav or page-structure change; CI build covers the docs path
    Findings:
  • No actionable defects. The cordis mcp row on current main is lines 7–17 of a 17-line file, so the citation fix lands on the range that exists. The new guard fails when a backticked path:line citation in docs/ or README.md runs past EOF or names a missing in-repo file, with upstream Elixir/DGM pointers pinned in _EXTERNAL.
    Verdict: PASS

@Birfy Birfy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: PASS at 58ab248

@Birfy
Birfy merged commit 17e779b into main Nov 25, 2026
15 checks passed
@Birfy
Birfy deleted the agent/1259-cordis-citation branch November 25, 2026 04:22
Birfy pushed a commit that referenced this pull request Nov 25, 2026
…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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-pr Pull request opened by an agent area:docs Documentation site (docs/, mkdocs.yml) and README documentation Improvements or additions to documentation risk:T1 Risk tier T1 (tests, examples, changelog.d), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: the dsh agent page cites a line range past the end of cordis.patch.yml

2 participants