def evaluate(c):
    fresh=c.get("source_freshness")=="CURRENT"
    prov=bool(c.get("provenance_complete"))
    observation_valid=bool(c.get("observation_present") and c.get("window_valid") and c.get("baseline_present"))
    context_valid=bool(c.get("region_consistent") and c.get("window_comparable"))
    hypothesis_valid=bool(c.get("hypothesis_present") and c.get("alternative_present"))
    repeated=bool(c.get("replication_count",0)>=2)
    corroboration=bool(c.get("corroborating"))
    bounded=False
    if not fresh:
        state,decision,reason="STALE_EVIDENCE","REFRESH_EVIDENCE","SOURCE_EVIDENCE_STALE"
    elif not prov or not observation_valid:
        state,decision,reason="UNKNOWN","DEFER_MISSING_EVIDENCE","PROVENANCE_OR_OBSERVATION_INCOMPLETE"
    elif not hypothesis_valid:
        state,decision,reason="INSUFFICIENT_DATA","REVIEW_HYPOTHESIS","HYPOTHESIS_PAIR_INCOMPLETE"
    elif c.get("counter_signal") and (not c.get("region_consistent") or not c.get("window_comparable")):
        state,decision,reason="REJECTED","REJECT_PATTERN","CONTEXT_CHANGE_COLLAPSES_SIGNAL"
    elif c.get("counter_signal") and not c.get("seasonality_checked"):
        state,decision,reason="HYPOTHESIS","REVIEW_HYPOTHESIS","SEASONAL_COUNTER_EXPLANATION_UNRESOLVED"
    elif not repeated:
        state,decision,reason="ONE_OFF","KEEP_ONE_OFF","NO_REPLICATION"
    elif repeated and corroboration and not c.get("counter_signal") and c.get("seasonality_checked") and c.get("confidence")=="HIGH" and context_valid:
        state,decision,reason="STABLE_PATTERN","ALLOW_BOUNDED_PLANNING_USE","REPEATED_CORROBORATED_CONTEXT_STABLE"; bounded=True
    elif repeated and corroboration and not c.get("counter_signal"):
        state,decision,reason="EMERGING_PATTERN","CONTINUE_OBSERVATION","REPEATED_BUT_NOT_STABLE_ENOUGH"
    else:
        state,decision,reason="HYPOTHESIS","REVIEW_HYPOTHESIS","EVIDENCE_NOT_SUFFICIENT_FOR_PATTERN"
    return {"pattern_state":state,"decision":decision,"observation_valid":observation_valid,"context_valid":context_valid,"hypothesis_valid":hypothesis_valid,"repeated_evidence":repeated,"corroboration_valid":corroboration,"bounded_use_allowed":bounded,"control_reason":reason}
