一个名为"us-vs-them"的开源项目针对AI代理编辑场景提出了行级文本溯源解决方案[1]。该方案能够识别文本中哪些行由人类编写、哪些由AI生成,基于版本历史的diff分析实现这一功能[1]。
该工具支持作为库或命令行工具使用,可以处理纯文本和Markdown文件,无需对文本进行特殊标记[1]。输出结果包含行号范围与人类编写度量,其中1.0表示完全由人类编写,0.0表示完全由AI生成,0.46等中间值则表示内容由人类编写但经过AI修改[1]。工具提供两种互斥的标注模式:--ours用于标记人类编写内容,--theirs用于标记AI代理生成内容[1]。该方案的技术基础是对git版本历史中每个修订的作者标记进行diff计算[1]。
An open source project called us-vs-them has introduced a solution for identifying which lines in a text were written by humans and which were generated by AI agents [1]. The approach uses diff-based analysis of version history to determine authorship at the line level, operating without requiring special markup and supporting both plain text and Markdown files [1].
The tool offers two complementary modes of operation: --ours mode marks human-written content, while --theirs mode identifies AI agent contributions, with the two modes being mutually exclusive [1]. It can be deployed either as a library or as a command-line interface [1]. The underlying methodology relies on author tags from each revision in the git version history to perform the diff calculations [1].
Output from the system provides line number ranges paired with a human authorship metric, where a score of 1.0 indicates entirely human-written content, 0.0 indicates entirely AI-generated text, and intermediate values such as 0.46 represent human-written lines that were subsequently modified by AI [1]. This line-level provenance system is designed to address the emerging need for transparency in distinguishing between human and machine contributions in collaborative editing scenarios involving AI agents [1].