fix(consult): race a bounded VedAstro gateway on the chat path
Independent Staging Quality Gate / validate (push) Successful in 10m15s
Independent Staging Quality Gate / publish (push) Successful in 10m2s

Foreground still skips the heavy overview stack, but overlaps a timed
gateway so official evidence can merge when it finishes in budget.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-19 17:51:27 +08:00
parent 0eedf92992
commit bffc74efc5
9 changed files with 321 additions and 11 deletions
@@ -20,6 +20,7 @@ from jyotish_api_server import ( # noqa: E402
JyotishAPIHandler,
_attach_local_consultation_layers,
_build_consumer_context,
_compact_vedastro_cross_check,
)
from unified_consultation_orchestrator import UnifiedConsultationOrchestrator # noqa: E402
@@ -700,3 +701,35 @@ def test_failed_vedastro_raw_packet_is_not_marked_as_used() -> None:
)
assert packet['sections']['vedastro_official_raw_response']['status'] == 'received_unverified'
def test_compact_vedastro_cross_check_keeps_signs_and_drops_coordinates() -> None:
compact = _compact_vedastro_cross_check(
{'official_closure_state': 'official_verified', 'status': 'ok'},
{
'official_raw_response': {
'natal': {'sun': 'Leo', 'moon': 'Taurus', 'ascendant': 'Cancer'},
'lat': 25.03,
'lon': 121.56,
'hour': 3,
'minute': 4,
},
},
)
assert compact['status'] == 'executed'
assert compact['natal'] == {'sun': 'Leo', 'moon': 'Taurus', 'ascendant': 'Cancer'}
assert 'lat' not in compact
assert 'lon' not in compact
assert 'hour' not in compact
def test_compact_vedastro_cross_check_marks_timeout_blocked() -> None:
compact = _compact_vedastro_cross_check(
{},
{
'official_closure_state': 'official_blocked',
'official_closure_reason': 'foreground_optional_evidence_timeout',
},
)
assert compact['status'] == 'blocked'
assert compact['official_closure_reason'] == 'foreground_optional_evidence_timeout'