        ck('只允许既定core作者字段',set(output.get('core_fields',[]))=={'author','last_modified_by'});d=Document(f/'source.docx');before=[p.text for p in d.paragraphs]
        for key in output.get('core_fields',[]):
            if key not in {'author','last_modified_by'}:raise ValueError('Metadata field outside allowlist')
            setattr(d.core_properties,key,'')
        for comment in d.comments:
            comment.author=str(output.get('comment_author',''));comment.initials=str(output.get('comment_initials',''))
        d.save(f/'shared.docx');r=Document(f/'shared.docx');ck('作者字段实际清空',r.core_properties.author=='' and r.core_properties.last_modified_by=='');ck('批注作者已匿名',all(c.author=='Reviewer' and c.initials=='R' for c in r.comments));ck('正文和批注内容保留',[p.text for p in r.paragraphs]==before and [c.text for c in r.comments]==['Check the title.']);ck('文档标题未被一并删除',r.core_properties.title=='Public guide');result={'body_sha256':hashlib.sha256('\n'.join(before).encode()).hexdigest(),'author':r.core_properties.author,'comment_author':next(iter(r.comments)).author,'scope':['core author','core last_modified_by','comment author','comment initials']};add_native(f/'shared.docx')
