Repository navigation
fix(ci): stop a broken workflow step reporting clean, and the guard rewriting it into something that parses (#15152) - #15128
Merged
Conversation
mrveiss
force-pushed
the
issue-15122-inline-python-extractor
branch
from
August 26, 2026 15:06
a9f952f to
f421029
Compare
Contributor
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
…ewriting it into something that parses (#15152)
mrveiss
force-pushed
the
issue-15122-inline-python-extractor
branch
from
August 26, 2026 19:30
5880ba1 to
aa8a9ca
Compare
3 tasks
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.
Thinking Path
Re-scoped. This PR originally cited #15122, which has since been closed
not_plannedbecause its premise was wrong. The premise deserves a correction on the record, and then the two defects that survive it.What was wrong. #15122 claimed
test_every_extracted_program_parsesfails on the base and that the failure is "environment-independent — no package, Python version or checkout layout is involved". It is not. PEP 701 made an f-string reusing its own quote type inside the expression legal from 3.12. CI runs 3.12/3.14, where shard 12 is green. The red was a 3.10-only artifact. My earlier framing of this PR repeated a different piece of that error — I described the extractor as truncating its capture. It does not:_INLINE_PYTHON's(?:\\.|(?!\1).)*alternation is escape-aware, the capture ends on%"), and the next character after the match is a space. The fragment in the failure message iscode[:60], display truncation inside the assertion itself.What survives, and why it is worth more than the original claim. Two strings were being conflated:
shhands the interpreter for a single-quoted-cargument, backslashes intact:… print(f"…{r.get(\"overall_maturity\", 0):.1f}%")_unescape_shellstripped\"→":… print(f"…{r.get("overall_maturity", 0):.1f}%")Measured with
ast.parseon four interpreters:(A fails on every version. B is version-dependent.
_unescape_shellwas quote-blind — it applied double-quote rules to a single-quoted program thatshnever escape-processes — so it turned A into B. That is not a cosmetic infidelity: it is the transformation that converts a program broken on every interpreter into one that parses on the two CI runs.The consequence, measured against the unmodified base in the same checkout:
[('phase_validation.yml', …)][][]['json']On the interpreter CI actually runs, the base guard reports zero problems and claims to have checked
json— for a step that cannot start. A guard that rewrites its subject into something that passes is indistinguishable from a guard that passes. That is the same theme as the sibling PR, one layer earlier: not a skipped subject, a silently substituted one.And the step really is broken.
phase_validation.yml:52pinssetup-pythonat3.14; run verbatim underbashwith that interpreter:With the step's own
2>/dev/null || echo "Results not available"attached, the observed output isResults not available. The job summary has been printing the fallback in place of the maturity figure for as long as the line has existed — a live defect in what a workflow reports, independent of any test.What Changed
.github/workflows/phase_validation.yml:126— the maturity value is bound to a name and formatted with.format, so the program carries no backslash and needs no nested quoting. Verified under 3.14:**Overall System Maturity:** 42.5%.repo_tests/test_ci_import_smoke_paths_14252.py_unescape_shell(code, quote)unescapes only for". A single-quoted program is returned exactly asshdelivers it._imported_namesno longer catchesSyntaxError. A caller receiving[]could not distinguish "imports nothing" from "could not be read", and the assertion passed either way._uncaptured_invocations()+test_no_python_dash_c_invocation_escapes_the_extractor— everypython -csite must be captured as one whole shell argument. A site the pattern cannot close on previously produced no scan entry at all, so nothing iterated over it.test_phase_validation_inline_programs_are_actually_checked, plus direct assertions that single-quoted backslashes survive and that unreadable input raises._INLINE_PYTHON's comment andtest_every_extracted_program_parses's docstring both described the pre-fix truncation as current; that text produced two independent mis-diagnoses. Both now state that the capture is complete and point at_unescape_shelland thecode[:60]slice instead.Sweep: 4 backslash-carrying
python -csites.auto-fix-generated-types.yml:153,coverage.yml:178,verify-generated-types.yml:258are double-quoted, where\"is correct shell escaping and the existing unescaping is right.phase_validation.yml:126was the only single-quoted one, and the only defect.Verification
Module lands in shard 12 of 12 (
stable_shard.shard_ofagainst.test_durations).bash+ 3.14 →SyntaxErrorthenResults not available; fixed line →**Overall System Maturity:** 42.5%test_a_single_quoted_program_keeps_its_backslashesasserts both directions of_unescape_shellpytest repo_tests/test_ci_import_smoke_paths_14252.py→ 30 passedtest_no_python_dash_c_invocation_escapes_the_extractorenforces it continuouslyContrast mutations, all against final head
aa8a9ca:phase_validation.ymlAssertionError: inline python that the extractor could not parse under python 3.10 — its imports are checked against nothing: [('phase_validation.yml', …)]. Whether a program parses is version-dependent (PEP 701); confirm on the version CI runs before calling this a base failure._unescape_shellquote-blind againassert 'print(f"{d.get("k")}")' == 'print(f"{d.get(\"k\")}")'return []onSyntaxErrorin_imported_namesFailed: DID NOT RAISE <class 'SyntaxError'>python -cwith a'"'"'splice the pattern cannot close onAssertionError: python -c invocations the extractor did not capture as one whole argument -- their imports are checked against nothing: [('phase_validation.yml', 124, 'capture ends mid-argument at \'"\'')]No new
KNOWN_LARGEentry and no ceiling change — the module is 308 lines against a 600 ceiling and appears in neither ratchet carrier.Not proven here: that no other workflow program is version-dependent in the same way. A double-quoted program using nested same quotes is legal on 3.12+ and a SyntaxError on 3.10/3.11, so this guard can still disagree with itself between a developer checkout and CI. None of the four current sites has that shape. The versioned failure message makes the next such disagreement self-explaining rather than mysterious, but it does not prevent it.
Model Used
Claude Opus 5 (1M context)
Closes #15152