Skip to content

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.

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.

GroupStateStoreKey

GroupSecurityRollbackAnchorValue | undefined

GroupSecurityRollbackAnchorValue

Promise<boolean>


load(key): Promise<GroupSecurityRollbackAnchorValue | undefined>

Defined in: packages/core/src/group-security-rollback-anchor.ts:87

GroupStateStoreKey

Promise<GroupSecurityRollbackAnchorValue | undefined>


loadIntents(key): Promise<readonly GroupSecurityRollbackIntent[]>

Defined in: packages/core/src/group-security-rollback-anchor.ts:91

Return the intents recorded beside the current value, oldest first.

GroupStateStoreKey

Promise<readonly GroupSecurityRollbackIntent[]>


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.

GroupStateStoreKey

GroupSecurityRollbackForkPoison

GroupSecurityRollbackAnchorValue

Promise<GroupSecurityRollbackAnchorValue>


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.

GroupStateStoreKey

GroupSecurityRollbackAnchorValue | undefined

GroupSecurityRollbackIntent

Promise<boolean>


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.

GroupStateStoreKey

GroupSecurityRollbackAnchorValue

GroupSecurityRollbackRemoval

Promise<boolean>