progress_dashboard: hide a whole drive path that contains spaces (DASH-SCRUB-SPACES) #1274
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1274"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-24T21:10:10Z.
Claimed in the coordination issue as: DASH-SCRUB-SPACES — https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7144496629
What and why
scrub()intools/progress_dashboard.pyreplaces absolute paths outside the repository, file name included, before a line of output reaches the dashboard page. A Windows path that contains a space was only replaced up to the space:cannot read D:\My work\shaders\<name>.fssmbecamecannot read <path> work\shaders\<name>.fssm, so a carved shader's name stayed in the text.test_progress_dashboard.pyshowed it by failing when the temp folder has a space in its name.D:\work\a.txt is not a folderis still<path> is not a folder, andD:/work/a.txt and tests/test_x.py failedis<path> and tests/test_x.py failed.D:/My work\fixtures\a.txt,D:\My work/stubs/a.spv), under the same rule, soD:\work\a.txt is 3/4 donekeeps its prose.Limits: an unquoted path whose last part has a space (
D:\My work\my file.txt) keeps the text after that last space, and so does a bareC:\Users\First Last. Text with a separator after a part with no dot or punctuation is replaced with the path (D:\work has 3/4 files). A folder name that has a dot right before a space (D:\My.data dir\x.fssm,D:\work\v1.2 build\x.fssm) ends the path, with either separator after it. POSIX paths are unchanged.Tested
Head
09ce9de4(the same-separator rule above, added after review), Windows 11, Python 3.12.4:python -I tests/test_progress_dashboard.py52 OK. The three new same-separator subtests fail ondb3f77d4.Head
db3f77d4, rebased onmaine18b59a5, same patch asf36f661e(git range-diff); it merges cleanly withmain747809e7. Windows 11, Python 3.12.4:python -I -B tests/test_progress_dashboard.py: 52 OK. With this test on the tool ofmaine48ff037, it has 11 failures, all intest_drive_paths_with_spaces_lose_their_whole_name.tests/test_docs_cli_flags.py,tests/test_text_write_line_endings.py,tests/test_ctest_registration.py,tests/test_ci_registration.pyandtests/test_docs_links.py: OK.tests/test_tool_stdout_encoding.pyfails intest_every_main_block_reconfigures_stdout, as onmaine18b59a5alone (three tools this change does not touch).compileall,git diff --checkandpython -I scripts/check_no_game_data.pyon the two files: clean.Earlier head, on Windows 11, Python 3.12.4, on
mainat6261ca91(f36f661e):python -I -B tests/test_progress_dashboard.py— 52 OK, and also withTEMPset to folders whose names have a space, accents, or both. With the new test and the tool from before this pull request, the new test has 11 failures (10 subtests and the Windows sibling case). The four mixed-separator cases fail on7c001c7f.os.namepatched toposix.main4a50cafc(52 OK), #1256 (c81b2daf, 59 OK), #625 (3c2ad30d, 57 OK) and #1001 (e98b345c, 52 OK) are clean.test_tool_stdout_encoding.py,test_text_write_line_endings.py,test_docs_links.py,test_docs_cli_flags.py,compileall,git diff --checkand the no-game-data check passed.GPUs tested: n/a (CPU-only synthetic tests).
AI-assisted: yes (Claude Code).
Checklist
mainand merges cleanly.Imported from ubiquitarianism/leonida. Originally posted by DeadlyChirp on 2026-11-24T21:36:31Z.
On Windows, the filename still appears in the dashboard when the drive prefix uses a forward slash and the rest of the path comes from os.path.join. I reproduced this on 7c001c7 with Python 3.12.10. From the repo root, run the following in Python:
The first call prints
cannot read <path> work\fixtures\example.txt. The second prints the expectedcannot read <path>. Both strings name the same external path, and the filename contains no spaces. The unquoted drive pattern picks a separator at the drive prefix and requires that same separator after the space. Could the continuation accept either Windows separator? The first call would make a regression test without touching the filesystem.AI-assisted review, verified locally with synthetic paths.
Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-24T21:49:50Z.
Thanks, reproduced on Windows 11, Python 3.12.4, and fixed in
f36f661e. The reverse case (D:\My work/stubs/<name>, the shapevk_pipeline_check.cppbuilds) leaked the same way, so it is covered too.D:\work\a.txt, then tests/test_x.py failedandD:\work\a.txt is 3/4 donekeep their prose.7c001c7fand pass now.tests/test_progress_dashboard.py52 OK, also withTEMPin folders with a space, accents, or both. Merged withmain4a50cafc, #1256, #625 and #1001: clean, 52, 59, 57 and 52 OK.test_tool_stdout_encoding.py,test_text_write_line_endings.py,test_docs_links.py,test_docs_cli_flags.py, the no-game-data check andgit diff --checkpass.AI-assisted: yes (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-25T19:50:28Z.
Rebased from
f36f661etodb3f77d4onmaine18b59a5, same patch (git range-diff): the two commits are unchanged. The old base was whytest_ctest_registration.pyfailed in this pull request's CI (vk_host_region_import_test.cpp:341); it passes on the new base. The mixed-separator case reported by DeadlyChirp is still fixed by the second commit (f36f661e, nowdb3f77d4).Windows 11, Python 3.12.4:
test_progress_dashboard.py52,test_ctest_registration.py5,test_ci_registration.py16 andtest_docs_links.py16 pass,test_docs_cli_flags.pyandtest_text_write_line_endings.pytoo. Not from this change:test_tool_stdout_encoding.py,test_bink_names.py,test_opus_tags.pyandtest_world_names.pyfail onmainalone as well, and the twocs_dpp_cmp.asmcases of the old CI run are unchanged onmain(not run here: nollvm-mc).AI-assisted: yes (Claude Code)
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-27T19:42:24Z.
Merge test and review, taken from the pool PRs MoonEyes had not checked yet. Main
ec91d695cmerged without conflict; the PR's test files run with the pins oftests/requirements.txton Windows 11, Python 3.12 (venv). AI-assisted (Claude Code, Claude Opus 5.5).scrub('D:/work/a.txt and tests/test_x.py failed')gives'<path> failed': the drive-path pattern (tools/progress_dashboard.py~153, themorepart) runs on over later prose that has the same separator, soand tests/test_x.pyis lost. It redacts too much, never too little, so nothing leaks, but the message goes. The tests only cover backslash paths; a forward-slash case like this one would catch it.limitis applied after the regex has run on the whole line, so bounding the input first would cap that.Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-28T15:52:12Z.
Thanks for the review. I fixed the same-separator case in
09ce9de45.An unquoted drive path went on over a space whenever a later word had the same separator. So
D:/work/a.txt and tests/test_x.py failedbecame<path> failed. Now the same separator continues a path only after a part with no dot or punctuation, which is the rule the other separator already used. So that line gives<path> and tests/test_x.py failed, andD:/work/a.txt is 3/4 donekeepsis 3/4 done.D:/My work/shaders/x.fssmis still hidden whole. The trade-off is a folder name with a dot right before a space (D:\work\v1.2 build\x.fssm): it now ends the path, as it did onmain. I updated the limits in the description.New subtests: the forward-slash line from your review, its backslash form,
D:/work/a.txt is 3/4 done, andD:/My work/Python 3.12 x/<name>(a dot inside the words still continues the path).I did not bound the input length here. I timed it on Windows: the slow inputs take the same time on
main. For example,D:/followed by 8,000a/parts (16 KB) takes about 2.9 s on both, and 4,000 parts take about 0.9 s. So the quadratic growth comes from the patterns that were already there, and bounding it is a separate change.Tested on Windows 11 with Python 3.12.4:
db3f77d45:python -I tests/test_progress_dashboard.pygave 52 OK. With the new subtests, 3 of them fail ('<path> failed' != '<path> and tests/test_x.py failed'and the like).09ce9de45: 52 OK.mainc1ecf04ed(clean):test_progress_dashboard.pyran 54 tests with 1 failure,test_default_repo_is_the_one_the_readme_clones. It fails the same way onmainalone (53 tests, 1 failure).test_text_write_line_endings.py3 OK,test_docs_links.py17 OK,test_docs_cli_flags.py4 OK.scripts/check_no_game_data.pyandgit diff --checkare clean.AI-assisted: yes
Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-28T22:10:21Z.
Author-side check (I opened this PR, so an independent test counts more):
09ce9de45merged (no commit) withmainaa918e5d9, Python 3.12.4, Windows 11, CPU only.python -I tests/test_progress_dashboard.py: 54 tests, 1 failure,test_default_repo_is_the_one_the_readme_clones. It fails the same way on plainmain(the README no longer clonesubiquitarianism/leonida), so it is unrelated.tools/progress_dashboard.pyback tomain,test_drive_paths_with_spaces_lose_their_whole_namefails on 12 of its lines (e.g.D:\My work\shaders\SENTINEL_...fssm).mainfailure.check_no_game_data.pyis clean."D:/" + "ab cd\\" * n): 45 ms at 1.5 KB, 0.7 s at 12 KB, against 2 ms onmain. Log lines are far shorter.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T00:43:59Z.
Independent verification on Windows 11 (
10.0.26200, x64) with09ce9de45amerged ontoorigin/main(e66c65b950,0merge conflicts), tested under bothPython 3.12.10andPython 3.14.5(CPU-only synthetic tests, no game data):origin/maintools/progress_dashboard.py+ mergedtests/test_progress_dashboard.py):python -I tests/test_progress_dashboard.py:Ran 66 tests,FAILED (failures=13)on bothPython 3.12.10andPython 3.14.5(12drive-path space cases intest_drive_paths_with_spaces_lose_their_whole_name, plusorigin/main's unrelatedtest_default_repo_is_the_one_the_readme_clonesbaseline mismatch afterREADME.md'sgit clonecommand update).09ce9de45amerged ontoorigin/main):python -I tests/test_progress_dashboard.py: all12failures intest_drive_paths_with_spaces_lose_their_whole_namepass (65/66pass; only the same unrelatedorigin/maintest_default_repo_is_the_one_the_readme_clonesfailure remains) onPython 3.12.10(4.92 s) andPython 3.14.5(4.77 s).python -I -B tests/test_progress_dashboard.pywithTEMPandTMPpointed at a directory containing both spaces and non-ASCII characters also passes allScrubtests cleanly (4.77 s), including mixed-separator paths, quoted paths with spaces in the filename, and same-separator trailing prose (D:/work/a.txt and tests/test_x.py failed-><path> and tests/test_x.py failed).git diff --check,python -I -m compileall -q,python -I scripts/check_no_game_data.py,python -I tests/test_ci_registration.py(18/18), andpython -I tests/test_text_write_line_endings.py(3/3) all exited0.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T00:44:56Z.
RUN for #1274 (progress_dashboard: hide a whole drive path that contains spaces, DASH-SCRUB-SPACES)
Kind: Python (tools/progress_dashboard.py + tests/test_progress_dashboard.py). Tester: second machine, not the author.
Heads
09ce9de45a(merge basee18b59a5b7)48bae6cadeCommands (repo root, one process per file)
python -I tests/test_progress_dashboard.py
python -m compileall -q tools/progress_dashboard.py tests/test_progress_dashboard.py
python -I tests/test_progress_dashboard_ci.py ; python -I tests/test_ci_registration.py
RED (tools/progress_dashboard.py reverted to the merge base, tests kept)
GREEN at PR head
GREEN merged into current main
Machine: Windows 11 Pro, RTX 3090 24 GB, NVIDIA 621.40, Python 3.13.12 (uv build).
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T02:33:59Z.
Review: APPROVED
Approve. The same-separator over-redaction I reported is fixed:
D:/work/a.txt and tests/test_x.py failednow gives<path> and tests/test_x.py failed, and a subtest covers it.Checked on origin/main
791899f65+ PR (clean merge), Windows 11, Python 3.12.10:python -I tests/test_progress_dashboard.py: 66 tests, 1 failure,test_default_repo_is_the_one_the_readme_clones. It also fails on plainmain.main'sscrub. Mixed separators,Program Files (x86), lowercase drives, quoted names with spaces and;-joined paths all come out fully hidden. No line hides less than onmain.main.Non-blocking: on mixed separators the new pattern is quadratic.
"D:/" + "ab cd\\" * 4000(24 KB) takes 1.7 s, against about 0 s onmain. Only one log line is scrubbed, so this is unlikely to matter in practice. Truncating the line before the regex (for example to4 * limit) would bound it later.Review by OreoFR's agent (AI-assisted, Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T08:14:32Z.
Merged after OreoFR's check (check: red/green on
main+ this PR) and a re-check here: no conflict withmain3aee82301, same head as checked, not frozen,no-game-datagreen.AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.