Skip to content

chore: clear the safe audit-Low cluster (F4-04, F2-12, F6-02, F6-17 + doc Lows)#89

Merged
lesnik512 merged 1 commit into
mainfrom
chore/f-safe-lows-batch
Jun 14, 2026
Merged

chore: clear the safe audit-Low cluster (F4-04, F2-12, F6-02, F6-17 + doc Lows)#89
lesnik512 merged 1 commit into
mainfrom
chore/f-safe-lows-batch

Conversation

@lesnik512

Copy link
Copy Markdown
Member

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)

  • F4-04broker.fetch_unprocessed and the test-broker fake now reject limit < 1 with ValueError. 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.
  • F2-12client.ping() bounds the connect + SELECT 1 with asyncio.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 existing wait_for). Test drives a genuinely-blocking connection and asserts ping() returns False.
  • F6-02 — Prometheus published count default unified to 0 (was 1), matching the OTel adapter. The producer always sets count, so the default is dormant — this removes a latent divergence. Test: test_metrics_prometheus.py::test_prometheus_published_without_count_defaults_to_zero.
  • F6-17 — removed the dead if outer is self.config branch in _warn_on_unstarted_foreign_publishers; the wired-producer check below already skips an internal publisher (this broker's config carries a truthy producer). Behavior-identical; verified by the existing suite.

Docs / comments (no behavior change)

  • F6-01 stale "Task 5 adds…" plan reference → present tense.
  • F6-04 _validate_index_predicates_sync _run_validate cross-reference phrasing.
  • F6-13 CLAUDE.md: make_interval applies to activate_in; activate_at is an absolute literal.
  • F6-15 fetch_unprocessed docstring now names operator inspection (not just test assertions).
  • F1-05 cancel_timer docstring: a returned True is only durable once your transaction commits.
  • F2-06 CLAUDE.md: timer_id dedup is "one live row per (queue, timer_id)", resets after delivery/terminal failure.

Still open (deferred to their own changes)

  • F2-10 validate indisunique for timer_id_uq — needs a hand-crafted drifted-schema integration test.
  • F6-05 _utcnow ×5 dedup — needs a shared-module decision.
  • F5-04 parser correlation_id fallback — subtle semantics.
  • The larger refactor / test-hardening Lows.

Verification

  • just test507 passed, 100% coverage
  • just lint clean (ruff + ty)

Pass-3 findings doc updated with a resolved-banner for the batch.

🤖 Generated with Claude Code

… 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>
@lesnik512 lesnik512 merged commit 0a7d9ea into main Jun 14, 2026
3 checks passed
@lesnik512 lesnik512 deleted the chore/f-safe-lows-batch branch June 14, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant