cd /news/developer-tools/build-a-30-line-provenance-log-for-a… · home topics developer-tools article
[ARTICLE · art-57418] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Build a 30-Line Provenance Log for AI-Generated Code

A developer proposes a 30-line provenance log for AI-generated code using an append-only JSONL file. The log records task, constraints, model, input commit, verification command, and human decision, creating a searchable chain from intent to evidence. The approach aims to preserve decisions and make generated code replaceable by focusing on verified intent rather than the code itself.

read1 min views49 publishedJul 13, 2026

“Control the ideas, not the code” is trending today. For a small team, the practical question is how to preserve decisions when code becomes cheap to regenerate.

Use an append-only JSONL log. It should record the task, constraints, model or tool, input commit, accepted output commit, verification command, and human decision—never raw secrets or an entire private prompt.

import { appendFileSync } from "node:fs";
import { execFileSync } from "node:child_process";

const git = (...args) => execFileSync("git", args, { encoding: "utf8" }).trim();
const entry = {
  at: new Date().toISOString(),
  task: process.argv[2],
  constraints: process.argv[3].split(","),
  input: git("rev-parse", "HEAD"),
  verify: process.argv[4],
  decision: "pending"
};
appendFileSync(".provenance.jsonl", JSON.stringify(entry) + "\n");

Commit the log beside an architecture decision record. After review, add a second event containing the output commit, test result, reviewer, and accept/reject reason. Events are safer than rewriting history because retries and reversals remain visible.

This does not prove authorship, correctness, or license compatibility. It creates a searchable chain from intent to evidence. That chain lets you replace a model, regenerate an implementation, or explain why a strange constraint exists six months later.

The durable asset is not a pile of generated lines. It is the verified intent that makes those lines replaceable.

── more in #developer-tools 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/build-a-30-line-prov…] indexed:0 read:1min 2026-07-13 ·