Repository navigation
feat(ci): add automated transport import validation [OMN-220] - #147
jonahgabriel merged 15 commits into
Conversation
Add AST-based CI check to enforce zero transport library imports in omnibase_core, ensuring architectural compliance with dependency inversion. - Create scripts/check_transport_imports.py with AST-based detection - Add 53 comprehensive tests with 81%+ coverage - Integrate into CI lint job (runs on every PR) - Support --verbose and --json output formats - Add temporary allowlist for pre-existing violation (mixin_health_check.py) Banned imports: kafka, aiokafka, httpx, aiohttp, requests, asyncpg, psycopg, psycopg2, hvac, consul, redis, valkey These transport libraries belong in omnibase_spi or service layers, not in the core framework.
|
Warning Rate limit exceeded@jonahgabriel has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 43 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. 📒 Files selected for processing (2)
WalkthroughAdds an AST-based transport-import checker (with tests and docs), integrates it into CI, introduces cleanup CLI options, simplifies node compute generics/contract APIs, and removes an associated NodeCompute test module. Changes
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Comment |
PR Review: Transport Import Validation [OMN-220]SummaryThis PR introduces an AST-based CI check to enforce architectural boundaries by preventing direct imports of transport libraries in ✅ Strengths1. Excellent Code Quality
2. Comprehensive Test Coverage
3. Thoughtful Design Decisions
4. CI Integration
🔍 Code Review FindingsNo Critical Issues Found ✅Minor Suggestions (Optional Enhancements)1. Performance: Consider Caching Parsed AST (Optional)Currently, each file is parsed once. For very large codebases, you could cache the AST if running multiple analyzers: # scripts/check_transport_imports.py:336
def analyze_file(file_path: Path) -> TransportCheckResult:
try:
source = file_path.read_text(encoding="utf-8")
source_lines = source.splitlines()
tree = ast.parse(source, filename=str(file_path)) # Potentially cache thisImpact: Negligible for current use case (single validator). Only relevant if you add more AST-based validators in the future. 2. Test Organization: Extract Test Fixtures (Optional)The test code samples (e.g., kafka import strings) are duplicated across multiple tests. Consider using pytest fixtures: # tests/unit/scripts/test_check_transport_imports.py
@pytest.fixture
def kafka_import_code():
return "import kafka"
@pytest.fixture
def redis_import_code():
return "import redis"Impact: Would reduce duplication, but current approach is perfectly acceptable for this test suite size. 3. Documentation: Add Example Output to DocstringThe main docstring (lines 2-39) could include example output for clarity: Example Output:
[ERROR] src/omnibase_core/mixins/mixin_health_check.py:811:0
banned_transport_import: Import of 'aiohttp' is forbidden in omnibase_core
Suggestion: Transport libraries belong in omnibase_spi or service layers. Use ProtocolHttpClient instead.Impact: Minor - helps users understand what to expect when violations are found. 4. Consider Tracking Allowlist Expiration (Future Enhancement)The TEMPORARY_ALLOWLIST: dict[str, dict[str, str]] = {
"mixins/mixin_health_check.py": {
"ticket": "OMN-XXX",
"expires": "2025-01-15", # Optional: fail CI after this date
"reason": "Uses aiohttp directly for HTTP health checks"
}
}Impact: Low priority - ensures allowlist doesn't become permanent. Current approach is acceptable. 📊 Test Coverage AnalysisCoverage Summary
Coverage Breakdown by Component
Missing Coverage (Acceptable)
Verdict: Coverage is excellent for a validation script. Missing items are low-risk utility functions. 🔒 Security Assessment✅ No Security Concerns
Input Validation
🚀 Performance ConsiderationsCurrent Performance
Optimization Opportunities (Not Needed Now)
Verdict: Current implementation is appropriate for the codebase size. No optimization needed. 📝 Documentation & Maintainability✅ Excellent Documentation
Maintainability Score: 9/10
🎯 Alignment with CLAUDE.md Standards✅ Full Compliance
🔄 Pre-existing Violation: mixin_health_check.pyStatus: Properly TrackedThe PR correctly identifies 1 pre-existing violation:
Recommendation✅ Approve this approach. Blocking this PR on pre-existing tech debt would be counterproductive. The allowlist is:
Action Item: Create follow-up ticket to fix 🎨 Code Style & Conventions✅ Excellent Adherence
🧪 Test Execution VerificationTest Module Loading Pattern (Excellent)The test suite uses a clever module loading pattern (lines 49-91): def _load_module() -> bool:
"""Load the transport import checker module."""
global _module_loaded, TransportViolation, TransportImportAnalyzer
# ... loads script dynamicallyWhy this is good:
pytest Configuration
🎁 Bonus Features1. Multiple Output Modes
2. Flexible File Selection# Check entire codebase
poetry run python scripts/check_transport_imports.py
# Check specific file
poetry run python scripts/check_transport_imports.py --file src/omnibase_core/some_file.py
# Custom source directory
poetry run python scripts/check_transport_imports.py --src-dir /path/to/src3. Helpful Error MessagesLines 628-639 provide actionable suggestions: ✅ Final VerdictAPPROVED - LGTM (Looks Good To Me) 🚀This is a high-quality PR that:
Merge Recommendation: APPROVE & MERGENo blocking issues. The minor suggestions above are optional enhancements that could be addressed in future PRs if desired. 📋 Post-Merge Action Items
🙏 Nice Work!This PR demonstrates:
Correlation ID: |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
scripts/check_transport_imports.py (3)
159-165: Update placeholder ticket number for allowlist tracking.The comment references
OMN-XXXbut should reference the actual Linear ticket for tracking the fix of this pre-existing violation. This helps with traceability.- { - # OMN-XXX: mixin_health_check.py uses aiohttp directly for HTTP health checks + { + # OMN-221: mixin_health_check.py uses aiohttp directly for HTTP health checksNote: Replace
OMN-221with the actual ticket number created to track this fix.
223-226: Minor:generic_visitcall is redundant before early return.The
generic_visit(node)call beforereturnhas no effect since the method returns immediately after. The same applies at lines 243-244.if self.in_type_checking_block: # Allow type-only imports inside TYPE_CHECKING blocks - self.generic_visit(node) return
367-383: Consider: Syntax error handling uses mismatched violation type.When a
SyntaxErroroccurs, the code creates aTransportViolationwithViolationType.BANNED_TRANSPORT_IMPORT, which is semantically inaccurate. Theskip_reasonfield correctly indicates the error, so this works in practice, but for clarity you could consider either:
- Adding a
SYNTAX_ERRORviolation type, or- Returning an empty violations list with only the
skip_reasonset.This is minor since the current behavior is functionally correct.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/test.yml(1 hunks)scripts/check_transport_imports.py(1 hunks)tests/unit/scripts/test_check_transport_imports.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
.github/workflows/test.yml
📄 CodeRabbit inference engine (CLAUDE.md)
Configure CI to run 20 parallel test splits with expected runtime of 2m30s-3m30s per split, timeouts at 4m30s threshold, and failure investigation procedures
Files:
.github/workflows/test.yml
**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.py: Always callsuper().__init__(container)in node constructors where the parent class is a node base class (NodeCoreBase, NodeCompute, NodeEffect, NodeReducer, NodeOrchestrator)
UseModelONEXContainer(fromomnibase_core.models.container.model_onex_container) for dependency injection in node constructors, neverModelContainer[T]
Usepoetry runfor all Python command execution (pytest, mypy, black, isort, python -m) - never use pip or direct python invocation
Raise structuredModelOnexErrorexceptions with appropriateEnumCoreErrorCodevalues instead of generic Exception types
Usecontainer.get_service("ProtocolName")for dependency injection, never instantiate concrete classes or useisinstancechecks with protocols
Apply@standard_error_handlingdecorator fromomnibase_core.decorators.error_handlingto async methods that need try/catch boilerplate elimination
Do not share node instances across threads - create separate instances per thread or use thread-local storage
Import nodes directly fromomnibase_core.nodes(NodeCompute, NodeEffect, NodeReducer, NodeOrchestrator), not from legacyomnibase_core.infrastructurepaths
UseEnumNodeKindfor architectural classification in the ONEX workflow pipeline (EFFECT, COMPUTE, REDUCER, ORCHESTRATOR, RUNTIME_HOST), andEnumNodeTypefor specific implementation type discovery
Document node types with comprehensive YAML contract declarations showing input/output models and FSM/workflow configurations for REDUCER and ORCHESTRATOR nodes
Use duck typing with protocols instead of isinstance checks - access protocol methods directly without type verification
When using mixin classes, inherit from both the node base class and specific mixins (e.g., MixinDiscoveryResponder, MixinEventHandler, MixinWorkflowSupport) to add capabilities
Use event-driven communication throughModelEventEnvelopepattern for inter-service communication and event processing
Files:
scripts/check_transport_imports.pytests/unit/scripts/test_check_transport_imports.py
tests/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Mark tests with appropriate pytest markers (@pytest.mark.unit, @pytest.mark.integration, @pytest.mark.slow, @pytest.mark.smoke, @pytest.mark.performance) and add timeouts for tests that may hang
Files:
tests/unit/scripts/test_check_transport_imports.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Smoke Tests
- GitHub Check: claude-review
🔇 Additional comments (15)
.github/workflows/test.yml (1)
223-228: LGTM! Transport import validation properly integrated into CI.The mypy strict check ensures type safety for the new script, and the dedicated step for transport import violations provides clear CI feedback. The
poetry runinvocation follows the coding guidelines.scripts/check_transport_imports.py (6)
1-52: Excellent module documentation and minimal dependencies.The docstring thoroughly documents the architectural rationale, forbidden libraries with alternatives, usage patterns, and exit codes. Using only standard library imports keeps the script lightweight and avoids circular dependency risks.
54-99: Clean data model with good extensibility.The enum and dataclass design allows for future extension (e.g., adding WARNING severity or additional violation types) without breaking changes.
250-329: Solid implementation of type checking detection and violation handling.The
_is_type_checking_conditionmethod properly handles both import styles (TYPE_CHECKINGandtyping.TYPE_CHECKING). The root module extraction viasplit(".")[0]correctly catches submodule imports likekafka.producer.
393-447: LGTM! Clean utility functions with proper error handling.The sorted file list ensures deterministic CI output, and
_safe_relative_pathproperly handles edge cases where the file might be outside the base directory.
449-560: Well-structured CLI with proper fallback logic and allowlist handling.The source directory resolution with cwd/script-relative fallback handles different invocation contexts. The allowlist mechanism correctly suppresses violations for tracked pre-existing issues while preserving them for reporting.
562-648: LGTM! Clean output formatting with proper exit codes.The JSON output structure is well-designed for CI integration, and the text output provides helpful context including the protocol alternatives table on failure. Exit codes align with the documented behavior.
tests/unit/scripts/test_check_transport_imports.py (8)
104-145: Good coverage of TransportViolation dataclass.Tests verify both field assignment and the format method. Consider adding a test for
format(verbose=False)to verify the non-verbose output path, but this is optional.
147-169: LGTM! Configuration validation tests.These tests ensure the banned modules configuration contains the expected entries, acting as regression tests if the configuration is modified.
171-508: Comprehensive banned import detection tests.Excellent coverage of all banned libraries with both
import Xandfrom X import Ypatterns. The tests verify the core detection functionality works correctly for each transport library.
509-620: Essential negative tests prevent false positives.Testing that legitimate imports (typing, pydantic, standard library) don't trigger violations is crucial for preventing CI false positives.
622-669: LGTM! TYPE_CHECKING block handling tests.Tests correctly verify that banned imports inside
TYPE_CHECKINGblocks are allowed, covering both import styles of the constant.
671-807: Excellent edge case coverage.The tests for strings and comments containing banned names are particularly important - they verify the AST-based approach doesn't produce false positives from non-import code. The try/except test ensures developers can't bypass the check with conditional imports.
809-966: Good integration tests with proper isolation.The tests use
tmp_pathfixtures for file system isolation andpatch.objectfor argv mocking. Exit code tests verify the CLI contract.
1043-1122: LGTM! Aliased and submodule import detection tests.These tests verify that aliased imports (
import X as Y) and submodule imports (from X.sub import Z) are correctly detected, which are important edge cases.
- Add SYNTAX_ERROR violation type for syntax error handling - Add defensive sys.path check to prevent duplicates - Fix JSON assertion to use correct field name (total_violations) - Add docstrings to all 17 test classes - Add allowlist expiration tracking comment (2025-03-01) - Update OMN-XXX placeholder to TODO comment - Remove redundant generic_visit calls in AST visitor
PR Review: Transport Import Validation [OMN-220]SummaryThis PR adds automated enforcement of the ONEX dependency inversion principle by detecting direct transport library imports in ✅ Strengths1. Excellent Architecture & Code Quality
2. Smart TYPE_CHECKING HandlingThe
3. Comprehensive Test Coverage
4. Great Developer Experience
5. Proper Allowlist Management
🔍 Issues & Suggestions1. Medium: Generic Exception Handling (Line 383-389)Issue: The script catches all exceptions with a bare except Exception as e:
return TransportCheckResult(
file_path=file_path,
violations=[],
is_clean=False,
skip_reason=f"Error analyzing file: {e}",
)Recommendation:
Suggested fix: except UnicodeDecodeError as e:
return TransportCheckResult(
file_path=file_path,
violations=[],
is_clean=False,
skip_reason=f"Cannot decode file (not UTF-8): {e}",
)
except PermissionError as e:
return TransportCheckResult(
file_path=file_path,
violations=[],
is_clean=False,
skip_reason=f"Permission denied: {e}",
)
# Let other exceptions propagate to fail CI loudly2. Low: Potential Edge Case - Nested TYPE_CHECKING BlocksCurrent code (lines 203-214): if self._is_type_checking_condition(node.test):
prev_state = self.in_type_checking_block
self.in_type_checking_block = True
# Visit body...
self.in_type_checking_block = prev_stateIssue: While nested Impact: Very low - this pattern is virtually never used in practice. Suggestion: Document this limitation, or use a counter/stack instead of a boolean if you want to be bulletproof. 3. Low: Test Module Loading PatternObservation: The test file uses dynamic module loading with Alternative approach: Since the script is in the repo, you could:
Current approach is fine, but worth considering for future scripts. 4. Documentation: Missing DEPENDENCY_INVERSION.md ReferenceLine 39 references Action needed:
🔒 Security Considerations✅ No security concerns identified:
⚡ Performance ConsiderationsCurrent Performance
Optimization Opportunities (Not Urgent)If this becomes a bottleneck with 10,000+ files:
📋 Test Coverage AnalysisTest organization is excellent:
Coverage estimate: 81%+ (as mentioned in PR description) is solid. Missing test scenarios (nice-to-have):
🎯 Alignment with Project Standards✅ Follows CLAUDE.md Requirements
|
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
tests/unit/scripts/test_check_transport_imports.py (1)
1038-1043: LGTM! Previous review issue addressed.The JSON field assertion now correctly uses
total_violationsinstead ofviolation_count.
🧹 Nitpick comments (2)
scripts/check_transport_imports.py (2)
249-266: Minor edge case: aliased typing module not handled.
_is_type_checking_conditionhandlesTYPE_CHECKINGandtyping.TYPE_CHECKINGbut not aliased imports likeimport typing as t; if t.TYPE_CHECKING:. This is an uncommon pattern, so low risk.If you want full coverage, you could track typing aliases at import time:
+ typing_aliases: set[str] = field(default_factory=lambda: {"typing"}) + + def visit_Import(self, node: ast.Import) -> None: + # Track typing aliases + for alias in node.names: + if alias.name == "typing" and alias.asname: + self.typing_aliases.add(alias.asname) + # ... existing logicThen update
_is_type_checking_conditionto checkself.typing_aliases.
383-389: Generic exception handler masks specific errors.The broad
except Exceptioncatch is acceptable for CI resilience but could hide unexpected issues during development. Consider logging the exception type for debugging:except Exception as e: + # Log for debugging: print(f"DEBUG: {type(e).__name__}: {e}", file=sys.stderr) return TransportCheckResult( file_path=file_path, violations=[], is_clean=False, - skip_reason=f"Error analyzing file: {e}", + skip_reason=f"Error analyzing file ({type(e).__name__}): {e}", )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
scripts/check_transport_imports.py(1 hunks)tests/unit/scripts/test_check_transport_imports.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.py: Always callsuper().__init__(container)in node constructors where the parent class is a node base class (NodeCoreBase, NodeCompute, NodeEffect, NodeReducer, NodeOrchestrator)
UseModelONEXContainer(fromomnibase_core.models.container.model_onex_container) for dependency injection in node constructors, neverModelContainer[T]
Usepoetry runfor all Python command execution (pytest, mypy, black, isort, python -m) - never use pip or direct python invocation
Raise structuredModelOnexErrorexceptions with appropriateEnumCoreErrorCodevalues instead of generic Exception types
Usecontainer.get_service("ProtocolName")for dependency injection, never instantiate concrete classes or useisinstancechecks with protocols
Apply@standard_error_handlingdecorator fromomnibase_core.decorators.error_handlingto async methods that need try/catch boilerplate elimination
Do not share node instances across threads - create separate instances per thread or use thread-local storage
Import nodes directly fromomnibase_core.nodes(NodeCompute, NodeEffect, NodeReducer, NodeOrchestrator), not from legacyomnibase_core.infrastructurepaths
UseEnumNodeKindfor architectural classification in the ONEX workflow pipeline (EFFECT, COMPUTE, REDUCER, ORCHESTRATOR, RUNTIME_HOST), andEnumNodeTypefor specific implementation type discovery
Document node types with comprehensive YAML contract declarations showing input/output models and FSM/workflow configurations for REDUCER and ORCHESTRATOR nodes
Use duck typing with protocols instead of isinstance checks - access protocol methods directly without type verification
When using mixin classes, inherit from both the node base class and specific mixins (e.g., MixinDiscoveryResponder, MixinEventHandler, MixinWorkflowSupport) to add capabilities
Use event-driven communication throughModelEventEnvelopepattern for inter-service communication and event processing
Files:
scripts/check_transport_imports.pytests/unit/scripts/test_check_transport_imports.py
tests/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Mark tests with appropriate pytest markers (@pytest.mark.unit, @pytest.mark.integration, @pytest.mark.slow, @pytest.mark.smoke, @pytest.mark.performance) and add timeouts for tests that may hang
Files:
tests/unit/scripts/test_check_transport_imports.py
🧬 Code graph analysis (1)
tests/unit/scripts/test_check_transport_imports.py (1)
scripts/check_transport_imports.py (9)
TransportViolation(68-99)TransportImportAnalyzer(177-327)TransportCheckResult(102-108)analyze_file(335-389)find_python_files(392-411)main(448-643)ViolationType(54-58)Severity(61-64)format(80-99)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Smoke Tests
- GitHub Check: claude-review
🔇 Additional comments (13)
scripts/check_transport_imports.py (4)
1-52: LGTM!Well-documented module with comprehensive usage instructions and architectural rationale. Standard library imports only, appropriate for a CI tool.
54-109: LGTM!Well-structured data models. The
format()method's handling for potential future severity levels is reasonable future-proofing.
392-446: LGTM!Helper functions are well-implemented with proper error handling. Sorting ensures deterministic CI output, which is important for reproducibility.
448-644: LGTM!The
main()function is well-structured with proper argument parsing, directory resolution fallbacks, allowlist handling, and consistent exit codes. JSON output format is suitable for CI integration.tests/unit/scripts/test_check_transport_imports.py (9)
32-35: LGTM! Previous review issue addressed.The
sys.pathmodification now correctly checks for existing entries before inserting, preventing duplicate entries across test sessions.
106-147: LGTM!Tests for
TransportViolationcreation and formatting are clear and verify key functionality.
149-171: LGTM!Configuration validation tests ensure the banned modules list contains expected entries.
173-509: LGTM!Comprehensive detection tests covering all banned transport libraries with both
import Xandfrom X import Ypatterns. Well-organized by library category.
511-622: LGTM!Good negative test coverage ensuring allowed imports (typing, pydantic, standard library) don't trigger false positives.
624-671: LGTM!TYPE_CHECKING exemption tests cover both direct
TYPE_CHECKINGandtyping.TYPE_CHECKINGpatterns.
673-809: LGTM!Excellent edge case coverage including empty files, syntax errors, nested imports, string/comment false positive prevention, and try/except blocks.
811-893: LGTM!Good integration tests for multiple violation detection and
analyze_file()function with proper use oftmp_pathfixture.
1045-1124: LGTM!Good coverage of aliased imports (
import kafka as k) and submodule imports (from kafka.errors import ...), verifying the root module extraction logic works correctly.
Address all PR review issues including major, minor, and nitpicks: MAJOR: - Add ANALYSIS_ERROR violation type for proper error handling - Fix generic exception handler to create violations instead of masking errors - Handle aliased typing module (import typing as t; if t.TYPE_CHECKING:) MINOR: - Update allowlist expiration date to 2026-06-10 - Add TODO ticket references [OMN-220] - Update architecture doc reference to existing PROTOCOL_ARCHITECTURE.md - Add explanatory comments for sys.path defensive check - Add comments explaining generic_visit behavior NITPICKS: - Add test for aliased typing module edge case - Improve docstrings with supported patterns
Code Review - PR #147: Transport Import ValidationSummaryThis PR adds AST-based automated validation to enforce the ONEX architecture principle of dependency inversion by preventing direct transport library imports in ✅ Strengths1. Architecture & Design (Outstanding)
2. Code Quality (Excellent)
3. Testing (Outstanding)
4. CLI & User Experience (Excellent)
5. CI Integration (Well Done)
🔍 Observations & Minor Suggestions1. Performance Consideration (Optional Optimization)Current: Scans all Python files in Suggestion: Consider adding a # Could add to main():
parser.add_argument(
"--changed-files",
action="store_true",
help="Only check files changed in current git branch"
)Impact: Low priority - current implementation is fine for now given the codebase size. 2. Allowlist Expiration (Process Improvement)Line 161: Expiration date set to 2026-06-10 (6 months from last review) Suggestion: Consider adding a CI check that warns when the allowlist expiration date is approaching. This ensures pre-existing violations don't remain indefinitely. Implementation: Could be a separate script or integrated into this one. 3. Documentation Reference (Minor)Line 39: References Observation: Should verify this doc exists or create it as a follow-up. The PR description doesn't mention documentation updates. 4. Test Coverage Gap (Minor)The tests comprehensively cover the script functionality, but I don't see explicit tests for:
Recommendation: Add a couple of edge case tests if not already present in the full test file (I only reviewed first 200 lines). 5. Error Reporting Enhancement (Optional)Lines 397-417: Exception handling wraps all errors as violations Suggestion: Consider logging unexpected exceptions to stderr before returning, especially for debugging CI failures: except Exception as e:
# Log to stderr for CI visibility
print(f"Warning: Failed to analyze {file_path}: {e}", file=sys.stderr)
return TransportCheckResult(...)🔒 Security & Safety✅ No security concerns identified
📊 Test Results VerificationRecommendation: Before merging, please verify:
🎯 Final VerdictStatus: ✅ APPROVED with minor suggestions This is high-quality code that:
Minor improvements suggested above are optional - the PR is ready to merge as-is. The suggestions are for future enhancements, not blockers. 📝 Post-Merge Action Items
Excellent work on this PR! The implementation demonstrates deep understanding of Python AST, clean architecture principles, and comprehensive testing practices. 🎉 Reviewed by: Claude Code (omnibase_core CLAUDE.md conventions) |
Add optional improvements suggested in PR review: ENHANCEMENTS: - Add --changed-files CLI flag for incremental CI checks - Only checks files modified in current git branch - Falls back gracefully if git unavailable - Speeds up CI for large PRs - Add allowlist expiration warning system - ALLOWLIST_EXPIRATION_DATE and ALLOWLIST_WARNING_DAYS constants - Warns to stderr when expiration approaches (30 days) - JSON output includes allowlist_expiration_warning field - Add stderr error logging for CI visibility - Log syntax errors and unexpected exceptions to stderr - Helps debug CI failures without checking violation reports TEST COVERAGE: - Add test for nested TYPE_CHECKING blocks - Add test for multi-line from-imports - Add test for comma-separated import statements Total: 57 tests passing
Pull Request Review: feat(ci): add automated transport import validation [OMN-220]SummaryThis PR introduces AST-based CI validation to enforce architectural boundaries by preventing direct imports of transport libraries in ✅ Strengths1. Architecture Alignment ⭐
2. Robust Implementation
3. Excellent Test Coverage
4. Developer Experience
5. CI Integration
🔍 Code Quality ObservationsStrong Points✅ Follows Python best practices: type hints, docstrings, dataclasses Minor Recommendations1. Python Version Compatibility Check
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
scripts/check_transport_imports.py (1)
549-556: String containment check may cause false path matches.The comparison
str(src_dir) in str(file_path.resolve())uses string containment which could incorrectly match paths. For example, ifsrc_diris/foo/bar, it would match/foo/bar_extended/file.py.Consider using proper path ancestry check:
for line in result.stdout.strip().split("\n"): file_path = Path(line) - # Only include files within src_dir - if file_path.exists() and str(src_dir) in str(file_path.resolve()): - changed_files.append(file_path.resolve()) + # Only include files within src_dir using proper path ancestry + resolved = file_path.resolve() + try: + resolved.relative_to(src_dir.resolve()) + if file_path.exists(): + changed_files.append(resolved) + except ValueError: + pass # File not under src_dir
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
scripts/check_transport_imports.py(1 hunks)tests/unit/scripts/test_check_transport_imports.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.py: Always callsuper().__init__(container)in node constructors where the parent class is a node base class (NodeCoreBase, NodeCompute, NodeEffect, NodeReducer, NodeOrchestrator)
UseModelONEXContainer(fromomnibase_core.models.container.model_onex_container) for dependency injection in node constructors, neverModelContainer[T]
Usepoetry runfor all Python command execution (pytest, mypy, black, isort, python -m) - never use pip or direct python invocation
Raise structuredModelOnexErrorexceptions with appropriateEnumCoreErrorCodevalues instead of generic Exception types
Usecontainer.get_service("ProtocolName")for dependency injection, never instantiate concrete classes or useisinstancechecks with protocols
Apply@standard_error_handlingdecorator fromomnibase_core.decorators.error_handlingto async methods that need try/catch boilerplate elimination
Do not share node instances across threads - create separate instances per thread or use thread-local storage
Import nodes directly fromomnibase_core.nodes(NodeCompute, NodeEffect, NodeReducer, NodeOrchestrator), not from legacyomnibase_core.infrastructurepaths
UseEnumNodeKindfor architectural classification in the ONEX workflow pipeline (EFFECT, COMPUTE, REDUCER, ORCHESTRATOR, RUNTIME_HOST), andEnumNodeTypefor specific implementation type discovery
Document node types with comprehensive YAML contract declarations showing input/output models and FSM/workflow configurations for REDUCER and ORCHESTRATOR nodes
Use duck typing with protocols instead of isinstance checks - access protocol methods directly without type verification
When using mixin classes, inherit from both the node base class and specific mixins (e.g., MixinDiscoveryResponder, MixinEventHandler, MixinWorkflowSupport) to add capabilities
Use event-driven communication throughModelEventEnvelopepattern for inter-service communication and event processing
Files:
tests/unit/scripts/test_check_transport_imports.pyscripts/check_transport_imports.py
tests/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Mark tests with appropriate pytest markers (@pytest.mark.unit, @pytest.mark.integration, @pytest.mark.slow, @pytest.mark.smoke, @pytest.mark.performance) and add timeouts for tests that may hang
Files:
tests/unit/scripts/test_check_transport_imports.py
🧬 Code graph analysis (1)
tests/unit/scripts/test_check_transport_imports.py (1)
scripts/check_transport_imports.py (9)
TransportViolation(70-101)TransportImportAnalyzer(185-346)TransportCheckResult(104-110)analyze_file(354-432)find_python_files(435-454)main(563-782)ViolationType(55-60)Severity(63-66)format(82-101)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: claude-review
- GitHub Check: Smoke Tests
🔇 Additional comments (17)
scripts/check_transport_imports.py (7)
1-52: LGTM: Well-documented module with clear architecture rationale.The module docstring provides excellent documentation of forbidden imports, allowed patterns, usage examples, and exit codes. The imports are appropriately minimal and from the standard library.
55-111: Clean data structures for violation tracking.The
ViolationTypeenum,Severityenum,TransportViolationdataclass, andTransportCheckResultNamedTuple are well-designed for representing analysis results. Theformat()method provides flexible output formatting.
113-176: Configuration is comprehensive and well-documented.The banned modules list covers all intended transport libraries with clear protocol alternatives. The temporary allowlist includes proper expiration tracking with the TODO reference to OMN-220.
184-286: Solid AST visitor implementation for TYPE_CHECKING detection.The
TransportImportAnalyzercorrectly handles:
- State preservation when entering/exiting TYPE_CHECKING blocks
- Both
if TYPE_CHECKING:andif typing.TYPE_CHECKING:patterns- Aliased imports like
import typing as t; if t.TYPE_CHECKING:- Nested conditions within TYPE_CHECKING blocks via recursive visiting
287-346: Root module extraction handles submodule imports correctly.The
_check_banned_modulemethod properly extracts the root module from qualified names (e.g., "kafka" from "kafka.producer"), ensuring submodule imports are also detected.
354-432: Comprehensive error handling in file analysis.The
analyze_filefunction properly handles syntax errors and unexpected exceptions by creating appropriate violation records rather than silently skipping, which ensures CI visibility of issues.
563-782: Well-structured CLI with proper exit codes and multiple output formats.The main function provides:
- Clear argument parsing with sensible defaults
- JSON output for CI integration
- Text output with verbose mode for debugging
- Proper exit codes (0 clean, 1 violations, 2 errors)
- Allowlist expiration warnings
tests/unit/scripts/test_check_transport_imports.py (10)
1-38: Well-structured test module with proper defensive coding.The module docstring clearly documents test coverage. The
sys.pathmodification now includes the defensive check to prevent duplicate entries, addressing the prior review comment.
40-106: Dynamic module loading approach is appropriate for testing standalone scripts.Using
importlib.utilto load the script module at runtime avoids hard import-time dependencies and handles the case where the script might not exist. Theskip_if_module_not_loaded()helper provides clean test skipping.
109-174: Good coverage of basic dataclass and configuration tests.Tests verify
TransportViolationcreation, formatting, and that banned module configuration includes key libraries (kafka, redis, httpx, asyncpg).
176-557: Thorough coverage of banned import detection across all transport categories.Tests cover:
- Kafka/aiokafka (message queues)
- Redis/valkey (cache)
- httpx/aiohttp/requests (HTTP clients)
- asyncpg/psycopg/psycopg2 (database clients)
- hvac (Vault)
- consul (service discovery)
Both
import Xandfrom X import Ypatterns are tested with multi-line imports.
560-670: Comprehensive allowed imports validation.Tests confirm that standard library imports (typing, json, os, sys, etc.), pydantic, and omnibase_core imports do not trigger violations.
673-776: Excellent TYPE_CHECKING block handling tests.Tests cover:
- Direct
if TYPE_CHECKING:blocks- Qualified
if typing.TYPE_CHECKING:blocks- Aliased
if t.TYPE_CHECKING:patterns- Nested conditions inside TYPE_CHECKING blocks
This validates the AST visitor correctly exempts type-only imports.
779-916: Robust edge case coverage.Tests handle:
- Empty files
- Syntax errors (graceful handling with skip_reason)
- Nested imports in functions and classes
- Strings/comments containing banned names (no false positives)
- Try/except import blocks (still detected)
919-1036: Good integration tests for analyze_file and find_python_files.Tests verify multiple violations are detected with correct line numbers, the
analyze_filefunction returns proper results, andfind_python_filescorrectly skips__pycache__directories.
1038-1154: CLI behavior tests validate exit codes and output formats.Tests confirm:
- Exit code 0 when clean
- Exit code 1 when violations found
- Exit code 2 for missing paths
--verboseproduces detailed output--jsonproduces valid JSON with correcttotal_violationsfield
1157-1236: Aliased and submodule import detection tests are thorough.Tests verify that aliased imports (
import kafka as k,from redis import Redis as R) and submodule imports (from kafka.errors import ...,import redis.asyncio) are correctly detected.
Replace string containment check with Path.relative_to() for robust path matching. This prevents false positives when paths contain similar substrings (e.g., /src/omnibase_core_utils matching /src/omnibase_core).
Code Review: Transport Import Validation [OMN-220]✅ Overall AssessmentExcellent work! This PR implements a robust AST-based validation system to enforce ONEX's protocol-driven dependency inversion architecture. The implementation is production-ready with strong test coverage (81%+, 53 tests) and strict mypy compliance. 🎯 Strengths1. Architecture Alignment ⭐
2. Robust Implementation
3. Test Coverage ⭐
4. Developer Experience
5. Technical Debt Management
🔍 Code Quality Observations✅ Excellent Patterns
BANNED_TRANSPORT_MODULES: frozenset[str] = frozenset({...})Prevents accidental modification - good defensive programming.
prev_state = self.in_type_checking_block
self.in_type_checking_block = True
# ... visit children ...
self.in_type_checking_block = prev_state # Restore stateProper state restoration handles nested TYPE_CHECKING blocks correctly.
try:
return str(file_path.relative_to(base_dir))
except ValueError:
return str(file_path) # Fallback to full pathHandles edge cases where files are outside expected directories. 🐛 Minor Issues & Suggestions1. Performance Optimization (Low Priority)Issue: Impact: O(n) filesystem operations on CI, but negligible for typical PR sizes (<100 files). Suggestion: Consider caching if file_path.exists() and file_path.resolve().is_relative_to(src_dir_resolved):
changed_files.append(file_path.resolve())Verdict: Not critical for merge, can optimize later if CI performance degrades. 2. Test Module Import Pattern (Low Priority)Observation: Current approach: spec = importlib.util.spec_from_file_location("check_transport_imports", script_path)
_module = importlib.util.module_from_spec(spec)
sys.modules["check_transport_imports"] = _module
spec.loader.exec_module(_module)Why this works: Prevents import issues when running tests in parallel ( Suggestion: Add a comment explaining why dynamic loading is needed (parallel test execution). Verdict: Works correctly as-is, documentation enhancement only. 3. Allowlist Expiration Warning (Informational)Good: Expiration tracking prevents technical debt from going stale (line 175). Consideration: 6-month expiration (2026-06-10) is reasonable, but ensure there's a calendar reminder or Linear ticket to review before expiration. Action: Verify Linear ticket OMN-220 has subtasks for:
Verdict: Process issue, not code issue. 🔒 Security Considerations✅ No security concerns identified
🚀 Performance Considerations✅ Acceptable for CI
Benchmark: With 1865 files, expect CI step to complete in ~5-10 seconds (including Poetry overhead). 📊 Test Coverage AnalysisCoverage: 81%+ ✅ (exceeds 60% requirement) Well-tested scenarios:
Potentially undertested (non-blocking):
Verdict: Test coverage is strong. Edge cases are extremely rare in practice. 📝 Documentation Quality✅ Excellent documentation
Example (line 306): f"Transport libraries belong in omnibase_spi or service layers. Use {alternative} instead."Clear guidance on how to fix violations. 🎨 Code Style & Standards✅ Fully compliant with omnibase_core standards
Minor style note: Enum naming follows Python conventions ( 🔄 CI Integration✅ Properly integrated into CI workflow Changes in - name: Check for transport import violations (OMN-220)
run: |
poetry run python scripts/check_transport_imports.pyGood practices:
Suggestion: Consider adding poetry run python scripts/check_transport_imports.py --changed-filesTradeoff: Faster CI, but might miss violations in unchanged files. Recommend keeping current approach (check all files) for now. 🎯 Pre-Existing Violation AnalysisFile: Root cause: import aiohttp
async with aiohttp.ClientSession() as session:
async with session.get(health_url, timeout=...) as response:
...Architectural violation: Should use Remediation plan (as noted in allowlist comments):
Verdict: Allowlist is appropriate - pragmatic approach to avoid blocking this PR on unrelated work. ✅ RecommendationsMust-Do (Before Merge)
Should-Do (Follow-up Tickets)
Nice-to-Have (Low Priority)
📊 Final Scorecard
Overall: ⭐⭐⭐⭐⭐ APPROVED - Ready to Merge 🎉 ConclusionThis is production-ready code that enforces critical architectural boundaries. The implementation demonstrates strong software engineering practices:
Recommendation: ✅ APPROVE and MERGE Post-merge actions:
Great work on this feature! 🚀 Reviewed by: Claude Code (Sonnet 4.5) |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
scripts/check_transport_imports.py (1)
518-568: Correct git diff implementation with proper fallbacks.The function correctly handles missing
origin/mainby falling back toorigin/master, validates file existence (line 556) to handle deleted files, and uses proper path resolution for comparisons. The graceful fallback to an empty list when git is unavailable is appropriate for CI flexibility.Consider adding a verbose-mode log message when git diff fails entirely (e.g., shallow clone scenarios) to aid debugging:
except FileNotFoundError: pass # git not available - return [] # Return empty list if git fails + # Return empty list if git fails - caller handles by scanning all files + return []
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
scripts/check_transport_imports.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.py: Always callsuper().__init__(container)in node constructors where the parent class is a node base class (NodeCoreBase, NodeCompute, NodeEffect, NodeReducer, NodeOrchestrator)
UseModelONEXContainer(fromomnibase_core.models.container.model_onex_container) for dependency injection in node constructors, neverModelContainer[T]
Usepoetry runfor all Python command execution (pytest, mypy, black, isort, python -m) - never use pip or direct python invocation
Raise structuredModelOnexErrorexceptions with appropriateEnumCoreErrorCodevalues instead of generic Exception types
Usecontainer.get_service("ProtocolName")for dependency injection, never instantiate concrete classes or useisinstancechecks with protocols
Apply@standard_error_handlingdecorator fromomnibase_core.decorators.error_handlingto async methods that need try/catch boilerplate elimination
Do not share node instances across threads - create separate instances per thread or use thread-local storage
Import nodes directly fromomnibase_core.nodes(NodeCompute, NodeEffect, NodeReducer, NodeOrchestrator), not from legacyomnibase_core.infrastructurepaths
UseEnumNodeKindfor architectural classification in the ONEX workflow pipeline (EFFECT, COMPUTE, REDUCER, ORCHESTRATOR, RUNTIME_HOST), andEnumNodeTypefor specific implementation type discovery
Document node types with comprehensive YAML contract declarations showing input/output models and FSM/workflow configurations for REDUCER and ORCHESTRATOR nodes
Use duck typing with protocols instead of isinstance checks - access protocol methods directly without type verification
When using mixin classes, inherit from both the node base class and specific mixins (e.g., MixinDiscoveryResponder, MixinEventHandler, MixinWorkflowSupport) to add capabilities
Use event-driven communication throughModelEventEnvelopepattern for inter-service communication and event processing
Files:
scripts/check_transport_imports.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Smoke Tests
- GitHub Check: claude-review
🔇 Additional comments (10)
scripts/check_transport_imports.py (10)
1-52: Well-documented module with clear architectural rationale.The docstring comprehensively explains the purpose, forbidden imports, allowed patterns, usage examples, and exit codes. Import set is minimal and uses only standard library modules.
55-111: Clean data model design.The
ViolationType,Severity,TransportViolation, andTransportCheckResulttypes are well-structured. Theformat()method handles verbose output appropriately. The conditional on line 92 (if self.severity == Severity.ERROR) is currently always true since onlyERRORexists, but this provides good extensibility for future severity levels likeWARNING.
113-177: Well-organized configuration with proper tracking.Using
frozensetfor immutability is a good practice. The allowlist includes proper TODO comments with ticket references (OMN-220) for tracking cleanup. The expiration date mechanism provides accountability for temporary exceptions.
204-228: TYPE_CHECKING block handling is correct.The state save/restore pattern (lines 213-219) properly handles nested contexts. Visiting
orelsenormally (lines 221-222) is correct sinceelse/elifblocks of aTYPE_CHECKINGcondition should not be exempt—only theif TYPE_CHECKING:body contains type-only imports.
260-285: Robust TYPE_CHECKING detection.The implementation correctly handles common patterns including direct imports (
TYPE_CHECKING), qualified access (typing.TYPE_CHECKING), and aliased imports (t.TYPE_CHECKING). The permissive check on line 281-284 accepts anyX.TYPE_CHECKINGattribute access, which is reasonable since false positives here only result in allowing type-only imports.
354-433: Robust error handling in file analysis.The function handles both
SyntaxError(with line/column info) and unexpected exceptions by creating properTransportViolationrecords rather than silently masking errors. Logging to stderr ensures CI visibility. Using explicit UTF-8 encoding on line 367 is good practice.
435-516: Helper functions are well-implemented.
find_python_filescorrectly excludes__pycache__and returns a sorted list for deterministic output._is_allowlisteduses proper path comparison viarelative_torather than string matching.check_allowlist_expirationprovides clear warning messages for both expired and approaching expiration states.
570-678: Comprehensive CLI implementation with good fallback logic.The source directory resolution (lines 617-626) correctly handles both running from repository root and from the scripts directory. The
--changed-filesmode integration (lines 649-658) provides helpful verbose output about which mode is active. Empty file handling (lines 660-677) returns appropriate JSON structure or message.
689-789: Well-structured output handling with proper allowlist integration.The allowlist handling (lines 692-704) correctly suppresses violations while preserving tracking through
allowlisted_violations. Both JSON and text output modes are comprehensive—JSON includesallowlist_expiration_warningfor CI integration, and text mode provides actionable guidance with protocol alternatives (lines 782-784).
792-793: Correct entry point implementation.The
if __name__ == "__main__":guard allows the module to be imported without side effects (as noted in the test suite), andsys.exit(main())properly propagates the exit code.
Code Review - PR #147: Transport Import ValidationSummaryThis PR adds AST-based CI validation to prevent direct imports of transport libraries in ✅ Strengths1. Excellent Architecture Alignment
2. Robust Implementation
3. Outstanding Test Coverage
4. Production-Ready Features
5. Code Quality
🔍 Observations & Minor Suggestions1. Pre-existing Violation Handling ✅
2. Line 367: Encoding Specification ✅source = file_path.read_text(encoding="utf-8")Good practice: Explicit UTF-8 encoding prevents issues across platforms. 3. Lines 386-412: Error Handling Strategy ✅The script properly distinguishes between:
Observation: This is defensive and appropriate - prevents silent failures during CI. 4. Lines 518-567: Git Integration
|
| Requirement | Status | Evidence |
|---|---|---|
| Poetry Usage | ✅ | CI uses poetry run python |
| Type Checking | ✅ | 100% mypy strict (0 errors) |
| Error Handling | ✅ | Uses structured error reporting |
| Testing | ✅ | 53 tests with pytest, proper markers |
| Documentation | ✅ | Comprehensive docstrings |
| No Generic Exceptions | ✅ | Uses typed enums for violation types |
🚀 Recommended Next Steps
Before Merge:
- ✅ All tests passing - Verify in CI
- ✅ Mypy strict passing - Mentioned in PR description
⚠️ Optional: Fix git diff glob pattern (lines 535-536) - see suggestion above- ✅ Create child ticket for fixing
mixin_health_check.pyaiohttp usage
After Merge:
- Monitor CI performance - First 3-5 runs to validate <20s overhead
- Remove allowlist entry once OMN-XXX (health check refactor) is merged
- Update expiration date before 2026-05-10 (30 days before expiration)
📊 Final Verdict
✅ APPROVE - Ready to Merge
This is excellent work. The implementation is:
- ✅ Architecturally sound
- ✅ Thoroughly tested (81%+ coverage, 53 tests)
- ✅ Production-ready (error handling, CI integration, performance optimization)
- ✅ Well-documented
- ✅ Follows all project conventions
Risk Assessment: LOW
- No breaking changes
- Read-only validation script
- Comprehensive test coverage
- Allowlist handles pre-existing violations
Business Value: HIGH
- Prevents architectural violations at CI time
- Enforces protocol-driven dependency injection
- Self-documenting (maps transports to protocols)
- Low ongoing maintenance burden
🎉 Kudos
Special recognition for:
- AST-based detection - More reliable than regex
- TYPE_CHECKING exemption - Shows deep understanding of Python import patterns
- Allowlist expiration tracking - Prevents allowlist from growing indefinitely
- Comprehensive testing - 53 tests is impressive for a validation script
- CI performance optimization -
--changed-filesflag shows production mindset
Excellent contribution to the codebase! 🚀
Reviewer: Claude Code
Linear Ticket: OMN-220
Review Date: 2025-12-10
…-220] - Add specific exception handlers (UnicodeDecodeError, PermissionError, FileNotFoundError) before generic Exception handler for better error messages and actionable suggestions - Improve git integration with proper path comparison using resolved Path objects instead of string containment - Create DEPENDENCY_INVERSION.md architecture documentation explaining the transport library restrictions and protocol alternatives - Add test for aliased typing module TYPE_CHECKING blocks (tp.TYPE_CHECKING) - Update script references to new documentation file - Ensure find_python_files returns resolved paths for consistent comparison All 58 tests pass, mypy strict passes, transport import check passes.
Code Review - PR #147: Transport Import ValidationThank you for this comprehensive contribution! This PR implements a critical architecture enforcement mechanism for dependency inversion. Overall, the implementation is solid and production-ready, with excellent test coverage and thorough documentation. ✅ Strengths1. Excellent Architecture Alignment
2. Robust AST-Based Detection
3. Comprehensive Error HandlingThe
Good practice: All exceptions log to stderr for CI visibility while creating structured violations for reporting. 4. Strong Test Coverage
5. CI IntegrationThe workflow integration (lines 226-229 in
🔍 Issues FoundIssue 1: Nested If Statement Detection Gap
|
Code Review - PR #147: Transport Import ValidationI've completed a thorough review of this pull request. Overall, this is excellent work that adds critical architectural enforcement to the codebase. The implementation is well-designed, thoroughly tested, and properly documented. ✅ Strengths1. Architectural Soundness
2. Implementation Quality
3. Test Coverage
4. Documentation
5. CI Integration
6. Code Quality
🔍 Areas for Improvement1. Allowlist Expiration Warning (Minor)The allowlist expiration logic (lines 562-586) warns when approaching expiration, but doesn't actually block CI when the date passes. This could lead to the allowlist being forgotten. Suggestion: Consider making the expiration blocking (return exit code 1) after a grace period, not just a warning. For example: if days_until_expiration < -30: # 30 days past expiration
# Block CI after grace period
return 1, "CRITICAL: Allowlist expired over 30 days ago..."Current: Warning only (line 769-770 prints to stderr but doesn't fail) 2. Git Changed Files Detection (Minor Performance)The Suggestion: Check which branch exists first before attempting diff: # Determine base branch once
for base_branch in ["origin/main", "origin/master"]:
check = subprocess.run(["git", "rev-parse", "--verify", base_branch], ...)
if check.returncode == 0:
# Use this base_branch for diff
breakCurrent: Lines 611-626 try main, then master on failure 3. Test File Path Manipulation (Minor Code Smell)Lines 30-38 in test file use scripts_dir = str(SCRIPTS_DIR)
if scripts_dir not in sys.path:
sys.path.insert(0, scripts_dir)Suggestion: Consider using Current: Works correctly, just not the cleanest approach 4. Missing Test for
|
- Bump CACHE_VERSION to 0.1.2 to invalidate stale CI cache - Make test_enum_docstring more flexible (accept ONEX-compliant or ONEX-compatible) - Fixes CI failures caused by cached venv with old installed packages
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
docs/architecture/DEPENDENCY_INVERSION.md (2)
16-42: Add language specifier to fenced code block.The ASCII diagram code block should have a language specifier to satisfy markdown linting (MD040). Consider using
textorplaintext:-``` +```text +--------------------------------------------------+ | SERVICE LAYER |
164-167: Minor: Vary phrasing for readability.The repeated "can be replaced with" structure reads somewhat monotonously. Consider varying the phrasing:
-- Kafka can be replaced with RabbitMQ, AWS SQS, or GCP Pub/Sub -- PostgreSQL can be replaced with MySQL, MongoDB, or DynamoDB -- HashiCorp Vault can be replaced with AWS Secrets Manager -- Redis can be replaced with Memcached or DynamoDB +- Kafka → RabbitMQ, AWS SQS, or GCP Pub/Sub +- PostgreSQL → MySQL, MongoDB, or DynamoDB +- HashiCorp Vault → AWS Secrets Manager +- Redis → Memcached or DynamoDBscripts/check_transport_imports.py (1)
562-586: Consider moving UTC import to module level.The
from datetime import UTC, datetimeimport insidecheck_allowlist_expiration()could be moved to the module-level imports for consistency and slight performance improvement (avoid repeated import lookup).from dataclasses import dataclass, field -from datetime import date +from datetime import UTC, date, datetime from enum import EnumThen update the function:
def check_allowlist_expiration() -> tuple[bool, str]: ... - from datetime import UTC, datetime - today = datetime.now(tz=UTC).date()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.github/workflows/test.yml(2 hunks)docs/architecture/DEPENDENCY_INVERSION.md(1 hunks)scripts/check_transport_imports.py(1 hunks)tests/unit/enums/test_enum_json_value_type.py(1 hunks)tests/unit/scripts/test_check_transport_imports.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.py: Always callsuper().__init__(container)in node constructors where the parent class is a node base class (NodeCoreBase, NodeCompute, NodeEffect, NodeReducer, NodeOrchestrator)
UseModelONEXContainer(fromomnibase_core.models.container.model_onex_container) for dependency injection in node constructors, neverModelContainer[T]
Usepoetry runfor all Python command execution (pytest, mypy, black, isort, python -m) - never use pip or direct python invocation
Raise structuredModelOnexErrorexceptions with appropriateEnumCoreErrorCodevalues instead of generic Exception types
Usecontainer.get_service("ProtocolName")for dependency injection, never instantiate concrete classes or useisinstancechecks with protocols
Apply@standard_error_handlingdecorator fromomnibase_core.decorators.error_handlingto async methods that need try/catch boilerplate elimination
Do not share node instances across threads - create separate instances per thread or use thread-local storage
Import nodes directly fromomnibase_core.nodes(NodeCompute, NodeEffect, NodeReducer, NodeOrchestrator), not from legacyomnibase_core.infrastructurepaths
UseEnumNodeKindfor architectural classification in the ONEX workflow pipeline (EFFECT, COMPUTE, REDUCER, ORCHESTRATOR, RUNTIME_HOST), andEnumNodeTypefor specific implementation type discovery
Document node types with comprehensive YAML contract declarations showing input/output models and FSM/workflow configurations for REDUCER and ORCHESTRATOR nodes
Use duck typing with protocols instead of isinstance checks - access protocol methods directly without type verification
When using mixin classes, inherit from both the node base class and specific mixins (e.g., MixinDiscoveryResponder, MixinEventHandler, MixinWorkflowSupport) to add capabilities
Use event-driven communication throughModelEventEnvelopepattern for inter-service communication and event processing
Files:
tests/unit/enums/test_enum_json_value_type.pytests/unit/scripts/test_check_transport_imports.pyscripts/check_transport_imports.py
tests/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Mark tests with appropriate pytest markers (@pytest.mark.unit, @pytest.mark.integration, @pytest.mark.slow, @pytest.mark.smoke, @pytest.mark.performance) and add timeouts for tests that may hang
Files:
tests/unit/enums/test_enum_json_value_type.pytests/unit/scripts/test_check_transport_imports.py
.github/workflows/test.yml
📄 CodeRabbit inference engine (CLAUDE.md)
Configure CI to run 20 parallel test splits with expected runtime of 2m30s-3m30s per split, timeouts at 4m30s threshold, and failure investigation procedures
Files:
.github/workflows/test.yml
🧠 Learnings (4)
📚 Learning: 2025-12-10T00:12:47.175Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T00:12:47.175Z
Learning: Applies to **/*.py : Use `poetry run` for all Python command execution (pytest, mypy, black, isort, python -m) - never use pip or direct python invocation
Applied to files:
.github/workflows/test.yml
📚 Learning: 2025-12-10T00:12:47.175Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T00:12:47.175Z
Learning: Applies to **/*.{js,ts,tsx} : No JavaScript/TypeScript files are present in this project - development is Python-only using Python 3.12+ with Poetry
Applied to files:
.github/workflows/test.yml
📚 Learning: 2025-12-10T00:12:47.175Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T00:12:47.175Z
Learning: Applies to **/*.py : Use `ModelONEXContainer` (from `omnibase_core.models.container.model_onex_container`) for dependency injection in node constructors, never `ModelContainer[T]`
Applied to files:
docs/architecture/DEPENDENCY_INVERSION.md
📚 Learning: 2025-12-10T00:12:47.175Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T00:12:47.175Z
Learning: Applies to **/*.py : Use `container.get_service("ProtocolName")` for dependency injection, never instantiate concrete classes or use `isinstance` checks with protocols
Applied to files:
docs/architecture/DEPENDENCY_INVERSION.md
🪛 LanguageTool
docs/architecture/DEPENDENCY_INVERSION.md
[style] ~165-~165: You have already used this phrasing in nearby sentences. Consider using an alternative to add variety to your writing.
Context: ...SQS, or GCP Pub/Sub - PostgreSQL can be replaced with MySQL, MongoDB, or DynamoDB - HashiCorp...
(REP_REPLACEMENT)
[style] ~166-~166: You have already used this phrasing in nearby sentences. Consider using an alternative to add variety to your writing.
Context: ...B, or DynamoDB - HashiCorp Vault can be replaced with AWS Secrets Manager - Redis can be repl...
(REP_REPLACEMENT)
[style] ~167-~167: You have already used this phrasing in nearby sentences. Consider using an alternative to add variety to your writing.
Context: ...with AWS Secrets Manager - Redis can be replaced with Memcached or DynamoDB ## Allowed Patte...
(REP_REPLACEMENT)
🪛 markdownlint-cli2 (0.18.1)
docs/architecture/DEPENDENCY_INVERSION.md
16-16: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Smoke Tests
- GitHub Check: claude-review
🔇 Additional comments (13)
tests/unit/enums/test_enum_json_value_type.py (1)
77-79: LGTM - More resilient docstring validation.The change appropriately relaxes the assertion to accept variations like "ONEX-compliant" or "ONEX-compatible" while still validating essential documentation content. The
or ""fallback safely handles potentialNonedocstrings..github/workflows/test.yml (1)
223-228: LGTM - Transport import validation properly integrated into CI.The new lint step correctly uses
poetry run pythonas per coding guidelines, and the mypy strict validation on the script ensures type safety. Placement after dependency installation ensures the script can execute properly.docs/architecture/DEPENDENCY_INVERSION.md (1)
1-311: Comprehensive and well-structured documentation.The architecture document clearly explains the dependency inversion principle, provides useful code examples, and accurately describes the enforcement mechanism. The migration guide and temporary allowlist documentation will help developers transition existing code properly.
scripts/check_transport_imports.py (5)
56-68: LGTM - Clean enum definitions.The
ViolationTypeandSeverityenums are well-defined and appropriately scoped. IncludingSYNTAX_ERRORandANALYSIS_ERRORviolation types provides comprehensive error categorization.
159-178: LGTM - Allowlist with proper tracking.The temporary allowlist mechanism is well-documented with expiration date (2026-06-10), warning threshold (30 days), and clear TODO comments linking to the tracking ticket (OMN-220). This addresses the previous review comment about expiration tracking.
206-229: LGTM - TYPE_CHECKING block handling is thorough.The
visit_Ifmethod correctly tracks TYPE_CHECKING block state, restores it after visiting the body, and handles the else/elif branches normally. This properly allows type-only imports while detecting runtime imports.
387-501: LGTM - Comprehensive exception handling.The
analyze_filefunction handles all relevant exceptions (SyntaxError,UnicodeDecodeError,PermissionError,FileNotFoundError, and genericException) with proper violation creation and stderr logging. This ensures CI visibility while maintaining structured error reporting.
609-650: LGTM - Robust git integration.The
get_changed_filesfunction properly handles the fallback fromorigin/maintoorigin/master, handles various git failures gracefully (returning empty list), and correctly filters files to those withinsrc_dirusing proper path comparison rather than string containment.tests/unit/scripts/test_check_transport_imports.py (5)
35-38: LGTM - Defensive sys.path handling.The duplicate-entry check before
sys.path.insertfollows the pattern used elsewhere in the test suite and prevents path pollution during parallel test execution.
54-96: LGTM - Clean module loading pattern.The
_load_module()function safely handles the dynamic loading of the validation script with proper guards for missing files and invalid specs. Adding the module tosys.modulesbeforeexec_modulecorrectly prevents dataclass issues.
673-803: LGTM - Thorough TYPE_CHECKING block tests.The test class covers all the key patterns: direct
TYPE_CHECKING,typing.TYPE_CHECKING, aliased imports (t.TYPE_CHECKING,tp.TYPE_CHECKING), and nested conditions. This ensures the analyzer correctly allows type-only imports.
1177-1181: LGTM - Correct JSON field assertion.The assertion now uses the correct field name
total_violationsmatching the script's output, addressing the previous review comment.
1-1263: Comprehensive test coverage for transport import checker.The test suite thoroughly covers:
- Data class creation and formatting
- All banned transport modules (Kafka, Redis, HTTP clients, databases, infrastructure)
- Allowed imports (typing, pydantic, stdlib)
- TYPE_CHECKING block handling with various patterns
- Edge cases (empty files, syntax errors, nested imports, strings, comments)
- Multiple violations and line number accuracy
- CLI exit codes and output formats (text, JSON, verbose)
- Aliased and submodule imports
This provides strong confidence in the validator's correctness.
PR Review: Transport Import Validation [OMN-220]Overall Assessment✅ APPROVED with minor suggestions - This is an excellent implementation of automated transport import validation. The code quality is high, the test coverage is comprehensive, and the architectural approach aligns perfectly with the ONEX dependency inversion principles. Strengths 🌟1. Exceptional Test Coverage
2. Robust AST-based Detection
3. Smart TYPE_CHECKING Handling# Correctly allows type-only imports
if TYPE_CHECKING:
import kafka # ✅ Allowed for type annotations
4. Comprehensive Error HandlingThe script gracefully handles:
All errors are logged to stderr and converted to proper violations with helpful suggestions. 5. Excellent Documentation
6. CI Integration
Code Quality ObservationsExcellent Patterns ✅
BANNED_TRANSPORT_MODULES: frozenset[str] = frozenset({...})
TEMPORARY_ALLOWLIST: frozenset[str] = frozenset({...})
class TransportCheckResult(NamedTuple):
file_path: Path
violations: list[TransportViolation]
is_clean: bool
skip_reason: str | None
class ViolationType(Enum):
BANNED_TRANSPORT_IMPORT = "banned_transport_import"
SYNTAX_ERROR = "syntax_error"
ANALYSIS_ERROR = "analysis_error"
@dataclass
class TransportImportAnalyzer(ast.NodeVisitor):
def visit_Import(self, node: ast.Import) -> None: ...
def visit_ImportFrom(self, node: ast.ImportFrom) -> None: ...
def visit_If(self, node: ast.If) -> None: ...Suggestions for Improvement1. Minor: Allowlist Expiration Warning (Low Priority)# Current implementation
ALLOWLIST_EXPIRATION_DATE: date = date(2026, 6, 10)
ALLOWLIST_WARNING_DAYS: int = 30 # Warn this many days before expirationSuggestion: Add a check in def check_allowlist_expiration() -> None:
"""Warn if allowlist is approaching expiration."""
today = date.today()
days_until_expiration = (ALLOWLIST_EXPIRATION_DATE - today).days
if days_until_expiration <= ALLOWLIST_WARNING_DAYS:
print(
f"⚠️ WARNING: Temporary allowlist expires in {days_until_expiration} days!"
f" ({ALLOWLIST_EXPIRATION_DATE})\n"
f"Review and fix allowlisted files in TEMPORARY_ALLOWLIST.\n",
file=sys.stderr
)Rationale: Proactive warning prevents allowlist from becoming permanent. 2. Minor: Performance Optimization (Very Low Priority)The current implementation reads all Python files into memory. For very large codebases, consider: def analyze_file(file_path: Path) -> TransportCheckResult:
# Current: reads entire file
source = file_path.read_text(encoding="utf-8")
# Alternative for huge files (>10MB):
# Use streaming or early-exit on first violationNote: This is NOT a concern for omnibase_core (1865 files), but worth documenting for future scalability. 3. Documentation: Add Example Violation Output (Low Priority)The documentation is excellent, but could benefit from a "What does a violation look like?" section showing sample output formats. Security Considerations ✅No security concerns identified. The script:
Performance ConsiderationsCurrent Performance
CI Impact- name: Check for transport import violations (OMN-220)
run: |
poetry run python scripts/check_transport_imports.pyEstimated runtime: ~2-5 seconds for full omnibase_core scan (based on similar AST tools) Recommendation: ✅ No optimization needed. Current implementation is appropriate for project size. Test Coverage AnalysisCoverage Breakdown
Missing Test Cases (Optional Enhancement)Consider adding tests for:
Priority: Low - current coverage (81%) exceeds requirements (60%) Alignment with Project Standards✅ Follows CLAUDE.md Conventions
✅ Follows ONEX Architecture Principles
✅ Follows Testing Standards
Potential Bugs or IssuesNone identified ✅ The code is well-tested and handles edge cases properly. The temporary allowlist for Recommendations
Final VerdictLGTM 🚀 - This is excellent work! The implementation demonstrates:
The automated transport import validation will prevent architectural violations and maintain clean dependency boundaries as the codebase evolves. Estimated Merge Impact:
Reviewed by: Claude Sonnet 4.5 (AI Code Review Agent) |
- Replace generic NodeCompute[T_Input, T_Output] with non-generic version from main - Update ModelServiceCompute to use non-generic NodeCompute - Fixes mypy error when merging into main
Pull Request Review: Transport Import Validation [OMN-220]Overall AssessmentVerdict: APPROVED ✅ - This is an excellent architectural enforcement tool with comprehensive testing and documentation. Strengths 🌟1. Strong Architectural Foundation
2. Robust Implementation
3. Excellent Developer Experience
4. Thorough Documentation
Code Quality ObservationsSecurity ✅
Performance ✅
Type Safety ✅
Error Handling ✅
Detailed FindingsMajor Issues: NONE ✅Minor Issues: NONE ✅Nitpicks (optional improvements):
Test Coverage AnalysisTest File: tests/unit/scripts/test_check_transport_imports.py
Test Categories Covered: CI Integration ReviewChanges in .github/workflows/test.yml:
Concerns: NONE - Integration is clean and non-invasive Documentation Reviewdocs/architecture/DEPENDENCY_INVERSION.md:
Quality: Excellent - matches project documentation standards Peripheral Changes1. NodeCompute SimplificationFile: src/omnibase_core/nodes/node_compute.py 2. Effect Execution InfrastructureNew Files:
Assessment: These appear to be foundational for the declarative effect contract system. Well-documented, strongly typed, and comprehensively tested. ✅ Good addition 3. Example ContractsNew Files:
Assessment: ✅ Excellent examples with inline documentation showing real-world patterns 4. Test FlexibilityFile: tests/unit/enums/test_enum_json_value_type.py Performance Considerations
Security Review
Pre-existing Violation HandlingFile: src/omnibase_core/mixins/mixin_health_check.py:811 Recommendation: Create child ticket [OMN-XXX] to refactor mixin_health_check.py to use ProtocolHttpClient Commit History Review10 commits with clear progression:
Assessment: ✅ Well-organized commit history showing iterative improvement RecommendationsRequired Actions: NONE ✅Suggested Follow-ups (non-blocking):
ConclusionThis PR demonstrates:
No blocking issues found. Ready to merge. Reviewed by: Claude Code (Sonnet 4.5) |
- Delete test_node_compute_execute.py which tests non-existent methods (_contract_to_input, execute_compute) and used non-generic NodeCompute[Any, Any] - Add --tmp-only flag to cleanup.py to preserve mypy/ruff/pytest caches - Update CLAUDE.md to recommend --tmp-only for cleanup - Update pre-push.legacy hook to use --tmp-only
Code Review - PR #147: Transport Import ValidationThanks for this comprehensive PR implementing AST-based transport import validation! This is a solid architectural enforcement mechanism. ✅ STRENGTHS1. Excellent Architecture Enforcement
2. Robust Error Handling
3. Good CI Integration
4. Comprehensive Testing
5. Documentation
🔍 ISSUES TO ADDRESSMAJOR: Test File Deletion Without ContextFile: tests/unit/nodes/test_node_compute_execute.py deleted (1008 lines removed) Questions:
IMPORTANT: Per CLAUDE.md, project requires 60%+ test coverage with 12,000+ tests. Verify this deletion doesn't drop below threshold. MINOR: Allowlist ExpirationFile: scripts/check_transport_imports.py:176-178 Recommendation: Create child ticket immediately to refactor mixin_health_check.py to use ProtocolHttpClient 🧪 TESTING CONCERNSEffect Execution Utilities in ScopeFiles Added:
Question: These additions seem unrelated to transport validation (OMN-220). Why are they in this PR? NodeCompute SimplificationFile: node_compute.py This massive simplification needs explanation in PR description. 🎯 RECOMMENDATIONSMust Address Before Merge:
Should Address:
✅ FINAL VERDICTOverall: Approve with Conditions (pending clarifications) High-quality architectural enforcement with excellent error handling, testing, and documentation. Key Strengths: AST-based detection, comprehensive testing (57+ cases), excellent docs Once clarified, ready to merge! 🚀 Reviewed by: Claude Sonnet 4.5 |
Remove effect execution files that were accidentally included during NodeCompute sync. These belong to PR #135 (OMN-466), not this PR. Removed files: - src/omnibase_core/mixins/mixin_effect_execution.py - src/omnibase_core/utils/effect_executor.py - tests/unit/mixins/test_mixin_effect_execution.py - tests/unit/utils/test_effect_executor.py - examples/contracts/effect/api_data_fetcher.yaml - examples/contracts/effect/file_processor.yaml This keeps PR #147 focused on transport import validation only.
PR Review Response - Addressing Feedback1. Test File Deletion Rationale:
|
Code Review - PR #147: Transport Import ValidationOverviewThis PR adds a robust AST-based CI check to enforce architectural boundaries by preventing direct import of transport libraries in ✅ Strengths1. Excellent Architecture & Design ⭐
2. Outstanding Test Coverage ⭐⭐⭐
3. Robust Error Handling
4. Thoughtful CI Integration
5. Excellent Documentation
6. Code Quality
📋 Minor Observations (Not Blockers)1. Cleanup Script EnhancementThe Suggestion: Consider documenting the cache rebuild time in CLAUDE.md: # Full cleanup rebuilds caches (2-5 minutes mypy strict on 1865 files)
python3 scripts/cleanup.py
# Fast cleanup for hooks (seconds)
python3 scripts/cleanup.py --tmp-only2. Test File RemovalGood call removing 3. Allowlist Expiration Date6-month expiration ( 🔒 Security Review✅ No security concerns
🎯 Performance Review✅ Efficient implementation
CI Impact: Script adds ~1-2 seconds to lint job (negligible) 📊 Test Quality AnalysisCoverage Breakdown:
Test organization: Excellent use of test classes with descriptive docstrings 🚀 Recommendations for Future Enhancements (Post-Merge)
📝 Commit History Review✅ Clean, well-documented commits:
✅ Final VerdictAPPROVED - Ready to Merge ⭐⭐⭐⭐⭐ This PR demonstrates exceptional engineering:
Test Coverage: 81%+ significantly exceeds the project's 60% requirement Code Quality: Passes all quality gates:
Documentation: Comprehensive and well-structured No blocking issues - all feedback has been addressed through the iterative commits. 🎉 KudosExcellent work on:
This sets a high bar for future validation scripts! 🚀 Linear Ticket: OMN-220 |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/omnibase_core/nodes/node_compute.py (1)
314-331: ThreadPoolExecutor.shutdown() does not accept atimeoutkwarg
self.thread_pool.shutdown(wait=True, timeout=5.0)passes an unsupported keyword argument. Theshutdown()method inconcurrent.futures.ThreadPoolExecutoronly acceptswait(bool) and, in Python 3.9+,cancel_futures(keyword-only). This will raiseTypeErrorat runtime when_cleanup_node_resources()is called with a non-Nonepool, causing cleanup to fail and leaving executor threads uncollected.Remove the
timeout=5.0parameter and useshutdown(wait=True), or implement a manual timeout pattern by callingshutdown(wait=False)and polling for completion via executor inspection.
🧹 Nitpick comments (4)
scripts/cleanup.py (1)
71-90: Minor optimization and comment alignment fortmp_onlytraversalThe
tmp_onlybehavior is functionally correct: it selectsCLEANUP_DIRECTORIES_TMP_ONLYand disables pattern-based matching so onlytmp/directories are removed, preserving caches.Two small points you may want to tighten up:
- The comment says “Check files (only in full mode)” but in
tmp_onlyyou still iterate overfilesand computerelative_path, just withpatterns = []. This is harmless but a bit misleading and does unnecessary work on large trees.- You already know the mode from
tmp_only, so you can avoid compiling regexes and walking files when they’ll never be matched.One possible refactor:
def find_cleanup_files( - root_dir: Path, patterns: list[Pattern[str]], tmp_only: bool = False + root_dir: Path, patterns: list[Pattern[str]], tmp_only: bool = False ) -> list[Path]: @@ - # In tmp_only mode, skip pattern matching entirely - just find tmp dirs - if tmp_only: - patterns = [] + # In tmp_only mode, skip pattern matching entirely - just find tmp dirs + if tmp_only: + patterns = [] @@ - # Check files (only in full mode) - for file in files: - file_path = root_path / file - relative_path = file_path.relative_to(root_dir) - - for pattern in patterns: - if pattern.search(str(relative_path)): - cleanup_files.append(file_path) - break + # Check files (only in full mode) + if not tmp_only: + for file in files: + file_path = root_path / file + relative_path = file_path.relative_to(root_dir) + + for pattern in patterns: + if pattern.search(str(relative_path)): + cleanup_files.append(file_path) + breakOptionally, you could also skip compiling
CLEANUP_PATTERNSinmain()whenargs.tmp_onlyis true, but that’s purely micro-optimization.Also applies to: 101-121, 128-145
src/omnibase_core/models/service/model_service_compute.py (1)
61-67: MRO reorder and constructor are aligned with node guidelinesThe new base order with
MixinNodeServicefirst andNodeComputesecond, plus the documented MRO, makes sense for ensuring service lifecycle setup precedes health/caching/metrics. The__init__(self, container: ModelONEXContainer)correctly delegates tosuper().__init__(container), matching the dependency-injection and node-constructor patterns fromNodeCoreBase. Optionally, you could add-> Noneto the__init__signature for consistency with other node types.
Based on learnings, this matches the ModelONEXContainer + super().init(container) guidance.Also applies to: 78-81, 104-118
src/omnibase_core/nodes/node_compute.py (2)
102-116: process() pipeline (validation, caching, parallelism, metrics) is consistent but misses cache-hit timingThe overall flow—validate input, derive a deterministic cache key, short-circuit on cache hits, branch to parallel vs sequential computation, enforce a performance threshold, then update specialized + core metrics—is coherent and matches the documented behavior. Two possible refinements to consider:
- Cache hits currently return
ModelComputeOutputwithprocessing_time_ms=0.0andcache_hit=Truebut never populatecache_lookup_time_msor any metrics counters, so observability under-reports how often the node serves from cache and how long lookups take.- When
parallel_enabledis true butself.thread_poolisNone,_execute_parallel_computation()falls back to sequential execution butparallel_usedremainsTrue, which can slightly misreportparallel_execution_usedin edge cases whereprocess()is called before initialization/after cleanup.If you want full observability, you could track cache lookup time and update metrics on the cache-hit path, and optionally have
_execute_parallel_computation()return a flag indicating whether a pool was actually used.Also applies to: 124-126, 142-144, 165-167, 178-189
352-357: Cache-key generation and parallel-support check are simple; consider stronger determinismThe helpers
_generate_cache_key()and_supports_parallel_execution()are clear and inexpensive: keys derive fromcomputation_typeplus a SHA-256 ofstr(input_data.data), and parallelism is restricted to non-triviallist/tupleinputs. One caution:str()of unordered containers (e.g.set, or dicts if authors don’t treat insertion order as canonical) may not be semantically stable, which can lead to surprising cache misses across processes or versions. If you expect such inputs, consider normalizing to a canonical representation (e.g., JSON with sorted keys) before hashing.Also applies to: 359-363
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
CLAUDE.md(1 hunks)scripts/cleanup.py(7 hunks)src/omnibase_core/models/service/model_service_compute.py(1 hunks)src/omnibase_core/nodes/node_compute.py(8 hunks)tests/unit/nodes/test_node_compute_execute.py(0 hunks)
💤 Files with no reviewable changes (1)
- tests/unit/nodes/test_node_compute_execute.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.py: Always callsuper().__init__(container)in node constructors where the parent class is a node base class (NodeCoreBase, NodeCompute, NodeEffect, NodeReducer, NodeOrchestrator)
UseModelONEXContainer(fromomnibase_core.models.container.model_onex_container) for dependency injection in node constructors, neverModelContainer[T]
Usepoetry runfor all Python command execution (pytest, mypy, black, isort, python -m) - never use pip or direct python invocation
Raise structuredModelOnexErrorexceptions with appropriateEnumCoreErrorCodevalues instead of generic Exception types
Usecontainer.get_service("ProtocolName")for dependency injection, never instantiate concrete classes or useisinstancechecks with protocols
Apply@standard_error_handlingdecorator fromomnibase_core.decorators.error_handlingto async methods that need try/catch boilerplate elimination
Do not share node instances across threads - create separate instances per thread or use thread-local storage
Import nodes directly fromomnibase_core.nodes(NodeCompute, NodeEffect, NodeReducer, NodeOrchestrator), not from legacyomnibase_core.infrastructurepaths
UseEnumNodeKindfor architectural classification in the ONEX workflow pipeline (EFFECT, COMPUTE, REDUCER, ORCHESTRATOR, RUNTIME_HOST), andEnumNodeTypefor specific implementation type discovery
Document node types with comprehensive YAML contract declarations showing input/output models and FSM/workflow configurations for REDUCER and ORCHESTRATOR nodes
Use duck typing with protocols instead of isinstance checks - access protocol methods directly without type verification
When using mixin classes, inherit from both the node base class and specific mixins (e.g., MixinDiscoveryResponder, MixinEventHandler, MixinWorkflowSupport) to add capabilities
Use event-driven communication throughModelEventEnvelopepattern for inter-service communication and event processing
Files:
src/omnibase_core/models/service/model_service_compute.pysrc/omnibase_core/nodes/node_compute.pyscripts/cleanup.py
🧠 Learnings (5)
📚 Learning: 2025-12-10T00:12:47.175Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T00:12:47.175Z
Learning: Applies to **/*.py : Use `ModelONEXContainer` (from `omnibase_core.models.container.model_onex_container`) for dependency injection in node constructors, never `ModelContainer[T]`
Applied to files:
src/omnibase_core/models/service/model_service_compute.pysrc/omnibase_core/nodes/node_compute.py
📚 Learning: 2025-12-10T00:12:47.175Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T00:12:47.175Z
Learning: Applies to **/*.py : Import nodes directly from `omnibase_core.nodes` (NodeCompute, NodeEffect, NodeReducer, NodeOrchestrator), not from legacy `omnibase_core.infrastructure` paths
Applied to files:
src/omnibase_core/models/service/model_service_compute.pysrc/omnibase_core/nodes/node_compute.py
📚 Learning: 2025-12-10T00:12:47.175Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T00:12:47.175Z
Learning: Applies to **/*.py : Document node types with comprehensive YAML contract declarations showing input/output models and FSM/workflow configurations for REDUCER and ORCHESTRATOR nodes
Applied to files:
src/omnibase_core/nodes/node_compute.py
📚 Learning: 2025-12-10T00:12:47.175Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T00:12:47.175Z
Learning: Applies to **/*.py : Always call `super().__init__(container)` in node constructors where the parent class is a node base class (NodeCoreBase, NodeCompute, NodeEffect, NodeReducer, NodeOrchestrator)
Applied to files:
src/omnibase_core/nodes/node_compute.py
📚 Learning: 2025-12-10T00:12:47.175Z
Learnt from: CR
Repo: OmniNode-ai/omnibase_core PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-10T00:12:47.175Z
Learning: Applies to **/*.py : Use `poetry run` for all Python command execution (pytest, mypy, black, isort, python -m) - never use pip or direct python invocation
Applied to files:
scripts/cleanup.py
🧬 Code graph analysis (1)
src/omnibase_core/nodes/node_compute.py (4)
src/omnibase_core/enums/enum_core_error_code.py (1)
EnumCoreErrorCode(9-154)src/omnibase_core/infrastructure/node_core_base.py (1)
NodeCoreBase(43-861)src/omnibase_core/models/compute/model_compute_output.py (1)
ModelComputeOutput(53-111)src/omnibase_core/models/compute/model_compute_input.py (1)
ModelComputeInput(56-114)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Smoke Tests
- GitHub Check: claude-review
🔇 Additional comments (3)
scripts/cleanup.py (1)
9-22:--tmp-onlyflag semantics and wiring look correctThe new
--tmp-onlyoption is documented consistently (usage string, options block, and log message) and is correctly plumbed intofind_cleanup_files(tmp_only=args.tmp_only). The distinction between full cleanup and tmp-only mode is clear to users and aligns with the guidance in CLAUDE.md about preserving mypy/ruff/pytest caches for pre-commit/pre-push.Also applies to: 245-250, 286-294
src/omnibase_core/nodes/node_compute.py (2)
20-26: Non-generic NodeCompute with method-level type vars looks coherentDefining
T_Input/T_Outputat module scope and using them inprocess()’sModelComputeInput[T_Input]→ModelComputeOutput[T_Output]signature keeps the class runtime-non-generic while still giving a typed public surface for callers. The updated class docstring clearly advertises pure, deterministic compute behavior and type-safe I/O, which matches the current API.Also applies to: 38-53
212-224: Computation registration and metrics surface are well-guarded
register_computation()validates both duplicate keys and non-callable functions usingModelOnexErrorwithEnumCoreErrorCode.VALIDATION_ERROR, which is consistent with the error-code strategy, and logs successful registrations with node context.get_computation_metrics()composes per-computation metrics with cache and parallel-processing stats into a uniformdict[str, dict[str, float]], including safe handling ofmax_size == 0when computing utilization. The API surface here looks solid.Also applies to: 247-264
| # Cleanup | ||
| python3 scripts/cleanup.py # Clean tmp/, cache files | ||
| python3 scripts/cleanup.py --remove-from-git # Also remove tracked tmp files | ||
| python3 scripts/cleanup.py --tmp-only # Clean tmp/ only (preserves caches) - USE THIS! | ||
| python3 scripts/cleanup.py # FULL cleanup (deletes ALL caches - slow rebuild!) | ||
| python3 scripts/cleanup.py --remove-from-git --tmp-only # Remove tracked tmp files from git | ||
| python3 scripts/cleanup.py --dry-run # Preview what would be cleaned | ||
| python3 scripts/cleanup.py --verbose # Detailed output |
There was a problem hiding this comment.
Quick-reference cleanup commands should use Poetry, not direct python3
This block conflicts with the earlier “ALWAYS use Poetry” rule and the usage string in scripts/cleanup.py. It teaches direct python3 invocation instead of going through poetry run, which undermines the enforced environment consistency.
Recommend updating all cleanup commands here to use Poetry, e.g.:
- python3 scripts/cleanup.py --tmp-only # Clean tmp/ only (preserves caches) - USE THIS!
- python3 scripts/cleanup.py # FULL cleanup (deletes ALL caches - slow rebuild!)
- python3 scripts/cleanup.py --remove-from-git --tmp-only # Remove tracked tmp files from git
- python3 scripts/cleanup.py --dry-run # Preview what would be cleaned
- python3 scripts/cleanup.py --verbose # Detailed output
+ poetry run python scripts/cleanup.py --tmp-only # Clean tmp/ only (preserves caches) - USE THIS!
+ poetry run python scripts/cleanup.py # FULL cleanup (deletes ALL caches - slow rebuild!)
+ poetry run python scripts/cleanup.py --remove-from-git --tmp-only # Remove tracked tmp files from git
+ poetry run python scripts/cleanup.py --dry-run # Preview what would be cleaned
+ poetry run python scripts/cleanup.py --verbose # Detailed outputBased on learnings, this keeps all Python command execution routed through Poetry.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Cleanup | |
| python3 scripts/cleanup.py # Clean tmp/, cache files | |
| python3 scripts/cleanup.py --remove-from-git # Also remove tracked tmp files | |
| python3 scripts/cleanup.py --tmp-only # Clean tmp/ only (preserves caches) - USE THIS! | |
| python3 scripts/cleanup.py # FULL cleanup (deletes ALL caches - slow rebuild!) | |
| python3 scripts/cleanup.py --remove-from-git --tmp-only # Remove tracked tmp files from git | |
| python3 scripts/cleanup.py --dry-run # Preview what would be cleaned | |
| python3 scripts/cleanup.py --verbose # Detailed output | |
| # Cleanup | |
| poetry run python scripts/cleanup.py --tmp-only # Clean tmp/ only (preserves caches) - USE THIS! | |
| poetry run python scripts/cleanup.py # FULL cleanup (deletes ALL caches - slow rebuild!) | |
| poetry run python scripts/cleanup.py --remove-from-git --tmp-only # Remove tracked tmp files from git | |
| poetry run python scripts/cleanup.py --dry-run # Preview what would be cleaned | |
| poetry run python scripts/cleanup.py --verbose # Detailed output |
🤖 Prompt for AI Agents
In CLAUDE.md around lines 896 to 901, the quick-reference cleanup commands show
direct `python3` invocation which contradicts the repository's “ALWAYS use
Poetry” rule; update each example to run the script via Poetry (e.g., `poetry
run python scripts/cleanup.py` or `poetry run python3 scripts/cleanup.py`
consistently), and make the examples and any mention of flags match the script's
usage string in scripts/cleanup.py so all shown commands route execution through
Poetry.
Code Review: PR #147 - Transport Import ValidationThank you for this comprehensive implementation! This is an excellent addition that enforces architectural boundaries through automated validation. Here's my detailed review: ✅ Strengths1. Excellent Architecture Enforcement
2. Outstanding Test Coverage
3. Production-Ready Error Handling
4. Excellent Documentation
5. Smart Design Decisions
🔍 Code Quality ObservationsMinor Issues1. Incomplete Truncation in CI Output (Line ~500 in check_transport_imports.py) Looking at the diff output, it appears line 500 in the script may be truncated. The visible portion shows: skip_reason=f"Error analyzing file: {e}",This looks complete based on the pattern, but please verify the script file is not corrupted. The PR diff shows Resolution: Run 2. Module Loading in Tests (test_check_transport_imports.py:32-38) The defensive check in the test module: if scripts_dir not in sys.path:
sys.path.insert(0, scripts_dir)While functional, this could cause issues with pytest-xdist parallel execution if sys.path manipulation races occur. Consider using pytest's Recommendation: @pytest.fixture(scope="module")
def transport_checker_module():
spec = importlib.util.spec_from_file_location(
"check_transport_imports",
SCRIPTS_DIR / "check_transport_imports.py"
)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return moduleThis would eliminate the global sys.path manipulation. 3. Allowlist Expiration Warning (check_transport_imports.py:576-586) The expiration check calculates days correctly, but only warns to stderr in non-JSON mode. Consider:
# .github/workflows/test.yml
- name: Check allowlist expiration
run: |
# Fail if allowlist expired
poetry run python scripts/check_transport_imports.py --json | jq -e '.summary.allowlist_expiration_warning == null'4. Type Annotations for Clarity (check_transport_imports.py:528-542) The def _safe_relative_path(file_path: Path, base_dir: Path) -> str:
"""Get relative path, falling back to full path if not relative.
Args:
file_path: Path to make relative.
base_dir: Base directory to compute relative path from.
Returns:
String representation of relative path, or full path if relative_to fails.
"""
try:
return str(file_path.relative_to(base_dir))
except ValueError:
# Path is outside base_dir, return the full path
return str(file_path)Already well-typed! ✅ 🎯 Suggestions for Enhancement1. Performance Optimization for CIThe # scripts/check_transport_imports.py
import hashlib
from pathlib import Path
def _get_file_hash(file_path: Path) -> str:
return hashlib.sha256(file_path.read_bytes()).hexdigest()
# Cache results to .transport-check-cache.json
# Invalidate on file content changeThis could speed up repeated runs during development. 2. Enhanced CLAUDE.md IntegrationThe CLAUDE.md update is good, but consider adding to the "Common Pitfalls" section: ### ❌ Don't
8. **Import transport libraries in omnibase_core**
```python
# WRONG - violates dependency inversion
from kafka import KafkaProducer
from redis import Redis✅ Do
4. Allow Dynamic Protocol RegistrationFuture enhancement: Consider allowing projects to define additional banned modules via config: # pyproject.toml
[tool.omnibase.transport-checker]
banned_modules = ["custom_transport"]
alternatives = {"custom_transport" = "ProtocolCustom"}Not critical for v1, but would make the tool more extensible. 🔒 Security Considerations✅ No security concerns identified
🧪 Testing RecommendationsBefore Merge:
📊 Performance AnalysisExpected Performance:
Recommendations:
📝 Documentation ReviewDEPENDENCY_INVERSION.md:
CLAUDE.md Updates:
🎓 Learning from This PRWhat Makes This PR Excellent:
This is a model PR for architectural enforcement tooling. ✅ Final RecommendationAPPROVE - This PR is ready to merge pending minor verification:
Optional Future Enhancements (separate PRs):
📋 Checklist Status
Outstanding work! This PR demonstrates excellent software engineering practices and will significantly improve the project's architectural integrity. cc: @jonahgabriel |
Code Review: Transport Import Validation (OMN-220)SummaryThis PR introduces automated AST-based validation to enforce dependency inversion in omnibase_core by preventing direct imports of transport libraries. The implementation is well-architected, comprehensive, and production-ready with excellent test coverage and documentation. Strengths ✅1. Excellent Architecture & Design
2. Comprehensive Error Handling
3. Outstanding Test Coverage
4. Production-Grade Features
5. Documentation Excellence
6. CI Integration
Issues Found 🔍CRITICAL: Line Truncation in analyze_file()Location: The diff shows the file is truncated mid-line in the exception handler: skip_reason=f"Error analyzing file: {e}",
)\nThis appears to be a display artifact in the GitHub diff viewer. Please verify that the actual file is complete and not truncated. If it is truncated, this would cause a SyntaxError when the script runs. Action Required: # Verify file integrity
poetry run python -m py_compile scripts/check_transport_imports.py
# Or just run the script
poetry run python scripts/check_transport_imports.pyMINOR: Potential Performance Issue in get_changed_files()Location: The function tries result = subprocess.run(
["git", "diff", "--name-only", "origin/main", "--", "*.py"],
...
)
if result.returncode != 0:
# Try master if main doesn't exist
result = subprocess.run(
["git", "diff", "--name-only", "origin/master", "--", "*.py"],
...
)Issue: This will always run two git commands in repos using Suggestion: Cache the detected branch or check which exists first: # More efficient approach
for branch in ["origin/main", "origin/master"]:
result = subprocess.run(
["git", "diff", "--name-only", branch, "--", "*.py"],
capture_output=True, text=True, check=False,
cwd=src_dir.parent.parent,
)
if result.returncode == 0:
breakThis is minor and doesn't block the PR, but would be a nice optimization. MINOR: Thread Safety ConsiderationLocation: The Not an issue now, just something to keep in mind for future performance optimizations. Recommendations 💡1. Consider Adding Performance MetricsFor large codebases, it would be helpful to track:
This helps identify bottlenecks if the check becomes slow as the codebase grows. 2. Allowlist AutomationConsider adding a command to automatically update poetry run python scripts/check_transport_imports.py --extend-allowlist 90This would make allowlist management easier during periodic reviews. 3. Pre-commit Hook IntegrationConsider adding this check to pre-commit hooks for faster feedback: # .pre-commit-config.yaml
- repo: local
hooks:
- id: check-transport-imports
name: Check transport imports
entry: poetry run python scripts/check_transport_imports.py --changed-files
language: system
pass_filenames: falseSecurity Considerations 🔒
Test Coverage Assessment 📊Based on the PR description (53 tests, 81%+ coverage), coverage is excellent. The uncovered 19% is likely:
Recommendation: Maintain this coverage bar, don't let it drop below 75%. Performance Considerations ⚡Estimated Runtime (based on script design):
CI Impact: Minimal. This runs in the Final Verdict ✅APPROVE with minor suggestions This is exemplary work that demonstrates:
The only blocking issue is verifying the file isn't actually truncated (likely just a display artifact). Action ItemsBefore Merge:
Future Enhancements (separate tickets):
Reviewed by: Claude Sonnet 4.5 |
Code Review - PR 147: Transport Import ValidationI have completed a thorough review of this PR. Overall, this is excellent work that significantly strengthens the architectural boundaries of omnibase_core. Summary
Key Strengths
Security ReviewNo security concerns identified:
Performance Considerations
Project Standards AlignmentAll omnibase_core conventions followed:
|
Observations and Minor Suggestions1. Allowlist Expiration (Low Priority)File: scripts/check_transport_imports.py:161-163 The allowlist expires on 2026-06-10 but check_allowlist_expiration() only warns without blocking. Consider adding a CI check or calendar reminder to review allowlisted items before expiration. 2. Pre-existing Violation Tracking (Follow-up Required)File: src/omnibase_core/mixins/mixin_health_check.py:811 The aiohttp import on line 811 is properly allowlisted. Recommend creating a child ticket (OMN-220-followup) to:
3. CI Performance Optimization (Informational)File: .github/workflows/test.yml:226-228 The check runs full scans on every PR with approximately 1865 source files. The --changed-files mode exists but is not yet used in CI. Trade-off: Changed-files mode might miss violations if the banned module list is updated. Current full scan approach is safer but slower. Action: Optional optimization for future performance tuning. 4. Test Coverage Gap (Minor)The allowlist expiration warning logic is not explicitly tested. Consider adding a test that mocks date.today() to trigger the warning pathway. 5. Thread Safety Documentation (Excellent)File: scripts/check_transport_imports.py:182-189 The explicit thread safety documentation is excellent and aligns perfectly with the project threading documentation (docs/guides/THREADING.md). Well done! |
Final VerdictRecommendation: APPROVE with minor follow-up suggestions This PR is production-ready and should be merged. The implementation is clean, well-tested, and follows all project standards. Suggested Follow-up Tickets:
Why This Matters:This PR provides excellent architectural enforcement that will:
Kudos:
Great work on OMN-220! This will prevent architectural drift and keep omnibase_core clean. Reviewed by: Claude Sonnet 4.5 |
- Fix CLAUDE.md cleanup commands to use Poetry (python3 → poetry run python) - Move UTC import to module level in check_transport_imports.py - Improve get_changed_files() with robust repo root detection and fallbacks - Add explicit subprocess and unicode error handling - Document aliased TYPE_CHECKING edge case limitation - Add 6 new tests for --changed-files flag coverage - Add test documenting aliased TYPE_CHECKING constant behavior All 65 tests pass, mypy --strict passes. [OMN-220]
…651] (#149) * feat(ci): implement B+ hybrid mode for transport import checker [OMN-651] Optimize transport import validation with intelligent mode selection: - PRs to protected branches (main/develop): full scan for safety - PRs to other branches: --changed-files for fast feedback (55-82% faster) - Pushes to protected branches: full scan - Pushes to other branches: --changed-files Includes: - GitHub Actions summary output for visibility - Comprehensive evaluation document with benchmarks - Risk analysis and mitigation documentation Performance: 2.6s full scan → 0.5s typical PR (82% improvement) Closes OMN-651 * fix(ci): address PR #147 review feedback for transport import checker - Fix CLAUDE.md cleanup commands to use Poetry (python3 → poetry run python) - Move UTC import to module level in check_transport_imports.py - Improve get_changed_files() with robust repo root detection and fallbacks - Add explicit subprocess and unicode error handling - Document aliased TYPE_CHECKING edge case limitation - Add 6 new tests for --changed-files flag coverage - Add test documenting aliased TYPE_CHECKING constant behavior All 65 tests pass, mypy --strict passes. [OMN-220] * fix(ci): complete PR review feedback for transport import checker [OMN-651] Address remaining PR review items: 1. Documentation Enhancement: - Add concrete example for base ref limitation in evaluation doc - Shows commit divergence scenario with practical implications 2. CI Summary Enhancement: - Add file count to CI summary output for transparency - Shows total files in src/, files checked, and mode indicator - Enhanced JSON output with new summary fields 3. Integration Tests: - Add tests/integration/scripts/test_check_transport_imports_integration.py - 10 tests covering real codebase execution - Tests JSON output, verbose mode, changed-files mode, allowlisting 4. Risk Documentation (RISK-009): - Document CI workflow modification risk - Create .github/CODEOWNERS with workflow protection - Add RISK-009 reference comment in test.yml All 65 unit tests + 10 integration tests pass. mypy --strict passes. [OMN-651]
Summary
scripts/check_transport_imports.pywith comprehensive detection logiclintjob (runs on every PR)Banned Transport Libraries
Key Features
import Xandfrom X import Ypatternsif TYPE_CHECKING:blocksmixin_health_check.pyviolation tracked for separate fixPre-existing Violation
Found 1 pre-existing violation in
src/omnibase_core/mixins/mixin_health_check.py:811(importsaiohttpdirectly). Added to temporary allowlist - should be fixed in a separate ticket.Test plan
Summary by CodeRabbit
New Features
Chores
Tests
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.