Definition
Artifact provenance is the recorded history of how an artifact came to exist. An artifact here is any file or data object that a process produces or uses, such as a compiled program, a dataset or a table of results. The history names the process that produced the artifact, its inputs, tools and settings, who or what ran it, and when. It is a chain of links, each stating that one run read particular inputs and wrote a particular output. A file name or a timestamp is not provenance.
The idea
A results file named results-B.csv reports a mean delay for version B of a program. Three histories can produce that file: version B was built and run; an old executable built from an earlier version A was run by mistake and its output saved under the new name; or someone copied an earlier results file and renamed it. All three leave a file with the same name in the same folder. Whoever saves a file chooses its name and folder, and a modification time can be changed with one command, so none of these labels tells the three histories apart.
Provenance replaces the name with evidence of production. Each step records, at the moment it runs, what it actually read and wrote, and every artifact is identified by its content instead of its name, usually by a digest: a short, fixed-length value that a cryptographic hash function §5.1 computes from the bytes, so that different bytes give different digests in practice. A reader can then follow the records backward from the result to the source code and the data, checking each link against the bytes in hand.
The word comes from the art trade, where the provenance of a painting is its documented chain of owners. As with a painting, a gap in the chain weakens the claim; unlike a painting’s, an artifact’s provenance records how the artifact was made, not who owned it.
How it works
The World Wide Web Consortium (W3C) published a general vocabulary for provenance in 2013, the PROV data model (PROV is short for provenance) [402]. It describes any history with three kinds of thing:
an entity is a thing whose history is recorded, such as a file or a dataset;
an activity happens over a period of time and uses or produces entities, such as one compilation or one measurement run;
an agent is a person, an organization or a piece of software that bears responsibility for an activity.
Its relations state that an activity used an entity, that an entity was generated by an activity, that an activity was associated with an agent, and that one entity was derived from another.
Recording the provenance of one result takes these steps, carried out while the work runs, not reconstructed afterwards.
Identify each artifact by content. Compute a digest of every input, executable and output, for example with SHA-256 §5.2 (Secure Hash Algorithm with a 256-bit output).
Record each build: the source revision, meaning the exact version of the source code in a version-control system such as Git; whether the working copy held uncommitted changes; the compiler and its version; the build options; and the digest of the executable produced.
Record each run: the digest of the executable actually loaded, the command line, the digest of every input file read, every input that is not a file (environment variables, random seeds, data fetched over a network), the machine, the start and end times, whether the run finished successfully, and the person, service or build system responsible.
Record each later step. Every parser, filter or summary script that turns raw output into the reported number is itself a run and is recorded in the same way.
Protect the records. Store them where they cannot be changed silently, such as an append-only log §8.13, or sign them with a digital signature §5.14, so that a reader can check who issued each record and that it has not been altered.
To check a result, a reader starts from the digest of the file that holds the number and follows the records backward, link by link, to the source revision and the inputs.
Worked example
Source revision A of a program waits 2 ms between two actions; source revision B waits 20 ms. A report states that revision B gave a mean measured delay of 2.1 ms. The results file holds three measured delays, 2.0, 2.1 and 2.2 ms, and their mean is ms. That mean lies close to the 2 ms of revision A and about times below the 20 ms of revision B, so the number needs an explanation before anyone relies on it.
The provenance records give the explanation. The digests below are invented for the example and shortened to 8 hexadecimal digits.
The results file has digest
5be0c2a1. The record of run R lists5be0c2a1as its output, so the link from the file to run R holds.The record of run R states that the executable loaded had digest
9e41d07f.Build record 1 states that source revision A produced an executable with digest
9e41d07f. Build record 2 states that revision B produced an executable with digestc3a8f615.
Run R therefore ran the executable built from revision A. Revision B had been built, but its executable was never installed on the test machine. The link from output to run holds; the link from run to source leads to A, not B, so the report’s claim fails. The digest of the results file alone could not have shown this, because it identifies the file, not where its numbers came from. The repair is to install the executable with digest c3a8f615, run again, and report the new run with its own record.
Stated precisely
Model the records as a directed graph whose nodes are artifacts, runs and agents. An arrow from an artifact to a run means that the run read the artifact, an arrow from a run to an artifact that the run wrote it, and an arrow from a run to an agent that the agent was responsible for the run. Every artifact node carries its recorded digest. A claim that output was produced from source revision and inputs is supported when four conditions hold.
The digest of the artifact in hand equals the digest recorded for .
Following arrows backward from reaches and every , through runs whose records exist.
Each record was made at the time of its run, by the process that performed the run or by a system that observed it.
Every input that a run on those paths read appears in that run’s record.
The support rests on four assumptions. First, whoever wrote each record saw what really happened: a record written by the build service that ran the compiler is stronger evidence than a statement a person wrote later. Second, the hash function is collision resistant §5.5, meaning that nobody can find two different inputs with the same digest, so equal digests mean equal bytes. Third, the records have not been altered since they were made. Fourth, condition 4 is backed by a mechanism, not by good intentions: either an environment that stops a run from reading anything unlisted, which for compilation is called a hermetic build §13.7, or a trace of every file and network access the run made.
Limits and common mistakes
Provenance shows where an artifact came from, not that the artifact is correct. A complete, authentic record of a run of a faulty program, or of a miscalibrated instrument, faithfully documents a wrong result.
A record is a statement by whoever wrote it. A digital signature on the record proves who issued it and that it has not changed since, not that its statements are true.
Names, folders and timestamps are labels, not links. A copy keeps its name, any file can be renamed, and a file’s owner can set its modification time to any value.
A source revision covers only the files under version control. Uncommitted edits, generated files and files the version-control system ignores can all change the executable without changing the revision identifier. Inputs that are not files, such as the compiler version, system libraries, the current date and random seeds, are just as easy to leave out.
A missing link must be recorded as missing. Filling it in from matching names or plausible numbers turns a gap into an unsupported claim.
Provenance is often confused with two related terms. Data lineage §13.18 traces how data flow through processing steps; a chain of custody §13.5 adds who held the evidence at each moment and whether each change was permitted.
Questions answered
Can the reported output be linked to the exact source and inputs of the run?
The reported output can be linked to the exact source and inputs of the run only if records made at the time connect every step, and every digest in those records matches the bytes in hand. A digest is a short value computed from a file’s bytes by a cryptographic hash function, so equal digests mean identical files. The chain needs four links.
Output to run: the digest of the file holding the reported number equals the output digest in the record of a particular run, and the same holds for every script that turned raw output into that number.
Run to executable: the run record gives the digest of the executable actually loaded.
Executable to source: a build record shows that this executable was built from a named source revision, without uncommitted changes, by a named compiler with named options.
Run to inputs: the run record lists the digest of every input the run read, including generated files, configuration, random seeds and data fetched over a network.
A file name, a folder or a timestamp establishes none of these links. Where a link is missing, the output is linked only as far as the records reach, and the gap must be reported, not inferred from consistent names.
Related entries: Content-addressed identity (§13.2), Chain of custody (§13.5), Source closure (§13.6), Data lineage (§13.18), Hermetic build (§13.7), Cryptographic hash function (§5.1). Further reading: [402].