Expose only what clients call
Giveallow only to the functions a client calls. Everything else stays
internal: continuations, performers, reactions and helpers reached by
ctx.call. bijection.lock lists every path with its allow; review its diff like code.
Keep authority in declarations
Say who may enter a function withallow, what it may see and write with
labels and under, and what the business forbids with
guards. Attribute work to ctx.frame.as.id, the verified
principal; a principal named in the arguments is ordinary input.
Let the write state its assumption
Pick the write by what it assumes.insert refuses Exists; replace,
patch and delete refuse Absent; put and retract assume nothing and
never refuse. A separate existence check before the write is a second read
with nothing to add.
Share plain helpers
Keep reusable logic in ordinary functions. A helper that uses the context takesctx first: Base when it only reads (every function’s context is
one), MutationCtx when it writes. Callers pass their own ctx without a
cast. Use ctx.call only when a separate function boundary is part of the
contract.
Read time from the frame
Usectx.frame.now.entry for the entry instant and ctx.frame.at for the valid
instant (null at the present). To judge the commit instant, read
ctx.frame.now.before(t). For a change that must happen later, submit a task
with due.
Keep outside work out of the transaction
A transaction does no outside work. Submit a task to a target and receive its result in athen continuation.
Give each submit a once that names the logical effect, so a retry returns the
original task.
Commit a protected decision and a lower publication together
Enter the mutation under a label that clears every input to the decision, using a grant that admits the entry there. Read the inputs and make the decision in that frame. Put any lower publication in the same transaction through a release declared by the writing function. A reviewer enters atreview. Approval updates the protected case and
writes the public projection in the same commit.
Queued review
bijection/publication.ts
release right and disclosure guards govern that publication.
Lowering effects
Bound every read
End each listed selection in.first(n), page the rest with ctx.page, and
let an index serve every selection. On a
protected table, end a partial, range or ordered
selection in .atMost(n) instead, or declare its index ordered. A watched query reruns whenever what it
read changes, so a small read is a cheap watch.