Surface VedAstro overview across prompts and reports
This commit is contained in:
@@ -190,6 +190,18 @@ def test_vedastro_status_endpoint_exposes_safe_adapter_state(monkeypatch) -> Non
|
||||
assert payload['live_profile'] == 'vedastro-live'
|
||||
|
||||
|
||||
def test_vedastro_status_endpoint_honors_explicit_network_disable_even_when_local_env_exists(monkeypatch) -> None:
|
||||
monkeypatch.setenv('VEDASTRO_API_ENDPOINT', 'https://vedastro.example.test/secret/path')
|
||||
monkeypatch.setenv('VEDASTRO_ENABLE_NETWORK', '0')
|
||||
handler = _VedAstroStatusCaptureHandler()
|
||||
|
||||
handler.do_GET()
|
||||
|
||||
payload = handler.payload()
|
||||
assert payload['network_enabled'] is False
|
||||
assert payload['status'] == 'network_execution_disabled'
|
||||
|
||||
|
||||
def test_vedastro_range_scan_endpoint_uses_user_birth_and_returns_controlled_blocked_state(monkeypatch) -> None:
|
||||
monkeypatch.delenv('VEDASTRO_API_ENDPOINT', raising=False)
|
||||
monkeypatch.delenv('VEDASTRO_ENABLE_NETWORK', raising=False)
|
||||
@@ -578,6 +590,59 @@ def test_report_artifact_can_render_functional_benefic_malefic_summary() -> None
|
||||
assert '高严谨模式下必须叠加功能性吉凶星。' in html
|
||||
|
||||
|
||||
def test_report_artifact_can_render_vimsopaka_semantic_summary() -> None:
|
||||
handler = _handler()
|
||||
result = handler._compute_report_artifact({
|
||||
'format': 'html',
|
||||
'name': 'vimsopaka-semantic-report',
|
||||
'html': '<!doctype html><html><body><h1>Jyotish</h1></body></html>',
|
||||
'vimsopaka_semantic_summary': {
|
||||
'status': 'used',
|
||||
'highlights': ['Sun: 极友(Great Friend)', 'Moon: 落陷取消(Neecha Bhanga)'],
|
||||
'warnings': ['Mars: 极敌(Great Enemy)'],
|
||||
},
|
||||
})
|
||||
|
||||
assert result['success'] is True
|
||||
html = Path(result['html_path']).read_text(encoding='utf-8')
|
||||
assert 'Vimsopaka Semantic Summary' in html
|
||||
assert 'Great Friend' in html
|
||||
assert 'Neecha Bhanga' in html
|
||||
assert 'Great Enemy' in html
|
||||
|
||||
|
||||
def test_report_artifact_can_render_vedastro_external_overview() -> None:
|
||||
handler = _handler()
|
||||
result = handler._compute_report_artifact({
|
||||
'format': 'html',
|
||||
'name': 'vedastro-overview-report',
|
||||
'html': '<!doctype html><html><body><h1>Jyotish</h1></body></html>',
|
||||
'vedastro_overview': {
|
||||
'status': 'ok',
|
||||
'source': 'vedastro_service_adapter_candidate',
|
||||
'ingestion_profile': 'main_entry_overview',
|
||||
'search_scope': 'single_day_overview',
|
||||
'reference_date': '2026-06-29',
|
||||
'event_count': 5,
|
||||
'domain_statuses': {'career': 'ok', 'marriage': 'ok', 'wealth': 'ok'},
|
||||
'top_events_by_domain': {
|
||||
'marriage': {'signal_label': 'Jupiter in 7th marriage window', 'start': '2026-06-29'},
|
||||
'career': {'signal_label': 'Jupiter in 10th career window', 'start': '2026-06-29'},
|
||||
},
|
||||
'boundary_note': 'This is overview only and does not replace explicit long-range scans.',
|
||||
},
|
||||
})
|
||||
|
||||
assert result['success'] is True
|
||||
html = Path(result['html_path']).read_text(encoding='utf-8')
|
||||
assert 'VedAstro External Overview' in html
|
||||
assert 'main_entry_overview' in html
|
||||
assert 'single_day_overview' in html
|
||||
assert '2026-06-29' in html
|
||||
assert 'Jupiter in 7th marriage window' in html
|
||||
assert 'overview only' in html
|
||||
|
||||
|
||||
def test_report_artifact_can_render_relationship_strict_narrative_summary() -> None:
|
||||
handler = _handler()
|
||||
result = handler._compute_report_artifact({
|
||||
@@ -1534,6 +1599,36 @@ def test_chart_ai_prompt_pack_exposes_functional_benefic_malefic_layer() -> None
|
||||
assert isinstance(functional['functional_benefics'], list)
|
||||
assert isinstance(functional['functional_malefics'], list)
|
||||
assert functional['effect_on_confidence']
|
||||
vedastro = prompt_pack['evidence_snapshot']['vedastro_overview']
|
||||
assert vedastro['source'] == 'vedastro_service_adapter_candidate'
|
||||
assert vedastro['ingestion_profile'] == 'main_entry_overview'
|
||||
assert vedastro['visibility'] == 'user_visible_overview_only'
|
||||
|
||||
|
||||
def test_chart_auto_attaches_vedastro_main_entry_boundary(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setenv("VEDASTRO_API_ENDPOINT", "https://example.invalid/api")
|
||||
monkeypatch.setenv("VEDASTRO_ENABLE_NETWORK", "0")
|
||||
monkeypatch.setenv("JYOTISH_SKIP_LOCAL_ENV", "1")
|
||||
|
||||
handler = _handler()
|
||||
result = handler._compute_chart({
|
||||
'year': 1990,
|
||||
'month': 6,
|
||||
'day': 15,
|
||||
'hour': 12,
|
||||
'minute': 0,
|
||||
'lat': 39.9,
|
||||
'lon': 116.4,
|
||||
'tz': 8,
|
||||
})
|
||||
|
||||
assert "modules" in result
|
||||
vedastro = result["modules"]["vedastro_range_scan_result"]
|
||||
assert vedastro["backend"] == "vedastro_service_adapter_candidate"
|
||||
assert vedastro["status"] == "network_execution_disabled"
|
||||
assert vedastro["source_metadata"]["ingestion_profile"] == "main_entry_overview"
|
||||
assert vedastro["source_metadata"]["reference_date"]
|
||||
assert sorted(vedastro["source_metadata"]["domain_statuses"]) == ["career", "marriage", "wealth"]
|
||||
|
||||
|
||||
def test_yogas_endpoint_returns_summary_counts() -> None:
|
||||
|
||||
@@ -313,6 +313,10 @@ def test_full_reading_reports_ayanamsa_metadata_and_ai_prompt_pack() -> None:
|
||||
assert relationship_narrative["markdown"]
|
||||
assert "D9" in "".join(relationship_narrative["boundaries"])
|
||||
assert "dual dasha" in relationship_narrative["markdown"]
|
||||
vimsopaka_summary = prompt_pack["evidence_snapshot"]["vimsopaka_semantic_summary"]
|
||||
assert vimsopaka_summary["status"] == "used"
|
||||
assert isinstance(vimsopaka_summary["highlights"], list)
|
||||
assert isinstance(vimsopaka_summary["warnings"], list)
|
||||
oracle_progress = prompt_pack["evidence_snapshot"]["oracle_progress"]
|
||||
assert oracle_progress["scope"] == "external_oracle_evidence_validation"
|
||||
assert oracle_progress["valid_packets"] >= 4
|
||||
@@ -320,6 +324,49 @@ def test_full_reading_reports_ayanamsa_metadata_and_ai_prompt_pack() -> None:
|
||||
assert oracle_progress["production_tuning_allowed"] is False
|
||||
assert oracle_progress["artifact_policy"] == "references/oracle/artifacts/"
|
||||
assert "external_verified" in oracle_progress["promotion_rule"]
|
||||
vedastro_overview = prompt_pack["evidence_snapshot"]["vedastro_overview"]
|
||||
assert vedastro_overview["status"] in {"ok", "network_execution_disabled", "service_endpoint_not_configured"}
|
||||
assert vedastro_overview["source"] == "vedastro_service_adapter_candidate"
|
||||
assert vedastro_overview["ingestion_profile"] == "main_entry_overview"
|
||||
assert vedastro_overview["visibility"] == "user_visible_overview_only"
|
||||
vedastro_rows = [row for row in audit_table if row["technique"] == "VedAstro Main Entry Overview"]
|
||||
assert vedastro_rows
|
||||
assert vedastro_rows[0]["status"] in {"used", "blocked"}
|
||||
assert "overview only" in vedastro_rows[0]["note"]
|
||||
assert "domain_statuses" in vedastro_rows[0]["note"]
|
||||
|
||||
|
||||
def test_full_reading_auto_attaches_vedastro_main_entry_boundary() -> None:
|
||||
env = dict(**__import__("os").environ)
|
||||
env["VEDASTRO_API_ENDPOINT"] = "https://example.invalid/api"
|
||||
env["VEDASTRO_ENABLE_NETWORK"] = "0"
|
||||
env["JYOTISH_SKIP_LOCAL_ENV"] = "1"
|
||||
|
||||
completed = subprocess.run(
|
||||
[
|
||||
sys.executable,
|
||||
str(ENGINE),
|
||||
"full-reading",
|
||||
*BASE_BIRTH_ARGS,
|
||||
"--today",
|
||||
"2026-06-29",
|
||||
"--transit-date",
|
||||
"2026-06-29",
|
||||
],
|
||||
cwd=ROOT,
|
||||
check=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
env=env,
|
||||
)
|
||||
result = json.loads(completed.stdout)
|
||||
|
||||
vedastro = result["modules"]["vedastro_range_scan_result"]
|
||||
assert vedastro["backend"] == "vedastro_service_adapter_candidate"
|
||||
assert vedastro["status"] == "network_execution_disabled"
|
||||
assert vedastro["source_metadata"]["ingestion_profile"] == "main_entry_overview"
|
||||
assert vedastro["source_metadata"]["reference_date"] == "2026-06-29"
|
||||
assert sorted(vedastro["source_metadata"]["domain_statuses"]) == ["career", "marriage", "wealth"]
|
||||
|
||||
|
||||
def test_full_reading_exposes_sensitive_point_modules() -> None:
|
||||
|
||||
@@ -1931,7 +1931,24 @@ def test_provenance_panchanga_workspace_panel_is_productized() -> None:
|
||||
assert "_relationshipStrictNarrativeSection" in export_js
|
||||
assert "relationship_report" in export_js
|
||||
assert "relationship_narrative" in export_js
|
||||
assert "vimsopaka_semantic_summary" in export_js
|
||||
assert "functional_benefic_malefic" in export_js
|
||||
assert "vedastro_overview" in export_js
|
||||
assert "technique_audit_table" in export_js
|
||||
assert "relationship_narrative" in main
|
||||
assert "vimsopaka_semantic_summary" in main
|
||||
assert "functional_benefic_malefic:" in main
|
||||
assert "vedastro_overview:" in main
|
||||
assert "technique_audit_table:" in main
|
||||
assert "_functionalRoleSummarySection" in export_js
|
||||
assert "_techniqueAuditTableSection" in export_js
|
||||
assert "_vimsopakaSemanticSummarySection" in export_js
|
||||
assert "Functional Benefic/Malefic" in export_js
|
||||
assert "Technique Audit Table" in export_js
|
||||
assert "Vimsopaka 语义摘要" in export_js
|
||||
assert "highlights" in export_js
|
||||
assert "warnings" in export_js
|
||||
assert "vimsopaka_semantic_summary:" in main
|
||||
assert "strictNarrative" in main
|
||||
assert "relationship-deliverable" in export_js
|
||||
assert "relationship-evidence-grid" in export_js
|
||||
|
||||
Reference in New Issue
Block a user