        original=case['input']['references'];entries=output.get('entries',[]);ck('书目ID与顺序没有改变',[r.get('id') for r in entries]==[r['id'] for r in original]);chunks=[]
        for r,orig in zip(entries,original):
            ck('作者顺序与团体作者保留 '+orig['id'],r.get('authors')==orig['authors'])
            title=r.get('title','');ck('标题原文保留 '+orig['id'],title==orig['title']);protected=re.sub(r'\b(API|JSON|XML)\b',r'{\1}',title)
            fields={'author':' and '.join(r.get('authors',[])),'title':protected,'year':r.get('year','')}
            for key in ['journal','publisher']:
                if key in r:fields[key]=r[key]
            chunks.append('@'+r.get('type','misc')+'{'+r['id']+',\n'+',\n'.join('  '+k+' = {'+v+'}' for k,v in fields.items())+'\n}')
        bib='\n\n'.join(chunks);(f/'references.bib').write_text(bib);parsed=parse_string(bib,'bibtex')
        ck('Pybtex真实回读条目数',len(parsed.entries)==2);ck('API大写保护保留','{API}' in parsed.entries['gao2026'].fields['title'])
        style=find_plugin('pybtex.style.formatting','plain')();bibliography=style.format_bibliography(parsed);writer=find_plugin('pybtex.backends','html')();writer.write_to_file(bibliography,str(f/'references.html'))
        ck('HTML参考文献实际生成',(f/'references.html').stat().st_size>100);result={'keys':list(parsed.entries),'engine':'pybtex','protected_title':parsed.entries['gao2026'].fields['title']};art+=['references.bib','references.html']
