Skip to content

feat: GRAPH-side Redis Streams adapter — closes bidirectional ENRICH↔GRAPH loop#95

Open
cryptoxdog wants to merge 3 commits into
mainfrom
feat/enrich-graph-bidirectional-convergence-loop
Open

feat: GRAPH-side Redis Streams adapter — closes bidirectional ENRICH↔GRAPH loop#95
cryptoxdog wants to merge 3 commits into
mainfrom
feat/enrich-graph-bidirectional-convergence-loop

Conversation

@cryptoxdog

Copy link
Copy Markdown
Collaborator

Summary

GRAPH-side companion to EIE PR Quantum-L9/Enrichment.Inference.Engine#31.

Adds RedisStreamAdapter to the GRAPH repo so the graph_worker can publish
graph.inference.complete events after every materialization batch.
EIE's new GraphInferenceConsumer subscribes and feeds qualifying inferred
triples back into the convergence loop.


New File

engine/adapters/redis_stream_adapter.py

  • Async RedisStreamAdapter class wrapping redis.asyncio
  • publish_inference_event() — publishes to graph.inference.complete stream with:
    • entity_id, domain, run_id
    • inferred_triples (list of subject/predicate/object/confidence dicts)
    • materialization_pass, graph_confidence
  • Non-fatal failure path — if Redis is unavailable, EIE degrades gracefully (no GRAPH signals, loop exits normally)
  • STREAM_MAXLEN = 50_000 with approximate trim to bound memory

Integration Point

Call await redis_adapter.publish_inference_event(...) in graph_worker.py after each materialization batch completes. Wire the adapter via Settings.redis_url.

Stream Contract

Stream:  graph.inference.complete
Payload: {"entity_id": str, "domain": str, "run_id": str,
          "inferred_triples": [...], "materialization_pass": int,
          "graph_confidence": float}

Companion PR

EIE consumer side: Quantum-L9/Enrichment.Inference.Engine#31


IgorBot · 2026-04-01

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Apr 1, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@cryptoxdog has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 23 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 9 minutes and 23 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 310e2b65-74d4-4766-a060-dd9cadc88b4f

📥 Commits

Reviewing files that changed from the base of the PR and between d6520d0 and 056ecc1.

📒 Files selected for processing (99)
  • chassis/errors.py
  • engine/adapters/redis_stream_adapter.py
  • engine/arbitration/engine.py
  • engine/arbitration/schema.py
  • engine/auth/capabilities.py
  • engine/boot.py
  • engine/causal/attribution.py
  • engine/causal/causal_compiler.py
  • engine/compliance/audit_persistence.py
  • engine/contract_enforcement.py
  • engine/convergence_controller_patch.py
  • engine/diagnostics/__init__.py
  • engine/diagnostics/dissimilarity.py
  • engine/diagnostics/fingerprint.py
  • engine/gds/scheduler.py
  • engine/graph/circuit_breaker.py
  • engine/graph/community_export.py
  • engine/graph/driver.py
  • engine/graph/graph_sync_client_fix.py
  • engine/graph_return_channel.py
  • engine/handlers.py
  • engine/hoprag/config.py
  • engine/hoprag/indexer.py
  • engine/inference_bridge.py
  • engine/inference_rule_registry.py
  • engine/kge/cross_dimensional_ensemble.py
  • engine/models/outcomes.py
  • engine/outcomes/schema.py
  • engine/packet/bridge.py
  • engine/packet/packet_store.py
  • engine/personas/composer.py
  • engine/personas/suppression.py
  • engine/personas/synthesis.py
  • engine/scoring/assembler.py
  • engine/scoring/confidence.py
  • engine/scoring/helpfulness.py
  • engine/scoring/importance.py
  • engine/scoring/pareto_integrator.py
  • engine/scoring/weight_discovery.py
  • engine/security/P2_9_llm_schemas.py
  • engine/startup_wiring.py
  • engine/state.py
  • engine/traversal/edge_merger.py
  • engine/traversal/multihop.py
  • engine/traversal/pseudo_query.py
  • l9_core/models.py
  • tests/conftest.py
  • tests/contracts/test_contracts.py
  • tests/gap_fixes/test_gap1_contract.py
  • tests/gap_fixes/test_gap2_return_channel.py
  • tests/gap_fixes/test_gap3_inference_registry.py
  • tests/gap_fixes/test_gap5_audit.py
  • tests/integration/test_admin_handler.py
  • tests/integration/test_graph_driver.py
  • tests/integration/test_handlers.py
  • tests/integration/test_hoprag_pipeline.py
  • tests/integration/test_match_handler.py
  • tests/integration/test_outcomes_handler.py
  • tests/integration/test_sync_handler.py
  • tests/invariants/test_compliance.py
  • tests/invariants/test_configuration.py
  • tests/invariants/test_trust_boundary.py
  • tests/performance/test_query_latency.py
  • tests/performance/test_sync_throughput.py
  • tests/property/test_gates_property.py
  • tests/property/test_scoring_property.py
  • tests/scoring/test_benchmark.py
  • tests/security/test_compliance_security.py
  • tests/security/test_injection.py
  • tests/test_algorithmic_upgrades.py
  • tests/test_pareto_wiring.py
  • tests/unit/test_arbitration.py
  • tests/unit/test_compliance_checker.py
  • tests/unit/test_cross_dimensional_ensemble.py
  • tests/unit/test_cypher_utils.py
  • tests/unit/test_domain_loader.py
  • tests/unit/test_edge_merger.py
  • tests/unit/test_gate_compiler.py
  • tests/unit/test_handlers_enrich_health.py
  • tests/unit/test_handlers_extended.py
  • tests/unit/test_hgkr_gds_dag.py
  • tests/unit/test_loader.py
  • tests/unit/test_multihop_traversal.py
  • tests/unit/test_outcomes.py
  • tests/unit/test_packet_bridge.py
  • tests/unit/test_parameter_resolver.py
  • tests/unit/test_persona_composer.py
  • tests/unit/test_persona_selector.py
  • tests/unit/test_persona_synthesis.py
  • tests/unit/test_sanitize.py
  • tests/unit/test_scoring_assembler.py
  • tests/unit/test_sync_and_traversal.py
  • tests/unit/test_sync_generator.py
  • tests/unit/test_traversal_assembler.py
  • tests/unit/test_wave4_state_resilience.py
  • tests/unit/test_wave6_dormant_features.py
  • tools/contract_report.py
  • tools/hoprag_benchmark.py
  • tools/validate_domain.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/enrich-graph-bidirectional-convergence-loop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown

Too Many Files Changed
Changed: 99 files
Limit: 50 files
Action Required: Split into multiple focused PRs

PR Too Large
Lines changed: 1790
Limit: 1000 lines
Action Required: Break into smaller, atomic PRs

📋 Best Practices for Large Changes

  1. Refactoring + Features: Separate into 2 PRs
  2. Multiple Features: One PR per feature
  3. Database + Code: Separate migration from logic
  4. Generated Code: Separate from manual changes

🚫 This PR is blocked from merging until size limits are met.

IgorBot and others added 2 commits April 3, 2026 13:21
Resolve remaining terminology-guard offenders, eliminate contract-scanner false positives in sanitized causal Cypher builders, and bring ruff back to green with bounded mechanical edits.

GMP: Phase 0-6 complete; Scope: shared-blockers remediation on fix/shared-blockers-all-prs; Blast radius: engine/tests/tools mechanical lint+contract fixes; Validation: python3 tools/contract_scanner.py=PASS, ruff check .=PASS, terminology grep=PASS; Note: .pre-commit-config.yaml present but pre-commit executable/module unavailable in this environment.
- carry forward shared-blocker cleanup onto PR #95 branch
- narrow Redis publish failure handling to RedisError
- restructure publish path to satisfy Ruff without changing behavior

Verification:
- python3 tools/contract_scanner.py ✅
- ruff check . ✅

GMP: Phase 0-4 complete; scoped PR95 remediation only; static verification green.
@sonarqubecloud

sonarqubecloud Bot commented Apr 3, 2026

Copy link
Copy Markdown

@cryptoxdog

Copy link
Copy Markdown
Collaborator Author

Automated PR patrol review — 2026-04-22 UTC

Patrol note only; not a human approval. This PR has been open for 498.5h with no review.

  • CI status: FAILURE
  • Review decision: NONE
  • Draft: False
  • Files changed: 99 (python:99)
  • Heuristic scan: error_handling=1, typing=2

Top findings:

  • engine/compliance/audit_persistence.py:16 — Type ignore comment
  • engine/graph/graph_sync_client_fix.py:95 — Broad except Exception
  • engine/traversal/multihop.py:287 — Type ignore comment

Suggested next action: fix failing CI, then request review .

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