from research import *
s=begin(1205,'Recover the baseline from branch-appropriate loss data','Do the three excesses and six ordinary residuals reconstruct the complete ledger?',{},['C1204'])
d=json.loads((ROOT/'model/cap_round_branch_information.json').read_text());recover=[x['c']+x['excess'] if x['branch']=='clipped' else x['Q_y']+x['rounding_residual'] for x in d['rows']]
register=[{'row_index':i,'stored_kind':'excess' if x['branch']=='clipped' else 'residual','stored_value':x['excess'] if x['branch']=='clipped' else x['rounding_residual']} for i,x in enumerate(d['rows'])]
a=artifact('model/SP_composite_loss_recovery.json',json.dumps({'recovered_lifespans':recover,'branch_appropriate_register':register,'source_cost':'Known capacities, branch labels and indicated exact register values are required; the output does not generate them.'},indent=2)+'\n')
finish(s,{'recovery':a,'recovered':recover},'The declared register exactly recovers all nine baseline lives. This is an information-preserving enlargement of the cap-and-round construction, not an inverse of its output alone.','Test whether the single total488 can replace the three located excesses.',{'exact_recovery':recover==[x['L'] for x in d['rows']],'nine_records':len(register)==9})
