D51c — The peer holds the leases, for everyone¶
- Status: Accepted — completes D47n
- Date: 2026-09-24
- Origin: slice 28 build
- Area: writes
Decision¶
- A claim is taken under one write lock (
BEGIN IMMEDIATE), check and write together. Of many writers, exactly one wins; a test runs 20 at once. - A lease records the signed-in client (
session) as well as the handle and agent. Two sessions of one person are told apart on the record. - Refresh tasks are leased too, under
refresh:<entity>:<property>: kg refresh brief --claim(MCPwrite op=refresh_claim) claims each task it hands out;- a task someone else holds is held back, and the brief names who holds it;
- recording the results gives the researcher's leases back.
- When a dataset names a peer (
peer:indataset.yaml), claims go there from everyone's command line:kg sweep claim/release,kg sweep brief --claim,kg refresh brief --claim(throughtask_claim). Without one, leases stay in the local graph, as before. - Leases never go into bundles.
Why¶
A lease exists so two people do not do the same work. In one graph it only ever stopped two agents fanned out from the same machine (D47n). A claim across people has to be seen by the other person before they start, and a git dataset can only show it after a pull request. A server everyone reaches can. Holding it under a write lock matters for the same reason: a server is where two claims arrive at once.
Alternatives¶
- Leases in the dataset. A pull request per claim, and a claim no one sees until it merges.
- Advisory claims ("I'm on it" in a chat). Nothing checks them.