Tool

Track line-level authorship in AI-edited code

Line-level provenance tool that tells you which lines of a text a human wrote versus an agent, from git history.

Works with git

91
Spark score
out of 100
Updated 13 days ago
Source checked Sep 18, 2026
Version 1.0.0

Add to Favorites

Why it matters

Distinguish human-authored code from AI-generated content in files under agentic editing, enabling developers to protect sacred human-written sections while allowing agents to freely modify machine-generated code.

Outcomes

What it gets done

01

Parse git history to identify authorship of each file revision

02

Calculate provenance scores showing human vs. agent ownership per line range

03

Generate island-and-sea maps of human-authored sections within AI-generated text

04

Provide CLI and library interfaces for querying authorship in any git repository

Source

Get it from source

Spark does not host a copy of it.

Open source

Reports

Agent outcome reports

No reports yet

Overview

Us Vs Them

Us vs. Them is a CLI tool that reads git version history to score which line ranges of a text are human-authored versus agent-generated, so AI agents know which sections to treat as protected. Use it in a git-tracked codebase or document where you want to mark human-written sections as off-limits to casual agent rewrites while leaving agent-generated text open to change.

What it does

Us vs. Them derives line-level provenance for text under agentic editing - who wrote this line, us or them - from a text's version history, usable as a library or a CLI tool. With agentic coding and editing, text a human wrote or edited should be treated as close to sacred, something an agent should be hesitant to touch without good reason, while text another agent produced is fair game to rewrite. A use case: in a mostly vibecoded app, mark the corners of code where you've asserted your own ideas and ownership so another agent doesn't bulldoze over them in a later session. Another: in a generated README, once you've rewritten the opening paragraphs by hand, an agent should feel free to redo sections further down but think twice before touching the opener again.

When to use - and when NOT to

Use it wherever a git repository already carries a version history with an identifiable author (human or agent) for every revision - it works on plain text and Markdown as-is, with no special markup required. It is not designed to track authorship of individual lines in isolation; instead it treats meaningfully coherent ranges of text ("islands" of human-authored lines inside a "sea" of machine-generated text), accounting for joining, splitting, and dilution of authorship, deliberately avoiding collapsing into either "fully sea" or "fully island."

Inputs and outputs

The CLI requires bbin for a local install:

make install

Run it inside a git repository, naming either your side or the agent side (whichever list is shorter):

us-vs-them --ours dan@eighttrigrams.net README.md

This yields a listing of line ranges and a score per range, for example:

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

A score of 1.00 means a fully human-authored range, 0.00 means fully agent-authored, and a value like 0.46 means an originally human-authored range that agents have since modified to some degree. Use --ours to name the humans (everyone else is treated as an agent) or --theirs to name the agents (everyone else is treated as human) - passing both together is rejected.

Integrations

Provenance is read directly from git history: every revision of a file, in order, carries the author of the change that produced it, so no separate tracking system or text markup is needed. Run make test to exercise the test suite, including caution_test.clj, which the project points to as the clearest way to understand its range-merging behavior.

Who it's for

Developers working with AI coding agents on a shared codebase who want a concrete signal for which lines or sections were human-authored and should be protected from casual agent rewrites, versus which are agent-generated and open to change.

Source README

Us vs. Them

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.

The problem

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.

How it works

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.

Usage

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

make 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 dan@eighttrigrams.net 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, everone 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.

Development

make test
make test-cljs   # the same suite on node, from the cookbook checkout beside this one

caution and core are .cljc. Cookbook compiles them into its browser
bundle - its Recipes are encrypted, so its server cannot read the history the
split is drawn from and the client has to - and a library whose suite only ever
runs on one of two hosts is one that will drift on the other. There is no npm
here on purpose, so make test-cljs points at the consumer that has one. That
runs cookbook's whole node suite, most of which is cookbook's rather than this
library's, so it can go red for a reason that is not yours - read the namespace
in the failure. See the Makefile, and hosts_test.cljc for the two places the
hosts do not agree: one number spelled differently, and one degenerate input
refused on one host and invented over on the other.

Behaviour

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

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.