Skip to content
Alpha: see what works today →
Menu

For tools: runtime/arrivals.feature

Arrivals

The scenario the examples run

Which arrivals a runtime writes, and what each writes: when an import brings a document, an entry brings drafts, an app connects to a server, or the pod is created; and which views the build writes.

Each pod starts empty, at https://pod.example/, with one person as its subject (scripted-input/people.ttl). Ada imports Apple Health exports of four allergies (peanut, latex, shellfish, mango) from one hospital, and later exports that change them. Ben enters a peanut allergy and an asthma by hand. Finn brings exports, downloads and entries a runtime must refuse, two allergies of one code, a C-CDA download of one allergy, and a pull from his hospital, whose FHIR server his app connects to; then pulls of his allergies before and after the hospital restored a backup, and pulls on a clock that ran behind.

21 rules, 46 examples: 46 pass, 0 fail, 0 not run

A1. A document whose bytes the pod already keeps brings nothing new

Ruled by How everything in a pod is named, row document, finding; What a pod costs as it grows, row content names and the held-state rule

It is not converted, and nothing is written. The example saves no Bridge output for it, so a runtime that converted it would have none.

Why a matcher judgment, an assertion per rule list version, and one matcher agent. A matcher judgment is named once, with an assertion per rule list version because the same inputs give the same name, so a later version that agrees could otherwise write nothing, and a run that reaches an asserted judgment writes nothing, so a daily run adds no files. A matcher judgment counts while its maker is trusted, its used versions are current, and it has an assertion under a rule list version whose row for the rule carries the same rec:queryHash as the version the app uses. M11 pins a rule's bytes, so two versions with one hash reach the same matcher judgments, and a new version asserts only the matcher judgments of the rules it changed; an assertion per matcher judgment per version would be 600k to 1.2M files over ten years, more than the rest of the pod (computed, #206). A matcher judgment's members are the record and the least member of each entry it matched, a star, because entries are a transitive closure and come out the same, where every earlier copy as a member makes a fact re-downloaded in each monthly summary a matcher judgment of 1, 2 … g members, which same-pairs.rq expands to about 58M pairs over ten years (computed from an assumed 100 persistent entries per summary, #206). The rule list's version is out of the matcher judgment's name because with it in, every version renamed every matcher judgment, the duplication the split exists to stop; the member and table versions stay in, because a matcher judgment about old content is a different matcher judgment, and a new table version re-mints only the matcher judgments whose joining rows changed in it (M7), since rows are the content: re-minting every table-reading matcher judgment per adopted table version is about 960k matcher judgments in ten years (assumed monthly adoption, #206), and a used table version stays current for a matcher judgment while the current version's joining rows are the same. Which rows join is asked of the matcher judgment's rule, run over its members against the current version (M7), so a matcher judgment names no rows and its recipe stays as ruled. A rule list version that merely tightens a rule retracts nothing: the matcher judgments it no longer reaches have no assertion under it and stop counting by derivation, and its first run files one finding naming them, which the review page lists as one line, answered pair by pair over records: a Same or a Different over a pair's records, which an app may file for every pair at once, or an acknowledgement of the kind naming exactly them; a person's Same already filed on a pair is untouched. A release retracts only what it declares wrong, so a known-bad join is never offered back. The Cascade matcher is one unversioned agent because the matcher feature promises every runtime that follows it reaches the same matcher judgments, so which runtime ran is forensics, and it sits on the run's act with every other act's performer: a bug in a rule list version is found by the assertions under it, a bug in a runtime by the acts it performed, a bug in an app by its own agent and version, and bad data from any of them is hidden by a person's Erroneous over the act.

How everything in a pod is named: the whole Why, the alternatives that lost and what would change our mind.

1 example: 1 pass, 0 fail, 0 not run

passan export bringing a document the pod already keeps writes nothing
Example: an export bringing a document the pod already keeps writes nothing
  Given a new pod for Ada on 2026-01-01 at 09:00
  And the export "first-export" is imported on 2026-01-02 at 10:00
  When the export "same-bytes" is imported on 2026-01-03 at 10:00
  Then that step wrote no file

A2. A record's first arrival writes the record, its version, and a revision with no prov:wasRevisionOf

Ruled by Which revision of a record is current, row what an arrival writes

Why every document is kept. A document that repeats a state the pod holds writes no revision, so a pod that dropped it could never say that this document gave that state. "What did the March document say" would then have an answer only in the order the documents arrived in: in a rebuild in reverse order the March document comes second, repeats what the later one wrote and leaves nothing. Keeping it is the cheapest way for the question to have an answer whatever the order, because the document's own bytes are the answer, where any other way derives it from the revisions that happened to be written. The cost is, for each document whose bytes the pod did not keep, its bytes, its description and a share of the import's act; a document whose bytes the pod keeps costs nothing (A1). The sizes are in performance.md, row "content names and the held-state rule" (ruling 5.5 of #415).

Which revision of a record is current: the whole Why, the alternatives that lost and what would change our mind.

1 example: 1 pass, 0 fail, 0 not run

passeach record's first arrival is its first version and a revision that follows none
Example: each record's first arrival is its first version and a revision that follows none
  Given a new pod for Ada on 2026-01-01 at 09:00
  When the export "first-export" is imported on 2026-01-02 at 10:00
  Then the records have these revisions:
    | record              | arrived             | version | after |
    | allergy "Peanut"    | 2026-01-02 at 10:00 | 1       |       |
    | allergy "Latex"     | 2026-01-02 at 10:00 | 1       |       |
    | allergy "Shellfish" | 2026-01-02 at 10:00 | 1       |       |
    | allergy "Mango"     | 2026-01-02 at 10:00 | 1       |       |

A3. An arrival whose version, source version and source change time a revision of the record holds writes no revision

Ruled by Which revision of a record is current, rows what an arrival writes, source's own version; What a pod costs as it grows, row content names and the held-state rule

The source version is the arrival's pav:version and its change time its pav:lastUpdateOn. So does an arrival that carries no source change time and whose version the record holds, whatever stamp the revision holding it carries. Either holds whether or not the arrival would be current: it would be only if a judgment removed the revision that holds its state, and writing it again would undo the judgment. A source version alone tells nothing apart.

Why every document is kept. A document that repeats a state the pod holds writes no revision, so a pod that dropped it could never say that this document gave that state. "What did the March document say" would then have an answer only in the order the documents arrived in: in a rebuild in reverse order the March document comes second, repeats what the later one wrote and leaves nothing. Keeping it is the cheapest way for the question to have an answer whatever the order, because the document's own bytes are the answer, where any other way derives it from the revisions that happened to be written. The cost is, for each document whose bytes the pod did not keep, its bytes, its description and a share of the import's act; a document whose bytes the pod keeps costs nothing (A1). The sizes are in performance.md, row "content names and the held-state rule" (ruling 5.5 of #415).

Which revision of a record is current: the whole Why, the alternatives that lost and what would change our mind.

2 examples: 2 pass, 0 fail, 0 not run

passan older state the record holds arrives again after a newer one, and writes nothing
Example: an older state the record holds arrives again after a newer one, and writes nothing
  Given a new pod for Ada on 2026-01-01 at 09:00
  And the export "first-export" is imported on 2026-01-02 at 10:00
  And the export "new-content" is imported on 2026-01-06 at 10:00
  When the export "first-export" is imported on 2026-01-09 at 10:00 (second-import)
  Then allergy "Peanut" has these revisions:
    | arrived             | version | clinical status | after               |
    | 2026-01-02 at 10:00 | 1       | active          |                     |
    | 2026-01-06 at 10:00 | 2       | inactive        | 2026-01-02 at 10:00 |
passthe latex allergy arrives under a source version it already has, with other content, and is a revision
Example: the latex allergy arrives under a source version it already has, with other content, and is a revision
  Given a new pod for Ada on 2026-01-01 at 09:00
  And the export "first-export" is imported on 2026-01-02 at 10:00
  When the export "known-source-version" is imported on 2026-01-04 at 10:00
  Then allergy "Latex" has these revisions:
    | arrived             | version | after               |
    | 2026-01-02 at 10:00 | 1       |                     |
    | 2026-01-04 at 10:00 | 2       | 2026-01-02 at 10:00 |

A4. An arrival whose version is the record's current version writes no revision

Ruled by Which revision of a record is current, row what an arrival writes; What a pod costs as it grows, row content names and the held-state rule

Even under a new source version or a new source change time. The record's current version is its current revision's, as the ladder picks it before the step (C2).

Why every document is kept. A document that repeats a state the pod holds writes no revision, so a pod that dropped it could never say that this document gave that state. "What did the March document say" would then have an answer only in the order the documents arrived in: in a rebuild in reverse order the March document comes second, repeats what the later one wrote and leaves nothing. Keeping it is the cheapest way for the question to have an answer whatever the order, because the document's own bytes are the answer, where any other way derives it from the revisions that happened to be written. The cost is, for each document whose bytes the pod did not keep, its bytes, its description and a share of the import's act; a document whose bytes the pod keeps costs nothing (A1). The sizes are in performance.md, row "content names and the held-state rule" (ruling 5.5 of #415).

Which revision of a record is current: the whole Why, the alternatives that lost and what would change our mind.

1 example: 1 pass, 0 fail, 0 not run

passthe peanut allergy arrives again unchanged under a new source version
Example: the peanut allergy arrives again unchanged under a new source version
  Given a new pod for Ada on 2026-01-01 at 09:00
  And the export "first-export" is imported on 2026-01-02 at 10:00
  When the export "current-version-again" is imported on 2026-01-05 at 10:00
  Then allergy "Peanut" has these revisions:
    | arrived             | version | after |
    | 2026-01-02 at 10:00 | 1       |       |

A5. Any other arrival writes a revision after each of the record's heads

Ruled by Which revision of a record is current, rows what an arrival writes, heads

Its prov:wasRevisionOf names each head, as a git merge names each parent: one, unless two writers revised the record apart (S6).

Why every document is kept. A document that repeats a state the pod holds writes no revision, so a pod that dropped it could never say that this document gave that state. "What did the March document say" would then have an answer only in the order the documents arrived in: in a rebuild in reverse order the March document comes second, repeats what the later one wrote and leaves nothing. Keeping it is the cheapest way for the question to have an answer whatever the order, because the document's own bytes are the answer, where any other way derives it from the revisions that happened to be written. The cost is, for each document whose bytes the pod did not keep, its bytes, its description and a share of the import's act; a document whose bytes the pod keeps costs nothing (A1). The sizes are in performance.md, row "content names and the held-state rule" (ruling 5.5 of #415).

Which revision of a record is current: the whole Why, the alternatives that lost and what would change our mind.

1 example: 1 pass, 0 fail, 0 not run

passnew content under a new source version is a revision after the last
Example: new content under a new source version is a revision after the last
  Given a new pod for Ada on 2026-01-01 at 09:00
  And the export "first-export" is imported on 2026-01-02 at 10:00
  When the export "new-content" is imported on 2026-01-06 at 10:00
  Then allergy "Peanut" has these revisions:
    | arrived             | version | clinical status | after               |
    | 2026-01-02 at 10:00 | 1       | active          |                     |
    | 2026-01-06 at 10:00 | 2       | inactive        | 2026-01-02 at 10:00 |

A6. Arrivals with no source version are told apart by their content alone

Ruled by Which revision of a record is current, row what an arrival writes

So, by A4, one with the content the record is at now writes no revision.

Why every document is kept. A document that repeats a state the pod holds writes no revision, so a pod that dropped it could never say that this document gave that state. "What did the March document say" would then have an answer only in the order the documents arrived in: in a rebuild in reverse order the March document comes second, repeats what the later one wrote and leaves nothing. Keeping it is the cheapest way for the question to have an answer whatever the order, because the document's own bytes are the answer, where any other way derives it from the revisions that happened to be written. The cost is, for each document whose bytes the pod did not keep, its bytes, its description and a share of the import's act; a document whose bytes the pod keeps costs nothing (A1). The sizes are in performance.md, row "content names and the held-state rule" (ruling 5.5 of #415).

Which revision of a record is current: the whole Why, the alternatives that lost and what would change our mind.

1 example: 1 pass, 0 fail, 0 not run

passwith no source version, new content is a revision and the content the record is at is none
Example: with no source version, new content is a revision and the content the record is at is none
  Given a new pod for Ada on 2026-01-01 at 09:00
  And the export "first-export" is imported on 2026-01-02 at 10:00
  And the export "no-source-version" is imported on 2026-01-07 at 10:00
  When the export "no-source-version-again" is imported on 2026-01-07 at 12:00
  Then allergy "Shellfish" has these revisions:
    | arrived             | version | clinical status | after               |
    | 2026-01-02 at 10:00 | 1       | active          |                     |
    | 2026-01-07 at 10:00 | 2       | inactive        | 2026-01-02 at 10:00 |

A7. A change that is undone at its source reuses the earlier version

Ruled by How everything in a pod is named, row version

The new revision points at it.

Why identifiers are evidence, not names. An accession alone would merge a whole panel; sources disagree on identifier systems; and a name input a source may correct later is a name that changes. So the identifier rides in the version, sorted, and a judgment says when two records share one plus a code. A document's minted ids are the document's for the same reason: two of three open converters mint a new id per run, a summary generator can be set to mask server ids (both verified, in the generators' code), and nothing in a resource says whether a server or a generator assigned its id (research 3).

How everything in a pod is named: the whole Why, the alternatives that lost and what would change our mind.

1 example: 1 pass, 0 fail, 0 not run

passthe peanut allergy changes and changes back, and its third revision sets its first version again
Example: the peanut allergy changes and changes back, and its third revision sets its first version again
  Given a new pod for Ada on 2026-01-01 at 09:00
  And the export "first-export" is imported on 2026-01-02 at 10:00
  And the export "new-content" is imported on 2026-01-06 at 10:00
  When the export "change-undone" is imported on 2026-01-08 at 10:00
  Then allergy "Peanut" has these revisions:
    | arrived             | version | clinical status | after               |
    | 2026-01-02 at 10:00 | 1       | active          |                     |
    | 2026-01-06 at 10:00 | 2       | inactive        | 2026-01-02 at 10:00 |
    | 2026-01-08 at 10:00 | 1       | active          | 2026-01-06 at 10:00 |

A8. A record that is missing from a later export gets nothing written, and nothing of it goes

No decision note rules this: it is mechanics every runtime follows alike.

1 example: 1 pass, 0 fail, 0 not run

passthree allergies missing from a later export keep what they had
Example: three allergies missing from a later export keep what they had
  Given a new pod for Ada on 2026-01-01 at 09:00
  And the export "first-export" is imported on 2026-01-02 at 10:00
  When the export "same-bytes" is imported on 2026-01-03 at 10:00
  Then the records have these revisions:
    | record              | arrived             | version | after |
    | allergy "Peanut"    | 2026-01-02 at 10:00 | 1       |       |
    | allergy "Latex"     | 2026-01-02 at 10:00 | 1       |       |
    | allergy "Shellfish" | 2026-01-02 at 10:00 | 1       |       |
    | allergy "Mango"     | 2026-01-02 at 10:00 | 1       |       |

A9. A revision holds exactly the triples listed in N4

Ruled by How everything in a pod is named, row revision

Why the revision is a commit with heads. Two arrivals of one state are two events, so the act's id is hashed in; a random name would check nothing, so the revision is self-hashed. Naming the record's heads it saw, as git's parents do, lets two offline writers both import a correction and merge by union; naming every ancestor would grow without bound. Which head is current is currency.md.

How everything in a pod is named: the whole Why, the alternatives that lost and what would change our mind.

1 example: 1 pass, 0 fail, 0 not run

passa revision holds its own six statements and its arrival's, the import that made it shown as its step
Example: a revision holds its own six statements and its arrival's, the import that made it shown as its step
  Given a new pod for Ada on 2026-01-01 at 09:00
  When the export "first-export" is imported on 2026-01-02 at 10:00
  When the query is:
    """
    SELECT ?predicate ?value WHERE {
      { SELECT DISTINCT ?import WHERE {
        GRAPH <urn:cascade:steps> { <urn:cascade:step:first-export> prov:generated ?importFile }
        GRAPH ?importFile { ?import prov:used ?document }
      } }
      GRAPH <urn:cascade:steps> { <urn:cascade:step:first-export> prov:generated ?file }
      GRAPH ?file { ?revision cascade:revisionOf <urn:uuid:beaefb13-def8-8f7f-882d-eff4a1ee11d9> ; ?predicate ?object }
      BIND(IF(sameTerm(?object, ?import), <urn:cascade:step:first-export>,
              IF(STRSTARTS(STR(?object), CONCAT(STR(?revision), "#")), STRAFTER(STR(?object), STR(?revision)), ?object)) AS ?value)
    }
    """
  Then it answers:
    | predicate            | value                                |
    | rdf:type             | cascade:Revision                     |
    | cascade:revisionOf   | allergy "Peanut"                     |
    | cascade:version      | version 1 of allergy "Peanut"        |
    | prov:generatedAtTime | "2026-01-02T10:00:00Z"^^xsd:dateTime |
    | cascade:observedAsOf | "2026-01-02T10:00:00Z"^^xsd:dateTime |
    | prov:wasGeneratedBy  | <urn:cascade:step:first-export>      |
    | pav:version          | "1"                                  |
    | pav:lastUpdateOn     | "2025-12-01T00:00:00Z"^^xsd:dateTime |
    | oa:hasSelector       | "#selector"                          |
    | oa:hasSource         | the document of allergy "Peanut"     |
    | prov:wasDerivedFrom  | the document of allergy "Peanut"     |

A10. Every document an import brings is kept

Ruled by Which revision of a record is current, rows what an arrival writes, a source that goes backwards; What a pod costs as it grows, row content names and the held-state rule

Kept is its bytes under attachments/, and its description, whether it wrote a revision, repeated a state the pod holds, reported an older state (A18), raised findings or brought no record at all (a lone Patient). A document whose bytes the pod already keeps is not brought again (A1).

Why every document is kept. A document that repeats a state the pod holds writes no revision, so a pod that dropped it could never say that this document gave that state. "What did the March document say" would then have an answer only in the order the documents arrived in: in a rebuild in reverse order the March document comes second, repeats what the later one wrote and leaves nothing. Keeping it is the cheapest way for the question to have an answer whatever the order, because the document's own bytes are the answer, where any other way derives it from the revisions that happened to be written. The cost is, for each document whose bytes the pod did not keep, its bytes, its description and a share of the import's act; a document whose bytes the pod keeps costs nothing (A1). The sizes are in performance.md, row "content names and the held-state rule" (ruling 5.5 of #415).

Which revision of a record is current: the whole Why, the alternatives that lost and what would change our mind.

1 example: 1 pass, 0 fail, 0 not run

passa document that wrote no revision is kept, and the import that brought it is written
Example: a document that wrote no revision is kept, and the import that brought it is written
  Given a new pod for Ada on 2026-01-01 at 09:00
  And the export "first-export" is imported on 2026-01-02 at 10:00
  And the export "no-source-version" is imported on 2026-01-07 at 10:00
  When the export "no-source-version-again" is imported on 2026-01-07 at 12:00
  When the query is:
    """
    SELECT ?document (COUNT(DISTINCT ?attachment) AS ?storedFiles) ?usedByTheImport WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:no-source-version-again> prov:generated ?description }
      GRAPH ?description { ?document a prov:Entity }
      OPTIONAL {
        GRAPH <urn:cascade:steps> { <urn:cascade:step:no-source-version-again> prov:generated ?attachment }
        FILTER NOT EXISTS { GRAPH ?attachment { ?s ?p ?o } }
      }
      BIND(EXISTS {
        GRAPH <urn:cascade:steps> { <urn:cascade:step:no-source-version-again> prov:generated ?importFile }
        GRAPH ?importFile { ?import a prov:Activity ; prov:used ?document }
      } AS ?usedByTheImport)
    }
    GROUP BY ?document ?usedByTheImport
    """
  Then it answers:
    | document                                                                                                    | storedFiles | usedByTheImport |
    | the document "no-source-version-again/apple_health_export/clinical-records/AllergyIntolerance-shellfish.json" | 1           | true            |

A11. An import that kept any document writes its description once

Ruled by How everything in a pod is named, row act

That description is that it is a cascade:DocumentImport and a prov:Activity; the label, the start and the association the Bridge gave; the runtime that performed the import (N7); and prov:used for each kept document. The import's snapshot (N14) is in its file. An import that kept nothing, every document it brought being one the pod already keeps (A1), writes nothing, not even itself.

Why six kinds of act, and a snapshot per act. Every file an act writes is credited to it, which is what the audit trail and the snapshot rest on. A connect writes what a server reports, a migration writes a release's retractions, a run writes matcher judgments and assertions; folding them into an import would pretend a connect with no pull, or a migration by a writer that never imports, happened inside one. So each is an act with a random id, a start, an agent and a snapshot, and the snapshot exists because per-file integrity says nothing about the set being whole. The snapshot is a chain, its previous snapshot and this act's additions with an order-free hash of the set, because a list of every file per act grows with the square of the pod: 170 to 490 GB over ten years and 12,300 acts (5,000 and 7,300 pulls; the 70 to 200 GB of 5,000 acts scaled by 2.46) against a pod of 36 to 38 GB, where git's tree with this layout is 2.5 to 5 GB over those acts (the 1 to 2 GB of 5,000 acts scaled by 2.46) and the chain 60 to 115 MB (computed from a stated ten-year pod, #206); the set only grows, so a chain loses nothing, and "in sync" is one comparison of two hashes. A sync is an act because "when did this writer first see that import" is history nothing else records, and the matcher run the union calls for needs a cause to name; it is written only when the writer holds an act, other than a sync, whose snapshot is no ancestor of its last snapshot, because a background transport syncs many times a day and moves nothing in nearly all of them, because what the writer holds survives a transfer that stops partway where a list of what one transfer moved does not, and because an act that counted syncs would fire on its own arrival at the other writer. That test says whether anything an act wrote has reached the writer unmerged, at the cost of a walk of the snapshots it holds, and the files that change in place are outside the set, or every view rebuild would change it. Union needs no merge step of its own: two writers that imported one record wrote one version file by name, and two that ran one rule on one pair wrote one matcher judgment, so the only things a union leaves are two heads of one record, which the ladder in currency.md ranks, and pairs no matcher saw together, which the run the sync triggers takes, bound to the records the sync brought (republishing-sources.md).

How everything in a pod is named: the whole Why, the alternatives that lost and what would change our mind.

3 examples: 3 pass, 0 fail, 0 not run

passan import writes its label, its start, its association and each document it kept
Example: an import writes its label, its start, its association and each document it kept
  Given a new pod for Ada on 2026-01-01 at 09:00
  When the export "first-export" is imported on 2026-01-02 at 10:00
  When the query is:
    """
    SELECT ?predicate ?value WHERE {
      { SELECT DISTINCT ?import ?file WHERE {
        GRAPH <urn:cascade:steps> { <urn:cascade:step:first-export> prov:generated ?file }
        GRAPH ?file { ?import prov:used ?document }
      } }
      GRAPH ?file {
        { ?import ?predicate ?value FILTER (!isBlank(?value)) }
        UNION
        { ?import prov:qualifiedAssociation/prov:hadPlan/rdfs:label ?value BIND(prov:qualifiedAssociation AS ?predicate) }
      }
    }
    """
  Then it answers:
    | predicate                 | value                                |
    | rdf:type                  | prov:Activity                        |
    | rdf:type                  | cascade:DocumentImport               |
    | rdfs:label                | "Apple Health export"                |
    | prov:startedAtTime        | "2026-01-02T10:00:00Z"^^xsd:dateTime |
    | prov:qualifiedAssociation | "fhir-r4"                            |
    | prov:wasAssociatedWith    | the runtime                          |
    | prov:used                 | the document of allergy "Peanut"     |
    | prov:used                 | the document of allergy "Latex"      |
    | prov:used                 | the document of allergy "Shellfish"  |
    | prov:used                 | the document of allergy "Mango"      |
passa download's import writes its label, its start, its association and the document it kept
Example: a download's import writes its label, its start, its association and the document it kept
  Given a new pod for Finn on 2026-06-01 at 09:00
  When the download "allergy-summary.xml" is imported on 2026-06-07 at 09:00
  When the query is:
    """
    SELECT ?predicate ?value WHERE {
      { SELECT DISTINCT ?import ?file WHERE {
        GRAPH <urn:cascade:steps> { <urn:cascade:step:allergy-summary.xml> prov:generated ?file }
        GRAPH ?file { ?import prov:used ?document }
      } }
      GRAPH ?file {
        { ?import ?predicate ?value FILTER (!isBlank(?value)) }
        UNION
        { ?import prov:qualifiedAssociation/prov:hadPlan/rdfs:label ?value BIND(prov:qualifiedAssociation AS ?predicate) }
      }
    }
    """
  Then it answers:
    | predicate                 | value                                |
    | rdf:type                  | prov:Activity                        |
    | rdf:type                  | cascade:DocumentImport               |
    | rdfs:label                | "C-CDA download"                     |
    | prov:startedAtTime        | "2026-06-07T09:00:00Z"^^xsd:dateTime |
    | prov:qualifiedAssociation | "ccda"                               |
    | prov:wasAssociatedWith    | the runtime                          |
    | prov:used                 | the document "allergy-summary.xml"   |
passa pull's import uses its bundle.json as its one document, and its pull.json as none
Example: a pull's import uses its bundle.json as its one document, and its pull.json as none
  Given a new pod for Finn on 2026-06-01 at 09:00
  When the pull "allergy-pull" is imported on 2026-06-08 at 09:00
  When the query is:
    """
    SELECT ?predicate ?value WHERE {
      { SELECT DISTINCT ?import ?file WHERE {
        GRAPH <urn:cascade:steps> { <urn:cascade:step:allergy-pull> prov:generated ?file }
        GRAPH ?file { ?import prov:used ?document }
      } }
      GRAPH ?file {
        { ?import ?predicate ?value FILTER (!isBlank(?value)) }
        UNION
        { ?import prov:qualifiedAssociation/prov:hadPlan/rdfs:label ?value BIND(prov:qualifiedAssociation AS ?predicate) }
      }
    }
    """
  Then it answers:
    | predicate                 | value                                   |
    | rdf:type                  | prov:Activity                           |
    | rdf:type                  | cascade:DocumentImport                  |
    | rdfs:label                | "FHIR pull"                             |
    | prov:startedAtTime        | "2026-06-08T09:00:00Z"^^xsd:dateTime    |
    | prov:qualifiedAssociation | "fhir-r4"                               |
    | prov:wasAssociatedWith    | the runtime                             |
    | prov:used                 | the document "allergy-pull/bundle.json" |
  And the pod neither names nor stores the document "allergy-pull/pull.json"

A12. An entry writes its session's description

Ruled by How everything in a pod is named, rows record from an entry, act

The session is a cascade:HandEntrySession and a prov:Activity, with what else the entry says of it. Each draft becomes a record (N2) with its version and a first revision, at the session's start, generated by the session.

Why the rest. Escaping closes a verified collision, ("a|b") and ("a","b") named one thing; a list carries its count so two lists back to back are unambiguous; the rule IRI makes two rules of equal arity never collide and lets a v8 name say which rule made it (ni: names take none, being content). Base URLs are normalised because :443 and none are one server, and userinfo is refused because a credential must never be a name input. The host is an ASCII reg-name, or a bracketed IPv6 address or IPvFuture with no zone id, and the port is empty (no port) or ASCII digits read as an integer, leading zeros dropped, above 65535 refused, then the scheme's default dropped, so :0443 and none are one server too and a URL two parsers read apart names nothing. A contained resource is scoped by its container's source version because a renumbered one would otherwise become a revision of another record. An entry hashes a session the app minted because the subject and a timestamp collide across writers in one instant. Custodian and patient in a C-CDA name stop two patients' id-less statements from one clinic fusing. A C-CDA entry is named by its CDA id across documents where a FHIR document's entry is not, because the two promises differ and the measurements differ (research 4 on #130): FHIR says a document's ids are unique within that bundle only, and converters mint them at random per run; CDA's networks say "organizations SHALL send the same ID for clinical data which has not changed", HL7's companion guide makes it a SHOULD, and in the only public pairs from one system every observation, medication and procedure kept its id (verified, counted: Greenway, 77 of 91 statements; Allscripts, 26 of 26; Synthea a month on, 97%), as did every record with a source id in two downloads seven weeks apart from one EHR (verified, cascade-cli #121). What failed was the wrappers, a concern act or a vitals organizer re-minted per export, which the matcher joins like any duplicate, and an id reused for two different entries (verified, counted: 2 in Synthea; 22 of 344 within one document in #121), which would fuse two facts under one name that no judgment could split; so the collision inside a document falls back to the document's name with a finding, and the rare reuse across documents is accepted over the per-document alternative's cost, thousands of records and a matcher judgment file per join on every re-download of a stable sender. A person's judgment keeps its IRI because whoever made it minted it once, so another pod can cite it. A document and a finding are named by content so the same one from two writers is one file, and Web Annotation wants exactly one IRI per annotation. A view entry is a fragment of its view because the view is rebuilt from the set, so its entries are too, and nothing outside the view may cite one; what an app names instead is the paragraph after this one. A retraction is an activity because PROV already says how an entity is invalidated. A fragment on a hashed parent (#source-version, #identifier-n, #padded-onsetDate, #absent-onsetDate) is a stated convention because the node is inside the parent's hashed content; RFC 6920's grammar has no fragment, and we say so. The opaque default hides a hospital from a casual reader of a shared view; the scheme declaration says in plain words that only a key hides it from a determined one. The address stays out of every name because a hostname in a name is a commitment nobody can undo. The vocabulary owns the rules because a pod reader has only the vocabulary; vectors are cross-checked because an implementation that minted its own vectors proves nothing.

How everything in a pod is named: the whole Why, the alternatives that lost and what would change our mind.

1 example: 1 pass, 0 fail, 0 not run

passan entry writes its session and, for each draft, a record with its version and a first revision
Example: an entry writes its session and, for each draft, a record with its version and a first revision
  Given a new pod for Ben on 2026-02-01 at 08:00
  When Ben enters "entry" on 2026-02-01 at 08:30
  When the query is:
    """
    SELECT ?record ?version ?at ?sessionStarted ?sessionLabel ?previous WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:entry> prov:generated ?sessionFile }
      GRAPH <urn:cascade:steps> { <urn:cascade:step:entry> prov:generated ?revisionFile }
      GRAPH ?sessionFile { ?session a prov:Activity, cascade:HandEntrySession ; prov:startedAtTime ?sessionStarted ; rdfs:label ?sessionLabel }
      GRAPH ?revisionFile {
        ?revision a cascade:Revision ; cascade:revisionOf ?record ; cascade:version ?version ; prov:generatedAtTime ?at ;
          prov:wasGeneratedBy ?session .
      }
      OPTIONAL { ?revision prov:wasRevisionOf ?previous }
    }
    """
  Then it answers:
    | record             | version                         | at                                   | sessionStarted                       | sessionLabel                 | previous |
    | allergy "Peanut"   | version 1 of allergy "Peanut"   | "2026-02-01T08:30:00Z"^^xsd:dateTime | "2026-02-01T08:30:00Z"^^xsd:dateTime | "entered in the Cascade app" |          |
    | condition "Asthma" | version 1 of condition "Asthma" | "2026-02-01T08:30:00Z"^^xsd:dateTime | "2026-02-01T08:30:00Z"^^xsd:dateTime | "entered in the Cascade app" |          |

A13. The pod's creation writes the subject as a cascade:Subject

Ruled by How everything in a pod is named, row pod identity

With it, the owner's profile, saying only who the owner is, where the pod's root is and where the preferences file is, and the preferences file, saying only that it is one and where the owner's type index is. The build writes the type index, from the views it writes (A15).

Why the rest. Escaping closes a verified collision, ("a|b") and ("a","b") named one thing; a list carries its count so two lists back to back are unambiguous; the rule IRI makes two rules of equal arity never collide and lets a v8 name say which rule made it (ni: names take none, being content). Base URLs are normalised because :443 and none are one server, and userinfo is refused because a credential must never be a name input. The host is an ASCII reg-name, or a bracketed IPv6 address or IPvFuture with no zone id, and the port is empty (no port) or ASCII digits read as an integer, leading zeros dropped, above 65535 refused, then the scheme's default dropped, so :0443 and none are one server too and a URL two parsers read apart names nothing. A contained resource is scoped by its container's source version because a renumbered one would otherwise become a revision of another record. An entry hashes a session the app minted because the subject and a timestamp collide across writers in one instant. Custodian and patient in a C-CDA name stop two patients' id-less statements from one clinic fusing. A C-CDA entry is named by its CDA id across documents where a FHIR document's entry is not, because the two promises differ and the measurements differ (research 4 on #130): FHIR says a document's ids are unique within that bundle only, and converters mint them at random per run; CDA's networks say "organizations SHALL send the same ID for clinical data which has not changed", HL7's companion guide makes it a SHOULD, and in the only public pairs from one system every observation, medication and procedure kept its id (verified, counted: Greenway, 77 of 91 statements; Allscripts, 26 of 26; Synthea a month on, 97%), as did every record with a source id in two downloads seven weeks apart from one EHR (verified, cascade-cli #121). What failed was the wrappers, a concern act or a vitals organizer re-minted per export, which the matcher joins like any duplicate, and an id reused for two different entries (verified, counted: 2 in Synthea; 22 of 344 within one document in #121), which would fuse two facts under one name that no judgment could split; so the collision inside a document falls back to the document's name with a finding, and the rare reuse across documents is accepted over the per-document alternative's cost, thousands of records and a matcher judgment file per join on every re-download of a stable sender. A person's judgment keeps its IRI because whoever made it minted it once, so another pod can cite it. A document and a finding are named by content so the same one from two writers is one file, and Web Annotation wants exactly one IRI per annotation. A view entry is a fragment of its view because the view is rebuilt from the set, so its entries are too, and nothing outside the view may cite one; what an app names instead is the paragraph after this one. A retraction is an activity because PROV already says how an entity is invalidated. A fragment on a hashed parent (#source-version, #identifier-n, #padded-onsetDate, #absent-onsetDate) is a stated convention because the node is inside the parent's hashed content; RFC 6920's grammar has no fragment, and we say so. The opaque default hides a hospital from a casual reader of a shared view; the scheme declaration says in plain words that only a key hides it from a determined one. The address stays out of every name because a hostname in a name is a commitment nobody can undo. The vocabulary owns the rules because a pod reader has only the vocabulary; vectors are cross-checked because an implementation that minted its own vectors proves nothing.

How everything in a pod is named: the whole Why, the alternatives that lost and what would change our mind.

1 example: 1 pass, 0 fail, 0 not run

passthe pod's creation files its subject
Example: the pod's creation files its subject
  Given a new pod for Ben on 2026-02-01 at 08:00
  When the query is:
    """
    SELECT ?subject WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:pod> prov:generated ?file }
      GRAPH ?file { ?subject a cascade:Subject }
    }
    """
  Then it answers:
    | subject |
    | Ben     |

A14. Some steps are refused, and a refused step writes no revision and no import

No decision note rules this: it is mechanics every runtime follows alike.

Refused are: an export, a download or a pull no importer recognises, or one its importer cannot read, as an Apple Health export whose export.xml it cannot read, a downloaded file that is not well-formed or a pull whose pull.json names no FHIR base; a connect whose connect.json names no FHIR base that can be normalised or no client id, whose capability.json is no CapabilityStatement, or whose smart-configuration.json is no JSON object; a document no adapter of its media type accepts, as a CDA that is not a C-CDA, or one the Bridge fails on (a bridge:documentFailure); a graph holding a statement about no record, version, arrival, document or import; a record or draft of a type the pod files nowhere; one import's documents disagreeing on the import's description; an entry holding other than one activity; and an entry whose activity states a property by which the layout files an activity elsewhere than an entry's.

9 examples: 9 pass, 0 fail, 0 not run

passa Bridge graph holding a statement about nothing the pod files
Example: a Bridge graph holding a statement about nothing the pod files
  Given a new pod for Finn on 2026-06-01 at 09:00
  When the export "stray-statement" is imported on 2026-06-02 at 09:00
  Then that step is refused
  And that step wrote no file
  And the pod holds no revision
passa record of a type the pod files nowhere
Example: a record of a type the pod files nowhere
  Given a new pod for Finn on 2026-06-01 at 09:00
  When the export "type-filed-nowhere" is imported on 2026-06-03 at 09:00
  Then that step is refused
  And that step wrote no file
  And the pod holds no revision
passone import's documents disagreeing on the import's description, so not even the agreeing one is written
Example: one import's documents disagreeing on the import's description, so not even the agreeing one is written
  Given a new pod for Finn on 2026-06-01 at 09:00
  When the export "import-disagreement" is imported on 2026-06-04 at 09:00
  Then that step is refused
  And that step wrote no file
  And the pod holds no revision
passa downloaded file that is not well-formed
Example: a downloaded file that is not well-formed
  Given a new pod for Finn on 2026-06-01 at 09:00
  When the download "not-well-formed.xml" is imported on 2026-06-04 at 10:00
  Then that step is refused
  And that step wrote no file
  And the pod holds no revision
passa downloaded CDA that is not a C-CDA, which no adapter accepts
Example: a downloaded CDA that is not a C-CDA, which no adapter accepts
  Given a new pod for Finn on 2026-06-01 at 09:00
  When the download "not-a-ccda.xml" is imported on 2026-06-04 at 11:00
  Then that step is refused
  And that step wrote no file
  And the pod holds no revision
passa pull whose pull.json names no FHIR base
Example: a pull whose pull.json names no FHIR base
  Given a new pod for Finn on 2026-06-01 at 09:00
  When the pull "pull-without-base" is imported on 2026-06-08 at 10:00
  Then that step is refused
  And that step wrote no file
  And the pod holds no revision
passa connect whose connect.json names no client id
Example: a connect whose connect.json names no client id
  Given a new pod for Finn on 2026-06-01 at 09:00
  When the connect "connect-without-client-id" is made on 2026-06-08 at 08:55
  Then that step is refused
  And that step wrote no file
  And the pod holds no revision
passan entry holding two activities
Example: an entry holding two activities
  Given a new pod for Finn on 2026-06-01 at 09:00
  When Finn enters "entry-of-two-activities" on 2026-06-05 at 09:00
  Then that step is refused
  And that step wrote no file
  And the pod holds no revision
passan entry whose session states prov:used, by which the layout files an import
Example: an entry whose session states prov:used, by which the layout files an import
  Given a new pod for Finn on 2026-06-01 at 09:00
  When Finn enters "entry-session-filed-elsewhere" on 2026-06-06 at 09:00
  Then that step is refused
  And that step wrote no file
  And the pod holds no revision

A15. The build writes a view once the pod holds a record of its kind, and at every build after

Ruled by What a judgment is, and what it borrows, row what a judgment, a finding or a view came from

Records are never removed, so nothing a build wrote goes stale. The labels file, and each view pod-layout.ttl marks cascade:writtenAlways, as the patient-profile view, are written at every build: a pod always has a subject. The type index registers only the views written. So a kind the layout adds changes no pod that holds none of it. A view names each reference version it was built with by prov:wasDerivedFrom and names no act with prov:used; the example of that is in conformance/alex-rivera/alex-rivera.feature, "each view and the labels file used the reference versions current at the end".

Why: What a judgment is, and what it borrows, with the alternatives that lost and what would change our mind.

1 example: 1 pass, 0 fail, 0 not run

passa pod of an allergy and a condition holds those two views, the patient-profile view and the labels, and no other
Example: a pod of an allergy and a condition holds those two views, the patient-profile view and the labels, and no other
  Given a new pod for Ben on 2026-02-01 at 08:00
  When Ben enters "entry" on 2026-02-01 at 08:30
  And the query is:
    """
    SELECT ?view WHERE {
      GRAPH ?view { ?view a cascade:View }
    }
    """
  Then it answers:
    | view                                               |
    | <https://pod.example/clinical/allergies.ttl>       |
    | <https://pod.example/clinical/conditions.ttl>      |
    | <https://pod.example/clinical/labels.ttl>          |
    | <https://pod.example/clinical/patient-profile.ttl> |

A16. A connect writes its act and a version of its server's record holding what the server reported

Ruled by When a source moves, switches vendor or issues a new edition, row server; How everything in a pod is named, row server, organisation

A connect is a cascade:ConnectToServer and a prov:Activity, named as N7 says, started at the step's time. It writes its server's record, named by cascade:ServerNamingRule from connect.json's fhirBase and stating that base, normalised, as its cascade:serverBaseUrl, unless the pod holds it; and a version of it, with a revision as A2 to A5 say, generated by the connect. The version holds what capability.json, the server's CapabilityStatement, says, as the server wrote it: implementation.url as cascade:selfAssertedBaseUrl; software.name and software.version as cascade:serverSoftwareName and cascade:serverSoftwareVersion; and as cascade:authorizationEndpoint, the authorization_endpoint of smart-configuration.json, the server's SMART App Launch 2 discovery document, or, where the connect saved none or it names none, the authorize valueUri of the oauth-uris extension on the security of capability.json's first rest whose mode is server; each only where it is a string that is not empty. It holds connect.json's clientId as cascade:connectClientId. A connect whose version is the one the server's record is at writes nothing, not even itself, as an import that kept nothing; a connect with no pull is complete.

Why the client's address, and the self-URL only as evidence. Hashing the server's self-asserted base instead of the client's address was measured and lost (research 2): it survives a path edit and not a hosting move (verified, probed: 19 of 19 old Epic hosts now report the new host as themselves), MEDITECH never sends it, eClinicalWorks reports one base for every practice (both verified, probed), and Epic documents that it can differ per client id; as a judgment input it keeps the benefit and makes the failure retractable.

When a source moves, switches vendor or issues a new edition: the whole Why, the alternatives that lost and what would change our mind.

6 examples: 6 pass, 0 fail, 0 not run

passa connect's version holds what the server reported and the client id it was reported to
Example: a connect's version holds what the server reported and the client id it was reported to
  Given a new pod for Finn on 2026-06-01 at 09:00
  When the connect "hospital" is made on 2026-06-08 at 08:55
  When the query is:
    """
    SELECT ?predicate ?value WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:hospital> prov:generated ?file }
      GRAPH ?file { ?version prov:specializationOf ?server ; ?predicate ?value }
    }
    """
  Then it answers:
    | predicate                     | value                                                     |
    | prov:specializationOf         | <urn:uuid:4461f3ef-4caf-8a24-93f1-da07a8455cc5>           |
    | cascade:selfAssertedBaseUrl   | "https://fhir.example-hospital.example/api/FHIR/R4/"      |
    | cascade:authorizationEndpoint | "https://login.example-hospital.example/oauth2/authorize" |
    | cascade:serverSoftwareName    | "Example EHR"                                             |
    | cascade:serverSoftwareVersion | "2026.2"                                                  |
    | cascade:connectClientId       | "cascade-app"                                             |
passa connect is an act that generated its server's revision, and names the runtime that performed it
Example: a connect is an act that generated its server's revision, and names the runtime that performed it
  Given a new pod for Finn on 2026-06-01 at 09:00
  When the connect "hospital" is made on 2026-06-08 at 08:55
  When the query is:
    """
    SELECT ?predicate ?value WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:hospital> prov:generated ?revisionFile, ?actFile }
      GRAPH ?revisionFile { [] cascade:revisionOf ?server ; prov:wasGeneratedBy ?connect }
      GRAPH ?actFile { ?connect ?predicate ?value }
    }
    """
  Then it answers:
    | predicate              | value                                |
    | rdf:type               | prov:Activity                        |
    | rdf:type               | cascade:ConnectToServer              |
    | prov:startedAtTime     | "2026-06-08T08:55:00Z"^^xsd:dateTime |
    | prov:wasAssociatedWith | the runtime                          |
passa server serving no SMART configuration names its authorization endpoint in its CapabilityStatement
Example: a server serving no SMART configuration names its authorization endpoint in its CapabilityStatement
  Given a new pod for Finn on 2026-06-01 at 09:00
  When the connect "hospital-without-smart-configuration" is made on 2026-06-08 at 08:55
  When the query is:
    """
    SELECT ?endpoint WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:hospital-without-smart-configuration> prov:generated ?file }
      GRAPH ?file { [] prov:specializationOf ?server ; cascade:authorizationEndpoint ?endpoint }
    }
    """
  Then it answers:
    | endpoint                                                 |
    | "https://fhir.example-hospital.example/oauth2/authorize" |
passa connect reporting what its server's record already says writes nothing
Example: a connect reporting what its server's record already says writes nothing
  Given a new pod for Finn on 2026-06-01 at 09:00
  And the connect "hospital" is made on 2026-06-08 at 08:55
  When the connect "hospital" is made on 2026-06-09 at 08:55 (hospital-again)
  Then that step wrote no file
passa connect reporting other than its server's record says writes a revision after the record's last
Example: a connect reporting other than its server's record says writes a revision after the record's last
  Given a new pod for Finn on 2026-06-01 at 09:00
  And the connect "hospital" is made on 2026-06-08 at 08:55
  When the connect "hospital-without-smart-configuration" is made on 2026-06-09 at 08:55
  When the query is:
    """
    SELECT ?server WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:hospital> prov:generated ?first }
      GRAPH ?first { ?previous a cascade:Revision ; cascade:revisionOf ?server }
      GRAPH <urn:cascade:steps> { <urn:cascade:step:hospital-without-smart-configuration> prov:generated ?second }
      GRAPH ?second { [] a cascade:Revision ; cascade:revisionOf ?server ; prov:wasRevisionOf ?previous }
    }
    """
  Then it answers:
    | server                                          |
    | <urn:uuid:4461f3ef-4caf-8a24-93f1-da07a8455cc5> |
passa connect after a pull from its server writes a version and a revision, and not the record again
Example: a connect after a pull from its server writes a version and a revision, and not the record again
  Given a new pod for Finn on 2026-06-01 at 09:00
  And the pull "allergy-pull" is imported on 2026-06-08 at 09:00
  When the connect "hospital" is made on 2026-06-08 at 09:30
  When the query is:
    """
    SELECT ?written WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:hospital> prov:generated ?file }
      {
        GRAPH ?file { [] prov:specializationOf <urn:uuid:4461f3ef-4caf-8a24-93f1-da07a8455cc5> }
        BIND ("version" AS ?written)
      } UNION {
        GRAPH ?file { [] a cascade:Revision }
        BIND ("revision" AS ?written)
      } UNION {
        GRAPH ?file { [] a cascade:Server }
        BIND ("record" AS ?written)
      }
    }
    """
  Then it answers:
    | written    |
    | "version"  |
    | "revision" |

A17. An import writes the record of each server its kept documents name, with no version, when the pod has none

Ruled by When a source moves, switches vendor or issues a new edition, row server; How everything in a pod is named, row server, organisation

Each document an import keeps (A10) that states a cascade:serverBaseUrl, as a pull's and an Apple Health export's do, names a server: the import writes that server's record, named and stating its base as A16 says, with no version, unless the pod holds it. So a server a connect wrote is not written again, and a server known only from a document has a record with no version. A base URL that cannot be normalised names no server, so the import writes no server record for it and is not refused.

Why the client's address, and the self-URL only as evidence. Hashing the server's self-asserted base instead of the client's address was measured and lost (research 2): it survives a path edit and not a hosting move (verified, probed: 19 of 19 old Epic hosts now report the new host as themselves), MEDITECH never sends it, eClinicalWorks reports one base for every practice (both verified, probed), and Epic documents that it can differ per client id; as a judgment input it keeps the benefit and makes the failure retractable.

When a source moves, switches vendor or issues a new edition: the whole Why, the alternatives that lost and what would change our mind.

2 examples: 2 pass, 0 fail, 0 not run

passa pull writes the record of the server it came from, with no version
Example: a pull writes the record of the server it came from, with no version
  Given a new pod for Finn on 2026-06-01 at 09:00
  When the pull "allergy-pull" is imported on 2026-06-08 at 09:00
  When the query is:
    """
    SELECT ?server ?base WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:allergy-pull> prov:generated ?file }
      GRAPH ?file { ?server a cascade:Server ; cascade:serverBaseUrl ?base }
      FILTER NOT EXISTS { ?version prov:specializationOf ?server }
    }
    """
  Then it answers:
    | server                                          | base                                       |
    | <urn:uuid:4461f3ef-4caf-8a24-93f1-da07a8455cc5> | "https://fhir.example-hospital.example/r4" |
passa pull after a connect to its server writes no server record
Example: a pull after a connect to its server writes no server record
  Given a new pod for Finn on 2026-06-01 at 09:00
  And the connect "hospital" is made on 2026-06-08 at 08:55
  When the pull "allergy-pull" is imported on 2026-06-08 at 09:00
  When the query is:
    """
    SELECT ?server WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:allergy-pull> prov:generated ?file }
      GRAPH ?file { ?server a cascade:Server }
    }
    """
  Then it answers nothing

A18. An import whose source reports states older than it reported before files one finding naming each record that went back

Ruled by Which revision of a record is current, row a source that goes backwards; What a pod costs as it grows, row findings bounded

A live pull is a document retrieved on a date (pav:retrievedOn) that answers as of no other instant (cascade:answeredAsOf); two are of one source when both name one transmitter, the same agent, or neither names one, as the ladder reads them (C2). An arrival from a live pull that carries a source change time, of a record holding revisions from live pulls of the same source stamped later, contradicts each of those. After its revisions and before its act (W1), the import files one cascade:FindingForReview whose oa:hasBody is cascade:SourceReportedOlderStates, whose oa:motivatedBy is oa:classifying, whose oa:hasTarget is, for each such arrival, the revision holding its state, the one A3 found or the one the import wrote, and whose cascade:contradictedEarlierRevision is each revision it contradicts, so naming each earlier act and each record that went back. It names no record a finding the pod holds already names with each revision the arrival contradicts, acknowledged or not, and is not filed when it would name none: a repeat pull of the rolled-back states files nothing. The current pick is unchanged (C2): a state the record held writes nothing, and one it never held is written and ranked below the later stamp. A copy by another path, an export or a transmitter's, contradicts nothing. It carries no time and names no act, and is named by cascade:FindingNamingRule from its triples.

Why a rollback is one finding, and the later state stays. A rollback is noticed by the same test that keeps a stale copy quiet: a source contradicting its own earlier report is one fact, so it is one finding and, if the person agrees with the source, one Before with the per-record orderings derived, where a copy that is merely behind is what the ladder already expects. The pod keeps showing the later state because a hospital that restores a backup has usually lost data it will re-enter. One finding per import that goes back, naming every earlier act, because a finding per earlier act made a 30-day restore about 30 findings; an acknowledged finding still stands, or a daily pull of the rolled-back state would file one again every day; and a skewed writer has one clock finding while one stands, where one per act is up to 365 a year (computed, #206).

Which revision of a record is current: the whole Why, the alternatives that lost and what would change our mind.

3 examples: 3 pass, 0 fail, 0 not run

passa pull after the hospital restored a backup files one finding, and shows the later states still
Example: a pull after the hospital restored a backup files one finding, and shows the later states still
  The restored pull reports the peanut allergy at its first state, which the pod holds, and the latex allergy at a
  state stamped between the first two pulls, which it never held.

  Given a new pod for Finn on 2026-06-01 at 09:00
  And the pull "hospital-first-pull" is imported on 2026-06-08 at 09:00
  And the pull "hospital-second-pull" is imported on 2026-06-15 at 09:00
  When the pull "hospital-restored-pull" is imported on 2026-06-20 at 09:00
  When the query is:
    """
    SELECT ?record ?older ?contradicted WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:hospital-restored-pull> prov:generated ?file }
      GRAPH ?file {
        ?finding oa:hasBody cascade:SourceReportedOlderStates ; oa:motivatedBy oa:classifying ;
                 oa:hasTarget ?olderRevision ; cascade:contradictedEarlierRevision ?contradictedRevision
      }
      ?olderRevision cascade:revisionOf ?record ; cascade:version ?older .
      ?contradictedRevision cascade:revisionOf ?record ; cascade:version ?contradicted .
    }
    """
  Then it answers:
    | record                  | older                                | contradicted                         |
    | allergy SNOMED 91935009 | version 1 of allergy SNOMED 91935009 | version 2 of allergy SNOMED 91935009 |
    | allergy "Latex"         | version 3 of allergy "Latex"         | version 2 of allergy "Latex"         |
  And these records have:
    | record                  | field   | value |
    | allergy SNOMED 91935009 | version | 2     |
    | allergy "Latex"         | version | 2     |
passpulling the rolled-back states again names only the record that went back since
Example: pulling the rolled-back states again names only the record that went back since
  The pull after the restore left out the mango allergy; the next pull returns it at its first state, beside the
  peanut and latex allergies at the states the earlier finding names.

  Given a new pod for Finn on 2026-06-01 at 09:00
  And the pull "hospital-first-pull" is imported on 2026-06-08 at 09:00
  And the pull "hospital-second-pull" is imported on 2026-06-15 at 09:00
  And the pull "hospital-restored-pull" is imported on 2026-06-20 at 09:00
  When the pull "hospital-restored-pull-again" is imported on 2026-06-21 at 09:00
  When the query is:
    """
    SELECT ?record ?older ?contradicted WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:hospital-restored-pull-again> prov:generated ?file }
      GRAPH ?file { ?finding oa:hasTarget ?olderRevision ; cascade:contradictedEarlierRevision ?contradictedRevision }
      ?olderRevision cascade:revisionOf ?record ; cascade:version ?older .
      ?contradictedRevision cascade:revisionOf ?record ; cascade:version ?contradicted .
    }
    """
  Then it answers:
    | record          | older                        | contradicted                 |
    | allergy "Mango" | version 1 of allergy "Mango" | version 2 of allergy "Mango" |
passan export of a state older than the one an earlier export holds files nothing
Example: an export of a state older than the one an earlier export holds files nothing
  Apple Health names itself as the transmitter of each export, so each export is a path of its own, and its copy of
  the peanut allergy stamped 4 January, after the export stamped 5 January, is a stale copy.

  Given a new pod for Ada on 2026-01-01 at 09:00
  And the export "first-export" is imported on 2026-01-02 at 10:00
  And the export "new-content" is imported on 2026-01-06 at 10:00
  When the export "stale-copy" is imported on 2026-01-08 at 10:00
  When the query is:
    """
    SELECT ?finding WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:stale-copy> prov:generated ?file }
      GRAPH ?file { ?finding a cascade:FindingForReview }
    }
    """
  Then it answers nothing

A19. An act whose revisions show the writer's clock behind files one finding, unless an act in its first-parent ancestry filed one no one answered

Ruled by Which revision of a record is current, row wrong writer clock; What a pod costs as it grows, row findings bounded

A revision's observation time is the writer's own clock when it is an entry session's start, an act's start, or the pav:retrievedOn of a live pull that names no transmitter (A18). Two checks run on each revision an act writes: one whose observation time is the writer's clock and precedes the cascade:observedAsOf of a head it names (prov:wasRevisionOf), and one from a live pull that names no transmitter whose source change time (pav:lastUpdateOn) is after the pull's pav:retrievedOn, each by at least one whole day; the second cannot tell a writer's slow clock from a source's fast one. After its revisions and before its act (W1), the act files a cascade:FindingForReview whose oa:hasBody is cascade:ClockBehind, whose oa:motivatedBy is oa:classifying, whose oa:hasTarget is each revision either check found, and whose cascade:writerClockBehindByAtLeastDays is the greatest whole number of days one of them shows; it files none when an act in the first-parent ancestry of its snapshot (cascade:firstParentSnapshot, N14) filed one that no person's judgment answers: a cascade:Acknowledged of cascade:ClockBehind naming the act that filed it, or a cascade:ClockDiscounted whose member is that act, each standing as C7 reads a person's judgment; an Acknowledged of another kind answers nothing here. So a writer has one unanswered at a time, and a clock that stays wrong is found once more after each answer; another writer's finding, received by a sync, silences nothing. Its name follows cascade:FindingNamingRule.

Why a rollback is one finding, and the later state stays. A rollback is noticed by the same test that keeps a stale copy quiet: a source contradicting its own earlier report is one fact, so it is one finding and, if the person agrees with the source, one Before with the per-record orderings derived, where a copy that is merely behind is what the ladder already expects. The pod keeps showing the later state because a hospital that restores a backup has usually lost data it will re-enter. One finding per import that goes back, naming every earlier act, because a finding per earlier act made a 30-day restore about 30 findings; an acknowledged finding still stands, or a daily pull of the rolled-back state would file one again every day; and a skewed writer has one clock finding while one stands, where one per act is up to 365 a year (computed, #206).

Which revision of a record is current: the whole Why, the alternatives that lost and what would change our mind.

6 examples: 6 pass, 0 fail, 0 not run

passa pull on a clock behind the head it revises files a finding of the days between
Example: a pull on a clock behind the head it revises files a finding of the days between
  Given a new pod for Finn on 2026-05-31 at 09:00
  And the pull "hospital-unstamped-pull" is imported on 2026-06-10 at 09:00
  When the pull "hospital-pull-on-a-clock-behind" is imported on 2026-06-11 at 09:00
  When the query is:
    """
    SELECT ?days ?record ?version WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:hospital-pull-on-a-clock-behind> prov:generated ?file }
      GRAPH ?file {
        ?finding oa:hasBody cascade:ClockBehind ; oa:motivatedBy oa:classifying ;
                 cascade:writerClockBehindByAtLeastDays ?days ; oa:hasTarget ?revision
      }
      ?revision cascade:revisionOf ?record ; cascade:version ?version .
    }
    """
  Then it answers:
    | days | record           | version                       |
    | 9    | allergy "Sesame" | version 2 of allergy "Sesame" |
passa pull returning a record its source stamped after the pull's own time files a finding
Example: a pull returning a record its source stamped after the pull's own time files a finding
  Given a new pod for Finn on 2026-05-31 at 09:00
  When the pull "hospital-pull-stamped-after-it" is imported on 2026-06-12 at 09:00
  When the query is:
    """
    SELECT ?days ?record WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:hospital-pull-stamped-after-it> prov:generated ?file }
      GRAPH ?file { ?finding oa:hasBody cascade:ClockBehind ; cascade:writerClockBehindByAtLeastDays ?days ; oa:hasTarget ?revision }
      ?revision cascade:revisionOf ?record .
    }
    """
  Then it answers:
    | days | record           |
    | 5    | allergy "Sesame" |
passa writer whose earlier act filed a clock finding files no second
Example: a writer whose earlier act filed a clock finding files no second
  Given a new pod for Finn on 2026-05-31 at 09:00
  And the pull "hospital-unstamped-pull" is imported on 2026-06-10 at 09:00
  And the pull "hospital-pull-on-a-clock-behind" is imported on 2026-06-11 at 09:00
  When the pull "hospital-pull-stamped-after-it" is imported on 2026-06-12 at 09:00
  When the query is:
    """
    SELECT ?finding WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:hospital-pull-stamped-after-it> prov:generated ?file }
      GRAPH ?file { ?finding a cascade:FindingForReview }
    }
    """
  Then it answers nothing
passa writer whose clock finding the person answered files one more
Example: a writer whose clock finding the person answered files one more
  Finn discounted the clock of the act that filed the first finding, which answers it.

  Given a new pod for Finn on 2026-05-31 at 09:00
  And the pull "hospital-unstamped-pull" is imported on 2026-06-10 at 09:00
  And the pull "hospital-pull-on-a-clock-behind" is imported on 2026-06-11 at 09:00
  And Finn files the judgment "discount-the-clock-behind" on 2026-06-11 at 12:00
  When the pull "hospital-pull-stamped-after-it" is imported on 2026-06-12 at 09:00
  When the query is:
    """
    SELECT ?days ?record WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:hospital-pull-stamped-after-it> prov:generated ?file }
      GRAPH ?file { ?finding oa:hasBody cascade:ClockBehind ; cascade:writerClockBehindByAtLeastDays ?days ; oa:hasTarget ?revision }
      ?revision cascade:revisionOf ?record .
    }
    """
  Then it answers:
    | days | record           |
    | 5    | allergy "Sesame" |
passa writer whose clock finding the person acknowledged by its kind files one more
Example: a writer whose clock finding the person acknowledged by its kind files one more
  Finn acknowledged a warning of kind clock behind over the act that filed the first finding, which answers it.

  Given a new pod for Finn on 2026-05-31 at 09:00
  And the pull "hospital-unstamped-pull" is imported on 2026-06-10 at 09:00
  And the pull "hospital-pull-on-a-clock-behind" is imported on 2026-06-11 at 09:00
  And Finn files the judgment "acknowledge-the-clock-behind" on 2026-06-11 at 12:00
  When the pull "hospital-pull-stamped-after-it" is imported on 2026-06-12 at 09:00
  When the query is:
    """
    SELECT ?days ?record WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:hospital-pull-stamped-after-it> prov:generated ?file }
      GRAPH ?file { ?finding oa:hasBody cascade:ClockBehind ; cascade:writerClockBehindByAtLeastDays ?days ; oa:hasTarget ?revision }
      ?revision cascade:revisionOf ?record .
    }
    """
  Then it answers:
    | days | record           |
    | 5    | allergy "Sesame" |
passa writer whose clock finding the person acknowledged under another kind files no second
Example: a writer whose clock finding the person acknowledged under another kind files no second
  Finn acknowledged a warning of kind matcher judgments no longer reached over the act that filed the first finding, which answers nothing about a clock.

  Given a new pod for Finn on 2026-05-31 at 09:00
  And the pull "hospital-unstamped-pull" is imported on 2026-06-10 at 09:00
  And the pull "hospital-pull-on-a-clock-behind" is imported on 2026-06-11 at 09:00
  And Finn files the judgment "acknowledge-the-clock-behind-under-another-kind" on 2026-06-11 at 12:00
  When the pull "hospital-pull-stamped-after-it" is imported on 2026-06-12 at 09:00
  When the query is:
    """
    SELECT ?finding WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:hospital-pull-stamped-after-it> prov:generated ?file }
      GRAPH ?file { ?finding a cascade:FindingForReview }
    }
    """
  Then it answers nothing

A20. A pull writes the record of each Organization it holds, and a lab result names the organization that performed it

Ruled by When a source moves, switches vendor or issues a new edition, row organisation; How everything in a pod is named, row server, organisation

An Organization a pull's Bundle holds at the top of an entry, with an id and a fullUrl that is no urn:uuid, is a cascade:Organization record named by cascade:OrganizationNamingRule from the pull's fhirBase, normalised, Organization and its id, whatever names it, unless another entry holds an Organization with that id, when neither is a record. Like any record from a server it states its cascade:sourceUrl, <base>/Organization/<id>, and its cascade:sourceRecordId, and its version holds what the resource says, as A2 to A5 write any record's: its name as foaf:name, each identifier as org:identifier, typed by its system, and each address as cascade:organizationAddress. A lab result from a pull whose performers name one Organization, as Organization/<id> or <base>/Organization/<id>, a version's /_history/ dropped, holds that organization's record as prov:wasAttributedTo on its version. The reference alone names it, so the result is attributed whether or not the pull holds the Organization, unlike a document's interpretation, whose performer names a record only where it resolves to an Organization of the document. A reference made from an entry whose fullUrl is a urn:uuid, to an Organization the pull holds under one, or to an id two entries hold an Organization under names none, and performers naming two name none. The organization is content of the version, so a later pull naming another performer writes a revision of the same record. An organization record is never the subject's (M2).

Why an organisation is a record. An organisation is a record because a proposal, a view and a Same now point at one, and the source gives an OID or NPI to name it by; its name and address sit on versions so a merger's rename is history.

When a source moves, switches vendor or issues a new edition: the whole Why, the alternatives that lost and what would change our mind.

2 examples: 2 pass, 0 fail, 0 not run

passa pull's Organization is a record named by its server and id, with a version of what it says
Example: a pull's Organization is a record named by its server and id, with a version of what it says
  Given a new pod for Finn on 2026-06-01 at 09:00
  When the pull "hospital-pull-with-a-lab" is imported on 2026-06-08 at 09:00
  When the query is:
    """
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    PREFIX org: <http://www.w3.org/ns/org#>
    SELECT ?organization ?predicate ?value WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:hospital-pull-with-a-lab> prov:generated ?recordFile, ?versionFile }
      GRAPH ?recordFile { ?organization a cascade:Organization }
      GRAPH ?versionFile { [] prov:specializationOf ?organization ; ?predicate ?value }
      FILTER (?predicate != prov:specializationOf)
    }
    """
  Then it answers:
    | organization                                    | predicate                   | value                                             |
    | <urn:uuid:7b40ed6a-7e98-86bb-aa22-26e771ea51a3> | foaf:name                   | "Example Hospital Laboratory"                     |
    | <urn:uuid:7b40ed6a-7e98-86bb-aa22-26e771ea51a3> | org:identifier              | "1234567893"^^<http://hl7.org/fhir/sid/us-npi>    |
    | <urn:uuid:7b40ed6a-7e98-86bb-aa22-26e771ea51a3> | cascade:organizationAddress | "12 Harbour Road, Bellingham, WA 98225"           |
passa pulled lab result's version is attributed to the organization its performer names
Example: a pulled lab result's version is attributed to the organization its performer names
  Given a new pod for Finn on 2026-06-01 at 09:00
  When the pull "hospital-pull-with-a-lab" is imported on 2026-06-08 at 09:00
  When the query is:
    """
    SELECT ?organization WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:hospital-pull-with-a-lab> prov:generated ?file }
      GRAPH ?file { [] prov:specializationOf ?lab ; prov:wasAttributedTo ?organization }
      ?lab a cascade:LaboratoryTestResult .
    }
    """
  Then it answers:
    | organization                                    |
    | <urn:uuid:7b40ed6a-7e98-86bb-aa22-26e771ea51a3> |

A21. A document names the part each party played on an association of the act that generated it, and is attributed to its author and custodian

Ruled by When a source moves, switches vendor or issues a new edition, row the part a party played in a document

The document's prov:wasGeneratedBy names the act, a blank node with no rdf:type. Each prov:qualifiedAssociation of the act names a party as prov:agent and the part it played as prov:hadRole: cascade:AuthorRole, cascade:CustodianRole or cascade:TransmitterRole. The document is prov:wasAttributedTo its author and its custodian, each by the node its association names, and never to its transmitter. Each writer of the document writes its own act, the importer's facts one and a record's mapping another, so a document may carry several, and a reader walks prov:wasGeneratedBy/prov:qualifiedAssociation, which does not count them. The act and its associations are kept in the document's file with it (A10). No role is on an attribution, since PROV allows a role on none.

Why the part a party played sits on the act that generated the document. PROV-DM allows a role on a usage, a generation, an invalidation, an association, a start and an end, and never on an attribution (https://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-attribute); PROV-O gives prov:hadRole the domains prov:Influence and the union of prov:Association and prov:InstantaneousEvent, which an attribution is outside. So a role names the party's part in the act that made the document, and prov:wasAttributedTo still says who the document is ascribed to, for the many queries that need no role. Looked at:

When a source moves, switches vendor or issues a new edition: the whole Why, the alternatives that lost and what would change our mind.

1 example: 1 pass, 0 fail, 0 not run

passan export's document names its hospital as author and Apple Health as transmitter, and is attributed to the hospital alone
Example: an export's document names its hospital as author and Apple Health as transmitter, and is attributed to the hospital alone
  Given a new pod for Ada on 2026-01-01 at 09:00
  When the export "first-export" is imported on 2026-01-02 at 10:00
  When the query is:
    """
    SELECT ?document ?role ?party ?attributed WHERE {
      GRAPH <urn:cascade:steps> { <urn:cascade:step:first-export> prov:generated ?file }
      GRAPH ?file { ?document prov:wasGeneratedBy/prov:qualifiedAssociation ?association .
                    ?association prov:hadRole ?role ; prov:agent ?agent .
                    ?agent rdfs:label ?party
                    BIND (EXISTS { ?document prov:wasAttributedTo ?agent } AS ?attributed) }
      ?revision prov:wasDerivedFrom ?document ; cascade:version/cascade:allergenName "Peanut" .
    }
    """
  Then it answers:
    | document                         | role                    | party              | attributed |
    | the document of allergy "Peanut" | cascade:AuthorRole      | "Example Hospital" | true       |
    | the document of allergy "Peanut" | cascade:TransmitterRole | "Apple Health"     | false      |