import json,pathlib,sys
HERE=pathlib.Path(__file__).resolve().parent; LAB=HERE.parent; sys.path.insert(0,str(HERE))
from key_boundary import *
policy=json.loads((LAB/'fixture/golden-policy.json').read_text()); objects=json.loads((LAB/'fixture/baseline-data.json').read_text())['objects']
row=build_evidence_row('primary_database','service:primary-api',policy)
rotation=evaluate_rotation('primary_database',{'old_key_id':'dek-primary-v1','new_key_id':'dek-primary-v2','historical_key_ids_accounted':['dek-primary-v1'],'recovery_metadata':'plan:primary-recovery'},objects,policy)
print(json.dumps({'boundary':evaluate_boundary('primary_database',policy),'decrypt':evaluate_decrypt('primary_database','service:primary-api',policy),'rotation':rotation,'row_complete':evidence_row_complete(row),'row':row},indent=2))
