fix(governance): R1 — COMPLEX outer/inner timeout coherence - #36818
Open
drussell23 wants to merge 1 commit into
Open
fix(governance): R1 — COMPLEX outer/inner timeout coherence#36818drussell23 wants to merge 1 commit into
drussell23 wants to merge 1 commit into
Conversation
Soak bt-2026-05-18-015317: psf routed COMPLEX (Trace-1 validated) but GENERATE died with CancelledError at ~255s — the OUTER Iron-Gate _gen_timeout for COMPLEX (JARVIS_GEN_TIMEOUT_COMPLEX_S=240 + JARVIS_OUTER_GATE_GRACE_S=15 = 255s) killed the call BEFORE the INNER fallback's 360s thinking window could complete. More COMPLEX budget on the inner path is moot if the outer gate fires first (same class as Task #88b, now on the COMPLEX+SWE-bench path). Falsifies the earlier "timeouts resolve with COMPLEX budget" assumption — empirically. Root fix — single source of truth, no duplication, no per-path drift: * candidate_generator: extract the inline _call_fallback thinking predicate + cap into module-level gen_call_likely_thinking() + fallback_thinking_cap_s(); refactor _call_fallback to consume them (behaviour-identical for _max_cap; removed locals have zero downstream refs). * generate_runner (the LIVE phase-dispatcher path) + orchestrator (dead-twin parity): at the _gen_timeout birth seam, BEFORE the deadline the outer wait_for derives from, floor _gen_timeout = max(_gen_timeout, fallback_thinking_cap_s()) when gen_call_likely_thinking(route, task_complexity). Both inner and outer now consume the SAME predicate+cap → outer >= inner holds by construction. Floor runs BEFORE adaptive scale_gen_timeout (also added to generate_runner for orchestrator parity) so one coherent value propagates to deadline + outer wait_for + tool-loop budget. Fail-open to route base; lazy import (no module-load coupling). Spine: tests/governance/test_r1_timeout_coherence.py (14 — predicate truth-table incl. case-insensitive + psf case; cap default/env/invalid -fallback; coherence invariant max(240,360)>=360 (>255 death point); AST pins: candidate_generator uses shared helper not inline literal; generate_runner + orchestrator floor BEFORE the GENERATE deadline they feed and BEFORE adaptive scale; no duplicated predicate on either path). 52 adjacent parity tests green (route/classify runner parity + op-isolation). 18 candidate_generator TestExhaustionInstrumentation failures are PRE-EXISTING (stash-isolated: identical on clean origin/main) — flagged, not bundled, per clean-scope discipline. R2 (controlled rubric soak: serial, urgency=high, sensor-throttled) runs after this merges. Tasks #7/#8 stay ratified-held. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📊 PR Size AnalysisSize: Review Checklist
|
🚨 CI/CD Failure DetectedThe Environment Variable Validation workflow failed for this PR. Action RequiredA tracking PR has been automatically created to help resolve this issue: Quick LinksPlease review the analysis and implement the suggested fixes. 🤖 Auto-generated by JARVIS CI/CD Manager |
🚨 CI/CD Failure DetectedThe Database Connection Validation workflow failed for this PR. Action RequiredA tracking PR has been automatically created to help resolve this issue: Quick LinksPlease review the analysis and implement the suggested fixes. 🤖 Auto-generated by JARVIS CI/CD Manager |
🤖 CI/CD Pipeline ResultsStatus: success Pipeline Stages
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aligns the orchestrator outer Iron Gate
wait_forbudget with the inner fallback thinking cap for COMPLEX-route GENERATE, so ops are not cancelled at ~255s (240s + grace) while fallback advertises a 360s cap.Context
Rubric soak bt-2026-05-18-015317 showed GENERATE dying at 255s with
CancelledErrordespitemax_cap=360son the fallback path — outer/inner timeout mismatch (Task #88b class).Test plan
pytest tests/governance/(touched timeout coherence pins)OUROBOROS_BATTLE_MAX_WALL_SECONDSset; confirm failure mode moves past 255s if providers still exhaustMade with Cursor