chore: clear the safe audit-Low cluster (F4-04, F2-12, F6-02, F6-17 + doc Lows)#89
Merged
Conversation
… doc Lows) Pass-3 safe-Lows batch (no behavior-change risk beyond rejecting misuse): - F4-04: broker.fetch_unprocessed + the fake reject limit < 1 (a non-positive limit otherwise hit SQL with LIMIT -1 or silently mis-sliced rows[:-1]). - F2-12: client.ping() bounds the connect+SELECT 1 with asyncio.timeout( _PING_TIMEOUT_SECONDS) so a half-dead socket can't hang the liveness probe (mirrors the LISTEN health probe's wait_for). - F6-02: Prometheus 'published' count default unified to 0, matching the OTel adapter (the producer always sets count, so the default is dormant either way). - F6-17: removed the dead `outer is self.config` branch — the wired-producer check below already skips an internal publisher (self.config carries a producer). Docs/comments: F6-01 (stale "Task 5"), F6-04 (_run_validate phrasing), F6-13 (CLAUDE.md make_interval/activate_at), F6-15 (fetch_unprocessed docstring), F1-05 (cancel_timer commit-contingent return), F2-06 (timer_id dedup window). Still open (own changes): F2-10 (validate indisunique), F6-05 (_utcnow dedup), F5-04 (parser correlation_id fallback), and the larger refactor/test-hardening Lows. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
What
Batched, genuinely-safe Low-severity findings from the 2026-06-14 pass-3 deep audit (the #82 "safe cluster" pattern). Each is small and low-risk; everything is test-first where it's a behavior change.
Code (test-first)
broker.fetch_unprocessedand the test-broker fake now rejectlimit < 1withValueError. A non-positive limit otherwise hit SQL (LIMIT -1→ DB error) on the real path but silently mis-sliced (rows[:-1]) on the fake — a real/fake divergence. Tests:test_unit.py::test_fetch_unprocessed_rejects_non_positive_limit,test_fake.py::test_fake_broker_fetch_unprocessed_rejects_non_positive_limit.client.ping()bounds the connect +SELECT 1withasyncio.timeout(_PING_TIMEOUT_SECONDS=5.0)so a half-dead TCP socket can't hang the liveness probe for hours (mirrors the LISTEN health probe's existingwait_for). Test drives a genuinely-blocking connection and assertsping()returnsFalse.publishedcountdefault unified to0(was1), matching the OTel adapter. The producer always setscount, so the default is dormant — this removes a latent divergence. Test:test_metrics_prometheus.py::test_prometheus_published_without_count_defaults_to_zero.if outer is self.configbranch in_warn_on_unstarted_foreign_publishers; the wired-producer check below already skips an internal publisher (this broker's config carries a truthyproducer). Behavior-identical; verified by the existing suite.Docs / comments (no behavior change)
_validate_index_predicates_sync_run_validatecross-reference phrasing.make_intervalapplies toactivate_in;activate_atis an absolute literal.fetch_unprocesseddocstring now names operator inspection (not just test assertions).cancel_timerdocstring: a returnedTrueis only durable once your transaction commits.timer_iddedup is "one live row per(queue, timer_id)", resets after delivery/terminal failure.Still open (deferred to their own changes)
indisuniquefortimer_id_uq— needs a hand-crafted drifted-schema integration test._utcnow×5 dedup — needs a shared-module decision.correlation_idfallback — subtle semantics.Verification
just test→ 507 passed, 100% coveragejust lintclean (ruff + ty)Pass-3 findings doc updated with a resolved-banner for the batch.
🤖 Generated with Claude Code