# `Cause`

> Contract 2.0.0 · package sha256 `a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e` · generated from `configurator-runtime.d.ts` by `services/onsite-scripter/scripts/build-contract-docs.mjs`; edit the source, not this file.

Interface · `import type { Cause } from '@holostep-configurators/runtime-client/contract';` · stable · since 2.0.0 · section 2. Operations, reports, causes, problems

What caused a commit. On every state event, every commit-feed entry and every Report (as
[`op`](Cause.op.md), [`seq`](Cause.seq.md), [`origin`](Cause.origin.md)).

## Members

| Member | Kind | Summary |
| --- | --- | --- |
| <a id="op"></a>[`op`](Cause.op.md) | property | The operation that made the commit. |
| <a id="seq"></a>[`seq`](Cause.seq.md) | property | +1 per commit of any kind; the current [`session.seq`](Session.seq.md) on an equal write's 'history:changed'. |
| <a id="revision"></a>[`revision`](Cause.revision.md) | property | [`session.revision`](Session.revision.md) after this commit, or the current one for an equal write. |
| <a id="actor"></a>[`actor`](Cause.actor.md) | property | Who made it: the write's `actor`, else its `expectGroup`'s, else 'app'; 'shopper' for canvas input. |
| <a id="origin"></a>[`origin`](Cause.origin.md) | property | The write's `origin` tag; null when none was given. |
| <a id="kind"></a>[`kind`](Cause.kind.md) | property | 'write': one autocommit write; 'transaction': [`session.transaction`](Session.transaction.md); 'undo' and 'redo'; 'patch': [`applyPatch`](Writer.applyPatch.md); 'load': a [`setSceneModel`](Writer.setSceneModel.md) with no earlier model ([`boot`](boot.md) loads none), never an undo step (its result is the… |

## Declaration

```ts
export interface Cause {
  readonly op: OpId;
  readonly seq: number;
  readonly revision: number;
  readonly actor: Actor;
  readonly origin: string | null;
  readonly kind: 'write' | 'transaction' | 'undo' | 'redo' | 'patch' | 'load' | 'restore' | 'input' | 'other';
}
```

## Generic-API test (spec 3.1)

| Rule | Result |
| --- | --- |
| 1. Neutral name | pass: `Cause` names no product |
| 2. A precedent | pass: a correctness rule (rows `X2`) |
| 3. Two apps, or labs | pass: 16 apps (ledger: app-4fd23bc869, app-822bb9d6aa, app-8675b3225c, app-b362a81c85, app-bcb7ef21da, app-c1384707fc, app-e3b47169bc, app-e61a0b42ad and 8 more) |
| 4. The cheaper fix first | decided per need in Appendix B: rows `X2` at tier stable (a member only where no rule, data, asset or app code serves the need) |
