aitododocs Coming soonAutonomous delivery

Ids and claims from the server

Markdown

With a server pin (.aitodo/server.yaml) the store takes its ids and claims from the server, so clones on other machines (people, CI, agents) never collide.

Guideabout 3 min
On this page

The commands do not change; every call sends your token.

  • A claim is a lease owned by your token name + worktree + host, living 8 h; ticket update, ac …, note, section … renew it, by hand tkt ticket claim SG-128 --renew. Another token's lease: ERR_ALREADY_CLAIMED; only an admin takes it over with --force.
  • Server unreachable: ERR_COORDINATOR_UNREACHABLE; tkt --offline <cmd> works locally for that call (ids may collide; tkt doctor finds it, tkt ticket renumber repairs it). Read-only commands never contact the server.
Details5 items
  • Ids: ticket new, decision new, move, import, renumber, resolve-conflict use POST /v1/projects/{p}/ids {kind: ticket|decision, prefix, floor} (kind separates a group prefix D from the decision prefix D; numbers exceed floor, the clone's max, and raise the local counters.json). GET /v1/projects/{p}/ids?kind=…&prefix=… is the counter (move --dry-run). Failed writes skip numbers. tkt doctor: counter: server: <url> (project <id>); tkt where: coordinator: <url> (project <id>) serves ids, leases.
  • Leases: keyed by ticket ULID (kept by renumber, move); AITODO_CLAIM_TTL (e.g. 8h, 30m, 1d; invalid: the server does not start). Own token, other worktree or host: --force moves it; another token's needs admin (else ERR_AUTH_FORBIDDEN). Release: owner (any worktree) or admin. tkt ticket claims --json adds owner, host, expiresAt; expired = free, never stale. Renewal uses the gitignored .aitodo/leases.json; failures only warn; --renew on a gone lease: ERR_NOT_FOUND.
  • tkt next (no --claim) reads leases (unreachable: Warning: claims unknown: …). Closing (done/canceled) is written anyway; the lease expires. Offline also via AITODO_OFFLINE=1; no provisional ids, no sync command; resolve-conflict repairs too.
  • REST: GET /v1/projects/{p}/claims {leases: [{ulid, ticketId, owner, assignee, branch, worktree, host, claimedAt, renewedAt, expiresAt, mine}], ttlSeconds}; POST /v1/projects/{p}/claims/{ulid} {ticketId, assignee, branch, worktree, host, force?}: 201 new, 200 renewed/forced, 409; PUT renews the owner's only (404, 409); DELETE owner or admin (403, 404).
  • Busy server: while another request holds the server's database, a write answers 503 ERR_DB_BUSY (Server busy, retry, a Retry-After header, the request id); nothing was written. tkt asks again a few times, waiting longer each time, for a read, an id and a claim; any other write stops with the message: run it again. A read never waits on a write.
Generated from the registry: src/aitodo/api/selfdoc_entries/team.py · team.coordinatorv0.1.298