<?xml version="1.0" encoding="UTF-8"?>
<!--
  Supersession linkbase for the Order Service decision records.

  Standards in play
    XLink 1.1          extended links, locators and arcs   (W3C Rec, 2010)
    XPointer           shorthand and element() pointers    (W3C Rec, 2003)
    Dublin Core Terms  dcterms:replaces as the arc role    (DCMI)

  The ADR files never mention each other. Every "replaces" relationship
  lives here, so recording a new decision is one new ADR file plus one
  append to this file. Existing ADRs are never edited.

  An arc goes from the new decision to whatever it replaces. "Replaced by"
  is not stored; it is the same arc read backwards.
-->
<linkbase xmlns="urn:xenon:links"
          xmlns:xlink="http://www.w3.org/1999/xlink">

  <!-- Partial supersession: ADR-0004 replaces one decision of ADR-0001.
       The other decision (PostgreSQL) still stands. -->
  <supersession xlink:type="extended" xlink:title="UUIDv7 keys">
    <loc xlink:type="locator" xlink:label="new" xlink:href="../adr/adr-0004.xml#adr-0004-d1"/>
    <loc xlink:type="locator" xlink:label="old" xlink:href="../adr/adr-0001.xml#adr-0001-d2"/>
    <arc xlink:type="arc" xlink:from="new" xlink:to="old"
         xlink:arcrole="http://purl.org/dc/terms/replaces"/>
  </supersession>

  <!-- One decision replaces three, across two records: all of ADR-0003
       and the partner-key decision in ADR-0002. Both "old" locators share
       a label, so one arc covers both: an XLink multi-ended link.
       The second locator uses the XPointer element() scheme
       (6th child of #adr-0002, then its 2nd child) to show it is
       available; xml:id shorthand pointers are the robust choice. -->
  <supersession xlink:type="extended" xlink:title="Single identity model">
    <loc xlink:type="locator" xlink:label="new" xlink:href="../adr/adr-0006.xml#adr-0006-d1"/>
    <loc xlink:type="locator" xlink:label="old" xlink:href="../adr/adr-0003.xml#adr-0003"/>
    <loc xlink:type="locator" xlink:label="old" xlink:href="../adr/adr-0002.xml#element(adr-0002/6/2)"/>
    <arc xlink:type="arc" xlink:from="new" xlink:to="old"
         xlink:arcrole="http://purl.org/dc/terms/replaces"/>
  </supersession>

  <!-- A chain, step one: Kafka replaces LISTEN/NOTIFY. -->
  <supersession xlink:type="extended" xlink:title="Durable events">
    <loc xlink:type="locator" xlink:label="new" xlink:href="../adr/adr-0007.xml#adr-0007-d1"/>
    <loc xlink:type="locator" xlink:label="old" xlink:href="../adr/adr-0005.xml#adr-0005-d1"/>
    <arc xlink:type="arc" xlink:from="new" xlink:to="old"
         xlink:arcrole="http://purl.org/dc/terms/replaces"/>
  </supersession>

  <!-- A chain, step two: NATS replaces Kafka. The outbox decision in
       ADR-0007 is untouched and stays in force. -->
  <supersession xlink:type="extended" xlink:title="Broker change">
    <loc xlink:type="locator" xlink:label="new" xlink:href="../adr/adr-0008.xml#adr-0008-d1"/>
    <loc xlink:type="locator" xlink:label="old" xlink:href="../adr/adr-0007.xml#adr-0007-d1"/>
    <arc xlink:type="arc" xlink:from="new" xlink:to="old"
         xlink:arcrole="http://purl.org/dc/terms/replaces"/>
  </supersession>

  <!-- Recorded but not yet in force: ADR-0009 is only proposed, so this
       arc shows up as a pending change, not as a supersession. -->
  <supersession xlink:type="extended" xlink:title="Multi-region datastore">
    <loc xlink:type="locator" xlink:label="new" xlink:href="../adr/adr-0009.xml#adr-0009-d1"/>
    <loc xlink:type="locator" xlink:label="old" xlink:href="../adr/adr-0001.xml#adr-0001-d1"/>
    <arc xlink:type="arc" xlink:from="new" xlink:to="old"
         xlink:arcrole="http://purl.org/dc/terms/replaces"/>
  </supersession>

</linkbase>
