Skip to content

Provenance for agent-written code: which prompt produced this commit #534

Description

@vshulcz

The least exciting idea in this batch and the only one companies pay for. Code written by agents is arriving in repositories faster than anyone can account for it, and there is no answer to "who asked for this, and what were they told". Review will start asking. Compliance will follow.

We are sitting on the answer and doing nothing with it.

Shape

$ deja origin 9c1267a
commit 9c1267a  perf(search): bound how much of one session a query reads
  produced during claude session 2fc1d1ef, 2026-07-29 18:42
  asked for by: "давай дальше по issues, займись #513"
  the agent proposed the bound and measured 61.8 → 26.9 ms
  human approved the ranking trade-off explicitly before it shipped

Then the same thing over a range: deja origin main~20..main — which commits in this release were agent-written, under what instruction, and where a human said yes.

Why us and not a git hook

A hook can stamp "written by an agent" going forward. It cannot reconstruct the last six months, and it cannot show the instruction — the instruction lives in the transcript. Retroactive is the whole point, and it is the thing our corpus is for.

What makes it hard

  • Linking a commit to a session. Time proximity plus touched files plus project gets most of the way; it will be ambiguous when two sessions ran at once, and it must say "uncertain" rather than guess. Attributing a commit to the wrong instruction in a compliance context is a serious failure, not a UX wrinkle.
  • Squash merges destroy the timing signal we would lean on. This repo squashes; so does most of GitHub.
  • The instruction is often several turns, not one line, and picking the wrong turn misrepresents intent.

Why it might matter more than it looks

It is the first thing on this list that an organisation, rather than an individual, has a reason to install — and it needs no server, no key, and no data leaving the machine, which is exactly what makes it acceptable to the kind of company that would otherwise ban a memory tool outright.

Kill condition

Take 30 commits from this repo, attempt attribution, and check by hand. If precision is not near-perfect, ship it as "probably this session" or not at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions