Skip to content

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

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

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
Contributor

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.

@fiestorra

Copy link
Copy Markdown
Contributor

Heads-up on duplication, because two open pull requests change the same two lines of the same file.

This one sets read_text(encoding="utf-8") in scripts/windows-boot/test_crash_monitor.py. #2616 does the same, with one difference:

2610:  (self.report / "stack.txt").read_text(encoding="utf-8")
2616:  (self.report / "stack.txt").read_text(encoding="utf-8", errors="replace")

Both clear the same assertion (test_every_text_file_call_pins_its_encoding), which is the one keeping check, stdlib-tests-linux and macos-python red on
main; whichever lands first makes the other's hunk a textual conflict on the same lines.

Since this pull request also carries the docs-links part (docs/i18n/ar/quickstart.md, tests/test_docs_links.py), the clean split is: this one takes the
docs-links fix and drops its test_crash_monitor.py hunk
, leaving the encoding to #2616 - whose errors="replace" also covers a stack file whose module names
were decoded through the code page, which is the case the test is about.

Not a claim on either: I verified #2616's head passes tests/test_text_encoding.py and left the decision to whoever owns the two branches.

Written with an AI assistant.

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 29, 2026
@aegish-zagi

Copy link
Copy Markdown
Contributor

VERIFY-2610 (independent verification, aegish-zagi)

  • PR: docs links and text encoding: the two red checks of main's check job #2610 | head d00de531b | merge state vs main: DOES NOT MERGE CLEANLY onto current main c2a726196 — content conflict in scripts/windows-boot/test_crash_monitor.py
  • What happened: main has already landed a stronger version of the same line — read_text(encoding="utf-8", errors="replace") — while this PR pins only encoding="utf-8". python3 -I tests/test_text_encoding.py passes on plain current main, so the crash-monitor half of this PR is superseded.
  • Tests run on the PR head alone: tests/test_docs_links.py 19 tests OK; tests/test_text_encoding.py 2 tests OK. On plain main both also pass.
  • Remaining value: the docs/i18n/ar/quickstart.md link fix and the test_docs_links.py additions are not in main; they pass on the PR head.
  • Platform: Linux, Python 3.12.3, no GPU (Profile Z)
  • AI-assisted: yes

Verdict: needs rebase — drop the test_crash_monitor.py hunk (already fixed on main, in a stronger form) and keep the docs-link parts.

@fiestorra

Copy link
Copy Markdown
Contributor

Status on this machine: it does not apply, and unlike the pull requests where only the replay failed, here merge-tree fails too - GitHub could not merge this as it stands.

git merge-tree --write-tree origin/main refs/pull/2610/head
  Auto-merging docs/i18n/ar/quickstart.md
  Auto-merging scripts/windows-boot/test_crash_monitor.py
  CONFLICT (content): Merge conflict in scripts/windows-boot/test_crash_monitor.py

Cherry-picking d00de531b stops on the same file, so I could not run tests/test_docs_links.py against it.

What is worth saying about the change itself: the commit is "the two red checks of main's check job", and it touches three files - the Arabic quickstart, tests/test_docs_links.py, and scripts/windows-boot/test_crash_monitor.py. That last one is a script with a test_ prefix, not a test, and main has since moved under it: the file is the one that collided, so whatever fix it carried has almost certainly landed elsewhere in the meantime.

What a rebase would do: it would tell us in one minute whether the fix is still needed at all. If main's check job is green today for those two checks, this pull request is obsolete rather than conflicted, and closing it is cleaner than resolving it. I could not check that from here - it needs the CI run on current main, which takes the workflow, not this machine.

What I did not do: resolve the conflict. A conflicting script whose fix may already exist elsewhere is exactly the case where a stranger's resolution would look right and be wrong.

Written with an AI assistant.

@MoonEyes

Copy link
Copy Markdown
Collaborator Author

Closing my own pull request: on main ec1d85846 the link in docs/i18n/ar/quickstart.md is right and scripts/windows-boot/test_crash_monitor.py pins its encoding. What is left is an anchor case in tests/test_docs_links.py that no page needs (check is green on main).

AI-assisted (Claude Code). Closed at the owner's request (MoonEyes).

@MoonEyes MoonEyes closed this Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants