fix(prompt): respect Python runtime syntax metadata#109
Conversation
|
Codex review: needs maintainer review before merge. Latest ClawSweeper review: 2026-05-24 06:34 UTC / May 24, 2026, 2:34 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. The linked issue provides a minimal Python 3.14 repro and current-main source inspection shows the mapper/prompt path lacks target-runtime context and PEP 758 guidance. PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Next step before merge Security Review detailsBest possible solution: Merge this bounded mapper and prompt fix after normal maintainer checks, then let it close the linked issue at #106. Do we have a high-confidence way to reproduce the issue? Yes. The linked issue provides a minimal Python 3.14 repro and current-main source inspection shows the mapper/prompt path lacks target-runtime context and PEP 758 guidance. Is this the best way to solve the issue? Yes. Threading runtime metadata into Python feature context and adding narrow prompt guidance is the maintainable fix direction, and the follow-up commit covers the standalone pytest-suite path flagged in the earlier review. Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 857d854ac8d0. |
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Pearl Proofling Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
|
Added the missing standalone pytest-suite runtime metadata path and included real behavior proof in the PR body. @clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
Co-authored-by: Rohit <rohitjavvadi2@gmail.com>
d4b798b to
f98ba4a
Compare
|
Maintainer pass complete. I rebased this onto current Local proof on the rebased branch:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f98ba4a0e5
ℹ️ 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".
| if (name === ".python-version" || name === "runtime.txt") { | ||
| return true; |
There was a problem hiding this comment.
Validate runtime.txt before stopping metadata search
When a Python source tree is nested under a non-Python runtime.txt (for example in a polyglot app) but inherits its Python version from an ancestor .python-version or pyproject.toml, this treats the mere presence of runtime.txt as a Python runtime constraint and nearestPythonRuntimeContextFiles returns before reaching the ancestor. The review prompt then omits the actual Python target version, so the Python 3.14 syntax guidance can still be applied with the wrong/missing metadata; parse runtime.txt for a Python runtime the way .tool-versions is checked before using it as a stopping constraint.
Useful? React with 👍 / 👎.
Summary
Fixes #106.
Real behavior proof
I reran the issue reproduction against the built CLI on a minimal Python 3.14 project containing
.python-version,requires-python = ">=3.14", and the PEP 758 handler syntax:Command:
Output excerpt:
I also verified the standalone pytest-suite path flagged in review. A pytest-only Python 3.14 fixture now maps the test-suite feature with runtime metadata in context:
{ "title": "Python test suite tests", "contextFiles": [ { "path": "pyproject.toml", "reason": "python target runtime metadata" }, { "path": ".python-version", "reason": "python target runtime metadata" }, { "path": "runtime.txt", "reason": "python target runtime metadata" }, { "path": "tests/test_pep758.py", "reason": "nearby test" } ], "ownedFiles": [ { "path": "tests/test_pep758.py", "reason": "pytest file" } ], "tests": [ { "path": "tests/test_pep758.py", "command": "pytest" } ] }Checks
./node_modules/.bin/vitest run src/mapper.test.ts src/prompt.test.ts./node_modules/.bin/tsc -p tsconfig.json --noEmit./node_modules/.bin/oxfmt --check src/mappers/python.ts src/mapper.test.ts src/prompt.ts src/prompt.test.ts./node_modules/.bin/oxlint . --config oxlint.jsongit diff --checkpnpm buildpnpm typecheckpnpm lintpnpm format:checkpnpm test