Fate Supplement — System Protocol reference
Fate Supplement schemas of the ObjectStack System Protocol — each property with its type, default and a TypeScript example.
Source: packages/spec/src/system/fate-supplement.zod.ts
import { OrganizationOwnershipAnchorSchema, OrganizationOwnershipCategorySchema, OrganizationOwnershipDepartureSchema, OrganizationOwnershipFateSchema, OrganizationOwnershipRowConditionSchema, OrganizationOwnershipSupplementSchema, OrganizationOwnershipSupplementEntrySchema } from '@objectstack/spec/system';
import type { OrganizationOwnershipAnchor, OrganizationOwnershipCategory, OrganizationOwnershipDeparture, OrganizationOwnershipFate, OrganizationOwnershipRowCondition, OrganizationOwnershipSupplement, OrganizationOwnershipSupplementEntry } from '@objectstack/spec/system';
// Validate data
const result = OrganizationOwnershipAnchorSchema.parse(data);
Fate 3 anchor: parent, subject or holder
This schema accepts one of the following structures:
| Property | Type | Required | Description |
|---|
| kind | 'parent' | ✅ | |
| childKey | string | ✅ | Column of this row naming a row of parentObject |
| parentObject | string | ✅ | Object whose row carries the organization |
| Property | Type | Required | Description |
|---|
| kind | 'subject' | ✅ | |
| objectColumn | string | ✅ | Column naming the object of the record the row is about |
| idColumn | string | ✅ | Column naming that record's id |
| Property | Type | Required | Description |
|---|
| kind | 'holder' | ✅ | |
| holderObject | string | ✅ | Object whose rows point at this row |
| holderKey | string | ✅ | Column of holderObject naming this row; every stamped holder must agree |
A named row population the ceremony counts on the table
| Property | Type | Required | Description |
|---|
| id | string | ✅ | Category id (kebab-case), as the plan labels the count |
| label | string | ✅ | What the population is, in the operator's terms |
| citation | string | ✅ | The ruling or record that names the population |
| where | ({ column: string; equals: string | number | boolean } | { column: string; in: string[] } | { column: string; notIn: string[] } | { column: string; isNull: boolean } | … +1 more)[] | optional | Rows of the population; absent = every row |
| conflictBy | { groupBy: string[]; distinct?: string } | optional | Count groups holding more than one row instead of rows |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| equals | string | number | boolean | ✅ | The column equals this value |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| in | string[] | ✅ | The column holds one of these values |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| notIn | string[] | ✅ | The column is NULL or holds none of these values |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| isNull | boolean | ✅ | true: the column is NULL; false: it is not |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| notTrue | true | ✅ | The column is NULL or holds anything but true |
| Property | Type | Required | Description |
|---|
| groupBy | string[] | ✅ | Columns the rows are grouped by |
| distinct | string | optional | Count a group only when it holds more than one distinct value of this column |
Rows that leave the table before the NOT NULL gate: neither attributed nor reported
| Property | Type | Required | Description |
|---|
| id | string | ✅ | Departure id (kebab-case), as the plan labels the count |
| label | string | ✅ | Which rows leave, and by which step |
| citation | string | ✅ | The ruling or record that names the step |
| as | Enum<'mirror-deletion' | 'moved'> | ✅ | mirror-deletion for mirrors; moved for rows re-homed elsewhere |
| where | ({ column: string; equals: string | number | boolean } | { column: string; in: string[] } | { column: string; notIn: string[] } | { column: string; isNull: boolean } | … +1 more)[] | ✅ | The rows that leave |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| equals | string | number | boolean | ✅ | The column equals this value |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| in | string[] | ✅ | The column holds one of these values |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| notIn | string[] | ✅ | The column is NULL or holds none of these values |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| isNull | boolean | ✅ | true: the column is NULL; false: it is not |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| notTrue | true | ✅ | The column is NULL or holds anything but true |
ADR-0131 D10 fate: column-drop, mirror-deletion, attribution or report
column-drop
mirror-deletion
attribution
report
One condition on a row: equals, in, notIn, isNull or notTrue on one column
This schema accepts one of the following structures:
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| equals | string | number | boolean | ✅ | The column equals this value |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| in | string[] | ✅ | The column holds one of these values |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| notIn | string[] | ✅ | The column is NULL or holds none of these values |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| isNull | boolean | ✅ | true: the column is NULL; false: it is not |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| notTrue | true | ✅ | The column is NULL or holds anything but true |
The host fate supplement: the ADR-0131 D10 fates of the objects a host provides, one row per object
Type: ({ object: string; citation: string; categories?: object[]; note?: string; … } | … +3 more)[]
The fate of one object the host provides (ADR-0131 D10)
This schema accepts one of the following structures:
| Property | Type | Required | Description |
|---|
| object | string | ✅ | The object (= its table) the host provides |
| citation | string | ✅ | The host's source for this fate |
| categories | { id: string; label: string; citation: string; where?: (object | … +4 more)[]; … }[] | optional | Named row populations the plan counts on the table |
| note | string | optional | A note the plan carries beside the table |
| fate | 'column-drop' | ✅ | Fate 1: the object ends with no organization_id column |
A named row population the ceremony counts on the table
| Property | Type | Required | Description |
|---|
| id | string | ✅ | Category id (kebab-case), as the plan labels the count |
| label | string | ✅ | What the population is, in the operator's terms |
| citation | string | ✅ | The ruling or record that names the population |
| where | ({ column: string; equals: string | number | boolean } | { column: string; in: string[] } | { column: string; notIn: string[] } | { column: string; isNull: boolean } | … +1 more)[] | optional | Rows of the population; absent = every row |
| conflictBy | { groupBy: string[]; distinct?: string } | optional | Count groups holding more than one row instead of rows |
| Property | Type | Required | Description |
|---|
| object | string | ✅ | The object (= its table) the host provides |
| citation | string | ✅ | The host's source for this fate |
| categories | { id: string; label: string; citation: string; where?: (object | … +4 more)[]; … }[] | optional | Named row populations the plan counts on the table |
| note | string | optional | A note the plan carries beside the table |
| fate | 'mirror-deletion' | ✅ | Fate 2: mirror rows are deleted after the verified rewrite |
| mirror | ({ column: string; equals: string | number | boolean } | { column: string; in: string[] } | { column: string; notIn: string[] } | { column: string; isNull: boolean } | … +1 more)[] | optional | Which rows are mirrors; absent = every row |
A named row population the ceremony counts on the table
| Property | Type | Required | Description |
|---|
| id | string | ✅ | Category id (kebab-case), as the plan labels the count |
| label | string | ✅ | What the population is, in the operator's terms |
| citation | string | ✅ | The ruling or record that names the population |
| where | ({ column: string; equals: string | number | boolean } | { column: string; in: string[] } | { column: string; notIn: string[] } | { column: string; isNull: boolean } | … +1 more)[] | optional | Rows of the population; absent = every row |
| conflictBy | { groupBy: string[]; distinct?: string } | optional | Count groups holding more than one row instead of rows |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| equals | string | number | boolean | ✅ | The column equals this value |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| in | string[] | ✅ | The column holds one of these values |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| notIn | string[] | ✅ | The column is NULL or holds none of these values |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| isNull | boolean | ✅ | true: the column is NULL; false: it is not |
| Property | Type | Required | Description |
|---|
| column | string | ✅ | Column the condition reads |
| notTrue | true | ✅ | The column is NULL or holds anything but true |
| Property | Type | Required | Description |
|---|
| object | string | ✅ | The object (= its table) the host provides |
| citation | string | ✅ | The host's source for this fate |
| categories | { id: string; label: string; citation: string; where?: (object | … +4 more)[]; … }[] | optional | Named row populations the plan counts on the table |
| note | string | optional | A note the plan carries beside the table |
| fate | 'attribution' | ✅ | Fate 3: NULL rows take their organization from an anchor |
| anchors | ({ kind: 'parent'; childKey: string; parentObject: string } | { kind: 'subject'; objectColumn: string; idColumn: string } | { kind: 'holder'; holderObject: string; holderKey: string })[] | ✅ | The anchors, in order; empty = the Default Organization under single, otherwise reported |
| departures | { id: string; label: string; citation: string; as: Enum<'mirror-deletion' | 'moved'>; … }[] | optional | Rows that leave the table before the NOT NULL gate |
A named row population the ceremony counts on the table
| Property | Type | Required | Description |
|---|
| id | string | ✅ | Category id (kebab-case), as the plan labels the count |
| label | string | ✅ | What the population is, in the operator's terms |
| citation | string | ✅ | The ruling or record that names the population |
| where | ({ column: string; equals: string | number | boolean } | { column: string; in: string[] } | { column: string; notIn: string[] } | { column: string; isNull: boolean } | … +1 more)[] | optional | Rows of the population; absent = every row |
| conflictBy | { groupBy: string[]; distinct?: string } | optional | Count groups holding more than one row instead of rows |
| Property | Type | Required | Description |
|---|
| kind | 'parent' | ✅ | |
| childKey | string | ✅ | Column of this row naming a row of parentObject |
| parentObject | string | ✅ | Object whose row carries the organization |
| Property | Type | Required | Description |
|---|
| kind | 'subject' | ✅ | |
| objectColumn | string | ✅ | Column naming the object of the record the row is about |
| idColumn | string | ✅ | Column naming that record's id |
| Property | Type | Required | Description |
|---|
| kind | 'holder' | ✅ | |
| holderObject | string | ✅ | Object whose rows point at this row |
| holderKey | string | ✅ | Column of holderObject naming this row; every stamped holder must agree |
Rows that leave the table before the NOT NULL gate: neither attributed nor reported
| Property | Type | Required | Description |
|---|
| id | string | ✅ | Departure id (kebab-case), as the plan labels the count |
| label | string | ✅ | Which rows leave, and by which step |
| citation | string | ✅ | The ruling or record that names the step |
| as | Enum<'mirror-deletion' | 'moved'> | ✅ | mirror-deletion for mirrors; moved for rows re-homed elsewhere |
| where | ({ column: string; equals: string | number | boolean } | { column: string; in: string[] } | { column: string; notIn: string[] } | { column: string; isNull: boolean } | … +1 more)[] | ✅ | The rows that leave |
| Property | Type | Required | Description |
|---|
| object | string | ✅ | The object (= its table) the host provides |
| citation | string | ✅ | The host's source for this fate |
| categories | { id: string; label: string; citation: string; where?: (object | … +4 more)[]; … }[] | optional | Named row populations the plan counts on the table |
| note | string | optional | A note the plan carries beside the table |
| fate | 'report' | ✅ | Fate 4: NULL rows are listed, never guessed, never deleted |
| departures | { id: string; label: string; citation: string; as: Enum<'mirror-deletion' | 'moved'>; … }[] | optional | Rows that leave the table before the NOT NULL gate |
| notNullExempt | string | optional | The column is not the tenancy anchor, so it never receives NOT NULL: the reason |
A named row population the ceremony counts on the table
| Property | Type | Required | Description |
|---|
| id | string | ✅ | Category id (kebab-case), as the plan labels the count |
| label | string | ✅ | What the population is, in the operator's terms |
| citation | string | ✅ | The ruling or record that names the population |
| where | ({ column: string; equals: string | number | boolean } | { column: string; in: string[] } | { column: string; notIn: string[] } | { column: string; isNull: boolean } | … +1 more)[] | optional | Rows of the population; absent = every row |
| conflictBy | { groupBy: string[]; distinct?: string } | optional | Count groups holding more than one row instead of rows |
Rows that leave the table before the NOT NULL gate: neither attributed nor reported
| Property | Type | Required | Description |
|---|
| id | string | ✅ | Departure id (kebab-case), as the plan labels the count |
| label | string | ✅ | Which rows leave, and by which step |
| citation | string | ✅ | The ruling or record that names the step |
| as | Enum<'mirror-deletion' | 'moved'> | ✅ | mirror-deletion for mirrors; moved for rows re-homed elsewhere |
| where | ({ column: string; equals: string | number | boolean } | { column: string; in: string[] } | { column: string; notIn: string[] } | { column: string; isNull: boolean } | … +1 more)[] | ✅ | The rows that leave |