Skip to content

ApprovalGrantStore

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/approvals/grants.ts:494

A set of grants with entry-identity semantics. Pure data + membership: it holds what the human granted and answers is this the same grant, never does this grant cover that command.

new ApprovalGrantStore(initial?): ApprovalGrantStore

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/approvals/grants.ts:497

readonly ApprovalGrant[] = []

ApprovalGrantStore

add(grant): boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/approvals/grants.ts:510

Add a grant. Returns whether it was new — an identical entry is not stored twice.

The ApprovalGrant.annotations snapshot is copied on the way in, so what the store holds is private to this grant whatever the caller passed: the effective set may be a live object the caller keeps, or (were a source ever to regress) the shared fail-closed constant, and a store aliasing either would let one grant’s record be rewritten from outside it. Copying here rather than at each call site makes that structural instead of a habit every caller must keep.

ApprovalGrant

boolean


entries(): ApprovalEntry[]

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/approvals/grants.ts:553

Just the entries, for handing to the matcher as one of its rule lists.

ApprovalEntry[]


find(entry): ApprovalGrant | undefined

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/approvals/grants.ts:526

The grant stored under this entry’s identity, or undefined.

Identity, never a match decision — the same de-duplication question add asks. It answers “is this the same grant”, and whether a grant covers a call remains resolveApprovalRules’s alone.

ApprovalEntry

ApprovalGrant | undefined


list(): ApprovalGrant[]

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/approvals/grants.ts:548

Every grant, in the order they were made.

ApprovalGrant[]


remove(entry): boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/approvals/grants.ts:539

Drop the grant stored under this entry’s identity. Returns whether one was there.

§4.7.4’s invalidation is a removal rather than a skip, and that is load-bearing: add de-duplicates by entry identity, so a grant left in place while being ignored would silently swallow the human’s re-approval of the same tool — the grant would appear to be re-made and the stale snapshot would keep invalidating it.

ApprovalEntry

boolean


size(): number

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/approvals/grants.ts:558

How many grants are held.

number