feat(skill): validate first shadbala oracle packet
This commit is contained in:
@@ -39,15 +39,16 @@ def test_oracle_closure_master_dashboard_aggregates_all_hard_fronts() -> None:
|
||||
assert report["scope"] == "jyotish_external_oracle_closure_master_dashboard"
|
||||
assert report["schema_version"] == 1
|
||||
assert report["summary"]["total_tasks"] == 12
|
||||
assert report["summary"]["external_verified_tasks"] == 3
|
||||
assert report["summary"]["open_tasks"] == 9
|
||||
assert report["summary"]["external_verified_tasks"] == 4
|
||||
assert report["summary"]["open_tasks"] == 8
|
||||
assert report["summary"]["can_claim_global_oracle_closure"] is False
|
||||
assert report["fronts"]["dasha"]["task_count"] == 3
|
||||
assert report["fronts"]["shadbala"]["task_count"] == 4
|
||||
assert report["fronts"]["tajika_sahams"]["task_count"] == 5
|
||||
assert report["fronts"]["dasha"]["external_verified_tasks"] == 3
|
||||
assert report["fronts"]["dasha"]["first_priority"] is None
|
||||
assert report["fronts"]["shadbala"]["first_priority"]["case_id"] == "template_redacted_place_shadbala_raman"
|
||||
assert report["fronts"]["shadbala"]["external_verified_tasks"] == 1
|
||||
assert report["fronts"]["shadbala"]["first_priority"]["case_id"] == "template_user_REDACTED_YEAR_moon_longitude_lahiri"
|
||||
assert report["fronts"]["tajika_sahams"]["first_priority"]["case_id"] == "template_steve_jobs_varshaphala_1984_lahiri"
|
||||
assert report["fronts"]["tajika_sahams"]["first_priority"]["missing_groups"]["target"]["count"] == 10
|
||||
assert report["fronts"]["shadbala"]["first_priority"]["manual_fill_plan"]["manual_entry_count"] == 55
|
||||
@@ -66,7 +67,7 @@ def test_oracle_closure_master_dashboard_markdown_can_be_written(tmp_path: Path)
|
||||
assert "total_tasks: `12`" in markdown
|
||||
assert "can_claim_global_oracle_closure: `false`" in markdown
|
||||
assert "`dasha` | 3 | 3 | `complete`" in markdown
|
||||
assert "template_redacted_place_shadbala_raman" in markdown
|
||||
assert "template_user_REDACTED_YEAR_moon_longitude_lahiri" in markdown
|
||||
assert "template_steve_jobs_varshaphala_1984_lahiri" in markdown
|
||||
assert "manual entries" in markdown
|
||||
assert "metadata missing" in markdown
|
||||
|
||||
@@ -90,15 +90,14 @@ def test_validator_rejects_draft_packets_without_external_artifacts(tmp_path: Pa
|
||||
report = json.loads(completed.stdout)
|
||||
assert report["scope"] == "external_oracle_evidence_validation"
|
||||
assert report["summary"]["total_packets"] == 5
|
||||
assert report["summary"]["valid_packets"] == 0
|
||||
assert report["summary"]["ready_for_calibration"] == 0
|
||||
assert report["summary"]["valid_packets"] == 1
|
||||
assert report["summary"]["ready_for_calibration"] == 1
|
||||
assert report["summary"]["all_packets_external_verified"] is False
|
||||
first = report["packets"][0]
|
||||
assert first["capture_id"] == "external_template_user_REDACTED_YEAR_moon_longitude_lahiri"
|
||||
assert first["valid"] is False
|
||||
assert "missing_metadata:tool_name" in first["problems"]
|
||||
assert "missing_external_artifact" in first["problems"]
|
||||
assert "placeholder_unfilled:target.moon_sidereal_longitude_deg" in first["problems"]
|
||||
assert "missing_shadbala_component:Sun.sthana" in first["problems"]
|
||||
|
||||
|
||||
def test_validator_accepts_filled_external_packet_but_not_whole_queue(tmp_path: Path) -> None:
|
||||
@@ -128,8 +127,8 @@ def test_validator_accepts_filled_external_packet_but_not_whole_queue(tmp_path:
|
||||
|
||||
assert completed.returncode == 0, completed.stderr or completed.stdout
|
||||
report = json.loads(completed.stdout)
|
||||
assert report["summary"]["valid_packets"] == 1
|
||||
assert report["summary"]["ready_for_calibration"] == 1
|
||||
assert report["summary"]["valid_packets"] == 2
|
||||
assert report["summary"]["ready_for_calibration"] == 2
|
||||
assert report["summary"]["all_packets_external_verified"] is False
|
||||
first = report["packets"][0]
|
||||
assert first["valid"] is True
|
||||
@@ -211,6 +210,40 @@ def test_validator_rejects_non_numeric_or_negative_shadbala_components(tmp_path:
|
||||
assert "invalid_shadbala_component_negative:Moon.dig" in first["problems"]
|
||||
|
||||
|
||||
def test_validator_accepts_negative_drik_bala_when_component_sum_matches(tmp_path: Path) -> None:
|
||||
queue = build_queue()
|
||||
packet = queue["tasks"][0]["evidence_packet"]
|
||||
shadbala = complete_shadbala_components()
|
||||
shadbala["Sun"]["drik"] = -0.25
|
||||
shadbala["Sun"]["total_rupa"] = round(sum(shadbala["Sun"][component] for component in SHADBALA_COMPONENTS), 4)
|
||||
packet["metadata"] = {
|
||||
"tool_name": "PyJHora",
|
||||
"tool_version_or_url": "PyJHora 4.8.7 isolated /tmp black-box run",
|
||||
"capture_date": "2026-06-27",
|
||||
"source_artifact": "references/oracle/artifacts/pyjhora_shadbala_stdout.txt",
|
||||
"ayanamsa": "raman",
|
||||
"node_mode": "PyJHora default",
|
||||
"timezone": "UTC+08:00",
|
||||
"operator_note": "Black-box external stdout; Drik Bala can be negative.",
|
||||
}
|
||||
packet["target_placeholders"] = {
|
||||
"target.moon_sidereal_longitude_deg": 311.7897,
|
||||
"target.vimshottari_start_date": "1986-05-18",
|
||||
"target.shadbala_components": shadbala,
|
||||
}
|
||||
packet["status"] = "external_verified"
|
||||
queue_path = tmp_path / "queue.json"
|
||||
queue_path.write_text(json.dumps(queue, ensure_ascii=False), encoding="utf-8")
|
||||
|
||||
completed = run_validator(queue_path)
|
||||
|
||||
assert completed.returncode == 0, completed.stderr or completed.stdout
|
||||
report = json.loads(completed.stdout)
|
||||
first = report["packets"][0]
|
||||
assert first["valid"] is True
|
||||
assert first["problems"] == []
|
||||
|
||||
|
||||
def test_validator_rejects_missing_shadbala_total_rupa(tmp_path: Path) -> None:
|
||||
queue = build_queue()
|
||||
packet = queue["tasks"][0]["evidence_packet"]
|
||||
@@ -488,8 +521,8 @@ def test_validator_accepts_external_verified_packet_generated_from_oracle_file(t
|
||||
|
||||
assert completed.returncode == 0, completed.stderr or completed.stdout
|
||||
report = json.loads(completed.stdout)
|
||||
assert report["summary"]["valid_packets"] == 1
|
||||
assert report["summary"]["ready_for_calibration"] == 1
|
||||
assert report["summary"]["valid_packets"] == 2
|
||||
assert report["summary"]["ready_for_calibration"] == 2
|
||||
assert report["summary"]["production_tuning_allowed"] is False
|
||||
assert report["packets"][0]["valid"] is True
|
||||
assert report["packets"][0]["problems"] == []
|
||||
|
||||
@@ -39,13 +39,14 @@ def test_public_benchmark_dashboard_outputs_stable_json_summary() -> None:
|
||||
assert report["summary"]["technique_count"] >= 60
|
||||
assert report["summary"]["capability_valid"] is True
|
||||
assert report["oracle_readiness"]["total_packets"] == 5
|
||||
assert report["oracle_readiness"]["valid_packets"] == 0
|
||||
assert report["oracle_readiness"]["ready_for_calibration"] == 0
|
||||
assert report["oracle_readiness"]["valid_packets"] == 1
|
||||
assert report["oracle_readiness"]["ready_for_calibration"] == 1
|
||||
assert report["oracle_readiness"]["production_tuning_allowed"] is False
|
||||
assert report["dasha_oracle_readiness"]["valid_dasha_packets"] == 3
|
||||
assert report["dasha_oracle_readiness"]["total_dasha_packets"] == 3
|
||||
assert report["boundary_audit"]["production_tuning_recommended"] is False
|
||||
assert "Dasha-only external oracle readiness is 3/3" in report["global_first_gap"]
|
||||
assert "Shadbala external absolute-value readiness is 1/4" in report["global_first_gap"]
|
||||
assert report["public_claim"]["can_claim_global_first"] is False
|
||||
assert report["public_claim"]["reason"]
|
||||
|
||||
|
||||
@@ -37,12 +37,12 @@ def test_shadbala_oracle_closure_status_identifies_first_absolute_value_packet()
|
||||
assert report["scope"] == "shadbala_external_absolute_value_closure_status"
|
||||
assert report["schema_version"] == 1
|
||||
assert report["summary"]["shadbala_task_count"] == 4
|
||||
assert report["summary"]["external_verified_shadbala_tasks"] == 0
|
||||
assert report["summary"]["external_verified_shadbala_tasks"] == 1
|
||||
assert report["summary"]["can_claim_shadbala_absolute_closure"] is False
|
||||
assert report["summary"]["required_planets"] == ["Sun", "Moon", "Mars", "Mercury", "Jupiter", "Venus", "Saturn"]
|
||||
assert report["summary"]["required_components"] == ["sthana", "dig", "kala", "chesta", "naisargika", "drik", "total_rupa"]
|
||||
assert report["first_priority"]["case_id"] == "template_redacted_place_shadbala_raman"
|
||||
assert report["first_priority"]["capture_id"] == "external_template_redacted_place_shadbala_raman"
|
||||
assert report["first_priority"]["case_id"] == "template_user_REDACTED_YEAR_moon_longitude_lahiri"
|
||||
assert report["first_priority"]["capture_id"] == "external_template_user_REDACTED_YEAR_moon_longitude_lahiri"
|
||||
assert report["first_priority"]["required_target_fields"] == [
|
||||
"target.moon_sidereal_longitude_deg",
|
||||
"target.shadbala_components",
|
||||
@@ -54,7 +54,7 @@ def test_shadbala_oracle_closure_status_identifies_first_absolute_value_packet()
|
||||
assert report["first_priority"]["missing_groups"]["metadata"]["count"] == 5
|
||||
assert report["first_priority"]["missing_groups"]["target"]["count"] == 50
|
||||
assert report["first_priority"]["missing_groups"]["bodies"]["Sun"]["count"] == 7
|
||||
assert report["first_priority"]["prefilled_fields"]["metadata"]["ayanamsa"] == "Raman"
|
||||
assert report["first_priority"]["prefilled_fields"]["metadata"]["ayanamsa"] == "lahiri"
|
||||
assert report["first_priority"]["manual_fill_plan"]["status_value"] == "external_verified"
|
||||
assert report["first_priority"]["manual_fill_plan"]["manual_entry_count"] == 55
|
||||
assert report["first_priority"]["reject_global_scaling"] is True
|
||||
@@ -70,7 +70,7 @@ def test_shadbala_oracle_closure_status_markdown_can_be_written(tmp_path: Path)
|
||||
markdown = output.read_text(encoding="utf-8")
|
||||
assert "# Shadbala External Absolute-Value Closure Status" in markdown
|
||||
assert "can_claim_shadbala_absolute_closure: `false`" in markdown
|
||||
assert "external_template_redacted_place_shadbala_raman" in markdown
|
||||
assert "external_template_user_REDACTED_YEAR_moon_longitude_lahiri" in markdown
|
||||
assert "target.shadbala_components.Sun.sthana" in markdown
|
||||
assert "## Missing Summary" in markdown
|
||||
assert "## Prefilled Fields" in markdown
|
||||
|
||||
Reference in New Issue
Block a user