Repository navigation
fix(conformance): document orjson depth and integer limits in O001 - #4798
Conversation
…t the fallback orjson.dumps raises TypeError: Recursion limit reached for values nested 254+ levels deep and cannot serialize integers above 64 bits. A bare json->orjson swap on a source-payload path broke an extract (CONAT-7331). Document both limits, recommend try-orjson/fallback-to-json on TypeError, and accept that fallback as a valid ignore[O001] end state so remediation does not remove it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PckAM1Jg1diDsnZUgxDaGH
…nesting instead Remove case B from O001's terminal state. A try-orjson/except-TypeError fallback to stdlib json no longer counts as a correct end state of its own: suppressions are already the general escape hatch, and blessing the fallback hides the real question. Replace the fallback recommendation with guidance to check whether the deeply nested part of a source payload is used at all. In the prior incident the only unbounded field was a subtree the app stored but never read, so dropping it before serialization removes the limit and keeps the orjson path. Drop the Linear link from the public rule text. Claude-Session: https://claude.ai/code/session_01AbKqGYdoCpwNuU4Ams1SbH
|
/lens |
lens summary · updated after round 2 (re-review · only commits since d6eb41f)✅ Ready to merge — every finding is resolved Open findings: 🔴 0 critical · 🟠 0 high · 🟡 0 medium · ⚪ 0 low (nit) lens reads this PR as — O001 recommends replacing stdlib Approach check — ✅ every concern has been addressed.
✔️ Resolved (1)
🕘 Round history (2)
round 2 · $0.024 of $1.00 · 23 model calls · 0 failed requests · 77% prompt cache hits · gpt-6-luna |
…epted The new guidance said a site that genuinely needs a deeply nested value or integers above 64 bits should stay on stdlib json "behind the usual justified suppression". O001's terminal state does not accept that case, so the text promised an end state the rule declares unremediated. Say instead that it is a design decision for a human reviewer and that the finding stays open unless the reviewer chooses to suppress it. Claude-Session: https://claude.ai/code/session_01AbKqGYdoCpwNuU4Ams1SbH
|
/lens |
|
✅ lens · round 2 · re-review · only commits since d6eb41f — ready to merge — every finding resolved · $0.02 Open findings: 🔴 0 critical · 🟠 0 high · 🟡 0 medium · ⚪ 0 low (nit) Approach check — ✅ concerns addressed
$0.024 of $1.00 · 23 model calls · 0 failed requests |
atlan-ci
left a comment
There was a problem hiding this comment.
lens: ready to merge — every finding at every level is resolved (round 2).
Changelog
jsonaccepts: values nested 254 or more levels deep (TypeError: Recursion limit reached) and integers above 64 bits.jsonfallback. If the app genuinely needs the deep value or integers above 64 bits, staying on stdlibjsonis a design decision for a human reviewer. It is not a remediated end state, and the finding stays open unless the reviewer chooses to suppress it.rationalementions both limits.terminal_state("Already correct when") is unchanged from main. An earlier revision of this PR added a "Case B" that accepted a try-orjson/except-TypeError fallback as a correct end state. That was removed: suppressions are already the general escape hatch, and a dedicated carve-out would bless a workaround that hides the real question.docs/rules/by-id/O001.mdanddocs/rules/optimizations.mdregenerated withgenerate_rule_docs. No detector or tier changes.Additional context (e.g. screenshots, logs, links)
Checklist
generate_rule_docs --checkand pre-commit pass locally. The conformance tests covering O001, the catalog, remediation references and rule-doc generation pass locally (419 passed).Copyleft License Compliance
🤖 Generated with Claude Code
https://claude.ai/code/session_01AbKqGYdoCpwNuU4Ams1SbH