feat: complete minute birth-time rectification flow

This commit is contained in:
Jesse_Chen
2026-07-25 01:15:48 +08:00
parent f90aba217f
commit 3ca30ed7de
93 changed files with 8347 additions and 1646 deletions
+46 -16
View File
@@ -13,35 +13,57 @@ def build_rectification_technique_contract(
event_count: int,
domain_count: int,
high_rigor: bool = False,
local_candidate_ready: bool = False,
stability_diagnostics: dict[str, Any] | None = None,
required_layers_complete: bool = False,
canonical_input_hash: str = "",
missing_required_layers: list[str] | None = None,
external_validation: dict[str, Any] | None = None,
) -> dict[str, Any]:
blockers: list[str] = []
if event_count < 3:
blockers.append("insufficient_events")
if domain_count < 2:
blockers.append("insufficient_domains")
if high_rigor:
blockers.append("three_engine_parity_not_passed")
neighbor = (stability_diagnostics or {}).get("neighbor_stability") or {}
leave_one_out = (stability_diagnostics or {}).get("leave_one_event_out") or {}
if not neighbor.get("all_required_passed"):
blockers.append("neighbor_stability_not_passed")
if leave_one_out.get("status") != "pass":
blockers.append("leave_one_event_out_not_passed")
external = external_validation or {}
external_status = str(external.get("status") or "not_evaluated")
if not local_candidate_ready:
blockers.append("local_candidate_not_ready")
if not required_layers_complete:
blockers.append("required_layers_incomplete")
blockers.append("minute_holdout_not_ready")
if not high_rigor:
blockers.append("vedastro_validation_required")
elif external_status != "pass":
blockers.extend(external.get("blockers") or ["vedastro_validation_not_passed"])
confirmation_allowed = (
event_count >= 3
and domain_count >= 2
and local_candidate_ready
and required_layers_complete
and high_rigor
and external_status == "pass"
)
gates = {
"event_quality": _gate("pass" if event_count >= 3 else "fail", "requires_at_least_three_dated_events"),
"cross_domain_coverage": _gate("pass" if domain_count >= 2 else "fail", "requires_at_least_two_event_domains"),
"local_candidate": _gate("pass" if local_candidate_ready else "fail", "requires_a_unique_leading_candidate_range_no_wider_than_fifteen_minutes"),
"required_layers": _gate("pass" if required_layers_complete else "fail", "all_event_required_layers_must_compute"),
"neighbor_stability": _gate("pass" if neighbor.get("all_required_passed") else "fail", "requires_unique_lead_at_plus_minus_1_2_5_minutes"),
"leave_one_event_out": _gate("pass" if leave_one_out.get("status") == "pass" else "fail", "leader_must_survive_removing_each_event"),
"three_engine_input_parity": _gate("fail" if high_rigor else "not_evaluated", "same_normalized_input_and_domain_parity_required"),
"public_holdout_release": _gate("blocked", "frozen_public_AA_minute_holdout_is_below_20_cases"),
"neighbor_stability": _gate("pass" if neighbor.get("all_required_passed") else "diagnostic_fail", "diagnostic_only_unique_lead_at_plus_minus_1_2_5_minutes"),
"leave_one_event_out": _gate("pass" if leave_one_out.get("status") == "pass" else "diagnostic_fail", "diagnostic_only_leader_survival_after_removing_each_event"),
"three_engine_input_parity": _gate(
"pass" if external.get("mismatch_count") == 0 and external.get("engine_status") else "fail" if high_rigor and external_status != "not_evaluated" else "not_evaluated",
"local_pyjhora_and_jyotishganit_must_match_the_same_candidate_input",
),
"vedastro_official_response": _gate(
"pass" if external.get("vedastro_status") == "official_verified" else "fail" if high_rigor and external_status != "not_evaluated" else "not_evaluated",
str(external.get("vedastro_reason") or "official_vedastro_response_required_before_minute_sensitive_validation"),
),
"vedastro_minute_sensitive_validation": _gate(
"pass" if (external.get("minute_sensitive_validation") or {}).get("status") == "pass" else "fail" if high_rigor and external_status != "not_evaluated" else "not_evaluated",
"official_ascendant_house_D9_D10_and_dasha_candidate_identity_must_discriminate_the_local_winner_from_runner_up",
),
}
reported_missing_layers = list(dict.fromkeys([
*(missing_required_layers or []),
@@ -56,12 +78,20 @@ def build_rectification_technique_contract(
"missing_layers": reported_missing_layers,
"partial_layers": ["shadbala_sthana_drik_naisargika"],
"auxiliary_layers": ["functional_benefic_malefic", "controlled_transit", "ashtakavarga", "shadbala_verified_components"],
"external_engines": {"status": "required_not_run" if high_rigor else "not_run", "providers": ["pyjhora", "jyotishganit", "vedastro"]},
"external_engines": {
"status": external_status,
"providers": ["pyjhora", "jyotishganit", "vedastro"],
"validation": external,
},
"canonical_input_hash": canonical_input_hash,
"gates": gates,
"hard_blockers": list(dict.fromkeys(blockers)),
"decision": "continue_rectification",
"confirmation_allowed": False,
"can_narrow_to_minute": False,
"boundary": "A candidate range is not a confirmed birth minute. Minute confirmation is disabled until the frozen public AA holdout release gate passes.",
"decision": "confirm_minute" if confirmation_allowed else "continue_rectification",
"confirmation_allowed": confirmation_allowed,
"can_narrow_to_minute": confirmation_allowed,
"boundary": (
"The narrow local candidate passed required-layer, three-engine, and official VedAstro minute-sensitive identity validation. SearchEvents is background evidence only. Neighbor and leave-one-event-out stability remain diagnostic confidence indicators. Explicit user confirmation is still required before replacing the stored birth time."
if confirmation_allowed
else "A candidate range is not a confirmed birth minute. Continue until local candidate calculation, required layers, three-engine parity, and official VedAstro minute-sensitive identity validation pass. SearchEvents remains background evidence only; neighbor and leave-one-event-out results are diagnostic rather than hard blockers."
),
}