人类对战 AI —— 基于差异比对的智能体编辑文本行级溯源
Human vs. AI – Diff-based line-level provenance for text under agentic editing

原始链接: https://github.com/eighttrigrams/us-vs-them

**us-vs-them** 是一款提供文本行级溯源的工具,用于区分人类编写的“岛屿”和人工智能生成的“海洋”。在代理编辑(agentic editing)时代,该工具通过识别不应被重写、需要被视为“神圣”的区域,帮助保护人类编写的代码或文本。 该工具无需特殊标记,利用现有的 Git 版本历史来跟踪作者身份。通过分析连续的修订记录,它计算出溯源范围,并分配一个从 0.00(完全由代理编写)到 1.00(完全由人类编写)的分数。它能智能处理文本的演变(例如合并、拆分或稀释内容),从而长期保持有效的归属跟踪。 该工具提供库和命令行界面(CLI)两种形式,允许开发者定义“我们的”(人类)和“他们的”(代理)。这使得用户能够锁定项目的关键区域(如核心逻辑或特定的 README 编辑),确保自动化代理尊重人类的贡献。在技术实现方面,它依赖于标准的 Git diff,建议通过项目的测试套件进一步了解。

Hacker News | 最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 | 登录 人类与 AI —— 代理编辑下文本的基于差异(diff)的行级溯源 (github.com/eighttrigrams) 8 个积分,由 eighttrigrams 发布于 1 小时前 | 隐藏 | 过往 | 收藏 | 1 条评论 | 帮助 gritzko 5 分钟前 [–] 很有意思。我为此使用注释。但即使代理在 100 次中有 1 次忽略它们,我也能在手头积累足够多的案例来观察到这种情况的发生。 回复 考虑申请 YC 2026 年秋季批次!申请截止日期为 7 月 27 日。 准则 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Line-level provenance for text under agentic editing — who wrote this line, us or them? — derived from a text's version history. Use it as library or as CLI tool.

alt

With agentic coding and editing, provenance becomes a pertinent question. Text a human wrote or edited should be considered close to sacred: an agent should be hesitant and have a very good reason to touch it. Slop another agent has produced, on the other hand, is completely up for grabs.

A use case for this: Take a mostly vibecoded app in which you want to establish some corners in the code where you want to assert your ideas and ownership. You surely don't want another agent bulldoze over this piece of code in the next session.

Another use case: the README.md, originally generated, where you rewrite the opening paragraphs. The agent should feel free to redo or append parts further downwards but should really think twice changing anything in the opener.

The main constraint under which this should work is that this should not require for text to be marked up specifically for that. Omnipresent plain text (markdown) should be supported as is.

The only thing to leverage then, is that each new version of a text is created under identifable authorship - of either a human or an agent.

The output of an evaluation over a given text is a set of ranges — "islands" of human-authored lines inside a "sea" of machine generated text. Technically based on simple diffing, this is the guiding metaphor for development of the algorithm. We don't want to track authorship of individual lines only, but of meaningfully coherent pieces of text. So joining, splitting apart, and dilution of authorship are behaviours to be factored in, also in such a manner that we don't converge in full sea or full island.

Using us-vs-them as CLI tool requires bbin for a local install.

A git repository is already a history of versions each carrying a provenance marker — every revision of the file, in order, with the author of the change that made it.

To use it anywhere inside a git repository:

us-vs-them --ours [email protected] README.md

This yields a listing like

1-3          0.00
4            1.00
5-7          0.00
8-20         0.46
21-164       0.00

where 1.0 means fully human authored range.
0.46 means originally human authored range, modified by agents to a certain degree.
0.00 means fully agent authored.

Parameters are:

--ours: these are the humans, everonee else is considered an agent

--theirs: these are agents, everyone else is considered human

Name whichever side is the shorter list.
Passing both arguments at the same time will be rejected.

The best way to understand the behaviour is to have a look at caution_test.clj.

联系我们 contact @ memedata.com