fix(rectification): restore classic eight methods and observe KP Placidus cusps
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -13,6 +13,7 @@ from scripts.rectification.contracts import (
|
||||
is_scoreable_event,
|
||||
)
|
||||
from scripts.rectification.house_table import compact_house_table_from_contexts
|
||||
from scripts.rectification.horary_observation import build_horary_observation
|
||||
from scripts.rectification.refinement_packet import build_refinement_packet
|
||||
from scripts.rectification.scoring_service import precision_weight
|
||||
from scripts.rectification.sealed_holdout import holdout_passed, load_sealed_minute_holdout
|
||||
@@ -269,11 +270,7 @@ def build_technique_audit(
|
||||
continue
|
||||
label, note = _AUDIT_LABELS[method]
|
||||
rows.append({"technique": label, "status": "executed", "note": note})
|
||||
rows.append({
|
||||
"technique": "KP 宫头",
|
||||
"status": "blocked",
|
||||
"note": "KP 宫头政策跳过,不参与提出门或确认门。",
|
||||
})
|
||||
rows.append(_kp_audit_row(built))
|
||||
rows.extend((
|
||||
vedastro_audit_row(vedastro_status),
|
||||
unique_minute_audit_row(confirmation_allowed),
|
||||
@@ -281,6 +278,29 @@ def build_technique_audit(
|
||||
return rows
|
||||
|
||||
|
||||
def _kp_audit_row(built: dict[str, Any]) -> dict[str, str]:
|
||||
executed = False
|
||||
for context in built.get("static_contexts") or []:
|
||||
if not isinstance(context, dict):
|
||||
continue
|
||||
feature = context.get("feature")
|
||||
snapshot = feature.get("kp_cusps") if isinstance(feature, dict) else None
|
||||
if isinstance(snapshot, dict) and snapshot.get("status") == "executed":
|
||||
executed = True
|
||||
break
|
||||
if executed:
|
||||
return {
|
||||
"technique": "KP 宫头",
|
||||
"status": "executed",
|
||||
"note": "已按 Swiss Ephemeris Placidus + Krishnamurti 观察 12 宫头;不计分,不参与提出门或确认门。",
|
||||
}
|
||||
return {
|
||||
"technique": "KP 宫头",
|
||||
"status": "blocked",
|
||||
"note": "Swiss Ephemeris Placidus 宫头无法计算或尚未执行。KP 观察不计分,不挡提出门。",
|
||||
}
|
||||
|
||||
|
||||
def _quantized_score(row: CandidateScoreRow) -> Decimal:
|
||||
return _decimal(row.get("score")).quantize(SCORE_QUANTUM, rounding=ROUND_HALF_UP)
|
||||
|
||||
@@ -581,6 +601,7 @@ def build_decision_receipt(
|
||||
"nakshatra_boundary": packet["nakshatra_boundary"],
|
||||
"precision_stage": packet["precision_stage"],
|
||||
"oos_blind_prompts": packet["oos_blind_prompts"],
|
||||
"horary_observation": build_horary_observation(request),
|
||||
"unique_minute_claim": False,
|
||||
})
|
||||
return apply_confirmation_decision(receipt)
|
||||
|
||||
Reference in New Issue
Block a user