Skip to main content

Intelligence, indexing, and pattern services as first-class Omninode nodes

Project description

OmniIntelligence

Python 3.12+ uv Linting: ruff Type checked: mypy Pre-commit Nodes: 21

Intelligence, pattern learning, and code quality analysis as first-class ONEX nodes.

Table of Contents

Overview

OmniIntelligence is the intelligence platform for the ONEX ecosystem. It provides code quality analysis, ML-based pattern learning, semantic analysis, and Claude Code hook processing — all implemented as declarative ONEX nodes following the thin-shell pattern.

The system is registered as a domain plugin (PluginIntelligence) and discovered at runtime by RuntimeHostProcess from omnibase_infra. Nodes declare their Kafka subscriptions and handler routing in contract.yaml; the runtime wires everything automatically.

For architecture details, invariants, and handler patterns, see CLAUDE.md.

Prerequisites

  • Python 3.12+
  • uv for dependency management (required — do not use pip or Poetry directly)

Installation

# Core node system + all infrastructure dependencies
uv sync --group core

# Development tools (ruff, mypy, pytest)
uv sync --group dev

# Everything (core + dev)
uv sync --group all

# Install pre-commit hooks
pre-commit install

ONEX ecosystem dependencies (NOT on public PyPI — installed via editable installs from sibling repos or private registry):

Package Version Purpose
omnibase-core >=0.18.0,<0.19.0 Node base classes, protocols, validation
omnibase-spi >=0.10.0,<0.11.0 Service Provider Interface protocols
omnibase-infra >=0.8.0,<0.9.0 Kafka, PostgreSQL, runtime infrastructure

Architecture

The system decomposes intelligence operations into 21 specialized ONEX nodes across four types.

Node Inventory

Orchestrators — coordinate multi-step workflows

Node Purpose
NodeIntelligenceOrchestrator Main workflow coordination (contract-driven)
NodePatternAssemblerOrchestrator Pattern assembly from execution traces

Reducer — FSM state management

Node Purpose
NodeIntelligenceReducer Unified FSM handler for ingestion, pattern learning, and quality assessment

Compute nodes — pure data processing, no side effects

Node Purpose
NodeQualityScoringCompute Code quality scoring with ONEX compliance
NodeSemanticAnalysisCompute Semantic code analysis
NodePatternExtractionCompute Extract patterns from code
NodePatternLearningCompute ML pattern learning pipeline
NodePatternMatchingCompute Match patterns against code
NodeIntentClassifierCompute User prompt intent classification
NodeExecutionTraceParserCompute Parse execution traces
NodeSuccessCriteriaMatcherCompute Match success criteria against outcomes

Effect nodes — external I/O (Kafka, PostgreSQL)

Node Purpose
NodeClaudeHookEventEffect Process Claude Code hook events; emit classified intents to Kafka
NodePatternStorageEffect Persist patterns to PostgreSQL
NodePatternPromotionEffect Promote patterns (provisional → validated)
NodePatternDemotionEffect Demote patterns (validated → deprecated)
NodePatternFeedbackEffect Record session outcomes and metrics
NodePatternLifecycleEffect Atomic lifecycle transitions with audit trail
NodePatternLearningEffect Pattern learning effect (contract-only)
NodeComplianceEvaluateEffect Evaluate compliance rules against patterns
NodeEnforcementFeedbackEffect Record enforcement feedback and confidence adjustments
NodePatternComplianceEffect Pattern compliance assessment pipeline

Runtime Plugin

PluginIntelligence (omniintelligence.runtime.plugin) is the domain plugin entry point registered under onex.domain_plugins. It is discovered by RuntimeHostProcess, which manages the process lifecycle. PluginIntelligence itself scans contract.yaml files (via collect_subscribe_topics_from_contracts()) to wire Kafka subscriptions and handler routing.

API Module

omniintelligence.api exposes HTTP endpoints (FastAPI/uvicorn) for intelligence operations.

Project Structure

src/omniintelligence/
├── nodes/                              # 21 ONEX nodes
│   ├── node_claude_hook_event_effect/
│   ├── node_compliance_evaluate_effect/
│   ├── node_enforcement_feedback_effect/
│   ├── node_execution_trace_parser_compute/
│   ├── node_intelligence_orchestrator/
│   ├── node_intelligence_reducer/
│   ├── node_intent_classifier_compute/
│   ├── node_pattern_assembler_orchestrator/
│   ├── node_pattern_compliance_effect/
│   ├── node_pattern_demotion_effect/
│   ├── node_pattern_extraction_compute/
│   ├── node_pattern_feedback_effect/
│   ├── node_pattern_learning_compute/
│   ├── node_pattern_learning_effect/
│   ├── node_pattern_lifecycle_effect/
│   ├── node_pattern_matching_compute/
│   ├── node_pattern_promotion_effect/
│   ├── node_pattern_storage_effect/
│   ├── node_quality_scoring_compute/
│   ├── node_semantic_analysis_compute/
│   └── node_success_criteria_matcher_compute/
├── runtime/                            # PluginIntelligence, MessageDispatchEngine wiring
├── api/                                # FastAPI HTTP endpoints
├── repositories/                       # Database access layer
├── handlers/                           # Shared handler functions
├── models/                             # Shared Pydantic models
├── enums/                              # Domain enumerations
├── protocols/                          # Protocol interfaces
├── utils/                              # Utilities
├── testing/                            # Shared test helpers and fixtures
├── tools/                              # Internal tooling and scripts
├── audit/                              # Audit and compliance utilities
├── _legacy/                            # Legacy code (do not import)
└── constants.py                        # Module-level constants

tests/
├── audit/                              # I/O purity enforcement (AST analysis)
├── unit/                               # Unit tests (no infrastructure)
│   └── nodes/                          # Primary location for node-specific unit tests (10+ node subdirectories)
├── integration/                        # Integration tests
├── nodes/                              # Legacy/transitional node tests (limited coverage, single entry)
└── fixtures/                           # Shared test data

Each node directory contains:

node_example_compute/
├── contract.yaml        # Declarative: I/O models, handler routing, event bus topics
├── node.py              # Thin shell (~20-50 lines), delegates to handler
├── models/              # Input/output Pydantic models
└── handlers/            # All business logic, error handling, logging

Development

# Lint (includes import sorting)
uv run ruff check src tests

# Auto-fix lint issues
uv run ruff check --fix src tests

# Format
uv run ruff format src tests

# Type check
uv run mypy src

# Run all tests
uv run pytest

# Run with coverage
uv run pytest --cov=src/omniintelligence --cov-report=html

Testing

uv run pytest tests/unit          # Unit tests (no infrastructure required)
uv run pytest tests/integration   # Integration tests (requires Kafka + PostgreSQL)
uv run pytest -m unit             # Only @pytest.mark.unit tests
uv run pytest -m audit            # I/O purity enforcement
uv run pytest -m "not slow"       # Exclude slow tests
uv run pytest -k "test_name"      # Single test by name

pytest Markers

Marker Purpose
unit Fast, isolated unit tests
integration Tests requiring live infrastructure
slow Long-running tests
audit AST-based I/O purity enforcement (network client imports, env var access, file I/O in nodes)
performance Performance benchmarks

For infrastructure configuration (Kafka, PostgreSQL, remote server topology), see ~/.claude/CLAUDE.md.


Copyright © 2024 OmniNode Team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omniintelligence-0.6.0.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omniintelligence-0.6.0-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file omniintelligence-0.6.0.tar.gz.

File metadata

  • Download URL: omniintelligence-0.6.0.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for omniintelligence-0.6.0.tar.gz
Algorithm Hash digest
SHA256 49bf6802978d8df73e2361d26052630d973becf2a4d00577825774e5878366ac
MD5 b85224e16963446155d1b89ce3ce68d3
BLAKE2b-256 affa790da86051e8c3051f89a97651e6e21750145dad8c949165fbf2a2502456

See more details on using hashes here.

File details

Details for the file omniintelligence-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: omniintelligence-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for omniintelligence-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c9326f96ce648b35aa026587a9d5d4945fe005b67e15739aed90bb1dbd92617
MD5 b771a3efb0daf6bad466c8edbe0e547d
BLAKE2b-256 a7592f241434b699fdafb5f97929d6c8a7c3b9b103fa102595f3a9585aa86c21

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page