feat(verify): Python verification + modular architecture + verified headers#496
Merged
feat(verify): Python verification + modular architecture + verified headers#496
Conversation
- Add PYTHON_MODULES mapping for string and math module functions
- Add convertJsLineToPython with JS→Python syntax conversions:
- true/false/null/undefined → True/False/None
- Infinity/NaN → float('inf')/float('nan')
- .length → len()
- Add jsToPython to generate runnable Python code with imports
- Add Python verification logic in verifyFunction
- Normalize Python float output (.0 stripping)
- Bump CACHE_VERSION to 5
Results: 15/17 Python functions pass verification against Python 3.12
Remaining failures:
- capwords: JS preserves double spaces, Python collapses them
- printable: .length on function result not converted
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…upport Architecture changes: - Split verify.ts (1000+ lines) into modular structure: - scripts/verify/types.ts - Shared interfaces - scripts/verify/cache.ts - Caching utilities - scripts/verify/docker.ts - Docker utilities - scripts/verify/runner.ts - JS execution - scripts/verify/parser.ts - Function file parsing - scripts/verify/languages/index.ts - Language registry - scripts/verify/languages/php.ts - PHP handler - scripts/verify/languages/python.ts - Python handler - Main verify.ts is now ~250 lines CLI entry point New features: - Add `verified: X.Y` header support in function files - Functions with header are verified in CI mode (default) - Functions without header are skipped unless --all is used - Add --summary flag to show verification status counts - Add --all flag to include unverified functions CI integration: - Default mode only runs functions with verified: header - Exit code 1 only for verified function failures - Unverified functions shown as "skipped" count Demo verified headers added: - src/php/strings/trim.js: verified: 8.3 - src/python/math/factorial.js: verified: 3.12 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Summary
verified: X.Yheader support for CI integrationChanges
Python Verification
Modular Architecture
Split verify.ts into:
scripts/verify/types.ts- Shared interfacesscripts/verify/cache.ts- Caching utilitiesscripts/verify/docker.ts- Docker utilitiesscripts/verify/runner.ts- JS executionscripts/verify/parser.ts- Function file parsingscripts/verify/languages/- Per-language handlers (PHP, Python)CI Integration
verified: X.Yheader support in function files--allflag includes unverified functions--summaryflag shows verification status countsDemo
Added verified headers to demonstrate the system:
src/php/strings/trim.js: verified: 8.3src/python/math/factorial.js: verified: 3.12Test plan
yarn verify --summaryshows correct countsyarn verifyruns only verified functionsyarn verify --allincludes all functionsyarn checkpasses (only pre-existing warnings)🤖 Generated with Claude Code