Authoring
Audience: collection authors and tool authors implementing authoring behavior.
Authoritative for:
- immutable field semantics
- the additional
ulid,random, andsequencegeneration strategies
See also:
- Field Definition Reference: core generation strategies and generic generation behavior
- Managed Notes and Properties: core-defined fields and materialization
- Expressions: computed field definitions
- Migration Effects: managed-note effects of schema changes
This optional module groups field immutability and additional generation strategies used by authoring tools. Core now, now_on_write, and uuid generation and general field materialization remain with their linked owners.
immutable#
Immutability preserves a field's first concrete stored value across later edits. It complements the generation behavior defined in the Field Definition Reference.
Example:
external_reference:
type: text
immutable: true
Rules:
- FDR-95
immutableMAY be omitted. - FDR-96
immutableMUST be a boolean. - FDR-97 If omitted,
immutabledefaults tofalse. - FDR-98
immutable: truemeans that once the field holds a concrete non-null stored value, that value MUST NOT change. - FDR-99 Immutability is an obligation on tools and operations that modify managed notes; because conformance evaluation is stateless, a validator MAY verify immutability only when it has access to historical state.
- FDR-100 A
rename_fieldmigration moves an immutable value unchanged; achange_fieldmigration MAY change a field'simmutabledeclaration. - FDR-101 A
const_valueconstraint is stronger than immutability and does not require a duplicate immutable declaration. - FDR-102 The core-defined
idfield is immutable whether or not its definition declares it. - FDR-103
immutableMAY be declared on top-level fields and on nested fields insideobject.fields; it MUST NOT be declared onitems.
Additional Generation Strategies#
These strategies add sortable identifiers, random strings, and sequence numbers to the generation contract in Field Definition Reference.
Example:
reference:
type: text
generated: ulid
code:
type: text
generated:
random: 12
ticket_number:
type: integer
generated:
sequence:
start: 1
scope: note_type
Rules:
- FDR-71
ulidis valid fortextfields. The tool MUST generate a ULID written in lowercase, so the value satisfiesformat: slug, once; it MUST NOT overwrite an existing concrete non-null value. - FDR-72
{ random: n }is valid fortextfields.randomMUST be a positive integer. The tool MUST generatencharacters drawn uniformly from the lowercase lettersathroughzand the digits0through9, once; it MUST NOT overwrite an existing concrete non-null value. - FDR-73
{ sequence: { start, scope } }is valid forintegerfields.startMAY be omitted and defaults to1;scopeMAY be omitted, MUST benote_typeorcollectionwhen present, and defaults tonote_type. The generated value is one greater than the highest stored value of this field across the managed notes in scope, orstartwhen no stored value exists;note_typescope spans managed notes of the same note type andcollectionscope spans all managed notes. The value is produced once: a tool MUST NOT overwrite an existing concrete non-null value.