milestone: richer examples + review-pass fixes - #16
Merged
Conversation
Rewrites pythonic.py (and tests) where the toy domain didn't answer "what does this look like in a real system": - facade: place_order() over inventory/payment/shipping/notification, with the payment-failure rollback tested - dependency_injection: overdue-invoice reminders with clock, source, and mail seams — deterministic tests, no monkeypatching - bridge: alert/digest notifiers bridged over email/Slack/SMS transports - prototype: report-job templates via partial + dataclasses.replace - mediator: checkout form with cascading country/shipping/payment rules - abstract_factory: one report rendered through HTML/Markdown document families naive.py toys kept as-is (the diff against them is the teaching device). READMEs aligned. 236 tests; ruff/mypy --strict clean. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…server (#15) 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.
Two squashed batches since v1.0.0, for review before merge and (optionally) a v1.0.1 tag:
1. Realistic domains for the six thinnest examples (#14)
The units whose
pythonic.pywas correct-but-toy now show the pattern in a liftable business scenario:place_order()over inventory/payment/shipping/notification, with the payment-declined rollback testedpartial+dataclasses.replacenaive.pytoys intentionally unchanged — the legible diff against them is the teaching device.2. Review-pass fixes + reviewer standards (#15)
0 CRITICAL / 3 HIGH / 4 MEDIUM, all fixed:
safe_eval: bool constants rejected (True + 1no longer computes); depth limit turns hostile nesting intoValueErrorinstead ofRecursionError— both testedassertruntime guard → realFileNotFoundError; timeout keeps stderrlru_cache) — no disk I/O at import, per our ownglobal_objectunitdocs/code-review.md: the reviewer's contract (tool layer, PEP standards, severity checklist, MCP reference sources)Gates: ruff ✅ · mypy
--strict(206 files) ✅ · pytest 238 ✅ · README table current ✅🤖 Generated with Claude Code