Skip to content

The README example doesn't run, and the gate tests a private copy of it - #19

Merged
n1ckyb merged 1 commit into
release/v0.0.2-rcfrom
fix/readme-example-and-gate
Aug 9, 2026
Merged

The README example doesn't run, and the gate tests a private copy of it#19
n1ckyb merged 1 commit into
release/v0.0.2-rcfrom
fix/readme-example-and-gate

Conversation

@n1ckyb

@n1ckyb n1ckyb commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

The headline example on this release candidate does not run.

SyntaxError: unterminated string literal (detected at line 3)

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 NameError because 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:

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 exactly the gap that pulled 0.0.1: every check was green.

The gate now extracts the first ```python fence from the README a user actually 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

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:

Defect Status on this RC
python -m intentumdiff failed (no __main__.py) fixed
~69 plugin-trust errors per run fixed — allowlist carries the distribution name in both registry.py and rust_core.py
release gate absent present
README example doesn't run still broken — this PR

🤖 Generated with Claude Code

…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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +83 to +86
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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@n1ckyb
n1ckyb merged commit d26a0b1 into release/v0.0.2-rc Aug 9, 2026
1 check passed
@n1ckyb
n1ckyb deleted the fix/readme-example-and-gate branch August 9, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant