Repository navigation
fix(#695): the round-1 release-audit findings worth fixing before v0.33.0 - #701
Merged
Merged
Conversation
…e the tag The v0.33.0 release audit (round 1, token rel-0330-429b3dd1) returned six findings, none in a blocking row. Five are fixed here; the sixth is filed as #700. **The scanner credited a nested function's declaration to its parent.** _function_spans closed a function at the first `}` at column 0, on the stated assumption that no function is defined inside another. #696 broke that assumption: capture_was_seen() is defined at column 0 inside _remember_deferred_phase(), so the outer span was computed as ending at the inner function's brace and the inner's `local LC_ALL=C` was credited to 148 outer lines that have none. Neither PR contains this -- #696 has no scanner, #699 has no nesting -- it existed only once both had landed, which is the kind of thing only a whole-delta audit sees. Nothing falls through it today (a direct sweep of those lines finds no ranges), but the scanner is the entire standing defence for a class that already shipped a total-failure bug. Now a stack, with a nested fixture pinning both halves. **`local LC_ALL=C` never reached the `tr` child.** `local` on a name the environment never exported leaves it unexported, so on a host whose language comes from LANG alone -- what setting a system language actually produces -- the drive-letter uppercase still ran under Turkish rules and mapped `i` to the dotted `İ`. My own test in #699 passed because its harness exports LC_ALL, so `local` shadowed an already-exported name: it passed for a reason that does not hold on a real host. The new control puts a recording `tr` on PATH and asserts what locale it was actually called under, which runs on every platform and does not need a glibc runner to fail. The changelog fragment that claimed this was fixed is corrected in the same commit. **An unmeasured file size laundered into 0**, in two places, which made _remember_emit_file's own "no usable size" arm unreachable from its only caller: `0` is a digit string and `0 -gt 16384` is false, so a file of any size took the read path that #660's own threshold exists to keep it off -- 4MB measured at 24.1s on windows-latest, on the session-start foreground path. The batched `wc -c` can fail wholesale, leaving every file in that state at once. Unknown is now kept distinct from zero end to end, and the compact-mode notice says `size unknown` rather than printing `0 bytes` for a file nobody measured. **The deferred default-path control asserted one of the three records its own docstring named.** It now polls both that this fixture's storage mode can produce, and says why the third needs external storage and where it is covered instead. Local suite: 2483 passed, 58 skipped. The one failure on the way was this repo's own blanket-win32-skip guard catching a triage row I had not written yet -- added. Part of #695 Co-Authored-By: Max <noreply>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The v0.33.0 release audit (gate 3, round 1, dispatch token
rel-0330-429b3dd1)returned six findings, none in a blocking row.
gate3_disposition.pyansweredstop-tag-- round-one findings always stop the tag, blocking or not. Five are fixedhere; the sixth is filed as #700.
The one that only a whole-delta audit could see
_function_spansin the #695 scanner closed a function at the first}at column 0,on its own stated assumption that no function is defined inside another. #696 broke that
assumption:
capture_was_seen() {is defined at column 0 inside_remember_deferred_phase() {. So the outer span was computed as ending at the innerfunction's brace, and the inner's
local LC_ALL=Cwas credited to 148 outer lines thathave no such declaration -- reported protected while unprotected.
Neither pull request contains this. #696 added no scanner; #699 added no nesting. It
existed only once both had landed, and both were green. Nothing falls through it today
(a direct sweep of lines 861-1008 finds no letter ranges), so it is a latent guard defect
rather than a shipping bug -- but the scanner is the entire standing defence for a class
that already shipped a total-failure bug, and the two existing must-fire controls both use
flat fixtures, so neither could see this shape.
Now a stack, with a nested fixture pinning both halves: the outer lines must not inherit,
and the inner's own must still be recognised.
The one where my own test passed for the wrong reason
local LC_ALL=Cdoes not reach a child process.localon a name the environment neverexported leaves it unexported:
Two of #699's thirteen functions spawn
tr '[:lower:]' '[:upper:]'on a drive letter. Onthe host this whole issue is about --
LANG=tr_TR.UTF-8withLC_ALLunset, which is whatsetting a system language actually produces -- that
trstill ran under Turkish rules,where
iupper-cases to the dottedİ: two bytes in a slot that holds one ASCII letter.tests/test_id_guards_locale_695.pydid not catch it because its harness passesLC_ALLin the subprocess environment, so
localshadowed an already-exported name and the childdid see
C. It passed for a reason that does not hold on a real host.Fixed with an
LC_ALL=Cprefix on the command itself. The new control puts a recordingtron PATH and asserts the locale it was actually called under -- so it runs on everyplatform and does not need a glibc runner to fail. The
#699changelog fragment thatclaimed this was already fixed is corrected in the same commit.
The one that defeats a threshold shipping in this same release
_remember_wc_size_get_intoreturned${!key:-0}for a path it holds no measurement for,and the render loop rewrote anything non-numeric to
0as well. Two separate placesturning "never measured" into the size zero -- which made
_remember_emit_file's own"no usable size" arm unreachable from its only caller.
0is a digit string and0 -gt 16384is false, so an unmeasured file of any size took thereadpath that#660's threshold exists to keep it off: 4 MB measured at 24.1s on
windows-latest, on thesession-start foreground path.
The batched
wc -ccan fail wholesale (ARG_MAX,wcabsent), which leaves every fileunmeasured at once. Unknown is now kept distinct from zero end to end, and the compact-mode
notice says
size unknownrather than printing0 bytesfor a file nobody measured.The controls use a recording
catfor the same reason as above: the bytes come outidentical either way, so output alone cannot tell the two arms apart -- which is how this
went unnoticed.
The rest
named. It now polls both this fixture's storage mode can produce, and states why the
third needs external storage and where it is covered instead.
_REMEMBER_PHASEis write-only and unexported -> _REMEMBER_PHASE is write-only: nothing reads it, and it is not exported #700. It changes no behaviour eitherway and picking between delete/export/log is a design call, not a repair.
Verification
Local suite 2483 passed, 58 skipped. The one failure on the way was this repo's own
blanket-win32-skip guard catching a triage row I had not written yet -- added, which is the
guard doing its job.
Round 2 of the audit runs against this head once it is green.
Part of #695
[AI-generated]