loopx icon indicating copy to clipboard operation
loopx copied to clipboard

[Bug]: docs governance smoke fails on Windows - hosted-docs nav parity compares backslash paths against POSIX mkdocs nav keys

Open JasonBuildAI opened this issue 1 month ago • 0 comments

Preflight

  • [x] I searched existing issues and discussions for this behavior.
  • [x] This report is not an unpatched security vulnerability.
  • [x] The report and attachments contain no credentials or private/internal material.

Issue origin

Observed or reproduced in a real environment

LoopX version or commit

c2b17b3e1 (upstream main)

Host or runtime surface

Other - native Windows 11, PowerShell, cp936 default code page

LoopX area

Build, packaging, installer, or CI

Problem

examples/docs-governance-smoke.py cannot run on native Windows. In assert_hosted_docs_nav_parity() the docs-relative key for each link in docs/index.md and docs/README.md is built with str(resolved.relative_to(DOCS.resolve())). On Windows that returns backslash-separated text (guides\getting-started.md), while mkdocs_nav_paths() parses forward-slash paths out of mkdocs.yaml (guides/getting-started.md). The two keys can never compare equal, so a link that is correctly listed in the nav is reported as missing:

docs/index.md links to guides\getting-started.md, which is missing from mkdocs.yaml nav and has no allowlist reason

The report is a false positive, and it aborts main() before the checks that follow assert_hosted_docs_nav_parity() (RFC status index rules, contributor board anchors, technical-direction governance). On Windows the documented docs/RFC governance validation is therefore unusable, and the message sends the contributor looking for a nav entry that is already present.

No workflow in .github/workflows/ invokes this smoke, so the path is green in CI: pytest runs on ubuntu-latest, and the windows-powershell job runs a curated Windows subset that does not include it.

Minimal reproduction

On a native Windows host, from the repository root:

uv run --extra test python examples/docs-governance-smoke.py

Observed with Python 3.12 (default code page cp936) on Windows 11: it exits 1 in assert_hosted_docs_nav_parity().

Expected behavior

A docs/index.md or docs/README.md link that is present in mkdocs.yaml nav passes the parity check on every platform, and the smoke proceeds to the later checks. The key is a repository-relative path, so its form should not depend on the host separator.

Actual behavior

str(resolved.relative_to(DOCS.resolve())) yields guides\getting-started.md on Windows, which is not in the nav set parsed from mkdocs.yaml, so assert_path_in_nav_or_allowlisted() fails with "missing from mkdocs.yaml nav and has no allowlist reason".

Sanitized diagnostics

$ uv run --extra test python examples/docs-governance-smoke.py
Traceback (most recent call last):
  File "examples/docs-governance-smoke.py", line 1192, in main
    assert_hosted_docs_nav_parity()
  File "examples/docs-governance-smoke.py", line 601, in assert_hosted_docs_nav_parity
    assert_path_in_nav_or_allowlisted(
  File "examples/docs-governance-smoke.py", line 572, in assert_path_in_nav_or_allowlisted
    assert reason, (
AssertionError: docs/index.md links to guides\getting-started.md, which is missing from mkdocs.yaml nav and has no allowlist reason

Paths above are repository-relative; the local worktree path was removed.

Additional context

The two affected lines are the only separator-sensitive comparison keys in that function; the other relative_to() uses in the file are error-message text. Repository convention for these repository-relative keys is Path.relative_to(...).as_posix() (for example loopx/canary/maintainability_ratchet.py, loopx/canary/runner.py, scripts/chat_bundle.py, scripts/generate_semantic_bindings.py). Replacing str(...relative_to(...)) with ...as_posix() at both sites makes the smoke print docs-governance-smoke ok on this host.

JasonBuildAI avatar Oct 10 '26 10:10 JasonBuildAI