Skip to content

Claude/port omnicorp service local#80

Merged
maximusunc merged 6 commits into
mainfrom
claude/port-omnicorp-service-local-vKJhf
May 5, 2026
Merged

Claude/port omnicorp service local#80
maximusunc merged 6 commits into
mainfrom
claude/port-omnicorp-service-local-vKJhf

Conversation

@maximusunc
Copy link
Copy Markdown
Collaborator

No description provided.

claude and others added 5 commits May 5, 2026 16:08
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
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 71.90476% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.25%. Comparing base (928e4d8) to head (51c0931).
⚠️ Report is 128 commits behind head on main.

Files with missing lines Patch % Lines
workers/aragorn_omnicorp/worker.py 71.92% 38 Missing and 19 partials ⚠️
workers/bte_lookup/worker.py 0.00% 1 Missing ⚠️
workers/gandalf/worker.py 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
shepherd_utils/config.py 100.00% <100.00%> (ø)
workers/example_ara/worker.py 42.55% <100.00%> (-21.34%) ⬇️
workers/example_lookup/worker.py 50.54% <100.00%> (-24.46%) ⬇️
workers/bte_lookup/worker.py 0.00% <0.00%> (ø)
workers/gandalf/worker.py 0.00% <0.00%> (ø)
workers/aragorn_omnicorp/worker.py 65.61% <71.92%> (+65.61%) ⬆️

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3cd9662...51c0931. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maximusunc maximusunc merged commit 7416186 into main May 5, 2026
2 checks passed
@maximusunc maximusunc deleted the claude/port-omnicorp-service-local-vKJhf branch May 5, 2026 20:47
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.

2 participants