# Reviewer handoff and temporary delegation

Why a delegation that cannot expire makes the sentence ‘expired delegations stop
authorizing actions’ false rather than untested, what a grant has to be before
any of its lifecycle questions can be asked of it, why the provenance of the
instant an expiry is judged against is part of the answer, what has to have RUN
before an expiry has happened, which two facts a revocation carries that an
expiry does not, which of a delegate’s unfinished work survives the authority
ending and which does not, where a row goes when its ground is withdrawn and
nobody is named to take it, why the delegator’s standing has to be read in the
present tense, what an omitted scope dimension says, which action no grant may
ever confer and which action-and-kind PAIR cannot be expressed as one, at which
instant a destination’s six eligibility axes are measured, why a load count that
cannot exceed its ceiling is a refusal that can never fire, and which of the
ways of attributing a delegated action reads correctly to a person and wrongly
to a query.

Generated from `libs/oshun/workbench-kit/src/reviewer-handoff.ts` by
`node scripts/v1-workbenches/generate-workbench-kit-api-reference.mjs`. Ledger:
S8.11. Do not edit by hand.

## Summary

- `src/reviewer-handoff.ts`

| Entry point                             | Runtime class | Authorized by |
| --------------------------------------- | ------------- | ------------- |
| `@oshun/workbench-kit/reviewer-handoff` | `contract`    | S8.11         |

## Exports

| Symbol                                                                | Kind        | Summary                                                                                                           |
| --------------------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------- |
| [ALL_REVIEWER_HANDOFF_FAULTS](#all_reviewer_handoff_faults)           | constant    | Every fault kind this module can produce.                                                                         |
| [ATTRIBUTION_SHAPES](#attribution_shapes)                             | enumeration | The shapes an attribution can take, including the two that look right.                                            |
| [ATTRIBUTION_SURFACES](#attribution_surfaces)                         | enumeration | Surfaces a delegated action can appear on.                                                                        |
| [attributionShape](#attributionshape)                                 | function    | Classify one record against the two actors it should name.                                                        |
| [AttributionShape](#attributionshape)                                 | type        | —                                                                                                                 |
| [AttributionSurface](#attributionsurface)                             | type        | —                                                                                                                 |
| [AudienceNotice](#audiencenotice)                                     | interface   | —                                                                                                                 |
| [AUDIENCES_ENTITLED_TO_THE_REASON](#audiences_entitled_to_the_reason) | enumeration | Audiences the reason may reach: the ones it is ABOUT.                                                             |
| [AUDIENCES_FOR_AN_ENDING](#audiences_for_an_ending)                   | enumeration | Audiences an ENDING must reach, which are not the audiences of a beginning.                                       |
| [AuthorityGrant](#authoritygrant)                                     | interface   | —                                                                                                                 |
| [AUTHORIZATION_REFUSALS](#authorization_refusals)                     | enumeration | —                                                                                                                 |
| [AuthorizationObservation](#authorizationobservation)                 | interface   | What the host says is true, so that this module can disagree with it.                                             |
| [AuthorizationRefusal](#authorizationrefusal)                         | type        | —                                                                                                                 |
| [authorizesDelegatedAction](#authorizesdelegatedaction)               | function    | The function the evidence clause is about: does this grant authorize this action, at this instant, on this clock. |
| [AUTHORIZING_STANDINGS](#authorizing_standings)                       | enumeration | Only one standing authorizes anything. Named so nothing has to remember.                                          |
| [AVAILABILITY_STANDINGS](#availability_standings)                     | enumeration | Whether somebody can take work, as three values rather than two.                                                  |
| [AvailabilityStanding](#availabilitystanding)                         | type        | —                                                                                                                 |
| [CapacityObservation](#capacityobservation)                           | interface   | —                                                                                                                 |
| [CENSUS_MAX_AGE_MINUTES](#census_max_age_minutes)                     | constant    | How stale a census may be before it is describing a different review.                                             |
| [checkDestination](#checkdestination)                                 | function    | Decide whether this destination may receive this work, AT `effectiveAt` (S8.11.b).                                |
| [CLOCK_SOURCES](#clock_sources)                                       | enumeration | Where the instant an expiry is judged against came from.                                                          |
| [ClockSource](#clocksource)                                           | type        | —                                                                                                                 |
| [COUNT_TRUSTS](#count_trusts)                                         | enumeration | Whether a load count can be believed.                                                                             |
| [CountTrust](#counttrust)                                             | type        | —                                                                                                                 |
| [DELEGATED_ATTRIBUTION_FAULTS](#delegated_attribution_faults)         | enumeration | —                                                                                                                 |
| [DelegatedAsk](#delegatedask)                                         | interface   | What is being attempted, in the six dimensions a grant is scoped on.                                              |
| [delegatedAskOf](#delegatedaskof)                                     | function    | Build the delegated ask FROM the target, for the same reason.                                                     |
| [DelegatedAttributionFault](#delegatedattributionfault)               | type        | —                                                                                                                 |
| [delegatedAttributionFaults](#delegatedattributionfaults)             | function    | Check what the record says against what happened (S8.11.g).                                                       |
| [DelegatedAuthorization](#delegatedauthorization)                     | type        | —                                                                                                                 |
| [DelegatorStanding](#delegatorstanding)                               | interface   | What the delegator holds, NOW.                                                                                    |
| [DESTINATION_AXES](#destination_axes)                                 | enumeration | The six axes a destination is judged on.                                                                          |
| [DESTINATION_REFUSALS](#destination_refusals)                         | enumeration | —                                                                                                                 |
| [DestinationAxis](#destinationaxis)                                   | type        | —                                                                                                                 |
| [DestinationCandidate](#destinationcandidate)                         | interface   | Everything about a destination that the host knows and this module does not.                                      |
| [DestinationRefusal](#destinationrefusal)                             | type        | —                                                                                                                 |
| [DestinationRequirement](#destinationrequirement)                     | interface   | —                                                                                                                 |
| [destinationRequirementOf](#destinationrequirementof)                 | function    | Build the destination requirement FROM the handoff's own target.                                                  |
| [DestinationVerdict](#destinationverdict)                             | type        | —                                                                                                                 |
| [EffectiveActor](#effectiveactor)                                     | interface   | The two actors behind a delegated action, and the grant joining them.                                             |
| [effectiveActorLabel](#effectiveactorlabel)                           | function    | How a delegated actor is rendered, everywhere, in one order.                                                      |
| [GRANT_AUTHORITY_FAULTS](#grant_authority_faults)                     | enumeration | —                                                                                                                 |
| [GRANT_EVENTS](#grant_events)                                         | enumeration | —                                                                                                                 |
| [GRANT_LIFECYCLE_FAULTS](#grant_lifecycle_faults)                     | enumeration | —                                                                                                                 |
| [GRANT_SCOPE_FAULTS](#grant_scope_faults)                             | enumeration | —                                                                                                                 |
| [GRANT_STANDINGS](#grant_standings)                                   | enumeration | Where a grant stands, as six values.                                                                              |
| [GrantAuthorityContext](#grantauthoritycontext)                       | interface   | —                                                                                                                 |
| [GrantAuthorityFault](#grantauthorityfault)                           | type        | —                                                                                                                 |
| [grantAuthorityFaults](#grantauthorityfaults)                         | function    | Check that the authority being lent was the delegator's to lend (S8.11.e).                                        |
| [GrantEvent](#grantevent)                                             | type        | —                                                                                                                 |
| [GrantLifecycleFault](#grantlifecyclefault)                           | type        | —                                                                                                                 |
| [grantLifecycleFaults](#grantlifecyclefaults)                         | function    | Compare the deployment's accounting with what the register actually says (S8.11.f).                               |
| [grantNotices](#grantnotices)                                         | function    | Build the notices for one event.                                                                                  |
| [GrantRevocation](#grantrevocation)                                   | interface   | Somebody ending a grant early, which is an act and not a lapse.                                                   |
| [GrantScope](#grantscope)                                             | interface   | —                                                                                                                 |
| [GrantScopeFault](#grantscopefault)                                   | type        | —                                                                                                                 |
| [grantScopeFaults](#grantscopefaults)                                 | function    | Judge the grant as written, before anybody's authority is consulted (S8.11.d).                                    |
| [grantStanding](#grantstanding)                                       | function    | Compute the standing of one grant (S8.11.f).                                                                      |
| [GrantStanding](#grantstanding)                                       | type        | —                                                                                                                 |
| [HANDOFF_DISPOSITIONS](#handoff_dispositions)                         | enumeration | Whether this handoff moves the work or merely covers it.                                                          |
| [HANDOFF_NOTICE_AUDIENCES](#handoff_notice_audiences)                 | enumeration | The parties a handoff or a grant event concerns.                                                                  |
| [HANDOFF_NOTICE_FAULTS](#handoff_notice_faults)                       | enumeration | —                                                                                                                 |
| [HANDOFF_SCHEMA_FAULTS](#handoff_schema_faults)                       | enumeration | —                                                                                                                 |
| [HANDOFF_TENSES](#handoff_tenses)                                     | enumeration | Where a handoff sits relative to the clock.                                                                       |
| [HandoffDisposition](#handoffdisposition)                             | type        | —                                                                                                                 |
| [HandoffFinding](#handofffinding)                                     | interface   | —                                                                                                                 |
| [HandoffNoticeAudience](#handoffnoticeaudience)                       | type        | —                                                                                                                 |
| [HandoffNoticeFault](#handoffnoticefault)                             | type        | —                                                                                                                 |
| [handoffNoticeFaults](#handoffnoticefaults)                           | function    | Judge a notice set (S8.11.g).                                                                                     |
| [HandoffRecord](#handoffrecord)                                       | interface   | —                                                                                                                 |
| [HandoffSchemaFault](#handoffschemafault)                             | type        | —                                                                                                                 |
| [handoffSchemaFaults](#handoffschemafaults)                           | function    | Judge the handoff REQUEST, before any ledger row exists (S8.11.a).                                                |
| [HandoffTarget](#handofftarget)                                       | interface   | —                                                                                                                 |
| [HandoffTense](#handofftense)                                         | type        | —                                                                                                                 |
| [NONDELEGABLE_PAIRS](#nondelegable_pairs)                             | constant    | The rule that is a PAIR rather than an action.                                                                    |
| [nondelegableActions](#nondelegableactions)                           | function    | Actions no grant may confer, DERIVED from what a delegation already means.                                        |
| [NOTICE_KEYS](#notice_keys)                                           | constant    | —                                                                                                                 |
| [OnwardPolicy](#onwardpolicy)                                         | type        | Whether a grant may be used to cut further grants, and how deep.                                                  |
| [PART_OUTCOMES](#part_outcomes)                                       | enumeration | —                                                                                                                 |
| [PartOutcome](#partoutcome)                                           | type        | —                                                                                                                 |
| [PartResult](#partresult)                                             | interface   | —                                                                                                                 |
| [PendingWorkRow](#pendingworkrow)                                     | interface   | A piece of work whose holder may be holding it on borrowed authority.                                             |
| [PREDECESSOR_RECORDS](#predecessor_records)                           | enumeration | Where the previous holder's identity survives the transfer.                                                       |
| [PredecessorRecord](#predecessorrecord)                               | type        | —                                                                                                                 |
| [QualificationRecord](#qualificationrecord)                           | interface   | A competency with an end on it, because competencies lapse.                                                       |
| [RecordedAttribution](#recordedattribution)                           | interface   | —                                                                                                                 |
| [REFUSAL_AXIS](#refusal_axis)                                         | constant    | Which axis a refusal came from, so a caller can report by axis.                                                   |
| [resolveGrant](#resolvegrant)                                         | function    | Look a grant up in the register. A grant is a row, so this can fail.                                              |
| [ReviewerHandoffFault](#reviewerhandofffault)                         | type        | —                                                                                                                 |
| [SCOPE_DIMENSIONS](#scope_dimensions)                                 | enumeration | —                                                                                                                 |
| [ScopeDimension](#scopedimension)                                     | type        | —                                                                                                                 |
| [ScopeSelector](#scopeselector)                                       | type        | One dimension of a grant's reach.                                                                                 |
| [selectorAdmits](#selectoradmits)                                     | function    | Whether a selector admits a value. `all` admits everything by construction.                                       |
| [ServerClock](#serverclock)                                           | interface   | —                                                                                                                 |
| [SURFACES_REQUIRING_BOTH_ACTORS](#surfaces_requiring_both_actors)     | enumeration | Surfaces on which both actors are MANDATORY.                                                                      |
| [SWEEP_OUTCOMES](#sweep_outcomes)                                     | enumeration | —                                                                                                                 |
| [sweepGrants](#sweepgrants)                                           | function    | Re-evaluate every pending row against the register, now (S8.11.f).                                                |
| [SweepInput](#sweepinput)                                             | interface   | —                                                                                                                 |
| [SweepOutcome](#sweepoutcome)                                         | type        | —                                                                                                                 |
| [SweepResult](#sweepresult)                                           | interface   | —                                                                                                                 |
| [TRANSFER_FAULTS](#transfer_faults)                                   | enumeration | —                                                                                                                 |
| [TRANSFER_ORDER](#transfer_order)                                     | enumeration | The order the parts must be applied in.                                                                           |
| [TRANSFER_PARTS](#transfer_parts)                                     | enumeration | The parts a handoff actually consists of.                                                                         |
| [TransferFault](#transferfault)                                       | type        | —                                                                                                                 |
| [transferFaults](#transferfaults)                                     | function    | Judge what actually happened when the work moved (S8.11.c).                                                       |
| [TransferJudgment](#transferjudgment)                                 | interface   | The two verdicts a transfer gets, kept apart on purpose.                                                          |
| [TransferOutcome](#transferoutcome)                                   | interface   | —                                                                                                                 |
| [TransferPart](#transferpart)                                         | type        | —                                                                                                                 |
| [UNRESOLVED_WORK_KINDS](#unresolved_work_kinds)                       | enumeration | The kinds of loose end a review can be holding when it changes hands.                                             |
| [UnresolvedCensus](#unresolvedcensus)                                 | type        | What was found when somebody looked, or the fact that nobody did.                                                 |
| [UnresolvedItem](#unresolveditem)                                     | interface   | —                                                                                                                 |
| [UnresolvedWorkKind](#unresolvedworkkind)                             | type        | —                                                                                                                 |

## Shapes

#### ALL_REVIEWER_HANDOFF_FAULTS

Every fault kind this module can produce.

#### ATTRIBUTION_SHAPES

The shapes an attribution can take, including the two that look right.

Values: `both`, `delegate-only`, `delegator-only`,
`delegate-label-over-delegator-id`, `delegator-label-over-delegate-id`,
`neither`

#### ATTRIBUTION_SURFACES

Surfaces a delegated action can appear on.

Values: `action`, `audit`, `activity`, `notification`

#### attributionShape

Classify one record against the two actors it should name.

```ts
attributionShape(record: RecordedAttribution, effective: EffectiveActor): AttributionShape
```

#### AttributionShape

```ts
(typeof ATTRIBUTION_SHAPES)[number];
```

#### AttributionSurface

```ts
(typeof ATTRIBUTION_SURFACES)[number];
```

#### AudienceNotice

| Field              | Type                                            | Required | Notes |
| ------------------ | ----------------------------------------------- | -------- | ----- |
| `audience`         | [HandoffNoticeAudience](#handoffnoticeaudience) | required | —     |
| `key`              | `string`                                        | required | —     |
| `carriesTheReason` | `boolean`                                       | required | —     |

#### AUDIENCES_ENTITLED_TO_THE_REASON

Audiences the reason may reach: the ones it is ABOUT.

Values: `source`, `delegator`, `delegate`

#### AUDIENCES_FOR_AN_ENDING

Audiences an ENDING must reach, which are not the audiences of a beginning.

Values: `delegator`, `delegate`, `waiting-parties`

#### AuthorityGrant

| Field             | Type                                                            | Required | Notes                                                                  |
| ----------------- | --------------------------------------------------------------- | -------- | ---------------------------------------------------------------------- |
| `grantId`         | `string`                                                        | required | —                                                                      |
| `tenant`          | [TenantId](./identity.md#tenantid)                              | required | —                                                                      |
| `delegator`       | [ActorId](./identity.md#actorid)                                | required | —                                                                      |
| `delegate`        | [ActorId](./identity.md#actorid)                                | required | —                                                                      |
| `scope`           | [GrantScope](#grantscope)                                       | required | —                                                                      |
| `notBefore`       | [Instant](./identity.md#instant)                                | required | —                                                                      |
| `notAfter`        | [Instant](./identity.md#instant)                                | required | The end in force now, which a revocation does NOT move.                |
| `issuedNotAfter`  | [Instant](./identity.md#instant)                                | required | The end the grant was issued with.                                     |
| `reasonCode`      | `string`                                                        | required | —                                                                      |
| `delegatorGround` | [EligibilityGround](./review-inbox.md#eligibilityground)        | required | The ground the delegator held when this was cut. Caps what it confers. |
| `onward`          | [OnwardPolicy](#onwardpolicy)                                   | required | —                                                                      |
| `parentGrantId`   | `string \| null`                                                | required | Set when this grant was itself cut from another.                       |
| `depth`           | `number`                                                        | required | 0 for a grant cut from held authority, 1 for one cut from a grant.     |
| `revocation`      | `GrantRevocation \| null` — [GrantRevocation](#grantrevocation) | required | —                                                                      |

#### AUTHORIZATION_REFUSALS

Values: `clock-is-not-the-servers`, `grant-has-not-started`, `grant-has-ended`,
`grant-was-revoked`, `grant-lapsed-with-its-delegator`, `grant-is-malformed`,
`action-outside-the-granted-scope`, `action-is-nondelegable`

#### AuthorizationObservation

What the host says is true, so that this module can disagree with it.

| Field                      | Type                                                                           | Required | Notes                                                    |
| -------------------------- | ------------------------------------------------------------------------------ | -------- | -------------------------------------------------------- |
| `clock`                    | [ServerClock](#serverclock)                                                    | required | —                                                        |
| `lastSweptAt`              | `Instant \| null` — [Instant](./identity.md#instant)                           | required | When the sweep last ran. Null when it never has.         |
| `grants`                   | `readonly AuthorityGrant[]` — [AuthorityGrant](#authoritygrant)                | required | —                                                        |
| `delegatorsStillHold`      | `Readonly<Record<string, boolean>>`                                            | required | —                                                        |
| `rows`                     | `readonly PendingWorkRow[]` — [PendingWorkRow](#pendingworkrow)                | required | —                                                        |
| `stillAuthorized`          | `readonly string[]`                                                            | required | Item ids the deployment is still treating as authorized. |
| `successors`               | `Readonly<Record<string, ActorId \| null>>` — [ActorId](./identity.md#actorid) | required | —                                                        |
| `retroactivelyInvalidated` | `readonly string[]`                                                            | required | Completed items the deployment has since unwound.        |

#### AuthorizationRefusal

```ts
(typeof AUTHORIZATION_REFUSALS)[number];
```

#### authorizesDelegatedAction

The function the evidence clause is about: does this grant authorize this
action, at this instant, on this clock.

```ts
authorizesDelegatedAction(grant: AuthorityGrant, ask: DelegatedAsk, clock: ServerClock, delegatorStillHolds: boolean): DelegatedAuthorization
```

#### AUTHORIZING_STANDINGS

Only one standing authorizes anything. Named so nothing has to remember.

Values: `active`

#### AVAILABILITY_STANDINGS

Whether somebody can take work, as three values rather than two.

Values: `available`, `unavailable`, `unknown`

#### AvailabilityStanding

```ts
(typeof AVAILABILITY_STANDINGS)[number];
```

#### CapacityObservation

| Field       | Type                      | Required | Notes                                                               |
| ----------- | ------------------------- | -------- | ------------------------------------------------------------------- |
| `openCount` | `number`                  | required | Live items the destination already holds, as the HOST counted them. |
| `ceiling`   | `number`                  | required | —                                                                   |
| `basis`     | [CountTrust](#counttrust) | required | —                                                                   |

#### CENSUS_MAX_AGE_MINUTES

How stale a census may be before it is describing a different review.

Value: `120`

#### checkDestination

Decide whether this destination may receive this work, AT `effectiveAt`
(S8.11.b).

```ts
checkDestination(requirement: DestinationRequirement, candidate: DestinationCandidate, effectiveAt: Instant): DestinationVerdict
```

#### CLOCK_SOURCES

Where the instant an expiry is judged against came from.

Values: `server`, `client`, `unknown`

#### ClockSource

```ts
(typeof CLOCK_SOURCES)[number];
```

#### COUNT_TRUSTS

Whether a load count can be believed.

Values: `actual`, `clamped-at-the-ceiling`

#### CountTrust

```ts
(typeof COUNT_TRUSTS)[number];
```

#### DELEGATED_ATTRIBUTION_FAULTS

Values: `attributed-to-the-delegate-alone`, `attributed-to-the-delegator-alone`,
`recorded-under-one-actor-and-labelled-with-the-other`,
`attributed-to-neither-actor`, `attribution-with-no-grant-to-trace-it-to`,
`attribution-citing-a-grant-the-register-cannot-resolve`,
`attribution-missing-from-a-surface-that-shows-the-action`

#### DelegatedAsk

What is being attempted, in the six dimensions a grant is scoped on.

| Field       | Type                                                 | Required | Notes |
| ----------- | ---------------------------------------------------- | -------- | ----- |
| `action`    | [InboxActionName](./review-inbox.md#inboxactionname) | required | —     |
| `role`      | [AssignmentRole](./assignments.md#assignmentrole)    | required | —     |
| `domain`    | `string`                                             | required | —     |
| `workbench` | `string`                                             | required | —     |
| `kind`      | [WorkKind](./review-inbox.md#workkind)               | required | —     |
| `objectId`  | `string`                                             | required | —     |

#### delegatedAskOf

Build the delegated ask FROM the target, for the same reason.

```ts
delegatedAskOf(target: HandoffTarget, action: InboxActionName): DelegatedAsk
```

#### DelegatedAttributionFault

```ts
(typeof DELEGATED_ATTRIBUTION_FAULTS)[number];
```

#### delegatedAttributionFaults

Check what the record says against what happened (S8.11.g).

```ts
delegatedAttributionFaults(effective: EffectiveActor, records: readonly RecordedAttribution[], grants: readonly AuthorityGrant[]): readonly HandoffFinding[]
```

#### DelegatedAuthorization

```ts
| { readonly authorized: true; readonly grantId: string; readonly detail: string }
| { readonly authorized: false; readonly refusal: AuthorizationRefusal; readonly detail: string }
```

#### DelegatorStanding

What the delegator holds, NOW.

| Field         | Type                                                                                   | Required | Notes                                                                 |
| ------------- | -------------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------- |
| `actorId`     | [ActorId](./identity.md#actorid)                                                       | required | —                                                                     |
| `ground`      | `EligibilityGround \| null` — [EligibilityGround](./review-inbox.md#eligibilityground) | required | Null when the delegator holds no ground on this work at all.          |
| `actions`     | `readonly InboxActionName[]` — [InboxActionName](./review-inbox.md#inboxactionname)    | required | —                                                                     |
| `roles`       | `readonly AssignmentRole[]` — [AssignmentRole](./assignments.md#assignmentrole)        | required | —                                                                     |
| `domains`     | `readonly string[]`                                                                    | required | —                                                                     |
| `workbenches` | `readonly string[]`                                                                    | required | —                                                                     |
| `kinds`       | `readonly WorkKind[]` — [WorkKind](./review-inbox.md#workkind)                         | required | —                                                                     |
| `objects`     | `readonly string[]`                                                                    | required | —                                                                     |
| `heldByGrant` | `string \| null`                                                                       | required | Set when the delegator's own authority came from a grant.             |
| `stillHeld`   | `boolean`                                                                              | required | Whether the host still recognises this standing at the instant asked. |

#### DESTINATION_AXES

The six axes a destination is judged on.

Values: `role`, `qualification`, `object-access`, `capacity`, `conflict`,
`availability`

#### DESTINATION_REFUSALS

Values: `destination-is-not-an-active-actor`,
`destination-kind-may-not-hold-work`, `destination-does-not-hold-the-role`,
`destination-lacks-a-required-qualification`,
`destination-qualification-expires-before-the-handoff-takes-effect`,
`destination-qualification-with-an-unparseable-end`,
`destination-cannot-reach-the-object`, `destination-is-in-another-tenant`,
`destination-is-at-or-over-its-ceiling`,
`destination-capacity-measured-on-a-clamped-count`,
`destination-authored-the-object`, `destination-is-recused-from-the-object`,
`destination-reports-to-the-source`, `destination-availability-is-unknown`,
`destination-is-unavailable`, `destination-cannot-attest`,
`destination-qualification-not-yet-granted`

#### DestinationAxis

```ts
(typeof DESTINATION_AXES)[number];
```

#### DestinationCandidate

Everything about a destination that the host knows and this module does not.

| Field                  | Type                                                                            | Required | Notes                                                                 |
| ---------------------- | ------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------- |
| `actorId`              | [ActorId](./identity.md#actorid)                                                | required | —                                                                     |
| `actor`                | [ActorRef](./identity.md#actorref)                                              | required | —                                                                     |
| `tenant`               | [TenantId](./identity.md#tenantid)                                              | required | —                                                                     |
| `active`               | `boolean`                                                                       | required | Whether the account is live. Unread by the product's delegation path. |
| `roles`                | `readonly AssignmentRole[]` — [AssignmentRole](./assignments.md#assignmentrole) | required | —                                                                     |
| `qualifications`       | `readonly QualificationRecord[]` — [QualificationRecord](#qualificationrecord)  | required | —                                                                     |
| `mayAccessObject`      | `boolean`                                                                       | required | —                                                                     |
| `capacity`             | [CapacityObservation](#capacityobservation)                                     | required | —                                                                     |
| `availability`         | [AvailabilityStanding](#availabilitystanding)                                   | required | —                                                                     |
| `authoredTheObject`    | `boolean`                                                                       | required | —                                                                     |
| `recusedFromTheObject` | `boolean`                                                                       | required | —                                                                     |
| `reportsToTheSource`   | `boolean`                                                                       | required | Whether the destination reports to the source of the handoff.         |

#### DestinationRefusal

```ts
(typeof DESTINATION_REFUSALS)[number];
```

#### DestinationRequirement

| Field                    | Type                                              | Required | Notes                                                                    |
| ------------------------ | ------------------------------------------------- | -------- | ------------------------------------------------------------------------ |
| `tenant`                 | [TenantId](./identity.md#tenantid)                | required | —                                                                        |
| `role`                   | [AssignmentRole](./assignments.md#assignmentrole) | required | —                                                                        |
| `kind`                   | [WorkKind](./review-inbox.md#workkind)            | required | —                                                                        |
| `requiredQualifications` | `readonly string[]`                               | required | Qualification ids the work requires. Empty is allowed and is a decision. |

#### destinationRequirementOf

Build the destination requirement FROM the handoff's own target.

```ts
destinationRequirementOf(target: HandoffTarget, requiredQualifications: readonly string[]): DestinationRequirement
```

#### DestinationVerdict

```ts
| { readonly eligible: true; readonly measured: readonly DestinationAxis[]; readonly detail: string; }
| { readonly eligible: false; readonly refusals: readonly HandoffFinding[]; readonly refusedAxes: readonly DestinationAxis[]; }
```

#### EffectiveActor

The two actors behind a delegated action, and the grant joining them.

| Field        | Type                             | Required | Notes            |
| ------------ | -------------------------------- | -------- | ---------------- |
| `acting`     | [ActorId](./identity.md#actorid) | required | Whose hands.     |
| `onBehalfOf` | [ActorId](./identity.md#actorid) | required | Whose authority. |
| `grantId`    | `string`                         | required | —                |

#### effectiveActorLabel

How a delegated actor is rendered, everywhere, in one order.

```ts
effectiveActorLabel(effective: EffectiveActor): string
```

#### GRANT_AUTHORITY_FAULTS

Values: `grant-cut-by-somebody-who-held-nothing`,
`grant-that-outlived-its-delegators-authority`,
`grant-wider-than-the-delegator`,
`grant-conferring-a-stronger-ground-than-the-delegator-holds`,
`onward-grant-from-a-grant-that-refused-it`,
`onward-grant-whose-parent-is-not-the-one-it-names`,
`onward-grant-outliving-its-parent`, `onward-grant-wider-than-its-parent`,
`onward-chain-past-its-depth-limit`, `grant-to-an-actor-who-may-not-hold-work`,
`grant-to-an-actor-already-acting-on-the-delegators-authority`,
`grant-that-crosses-a-tenant`, `grant-that-fills-a-second-quorum-seat`,
`grant-to-an-author-of-the-object`, `grant-whose-delegate-is-recused`,
`grant-conferring-work-the-delegate-is-not-qualified-for`,
`grant-whose-window-outlives-the-delegates-qualification`

#### GRANT_EVENTS

Values: `granted`, `revoked`, `expired`, `handed-off`

#### GRANT_LIFECYCLE_FAULTS

Values: `standing-computed-from-a-clock-that-is-not-the-servers`,
`sweep-that-has-never-run`, `expiry-that-was-never-swept`,
`work-still-authorized-by-a-grant-that-ended`,
`in-flight-work-grandfathered-past-its-grant`,
`completed-action-retroactively-invalidated`,
`withdrawn-work-left-with-nowhere-to-go`,
`sole-ground-naming-a-grant-the-register-cannot-resolve`,
`revocation-that-authorized-work-after-it-was-decided`,
`sweep-recorded-as-having-run-in-the-future`

#### GRANT_SCOPE_FAULTS

Values: `grant-with-no-end`, `grant-with-an-unparseable-window`,
`grant-whose-window-never-opens`, `grant-longer-than-a-role-change`,
`grant-scope-widened-to-all-with-no-justification`,
`grant-scope-dimension-that-selects-nothing`,
`grant-conferring-a-nondelegable-action`, `grant-conferring-an-attestation`,
`grant-to-the-delegator-themselves`, `grant-with-no-reason-code`,
`onward-permitted-with-a-depth-of-zero`,
`grant-with-a-parent-and-a-depth-of-zero`,
`grant-with-no-parent-and-a-nonzero-depth`,
`grant-whose-end-moved-with-no-revocation`, `revocation-with-no-reason-code`,
`revocation-recorded-under-the-grant-it-revokes`,
`revocation-by-an-erased-identity`

#### GRANT_STANDINGS

Where a grant stands, as six values.

Values: `malformed`, `revoked`, `pending`, `expired`, `lapsed-with-its-source`,
`active`

#### GrantAuthorityContext

| Field                    | Type                                                         | Required | Notes                                                            |
| ------------------------ | ------------------------------------------------------------ | -------- | ---------------------------------------------------------------- |
| `grant`                  | [AuthorityGrant](#authoritygrant)                            | required | —                                                                |
| `delegator`              | [DelegatorStanding](#delegatorstanding)                      | required | —                                                                |
| `delegate`               | [DestinationCandidate](#destinationcandidate)                | required | —                                                                |
| `parent`                 | `AuthorityGrant \| null` — [AuthorityGrant](#authoritygrant) | required | The grant this one was cut from, when it names one.              |
| `quorumSeats`            | `readonly ActorId[]` — [ActorId](./identity.md#actorid)      | required | Actors already holding a seat in a quorum decision on this work. |
| `authoredBy`             | `readonly ActorId[]` — [ActorId](./identity.md#actorid)      | required | Who produced the thing under review.                             |
| `askRole`                | [AssignmentRole](./assignments.md#assignmentrole)            | required | Roles whose holder is deciding, so a conflict binds.             |
| `requiredQualifications` | `readonly string[]`                                          | required | Competencies the work requires, which a grant cannot confer.     |

#### GrantAuthorityFault

```ts
(typeof GRANT_AUTHORITY_FAULTS)[number];
```

#### grantAuthorityFaults

Check that the authority being lent was the delegator's to lend (S8.11.e).

```ts
grantAuthorityFaults(context: GrantAuthorityContext): readonly HandoffFinding[]
```

#### GrantEvent

```ts
(typeof GRANT_EVENTS)[number];
```

#### GrantLifecycleFault

```ts
(typeof GRANT_LIFECYCLE_FAULTS)[number];
```

#### grantLifecycleFaults

Compare the deployment's accounting with what the register actually says
(S8.11.f).

```ts
grantLifecycleFaults(observation: AuthorizationObservation): readonly HandoffFinding[]
```

#### grantNotices

Build the notices for one event.

```ts
grantNotices(event: GrantEvent): readonly AudienceNotice[]
```

#### GrantRevocation

Somebody ending a grant early, which is an act and not a lapse.

| Field        | Type                               | Required | Notes |
| ------------ | ---------------------------------- | -------- | ----- |
| `at`         | [Instant](./identity.md#instant)   | required | —     |
| `by`         | [ActorRef](./identity.md#actorref) | required | —     |
| `reasonCode` | `string`                           | required | —     |

#### GrantScope

| Field         | Type                                                                                                                     | Required | Notes |
| ------------- | ------------------------------------------------------------------------------------------------------------------------ | -------- | ----- |
| `actions`     | `ScopeSelector<InboxActionName>` — [InboxActionName](./review-inbox.md#inboxactionname), [ScopeSelector](#scopeselector) | required | —     |
| `roles`       | `ScopeSelector<AssignmentRole>` — [AssignmentRole](./assignments.md#assignmentrole), [ScopeSelector](#scopeselector)     | required | —     |
| `domains`     | `ScopeSelector<string>` — [ScopeSelector](#scopeselector)                                                                | required | —     |
| `workbenches` | `ScopeSelector<string>` — [ScopeSelector](#scopeselector)                                                                | required | —     |
| `kinds`       | `ScopeSelector<WorkKind>` — [ScopeSelector](#scopeselector), [WorkKind](./review-inbox.md#workkind)                      | required | —     |
| `objects`     | `ScopeSelector<string>` — [ScopeSelector](#scopeselector)                                                                | required | —     |

#### GrantScopeFault

```ts
(typeof GRANT_SCOPE_FAULTS)[number];
```

#### grantScopeFaults

Judge the grant as written, before anybody's authority is consulted (S8.11.d).

```ts
grantScopeFaults(grant: AuthorityGrant): readonly HandoffFinding[]
```

#### grantStanding

Compute the standing of one grant (S8.11.f).

```ts
grantStanding(grant: AuthorityGrant, clock: ServerClock, delegatorStillHolds: boolean): GrantStanding
```

#### GrantStanding

```ts
(typeof GRANT_STANDINGS)[number];
```

#### HANDOFF_DISPOSITIONS

Whether this handoff moves the work or merely covers it.

Values: `permanent-transfer`, `for-the-duration-of-a-grant`

#### HANDOFF_NOTICE_AUDIENCES

The parties a handoff or a grant event concerns.

Values: `source`, `destination`, `delegator`, `delegate`, `object-owner`,
`waiting-parties`

#### HANDOFF_NOTICE_FAULTS

Values: `notice-carrying-the-reason-to-a-party-it-is-not-about`,
`ending-that-told-nobody-who-was-waiting`,
`ending-that-did-not-tell-the-delegate`,
`expiry-notice-carrying-a-reason-nobody-gave`,
`notice-set-with-a-duplicated-audience`

#### HANDOFF_SCHEMA_FAULTS

Values: `handoff-to-the-actor-who-already-holds-it`,
`handoff-with-no-reason-code`, `handoff-with-no-context-for-the-successor`,
`handoff-effective-before-it-was-requested`,
`handoff-with-an-unparseable-instant`, `unresolved-census-that-was-never-taken`,
`unresolved-census-older-than-the-work-it-describes`,
`unresolved-census-taken-after-the-handoff-took-effect`,
`unresolved-item-with-no-opening-instant`,
`blocking-unresolved-work-handed-over-with-the-deadline-inherited`,
`temporary-handoff-with-no-grant-to-end-it`,
`permanent-transfer-that-names-a-grant`,
`handoff-marked-effective-before-its-instant-arrived`,
`scheduled-handoff-whose-effective-instant-has-passed`,
`handoff-of-an-attestation-requested-by-a-machine-principal`,
`handoff-requested-by-the-destination`,
`handoff-requested-by-an-erased-identity`,
`inherited-deadline-with-no-deadline-to-inherit`,
`deadline-with-no-sla-class-to-measure-it-against`

#### HANDOFF_TENSES

Where a handoff sits relative to the clock.

Values: `scheduled`, `effective`, `superseded`, `withdrawn`

#### HandoffDisposition

```ts
(typeof HANDOFF_DISPOSITIONS)[number];
```

#### HandoffFinding

| Field     | Type                                          | Required | Notes                                                               |
| --------- | --------------------------------------------- | -------- | ------------------------------------------------------------------- |
| `kind`    | [ReviewerHandoffFault](#reviewerhandofffault) | required | —                                                                   |
| `subject` | `string`                                      | required | The handoff, destination, transfer part, grant, work row or record. |
| `detail`  | `string`                                      | required | —                                                                   |

#### HandoffNoticeAudience

```ts
(typeof HANDOFF_NOTICE_AUDIENCES)[number];
```

#### HandoffNoticeFault

```ts
(typeof HANDOFF_NOTICE_FAULTS)[number];
```

#### handoffNoticeFaults

Judge a notice set (S8.11.g).

```ts
handoffNoticeFaults(event: GrantEvent, notices: readonly AudienceNotice[]): readonly HandoffFinding[]
```

#### HandoffRecord

| Field         | Type                                                                      | Required | Notes                                                              |
| ------------- | ------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------ |
| `handoffId`   | `string`                                                                  | required | —                                                                  |
| `target`      | [HandoffTarget](#handofftarget)                                           | required | —                                                                  |
| `from`        | [ActorId](./identity.md#actorid)                                          | required | —                                                                  |
| `to`          | [ActorId](./identity.md#actorid)                                          | required | —                                                                  |
| `requestedBy` | [ActorRef](./identity.md#actorref)                                        | required | Who asked for it, which is frequently neither party.               |
| `requestedAt` | [Instant](./identity.md#instant)                                          | required | —                                                                  |
| `effectiveAt` | [Instant](./identity.md#instant)                                          | required | When ownership actually moves. May be later than `requestedAt`.    |
| `reasonCode`  | `string`                                                                  | required | —                                                                  |
| `contextNote` | `string`                                                                  | required | What the successor needs to know about the work. Not why it moved. |
| `unresolved`  | [UnresolvedCensus](#unresolvedcensus)                                     | required | —                                                                  |
| `duePolicy`   | [DuePolicyOnReassign](./assignments.md#duepolicyonreassign)               | required | —                                                                  |
| `due`         | `DueCommitment \| null` — [DueCommitment](./assignments.md#duecommitment) | required | —                                                                  |
| `slaClassId`  | `string \| null`                                                          | required | —                                                                  |
| `disposition` | [HandoffDisposition](#handoffdisposition)                                 | required | —                                                                  |
| `grantId`     | `string \| null`                                                          | required | Set exactly when the disposition is `for-the-duration-of-a-grant`. |
| `tense`       | [HandoffTense](#handofftense)                                             | required | —                                                                  |

#### HandoffSchemaFault

```ts
(typeof HANDOFF_SCHEMA_FAULTS)[number];
```

#### handoffSchemaFaults

Judge the handoff REQUEST, before any ledger row exists (S8.11.a).

```ts
handoffSchemaFaults(handoff: HandoffRecord, now: Instant): readonly HandoffFinding[]
```

#### HandoffTarget

| Field       | Type                                              | Required | Notes                                                                 |
| ----------- | ------------------------------------------------- | -------- | --------------------------------------------------------------------- |
| `tenant`    | [TenantId](./identity.md#tenantid)                | required | —                                                                     |
| `objectId`  | `string`                                          | required | —                                                                     |
| `askId`     | `string`                                          | required | The specific ask, so a handoff of one review is not a handoff of all. |
| `role`      | [AssignmentRole](./assignments.md#assignmentrole) | required | —                                                                     |
| `kind`      | [WorkKind](./review-inbox.md#workkind)            | required | —                                                                     |
| `domain`    | `string`                                          | required | —                                                                     |
| `workbench` | `string`                                          | required | —                                                                     |

#### HandoffTense

```ts
(typeof HANDOFF_TENSES)[number];
```

#### NONDELEGABLE_PAIRS

The rule that is a PAIR rather than an action.

#### nondelegableActions

Actions no grant may confer, DERIVED from what a delegation already means.

```ts
nondelegableActions(): readonly InboxActionName[]
```

#### NOTICE_KEYS

#### OnwardPolicy

Whether a grant may be used to cut further grants, and how deep.

```ts
| { readonly kind: 'refused' }
| { readonly kind: 'permitted'; readonly maxDepth: number }
```

#### PART_OUTCOMES

Values: `applied`, `skipped`, `failed`

#### PartOutcome

```ts
(typeof PART_OUTCOMES)[number];
```

#### PartResult

| Field     | Type                                                 | Required | Notes                                                 |
| --------- | ---------------------------------------------------- | -------- | ----------------------------------------------------- |
| `part`    | [TransferPart](#transferpart)                        | required | —                                                     |
| `outcome` | [PartOutcome](#partoutcome)                          | required | —                                                     |
| `at`      | `Instant \| null` — [Instant](./identity.md#instant) | required | When it was applied. Null for skipped and for failed. |
| `detail`  | `string`                                             | required | —                                                     |

#### PendingWorkRow

A piece of work whose holder may be holding it on borrowed authority.

| Field               | Type                                                                                      | Required | Notes                                                                  |
| ------------------- | ----------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------------- |
| `itemId`            | `string`                                                                                  | required | —                                                                      |
| `holder`            | [ActorId](./identity.md#actorid)                                                          | required | —                                                                      |
| `soleGroundGrantId` | `string \| null`                                                                          | required | The grant this holder's claim rests on. Null when it rests on nothing. |
| `otherGrounds`      | `readonly EligibilityGround[]` — [EligibilityGround](./review-inbox.md#eligibilityground) | required | Grounds the holder has independently of any grant.                     |
| `startedAt`         | `Instant \| null` — [Instant](./identity.md#instant)                                      | required | Set once the holder has begun. Not the same as having finished.        |
| `completedAt`       | `Instant \| null` — [Instant](./identity.md#instant)                                      | required | Set once the work is done. A completed action is not revisited.        |

#### PREDECESSOR_RECORDS

Where the previous holder's identity survives the transfer.

Values: `field`, `prose-only`, `absent`

#### PredecessorRecord

```ts
(typeof PREDECESSOR_RECORDS)[number];
```

#### QualificationRecord

A competency with an end on it, because competencies lapse.

| Field             | Type                                                 | Required | Notes                                                           |
| ----------------- | ---------------------------------------------------- | -------- | --------------------------------------------------------------- |
| `qualificationId` | `string`                                             | required | —                                                               |
| `grantedAt`       | [Instant](./identity.md#instant)                     | required | —                                                               |
| `expiresAt`       | `Instant \| null` — [Instant](./identity.md#instant) | required | Null for a qualification that does not lapse. Rare, and stated. |

#### RecordedAttribution

| Field              | Type                                                 | Required | Notes                                                            |
| ------------------ | ---------------------------------------------------- | -------- | ---------------------------------------------------------------- |
| `recordId`         | `string`                                             | required | —                                                                |
| `surface`          | [AttributionSurface](#attributionsurface)            | required | —                                                                |
| `actorId`          | `ActorId \| null` — [ActorId](./identity.md#actorid) | required | The id the record is stored under.                               |
| `displayedLabelOf` | `ActorId \| null` — [ActorId](./identity.md#actorid) | required | Whose NAME the surface displays. Frequently not the same person. |
| `onBehalfOf`       | `ActorId \| null` — [ActorId](./identity.md#actorid) | required | —                                                                |
| `grantId`          | `string \| null`                                     | required | —                                                                |

#### REFUSAL_AXIS

Which axis a refusal came from, so a caller can report by axis.

#### resolveGrant

Look a grant up in the register. A grant is a row, so this can fail.

```ts
resolveGrant(grants: readonly AuthorityGrant[], grantId: string): AuthorityGrant | null
```

#### ReviewerHandoffFault

```ts
| HandoffSchemaFault
| DestinationRefusal
| TransferFault
| GrantScopeFault
| GrantAuthorityFault
| GrantLifecycleFault
| DelegatedAttributionFault
| HandoffNoticeFault
```

#### SCOPE_DIMENSIONS

Values: `actions`, `roles`, `domains`, `workbenches`, `kinds`, `objects`

#### ScopeDimension

```ts
(typeof SCOPE_DIMENSIONS)[number];
```

#### ScopeSelector

One dimension of a grant's reach.

```ts
| { readonly kind: 'all'; readonly justification: string }
| { readonly kind: 'these'; readonly values: readonly T[] }
```

#### selectorAdmits

Whether a selector admits a value. `all` admits everything by construction.

```ts
selectorAdmits(selector: ScopeSelector<T>, value: T): boolean
```

#### ServerClock

| Field                  | Type                             | Required | Notes                                                                                                                                                |
| ---------------------- | -------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `now`                  | [Instant](./identity.md#instant) | required | —                                                                                                                                                    |
| `source`               | [ClockSource](#clocksource)      | required | —                                                                                                                                                    |
| `skewToleranceSeconds` | `number`                         | required | How far a grant boundary may be from `now` before the answer is treated as indeterminate. Zero is allowed and means the boundary is taken literally. |

#### SURFACES_REQUIRING_BOTH_ACTORS

Surfaces on which both actors are MANDATORY.

Values: `action`, `audit`

#### SWEEP_OUTCOMES

Values: `untouched-no-grant-involved`, `still-authorized`,
`left-with-another-ground`, `authorization-withdrawn`, `withdrawn-and-orphaned`,
`completed-under-a-live-grant`, `completed-after-its-grant-ended`,
`unresolvable-grant`

#### sweepGrants

Re-evaluate every pending row against the register, now (S8.11.f).

```ts
sweepGrants(input: SweepInput): readonly SweepResult[]
```

#### SweepInput

| Field                 | Type                                                                           | Required | Notes                                                                   |
| --------------------- | ------------------------------------------------------------------------------ | -------- | ----------------------------------------------------------------------- |
| `clock`               | [ServerClock](#serverclock)                                                    | required | —                                                                       |
| `grants`              | `readonly AuthorityGrant[]` — [AuthorityGrant](#authoritygrant)                | required | —                                                                       |
| `delegatorsStillHold` | `Readonly<Record<string, boolean>>`                                            | required | Whether each grant's delegator still holds what they lent. By grant id. |
| `rows`                | `readonly PendingWorkRow[]` — [PendingWorkRow](#pendingworkrow)                | required | —                                                                       |
| `successors`          | `Readonly<Record<string, ActorId \| null>>` — [ActorId](./identity.md#actorid) | required | Who the host found to take a withdrawn row. By item id.                 |

#### SweepOutcome

```ts
(typeof SWEEP_OUTCOMES)[number];
```

#### SweepResult

| Field      | Type                                                      | Required | Notes                                                |
| ---------- | --------------------------------------------------------- | -------- | ---------------------------------------------------- |
| `itemId`   | `string`                                                  | required | —                                                    |
| `outcome`  | [SweepOutcome](#sweepoutcome)                             | required | —                                                    |
| `grantId`  | `string \| null`                                          | required | —                                                    |
| `standing` | `GrantStanding \| null` — [GrantStanding](#grantstanding) | required | —                                                    |
| `holder`   | `ActorId \| null` — [ActorId](./identity.md#actorid)      | required | Who holds it after the sweep. Null when nobody does. |
| `detail`   | `string`                                                  | required | —                                                    |

#### TRANSFER_FAULTS

Values: `transfer-with-a-part-it-never-attempted`,
`transfer-that-applied-a-part-out-of-order`,
`transfer-that-continued-past-a-failed-part`,
`partial-transfer-reported-as-complete`,
`partial-transfer-with-no-compensation`,
`transfer-that-notified-before-it-audited`,
`transfer-whose-ledger-part-produced-no-ledger-pair`,
`transfer-that-moved-work-without-writing-an-audit-row`,
`predecessor-recorded-only-in-prose`, `predecessor-not-recorded-at-all`,
`carried-context-reattributed-to-the-successor`, `applied-part-with-no-instant`,
`skipped-part-that-carries-an-instant`, `compensation-with-no-reason-code`,
`compensation-recorded-before-the-parts-it-undoes`

#### TRANSFER_ORDER

The order the parts must be applied in.

Values: `assignment-ledger`, `outgoing-handover-grant`, `carried-context`,
`due-and-sla`, `audit`, `notifications`

#### TRANSFER_PARTS

The parts a handoff actually consists of.

Values: `assignment-ledger`, `outgoing-handover-grant`, `carried-context`,
`due-and-sla`, `audit`, `notifications`

#### TransferFault

```ts
(typeof TRANSFER_FAULTS)[number];
```

#### transferFaults

Judge what actually happened when the work moved (S8.11.c).

```ts
transferFaults(handoff: HandoffRecord, outcome: TransferOutcome, move: Reassignment | null): TransferJudgment
```

#### TransferJudgment

The two verdicts a transfer gets, kept apart on purpose.

| Field      | Type                                                                                     | Required | Notes |
| ---------- | ---------------------------------------------------------------------------------------- | -------- | ----- |
| `findings` | `readonly HandoffFinding[]` — [HandoffFinding](#handofffinding)                          | required | —     |
| `ledger`   | `readonly AssignmentFinding[]` — [AssignmentFinding](./assignments.md#assignmentfinding) | required | —     |

#### TransferOutcome

| Field                        | Type                                                                                               | Required | Notes                                                                   |
| ---------------------------- | -------------------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------- |
| `handoffId`                  | `string`                                                                                           | required | —                                                                       |
| `parts`                      | `readonly PartResult[]` — [PartResult](#partresult)                                                | required | —                                                                       |
| `reportedComplete`           | `boolean`                                                                                          | required | What the caller told the requester.                                     |
| `predecessorRecord`          | [PredecessorRecord](#predecessorrecord)                                                            | required | —                                                                       |
| `carriedContextReattributed` | `boolean`                                                                                          | required | Whether carried comments and evidence now name the successor as author. |
| `compensation`               | `{ readonly at: Instant; readonly reasonCode: string } \| null` — [Instant](./identity.md#instant) | required | What was done about a partial application. Null when nothing was.       |

#### TransferPart

```ts
(typeof TRANSFER_PARTS)[number];
```

#### UNRESOLVED_WORK_KINDS

The kinds of loose end a review can be holding when it changes hands.

Values: `open-thread`, `requested-change`, `pending-evidence`, `unrun-gate`,
`partial-decision`, `outstanding-question`

#### UnresolvedCensus

What was found when somebody looked, or the fact that nobody did.

```ts
| { readonly surveyed: true; readonly items: readonly UnresolvedItem[]; readonly surveyedAt: Instant; }
| { readonly surveyed: false; readonly reason: string; }
```

#### UnresolvedItem

| Field              | Type                                      | Required | Notes                                                      |
| ------------------ | ----------------------------------------- | -------- | ---------------------------------------------------------- |
| `itemId`           | `string`                                  | required | —                                                          |
| `kind`             | [UnresolvedWorkKind](#unresolvedworkkind) | required | —                                                          |
| `openedAt`         | [Instant](./identity.md#instant)          | required | —                                                          |
| `blocksCompletion` | `boolean`                                 | required | Whether the work cannot be completed until this is closed. |

#### UnresolvedWorkKind

```ts
(typeof UNRESOLVED_WORK_KINDS)[number];
```

## Valid examples

No committed fixture corpus covers this page's accepted cases; they are
unit-level and live in the module's own spec.

## Invalid examples

No committed fixture corpus covers this page's refused cases; they are
unit-level and live in the module's own spec.

## Authorization and scope

| Symbol                                     | Type                        | Notes                                                                                                             |
| ------------------------------------------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| `AuthorityGrant.grantId`                   | `string`                    | —                                                                                                                 |
| `AuthorityGrant.parentGrantId`             | `string                     | null`                                                                                                             | Set when this grant was itself cut from another.                       |
| `AuthorityGrant.scope`                     | `GrantScope`                | —                                                                                                                 |
| `AuthorityGrant.tenant`                    | `TenantId`                  | —                                                                                                                 |
| `AUTHORIZATION_REFUSALS`                   | `enumeration`               | —                                                                                                                 |
| `AuthorizationObservation.grants`          | `readonly AuthorityGrant[]` | —                                                                                                                 |
| `AuthorizationObservation.stillAuthorized` | `readonly string[]`         | Item ids the deployment is still treating as authorized.                                                          |
| `AuthorizationRefusal`                     | `type`                      | —                                                                                                                 |
| `authorizesDelegatedAction`                | `function`                  | The function the evidence clause is about: does this grant authorize this action, at this instant, on this clock. |
| `AUTHORIZING_STANDINGS`                    | `enumeration`               | Only one standing authorizes anything. Named so nothing has to remember.                                          |
| `DelegatedAuthorization`                   | `type`                      | —                                                                                                                 |
| `DelegatorStanding.actorId`                | `ActorId`                   | —                                                                                                                 |
| `DelegatorStanding.heldByGrant`            | `string                     | null`                                                                                                             | Set when the delegator's own authority came from a grant.              |
| `DestinationCandidate.actor`               | `ActorRef`                  | —                                                                                                                 |
| `DestinationCandidate.actorId`             | `ActorId`                   | —                                                                                                                 |
| `DestinationCandidate.tenant`              | `TenantId`                  | —                                                                                                                 |
| `DestinationRequirement.tenant`            | `TenantId`                  | —                                                                                                                 |
| `EffectiveActor.grantId`                   | `string`                    | —                                                                                                                 |
| `effectiveActorLabel`                      | `function`                  | How a delegated actor is rendered, everywhere, in one order.                                                      |
| `GRANT_AUTHORITY_FAULTS`                   | `enumeration`               | —                                                                                                                 |
| `GRANT_EVENTS`                             | `enumeration`               | —                                                                                                                 |
| `GRANT_LIFECYCLE_FAULTS`                   | `enumeration`               | —                                                                                                                 |
| `GRANT_SCOPE_FAULTS`                       | `enumeration`               | —                                                                                                                 |
| `GRANT_STANDINGS`                          | `enumeration`               | Where a grant stands, as six values.                                                                              |
| `GrantAuthorityContext.grant`              | `AuthorityGrant`            | —                                                                                                                 |
| `GrantAuthorityFault`                      | `type`                      | —                                                                                                                 |
| `grantAuthorityFaults`                     | `function`                  | Check that the authority being lent was the delegator's to lend (S8.11.e).                                        |
| `GrantEvent`                               | `type`                      | —                                                                                                                 |
| `GrantLifecycleFault`                      | `type`                      | —                                                                                                                 |
| `grantLifecycleFaults`                     | `function`                  | Compare the deployment's accounting with what the register actually says (S8.11.f).                               |
| `grantNotices`                             | `function`                  | Build the notices for one event.                                                                                  |
| `GrantScopeFault`                          | `type`                      | —                                                                                                                 |
| `grantScopeFaults`                         | `function`                  | Judge the grant as written, before anybody's authority is consulted (S8.11.d).                                    |
| `grantStanding`                            | `function`                  | Compute the standing of one grant (S8.11.f).                                                                      |
| `GrantStanding`                            | `type`                      | —                                                                                                                 |
| `HandoffRecord.grantId`                    | `string                     | null`                                                                                                             | Set exactly when the disposition is `for-the-duration-of-a-grant`.     |
| `HandoffTarget.tenant`                     | `TenantId`                  | —                                                                                                                 |
| `PendingWorkRow.soleGroundGrantId`         | `string                     | null`                                                                                                             | The grant this holder's claim rests on. Null when it rests on nothing. |
| `QualificationRecord.grantedAt`            | `Instant`                   | —                                                                                                                 |
| `RecordedAttribution.actorId`              | `ActorId                    | null`                                                                                                             | The id the record is stored under.                                     |
| `RecordedAttribution.grantId`              | `string                     | null`                                                                                                             | —                                                                      |
| `resolveGrant`                             | `function`                  | Look a grant up in the register. A grant is a row, so this can fail.                                              |
| `SCOPE_DIMENSIONS`                         | `enumeration`               | —                                                                                                                 |
| `ScopeDimension`                           | `type`                      | —                                                                                                                 |
| `ScopeSelector`                            | `type`                      | One dimension of a grant's reach.                                                                                 |
| `SURFACES_REQUIRING_BOTH_ACTORS`           | `enumeration`               | Surfaces on which both actors are MANDATORY.                                                                      |
| `sweepGrants`                              | `function`                  | Re-evaluate every pending row against the register, now (S8.11.f).                                                |
| `SweepInput.grants`                        | `readonly AuthorityGrant[]` | —                                                                                                                 |
| `SweepResult.grantId`                      | `string                     | null`                                                                                                             | —                                                                      |

## Idempotency and concurrency

Not applicable: nothing on this page is retried or applied twice: these are
declarations, not operations.

## Pagination

Not applicable: nothing on this page returns a collection a caller reads in
pages.

## State and failure

| Symbol                   | Type           | Notes                                                           |
| ------------------------ | -------------- | --------------------------------------------------------------- |
| `AUTHORIZATION_REFUSALS` | `enumeration`  | —                                                               |
| `AuthorizationRefusal`   | `type`         | —                                                               |
| `DESTINATION_REFUSALS`   | `enumeration`  | —                                                               |
| `DestinationRefusal`     | `type`         | —                                                               |
| `DestinationVerdict`     | `type`         | —                                                               |
| `PART_OUTCOMES`          | `enumeration`  | —                                                               |
| `PartOutcome`            | `type`         | —                                                               |
| `PartResult.outcome`     | `PartOutcome`  | —                                                               |
| `REFUSAL_AXIS`           | `constant`     | Which axis a refusal came from, so a caller can report by axis. |
| `SWEEP_OUTCOMES`         | `enumeration`  | —                                                               |
| `SweepOutcome`           | `type`         | —                                                               |
| `SweepResult.outcome`    | `SweepOutcome` | —                                                               |

## Compatibility

Not applicable: nothing on this page is versioned independently of the package.

## Deprecation

| Symbol                   | Type          | Notes                                                                               |
| ------------------------ | ------------- | ----------------------------------------------------------------------------------- |
| `GRANT_LIFECYCLE_FAULTS` | `enumeration` | —                                                                                   |
| `GrantLifecycleFault`    | `type`        | —                                                                                   |
| `grantLifecycleFaults`   | `function`    | Compare the deployment's accounting with what the register actually says (S8.11.f). |

## Evidence

- `evidence/v1-workbenches/workbench-kit-export-map.json`
- `libs/oshun/workbench-kit/src/reviewer-handoff.ts`
