fix: review-pass findings + reviewer standards doc - #15
Merged
Conversation
…server From a full review pass (bandit + manual, report in PR): HIGH - interpreter/real_world.py: safe_eval now rejects bool constants (bool subclasses int; True + 1 no longer computes) and depth-limits nesting so hostile input gets ValueError, not RecursionError - sandbox.py: assert path.is_file() replaced with a real pre-flight FileNotFoundError check (asserts vanish under python -O); timeout path now preserves captured stderr - memento/real_world.py: explicit CWE-502 warning — pickle.loads only on snapshots this process produced; README caveat added MEDIUM - server.py: catalog/index now lazy via lru_cache accessors — imports do no disk I/O, practicing what patterns/python/global_object teaches - facade/singleton/flyweight pythonic variants: honest inline notes on the saga boundary, unguarded lazy init, and unbounded pool docs/code-review.md: reviewer standards — tool layer, written standards, severity checklist, MCP reference sources. 238 tests (2 new hostile-input tests); ruff/mypy --strict clean. Co-Authored-By: Claude Fable 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.
Full review pass over staging (ruff/mypy/pytest already green; bandit + manual on top). 0 CRITICAL, 3 HIGH, 4 MEDIUM — all fixed here.
safe_evalcomputedTrue + 1(bool subclasses int) and crashed withRecursionErroron hostile nestingMAX_DEPTHguard → cleanValueError; both testedassertas a runtime file check (stripped under-O)FileNotFoundError; timeout path now keeps stderrglobal_objectunitlru_cachelazy accessorsAlso adds
docs/code-review.md— the reviewer's contract: machine-enforced layer (ruff/mypy/pytest/bandit), written standards (PEP 8/257/484, Google guide), severity checklist, and MCP reference sources (this repo's own server + Context7) for a review team.Gates: ruff ✅ mypy
--strict✅ pytest 238 ✅ README table current ✅🤖 Generated with Claude Code