fix(persistence): refurb cleanups in replay journal + lineage signer + eval (cluster C)#1813
Conversation
…+ eval (cluster C) Address 7 refurb alerts across 5 files: - journal.py:209 (#2468, FURB123): list(self.blob_refs) -> self.blob_refs.copy() - journal_export.py:94 (#2469, FURB123): list(self.blob_digests) -> .copy() - journal_export.py:108 (#2470, FURB123): list(self.blob_digests) -> .copy() - journal_export.py:485 (#2471, FURB160): drop redundant JournalError = JournalError self-assignment; add JournalError to __all__ so the re-export stays explicit for callers. - journal_publish.py:136 (#2472, FURB123): dict(row) -> row.copy() - lineage_signer.py:223 (#2473, FURB123): list(parents) -> parents.copy() - incident_synthesizer.py:756 (#2465, FURB124): collapse raw[0] == '"' and raw[-1] == '"' into the chained comparison raw[0] == '"' == raw[-1]. Behaviour unchanged: every .copy() returns the same shallow-copy semantics the previous explicit-type constructor produced, and the chained comparison evaluates identically for two-character bounds. uv run pytest tests/unit/ -k "journal or lineage_signer or incident_synthesizer" passes (104 tests). refurb is clean on the five touched files.
There was a problem hiding this comment.
Sorry @chernistry, you have reached your weekly rate limit of 2500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Sonar insights (advisory, no merge-block)Snapshot of
Run This comment is a soft signal. The Sonar scan runs on push to |
Review-bot acknowledgement summary
All must-address findings are resolved or acknowledged. |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughPR consolidates shallow copy patterns across persistence and eval modules by replacing type constructors ( ChangesCode style and API surface updates
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
bernstein doctor observe for PR #1813 ( sonar -- WARN (project bernstein)
code-scanning -- WARN (40 open alert(s))
Skipped backends (credentials not configured)
See docs/observability/unified-doctor.md for backend setup notes. |
Auto-applied by contract-drift-autofix.yml on PR #1813. Regenerated via scripts/regen_contract_drift.py. Refs #1273. Source CI run: https://github.com/sipyourdrink-ltd/bernstein/actions/runs/26252897437
The typos check on PR #1813 fails on a pre-existing comment in tests/unit/test_journal_chain.py:457 ("writeable" -> "writable"). Fix it in the same PR so cluster-C can land.
Summary
Address 7 refurb alerts across 5 files in the replay journal, lineage signer, and eval subsystems.
Alerts cleared
src/bernstein/core/persistence/journal.py:209list(self.blob_refs)->self.blob_refs.copy()src/bernstein/core/persistence/journal_export.py:94list(self.blob_digests)->self.blob_digests.copy()src/bernstein/core/persistence/journal_export.py:108list(self.blob_digests)->self.blob_digests.copy()src/bernstein/core/persistence/journal_export.py:485JournalError = JournalErrorself-assignment; addJournalErrorto__all__so the re-export stays explicit for callerssrc/bernstein/core/persistence/journal_publish.py:136dict(row)->row.copy()src/bernstein/core/persistence/lineage_signer.py:223list(parents)->parents.copy()src/bernstein/eval/incident_synthesizer.py:756raw[0] == '"' and raw[-1] == '"'into chainedraw[0] == '"' == raw[-1]Behaviour
Unchanged. Each
.copy()produces the same shallow-copy semantics as the explicitlist(...)/dict(...)constructor. The chained comparison evaluates identically for two-character bounds. TheJournalErrorre-export remains available via the top-of-file import; adding it to__all__documents the public surface explicitly.Test plan
uv run refurbon the 5 touched files is clean.uv run pytest tests/unit/ -q --no-cov --timeout=120 -k "journal or lineage_signer or incident_synthesizer"- 104 tests pass.uv run ruff check . --fix && uv run ruff format .- all checks passed, no formatting drift.uv run pyrighton the 5 touched files - error count unchanged versusorigin/mainbaseline (53/53; all pre-existing).Summary by CodeRabbit
Bug Fixes
Documentation
Refactor