Skip to content

D47b — Every changeset has an owner, and is one owner's session of work

  • Status: Accepted — implements D47 (part 1); amends D4 (one changeset per owner, not one global one) and D44 (a decision names who, not only the role)
  • Date: 2026-09-23
  • Origin: slice 21 build
  • Area: writes

Decision

  • Who. A writer is a handle, optionally an agent acting for it (billy/tdlr), and a mode (human, assisted, autonomous). The handle and agent are resolved from, in order:
  • kg --as (MCP: who);
  • $KG_AS;
  • me: in kg.yaml (kg init --me);
  • $USER.

KG_AS=/tdlr names only the agent, and the handle comes from the rest of that chain. Mode defaults to human with no agent and assisted with one. Over MCP an unnamed agent is called mcp. All of this is declared, not verified, as the actor is in D44. - Changesets. Each owner (handle, agent, mode) has its own open changeset. - Two agents staging at once never share one. - A changeset closes once it held work and nothing in it is still staged, after any merge or rejection, so the next write starts a new one. - An import and a sweep's documents each get a changeset of their own, labelled with what they are for. A sweep's changeset is owned by the researcher its results name ("researcher": "tdlr"); a generated brief names it after its channel. - kg changeset start --intent … --scope … labels your open changeset. - A changeset records the database's instance_id, which is set once in meta when the database is first opened. - Attribution lives on the changeset, not on each staged row. Rows reach it through the changeset_id they already carry. reviews, sweeps and dispositions also record the deciding contributor and agent. D44's role (user|agent|unknown) stays; naming an agent implies agent when no --by is given. - One contributor's work is a unit: - kg review --from, kg merge --from and kg reject --from take billy, billy/tdlr or /tdlr. - merge --from applies the same verdicts as any bulk merge, and brings along staged events its rows cite from other changesets. A reused event can belong to another agent's changeset, and without this a merged claim would cite a staged event. - reject --from cascades as any rejection does. It reports separately how many rows belonged to other contributors. - Reading who. kg review heads each changeset with its owner and intent. kg trace says who staged each row, in which changeset and why, and names who made each decision. kg whoami and kg changeset list show the rest.

Why

Before this slice every write went into one global changeset. It closed only when a --changeset merge emptied it, and that almost never happened. Three problems followed:

  • Several agents' work was one pile. When a person handed a sweep brief to each of five researcher agents, all five came back mixed together. kg review could not show what the register agent had done apart from the press agent, and a bad agent's work could not be dropped as one piece.
  • An import merged other people's work. An import merges its own changeset (D33e), and its changeset was everyone's. The label it asked for was silently dropped whenever something else was open, and its self-merge swept up rows a person had staged by hand. Two goldens (slices 9 and 10) had passed only because of this: a check's new site and two deferred notes landed on the back of an unrelated import.
  • Nothing said who staged anything, only who merged it, and only as a role.

Slice 22 exports a changeset as a bundle, which needs a changeset that belongs to someone and ends.

Alternatives

  • Owner columns on every staged table (D47's first sketch). One owner per changeset makes them redundant, and it would have meant nine migrations instead of one.
  • A new role vocabulary (human|assisted|autonomous) replacing D44's user|agent. It would have reworded D44 and every existing review. Mode sits beside the role instead.
  • Refusing writes until a handle is set. Every test and demo would then need setup, for no gain before signing exists. $USER is an honest default, and kg whoami says where the handle came from.
  • contributors.yaml now. A list of names verifies nothing without keys. It moves to slice 23, with signing.

Open questions

  • A person using an MCP client always shows as handle/mcp, because MCP cannot tell a person at the keyboard from their agent. That is honest, but it means "human" is reachable only through the CLI.
  • With no agent named, the mode defaults to human. That is a claim the tool cannot check. An agent that runs the CLI without KG_AS is recorded as its person, so SKILL.md tells agents to name themselves.