"""Deterministic TEACHING DATA, not measurements of an AI platform."""
import json
# Nested event counts in a deliberately simplified, fully observable local pipeline.
counts={'questions':40,'candidate_contains_brand':30,'selected_contains_brand':20,'answer_mentions_brand':12,'answer_cites_brand':8}
steps=[30/40,20/30,12/20,8/12]
# Final-answer classifications are independent flags: citation need not imply recommendation.
answers=[{'id':i,'mentioned':i<12,'cited':i<8,'recommended':i in {0,1,2,3,8}} for i in range(40)]
product=1
for x in steps:product*=x
result={'label':'教学模拟；非平台实测','counts':counts,'conditional_rates':steps,'chain_product':product,'direct_rate':8/40,'recommendations':sum(x['recommended'] for x in answers),'cited_and_recommended':sum(x['cited'] and x['recommended'] for x in answers),'cited_not_recommended':sum(x['cited'] and not x['recommended'] for x in answers)}
assert abs(product-8/40)<1e-12
assert result['cited_not_recommended']==4
print(json.dumps(result,ensure_ascii=False,indent=2))
