Repository navigation
Description
Evidence
BlockList::is_blocked returns only bool (pkgs/id/crates/id-core/src/block_list.rs:61-64), so callers cannot distinguish an unblocked entry from a failed lookup. The underlying EventStore::active_block/is_blocked operations are fallible and document storage errors and StoreError::Corrupt (pkgs/id/crates/id-events/src/event_store/mod.rs:135-170). However, both concrete BlockList implementations erase failures: EventStore uses unwrap_or(false) at lines 369-374, while SharedEventStore also maps storage errors and poisoned-lock errors to false at pkgs/id/crates/id-store/src/store_traits.rs:390-400.
Enforcement consumers treat false as a successful allow decision. For example, AbuseEvaluator::open_connection_inner refuses only when the peer/IP predicate is true (pkgs/id/crates/id-core/src/abuse.rs:1141-1152), and PullGate::admits proceeds when both block predicates are false and policy admits (pkgs/id/crates/id-events/src/pull_policy.rs:102-130). A corrupt block row or transient read/lock failure therefore makes the check indeterminate but indistinguishable from “not blocked”; the caller gets no diagnostic to surface to the operator.
The current fail-open behavior is explicitly documented and may be a deliberate availability choice. This issue is about making lookup failure observable and the enforcement policy explicit, not unilaterally changing it to fail-closed. Related history: closed #2245 implemented the operator block list but does not track error visibility.
Suggested fix
Preserve a distinguishable error/indeterminate outcome at the block-list boundary (or provide an equivalent structured reporting hook). Let each enforcement seam explicitly apply its documented fail-open/fail-closed policy, and report the failed check to the operator without leaking storage details to remote peers.
Acceptance criteria
- Successful active, absent, and expired-block lookups retain their existing semantics.
- Injected storage/decode errors and poisoned-lock failures are distinguishable from an ordinary unblocked result and produce an operator-visible diagnostic.
- Enforcement callers explicitly choose what to do with an indeterminate result; no caller silently treats it as an ordinary successful “not blocked” check.
- Tests cover the error oracle and the chosen per-surface policy; the default availability behavior is documented.
Activity
developing-today commentedon Nov 11, 2026
CODE-2611
dezren39 commentedon Nov 11, 2026
🤖 Agent note · triaged
dezren39 commentedon Nov 11, 2026
state: picked-up
task: 15007
lane: code-a
stage: claimed
Picked up task 15007 (small_fix for #8750). Revalidated fresh: issue #8750 OPEN, labels kind/bug, task/small-fix, priority/normal, effort/m, app/id — no hard-stop labels, no status/needs-triage (triage already applied by the triage step; the packet's work kind stands).
Plan: read the block-list boundary and both implementations plus the two enforcement seams (BlockList in id-core, EventStore in id-events, SharedEventStore in id-store, AbuseEvaluator in id-core/src/abuse.rs, PullGate in id-events/src/pull_policy.rs); add failing error-oracle tests first (injected storage/decode error, poisoned lock), then introduce a distinguishable indeterminate outcome with an operator-visible diagnostic and an explicit per-surface policy — without changing active/absent/expired semantics or silently flipping the documented default availability behavior.
docs(id): design record for the block-lookup API (#8750)
fix(id): surface failed block-list lookups separately from unblocked (#…
dezren39 commentedon Nov 11, 2026
state: done
task: 15007
lane: code-a
stage: done
Done — fixed_merged. PR #8761 squash-merged as 703f0d6; issue #8750 CLOSED.
What changed: BlockList gained a distinguishing lookup outcome — BlockLookup (Blocked / Unblocked / Indeterminate(BlockLookupFailure::{Corrupt, Storage, Unavailable})) in id-core, re-exported through id-store/id-events. EventStore and SharedEventStore override lookup() with their real results (a poisoned lock is Unavailable) and log a tracing::warn! operator diagnostic; their is_blocked now delegates to lookup() == Blocked so the seams cannot diverge. Enforcement callers state their indeterminate policy explicitly — all fail-open per the documented default, each with a warn diagnostic: AbuseEvaluator (peer + IP), PullGate::admits (plus new peer_lookup/topic_tag_lookup accessors), blob_gate::decide_with_blocks, and the log_sync topic-tag check. LocalEvents::lookup_block exposes the answer to operator surfaces. Failure categories only cross the seam — no storage details leak to peers. Design record: doc/2026-11-11T19-15-00Z_design_block_lookup/ (pkgs/id/docs symlink).
Verification (oracle: a failed lookup is distinguishable from an ordinary unblocked result):
Pre-existing, not caused here: cargo test -p id-sync --lib does not compile standalone on clean main (id_core::connectivity::silent feature) — filed as #8760. PR checks stayed QUEUED in the ongoing Actions runner stall; local laptop tests were the operative gate.