DurableGroupSecurityRollbackAnchor
Defined in: packages/core/src/group-security-rollback-anchor.ts:86
Separately protected compare-and-set boundary for rollback detection.
Every store commit is bracketed by two anchor writes. prepare records the
exact next value as an intent before the store commits, and advance
installs a value after it commits. Intents from several coordinators that
share one store accumulate beside the same value, because the store’s
revision check lets at most one of them commit. If the second write never
happens, restore completes whichever intent the store holds exactly. A store
still at the base is accepted and keeps its intents until the next advance
clears them. Any other store state fails closed. Every mutating method must
be durable before it resolves and must leave state unchanged when it returns
false.
Methods
Section titled “Methods”advance()
Section titled “advance()”advance(
key,expected,next):Promise<boolean>
Defined in: packages/core/src/group-security-rollback-anchor.ts:107
Install next while expected is current and clear every intent.
Parameters
Section titled “Parameters”expected
Section titled “expected”GroupSecurityRollbackAnchorValue | undefined
GroupSecurityRollbackAnchorValue
Returns
Section titled “Returns”Promise<boolean>
load()
Section titled “load()”load(
key):Promise<GroupSecurityRollbackAnchorValue|undefined>
Defined in: packages/core/src/group-security-rollback-anchor.ts:87
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<GroupSecurityRollbackAnchorValue | undefined>
loadIntents()
Section titled “loadIntents()”loadIntents(
key):Promise<readonlyGroupSecurityRollbackIntent[]>
Defined in: packages/core/src/group-security-rollback-anchor.ts:91
Return the intents recorded beside the current value, oldest first.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<readonly GroupSecurityRollbackIntent[]>
poison()
Section titled “poison()”poison(
key,forkPoison,initial?):Promise<GroupSecurityRollbackAnchorValue>
Defined in: packages/core/src/group-security-rollback-anchor.ts:116
Atomically and irreversibly poison whichever active value is current and clear every intent.
Parameters
Section titled “Parameters”forkPoison
Section titled “forkPoison”GroupSecurityRollbackForkPoison
initial?
Section titled “initial?”GroupSecurityRollbackAnchorValue
Returns
Section titled “Returns”Promise<GroupSecurityRollbackAnchorValue>
prepare()
Section titled “prepare()”prepare(
key,expected,intent):Promise<boolean>
Defined in: packages/core/src/group-security-rollback-anchor.ts:101
Add intent beside the current value while expected is current
(undefined before the first anchor). The intent must extend expected.
An identical intent is kept once. Beyond
MAX_GROUP_SECURITY_ROLLBACK_INTENTS, the oldest is dropped. Return false
when expected is not current.
Parameters
Section titled “Parameters”expected
Section titled “expected”GroupSecurityRollbackAnchorValue | undefined
intent
Section titled “intent”Returns
Section titled “Returns”Promise<boolean>
retire()
Section titled “retire()”retire(
key,expected,removal):Promise<boolean>
Defined in: packages/core/src/group-security-rollback-anchor.ts:130
Durably and atomically retire the exact active position after a verified removal. The caller authenticates the control and protocol Commit first. Retrying the identical expected position and marker is idempotent. A different current position returns false without changing state. Once written, the marker prevents every later active advance, including after store rollback, and every intent is cleared. Return true only after the exact terminal marker is durably retained.
Parameters
Section titled “Parameters”expected
Section titled “expected”GroupSecurityRollbackAnchorValue
removal
Section titled “removal”Returns
Section titled “Returns”Promise<boolean>