Skip to content

feat: split event listener protocols - #150

Merged
bagowix merged 2 commits into
mainfrom
feat/136-split-event-listeners
Aug 7, 2026
Merged

feat: split event listener protocols#150
bagowix merged 2 commits into
mainfrom
feat/136-split-event-listeners

Conversation

@bagowix

@bagowix bagowix commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • split listener hooks into narrow core, storage, and pipeline protocols while preserving the complete EventListener contract
  • narrow breaker/coordination and pipeline strategy annotations so focused listeners pass strict type checking
  • document the breaker-versus-strategy name namespace and regenerate the LLM documentation mirror

Checklist

  • Tests added or updated (suite stays at 100% coverage)
  • uv run ruff format --check and uv run ruff check pass
  • uv run mypy, uv run pyright and uv run pyrefly check pass
  • Docs updated (docs/) for user-facing changes
  • CHANGELOG.md [Unreleased] updated
  • Commits follow Conventional Commits

Related issues

Closes #136

Added

  • Added CoreEventListener, StorageEventListener, and PipelineEventListener to the public API.
  • Added typing support for core-only, storage-only, pipeline-only, and complete listeners.

Changed

  • Updated breaker, registry, engine, and HTTP integration APIs to accept CoreEventListener or StorageEventListener.
  • Updated pipeline and Tenacity APIs to accept PipelineEventListener.
  • Preserved the complete EventListener contract as a composite of the narrow protocols.
  • Clarified breaker and strategy name namespaces in listener documentation.
  • Regenerated docs/llms-full.txt and updated observability documentation.

Public API

  • Expanded the public listener protocol surface without changing EventListener members or notify behavior.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@bagowix, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 2 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d34c1bee-8f6f-4ae2-b31e-64a1ba333df9

📥 Commits

Reviewing files that changed from the base of the PR and between 28c7492 and 2072f43.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • docs/guides/observability.md
  • docs/llms-full.txt
  • tests/test_notify.py

Walkthrough

The PR splits EventListener into core, storage, and pipeline protocols. It updates listener annotations across public APIs and integrations, exports the new protocols, documents event-name namespaces, and adds protocol typing coverage.

Changes

Event listener protocol split

Layer / File(s) Summary
Listener contracts and exports
interlock/protocols.py, interlock/__init__.py
Adds CoreEventListener, StorageEventListener, and PipelineEventListener. EventListener combines all three protocols.
Core and storage API annotations
interlock/_engine.py, interlock/breaker.py, interlock/registry.py, interlock/integrations/*
Updates breaker, storage, registry, and transport listener parameters to accept core or storage protocols.
Pipeline annotations and dispatch
interlock/pipeline.py, interlock/integrations/tenacity.py, interlock/_notify.py
Uses PipelineEventListener for pipeline APIs. notify accepts each specialized protocol.
Documentation and typing validation
docs/guides/observability.md, docs/llms-full.txt, tests/test_notify.py, tests/typing_surface.py, CHANGELOG.md
Documents event ownership, name namespaces, and partial listeners. Tests cover protocol conformance and typed listener wiring.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • bagowix/interlock#148: Both changes update event-listener protocols, typing, and observability documentation.

Suggested labels: enhancement, documentation

🚥 Pre-merge checks | ✅ 7 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning CoreEventListener still includes storage hooks, so it is not breaker-only as required by issue #136. Remove storage hooks from CoreEventListener and keep them only in StorageEventListener.
Public Api Surface ⚠️ Warning Five public pipeline signatures change listener from EventListener to PipelineEventListener; no breaking-change label or migration note is present. Restore the original annotations, or label the PR breaking-change and add a CHANGELOG migration note for BulkheadStrategy.__init__, FallbackStrategy.__init__, PipelineBuilder.fallback, .retry, and .bulkhead.
✅ Passed checks (7 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits and accurately describes the protocol split.
Out of Scope Changes check ✅ Passed The changes remain within issue #136: protocol exports, annotations, documentation, changelog updates, and typing tests.
Zero-Dependency Core ✅ Passed Added imports outside integrations are interlock modules only; pyproject.toml keeps dependencies = []; init.py has no integration imports.
Changelog Entry ✅ Passed CHANGELOG.md has an [Unreleased] section with bullets describing the new listener contracts and strict type-checking behavior.
Docs And Llm Mirror ✅ Passed The PR changes exported listener protocols and integration annotations; observability.md is updated, docs/llms-full.txt changed in the same commit, and generator reconstruction matches it exactly.
Tests Accompany Behaviour Change ✅ Passed The PR changes Python files under interlock/ and also changes tests/test_notify.py and tests/typing_surface.py in the same commit.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/136-split-event-listeners

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 24 untouched benchmarks


Comparing feat/136-split-event-listeners (2072f43) with main (553ff37)

Open in CodSpeed

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
docs/guides/observability.md (1)

39-52: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Update the docs/llms.txt Observability entry.

The entry lists only EventListener. Add the three narrow protocols and state that core/storage hooks use breaker names while pipeline hooks use strategy names.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/observability.md` around lines 39 - 52, Update the Observability
entry in docs/llms.txt to list CoreEventListener, StorageEventListener, and
PipelineEventListener alongside EventListener. Document that core and storage
hooks receive breaker names, while pipeline hooks receive strategy names.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/guides/observability.md`:
- Around line 39-52: Revise the timing documentation in the observability guide
to apply the “after the protected call returns” behavior only to core and
storage breaker hooks. Document pipeline hook timing separately, noting that
PipelineEventListener callbacks occur during strategy execution, including retry
backoff, bulkhead admission failure, and fallback substitution paths.
- Around line 9-33: Make the protocol example runnable by adding the necessary
imports and definitions for Protocol, State, and Outcome before the listener
declarations, using the current public API symbols. Keep the CoreEventListener,
StorageEventListener, PipelineEventListener, and EventListener contracts
unchanged.

---

Nitpick comments:
In `@docs/guides/observability.md`:
- Around line 39-52: Update the Observability entry in docs/llms.txt to list
CoreEventListener, StorageEventListener, and PipelineEventListener alongside
EventListener. Document that core and storage hooks receive breaker names, while
pipeline hooks receive strategy names.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a927b3ec-b503-41fb-990b-57ef70aba461

📥 Commits

Reviewing files that changed from the base of the PR and between 553ff37 and 28c7492.

📒 Files selected for processing (18)
  • CHANGELOG.md
  • docs/guides/observability.md
  • docs/llms-full.txt
  • interlock/__init__.py
  • interlock/_engine.py
  • interlock/_notify.py
  • interlock/breaker.py
  • interlock/integrations/_registry.py
  • interlock/integrations/aiohttp.py
  • interlock/integrations/httpx.py
  • interlock/integrations/httpx2.py
  • interlock/integrations/requests.py
  • interlock/integrations/tenacity.py
  • interlock/pipeline.py
  • interlock/protocols.py
  • interlock/registry.py
  • tests/test_notify.py
  • tests/typing_surface.py
📜 Review details
⏰ Context from checks skipped due to timeout. (7)
  • GitHub Check: Run benchmarks
  • GitHub Check: quality (3.14t)
  • GitHub Check: quality (3.14)
  • GitHub Check: quality (3.11)
  • GitHub Check: quality (3.13)
  • GitHub Check: quality (3.12)
  • GitHub Check: Coverage
⚠️ CI failures not shown inline (2)

GitHub Actions: Code scanning AI findings on PR #150 / github-advanced-security: Code scanning AI findings on PR #150

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1mecho "RUNNER_TEMP=$RUNNER_TEMP"�[0m
 �[36;1mfind "$RUNNER_TEMP" -maxdepth 1 -type f -name 'git-credentials-*.config' -print -delete�[0m
 �[36;1m�[0m
 �[36;1m# Generate a unique token and stop processing workflow commands to prevent the runtime from injecting commands�[0m
 �[36;1mSTOP_***REDACTED_SECRET_ASSIGNMENT*** /proc/sys/kernel/random/uuid)�[0m
 �[36;1m�[0m
 �[36;1m# Use a trap to ensure we always resume command processing and check for�[0m
 �[36;1m# fallback error annotations, even if the runtime exits with a non-zero code�[0m
 �[36;1m# (which would otherwise cause set -e to abort the shell before we get here).�[0m
 �[36;1m# The trap preserves the original exit code.�[0m
 �[36;1mcopilot_cleanup() {�[0m
 �[36;1m  �[0m
 �[36;1m  if [ -n "${GIT_PROXY_PID:-}" ] && kill -0 "$GIT_PROXY_PID" 2>/dev/null; then�[0m
 �[36;1m    echo "Stopping git-proxy (pid=$GIT_PROXY_PID)..."�[0m
 �[36;1m    kill "$GIT_PROXY_PID" 2>/dev/null || true�[0m
 �[36;1m    for _ in {1..25}; do�[0m
 �[36;1m      if ! kill -0 "$GIT_PROXY_PID" 2>/dev/null; then break; fi�[0m
 �[36;1m      sleep 0.2�[0m
 �[36;1m    done�[0m
 �[36;1m    if kill -0 "$GIT_PROXY_PID" 2>/dev/null; then�[0m
 �[36;1m      echo "git-proxy did not stop gracefully; forcing termination."�[0m
 �[36;1m      kill -KILL "$GIT_PROXY_PID" 2>/dev/null || true�[0m
 �[36;1m    fi�[0m
 �[36;1m    wait "$GIT_PROXY_PID" 2>/dev/null || true�[0m
 �[36;1m  fi�[0m
 �[36;1m  �[0m
 �[36;1m  echo "::$STOP_***REDACTED_SECRET_ASSIGNMENT***
 �[36;1m  FALLBACK_FILE="${RUNNER_TEMP}/copilot-fallback-error.txt"�[0m
 �[36;1m  if [ -f "$FALLBACK_FILE" ]; then�[0m
 �[36;1m    FALLBACK_MSG=$(head -c 500 "$FALLBACK_FILE" | tr -d '\n\r')�[0m
 �[36;1m    echo "::error title=Copilot Error::${FALLBACK_MSG}"�[0m

GitHub Actions: Code scanning AI findings on PR #150 / 0_github-advanced-security.txt: Code scanning AI findings on PR #150

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1mecho "RUNNER_TEMP=$RUNNER_TEMP"�[0m
 �[36;1mfind "$RUNNER_TEMP" -maxdepth 1 -type f -name 'git-credentials-*.config' -print -delete�[0m
 �[36;1m�[0m
 �[36;1m# Generate a unique token and stop processing workflow commands to prevent the runtime from injecting commands�[0m
 �[36;1mSTOP_***REDACTED_SECRET_ASSIGNMENT*** /proc/sys/kernel/random/uuid)�[0m
 �[36;1m�[0m
 �[36;1m# Use a trap to ensure we always resume command processing and check for�[0m
 �[36;1m# fallback error annotations, even if the runtime exits with a non-zero code�[0m
 �[36;1m# (which would otherwise cause set -e to abort the shell before we get here).�[0m
 �[36;1m# The trap preserves the original exit code.�[0m
 �[36;1mcopilot_cleanup() {�[0m
 �[36;1m  �[0m
 �[36;1m  if [ -n "${GIT_PROXY_PID:-}" ] && kill -0 "$GIT_PROXY_PID" 2>/dev/null; then�[0m
 �[36;1m    echo "Stopping git-proxy (pid=$GIT_PROXY_PID)..."�[0m
 �[36;1m    kill "$GIT_PROXY_PID" 2>/dev/null || true�[0m
 �[36;1m    for _ in {1..25}; do�[0m
 �[36;1m      if ! kill -0 "$GIT_PROXY_PID" 2>/dev/null; then break; fi�[0m
 �[36;1m      sleep 0.2�[0m
 �[36;1m    done�[0m
 �[36;1m    if kill -0 "$GIT_PROXY_PID" 2>/dev/null; then�[0m
 �[36;1m      echo "git-proxy did not stop gracefully; forcing termination."�[0m
 �[36;1m      kill -KILL "$GIT_PROXY_PID" 2>/dev/null || true�[0m
 �[36;1m    fi�[0m
 �[36;1m    wait "$GIT_PROXY_PID" 2>/dev/null || true�[0m
 �[36;1m  fi�[0m
 �[36;1m  �[0m
 �[36;1m  echo "::$STOP_***REDACTED_SECRET_ASSIGNMENT***
 �[36;1m  FALLBACK_FILE="${RUNNER_TEMP}/copilot-fallback-error.txt"�[0m
 �[36;1m  if [ -f "$FALLBACK_FILE" ]; then�[0m
 �[36;1m    FALLBACK_MSG=$(head -c 500 "$FALLBACK_FILE" | tr -d '\n\r')�[0m
 �[36;1m    echo "::error title=Copilot Error::${FALLBACK_MSG}"�[0m
🧰 Additional context used
📓 Path-based instructions (15)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Support Python 3.11 and newer; use Python 3.11+ features where required.
Keep the core zero-dependency and use only the standard library; external dependencies must be isolated behind optional integrations.
Use injected Clock instances for all time access; do not call time.monotonic() or sleep() directly in logic.
Implement the core as an I/O-free state machine with a single threading.Lock around the await-free critical section, never held across the protected call.
Use Protocols for extension points: Clock, SlidingWindow, Storage, FailureClassifier, and EventListener; do not inherit from internal classes.
Expose one public CircuitBreaker class for sync and async operation, with separate internal paths selected by coroutine detection.
Expose the public API through the package __init__.py; keep helpers underscore-prefixed and hidden.
Use absolute imports, placed at the top of the file, ordered as standard library, third-party, then local imports with blank lines between groups.
Use a maximum line length of 100 characters, single-quoted strings, f-strings, and pathlib.Path instead of os.path.
Annotate every parameter and return value; use modern generic syntax and X | None instead of Optional[X].
Use StrEnum or module-level constants instead of magic constants.
When a constructor or function has three or more arguments, pass them by keyword.
Keep functions focused on one job, generally no longer than 20–30 lines, with minimal side effects and extracted repeated loop logic.
Use async/await for I/O-bound work, asyncio.TaskGroup instead of asyncio.gather, and asyncio.to_thread or ProcessPoolExecutor for CPU-bound work.
Do not mix sync and async in one function; never await a sync callable or block on an async callable.
Fail fast on invalid input or state by raising immediately; do not continue with partial results or invented defaults.
Catch only expected exceptions, log them with context, and re-raise; do not use ...

Files:

  • interlock/_notify.py
  • interlock/_engine.py
  • interlock/integrations/_registry.py
  • interlock/__init__.py
  • interlock/breaker.py
  • interlock/integrations/requests.py
  • interlock/registry.py
  • interlock/integrations/aiohttp.py
  • tests/test_notify.py
  • interlock/pipeline.py
  • interlock/integrations/httpx.py
  • interlock/protocols.py
  • interlock/integrations/tenacity.py
  • tests/typing_surface.py
  • interlock/integrations/httpx2.py
interlock/_notify.py

📄 CodeRabbit inference engine (AGENTS.md)

In interlock/_notify.py, log EventListener hook exceptions with traceback and swallow them; allow BaseException to propagate.

Files:

  • interlock/_notify.py
{interlock/**/*.py,docs/**/*.md,docs/llms-full.txt,docs/llms.txt}

📄 CodeRabbit inference engine (Custom checks)

When a change affects user-facing behaviour through the public API, integrations, or configuration options, update the relevant page under docs/ and regenerate docs/llms-full.txt; when adding a new documentation page, list it under ## Docs in docs/llms.txt.

Files:

  • interlock/_notify.py
  • interlock/_engine.py
  • interlock/integrations/_registry.py
  • interlock/__init__.py
  • interlock/breaker.py
  • interlock/integrations/requests.py
  • interlock/registry.py
  • interlock/integrations/aiohttp.py
  • docs/llms-full.txt
  • interlock/pipeline.py
  • interlock/integrations/httpx.py
  • docs/guides/observability.md
  • interlock/protocols.py
  • interlock/integrations/tenacity.py
  • interlock/integrations/httpx2.py
interlock/**/*.py

📄 CodeRabbit inference engine (Custom checks)

Every production behaviour change in interlock/ must be accompanied by a change under tests/; changes limited to docstrings, comments, or type annotations are exempt. Bug fixes must include at least one regression test that fails without the production fix.

Keep the core dependency-free; external dependencies must belong to extras and be imported lazily.

Files:

  • interlock/_notify.py
  • interlock/_engine.py
  • interlock/integrations/_registry.py
  • interlock/__init__.py
  • interlock/breaker.py
  • interlock/integrations/requests.py
  • interlock/registry.py
  • interlock/integrations/aiohttp.py
  • interlock/pipeline.py
  • interlock/integrations/httpx.py
  • interlock/protocols.py
  • interlock/integrations/tenacity.py
  • interlock/integrations/httpx2.py

⚙️ CodeRabbit configuration file

Core rules (AGENTS.md is authoritative): (1) Zero-dependency core — anything under interlock/ except interlock/integrations/ may import stdlib only. Flag every third-party import as a blocking issue. (2) No fallbacks, no silent excepts, no a or b or c for required config or data, no hidden retries. Invalid input or state raises immediately. interlock/_notify.py is the one sanctioned swallow (listener hooks are observability, logged with traceback, BaseException still propagates) — do not suggest generalising or "fixing" it. (3) Time comes only from the injected Clock protocol; direct time.monotonic()/time.sleep() in library logic is a bug. (4) Style: 100-char lines, single quotes, f-strings, pathlib, full annotations, X | None never Optional[X], keyword arguments for calls with 3+ arguments, no magic constants (StrEnum or module constants), functions under ~30 lines. (5) Extension points are Protocols (Clock, SlidingWindow, Storage, FailureClassifier, EventListener) — do not propose inheriting internal classes. (6) Sync and async live in one CircuitBreaker with separate internal paths; never propose Sync*/Async* twins and never mix the two paths in one function. (7) Public API is exported from interlock/init.py; everything else is underscore-prefixed. New public symbols need __all__ and a docstring. (8) Python 3.11 is the floor — no 3.12+ syntax or stdlib.

Files:

  • interlock/_notify.py
  • interlock/_engine.py
  • interlock/integrations/_registry.py
  • interlock/__init__.py
  • interlock/breaker.py
  • interlock/integrations/requests.py
  • interlock/registry.py
  • interlock/integrations/aiohttp.py
  • interlock/pipeline.py
  • interlock/integrations/httpx.py
  • interlock/protocols.py
  • interlock/integrations/tenacity.py
  • interlock/integrations/httpx2.py
{interlock/*.py,interlock/!(integrations)/**/*.py,pyproject.toml}

📄 CodeRabbit inference engine (Custom checks)

Keep the core zero-dependency: files under interlock/ outside interlock/integrations/ may import only the standard library or other interlock modules; [project] dependencies in pyproject.toml must remain empty; and interlock/__init__.py must not re-export from interlock.integrations.

Files:

  • interlock/_notify.py
  • interlock/_engine.py
  • interlock/__init__.py
  • interlock/breaker.py
  • interlock/registry.py
  • interlock/pipeline.py
  • interlock/protocols.py
interlock/_engine.py

📄 CodeRabbit inference engine (AGENTS.md)

Run mutation testing with mutmut whenever _engine.py is changed.

Mutation testing covers lock scope, dispatch, and recording order; survivors outside the documented equivalent-mutant classes indicate missing tests and should be fixed with tests.

Files:

  • interlock/_engine.py
interlock/{_state_machine,_engine,_coordination}.py

⚙️ CodeRabbit configuration file

The critical section. Verify: the state machine stays I/O-free and unaware of sync vs async; the threading.Lock covers only the await-free acquire and record sections and is never held across the protected call (a call under the lock is a deadlock and a throughput bug); HALF_OPEN still bounds concurrent probes. Ask whether uv run mutmut run was run — AGENTS.md requires it for these files, because 100% coverage here does not prove the new assertions bite.

Files:

  • interlock/_engine.py
interlock/integrations/**/*.py

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Integration dependencies must be optional extras and imported lazily.

Files:

  • interlock/integrations/_registry.py
  • interlock/integrations/requests.py
  • interlock/integrations/aiohttp.py
  • interlock/integrations/httpx.py
  • interlock/integrations/tenacity.py
  • interlock/integrations/httpx2.py

⚙️ CodeRabbit configuration file

Optional extras. The third-party import must stay inside this package, must never be re-exported from interlock/init.py, and a missing extra must fail with a clear install hint rather than a fallback. Wrap the dependency behind the project's own types so its objects do not leak into core signatures. Check that the extra is declared in pyproject.toml [project.optional-dependencies] and documented under docs/integrations/.

Files:

  • interlock/integrations/_registry.py
  • interlock/integrations/requests.py
  • interlock/integrations/aiohttp.py
  • interlock/integrations/httpx.py
  • interlock/integrations/tenacity.py
  • interlock/integrations/httpx2.py
**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Document user-facing changes in English Markdown documentation and keep generated documentation mirrors synchronized.

Files:

  • CHANGELOG.md
  • docs/guides/observability.md
CHANGELOG.md

📄 CodeRabbit inference engine (AGENTS.md)

Add every change to the [Unreleased] section under Added, Fixed, or Changed, explaining user impact rather than only symbol movement.

User-facing changes must update the [Unreleased] section.

Files:

  • CHANGELOG.md

⚙️ CodeRabbit configuration file

Keep a Changelog format. New entries go under ## [Unreleased] in Added / Fixed / Changed. An entry describes what a user could not do before and can now, not which symbol moved. Only the release commit dates a section and updates the link references.

Files:

  • CHANGELOG.md
{interlock/__init__.py,interlock/pipeline.py}

📄 CodeRabbit inference engine (Custom checks)

Do not remove or change signatures of symbols exported from interlock/__init__.py or interlock/pipeline.py—including removed or reordered positional parameters, narrowed types, or renamed public names—unless the PR has the breaking-change label and CHANGELOG.md includes a migration note. CI enforces this with uv run griffe check.

Files:

  • interlock/__init__.py
  • interlock/pipeline.py
docs/llms-full.txt

⚙️ CodeRabbit configuration file

Generated artefact — produced by uv run python scripts/build_llms_full.py. Do not review its content or suggest edits; only confirm it was regenerated together with the docs/ changes in the same PR.

Files:

  • docs/llms-full.txt
tests/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

tests/**/*.py: Use pytest functions rather than test classes, with names formatted as test__unit_of_work__state_under_test__expected_behavior.
Mirror package layout in test filenames, use Arrange-Act-Assert, and create fixtures for repeated setup.
Use injected Clock instances for deterministic tests; do not use sleep() in tests.
Use pytest-asyncio and @pytest.mark.asyncio for asynchronous tests, and use pytest-mock to isolate external dependencies.
Use Hypothesis property-based tests for the state machine and cover all transitions and races.
Write the reproducing test before a bug fix and specify the required behavior before implementing a feature.

Tests must preserve 100% coverage, avoid sleep for time-dependent behavior, and use injected clocks instead.

Files:

  • tests/test_notify.py
  • tests/typing_surface.py

⚙️ CodeRabbit configuration file

pytest functions only, never test classes. Names follow test__unit_of_work__state_under_test__expected_behavior in lower case. One behaviour per test, Arrange-Act-Assert. Time is the injected fake Clock — any real sleep or wall-clock read is flakiness, flag it. Async tests use @pytest.mark.asyncio; state-machine work carries hypothesis property tests. Coverage must stay at 100%: point out uncovered branches the diff introduces. Tests run under -n auto, so anything relying on ordering or shared global state is a bug.

Files:

  • tests/test_notify.py
  • tests/typing_surface.py
docs/**/*.{md,mdx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

User-facing changes must update the relevant documentation page under docs/.

Files:

  • docs/guides/observability.md
docs/**/*.md

⚙️ CodeRabbit configuration file

User-facing documentation. Check that code samples match the current public API and would actually run. A new page must also be listed in docs/llms.txt under ## Docs. Keep the existing voice: short sentences, no marketing.

Files:

  • docs/guides/observability.md
🔇 Additional comments (14)
docs/guides/observability.md (1)

145-165: LGTM!

docs/llms-full.txt (1)

1781-1824: LGTM!

Also applies to: 1917-1937

tests/test_notify.py (2)

26-33: LGTM!


145-152: 🎯 Functional Correctness

No runtime-checkability issue

All three listener protocols use @runtime_checkable; these isinstance() assertions do not raise TypeError.

			> Likely an incorrect or invalid review comment.
tests/typing_surface.py (1)

16-25: LGTM!

Also applies to: 35-49, 59-68

CHANGELOG.md (1)

11-18: LGTM!

interlock/_engine.py (2)

31-38: LGTM!


92-92: 📐 Maintainability & Code Quality

Run the required mutation test.

interlock/_engine.py changed. Run uv run mutmut run and confirm coverage for lock scope, dispatch, and recording order.

As per path instructions, run mutation testing with mutmut whenever _engine.py changes.

Source: Path instructions

interlock/breaker.py (2)

29-36: LGTM!


77-77: 🗄️ Data Integrity & Integration

Keep the specialized listener protocols.

EventListener extends the specialized protocols, so existing complete listeners remain accepted. The specialized annotations also allow partial listeners and match the documented API.

			> Likely an incorrect or invalid review comment.
interlock/integrations/requests.py (1)

35-35: LGTM!

Also applies to: 115-115

interlock/pipeline.py (1)

40-40: LGTM!

interlock/integrations/tenacity.py (1)

72-72: LGTM!

Also applies to: 198-198

interlock/_notify.py (1)

27-41: LGTM!

Comment thread docs/guides/observability.md
Comment thread docs/guides/observability.md
@bagowix
bagowix merged commit 03d610d into main Aug 7, 2026
17 of 18 checks passed
@bagowix
bagowix deleted the feat/136-split-event-listeners branch August 7, 2026 20:54
@bagowix bagowix mentioned this pull request Aug 7, 2026
6 tasks
bagowix added a commit that referenced this pull request Aug 7, 2026
## Summary

Prepare the `2.5.0` minor release.

- Bump the package version from `2.4.0` to `2.5.0`.
- Move the current `[Unreleased]` changelog entries into `[2.5.0] -
2026-08-08`.
- Update changelog comparison links and the comparison-page release
version.
- Regenerate `docs/llms-full.txt`.

Minor, not patch: the release includes backward-compatible public
additions: configurable transport breaker names, shared caller-owned
registries, and narrower listener protocols.

## Checklist

- [x] Tests added or updated (suite stays at 100% coverage)
- [x] `uv run ruff format --check` and `uv run ruff check` pass
- [x] `uv run mypy`, `uv run pyright` and `uv run pyrefly check` pass
- [x] Docs updated (`docs/`) for user-facing changes
- [x] `CHANGELOG.md` `[Unreleased]` updated
- [x] Commits follow Conventional Commits

Additional release checks: package and strict documentation builds pass.
Griffe reports only the expected public `VERSION` change (`2.4.0` →
`2.5.0`).

## Related issues

Closes #148
Closes #149
Closes #150
Closes #151
Closes #152
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.

Split EventListener into core, storage and pipeline protocols

1 participant