Skip to main content

Layer 7 · collaboration

derivation

blocks/7-collaboration/derivation.yaml

layer 7collaboration
1entity
3commands
3events
3views
14refusals
2KPIs

What a draft, a run or a deliverable was derived from: a decision (an answered question), or another derivation. A derivation is Current until its source changes; then it is marked for revision, and what followed from it is redone under a new derivation. Marking goes one step at a time: a revised decision marks the derivations made from it (MarkDecisionChanged), and each marked derivation marks the derivations made from it (MarkDerivedFrom), so a mark reaches every artifact that followed from the decision, directly or through other derivations. Nothing new is derived from a derivation marked for revision.

Depends on​

  • channel · layer 7 · 4 references
  • question · layer 7 · 9 references
  • work · layer 5 · 6 references
  • store · layer 3 · 5 references

Used by​

No block depends on this one.

Entities​

Derivation​

One artifact and the one source it was derived from.

Identified by derivation_id (DerivationId).

fieldtypemeaning
artifact_kindArtifactKind
record_idoptional RecordIdThe record derived, present exactly when the kind is Record.
deliverable_idoptional DeliverableIdThe deliverable derived, present exactly when the kind is Deliverable.
run_idoptional RunIdThe run derived, present exactly when the kind is Run.
question_idoptional QuestionIdThe decision it was derived from, an answered question; absent when the source is a derivation.
decided_optionoptional OptionLetterThe option the decision held when the artifact was derived from it.
derived_fromoptional DerivationIdThe derivation it was derived from; absent when the source is a decision.
recorded_byPartyId
recorded_attimestamp
causeoptional RevisionCauseWhy it was marked for revision, once it is.
marked_atoptional timestamp

Relations:

  • record references Record of store (one, by record_id)
  • deliverable references Deliverable of work (one, by deliverable_id)
  • run references Run of work (one, by run_id)
  • decision references Question of question (one, by question_id)
  • source references Derivation (one, by derived_from)

Lifecycle of Derivation

CurrentMarkedForRevisionmarkCurrentMarkedForRevisionmark
Ends in MarkedForRevision.

Commands​

MarkDecisionChanged​

Mark what was derived from a changed decision. Every Current derivation made from the decision is marked for revision.

Called by: Reviser.

fieldtype
question_idQuestionId
attimestamp
outcomewhenresult
unknown-question refusedno Question for question_idUnknownQuestion: No question has this identity; nothing was recorded.
decision-not-taken refusedthe Question of question_id has state != Answered and state != DefaultTakenDecisionNotTaken: The question has no chosen option (it is not Answered and took no default).
markedotherwiseemits DecisionDerivationsMarked

MarkDerivedFrom​

Mark what was derived from a marked derivation. Every Current derivation made from a derivation marked for revision is marked too.

Called by: Reviser.

fieldtype
derivation_idDerivationId
attimestamp
outcomewhenresult
unknown-derivation refusedno Derivation for derivation_idUnknownDerivation: No derivation has this identity; nothing was recorded.
source-not-marked refusedthe Derivation of derivation_id has state != MarkedForRevisionSourceNotMarked: The derivation is not marked for revision, so what was derived from it is not marked either.
markedotherwiseemits DerivedMarked

RecordDerivation​

Record a derivation. The caller records that an artifact (a record, a deliverable or a run) was derived from a decision that was taken, or from a derivation that is Current.

Called by: Author.

fieldtype
artifact_kindArtifactKind
record_idoptional RecordId
deliverable_idoptional DeliverableId
run_idoptional RunId
question_idoptional QuestionId
derived_fromoptional DerivationId
attimestamp
outcomewhenresult
no-source refusednot (defined(question_id)) and not (defined(derived_from))NoSource: The derivation names neither a decision nor a derivation it was derived from.
two-sources refuseddefined(question_id) and defined(derived_from)TwoSources: The derivation names both a decision and a derivation; it has one source.
artifact-not-named refused(artifact_kind == Record and (not (defined(record_id)) or defined(deliverable_id) or defined(run_id)) or artifact_kind == Deliverable and (not (defined(deliverable_id)) or defined(record_id) or defined(run_id)) or artifact_kind == Run and (not (defined(run_id)) or defined(record_id) or defined(deliverable_id)))ArtifactNotNamed: The derivation does not name exactly the artifact its kind says: a record for Record, a deliverable for Deliverable, a run for Run, and no other.
unknown-record refusedno Record for record_idUnknownArtifact: No record, deliverable or run has the identity named; nothing was recorded.
unknown-deliverable refusedno Deliverable for deliverable_idUnknownArtifact: No record, deliverable or run has the identity named; nothing was recorded.
unknown-run refusedno Run for run_idUnknownArtifact: No record, deliverable or run has the identity named; nothing was recorded.
unknown-question refusedno Question for question_idUnknownQuestion: No question has this identity; nothing was recorded.
unknown-source refusedno Derivation for derived_fromUnknownDerivation: No derivation has this identity; nothing was recorded.
decision-not-taken refusedthe Question of question_id has state != Answered and state != DefaultTakenDecisionNotTaken: The question has no chosen option (it is not Answered and took no default).
source-marked refusedthe Derivation of derived_from has state == MarkedForRevisionSourceMarkedForRevision: The derivation it would be derived from is marked for revision; derive from its revision.
recordedotherwisecreates a Derivation in Current; emits DerivationRecorded

Events​

eventfieldsemitted by
DecisionDerivationsMarkedquestion_id QuestionId, marked integer, at timestampMarkDecisionChanged
DerivationRecordedderivation_id DerivationId, artifact_kind ArtifactKind, record_id optional RecordId, deliverable_id optional DeliverableId, run_id optional RunId, question_id optional QuestionId, derived_from optional DerivationId, recorded_by PartyId, at timestampRecordDerivation
DerivedMarkedderivation_id DerivationId, marked integer, at timestampMarkDerivedFrom

Views​

viewrowsfields
Derivations
Derivations
each Derivationderivation_id DerivationId, artifact_kind ArtifactKind, record_id optional RecordId, deliverable_id optional DeliverableId, run_id optional RunId, question_id optional QuestionId, decided_option optional OptionLetter, derived_from optional DerivationId, recorded_by PartyId, recorded_at timestamp, cause optional RevisionCause, marked_at optional timestamp, state State
DerivedFrom
Derived from a derivation
each Derivation with defined(derived_from) and derived_from == param.derived_from
asked with derived_from DerivationId
derivation_id DerivationId, artifact_kind ArtifactKind, state State
DerivedFromDecision
Derived from a decision
each Derivation with defined(question_id) and question_id == param.question_id
asked with question_id QuestionId
derivation_id DerivationId, artifact_kind ArtifactKind, decided_option optional OptionLetter, state State

Types​

typeisvalues or fields
ArtifactKind
What was derived: a record of a store (a draft, a note, an artifact), a deliverable a run handed back, or a run.
one ofRecord, Deliverable, Run
RevisionCause
Why a derivation was marked for revision: its decision was changed, or the derivation it was derived from was marked.
one ofDecisionChanged, SourceMarked

KPIs​

2 KPIs from the KPI catalogue. A gate must be zero for a variant of an architecture to count.

Correctness​

KPIunitbettergatestatus
derived_left_unmarked
Derivations still current although the derivation or decision they were derived from was marked or changed.
How: DerivationRecorded events whose source derivation was marked (DecisionDerivationsMarked or DerivedMarked) or whose decision was revised (AnswerRevised) with no later mark of their own, at the end of the window. Must be 0.
countlowergateplanned
source: design

Quality​

KPIunitbettergatestatus
derivations_marked_for_revision
Drafts, runs and deliverables marked for revision because a decision they followed from changed.
How: The marked counts of DecisionDerivationsMarked and DerivedMarked events in the window, summed.
countlower–planned
source: design