$json){$old=json_decode($json,true);$now=$db->table($t)->get()->map(fn($r)=>(array)$r)->all();$canon=fn($r)=>Tempo\Finance\Payables\Payables::canonical($r);$seen=array_fill_keys(array_map($canon,$now),true);foreach($old as$r)if(!isset($seen[$canon($r)]))$changed[]=$n.'.'.$t;if(count($now)!==count($old))$changes[$n.'.'.$t]=count($now)-count($old);}}echo json_encode(['original_changed'=>array_unique($changed),'appends'=>$changes,'steps'=>count(json_decode(file_get_contents($s['root'].'/multiline-invoice-http-progress-private.json'),true)['steps'])],JSON_PRETTY_PRINT);