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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ApprovalGrantStore(
initial?):ApprovalGrantStore
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/approvals/grants.ts:497
Parameters
Section titled “Parameters”initial?
Section titled “initial?”readonly ApprovalGrant[] = []
Returns
Section titled “Returns”ApprovalGrantStore
Methods
Section titled “Methods”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
entries()
Section titled “entries()”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.
Returns
Section titled “Returns”find()
Section titled “find()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”ApprovalGrant | undefined
list()
Section titled “list()”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.
Returns
Section titled “Returns”remove()
Section titled “remove()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
size()
Section titled “size()”size():
number
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/core/approvals/grants.ts:558
How many grants are held.
Returns
Section titled “Returns”number