Versions and publishing
Atoms, sequences and journeys are each two things: the record (its id, code, status and tenant)
and its versions, which hold everything an author edits. The published version is the newest
version with a publishedAt.
Saving and publishing
- An atom is published as it is saved. Every save is its next version; there is no draft.
- A sequence or a journey keeps one draft version, rewritten by every save. Nothing a
participant sees changes until the draft is published, by setting its
publishedAtto now (updateSequenceVersion,updateJourneyVersion). A publish time other than now is refused withpublish_time_not_now; there is no scheduled publishing. - Publishing checks completeness. A journey with any error in its graph is refused, as is one that assigns a sequence or chains into a journey that has no published version or is archived. A sequence publish is refused when it removes a score or band a journey in use reads.
- Restoring an old version is loading it and saving, which makes it the next draft. There is no restore operation.
- A record with only a draft can't be assigned (
sequence_not_published,journey_not_published).?published=trueon a list returns only records that can be.
Which version a participant gets
- A user journey pins the version it started on. Edits and publishes after that reach new enrolments; assigning the journey again starts the participant over on the version chosen.
- A user sequence floats: it always resolves to the sequence's newest published version.
- Every response records the sequence version that scored it, so a later change never rescores what is on file.
Status
A record's status is separate from publishing: active (editable and selectable), locked
(selectable and frozen) or archived (retired: can't be selected, still resolves for everything
already referencing it). Archive rather than delete: a delete is refused while anything references
any version, because an old version is what some response was scored against.