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.

Software Requirement: Covered content is never persisted SEG-SREQ-018
refines: SEG-SYS-007

The affirmation store shall never persist the content that a hash it stores covers.

Software Requirement: Only valid records are written SEG-SREQ-019
refines: SEG-SYS-007

If a record does not validate against its schema, then the affirmation store shall reject it instead of writing it.

Software Requirement: Records read back as written SEG-SREQ-020
refines: SEG-SYS-007
is verified by: SEG-TS-103

The affirmation store shall reproduce each record it has written unchanged when that record is read back.

Software Requirement: Writes stay under the write root SEG-SREQ-021
refines: SEG-SYS-007

The affirmation store shall write every record beneath the write root it was given, and no record outside it.

Software Requirement: Records appear only when complete SEG-SREQ-022
refines: SEG-SYS-007

The affirmation store shall make a record readable only once it has been written completely.

Software Requirement: Deletion is explicit SEG-SREQ-023
refines: SEG-SYS-007

The affirmation store shall remove a persisted record only when removal of that record is requested.

Software Requirement: Every persisted content hash locates its content SEG-SREQ-050
refines: SEG-SYS-007

The affirmation store shall persist, for each content hash a node record carries, the source location of the content that hash covers.

Software Requirement: Unreadable records are never skipped SEG-SREQ-053
refines: SEG-SYS-007

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.

Software Requirement: Persisted affirmations change only on request SEG-SREQ-033
refines: SEG-SYS-011

The affirmation store shall change a persisted affirmation record only when that change is requested.

Software Requirement: Affirmed standing is never lost by omission SEG-SREQ-051
refines: SEG-SYS-011

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
refines: SEG-SYS-007

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.

Software Requirement: A refresh reports each schema that differed SEG-SREQ-140
refines: SEG-SYS-007

When the affirmation store refreshes a case’s schema copy, it shall report each schema whose copy differed from the packaged one.

Software Requirement: The case persists no test evidence SEG-SREQ-227
refines: SEG-SYS-013
is verified by: SEG-TS-098

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.

Software Requirement: A node record keeps the extraction revisions it is given SEG-SREQ-304
refines: SEG-SYS-007
is refined by: SEG-SREQ-325, SEG-SREQ-326
is verified by: SEG-TS-195, SEG-TS-198

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
refines: SEG-SYS-007
is verified by: SEG-TS-196

The affirmation store shall read back a node record that carries no extraction revision as written.

Software Requirement: A malformed extraction revision is refused SEG-SREQ-325
refines: SEG-SREQ-304
is verified by: SEG-TS-220

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.

Software Requirement: No extraction revision is persisted as no field SEG-SREQ-326
refines: SEG-SREQ-304
is verified by: SEG-TS-221

The affirmation store shall persist a node record that carries no extraction revision with no extraction revision field, never with an empty map.