Add sys.intern #1439
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.47) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 334 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.348
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #1439"
general
weight: 0.35
rewitt94
Summary
Add
sys.intern(string, /)using Monty’s session string table. Equal strings passed tosys.internshare a string ID witheach other and with compiled literals of the same text.
Monty retains new entries for the lifetime of the session. The existing worker memory budget accounts for the entries.
Tests
The
import__sys.pyfixture exercises identity for runtime strings and literals, including Unicode text, and checksCPython’s errors for invalid argument types and call shapes. The type-checking fixture checks the stub’s return type.
All 1,632 fixture cases passed with CPython 3.14.10. The production build check, type-checking suite, dump compatibility
tests, Clippy, and Ruff passed.
<!-- This is an auto-generated description by cubic. -->
---
Summary by cubic
Adds
sys.intern(string, /)to Monty's productionsysmodule. Equal strings passed to it share identity while the runtime intern stays alive, so repeated calls return the same object.sys.internis called on it.TypeErrormatching CPython for non-string arguments, wrong arity, and keyword arguments.Sysmodule functions are now available in production builds;setrecursionlimitstays behindtest-hooks.sys.flags.hash_randomization.<sup>Written for commit 32562ea06a47f7c91301f1eb4539b769af62ec8f. Summary will update on new commits.</sup>
<a href="https://cubic.dev/pr/pydantic/monty/pull/1439?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->