const DELAY
DELAY is how long a proposed writer waits, from its Ready, before it takes over: three days for anyone to read its code on gnoweb, which is on chain from then on and cannot change. A constant: it can never be shortened.
Package store keeps Gnogolf's data (every record, best, board, standing, round in play and hole) apart from its rules...
Package store keeps Gnogolf's data (every record, best, board, standing, round in play and hole) apart from its rules, so a new version of the rules takes the data on instead of starting empty. It knows nothing of golf: a few ordered collections of string keys to string values, written only by the one realm it names as its writer (the rules: golf/v2 at the launch), read by anyone. A new writer takes over three days after its code is on chain and says so (the owner proposes it, it calls Ready), on its own; the owner can stop every write at once (Pause), start the same rules again at once (Resume), and renounce the role for good.
Accept takes the role offered.
At is the key and value at a place in a collection's order.
Batch applies a save's writes in one call: ops is "set", collection, key, value or "del", collection, key, "" (four strings an op), at most 64 ops. A transaction is all or nothing: a bad op undoes the whole batch.
Cancel drops the proposed writer before it takes over. Only the owner can.
Get is a key's value in a collection, and whether it is there.
Has reports whether a collection holds a key.
Index is how many keys of a collection sort before key: its place, from 0 (O(log n) a step of a binary search, as golf v1's boards).
Make adds a collection, for rules that need one more. The writer only.
Page is up to limit keys of a collection from start (included) to end (excluded; "" to its end), in order, as rows one after another: each the key's length, ":", the key, the value's length, ":", the value (no separator to escape: the lengths say where each ends). limit is 1 to 300.
PageAt is up to limit keys from the offset-th of a collection (from 0), as Page's rows.
PageBack is Page from end (kept, as bptree's back walk) down to start.
Pause stops every write at once (the reads go on), and drops any proposal. Only the owner can: for a bug in the rules, or one feared. Resume starts the same rules again at once; new rules take their delay.
Propose names the next writer, a realm's pkgpath under gno.land/r/. Only the owner can; a new proposal replaces the last. Its delay starts when that realm, on chain, calls Ready: its code can then be read, as it will run.
Proposed is the writer proposed and when it takes over (unix seconds; 0 while its code has not called Ready), or "" and 0.
Ready is the proposed writer's own call, once it is on chain: it takes over DELAY later, with no transaction to send. Only that realm can, once.
Remove drops a key from a collection, reporting whether it was there. The writer only.
Render says who writes, what is proposed and who may change it.
Renounce gives the role up for good: the writer can then never change, nor be paused; a proposal not yet in force is dropped. Only the owner can, and not while paused: no rules could ever write again.
Resume starts again, at once, the rules a Pause stopped: their code was in force already, so nothing new runs. Only the owner can.
Set keeps value under key in a collection. The writer only.
Size is how many keys a collection holds.
Transfer offers the owner's role, which the address offered takes with Accept.
Writer is the realm whose writes store takes now: the proposed one once its delay is over ("" while paused).