Moving a store
A store lives in one place at a time, the repo or the server; the server's record is the truth (GET /v1/projects/{p}/store: location: repo|server|moving, movedAt).
On this page
Both directions need the admin token.
tkt store move --to server(in the repo whose.aitodo.yamlnames the store): needs.aitodo/server.yaml, atkt doctorwithout errors (warnings pass), nothing uncommitted (ERR_BAD_REQUEST), no live claim (ERR_ALREADY_CLAIMED;--force-claimsdrops the leases), no open decomposition (ERR_CONFIRM_REQUIRED;--force-decompositionsdrops them).tkt store move --to repo --dir .tickets(where.aitodo.yamlsaysstore: server):--dirmust not exist, or be empty; commit it and.aitodo.yaml.
Details6 items
- Merge open branches first: their tickets are not in the move. After
--to server, commit what it prints. - To the server: the store needs its own directory. The client uploads the committed files, with the history (a git bundle) when the store dir is the root of its own repository; the server checks with
tkt doctorwhilemoving, thenserver. Only then the client removes the local dir and rewrites.aitodo.yamltostore: server. A failure leavesrepoand the local store untouched. - Back: the server freezes the store (
moving: every/clicall gets 409ERR_STORE_MOVING), the client writes it, thenrepo, and the server archives its copy tostores/.archive/<project>-<date>(never deleted);.aitodo.yamlsaysworkspaceDir: <dir>. A failed release removes the dir: run it again; a crash after the release: the same command only rewrites the pointer. Open decompositions refuse here too; forced, they stay in the archive. - Half-done: the operator runs
tkt operator store-unfreeze <project> --server https://tkt.ideathon.me(back toserver) ortkt operator store-release <project> --server https://tkt.ideathon.me(repo, archived); each leaves an audit line. - Guards:
/cliruns only whileserver. A clone still writing its old local store gets 409ERR_STORE_LOCATION("this local copy is stale") once it asks for an id or a claim;tkt doctorwarnsSTALE_LOCAL_STORE(skipped offline or without a token), also when a branch merged later brings the store dir back. - REST (admin):
POST /v1/projects/{p}/store:import{tar, bundle?, forceClaims?}(base64; at most 100 MB together, else 413ERR_PAYLOAD_TOO_LARGE; the body is read only after the admin token check; a broken store 400ERR_BAD_REQUEST) →{location, storeVersion, movedAt, history, files};POST /v1/projects/{p}/store:exportandPOST /v1/projects/{p}/store:releasetake{forceDecompositions?}.