Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
a9c36fd
refactor: remove AI slop patterns from codebase (OMN-1297)
jonahgabriel Jan 12, 2026
019488d
refactor: rename StrValueMixin to StrValueHelper (OMN-1297)
jonahgabriel Jan 12, 2026
96af5e5
fix: restore required keywords in enum docstrings and fix lazy import…
jonahgabriel Jan 12, 2026
0896150
fix: regenerate poetry.lock and add @unique decorators to enums (OMN-…
jonahgabriel Jan 12, 2026
8d28166
fix: address PR #376 review feedback - add StrValueHelper to remainin…
jonahgabriel Jan 12, 2026
62baf2e
fix: address PR #376 review feedback - fix tests and remove misleadin…
jonahgabriel Jan 12, 2026
91fdf86
fix: add concise module docstrings to enum files (OMN-1297)
jonahgabriel Jan 12, 2026
2ae770b
fix: add StrValueHelper to enum_registry_action.py (OMN-1297)
jonahgabriel Jan 12, 2026
23ba68f
Merge branch 'main' into jonah/omn-1297-remove-ai-slop-patterns-from-…
jonahgabriel Jan 12, 2026
61e9496
fix: update poetry.lock to sync with pyproject.toml (OMN-1297)
jonahgabriel Jan 13, 2026
64601cf
Merge branch 'main' into jonah/omn-1297-remove-ai-slop-patterns-from-…
jonahgabriel Jan 13, 2026
4d9188b
fix: address PR review feedback for enum standardization (OMN-1297)
jonahgabriel Jan 13, 2026
3683e2f
Merge branch 'main' into jonah/omn-1297-remove-ai-slop-patterns-from-…
jonahgabriel Jan 13, 2026
95a3488
fix: address PR #376 review feedback (OMN-1297)
jonahgabriel Jan 13, 2026
4db6575
fix: correct test expectations for EnumFieldType optional properties …
jonahgabriel Jan 13, 2026
d719afa
fix: resolve merge conflicts with main branch (OMN-1297)
jonahgabriel Jan 13, 2026
e0fb9ea
merge: resolve conflicts with main branch (OMN-1297)
jonahgabriel Jan 13, 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
  •  
  •  
  •  
98 changes: 98 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,86 @@ poetry run ruff check --fix src/ tests/ # Auto-fix
pre-commit run --all-files # Run all hooks
```

### Docstring Guidelines

Follow these guidelines to avoid "AI slop" - docstrings that add noise without value.

#### Docstrings to AVOID (Tautological)

Do NOT write docstrings that simply restate the method name:

```python
# BAD - These add no value
def get_name(self):
"""Get the name.""" # Just restates method name

def set_status(self, value):
"""Set the status.""" # Obvious from signature

def validate_input(self):
"""Validate input.""" # No new information

def is_active(self) -> bool:
"""Check if active.""" # Obvious from name and return type
```

#### Docstrings to WRITE (Valuable)

Write docstrings that explain WHY, describe non-obvious behavior, or document edge cases:

```python
# GOOD - These add value
def get_name(self) -> str:
"""Return canonical name, falling back to id if name is None."""

def set_status(self, value: str) -> None:
"""Update status and emit StatusChanged event to all subscribers."""

def validate_input(self) -> bool:
"""
Validate against schema v2 rules.

Raises:
ValidationError: If required fields are missing or malformed.
"""

def is_active(self) -> bool:
"""Check activation considering both enabled flag and expiry timestamp."""
```

#### When to Write Docstrings

| Situation | Docstring Needed? | Example |
|-----------|-------------------|---------|
| Complex logic | Yes | Algorithms, state machines, multi-step processes |
| Non-obvious behavior | Yes | Side effects, event emission, caching |
| Public API | Yes | Module/class/function interfaces |
| Edge cases | Yes | Error conditions, boundary values |
| Simple getter/setter | No | `get_id()`, `set_name()` |
| Obvious from signature | No | `def add(a: int, b: int) -> int` |
| Private helpers | Usually no | `_parse_line()`, `_normalize()` |

#### Module and Class Docstrings

Keep module docstrings concise (3-6 lines max for simple modules):

```python
# GOOD - Concise module docstring
"""Enumeration for node execution status.

Defines lifecycle states for node execution from pending to completed.
"""

# BAD - Verbose module docstring (avoid)
"""
Enumeration for node execution status.

This module provides a comprehensive enumeration of all possible
execution states that a node can be in during its lifecycle...
[18 more lines of obvious information]
"""
```

### Type Annotation Style (PEP 604)

**Always use PEP 604 union syntax** (enforced by ruff UP007):
Expand Down Expand Up @@ -518,6 +598,24 @@ Some files are excluded from single-class-per-file validation due to architectur

These exclusions are documented in `.pre-commit-config.yaml` under `validate-single-class-per-file`.

### Enum String Serialization

All string-based enums should use `StrValueHelper` for consistent `__str__` behavior:

```python
from omnibase_core.utils.util_str_enum_base import StrValueHelper

class EnumStatus(StrValueHelper, str, Enum):
"""Status values for workflow execution."""
PENDING = "pending"
RUNNING = "running"
COMPLETED = "completed"

# StrValueHelper provides __str__ that returns self.value
str(EnumStatus.PENDING) # Returns: "pending"
```

**Note**: `StrValueHelper` is a utility mixin for enums, not a node mixin. It is located in `omnibase_core.utils`, not `omnibase_core.mixins`.
Comment on lines +601 to +618

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Verify potential duplication of Enum String Serialization section.

The AI summary indicates that the Enum String Serialization block appears in multiple locations within CLAUDE.md. If duplicated, consolidate to a single canonical location or use cross-references.

Run the following script to check for duplicate enum serialization content:

#!/bin/bash
# Description: Search for duplicate enum string serialization content in CLAUDE.md

# Search for the section header
rg -n "Enum String Serialization" CLAUDE.md

# Search for StrValueHelper mentions
rg -n "StrValueHelper" CLAUDE.md

# Search for the distinctive enum example
rg -n "class EnumStatus\(StrValueHelper" CLAUDE.md
🤖 Prompt for AI Agents
In @CLAUDE.md around lines 590 - 607, The CLAUDE.md contains a duplicated "Enum
String Serialization" section referencing StrValueHelper and the EnumStatus
example; consolidate duplicates by keeping a single canonical section and
removing other copies or replace them with cross-references to the canonical
section, ensuring the retained section includes the StrValueHelper mixin note
and the EnumStatus example so references to StrValueHelper, EnumStatus, and the
"Enum String Serialization" header remain valid.

### Pydantic Model Configuration Standards

Every Pydantic model MUST have an explicit `model_config`. Empty `ConfigDict()` is not allowed - it has ambiguous intent and provides no explicit policy for model behavior (extra fields, mutability, etc.). Models must declare their configuration explicitly.
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ python = "^3.12"
pydantic = "^2.12.5"
pyyaml = "^6.0.2"
dependency-injector = "^4.48.3"
deepdiff = "^8.0.0"

# CLI Dependencies
click = "^8.3.1"
Expand Down
1 change: 1 addition & 0 deletions src/omnibase_core/decorators/decorator_error_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def wrapper(*args: Any, **kwargs: Any) -> Any:
except ModelOnexError:
# Always re-raise ModelOnexError as-is to preserve error context
raise
# boundary-ok: converts unhandled exceptions to structured ModelOnexError at function boundary
except Exception as e:
# Convert generic exceptions to ModelOnexError with proper chaining
msg = f"{operation_name} failed: {e!s}"
Expand Down
7 changes: 5 additions & 2 deletions src/omnibase_core/enums/enum_acknowledgment_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
and registration processes.
"""

from enum import Enum
from enum import Enum, unique

from omnibase_core.utils.util_str_enum_base import StrValueHelper

class EnumAcknowledgmentType(str, Enum):

@unique
class EnumAcknowledgmentType(StrValueHelper, str, Enum):
"""Canonical acknowledgment types for ONEX discovery."""

BOOTSTRAP_ACK = "bootstrap_ack"
Expand Down
3 changes: 2 additions & 1 deletion src/omnibase_core/enums/enum_action_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
Categories for organizing different types of actions across tools.
"""

from enum import Enum
from enum import Enum, unique


@unique
class EnumActionCategory(str, Enum):
"""
Categories for organizing different types of actions across tools.
Expand Down
8 changes: 3 additions & 5 deletions src/omnibase_core/enums/enum_activation_reason.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@

from enum import Enum, unique

from omnibase_core.utils.util_str_enum_base import StrValueHelper


@unique
class EnumActivationReason(str, Enum):
class EnumActivationReason(StrValueHelper, str, Enum):
"""
Reason for capability activation or skip.

Expand Down Expand Up @@ -98,10 +100,6 @@ class EnumActivationReason(str, Enum):
TIMEOUT_EXCEEDED = "timeout_exceeded"
"""Activation window expired before capability could be activated."""

def __str__(self) -> str:
"""Return the string value for serialization."""
return self.value

def is_activation_reason(self) -> bool:
"""
Check if this reason indicates successful activation.
Expand Down
3 changes: 2 additions & 1 deletion src/omnibase_core/enums/enum_agent_capability.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
Defines capabilities that agents can have for task routing and selection.
"""

from enum import Enum
from enum import Enum, unique


@unique
class EnumAgentCapability(str, Enum):
"""Agent capabilities for intelligent task routing."""

Expand Down
3 changes: 2 additions & 1 deletion src/omnibase_core/enums/enum_agent_status_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
Strongly-typed enumeration for agent status types.
"""

from enum import Enum
from enum import Enum, unique


@unique
class EnumAgentStatusType(str, Enum):
"""Agent status enumeration."""

Expand Down
3 changes: 2 additions & 1 deletion src/omnibase_core/enums/enum_analysis_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
ONEX-compatible enum for standardized analysis status values.
"""

from enum import Enum
from enum import Enum, unique


@unique
class EnumAnalysisStatus(str, Enum):
"""Enumeration for analysis status values."""

Expand Down
1 change: 1 addition & 0 deletions src/omnibase_core/enums/enum_architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import enum


@enum.unique
class EnumArchitecture(enum.StrEnum):
"""Supported CPU architectures."""

Expand Down
3 changes: 2 additions & 1 deletion src/omnibase_core/enums/enum_argument_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
Defines the available types for CLI command arguments.
"""

from enum import Enum
from enum import Enum, unique


@unique
class EnumArgumentType(str, Enum):
"""
Enumeration of CLI argument types.
Expand Down
3 changes: 2 additions & 1 deletion src/omnibase_core/enums/enum_artifact_type.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""Artifact type enumeration for ONEX core."""

from enum import Enum
from enum import Enum, unique


@unique
class EnumArtifactType(str, Enum):
"""Artifact types for ONEX ecosystem."""

Expand Down
3 changes: 2 additions & 1 deletion src/omnibase_core/enums/enum_assembly_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
with proper ONEX enum naming conventions.
"""

from enum import Enum
from enum import Enum, unique


@unique
class EnumAssemblyStrategy(str, Enum):
"""LLM result assembly strategies."""

Expand Down
5 changes: 4 additions & 1 deletion src/omnibase_core/enums/enum_audit_action.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from enum import Enum
"""Audit action types for logging and compliance tracking."""

from enum import Enum, unique


@unique
class EnumAuditAction(str, Enum):
"""Common audit actions."""

Expand Down
11 changes: 5 additions & 6 deletions src/omnibase_core/enums/enum_auth_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
Authentication types for webhook notifications in ONEX infrastructure.
"""

from enum import Enum
from enum import Enum, unique

from omnibase_core.utils.util_str_enum_base import StrValueHelper

class EnumAuthType(str, Enum):

@unique
class EnumAuthType(StrValueHelper, str, Enum):
"""Enumeration for authentication types used in webhook communications."""

# No authentication
Expand All @@ -24,10 +27,6 @@ class EnumAuthType(str, Enum):
DIGEST = "digest" # Digest authentication
CUSTOM = "custom" # Custom authentication method

def __str__(self) -> str:
"""Return the string value of the authentication type."""
return self.value

@classmethod
def requires_credentials(cls, auth_type: "EnumAuthType") -> bool:
"""
Expand Down
13 changes: 7 additions & 6 deletions src/omnibase_core/enums/enum_authentication_method.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
from enum import Enum
"""Authentication method types for session and identity contexts."""

from enum import Enum, unique

class EnumAuthenticationMethod(str, Enum):
from omnibase_core.utils.util_str_enum_base import StrValueHelper


@unique
class EnumAuthenticationMethod(StrValueHelper, str, Enum):
"""Authentication methods supported for session and identity contexts."""

# No authentication
Expand All @@ -26,10 +31,6 @@ class EnumAuthenticationMethod(str, Enum):
# Enhanced security methods
MULTI_FACTOR = "multi_factor" # Multi-factor authentication (MFA)

def __str__(self) -> str:
"""Return the string value of the authentication method."""
return self.value

@classmethod
def is_federated(cls, method: "EnumAuthenticationMethod") -> bool:
"""
Expand Down
3 changes: 2 additions & 1 deletion src/omnibase_core/enums/enum_backend_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
This enum defines the supported secret backend types in the system.
"""

from enum import Enum
from enum import Enum, unique

from omnibase_core.enums.enum_core_error_code import EnumCoreErrorCode


@unique
class EnumBackendType(Enum):
"""Supported secret backend types."""

Expand Down
3 changes: 2 additions & 1 deletion src/omnibase_core/enums/enum_backoff_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
Retry backoff strategies for infrastructure resilience in ONEX systems.
"""

from enum import Enum
from enum import Enum, unique


@unique
class EnumBackoffStrategy(str, Enum):
"""Enumeration for retry backoff strategies used in infrastructure components."""

Expand Down
5 changes: 4 additions & 1 deletion src/omnibase_core/enums/enum_business_logic_pattern.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from enum import Enum
"""Business logic pattern classifications for node categorization."""

from enum import Enum, unique


@unique
class EnumBusinessLogicPattern(str, Enum):
"""Business logic pattern classifications."""

Expand Down
3 changes: 2 additions & 1 deletion src/omnibase_core/enums/enum_cache_eviction_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
Defines eviction strategies for cache management.
"""

from enum import Enum
from enum import Enum, unique


@unique
class EnumCacheEvictionPolicy(str, Enum):
"""
Cache eviction policy enumeration for ONEX caching systems.
Expand Down
3 changes: 2 additions & 1 deletion src/omnibase_core/enums/enum_case_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
This module defines the case modes available for CASE_CONVERSION transformations.
"""

from enum import Enum
from enum import Enum, unique


@unique
class EnumCaseMode(str, Enum):
"""
Case transformation modes.
Expand Down
Loading