The README example doesn't run, and the gate tests a private copy of it - #19
Conversation
…test it
The README example on this release candidate does not run:
old = "def greet(name):
return 'hi ' + name
"
The triple quotes had collapsed to single quotes, so it dies with
"SyntaxError: unterminated string literal" at PARSE time, before importing
anything. This is the first code a user copies, and it renders on PyPI.
That is 0.0.1 defect #4 again, in a new form. 0.0.1's example raised NameError
because it was a fragment; this one is self-contained but unparseable.
Restored the triple quotes and confirmed it runs, printing exactly what the
README claims two lines below it:
ChangeType.ADDITION Insert -> if_statement('if_statement')
## The gate could never have caught this
smoke_published_wheel.py already had "a real diff with a known-correct answer",
but it ran OLD_SRC/NEW_SRC — the script's own PRIVATE copy of the example. That
proves the library works. It proves nothing about what we published, which is
precisely the gap that pulled 0.0.1: every check was green.
So the gate now extracts the first ```python fence from the README a user reads
and executes it against the INSTALLED wheel. Verified in both directions:
repaired README exit 0 -> gate passes
the broken RC README exit 1 -> gate catches it
Found by auditing whether the RC actually contains the fixes 0.0.2 claims to
ship, rather than assuming it did. The other three 0.0.1 defects are genuinely
fixed on this branch.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 88d0678f3c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| here = Path(__file__).resolve() | ||
| for candidate in (here.parent.parent / "README.md", here.parent / "README.md"): | ||
| if candidate.is_file(): | ||
| return candidate.read_text(encoding="utf-8") |
There was a problem hiding this comment.
Test the README embedded in the wheel
When --wheel points to an artifact built before the checkout README was edited—or the default command installs a published release while the script comes from another revision—this reads the checkout's README.md, not the long description embedded in the installed distribution. A stale wheel containing the broken example can therefore pass after the source README is repaired, even though PyPI will render the stale content. Extract the README/description from the artifact or installed distribution metadata so the smoke test validates what will actually be published.
Useful? React with 👍 / 👎.
The headline example on this release candidate does not run.
The triple quotes had collapsed to single quotes, so it fails at parse time — before importing anything. This is the first code a user copies, and it renders on PyPI.
That is 0.0.1 defect #4 again, in a new form: 0.0.1's example raised
NameErrorbecause it was a fragment; this one is self-contained but unparseable.Repaired, and confirmed it now prints exactly what the README claims two lines below it:
The gate could never have caught this
smoke_published_wheel.pyalready had "a real diff with a known-correct answer" — but it ranOLD_SRC/NEW_SRC, the script's own private copy of the example. That proves the library works. It proves nothing about what we published.Which is exactly the gap that pulled 0.0.1: every check was green.
The gate now extracts the first
```pythonfence from the README a user actually reads and executes it against the installed wheel. Verified in both directions:How this was found
By auditing whether the RC genuinely contains the fixes 0.0.2 claims to ship, rather than assuming it did. The audit checked all four 0.0.1 defects independently:
python -m intentumdifffailed (no__main__.py)registry.pyandrust_core.py🤖 Generated with Claude Code