Applying a contribution
Applying aContribution is four steps, in one transaction:
- Remove. Remove the unit’s evidence for the passages in
replaces(all of them whenreplacesisNone), and the relations that lose all their evidence. - Restamp. Restamp all of the unit’s evidence, kept and new, with the contribution’s
access_labelsandstale_after. A metadata change therefore reaches evidence whose text did not change. - Merge. Merge in the new concepts, creating the ones that do not exist.
- Check. Check each concept left with no evidence. If a human verified it, mark it
deprecatedand log it. Otherwise delete it, leaving a redirect if it had been exported.
When two units disagree
When two units give a concept different text, content from a human actor wins. Otherwise the newestgenerated.at wins, and the vector travels with the winning text.
Merging two concepts keeps the older id. The other becomes a redirect.
Lesson 1 walks through these cases on one concept:
Versions make an update cheap
A unit’sDocVersion has three hashes: file, metadata and passages. Comparing them with the source’s manifest shows what changed, so only that is redone. New metadata re-opens context choices. Changed passages are re-extracted, and unchanged ones keep their pinned choices.
A rebuild gives the same index because ids derive from fixed founding fields and context choices are pinned and replayed.