Repository navigation
feat(OMN-10917): delegation env read scanner in report mode - #1577
Conversation
AST-based scanner detects os.environ/os.getenv reads in delegation-owned modules. Report mode warns without blocking CI; enforce mode reserved for Wave 2 after contract-driven config lands (OMN-10915). Covers: node_delegation_orchestrator, node_delegation_routing_reducer, node_delegate_skill_orchestrator, node_llm_inference_effect, node_llm_completion_effect, node_projection_delegation, adapters/llm/. Deduplicates per-line with specificity preference (os.environ.get > os.environ). Honors ONEX_FLAG_EXEMPT and ONEX_EXCLUDE inline skip tokens.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ 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. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
…tract config (#1582) * feat(OMN-10924): delegation runtime loads Kafka bootstrap from contract, not env * feat(OMN-10925): replace LLM, bifrost, and security env vars with contract config * feat(OMN-10926): delegation env scanner — enforce mode (#1583) * feat(OMN-10926): delegation env scanner — enforce mode for omnibase_infra - Add check_delegation_env_reads.py to scripts/ci/ (ast.Call-based scanner, correctly handles ONEX_FLAG_EXEMPT on closing ) of formatter-wrapped calls) - Wire scanner in CI lint job as --mode enforce - Annotate 12 remaining LLM-adapter env reads with ONEX_FLAG_EXEMPT marking them as Wave 3 migration targets (OMN-10915); scanner now exits 0 clean - Add 17 scanner tests covering enforce mode, exempt annotations, and multi-line closing-paren skip token detection OMN-10926 * feat(OMN-10927): proof of life — delegation boots from contract with zero env vars (#1585) Integration test proving DelegationProfileConfigLoader bootstraps entirely from contract YAML with all 10 delegation-path env vars explicitly unset. Verifies contract load, event bus accessor, LLM backend accessor, security config accessor, caching behavior, and — critically — that zero delegation env vars are read during load. Final task in Part 1 (OMN-10915). Co-authored-by: jonahgabriel <jonahgabriel@users.noreply.github.com> --------- Co-authored-by: jonahgabriel <jonahgabriel@users.noreply.github.com> * feat(OMN-10917): delegation env read scanner in report mode (#1577) AST-based scanner detects os.environ/os.getenv reads in delegation-owned modules. Report mode warns without blocking CI; enforce mode reserved for Wave 2 after contract-driven config lands (OMN-10915). Covers: node_delegation_orchestrator, node_delegation_routing_reducer, node_delegate_skill_orchestrator, node_llm_inference_effect, node_llm_completion_effect, node_projection_delegation, adapters/llm/. Deduplicates per-line with specificity preference (os.environ.get > os.environ). Honors ONEX_FLAG_EXEMPT and ONEX_EXCLUDE inline skip tokens. Co-authored-by: jonahgabriel <jonahgabriel@users.noreply.github.com> * fix(OMN-10925): clear llm security sonar hotspot * test(OMN-10925): align delegation profile integration assertion --------- Co-authored-by: jonahgabriel <jonahgabriel@users.noreply.github.com>
…tract config (#1582) * feat(OMN-10924): delegation runtime loads Kafka bootstrap from contract, not env * feat(OMN-10925): replace LLM, bifrost, and security env vars with contract config * feat(OMN-10926): delegation env scanner — enforce mode (#1583) * feat(OMN-10926): delegation env scanner — enforce mode for omnibase_infra - Add check_delegation_env_reads.py to scripts/ci/ (ast.Call-based scanner, correctly handles ONEX_FLAG_EXEMPT on closing ) of formatter-wrapped calls) - Wire scanner in CI lint job as --mode enforce - Annotate 12 remaining LLM-adapter env reads with ONEX_FLAG_EXEMPT marking them as Wave 3 migration targets (OMN-10915); scanner now exits 0 clean - Add 17 scanner tests covering enforce mode, exempt annotations, and multi-line closing-paren skip token detection OMN-10926 * feat(OMN-10927): proof of life — delegation boots from contract with zero env vars (#1585) Integration test proving DelegationProfileConfigLoader bootstraps entirely from contract YAML with all 10 delegation-path env vars explicitly unset. Verifies contract load, event bus accessor, LLM backend accessor, security config accessor, caching behavior, and — critically — that zero delegation env vars are read during load. Final task in Part 1 (OMN-10915). Co-authored-by: jonahgabriel <jonahgabriel@users.noreply.github.com> --------- Co-authored-by: jonahgabriel <jonahgabriel@users.noreply.github.com> * feat(OMN-10917): delegation env read scanner in report mode (#1577) AST-based scanner detects os.environ/os.getenv reads in delegation-owned modules. Report mode warns without blocking CI; enforce mode reserved for Wave 2 after contract-driven config lands (OMN-10915). Covers: node_delegation_orchestrator, node_delegation_routing_reducer, node_delegate_skill_orchestrator, node_llm_inference_effect, node_llm_completion_effect, node_projection_delegation, adapters/llm/. Deduplicates per-line with specificity preference (os.environ.get > os.environ). Honors ONEX_FLAG_EXEMPT and ONEX_EXCLUDE inline skip tokens. Co-authored-by: jonahgabriel <jonahgabriel@users.noreply.github.com> * fix(OMN-10925): clear llm security sonar hotspot * test(OMN-10925): align delegation profile integration assertion --------- Co-authored-by: jonahgabriel <jonahgabriel@users.noreply.github.com>
… env vars (#1578) * feat(OMN-10923): delegation profile config loader — contract-only, no env vars Reads delegation runtime profile YAML and returns typed Pydantic models. Zero env var reads during load; all config sourced from the contract file. Caches result after first successful load. Blocked on omnibase_core PR #1072. * fix(OMN-10923): add Any return type annotations with ONEX_EXCLUDE suppression * refactor(OMN-10923): import delegation models from omnibase_compat Switch DelegationProfileConfigLoader to import ModelDelegationRuntimeProfile from omnibase_compat.contracts.delegation (omnibase_compat PR#87 / OMN-10919) instead of omnibase_core.models.contracts. Add omnibase-compat>=0.3.1 as an explicit direct dependency in pyproject.toml. * test(OMN-10923): add delegation profile integration coverage * contract(OMN-10923): add deploy gate evidence * feat(OMN-10924): delegation runtime loads Kafka bootstrap from contract, not env (#1579) Co-authored-by: jonahgabriel <jonahgabriel@users.noreply.github.com> * chore(OMN-10923): retrigger blocked CI contexts * feat(OMN-10925): replace LLM, bifrost, and security env vars with contract config (#1582) * feat(OMN-10924): delegation runtime loads Kafka bootstrap from contract, not env * feat(OMN-10925): replace LLM, bifrost, and security env vars with contract config * feat(OMN-10926): delegation env scanner — enforce mode (#1583) * feat(OMN-10926): delegation env scanner — enforce mode for omnibase_infra - Add check_delegation_env_reads.py to scripts/ci/ (ast.Call-based scanner, correctly handles ONEX_FLAG_EXEMPT on closing ) of formatter-wrapped calls) - Wire scanner in CI lint job as --mode enforce - Annotate 12 remaining LLM-adapter env reads with ONEX_FLAG_EXEMPT marking them as Wave 3 migration targets (OMN-10915); scanner now exits 0 clean - Add 17 scanner tests covering enforce mode, exempt annotations, and multi-line closing-paren skip token detection OMN-10926 * feat(OMN-10927): proof of life — delegation boots from contract with zero env vars (#1585) Integration test proving DelegationProfileConfigLoader bootstraps entirely from contract YAML with all 10 delegation-path env vars explicitly unset. Verifies contract load, event bus accessor, LLM backend accessor, security config accessor, caching behavior, and — critically — that zero delegation env vars are read during load. Final task in Part 1 (OMN-10915). Co-authored-by: jonahgabriel <jonahgabriel@users.noreply.github.com> --------- Co-authored-by: jonahgabriel <jonahgabriel@users.noreply.github.com> * feat(OMN-10917): delegation env read scanner in report mode (#1577) AST-based scanner detects os.environ/os.getenv reads in delegation-owned modules. Report mode warns without blocking CI; enforce mode reserved for Wave 2 after contract-driven config lands (OMN-10915). Covers: node_delegation_orchestrator, node_delegation_routing_reducer, node_delegate_skill_orchestrator, node_llm_inference_effect, node_llm_completion_effect, node_projection_delegation, adapters/llm/. Deduplicates per-line with specificity preference (os.environ.get > os.environ). Honors ONEX_FLAG_EXEMPT and ONEX_EXCLUDE inline skip tokens. Co-authored-by: jonahgabriel <jonahgabriel@users.noreply.github.com> * fix(OMN-10925): clear llm security sonar hotspot * test(OMN-10925): align delegation profile integration assertion --------- Co-authored-by: jonahgabriel <jonahgabriel@users.noreply.github.com> * fix(OMN-10923): address delegation profile review gates * fix(OMN-10923): pin omnibase-compat to main for delegation contracts The delegation profile config loader imports from omnibase_compat.contracts.delegation, which was added in omnibase_compat PR #87 (commit d86ee00). The previous lock pinned omnibase-compat to v0.3.1 (commit ea4239d), predating the delegation module — causing ModuleNotFoundError on the 13 new delegation loader tests in CI Splits 2/15 and 10/15. Add an explicit [tool.uv.sources] pin plus an override-dependencies entry (so omnimarket's older zip-archive pin doesn't conflict), locking omnibase-compat at commit 51c39d8 (omnibase_compat main HEAD, contains both delegation contract models and the versioned pricing contract). Per ticket evidence: ticket OMN-10923 dod_evidence. Resolves Tests Split 2/15 + Split 10/15 + CI Summary + Tests Gate. * fix(OMN-10923): resolve sibling-compat URL conflict for omnibase-compat CI was rejecting the install with "Requirements contain conflicting URLs for package omnibase-compat": - pyproject.toml [tool.uv] override-dependencies pinned to git+SHA - check-sibling-compat.yml + ci.yml --overrides files added file:// uv treats CLI --overrides and pyproject override-dependencies as the same constraint layer, so two URL specs for the same package fail resolution. Drop the redundant file:// override lines in the three CI workflows; the pyproject git+SHA pin already forces omnimarket's archive zip URL to be replaced. The OMN-4315 sibling-compat semantics are preserved (we still validate dry-run install of omniintelligence against pinned omnibase_infra). Also invert tests/ci/test_delegation_env_scanner.py::test_scanner_finds_violations_in_repo to assert ZERO violations (OMN-10925 removed all env reads from delegation modules; the scanner's job is now to keep that state clean, not to find known violations). Rebased onto origin/main; conflict in scripts/ci/check_delegation_env_reads.py resolved by accepting main's superseding implementation (multi-line skip token detection from OMN-10925). --------- Co-authored-by: jonahgabriel <jonahgabriel@users.noreply.github.com>



Summary
os.environ/os.getenvin delegation-owned modulesos.environ.get>os.environ)ONEX_FLAG_EXEMPTandONEX_EXCLUDEinline skip tokensTest plan
OMN-10917
Evidence-Source: OCC#982
Evidence-Ticket: OMN-10917