Pipeline

What turns inputs into outputs

The functions, by the names the code gives them. Each one reads inputs someone wrote and writes outputs nobody edits; each page says what it reads, what it writes, where its code is, and every element it produced. The invariant in one view: agents write source, the pipeline regenerates, humans approve.

End to end

Inputs
Function
Outputs

prepare_data() R function

Reads each dataset the specs name from its source lane, applies the documented derivations, and hands the prepared frames to the ARD builder; every ARD records each frame's hash and row count.

Inputs
Function
Outputs
  • prepared datasetsin memory; hash and rows recorded in every ARD envelope

Code: pipeline/R/data-prep.R

Produced

build_ard() R function

Runs each analysis in analysis.yaml — built-in or the display's own custom.R — over the prepared datasets and stacks the results into the ARD, one row per statistic, with the population record.

Inputs
Function
Outputs
  • ARD rowsopencsr/ard/v1, plus the population record

Code: pipeline/R/ard.R

Produced

render_display() R function

Draws each variant of the display from the ARD and display.yaml: columns, rows, formats, footnotes, and the figure where the display is one.

Inputs
Function
Outputs
  • table.html per variantthe rendered cells

Code: pipeline/R/render.R

Produced

render_rtf() R function

Writes the same rendered cells as submission-format RTF, hash-recorded in the manifest so a hand-edited copy cannot pass as the pipeline's.

Function
Outputs
  • table.rtf per variantsha256 in the manifest

Code: pipeline/R/rtf.R

Produced

regenerate() R function

One display, one rebuild: prepares the data, builds the ARD, renders every variant, and writes a new iteration folder with its manifest — never editing an earlier one.

Function
Outputs
  • outputs/<slug>/vNNN/spec snapshots, ard.json, table.html, table.rtf, manifest.json
  • current.jsonwhich iteration is current

Code: pipeline/R/regenerate.R

Calls prepare_data(), build_ard(), render_display(), render_rtf().

Produced

regenerate_values() R function

Resolves every named value's address against the committed ARDs, evaluates the declared arithmetic, and writes the store with each value's provenance.

Inputs
Function
Outputs

Code: pipeline/R/values.R

Produced

assemble.mjs Node script

Fills a template object with this study's text, displays and values, numbers the displays from assembly order, records what each block and the document were built from, and runs the seven gates.

Inputs
Function
Outputs

Code: scripts/assemble.mjs

Gates

Produced

site.mjs Node script

Builds every page of this site from the registry, the outputs, the assembled documents and the evidence — including the pages you are reading — and fails on any internal link that does not resolve or any external resource.

Inputs
Function
Outputs
  • site/_build/every page, no external resource

Code: scripts/site.mjs

Produced

Nothing in the site collection yet.