fix(limits): traverse blank notional aliases and reject booleans - #1054
Conversation
|
Warning Review limit reachedNext included review available in 2 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 78 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Essentials Run ID: 📒 Files selected for processing (2)
Comment |
|
Workflow state fingerprint for Keepalive Loop Reporter. Do not edit. |
🤖 Keepalive Loop StatusPR #1054 | Agent: Codex | Iteration 0/12 Current State
🔍 Failure Classification| Error type | infrastructure | |
Keepalive Work Log (click to expand)
|
|
Workflow state fingerprint for Agents Gate Followups. Do not edit. |
🤖 Keepalive Loop StatusPR #1054 | Agent: Codex | Iteration 0/12 Current State
🔍 Failure Classification| Error type | infrastructure | |
|
Autofix attempts exhausted for this head. Latest Gate summary: Please investigate manually. |
There was a problem hiding this comment.
🟢 Approval recommended
Validation passes and no unresolved issues were identified.
Pull request overview
Fixes notional extraction for sparse aliases and rejects boolean values before limit evaluation.
Changes:
- Falls through blank notional aliases.
- Rejects boolean notionals with
ValueError. - Adds focused and integration test coverage.
File summaries
| File | Description |
|---|---|
tests/compute/test_limits.py |
Tests alias fallback, boolean rejection, and limit calculations. |
src/counter_risk/compute/limits.py |
Implements fallback traversal and boolean validation. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🤖 Keepalive Loop StatusPR #1054 | Agent: Codex | Iteration 0/12 Current State
🔍 Failure Classification| Error type | infrastructure | |
|
Autofix attempts exhausted for this head. Latest Gate summary: Please investigate manually. |
🤖 Keepalive Loop StatusPR #1054 | Agent: Codex | Iteration 0/12 Current State
🔍 Failure Classification| Error type | infrastructure | |
🤖 Keepalive Loop StatusPR #1054 | Agent: Claude | Iteration 1/12 Current State
Last Claude Run
Claude output:
🧠 Task Analysis| Provider | 🔶 Regex (fallback) |
|
|
Closer audit on exact head b149e18: complete two-file diff and source #1047 acceptance inspected. Sparse alias fallback, boolean rejection, precedence and breach calculations match scope. Retained opener original25fail/mutation14fail/restored43pass evidence checked; Cursor Orchestrator fallback independently reran43 tests PASS and direct250000.0. Copilot recommended approval on this exact head; active review threads are zero. CodeRabbit reported a usage spending cap, so its SUCCESS context is not treated as substantive review. The fallback helper was rechecked once and the prescribed advisory review completed approve/no P0/P1. Its optional alias expansion and non-Python boolean concerns are pre-existing and outside this issue’s explicit isinstance(bool) contract. Live branch protection returned404 and rulesets are empty; no separately required CodeRabbit approval needs a waiver. The stale needs-human label came from cancelled Gate34692833899/34692834337, superseded by successful Gate34692904565 and Python34692904706 on this same head. Fully paginated148check records/57names have latest SUCCESS/SKIPPED only. Compared with1052, the absent nested autofix/autofix job is explained by its parent autofix being SKIPPED; lint-format is configured skipped. Runtime-AC merge guard has no additional required gate. Seven-minute review floor12:15:23Z has elapsed. Before merge I will requery exact head, full check inventory, mergeability and full active threads. Source1047 remains pending postmerge verify:compare. |
Provider Comparison ReportProvider Summary
📋 Full Provider Details (click to expand)openai
anthropic
Agreement
DisagreementNo major disagreements detected. Unique Insights
🔍 LangSmith Traces |
|
Workflow state fingerprint for Agents Verifier. Do not edit. |
|
Runner dispatch state for claude on PR #1054. Do not edit. |
Closes #1047
Rows with a blank primary notional now use the next populated alias, so sparse exposure rows reach limit evaluation. Boolean notionals raise ValueError. Existing alias order, zero values, signed numbers, invalid-value rejection, and limit calculations remain unchanged.
Tasks
src/counter_risk/compute/limits.py, update_find_notionalto continue checking remaining candidate keys when a candidate key isNoneor empty.src/counter_risk/compute/limits.py, add boolean type guardnot isinstance(val, bool)in_find_notional.tests/compute/test_limits.py, add unit tests covering candidate fallthrough for{"notional": None, "exposure": 250000.0}and boolean input rejection.Acceptance Criteria
uv run pytest tests/compute/test_limits.py -qpasses; fallback keys are evaluated when first key isNoneor empty._find_notional({"notional": None, "exposure": 250000.0}) == 250000.0._find_notionalinsrc/counter_risk/compute/limits.pyto raise onNonewithout checking fallback keys; test must fail; restore and rerun.Validation evidence
uv run pytest tests/compute/test_limits.py -q: 43 passed. Includes public absolute and percentage breach calculations using sparse rows.250000.0. Black, Ruff, mypy, andgit diff --checkpass.UV_PROJECT_ENVIRONMENT,UV_NO_SYNC=1, andPYTHONPATH=src; verified imports resolve to this worktree. Focused suite only.The existing
_NOTIONAL_KEYStuple is preserved; the issue description names several aliases not currently supported. No alias expansion is needed for the stated acceptance criteria.