Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
de288b7
refactor: enforce file/class naming conventions across codebase [OMN-…
jonahgabriel Jan 15, 2026
fec8cf4
Merge origin/main into jonah/omn-1305-standardization-enforce-naming-…
jonahgabriel Jan 15, 2026
43bd4d5
fix: address PR #151 review feedback and pre-existing validation erro…
jonahgabriel Jan 15, 2026
5c3e20c
fix: resolve mypy errors in Kafka mixin files using Protocol pattern
jonahgabriel Jan 15, 2026
329d596
fix: address PR #151 review issues and CI failures [OMN-1305]
jonahgabriel Jan 15, 2026
115bb20
fix: update kafka_event_bus references to event_bus_kafka [OMN-1305]
jonahgabriel Jan 15, 2026
acd9092
fix: address PR #151 review issues (CRITICAL/MAJOR/MINOR) [OMN-1305]
jonahgabriel Jan 15, 2026
be91294
fix: address all PR #151 review issues (release ready) [OMN-1305]
jonahgabriel Jan 15, 2026
5399c90
merge: resolve conflict with main branch
jonahgabriel Jan 15, 2026
d68fd1e
merge: resolve conflicts with main branch and fix policy tests
jonahgabriel Jan 15, 2026
7deae16
fix: address all PR #151 review issues (release ready)
jonahgabriel Jan 15, 2026
61ffb20
feat: address PR review feedback items
jonahgabriel Jan 15, 2026
135f94d
fix: address all PR #151 review feedback (release ready)
jonahgabriel Jan 15, 2026
589e838
merge: resolve conflicts with main branch
jonahgabriel Jan 15, 2026
72fe4ee
fix: address remaining PR #151 review feedback (parallel-solve)
jonahgabriel Jan 16, 2026
8ea3647
fix: address PR #151 review feedback and CI failures (release ready)
jonahgabriel Jan 16, 2026
c764838
fix: address remaining PR #151 review feedback (release ready)
jonahgabriel Jan 16, 2026
2334718
fix: address PR #151 review feedback + enhance union validator [OMN-1…
jonahgabriel Jan 16, 2026
0c07b9d
fix: address all PR #151 review feedback for release ready [OMN-1305]
jonahgabriel Jan 16, 2026
f066b16
merge: resolve conflicts from main (OMN-1203 corpus capture service)
jonahgabriel Jan 16, 2026
a826f62
fix: address all PR #151 review feedback for release ready [OMN-1305]
jonahgabriel Jan 16, 2026
4ef2a74
merge: resolve conflicts from main (OMN-1358 type alias refactoring)
jonahgabriel Jan 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
55 changes: 0 additions & 55 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
# =============================================================================
# Copy this file to .env and configure with your specific values.
#
# DEPRECATION SUMMARY (v2.0.0 Removal):
# -------------------------------------
# The following variables are deprecated and will be removed in v2.0.0:
#
# CONTRACTS_DIR -> ONEX_CONTRACTS_DIR
# COMPUTE_REGISTRY_CACHE_SIZE -> ONEX_COMPUTE_REGISTRY_CACHE_SIZE
#
# Search for "DEPRECATED:" in this file for migration instructions.
# Current behavior: System checks new name first, falls back to legacy name.
# Action: Migrate ALL deprecated variables before upgrading to v2.0.0.
#
# HOSTNAME RESOLUTION:
# -------------------
# This project supports two usage patterns:
Expand Down Expand Up @@ -240,30 +229,6 @@ ONEX_HTTP_PORT=8085
# Example: ./contracts, /app/contracts, /etc/onex/contracts
# ONEX_CONTRACTS_DIR=./contracts

# -----------------------------------------------------------------------------
# DEPRECATED: CONTRACTS_DIR
# -----------------------------------------------------------------------------
# Status: DEPRECATED - Will be removed in v2.0.0
# Replacement: ONEX_CONTRACTS_DIR
#
# DEPRECATION NOTICE:
# CONTRACTS_DIR is deprecated. Use ONEX_CONTRACTS_DIR instead.
# Support will be removed in v2.0.0.
#
# Migration Steps:
# 1. Rename CONTRACTS_DIR to ONEX_CONTRACTS_DIR in your .env file
# 2. Update any scripts or CI/CD pipelines that set CONTRACTS_DIR
# 3. Verify your application starts correctly with the new variable name
#
# Current Behavior (until v2.0.0):
# - System checks ONEX_CONTRACTS_DIR first
# - Falls back to CONTRACTS_DIR if ONEX_CONTRACTS_DIR is not set
# - Logs deprecation warning when CONTRACTS_DIR fallback is used
#
# Legacy name (DO NOT USE for new deployments):
# CONTRACTS_DIR=./contracts
# -----------------------------------------------------------------------------

# Kafka topics for main runtime
# Default: requests, responses, onex-runtime-main
# Example: requests, responses, onex-runtime-main (dev)
Expand Down Expand Up @@ -399,26 +364,6 @@ ONEX_GROUP_ID=onex-runtime-main
# - 128 entries = ~12.8 KB cache overhead
# - 512 entries = ~51.2 KB cache overhead

# -----------------------------------------------------------------------------
# DEPRECATED: COMPUTE_REGISTRY_CACHE_SIZE
# -----------------------------------------------------------------------------
# Status: DEPRECATED - Will be removed in v2.0.0
# Replacement: ONEX_COMPUTE_REGISTRY_CACHE_SIZE
#
# Migration Steps:
# 1. Rename COMPUTE_REGISTRY_CACHE_SIZE to ONEX_COMPUTE_REGISTRY_CACHE_SIZE
# 2. Update any scripts or CI/CD pipelines that set COMPUTE_REGISTRY_CACHE_SIZE
# 3. Verify your application starts correctly with the new variable name
#
# Current Behavior (until v2.0.0):
# - System checks ONEX_COMPUTE_REGISTRY_CACHE_SIZE first
# - Falls back to COMPUTE_REGISTRY_CACHE_SIZE if ONEX_ version is not set
# - Logs deprecation warning when legacy fallback is used
#
# Legacy name (DO NOT USE for new deployments):
# COMPUTE_REGISTRY_CACHE_SIZE=128
# -----------------------------------------------------------------------------

# =============================================================================
# Performance Threshold Configuration (Optional)
# =============================================================================
Expand Down
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@ repos:
types: [python]
pass_filenames: false
stages: [pre-commit]
# Naming convention validation - file and class naming [OMN-1305]
# Validates Handler*, Dispatcher*, Store*, Adapter*, etc. naming patterns
# Runtime: <3s (single pass with caching)
- id: onex-validate-naming
name: ONEX Naming Convention Validation
entry: poetry run python scripts/validation/validate_naming.py src/omnibase_infra --errors-only
language: system
types: [python]
pass_filenames: false
stages: [pre-commit]
# Union usage validation
# TECH DEBT: Baseline increased to 108 violations (OMN-871)
# Target: Reduce to 30 incrementally after PR #37 merges
Expand Down
176 changes: 176 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,182 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

> **IMPORTANT**: This section documents API changes that may require code modifications when upgrading. Review each item carefully before upgrading.

#### File and Class Naming Standardization (OMN-1305, PR #151)

This refactoring enforces consistent naming conventions across the entire codebase per CLAUDE.md standards. **All import paths and class names have changed.**

##### Summary of Changes

| Category | Count | Pattern Change |
|----------|-------|----------------|
| Event Bus | 2 files, 2 classes | `{name}_event_bus` → `event_bus_{name}` |
| Handlers | 6 files, 6 classes | Suffix → Prefix standardization |
| Protocols | 4 files, 4 classes | Removed `Handler` suffix, domain-specific naming |
| Runtime | 6 files, 6 classes | Added `service_`, `util_`, `registry_` prefixes |
| Validation | 8 files, 8 classes | `{name}_validator` → `validator_{name}` |
| Stores | 2 classes | Suffix → Prefix standardization |

##### Event Bus Renames

| Old File | New File |
|----------|----------|
| `inmemory_event_bus.py` | `event_bus_inmemory.py` |
| `kafka_event_bus.py` | `event_bus_kafka.py` |

| Old Class | New Class |
|-----------|-----------|
| `InMemoryEventBus` | `EventBusInmemory` |
| `KafkaEventBus` | `EventBusKafka` |

**Migration**:
```python
# BEFORE
from omnibase_infra.event_bus.inmemory_event_bus import InMemoryEventBus
from omnibase_infra.event_bus.kafka_event_bus import KafkaEventBus

# AFTER
from omnibase_infra.event_bus.event_bus_inmemory import EventBusInmemory
from omnibase_infra.event_bus.event_bus_kafka import EventBusKafka
```

##### Handler Renames

| Old File | New File |
|----------|----------|
| `handler_mock_registration_storage.py` | `handler_registration_storage_mock.py` |
| `handler_postgres_registration_storage.py` | `handler_registration_storage_postgres.py` |
| `handler_consul_service_discovery.py` | `handler_service_discovery_consul.py` |
| `handler_mock_service_discovery.py` | `handler_service_discovery_mock.py` |

| Old Class | New Class |
|-----------|-----------|
| `MockRegistrationStorageHandler` | `HandlerRegistrationStorageMock` |
| `PostgresRegistrationStorageHandler` | `HandlerRegistrationStoragePostgres` |
| `ConsulServiceDiscoveryHandler` | `HandlerServiceDiscoveryConsul` |
| `MockServiceDiscoveryHandler` | `HandlerServiceDiscoveryMock` |
| `HttpRestHandler` | `HandlerHttpRest` |

**Migration**:
```python
# BEFORE
from omnibase_infra.handlers.registration_storage.handler_postgres_registration_storage import (
PostgresRegistrationStorageHandler,
)

# AFTER
from omnibase_infra.handlers.registration_storage.handler_registration_storage_postgres import (
HandlerRegistrationStoragePostgres,
)
```

##### Protocol Renames

| Old File | New File |
|----------|----------|
| `protocol_registration_storage_handler.py` | `protocol_registration_persistence.py` |
| `protocol_service_discovery_handler.py` | `protocol_discovery_operations.py` |

| Old Class | New Class |
|-----------|-----------|
| `ProtocolRegistrationStorageHandler` | `ProtocolRegistrationPersistence` |
| `ProtocolServiceDiscoveryHandler` | `ProtocolDiscoveryOperations` |

**Migration**:
```python
# BEFORE
from omnibase_infra.handlers.registration_storage.protocol_registration_storage_handler import (
ProtocolRegistrationStorageHandler,
)

# AFTER
from omnibase_infra.handlers.registration_storage.protocol_registration_persistence import (
ProtocolRegistrationPersistence,
)
```

##### Runtime File Renames

| Old File | New File | Rationale |
|----------|----------|-----------|
| `policy_registry.py` | `registry_policy.py` | Registry prefix pattern |
| `message_dispatch_engine.py` | `service_message_dispatch_engine.py` | Service prefix pattern |
| `runtime_host_process.py` | `service_runtime_host_process.py` | Service prefix pattern |
| `wiring.py` | `util_wiring.py` | Util prefix pattern |
| `container_wiring.py` | `util_container_wiring.py` | Util prefix pattern |
| `validation.py` | `util_validation.py` | Util prefix pattern |

| Old Class | New Class |
|-----------|-----------|
| `PolicyRegistry` | `RegistryPolicy` |
| `ProtocolBindingRegistry` | `RegistryProtocolBinding` |
| `MessageTypeRegistry` | `RegistryMessageType` |
| `EventBusBindingRegistry` | `RegistryEventBusBinding` |

**Migration**:
```python
# BEFORE
from omnibase_infra.runtime.policy_registry import PolicyRegistry
from omnibase_infra.runtime.message_dispatch_engine import MessageDispatchEngine

# AFTER
from omnibase_infra.runtime.registry_policy import RegistryPolicy
from omnibase_infra.runtime.service_message_dispatch_engine import MessageDispatchEngine
```

##### Validation File Renames

| Old File | New File |
|----------|----------|
| `any_type_validator.py` | `validator_any_type.py` |
| `chain_propagation_validator.py` | `validator_chain_propagation.py` |
| `contract_linter.py` | `linter_contract.py` |
| `registration_security_validator.py` | `validator_registration_security.py` |
| `routing_coverage_validator.py` | `validator_routing_coverage.py` |
| `runtime_shape_validator.py` | `validator_runtime_shape.py` |
| `security_validator.py` | `validator_security.py` |
| `topic_category_validator.py` | `validator_topic_category.py` |
| `validation_aggregator.py` | `service_validation_aggregator.py` |

> **Note**: Class names within validation files remain unchanged (e.g., `AnyTypeDetector`, `ChainPropagationValidator`). Only import paths changed.

**Migration**:
```python
# BEFORE
from omnibase_infra.validation.any_type_validator import AnyTypeDetector
from omnibase_infra.validation.chain_propagation_validator import ChainPropagationValidator

# AFTER
from omnibase_infra.validation.validator_any_type import AnyTypeDetector
from omnibase_infra.validation.validator_chain_propagation import ChainPropagationValidator
```

##### Store Class Renames

| Old Class | New Class |
|-----------|-----------|
| `InMemoryIdempotencyStore` | `StoreIdempotencyInmemory` |
| `PostgresIdempotencyStore` | `StoreIdempotencyPostgres` |

##### Automated Migration

Run these commands to find affected imports in your codebase:

```bash
# Find all affected imports
grep -rE "(InMemoryEventBus|KafkaEventBus|PolicyRegistry|inmemory_event_bus|kafka_event_bus)" \
--include="*.py" /path/to/your/code

# Specific patterns for each category
grep -r "from omnibase_infra.event_bus.inmemory_event_bus" --include="*.py" .
grep -r "from omnibase_infra.event_bus.kafka_event_bus" --include="*.py" .
grep -r "from omnibase_infra.runtime.policy_registry" --include="*.py" .
grep -r "from omnibase_infra.validation.any_type_validator" --include="*.py" .
```

##### CI Enforcement

A new naming validator (`scripts/validation/validate_naming.py`) enforces these conventions. The CI pipeline will reject PRs that violate naming standards.

#### MixinNodeIntrospection API (OMN-881, PR #54)

##### 1. Cache Invalidation Method Signature Change
Expand Down
19 changes: 15 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,22 @@ The `@allow_any` decorator is recognized by the validator when applied to functi

| Type | File Pattern | Class Pattern |
|------|-------------|---------------|
| Model | `model_<name>.py` | `Model<Name>` |
| Adapter | `adapter_<name>.py` | `Adapter<Name>` |
| Constants | `constants_<name>.py` | (constants) |
| Dispatcher | `dispatcher_<name>.py` | `Dispatcher<Name>` |
| Enum | `enum_<name>.py` | `Enum<Name>` |
| Protocol | `protocol_<name>.py` or `protocols.py` | `Protocol<Name>` |
| Error | In `errors/` | `<Domain><Type>Error` |
| Mixin | `mixin_<name>.py` | `Mixin<Name>` |
| Model | `model_<name>.py` | `Model<Name>` |
| Node | `node.py` | `Node<Name><Type>` |
| Plugin | `plugin_<name>.py` | `Plugin<Name>` |
| Protocol | `protocol_<name>.py` or `protocols.py` | `Protocol<Name>` |
| Reducer | `reducer_<name>.py` | `Reducer<Name>` |
| Service | `service_<name>.py` | `Service<Name>` |
| Store | `store_<name>.py` | `Store<Name>` |
| Transport | `transport_<name>.py` | `Transport<Name>` |
| Util | `util_<name>.py` | (functions) |
| Error | In `errors/` | `<Domain><Type>Error` |
| Node | `node.py` | `Node<Name><Type>` |
| Validator | `validator_<name>.py` | `Validator<Name>` |

**Protocol File Naming**:
- Single protocol: `protocol_<name>.py`
Expand Down Expand Up @@ -544,6 +552,7 @@ class MyAdapter(MixinAsyncCircuitBreaker):
**States**: CLOSED → OPEN (after failures) → HALF_OPEN → CLOSED (on success)

**See**: `docs/patterns/circuit_breaker_implementation.md` for full implementation details
**See**: `docs/patterns/mixin_dependencies.md` for mixin composition patterns and dependency requirements

### Transport Types
| Type | Value |
Expand All @@ -565,6 +574,7 @@ Each dispatcher should:
- Raise `InfraUnavailableError` when circuit opens

**See**: `docs/patterns/dispatcher_resilience.md` for full pattern details
**See**: `docs/patterns/mixin_dependencies.md` for mixin composition and inheritance order

### Handler No-Publish Constraint

Expand Down Expand Up @@ -605,6 +615,7 @@ The `MixinNodeIntrospection` mixin uses Python reflection for service discovery.
- Configure Kafka topic ACLs for introspection topics

**See**: `docs/patterns/security_patterns.md#introspection-security` for complete threat model and deployment checklist
**See**: `docs/patterns/mixin_dependencies.md#mixinnodeintrospection` for initialization requirements

### Handler Plugin Loader Patterns

Expand Down
2 changes: 1 addition & 1 deletion contracts/handlers/http/handler_contract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Unique identifier for this handler
name: handler-http
# Fully qualified class path for dynamic import
handler_class: omnibase_infra.handlers.handler_http.HttpRestHandler
handler_class: omnibase_infra.handlers.handler_http.HandlerHttpRest
# Handler behavioral classification:
# This handler is 'effect' because it makes HTTP requests to external services
handler_type: effect
Expand Down
10 changes: 0 additions & 10 deletions docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,6 @@ REDIS_PASSWORD=__REPLACE_WITH_SECURE_PASSWORD__
# Semver LRU cache size for plugin version resolution.
# Increase for large deployments with many unique version strings.
# ONEX_COMPUTE_REGISTRY_CACHE_SIZE=128 # Range: 1-10000 (default: 128)
#
# -----------------------------------------------------------------------------
# DEPRECATED: COMPUTE_REGISTRY_CACHE_SIZE
# -----------------------------------------------------------------------------
# Status: DEPRECATED - Will be removed in v2.0.0
# Replacement: ONEX_COMPUTE_REGISTRY_CACHE_SIZE
# Migration: Rename COMPUTE_REGISTRY_CACHE_SIZE to ONEX_COMPUTE_REGISTRY_CACHE_SIZE
# Legacy name (DO NOT USE for new deployments):
# COMPUTE_REGISTRY_CACHE_SIZE=128
# -----------------------------------------------------------------------------

# =============================================================================
# OpenTelemetry Observability Configuration (Optional)
Expand Down
10 changes: 5 additions & 5 deletions docs/SECURITY_VALIDATION_INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ From analyzing `MixinNodeIntrospection` and security documentation, key security

### 1. Security Validator Module

**File**: `src/omnibase_infra/validation/security_validator.py`
**File**: `src/omnibase_infra/validation/validator_security.py`

**Purpose**: Provides security validation functions that emit `ModelHandlerValidationError` for security violations.

Expand Down Expand Up @@ -137,7 +137,7 @@ from omnibase_infra.validation import (

### 4. Test Suite

**File**: `tests/unit/validation/test_security_validator.py`
**File**: `tests/unit/validation/test_validator_security.py`

**Coverage**:
- ✅ 23 tests, all passing
Expand Down Expand Up @@ -484,8 +484,8 @@ SENSITIVE_PARAMETER_NAMES = frozenset({

### New Files Created

- `src/omnibase_infra/validation/security_validator.py` - Security validation module
- `tests/unit/validation/test_security_validator.py` - Test suite
- `src/omnibase_infra/validation/validator_security.py` - Security validation module
- `tests/unit/validation/test_validator_security.py` - Test suite
- `docs/SECURITY_VALIDATION_INTEGRATION.md` - This document

### Modified Files
Expand All @@ -505,7 +505,7 @@ SENSITIVE_PARAMETER_NAMES = frozenset({
✅ **All success criteria from task description have been met:**

1. ✅ Security validation paths identified (found: none exist yet)
2. ✅ Integration pattern created (security_validator.py)
2. ✅ Integration pattern created (validator_security.py)
3. ✅ Rule IDs defined for security errors (SECURITY-001 through SECURITY-202)
4. ✅ All security errors have actionable remediation hints
5. ✅ Pattern documented for future use (security_patterns.md)
Expand Down
Loading