# Assignments

Why an assignment needs a record of its own rather than a column on the thing
being worked on, which states are lifecycle and which are the clock, why
offering work must not hand over the object, how a deadline survives the two
days a year its own wall clock does not, and what happens to work whose subject
moved underneath it.

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

## Summary

- `src/assignments.ts`

| Entry point                        | Runtime class | Authorized by |
| ---------------------------------- | ------------- | ------------- |
| `@oshun/workbench-kit/assignments` | `contract`    | S8.5          |

## Exports

| Symbol                                                        | Kind        | Summary                                                                                           |
| ------------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------- |
| [ACL_BEARING_STATES](#acl_bearing_states)                     | enumeration | States that put the holder into the object's access control list.                                 |
| [ACTORLESS_CAUSES](#actorless_causes)                         | enumeration | The causes that are the clock's or the object's, and therefore have no actor.                     |
| [AMBIGUITY_POLICIES](#ambiguity_policies)                     | enumeration | Which side to take when a wall clock denotes two instants or none.                                |
| [AmbiguityPolicy](#ambiguitypolicy)                           | type        | —                                                                                                 |
| [ASSIGNMENT_FAULTS](#assignment_faults)                       | constant    | —                                                                                                 |
| [ASSIGNMENT_ORIGINS](#assignment_origins)                     | enumeration | How the holder came to be holding it.                                                             |
| [ASSIGNMENT_PRIORITIES](#assignment_priorities)               | enumeration | Strongest first. The index IS the comparison, as in `notification-center.ts`.                     |
| [ASSIGNMENT_ROLES](#assignment_roles)                         | enumeration | The role the holder holds the work in.                                                            |
| [ASSIGNMENT_SCHEMA_FAULTS](#assignment_schema_faults)         | enumeration | —                                                                                                 |
| [ASSIGNMENT_STANDINGS](#assignment_standings)                 | enumeration | Where an assignment stands against the thing it is about.                                         |
| [ASSIGNMENT_STATES](#assignment_states)                       | enumeration | The lifecycle states, which are EIGHT of the item's ten.                                          |
| [AssignmentFault](#assignmentfault)                           | type        | —                                                                                                 |
| [AssignmentFinding](#assignmentfinding)                       | interface   | —                                                                                                 |
| [AssignmentOrigin](#assignmentorigin)                         | type        | —                                                                                                 |
| [AssignmentPriority](#assignmentpriority)                     | type        | —                                                                                                 |
| [AssignmentRecord](#assignmentrecord)                         | interface   | —                                                                                                 |
| [AssignmentRole](#assignmentrole)                             | type        | —                                                                                                 |
| [AssignmentSchemaFault](#assignmentschemafault)               | type        | —                                                                                                 |
| [assignmentSchemaFaults](#assignmentschemafaults)             | function    | —                                                                                                 |
| [assignmentStanding](#assignmentstanding)                     | function    | Decide where an assignment stands.                                                                |
| [AssignmentStanding](#assignmentstanding)                     | type        | —                                                                                                 |
| [AssignmentState](#assignmentstate)                           | type        | —                                                                                                 |
| [AssignmentSubject](#assignmentsubject)                       | interface   | What the assignment is ABOUT, which is a target at a revision.                                    |
| [CALENDAR_BANDS](#calendar_bands)                             | enumeration | The bands a queue is grouped into, which is where S8.5.f's LOCALE lives.                          |
| [calendarBand](#calendarband)                                 | function    | Which band a deadline falls into for a particular reader.                                         |
| [CalendarBand](#calendarband)                                 | type        | —                                                                                                 |
| [CAUSES_REQUIRING_A_REASON](#causes_requiring_a_reason)       | enumeration | Causes that cannot be recorded without a reason code.                                             |
| [CLOCK_FAULTS](#clock_faults)                                 | enumeration | —                                                                                                 |
| [ClockFault](#clockfault)                                     | type        | —                                                                                                 |
| [ClockSegment](#clocksegment)                                 | interface   | A stretch of the assignment's life, and whether it counts against the SLA.                        |
| [commitDue](#commitdue)                                       | function    | Build a commitment from a wall clock, resolving it once and pinning it.                           |
| [COUNT_BASES](#count_bases)                                   | enumeration | Where the number on the screen came from.                                                         |
| [CountBasis](#countbasis)                                     | type        | —                                                                                                 |
| [countWorkload](#countworkload)                               | function    | —                                                                                                 |
| [derivedAcl](#derivedacl)                                     | function    | Who may touch the object, derived.                                                                |
| [derivedWorkColumns](#derivedworkcolumns)                     | function    | Whose plate it is on, per role, derived.                                                          |
| [DUE_POLICIES_ON_REASSIGN](#due_policies_on_reassign)         | enumeration | What happens to the deadline when work changes hands.                                             |
| [DUE_STANDINGS](#due_standings)                               | enumeration | Where the deadline stands against a moment.                                                       |
| [DueCommitment](#duecommitment)                               | interface   | A deadline, as the three facts it takes to be one.                                                |
| [dueCommitmentFaults](#duecommitmentfaults)                   | function    | Check a commitment against the zone it was made in.                                               |
| [DuePolicyOnReassign](#duepolicyonreassign)                   | type        | —                                                                                                 |
| [dueStanding](#duestanding)                                   | function    | —                                                                                                 |
| [DueStanding](#duestanding)                                   | type        | —                                                                                                 |
| [duplicateWorkFaults](#duplicateworkfaults)                   | function    | Two people doing one job.                                                                         |
| [elapsedCountedMinutes](#elapsedcountedminutes)               | function    | Counted minutes elapsed, which is the only number an SLA is measured in.                          |
| [EntityAssignmentColumns](#entityassignmentcolumns)           | interface   | What the entity row says about assignment, which is the whole of what the storage model can hold. |
| [ESCALATION_CAUSES](#escalation_causes)                       | enumeration | Why work was escalated. The item's five, and they are not interchangeable.                        |
| [ESCALATION_FAULTS](#escalation_faults)                       | enumeration | —                                                                                                 |
| [EscalationCause](#escalationcause)                           | type        | —                                                                                                 |
| [EscalationContext](#escalationcontext)                       | interface   | —                                                                                                 |
| [EscalationFault](#escalationfault)                           | type        | —                                                                                                 |
| [escalationFaults](#escalationfaults)                         | function    | —                                                                                                 |
| [escalationKey](#escalationkey)                               | function    | The deduplication key.                                                                            |
| [EscalationRecord](#escalationrecord)                         | interface   | —                                                                                                 |
| [EscalationTarget](#escalationtarget)                         | interface   | What an escalation is aimed at.                                                                   |
| [escalationTargetDependency](#escalationtargetdependency)     | function    | —                                                                                                 |
| [everAssigned](#everassigned)                                 | function    | Everybody who has ever held an assignment on this object.                                         |
| [extendByCalendarDays](#extendbycalendardays)                 | function    | Move a deadline by whole calendar days, keeping the wall clock.                                   |
| [extensionFaults](#extensionfaults)                           | function    | Whether an extension was computed on the calendar or on a stopwatch.                              |
| [ExtensionRecord](#extensionrecord)                           | interface   | A deadline moved, which is a renegotiation and not a measurement.                                 |
| [formatWallClock](#formatwallclock)                           | function    | —                                                                                                 |
| [HANDOVER_NOTICE_KEYS](#handover_notice_keys)                 | constant    | —                                                                                                 |
| [HandoverGrant](#handovergrant)                               | interface   | What the outgoing holder keeps, and for how long.                                                 |
| [handoverNoticeFaults](#handovernoticefaults)                 | function    | —                                                                                                 |
| [handoverNotices](#handovernotices)                           | function    | Build the two notices.                                                                            |
| [HandoverNotices](#handovernotices)                           | interface   | What each side is told, and they are not the same sentence.                                       |
| [HostStateModel](#hoststatemodel)                             | interface   | What a host says its own state column holds.                                                      |
| [hostStateModelFaults](#hoststatemodelfaults)                 | function    | —                                                                                                 |
| [instantOfWallClock](#instantofwallclock)                     | function    | Resolve a wall clock in a zone to the instant or instants it denotes.                             |
| [isCrossAssigneeQuery](#iscrossassigneequery)                 | function    | True where the query reads somebody else's plate.                                                 |
| [isKnownZone](#isknownzone)                                   | function    | Whether the platform knows this zone at all.                                                      |
| [isTerminal](#isterminal)                                     | function    | —                                                                                                 |
| [JUDGING_ROLES](#judging_roles)                               | enumeration | Roles whose holder makes a JUDGEMENT, and which S8.1 therefore governs.                           |
| [KINDS_THAT_MAY_NOT_HOLD_WORK](#kinds_that_may_not_hold_work) | enumeration | Actor kinds that may not hold an obligation, WHICH IS NOT S8.1'S LIST.                            |
| [ledgerHeadline](#ledgerheadline)                             | function    | One sentence about a queue.                                                                       |
| [LedgerSummary](#ledgersummary)                               | interface   | —                                                                                                 |
| [liveAssignments](#liveassignments)                           | function    | The live assignments in a ledger, in ledger order.                                                |
| [NOTICE_FAULTS](#notice_faults)                               | enumeration | —                                                                                                 |
| [NoticeFault](#noticefault)                                   | type        | —                                                                                                 |
| [obligationAuthorityOf](#obligationauthorityof)               | function    | The authority behind an act, which for a delegated actor is the person whose authority was used.  |
| [OFFER_DISCLOSURE_FIELDS](#offer_disclosure_fields)           | enumeration | What somebody may see about work they have been offered and not accepted.                         |
| [OFFER_FAULTS](#offer_faults)                                 | enumeration | —                                                                                                 |
| [OfferDisclosure](#offerdisclosure)                           | interface   | —                                                                                                 |
| [offerDisclosureFaults](#offerdisclosurefaults)               | function    | —                                                                                                 |
| [OfferDisclosureField](#offerdisclosurefield)                 | type        | —                                                                                                 |
| [OfferFault](#offerfault)                                     | type        | —                                                                                                 |
| [pauseFaults](#pausefaults)                                   | function    | Check the measuring clock, and that it did not touch the promise.                                 |
| [PauseObservation](#pauseobservation)                         | interface   | What a host says happened when it paused something.                                               |
| [priorityAtLeast](#priorityatleast)                           | function    | True when `priority` is at least as urgent as `threshold`.                                        |
| [priorityRank](#priorityrank)                                 | function    | —                                                                                                 |
| [PROJECTION_FAULTS](#projection_faults)                       | enumeration | —                                                                                                 |
| [ProjectionFault](#projectionfault)                           | type        | —                                                                                                 |
| [projectionFaults](#projectionfaults)                         | function    | Check the entity's columns against the ledger, in both directions.                                |
| [reachableFrom](#reachablefrom)                               | function    | The states reachable from `state`.                                                                |
| [Reassignment](#reassignment)                                 | interface   | —                                                                                                 |
| [REASSIGNMENT_FAULTS](#reassignment_faults)                   | enumeration | —                                                                                                 |
| [ReassignmentFault](#reassignmentfault)                       | type        | —                                                                                                 |
| [reassignmentFaults](#reassignmentfaults)                     | function    | —                                                                                                 |
| [RECONCILIATION_FAULTS](#reconciliation_faults)               | enumeration | —                                                                                                 |
| [ReconciliationContext](#reconciliationcontext)               | interface   | —                                                                                                 |
| [ReconciliationFault](#reconciliationfault)                   | type        | —                                                                                                 |
| [reconciliationFaults](#reconciliationfaults)                 | function    | —                                                                                                 |
| [ReconciliationObservation](#reconciliationobservation)       | interface   | —                                                                                                 |
| [reminderFaults](#reminderfaults)                             | function    | Check a reminder schedule against the deadline it is for.                                         |
| [ReminderRule](#reminderrule)                                 | type        | How a reminder is expressed, and the two are different rules.                                     |
| [ROLE_COLUMNS](#role_columns)                                 | constant    | Roles that occupy a work column on the entity, and which column.                                  |
| [ScheduledReminder](#scheduledreminder)                       | interface   | —                                                                                                 |
| [scheduleReminders](#schedulereminders)                       | function    | Resolve a reminder schedule against a commitment.                                                 |
| [SLA_STANDINGS](#sla_standings)                               | enumeration | —                                                                                                 |
| [SlaClass](#slaclass)                                         | interface   | —                                                                                                 |
| [slaStanding](#slastanding)                                   | function    | —                                                                                                 |
| [SlaStanding](#slastanding)                                   | type        | —                                                                                                 |
| [STATE_MODEL_FAULTS](#state_model_faults)                     | enumeration | —                                                                                                 |
| [StateEvent](#stateevent)                                     | interface   | One state change, with who made it and why.                                                       |
| [StateModelFault](#statemodelfault)                           | type        | —                                                                                                 |
| [summarizeLedger](#summarizeledger)                           | function    | —                                                                                                 |
| [TERMINAL_STATES](#terminal_states)                           | enumeration | States after which nothing further may be recorded against this record.                           |
| [TRANSITION_AUTHORITIES](#transition_authorities)             | enumeration | Who may make a transition.                                                                        |
| [TRANSITION_CAUSES](#transition_causes)                       | enumeration | Why a transition happened.                                                                        |
| [TRANSITION_FAULTS](#transition_faults)                       | enumeration | —                                                                                                 |
| [TransitionAttempt](#transitionattempt)                       | interface   | One proposed transition, with everything the authorization needs.                                 |
| [TransitionAuthority](#transitionauthority)                   | type        | —                                                                                                 |
| [TransitionCause](#transitioncause)                           | type        | —                                                                                                 |
| [TransitionFault](#transitionfault)                           | type        | —                                                                                                 |
| [transitionFaults](#transitionfaults)                         | function    | Check one transition.                                                                             |
| [transitionRule](#transitionrule)                             | function    | Whether an edge exists at all.                                                                    |
| [TransitionRule](#transitionrule)                             | interface   | —                                                                                                 |
| [TRANSITIONS](#transitions)                                   | constant    | The edges, as data.                                                                               |
| [WallClock](#wallclock)                                       | interface   | A wall clock: what a person means by "five o'clock".                                              |
| [WeekShape](#weekshape)                                       | interface   | Which day a locale's week starts on, and which days it does not work.                             |
| [weekShapeFor](#weekshapefor)                                 | function    | The week shape for a locale, or null where the platform does not know it.                         |
| [WORKLOAD_FAULTS](#workload_faults)                           | enumeration | —                                                                                                 |
| [WorkloadCount](#workloadcount)                               | interface   | A workload count, computed the only way decision 7 permits.                                       |
| [WorkloadFault](#workloadfault)                               | type        | —                                                                                                 |
| [workloadFaults](#workloadfaults)                             | function    | —                                                                                                 |
| [WorkloadQuery](#workloadquery)                               | interface   | A workload query, and the field that decides whether it is an inbox.                              |
| [WorkloadRow](#workloadrow)                                   | interface   | One row a workload view is counting, with what the reader may do with it.                         |
| [WorkloadView](#workloadview)                                 | interface   | —                                                                                                 |
| [ZONE_RESOLUTIONS](#zone_resolutions)                         | enumeration | What a wall clock denotes in a zone, which twice a year is not one instant.                       |
| [ZonedInstant](#zonedinstant)                                 | interface   | —                                                                                                 |
| [zonedWallClock](#zonedwallclock)                             | function    | The wall clock an instant shows on, in a named zone.                                              |
| [zoneOffsetMinutesAt](#zoneoffsetminutesat)                   | function    | A zone's offset from UTC at a given moment, in whole minutes.                                     |
| [ZoneResolution](#zoneresolution)                             | type        | —                                                                                                 |

## Shapes

#### ACL_BEARING_STATES

States that put the holder into the object's access control list.

Values: `accepted`, `active`, `blocked`

#### ACTORLESS_CAUSES

The causes that are the clock's or the object's, and therefore have no actor.

Values: `offer-lapsed`, `target-withdrawn`

#### AMBIGUITY_POLICIES

Which side to take when a wall clock denotes two instants or none.

Values: `earlier`, `later`

#### AmbiguityPolicy

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

#### ASSIGNMENT_FAULTS

#### ASSIGNMENT_ORIGINS

How the holder came to be holding it.

Values: `offered`, `directed`, `claimed`, `escalated`, `reassigned`

#### ASSIGNMENT_PRIORITIES

Strongest first. The index IS the comparison, as in `notification-center.ts`.

Values: `critical`, `high`, `normal`, `low`

#### ASSIGNMENT_ROLES

The role the holder holds the work in.

Values: `worker`, `reviewer`, `approver`, `publisher`, `observer`

#### ASSIGNMENT_SCHEMA_FAULTS

Values: `assignment-with-no-identity`, `assignment-that-names-no-revision`,
`assignment-to-an-actor-kind-that-cannot-hold-an-obligation`,
`assignment-with-no-assigner-that-was-not-claimed`,
`claimed-assignment-carrying-an-assigner`,
`state-that-the-history-does-not-end-in`, `history-out-of-order`,
`history-that-does-not-start-at-creation`, `blocked-with-no-blocker`,
`blocker-recorded-on-an-unblocked-assignment`,
`assignee-who-is-not-in-the-pool-they-were-drawn-from`,
`assignment-carrying-a-successor-link-it-is-not-terminal-for`,
`overdue-escalation-on-an-assignment-nobody-ever-accepted`,
`state-entered-at-that-disagrees-with-the-history`

#### ASSIGNMENT_STANDINGS

Where an assignment stands against the thing it is about.

Values: `current`, `stale`, `void`, `orphaned`

#### ASSIGNMENT_STATES

The lifecycle states, which are EIGHT of the item's ten.

Values: `offered`, `accepted`, `active`, `blocked`, `completed`, `declined`,
`cancelled`, `reassigned`

#### AssignmentFault

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

#### AssignmentFinding

| Field     | Type                                | Required | Notes                                                             |
| --------- | ----------------------------------- | -------- | ----------------------------------------------------------------- |
| `kind`    | [AssignmentFault](#assignmentfault) | required | —                                                                 |
| `subject` | `string`                            | required | The assignment, entity, query or escalation the finding is about. |
| `detail`  | `string`                            | required | —                                                                 |

#### AssignmentOrigin

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

#### AssignmentPriority

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

#### AssignmentRecord

| Field            | Type                                                                  | Required | Notes                                                           |
| ---------------- | --------------------------------------------------------------------- | -------- | --------------------------------------------------------------- |
| `assignmentId`   | `string`                                                              | required | —                                                               |
| `tenant`         | [TenantId](./identity.md#tenantid)                                    | required | —                                                               |
| `workspace`      | `string \| null`                                                      | required | —                                                               |
| `subject`        | [AssignmentSubject](#assignmentsubject)                               | required | —                                                               |
| `role`           | [AssignmentRole](#assignmentrole)                                     | required | —                                                               |
| `origin`         | [AssignmentOrigin](#assignmentorigin)                                 | required | —                                                               |
| `assignee`       | [ActorRef](./identity.md#actorref)                                    | required | The person the obligation is on.                                |
| `eligiblePool`   | `readonly ActorId[]` — [ActorId](./identity.md#actorid)               | required | The pool the assignee was drawn from, where one was.            |
| `assigner`       | `ActorRef \| null` — [ActorRef](./identity.md#actorref)               | required | Who put it there. Null only where the origin is `claimed`.      |
| `priority`       | [AssignmentPriority](#assignmentpriority)                             | required | —                                                               |
| `state`          | [AssignmentState](#assignmentstate)                                   | required | —                                                               |
| `history`        | `readonly StateEvent[]` — [StateEvent](#stateevent)                   | required | Oldest first, and the last entry's `to` must be .               |
| `createdAt`      | [Instant](./identity.md#instant)                                      | required | —                                                               |
| `stateEnteredAt` | [Instant](./identity.md#instant)                                      | required | When the current state was entered.                             |
| `due`            | `DueCommitment \| null` — [DueCommitment](#duecommitment)             | required | —                                                               |
| `slaClassId`     | `string \| null`                                                      | required | —                                                               |
| `supersedes`     | `string \| null`                                                      | required | The assignment this one replaced, where it replaced one.        |
| `escalations`    | `readonly EscalationRecord[]` — [EscalationRecord](#escalationrecord) | required | The escalations raised against it. Empty is the ordinary case.  |
| `blockedOn`      | `string \| null`                                                      | required | What the holder is waiting on, required by the `blocked` state. |

#### AssignmentRole

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

#### AssignmentSchemaFault

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

#### assignmentSchemaFaults

```ts
assignmentSchemaFaults(record: AssignmentRecord): readonly AssignmentFinding[]
```

#### assignmentStanding

Decide where an assignment stands.

```ts
assignmentStanding(context: ReconciliationContext): AssignmentStanding
```

#### AssignmentStanding

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

#### AssignmentState

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

#### AssignmentSubject

What the assignment is ABOUT, which is a target at a revision.

| Field      | Type                                   | Required | Notes                                               |
| ---------- | -------------------------------------- | -------- | --------------------------------------------------- |
| `targetId` | `string`                               | required | —                                                   |
| `revision` | [RevisionId](./identity.md#revisionid) | required | —                                                   |
| `askId`    | `string \| null`                       | required | The specific ask, where the target carries several. |

#### CALENDAR_BANDS

The bands a queue is grouped into, which is where S8.5.f's LOCALE lives.

Values: `overdue`, `today`, `this-week`, `later`

#### calendarBand

Which band a deadline falls into for a particular reader.

```ts
calendarBand(due: DueCommitment, now: Instant, readerZone: string, week: WeekShape): CalendarBand
```

#### CalendarBand

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

#### CAUSES_REQUIRING_A_REASON

Causes that cannot be recorded without a reason code.

Values: `target-withdrawn`, `escalation-reassigned-it`

#### CLOCK_FAULTS

Values: `due-instant-that-no-longer-matches-its-wall-clock`,
`due-commitment-in-a-zone-the-platform-does-not-know`,
`deadline-set-for-a-wall-clock-that-does-not-exist`,
`deadline-set-for-a-wall-clock-that-happens-twice`,
`extension-computed-as-fixed-hours-across-a-transition`,
`reminder-that-fires-after-the-deadline`, `reminder-scheduled-into-a-gap`,
`open-clock-segment-that-is-not-the-last`, `overlapping-clock-segments`,
`pause-with-no-reason`, `pause-that-moved-the-promise`,
`deadline-moved-with-no-extension-record`, `extension-with-no-authority`

#### ClockFault

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

#### ClockSegment

A stretch of the assignment's life, and whether it counts against the SLA.

| Field        | Type                                                 | Required | Notes                                                               |
| ------------ | ---------------------------------------------------- | -------- | ------------------------------------------------------------------- |
| `from`       | [Instant](./identity.md#instant)                     | required | —                                                                   |
| `to`         | `Instant \| null` — [Instant](./identity.md#instant) | required | Null for the segment that is still running, which must be the last. |
| `counted`    | `boolean`                                            | required | —                                                                   |
| `reasonCode` | `string \| null`                                     | required | Required on an uncounted segment. Why the clock stopped.            |

#### commitDue

Build a commitment from a wall clock, resolving it once and pinning it.

```ts
commitDue(wall: WallClock, zone: string, policy: AmbiguityPolicy): DueCommitment
```

#### COUNT_BASES

Where the number on the screen came from.

Values: `after-the-reader-filter`, `before-the-reader-filter`

#### CountBasis

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

#### countWorkload

```ts
countWorkload(rows: readonly WorkloadRow[]): WorkloadCount
```

#### derivedAcl

Who may touch the object, derived.

```ts
derivedAcl(ledger: readonly AssignmentRecord[]): readonly ActorId[]
```

#### derivedWorkColumns

Whose plate it is on, per role, derived.

```ts
derivedWorkColumns(ledger: readonly AssignmentRecord[]): Readonly<Record<string, ActorId | null>>
```

#### DUE_POLICIES_ON_REASSIGN

What happens to the deadline when work changes hands.

Values: `inherit`, `reset`, `renegotiate`

#### DUE_STANDINGS

Where the deadline stands against a moment.

Values: `no-deadline`, `not-due`, `due-soon`, `overdue`

#### DueCommitment

A deadline, as the three facts it takes to be one.

| Field             | Type                                | Required | Notes                                                                  |
| ----------------- | ----------------------------------- | -------- | ---------------------------------------------------------------------- |
| `wall`            | [WallClock](#wallclock)             | required | —                                                                      |
| `zone`            | `string`                            | required | An IANA zone name. The zone the promise was made in, not the reader's. |
| `instant`         | [Instant](./identity.md#instant)    | required | —                                                                      |
| `resolution`      | [ZoneResolution](#zoneresolution)   | required | —                                                                      |
| `ambiguityPolicy` | [AmbiguityPolicy](#ambiguitypolicy) | required | —                                                                      |

#### dueCommitmentFaults

Check a commitment against the zone it was made in.

```ts
dueCommitmentFaults(due: DueCommitment): readonly AssignmentFinding[]
```

#### DuePolicyOnReassign

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

#### dueStanding

```ts
dueStanding(due: DueCommitment | null, now: Instant, soonWithinMinutes: number): DueStanding
```

#### DueStanding

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

#### duplicateWorkFaults

Two people doing one job.

```ts
duplicateWorkFaults(ledger: readonly AssignmentRecord[]): readonly AssignmentFinding[]
```

#### elapsedCountedMinutes

Counted minutes elapsed, which is the only number an SLA is measured in.

```ts
elapsedCountedMinutes(segments: readonly ClockSegment[], now: Instant): number
```

#### EntityAssignmentColumns

What the entity row says about assignment, which is the whole of what the
storage model can hold.

| Field        | Type                                                    | Required | Notes                                                  |
| ------------ | ------------------------------------------------------- | -------- | ------------------------------------------------------ |
| `entityId`   | `string`                                                | required | —                                                      |
| `assigneeId` | `ActorId \| null` — [ActorId](./identity.md#actorid)    | required | —                                                      |
| `reviewerId` | `ActorId \| null` — [ActorId](./identity.md#actorid)    | required | —                                                      |
| `openState`  | `'open' \| 'closed'`                                    | required | The two-valued flag `wbe_assignee_open` is partial on. |
| `assignees`  | `readonly ActorId[]` — [ActorId](./identity.md#actorid) | required | `authorization.ts`'s plural list: who may touch it.    |

#### ESCALATION_CAUSES

Why work was escalated. The item's five, and they are not interchangeable.

Values: `overdue`, `declined`, `blocked`, `unavailable`, `policy-triggered`

#### ESCALATION_FAULTS

Values: `escalation-that-granted-access-a-clock-decided`,
`escalation-to-a-target-with-no-eligibility-answer`,
`escalation-to-a-derived-target-that-was-not-pinned`,
`escalation-pinned-to-nobody`, `duplicate-escalation-under-one-key`,
`escalation-of-a-terminal-assignment`, `escalation-that-moved-the-deadline`,
`escalation-back-to-the-person-who-is-stuck`,
`overdue-escalation-with-no-deadline`,
`unavailability-escalation-to-an-unavailable-target`,
`blocked-escalation-that-does-not-name-the-blocker`

#### EscalationCause

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

#### EscalationContext

| Field             | Type                                                                                              | Required | Notes                                                        |
| ----------------- | ------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------ |
| `record`          | [AssignmentRecord](#assignmentrecord)                                                             | required | —                                                            |
| `escalation`      | [EscalationRecord](#escalationrecord)                                                             | required | —                                                            |
| `alreadyRaised`   | `readonly string[]`                                                                               | required | Keys already raised, so a repeat is visible.                 |
| `targetStandings` | `Readonly<Record<string, IdentityStanding>>` — [IdentityStanding](./mentions.md#identitystanding) | required | The standing of each pinned person, where the host knows it. |
| `now`             | [Instant](./identity.md#instant)                                                                  | required | —                                                            |

#### EscalationFault

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

#### escalationFaults

```ts
escalationFaults(context: EscalationContext): readonly AssignmentFinding[]
```

#### escalationKey

The deduplication key.

```ts
escalationKey(record: EscalationRecord): string
```

#### EscalationRecord

| Field               | Type                                                 | Required | Notes                                                                        |
| ------------------- | ---------------------------------------------------- | -------- | ---------------------------------------------------------------------------- |
| `escalationId`      | `string`                                             | required | —                                                                            |
| `assignmentId`      | `string`                                             | required | —                                                                            |
| `cause`             | [EscalationCause](#escalationcause)                  | required | —                                                                            |
| `at`                | [Instant](./identity.md#instant)                     | required | —                                                                            |
| `target`            | [EscalationTarget](#escalationtarget)                | required | —                                                                            |
| `generation`        | `number`                                             | required | The generation of the situation this escalation is about.                    |
| `targetEligibility` | `string \| null`                                     | required | S8.1's eligibility answer for the target on this seat, or null.              |
| `dueAtEscalation`   | `Instant \| null` — [Instant](./identity.md#instant) | required | The due commitment at the moment of escalation. Escalating does not move it. |

#### EscalationTarget

What an escalation is aimed at.

| Field       | Type                                                                            | Required | Notes                                                                 |
| ----------- | ------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------- |
| `kind`      | [MentionSubjectKind](./mentions.md#mentionsubjectkind)                          | required | —                                                                     |
| `subjectId` | `string`                                                                        | required | —                                                                     |
| `pinned`    | `readonly PinnedRecipient[]` — [PinnedRecipient](./mentions.md#pinnedrecipient) | required | The people the target resolved to, pinned at the instant it resolved. |

#### escalationTargetDependency

```ts
escalationTargetDependency(target: EscalationTarget): ResolutionDependency
```

#### everAssigned

Everybody who has ever held an assignment on this object.

```ts
everAssigned(ledger: readonly AssignmentRecord[]): readonly ActorId[]
```

#### extendByCalendarDays

Move a deadline by whole calendar days, keeping the wall clock.

```ts
extendByCalendarDays(due: DueCommitment, days: number): DueCommitment
```

#### extensionFaults

Whether an extension was computed on the calendar or on a stopwatch.

```ts
extensionFaults(before: DueCommitment, after: DueCommitment, intendedCalendarDays: number): readonly AssignmentFinding[]
```

#### ExtensionRecord

A deadline moved, which is a renegotiation and not a measurement.

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

#### formatWallClock

```ts
formatWallClock(wall: WallClock): string
```

#### HANDOVER_NOTICE_KEYS

#### HandoverGrant

What the outgoing holder keeps, and for how long.

| Field        | Type                             | Required | Notes |
| ------------ | -------------------------------- | -------- | ----- |
| `actor`      | [ActorId](./identity.md#actorid) | required | —     |
| `until`      | [Instant](./identity.md#instant) | required | —     |
| `reasonCode` | `string`                         | required | —     |

#### handoverNoticeFaults

```ts
handoverNoticeFaults(notices: HandoverNotices): readonly AssignmentFinding[]
```

#### handoverNotices

Build the two notices.

```ts
handoverNotices(): HandoverNotices
```

#### HandoverNotices

What each side is told, and they are not the same sentence.

| Field        | Type                                                                                                         | Required | Notes |
| ------------ | ------------------------------------------------------------------------------------------------------------ | -------- | ----- |
| `toOutgoing` | `{ readonly key: string; readonly carriesTheReason: boolean; }`                                              | required | —     |
| `toIncoming` | `{ readonly key: string; readonly carriesTheReason: boolean; readonly carriesThePredecessorName: boolean; }` | required | —     |

#### HostStateModel

What a host says its own state column holds.

| Field                      | Type                | Required | Notes                                                       |
| -------------------------- | ------------------- | -------- | ----------------------------------------------------------- |
| `declaredStates`           | `readonly string[]` | required | —                                                           |
| `overdueIsDerived`         | `boolean`           | required | True where the host derives overdue rather than storing it. |
| `escalationIsItsOwnRecord` | `boolean`           | required | True where the host keeps escalations as their own records. |

#### hostStateModelFaults

```ts
hostStateModelFaults(model: HostStateModel): readonly AssignmentFinding[]
```

#### instantOfWallClock

Resolve a wall clock in a zone to the instant or instants it denotes.

```ts
instantOfWallClock(wall: WallClock, zone: string, policy: AmbiguityPolicy): ZonedInstant
```

#### isCrossAssigneeQuery

True where the query reads somebody else's plate.

```ts
isCrossAssigneeQuery(query: WorkloadQuery): boolean
```

#### isKnownZone

Whether the platform knows this zone at all.

```ts
isKnownZone(zone: string): boolean
```

#### isTerminal

```ts
isTerminal(state: AssignmentState): boolean
```

#### JUDGING_ROLES

Roles whose holder makes a JUDGEMENT, and which S8.1 therefore governs.

Values: `reviewer`, `approver`, `publisher`

#### KINDS_THAT_MAY_NOT_HOLD_WORK

Actor kinds that may not hold an obligation, WHICH IS NOT S8.1'S LIST.

Values: `redacted`, `delegated`

#### ledgerHeadline

One sentence about a queue.

```ts
ledgerHeadline(summary: LedgerSummary): string
```

#### LedgerSummary

| Field               | Type                                                                              | Required | Notes                                   |
| ------------------- | --------------------------------------------------------------------------------- | -------- | --------------------------------------- |
| `total`             | `number`                                                                          | required | —                                       |
| `live`              | `number`                                                                          | required | —                                       |
| `terminal`          | `number`                                                                          | required | —                                       |
| `byState`           | `Readonly<Record<AssignmentState, number>>` — [AssignmentState](#assignmentstate) | required | —                                       |
| `overdue`           | `number`                                                                          | required | —                                       |
| `escalated`         | `number`                                                                          | required | —                                       |
| `peopleHoldingWork` | `number`                                                                          | required | Distinct authorities holding live work. |

#### liveAssignments

The live assignments in a ledger, in ledger order.

```ts
liveAssignments(ledger: readonly AssignmentRecord[]): readonly AssignmentRecord[]
```

#### NOTICE_FAULTS

Values: `handover-that-tells-the-successor-why-the-last-person-lost-it`,
`handover-that-does-not-tell-the-outgoing-holder-at-all`

#### NoticeFault

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

#### obligationAuthorityOf

The authority behind an act, which for a delegated actor is the person whose
authority was used.

```ts
obligationAuthorityOf(actor: ActorRef): string
```

#### OFFER_DISCLOSURE_FIELDS

What somebody may see about work they have been offered and not accepted.

Values: `target-kind`, `role`, `priority`, `due-standing`, `estimated-effort`,
`assigner`

#### OFFER_FAULTS

Values: `offer-that-grants-the-object-before-acceptance`,
`offer-carrying-a-field-that-is-not-in-the-disclosure-set`,
`offer-with-nothing-to-decide-on`

#### OfferDisclosure

| Field               | Type                | Required | Notes                                                            |
| ------------------- | ------------------- | -------- | ---------------------------------------------------------------- |
| `assignmentId`      | `string`            | required | —                                                                |
| `fields`            | `readonly string[]` | required | —                                                                |
| `grantsObjectRead`  | `boolean`           | required | Whether the offeree can open the object itself before accepting. |
| `targetIsProtected` | `boolean`           | required | Whether the object is one only assigned actors may reach.        |

#### offerDisclosureFaults

```ts
offerDisclosureFaults(offer: OfferDisclosure): readonly AssignmentFinding[]
```

#### OfferDisclosureField

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

#### OfferFault

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

#### pauseFaults

Check the measuring clock, and that it did not touch the promise.

```ts
pauseFaults(observation: PauseObservation): readonly AssignmentFinding[]
```

#### PauseObservation

What a host says happened when it paused something.

| Field          | Type                                                            | Required | Notes                                                            |
| -------------- | --------------------------------------------------------------- | -------- | ---------------------------------------------------------------- |
| `assignmentId` | `string`                                                        | required | —                                                                |
| `segments`     | `readonly ClockSegment[]` — [ClockSegment](#clocksegment)       | required | —                                                                |
| `dueBefore`    | `DueCommitment \| null` — [DueCommitment](#duecommitment)       | required | The commitment before the pause, and after it.                   |
| `dueAfter`     | `DueCommitment \| null` — [DueCommitment](#duecommitment)       | required | —                                                                |
| `extension`    | `ExtensionRecord \| null` — [ExtensionRecord](#extensionrecord) | required | The authorized extension that moved the deadline, where one did. |

#### priorityAtLeast

True when `priority` is at least as urgent as `threshold`.

```ts
priorityAtLeast(priority: AssignmentPriority, threshold: AssignmentPriority): boolean
```

#### priorityRank

```ts
priorityRank(priority: AssignmentPriority): number
```

#### PROJECTION_FAULTS

Values: `two-live-assignments-in-one-role`,
`work-column-that-no-live-assignment-supports`,
`live-assignment-missing-from-its-work-column`,
`observer-projected-into-a-work-column`,
`offered-assignment-projected-into-the-acl`, `acl-that-omits-a-live-holder`,
`acl-carrying-somebody-with-no-live-assignment`,
`open-flag-that-disagrees-with-the-ledger`

#### ProjectionFault

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

#### projectionFaults

Check the entity's columns against the ledger, in both directions.

```ts
projectionFaults(ledger: readonly AssignmentRecord[], columns: EntityAssignmentColumns): readonly AssignmentFinding[]
```

#### reachableFrom

The states reachable from `state`.

```ts
reachableFrom(state: AssignmentState): readonly AssignmentState[]
```

#### Reassignment

| Field               | Type                                                      | Required | Notes                                                               |
| ------------------- | --------------------------------------------------------- | -------- | ------------------------------------------------------------------- |
| `from`              | [AssignmentRecord](#assignmentrecord)                     | required | —                                                                   |
| `to`                | [AssignmentRecord](#assignmentrecord)                     | required | —                                                                   |
| `at`                | [Instant](./identity.md#instant)                          | required | —                                                                   |
| `by`                | [ActorRef](./identity.md#actorref)                        | required | —                                                                   |
| `reasonCode`        | `string`                                                  | required | —                                                                   |
| `duePolicy`         | [DuePolicyOnReassign](#duepolicyonreassign)               | required | —                                                                   |
| `handover`          | `HandoverGrant \| null` — [HandoverGrant](#handovergrant) | required | —                                                                   |
| `outgoingLeftInAcl` | `boolean`                                                 | required | Whether the outgoing holder was left in the object's assignee list. |

#### REASSIGNMENT_FAULTS

Values: `reassignment-that-did-not-terminate-its-predecessor`,
`successor-that-does-not-name-its-predecessor`,
`successor-that-changed-the-work`, `reassignment-with-no-reason`,
`reassignment-to-the-same-authority`,
`inherited-deadline-that-was-silently-moved`,
`reset-deadline-that-kept-the-old-instant`,
`renegotiated-deadline-that-was-left-as-a-commitment`,
`outgoing-access-left-as-a-stale-list-entry`, `handover-grant-with-no-end`,
`reassignment-that-restarted-the-sla-without-saying-so`

#### ReassignmentFault

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

#### reassignmentFaults

```ts
reassignmentFaults(move: Reassignment): readonly AssignmentFinding[]
```

#### RECONCILIATION_FAULTS

Values: `ghost-work-left-live-against-a-target-that-is-gone`,
`stale-assignment-presented-as-current`,
`orphaned-assignment-closed-instead-of-reassigned`,
`duplicate-live-assignments-for-one-ask`,
`assignment-whose-revision-is-ahead-of-the-target`,
`reconciliation-that-did-not-look-at-the-change`,
`void-assignment-whose-holder-was-never-told`

#### ReconciliationContext

| Field                 | Type                                               | Required | Notes                                                                    |
| --------------------- | -------------------------------------------------- | -------- | ------------------------------------------------------------------------ |
| `record`              | [AssignmentRecord](#assignmentrecord)              | required | —                                                                        |
| `targetRevision`      | [RevisionId](./identity.md#revisionid)             | required | The revision the target is at now.                                       |
| `changeTouchedTheAsk` | `boolean \| null`                                  | required | Whether the change since the assignment touched what was asked about.    |
| `askStillExists`      | `boolean`                                          | required | Whether the ask still exists on the target.                              |
| `targetExists`        | `boolean`                                          | required | Whether the target itself is still there.                                |
| `requiringGateOpen`   | `boolean \| null`                                  | required | The gate or stage that required this work, and whether it is still open. |
| `assigneeStanding`    | [IdentityStanding](./mentions.md#identitystanding) | required | —                                                                        |
| `repeatOnChange`      | `boolean \| null`                                  | required | S8.1's `repeatOnChange` for the stage this assignment serves, if any.    |

#### ReconciliationFault

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

#### reconciliationFaults

```ts
reconciliationFaults(observation: ReconciliationObservation): readonly AssignmentFinding[]
```

#### ReconciliationObservation

| Field           | Type                                            | Required | Notes                                                         |
| --------------- | ----------------------------------------------- | -------- | ------------------------------------------------------------- |
| `context`       | [ReconciliationContext](#reconciliationcontext) | required | —                                                             |
| `hostStanding`  | [AssignmentStanding](#assignmentstanding)       | required | What the host did with it.                                    |
| `holderWasTold` | `boolean`                                       | required | Whether the holder was told, where the standing calls for it. |

#### reminderFaults

Check a reminder schedule against the deadline it is for.

```ts
reminderFaults(due: DueCommitment, reminders: readonly ScheduledReminder[]): readonly AssignmentFinding[]
```

#### ReminderRule

How a reminder is expressed, and the two are different rules.

```ts
| { readonly kind: 'before-by-duration'; readonly minutes: number }
| { readonly kind: 'wall-clock-days-before'; readonly days: number; readonly hour: number; readonly minute: number; }
```

#### ROLE_COLUMNS

Roles that occupy a work column on the entity, and which column.

#### ScheduledReminder

| Field        | Type                              | Required | Notes |
| ------------ | --------------------------------- | -------- | ----- |
| `rule`       | [ReminderRule](#reminderrule)     | required | —     |
| `at`         | [Instant](./identity.md#instant)  | required | —     |
| `resolution` | [ZoneResolution](#zoneresolution) | required | —     |

#### scheduleReminders

Resolve a reminder schedule against a commitment.

```ts
scheduleReminders(due: DueCommitment, rules: readonly ReminderRule[]): readonly ScheduledReminder[]
```

#### SLA_STANDINGS

Values: `within`, `at-risk`, `breached`

#### SlaClass

| Field            | Type     | Required | Notes                                                         |
| ---------------- | -------- | -------- | ------------------------------------------------------------- |
| `slaClassId`     | `string` | required | —                                                             |
| `budgetMinutes`  | `number` | required | The budget, in counted minutes.                               |
| `warnAtFraction` | `number` | required | How much of the budget may be used before the SLA is at risk. |

#### slaStanding

```ts
slaStanding(sla: SlaClass, segments: readonly ClockSegment[], now: Instant): SlaStanding
```

#### SlaStanding

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

#### STATE_MODEL_FAULTS

Values: `state-column-carrying-a-clock-fact`,
`state-column-carrying-an-escalation-flag`,
`state-vocabulary-missing-a-lifecycle-state`,
`state-model-that-is-a-boolean-flag`

#### StateEvent

One state change, with who made it and why.

| Field        | Type                                                    | Required | Notes                                                                  |
| ------------ | ------------------------------------------------------- | -------- | ---------------------------------------------------------------------- |
| `at`         | [Instant](./identity.md#instant)                        | required | —                                                                      |
| `to`         | [AssignmentState](#assignmentstate)                     | required | —                                                                      |
| `by`         | `ActorRef \| null` — [ActorRef](./identity.md#actorref) | required | Who made it, or null for a lapse.                                      |
| `cause`      | [TransitionCause](#transitioncause)                     | required | —                                                                      |
| `reasonCode` | `string \| null`                                        | required | A reason code, never a sentence. Required where the cause demands one. |

#### StateModelFault

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

#### summarizeLedger

```ts
summarizeLedger(ledger: readonly AssignmentRecord[], now: Instant, soonWithinMinutes: number): LedgerSummary
```

#### TERMINAL_STATES

States after which nothing further may be recorded against this record.

Values: `completed`, `declined`, `cancelled`, `reassigned`

#### TRANSITION_AUTHORITIES

Who may make a transition.

Values: `the-assignee`, `the-assigner`, `an-escalation-authority`,
`nobody-it-lapsed`

#### TRANSITION_CAUSES

Why a transition happened.

Values: `acted`, `offer-lapsed`, `target-withdrawn`, `escalation-reassigned-it`

#### TRANSITION_FAULTS

Values: `transition-that-is-not-in-the-table`,
`transition-out-of-a-terminal-state`,
`transition-by-an-actor-without-the-authority`,
`acceptance-by-somebody-other-than-the-offeree`,
`completion-recorded-by-the-assigner`, `transition-with-no-actor-and-no-lapse`,
`lapse-carrying-an-invented-actor`,
`cause-that-requires-a-reason-and-carries-none`, `decline-with-no-reason`,
`block-declared-with-no-blocker`,
`judging-role-seated-without-an-eligibility-answer`,
`judging-role-seated-against-an-eligibility-refusal`,
`transition-recorded-before-the-state-it-leaves`

#### TransitionAttempt

One proposed transition, with everything the authorization needs.

| Field             | Type                                                                           | Required | Notes                                                                    |
| ----------------- | ------------------------------------------------------------------------------ | -------- | ------------------------------------------------------------------------ |
| `record`          | [AssignmentRecord](#assignmentrecord)                                          | required | —                                                                        |
| `to`              | [AssignmentState](#assignmentstate)                                            | required | —                                                                        |
| `by`              | `ActorRef \| null` — [ActorRef](./identity.md#actorref)                        | required | —                                                                        |
| `cause`           | [TransitionCause](#transitioncause)                                            | required | —                                                                        |
| `reasonCode`      | `string \| null`                                                               | required | —                                                                        |
| `at`              | [Instant](./identity.md#instant)                                               | required | —                                                                        |
| `blockedOn`       | `string \| null`                                                               | required | The blocker being declared, where the target state is `blocked`.         |
| `heldAuthorities` | `readonly TransitionAuthority[]` — [TransitionAuthority](#transitionauthority) | required | Authorities the actor holds beyond assignee/assigner, by name.           |
| `eligibility`     | `string \| null`                                                               | required | S8.1's answer for a judging role, or null where the role does not judge. |

#### TransitionAuthority

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

#### TransitionCause

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

#### TransitionFault

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

#### transitionFaults

Check one transition.

```ts
transitionFaults(attempt: TransitionAttempt): readonly AssignmentFinding[]
```

#### transitionRule

Whether an edge exists at all.

```ts
transitionRule(from: AssignmentState, to: AssignmentState): TransitionRule | null
```

#### TransitionRule

| Field  | Type                                                                           | Required | Notes                                                             |
| ------ | ------------------------------------------------------------------------------ | -------- | ----------------------------------------------------------------- |
| `from` | [AssignmentState](#assignmentstate)                                            | required | —                                                                 |
| `to`   | [AssignmentState](#assignmentstate)                                            | required | —                                                                 |
| `by`   | `readonly TransitionAuthority[]` — [TransitionAuthority](#transitionauthority) | required | —                                                                 |
| `note` | `string`                                                                       | required | Why this edge exists, or why the missing one next to it does not. |

#### TRANSITIONS

The edges, as data.

#### WallClock

A wall clock: what a person means by "five o'clock".

| Field    | Type     | Required | Notes |
| -------- | -------- | -------- | ----- |
| `year`   | `number` | required | —     |
| `month`  | `number` | required | —     |
| `day`    | `number` | required | —     |
| `hour`   | `number` | required | —     |
| `minute` | `number` | required | —     |
| `second` | `number` | required | —     |

#### WeekShape

Which day a locale's week starts on, and which days it does not work.

| Field      | Type                | Required | Notes |
| ---------- | ------------------- | -------- | ----- |
| `firstDay` | `number`            | required | —     |
| `weekend`  | `readonly number[]` | required | —     |

#### weekShapeFor

The week shape for a locale, or null where the platform does not know it.

```ts
weekShapeFor(locale: string): WeekShape | null
```

#### WORKLOAD_FAULTS

Values: `cross-assignee-query-that-kept-the-inbox-widening`,
`workload-count-taken-before-the-reader-filter`,
`capacity-derived-from-rows-the-reader-may-not-see`,
`filtered-count-presented-as-a-total`, `workload-row-the-reader-may-not-see`,
`queue-ordered-by-an-instant-rendered-in-the-wrong-zone`,
`workload-view-counting-observers-as-work`,
`week-banded-queue-with-no-locale-to-start-the-week`,
`sla-banded-queue-over-rows-with-no-sla-class`

#### WorkloadCount

A workload count, computed the only way decision 7 permits.

| Field           | Type                                                                                       | Required | Notes                                                                     |
| --------------- | ------------------------------------------------------------------------------------------ | -------- | ------------------------------------------------------------------------- |
| `total`         | `number`                                                                                   | required | —                                                                         |
| `basis`         | [CountBasis](#countbasis)                                                                  | required | —                                                                         |
| `byState`       | `Readonly<Record<AssignmentState, number>>` — [AssignmentState](#assignmentstate)          | required | —                                                                         |
| `byPriority`    | `Readonly<Record<AssignmentPriority, number>>` — [AssignmentPriority](#assignmentpriority) | required | —                                                                         |
| `bySlaStanding` | `Readonly<Record<SlaStanding \| 'unmeasured', number>>` — [SlaStanding](#slastanding)      | required | Counted by SLA standing, with the unmeasured kept apart from the healthy. |
| `withheld`      | `number`                                                                                   | required | —                                                                         |

#### WorkloadFault

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

#### workloadFaults

```ts
workloadFaults(view: WorkloadView): readonly AssignmentFinding[]
```

#### WorkloadQuery

A workload query, and the field that decides whether it is an inbox.

| Field             | Type                                                                     | Required | Notes                                                                    |
| ----------------- | ------------------------------------------------------------------------ | -------- | ------------------------------------------------------------------------ |
| `queryId`         | `string`                                                                 | required | —                                                                        |
| `reader`          | [ActorRef](./identity.md#actorref)                                       | required | —                                                                        |
| `subjectAssignee` | `ActorId \| null` — [ActorId](./identity.md#actorid)                     | required | —                                                                        |
| `byRole`          | `AssignmentRole \| null` — [AssignmentRole](#assignmentrole)             | required | —                                                                        |
| `byPriority`      | `AssignmentPriority \| null` — [AssignmentPriority](#assignmentpriority) | required | —                                                                        |
| `byState`         | `AssignmentState \| null` — [AssignmentState](#assignmentstate)          | required | —                                                                        |
| `byDueStanding`   | `DueStanding \| null` — [DueStanding](#duestanding)                      | required | —                                                                        |
| `bySlaStanding`   | `SlaStanding \| null` — [SlaStanding](#slastanding)                      | required | —                                                                        |
| `byCalendarBand`  | `CalendarBand \| null` — [CalendarBand](#calendarband)                   | required | The calendar band the queue is grouped into, where it groups by one.     |
| `byDomain`        | `string \| null`                                                         | required | —                                                                        |
| `boundScopes`     | `readonly ('tenantId' \| 'workspaceId')[]`                               | required | The scope predicates the query actually carries.                         |
| `readerZone`      | `string \| null`                                                         | required | The reader's own time zone, for rendering a due instant as a wall clock. |
| `readerLocale`    | `string \| null`                                                         | required | The reader's locale, which is what says when their week begins.          |

#### WorkloadRow

One row a workload view is counting, with what the reader may do with it.

| Field               | Type                                                | Required | Notes                                                                       |
| ------------------- | --------------------------------------------------- | -------- | --------------------------------------------------------------------------- |
| `assignmentId`      | `string`                                            | required | —                                                                           |
| `assignee`          | [ActorId](./identity.md#actorid)                    | required | —                                                                           |
| `role`              | [AssignmentRole](#assignmentrole)                   | required | —                                                                           |
| `priority`          | [AssignmentPriority](#assignmentpriority)           | required | —                                                                           |
| `state`             | [AssignmentState](#assignmentstate)                 | required | —                                                                           |
| `dueStanding`       | [DueStanding](#duestanding)                         | required | —                                                                           |
| `slaStanding`       | `SlaStanding \| null` — [SlaStanding](#slastanding) | required | Null where the assignment carries no SLA class to measure against.          |
| `domain`            | `string`                                            | required | —                                                                           |
| `readerDisposition` | `AuthorizationDisposition`                          | required | What `decideObjectAccess` said about the underlying object for THIS reader. |

#### WorkloadView

| Field                  | Type                                                                                                | Required | Notes                                                               |
| ---------------------- | --------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------- |
| `query`                | [WorkloadQuery](#workloadquery)                                                                     | required | —                                                                   |
| `rows`                 | `readonly WorkloadRow[]` — [WorkloadRow](#workloadrow)                                              | required | —                                                                   |
| `total`                | `number`                                                                                            | required | —                                                                   |
| `totalBasis`           | [CountBasis](#countbasis)                                                                           | required | —                                                                   |
| `capacity`             | `{ readonly ceiling: number; readonly usedBasis: CountBasis; } \| null` — [CountBasis](#countbasis) | required | A capacity figure shown beside the count, where one is.             |
| `declaresItIsFiltered` | `boolean`                                                                                           | required | Whether the view says out loud that it is showing a filtered count. |

#### ZONE_RESOLUTIONS

What a wall clock denotes in a zone, which twice a year is not one instant.

Values: `exact`, `skipped`, `repeated`

#### ZonedInstant

| Field           | Type                                                 | Required | Notes                                                                         |
| --------------- | ---------------------------------------------------- | -------- | ----------------------------------------------------------------------------- |
| `instant`       | [Instant](./identity.md#instant)                     | required | —                                                                             |
| `resolution`    | [ZoneResolution](#zoneresolution)                    | required | —                                                                             |
| `alternative`   | `Instant \| null` — [Instant](./identity.md#instant) | required | The other instant the same wall clock denotes, on `repeated`. Null otherwise. |
| `offsetMinutes` | `number`                                             | required | —                                                                             |

#### zonedWallClock

The wall clock an instant shows on, in a named zone.

```ts
zonedWallClock(instant: Instant, zone: string): WallClock
```

#### zoneOffsetMinutesAt

A zone's offset from UTC at a given moment, in whole minutes.

```ts
zoneOffsetMinutesAt(epochMillis: number, zone: string): number
```

#### ZoneResolution

```ts
(typeof ZONE_RESOLUTIONS)[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                                                                         |
| ---------------------------------- | --------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------ |
| `ACTORLESS_CAUSES`                 | `enumeration`         | The causes that are the clock's or the object's, and therefore have no actor. |
| `AssignmentRecord.tenant`          | `TenantId`            | —                                                                             |
| `HandoverGrant.actor`              | `ActorId`             | —                                                                             |
| `OfferDisclosure.grantsObjectRead` | `boolean`             | Whether the offeree can open the object itself before accepting.              |
| `WorkloadQuery.boundScopes`        | `readonly ('tenantId' | 'workspaceId')[]`                                                             | The scope predicates the query actually carries. |

## Idempotency and concurrency

| Symbol                                 | Type         | Notes                              |
| -------------------------------------- | ------------ | ---------------------------------- |
| `AssignmentSubject.revision`           | `RevisionId` | —                                  |
| `ReconciliationContext.targetRevision` | `RevisionId` | The revision the target is at now. |

## Pagination

| Symbol                       | Type          | Notes                                                              |
| ---------------------------- | ------------- | ------------------------------------------------------------------ |
| `PROJECTION_FAULTS`          | `enumeration` | —                                                                  |
| `ProjectionFault`            | `type`        | —                                                                  |
| `projectionFaults`           | `function`    | Check the entity's columns against the ledger, in both directions. |
| `ZonedInstant.offsetMinutes` | `number`      | —                                                                  |
| `zoneOffsetMinutesAt`        | `function`    | A zone's offset from UTC at a given moment, in whole minutes.      |

## State and failure

| Symbol                              | Type                                        | Notes                                                                   |
| ----------------------------------- | ------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------ |
| `ACL_BEARING_STATES`                | `enumeration`                               | States that put the holder into the object's access control list.       |
| `ASSIGNMENT_STATES`                 | `enumeration`                               | The lifecycle states, which are EIGHT of the item's ten.                |
| `AssignmentRecord.state`            | `AssignmentState`                           | —                                                                       |
| `AssignmentRecord.stateEnteredAt`   | `Instant`                                   | When the current state was entered.                                     |
| `AssignmentState`                   | `type`                                      | —                                                                       |
| `EntityAssignmentColumns.openState` | `'open'                                     | 'closed'`                                                               | The two-valued flag `wbe_assignee_open` is partial on. |
| `HostStateModel.declaredStates`     | `readonly string[]`                         | —                                                                       |
| `hostStateModelFaults`              | `function`                                  | —                                                                       |
| `LedgerSummary.byState`             | `Readonly<Record<AssignmentState, number>>` | —                                                                       |
| `STATE_MODEL_FAULTS`                | `enumeration`                               | —                                                                       |
| `StateModelFault`                   | `type`                                      | —                                                                       |
| `TERMINAL_STATES`                   | `enumeration`                               | States after which nothing further may be recorded against this record. |
| `WorkloadCount.byState`             | `Readonly<Record<AssignmentState, number>>` | —                                                                       |
| `WorkloadQuery.byState`             | `AssignmentState                            | null`                                                                   | —                                                      |
| `WorkloadRow.state`                 | `AssignmentState`                           | —                                                                       |

## Compatibility

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

## Deprecation

Not applicable: nothing on this page can be deprecated on its own; the package
version is its lifecycle.

## Evidence

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