From 6ffea249ec515e4fa4d40ad24a3876ac0b83819b Mon Sep 17 00:00:00 2001 From: Shay Date: Mon, 20 Jul 2026 13:36:53 -0700 Subject: [PATCH] fix(cognition): break ContractAssessment import cycle in pipeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lazy-import ContractAssessment inside geometry contract assessment so problem_frame_contracts → chat → cognition → problem_frame_contracts cannot form a partial-init cycle. Unblocks GSM8K rat1/wave_a runners. [Verification]: rat1+wave_a+pipeline+surface 38 passed; import path ok --- core/cognition/pipeline.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/cognition/pipeline.py b/core/cognition/pipeline.py index 98c5d9fb..325e2a4e 100644 --- a/core/cognition/pipeline.py +++ b/core/cognition/pipeline.py @@ -38,7 +38,6 @@ from generate.intent_ratifier import ( RatifiedIntent, ratify_intent, ) -from generate.problem_frame_contracts import ContractAssessment from generate.graph_planner import ( GraphNode, PropositionGraph, @@ -809,11 +808,15 @@ class CognitiveTurnPipeline: return inject(token_list, vocab) @staticmethod - def _geometry_contract_assessment(F) -> ContractAssessment: + def _geometry_contract_assessment(F): """Build contract assessment from active versor + GoldTether residuals. Closed only when versor_condition(F) < 1e-6 and R_GoldTether ≤ 1e-6. + Local import avoids chat → cognition → problem_frame_contracts cycles + (problem_frame_contracts imports chat.pack_resolver). """ + from generate.problem_frame_contracts import ContractAssessment + if F is None: return ContractAssessment( candidate_organ="shadow_coherence_gate",