Claude/port omnicorp service local#80
Merged
Merged
Conversation
The worker previously POSTed messages to a remote aragorn-ranker omnicorp_overlay endpoint. Run the overlay logic locally instead, with the two Redis-backed lookups (curie_query, shared_count_query) replaced by read-only LMDB environments mounted from ./omnicorp_lmdb. https://claude.ai/code/session_01955f1668hzQXmhwa9AEXKs
Existing tests
- conftest now also replaces shepherd_utils.db.{data_db_client,
logs_db_client} and shepherd_utils.broker.{broker_client, lock_client}
with fakeredis. Patching aioredis.Redis alone never caught those
clients because they are constructed at module import. conftest also
swaps setup_tracer for a no-op so the OTLP exporter does not retry
against a non-existent Jaeger collector and stall pytest on shutdown.
- test_aragorn now feeds a "null" workflow and asserts on the mutated
task instead of expecting a broker hand-off the entrypoint never makes.
- test_aragorn_lookup, test_example, and test_example_lookup invoke
wrap_up_task explicitly after the worker function so the downstream
task actually lands on the broker for the assertion.
- test_filter_kgraph_orphans was importing the shared util rather than
the worker wrapper (do_filter_kgraph_orphans).
- test_invalid_json now matches the actual KeyError message.
- example_ara was storing the workflow as a list, which broke the JSON
parse in wrap_up_task; fixed.
- example_lookup was calling add_callback_id with the old 3-arg
signature; fixed to pass otel_trace.
- test_example_lookup mocks the async db helpers with AsyncMock and uses
a non-zero timeout so the worker does not fall into the cleanup path.
aragorn_omnicorp tests (new)
- LMDB envs are now opened lazily so the worker module imports cleanly
in tests without the production data files mounted.
- New tests/unit/aragorn/test_aragorn_omnicorp.py builds curie and
shared-count LMDBs in a tmp_path and exercises curie_query,
shared_count_query, make_key, batches, the full overlay path,
zero-count skipping, and the task entrypoint round-trip.
https://claude.ai/code/session_01955f1668hzQXmhwa9AEXKs
The previous approach imported shepherd_utils.otel from conftest before patching setup_tracer, which transitively pulled in opentelemetry.instrumentation.httpx -> pkg_resources. tox 4 venvs do not ship setuptools by default, so CI conftest collection died with ModuleNotFoundError: No module named 'pkg_resources'. Install a stub `shepherd_utils.otel` into sys.modules before any worker import sees it. The stub exposes setup_tracer returning a MagicMock, which is sufficient because no test exercises the process_task span path. This also avoids loading the real BatchSpanProcessor that otherwise keeps retrying against a non-existent Jaeger collector and stalls pytest on shutdown. https://claude.ai/code/session_01955f1668hzQXmhwa9AEXKs
Codecov Report❌ Patch coverage is
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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.
No description provided.