textures: require the requested history before provisional export #2254
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!2254
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2254/head"
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?
@RavenCurseBurg on GitHub · 2026-11-25 07:59 UTC · original
RavenCurseBurg:textures/require-requested-history→main· +46 −9 · 3 files · 1 commits · merged 2026-11-25 08:24 UTCRefs #458. A batch run with
--allow-provisional --history chosen.jsoncould publish a DDS and report success after silently substituting the decoder default for a missing file or JSONnull. Malformed JSON produced a warning and the same output. On a generated pool with a test decoder whose output depends on the chosen history, all three cases returned 0 with the default bytes. A valid object produced different bytes.Read and validate an explicitly requested provisional history before opening the pool or changing any output. A missing or unreadable file, invalid UTF-8, malformed JSON or a non-object value now produces a CLI usage error (2). An empty object is passed to the decoder as supplied. The existing default still applies when the caller omits the history path.
Verification on Windows:
python -B tests/ttpf_batch_export_check.py -vran 13 tests: 12 passed, 1 skipped because the optional external reference decoder was unavailable.python -B tests/docs_links_check.py(428 links),python -B tests/bidi_controls_check.py(1,535 files) andgit diff --checkpassed.@tedin7 on GitHub · 2026-11-25 08:02 UTC · original · reviewed
Review of head
4dff6d9d94(comment only).Result: no blocking findings. P1=0, P2=0.
Commands executed locally (Linux):
git diff --stat origin/main...HEAD: 3 files, +46/-9.python3 -B tests/ttpf_batch_export_check.py: Ran 13 tests, OK (skipped=1, optional external decoder).python3 tests/docs_links_check.py: 18 Markdown files, 428 links OK.python3 tests/bidi_controls_check.py: 1535 files, no bidirectional controls.git diff --check origin/main...HEAD: clean.isinstance(history_dict, dict)check withif False:. Result: 2 failures. The new test kills it.except (OSError, ValueError)toexcept OSError. Result: 2 failures. The new test kills it.git checkout -- ..Notes:
load_toolsand before the pool is opened. A bad file therefore leaves the existing DDS and manifest untouched. The test checks this byte for byte.load_toolsis safe. The error text is the same, and it now fails earlier.--historywithout--allow-provisionalis still ignored without any message, as before. A short warning would help, but it is outside this PR's scope.str(exc)for aUnicodeDecodeErroris verbose in the CLI message. It is acceptable.AI-assisted; commands listed were executed locally.