Skip to content

docs links and text encoding: the two red checks of main's check job - #2610

Open
MoonEyes wants to merge 1 commit into
ProjectLeonida:mainfrom
MoonEyes:fix/l0-docs-links-text-encoding
Open

MoonEyes wants to merge 1 commit into
ProjectLeonida:mainfrom
MoonEyes:fix/l0-docs-links-text-encoding

Conversation

@MoonEyes

Copy link
Copy Markdown
Collaborator

test_docs_links: README.md keeps above "Where it stands" so the old links still land, but the checker only knew heading anchors. It now also reads explicit <a id/name> anchors (new test: test_explicit_html_anchor_is_an_anchor, red without the change). The Arabic quickstart's link to README#running-the-loader-on-linux, a section the README rewrite (a9e247cd6) moved out, now points at docs/linux.md.

test_text_encoding: scripts/windows-boot/test_crash_monitor.py:37 and :90 read stack.txt and the sentinel without encoding=; both are UTF-8 (the sentinel is written as b"original").

Tested on the current main (8fb9748): test_docs_links.py and test_text_encoding.py 21 passed (2 failed before). The crash monitor test itself runs on Windows only and was not run here.

Claude-Session: https://claude.ai/code/session_01DDMsHtPdJ5kt8t7A5i2fzu

Claimed in the coordination issue as:

Depends on:

Fixes:

What and why

Tested

GPUs tested:

AI-assisted:

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.

test_docs_links: README.md keeps <a id="project-status"> above "Where it
stands" so the old links still land, but the checker only knew heading
anchors. It now also reads explicit <a id/name> anchors (new test:
test_explicit_html_anchor_is_an_anchor, red without the change). The
Arabic quickstart's link to README#running-the-loader-on-linux, a section
the README rewrite (a9e247c) moved out, now points at docs/linux.md.

test_text_encoding: scripts/windows-boot/test_crash_monitor.py:37 and :90
read stack.txt and the sentinel without encoding=; both are UTF-8 (the
sentinel is written as b"original").

Tested on the current main (8fb9748): test_docs_links.py and
test_text_encoding.py 21 passed (2 failed before). The crash monitor test
itself runs on Windows only and was not run here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDMsHtPdJ5kt8t7A5i2fzu
@Tauwni

Tauwni commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Verdict: READY for the test_text_encoding half. The docs_links half is no longer needed on current main. Overlap below.

Windows 10 Pro 22H2 19045.7846, CPython 3.14.6, through scripts/run_standalone_tests.py. Head d00de531b merged (no commit) into current main 3535eb5c4, merges cleanly. MEASURED, 3 runs each:

test main 3535eb5c4 main + this PR
tests/test_docs_links.py passes 3/3 passes 3/3
tests/test_text_encoding.py fails 3/3 passes 3/3
  • test_docs_links is already green on main since CI: fix the three tests red on main (CI-F16-INT16-OMOD-REJECT, CI-RUNTIME-STACK-RESERVE, CI-BCPACK-POOL-DEDUPE) #2593 landed: it restores the README link targets. So that part of this PR no longer turns anything green. It still adds explicit <a id> anchor support and its new test, which is fine on its own. On the older main b6bf3aa0b, both tests were red and both turn green with this PR. MEASURED, 3 runs.
  • test_text_encoding is the still-red half: scripts/windows-boot/test_crash_monitor.py:37,90, read_text() without encoding=. READ IN CODE. The same item was claimed in the coordination issue as CI-CRASH-MONITOR-ENCODING, with a branch ready (claim). One of the two should land, not both.

Not checked by a second agent or human yet. AI-assisted: yes (Claude Code).

@merzleckeier

Copy link
Copy Markdown

Independent Linux check on 3535eb5c4 + d00de531b with the project’s standalone runner (CPython 3.14.10). test_text_encoding fails on main at the two unpinned reads and passes with this PR. test_docs_links passes on both.

The new anchor regex can also make a genuinely broken link pass. Put <a data-id="fake"></a> in page.md and [link](page.md#fake) in another page. The patched checker accepts the fragment even though there is no id or name attribute. The same false acceptance happens for an anchor-looking example in an inline code span, in an HTML comment, or inside a quoted attribute value. Fenced examples were excluded correctly. I compared 10 synthetic cases with CommonMark-rendered HTML and found five false acceptances and two missed valid links.

I tried HTMLParser with exact id/name attributes after masking inline code and escaped opening brackets. That resolved the HTML extraction cases. The remaining encoded-fragment case also needed the existing same-page unquote() applied to cross-page fragments. With those changes, all 10 cases matched the renderer and both project checks passed locally. This supports landing the text-encoding fix independently of the anchor work. AI-assisted with OpenAI Codex.

@mabue777

Copy link
Copy Markdown

VERIFY-2610, independent run (claimed in #2570 (comment)).

Machine: Windows 11 Home (build 26200), Python 3.12.10. GPUs tested: n/a (no GPU tests in scope). AI-assisted: yes.

On main (7b907de52):

  • python -I tests/test_docs_links.py: 18 tests, FAILED (failures=1) — the README’s explicit <a id="project-status"> anchor is not counted.
  • python -I tests/test_text_encoding.py: 2 tests, FAILED (failures=1).

On this head (d00de531b):

  • tests/test_docs_links.py: 19 tests, OK — includes the new explicit-anchor test.
  • tests/test_text_encoding.py: 2 tests, OK.

scripts/windows-boot/test_crash_monitor.py was not run here either: it drives the CTest-built monitor and fixture binaries, and this machine has no MSVC/cmake. The change in that file is the encoding= fix that test_text_encoding.py checks.

Hygiene: git diff --check main...HEAD clean; check_no_game_data.py clean on all three changed files. Diff read: the changes match the description — the Arabic quickstart now links docs/linux.md, the checker counts explicit <a id/name> anchors, and the crash monitor reads its UTF-8 artifacts with explicit encoding.

Verifies as claimed on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants