Affirmation Store
The affirmation store is the only component that persists graph data and the only one that reads it back. Its requirements govern what may be persisted — hashes and references, never the content those hashes cover — and the qualities that make persistence trustworthy: validated on write, faithful on read-back — and refused outright when faithful read-back is impossible — confined to one write root, never visible half-written, never silently removed, and never changed unless a change was asked for — including the case’s own copy of the schemas.
The affirmation store shall never persist the content that a hash it stores covers. |
If a record does not validate against its schema, then the affirmation store shall reject it instead of writing it. |
The affirmation store shall reproduce each record it has written unchanged when that record is read back. |
The affirmation store shall write every record beneath the write root it was given, and no record outside it. |
The affirmation store shall make a record readable only once it has been written completely. |
The affirmation store shall remove a persisted record only when removal of that record is requested. |
The affirmation store shall persist, for each content hash a node record carries, the source location of the content that hash covers. |
If a persisted record cannot be read back as written, then the affirmation store shall refuse the read instead of supplying a record stream without that record. |
The affirmation store shall change a persisted affirmation record only when that change is requested. |
If a write would replace an edge record carrying the hash it was affirmed against with a record carrying no such hash, and demotion of that edge was not requested, then the affirmation store shall refuse the write. |
Software Requirement: A case's schema copy is rewritten from the packaged schemas on request SEG-SREQ-139
|
When the refresh of a case’s schema copy is requested, the affirmation store shall rewrite that copy from the packaged schemas and write nothing else in the case. |
When the affirmation store refreshes a case’s schema copy, it shall report each schema whose copy differed from the packaged one. |
If a write names a test outcome node or an edge of kind Confirms, Witnesses or Excuses, then the affirmation store shall refuse the write. |
Extraction revisions
An extraction revision is the revision of a repository at which the content behind a node record’s content hashes was read. A node record can carry one for each repository its content anchors name. It is a reference, like an anchor. It never enters a hash.
Where an extraction revision is supplied for a repository that a node record’s content anchors name, the affirmation store shall persist that revision with the node record. |
Software Requirement: A node record without an extraction revision is read back as written SEG-SREQ-305
|
The affirmation store shall read back a node record that carries no extraction revision as written. |
If an extraction revision supplied with a node record is not 40 or 64 lowercase hexadecimal characters, then the affirmation store shall refuse the write. |
The affirmation store shall persist a node record that carries no extraction revision with no extraction revision field, never with an empty map. |