ANONYMOUS REPRODUCIBLE BUILD RECIPE

Run every command from the project root. Use exactly this validated toolchain:

- Rscript (R) 4.6.1 (2026-06-24), with base packages only
- Python 3.14.3, with the standard library only
- Quarto 1.10.18
- Pandoc 3.10 bundled with Quarto
- Tectonic 0.17.0
- R Cairo graphics capability enabled

Confirm the executable versions and Cairo capability before running the pipeline:

   Rscript --version
   python3 --version
   quarto --version
   quarto pandoc --version
   tectonic --version
   Rscript -e 'stopifnot(isTRUE(capabilities("cairo"))); cat("Cairo: TRUE\n")'

The expected version numbers are 4.6.1, 3.14.3, 1.10.18, 3.10, and 0.17.0, respectively; the Cairo command must print `Cairo: TRUE`. Publication-figure generation fails before installation if Cairo is unavailable.

1. Acquire and validate official public TIMSS inputs, run every analysis, generate all eight manuscript table fragments from the canonical analysis objects, and atomically install the publication tables, figures, fragments, and diagnostics:

   Rscript analysis/run_all.R

   The acquisition stage requires internet access. Subsequent stages use the locally validated official files. Raw and derived student-level files are deliberately excluded from Additional file 3. The publication transaction commits `outputs/diagnostics/publication_output_validation.csv` last and rolls the complete set back if any installed-file validation fails.

2. Render the reviewer documents. An explicit LaTeX render writes the retained main-manuscript TeX, and the subsequent main PDF render compiles the same QMD source with Tectonic; the supplement PDF render uses Tectonic without retaining a second TeX deliverable:

   quarto render manuscript/manuscript.qmd --to docx
   quarto render manuscript/manuscript.qmd --to latex
   quarto render manuscript/manuscript.qmd --to pdf
   quarto render manuscript/supplement.qmd --to docx
   quarto render manuscript/supplement.qmd --to pdf

   In the complete confidential author workspace only (the title-page source is deliberately absent from Additional file 3), also render:

   quarto render submission/title_page_template.qmd --to docx

   Required reviewer-document outputs are `manuscript/manuscript.tex`, `manuscript/manuscript.docx`, `manuscript/manuscript.pdf`, `manuscript/supplement.docx`, and `manuscript/supplement.pdf`. The complete author workspace additionally requires `submission/title_page_template.docx`. HTML is not configured, built, or delivered.

3. Apply and verify journal DOCX formatting, figure accessibility metadata, equation preservation, and confidential title-page hygiene:

   python3 tools/finalize_docx.py
   python3 tools/finalize_docx.py --verify-only

   In the complete confidential author workspace only, also run:

   python3 tools/finalize_docx.py --document title-page
   python3 tools/finalize_docx.py --document title-page --verify-only

   The default finalizer target remains the anonymous main manuscript and supplement so that the command works from extracted Additional file 3, where the confidential title page is intentionally absent. For reviewer documents, the finalizer refuses a DOCX, PDF, or required main TeX file that predates its QMD source, bibliography, CSL, finalizer source, included generated table fragments, or referenced publication PNGs. It requires exactly eight main and 16 supplement display equations in the QMD sources, verifies exact nonempty OMML display counts and ordered semantic markers in both DOCX files, rejects malformed or visibly mangled math, checks the retained main TeX equations in source order, verifies complete PDF signatures and trailers, and keeps every supplemental Figure S1–S6 caption with its following image in DOCX. It also removes only canonical passive custom properties and Pandoc's empty comments scaffold, clears identifying and volatile document properties, rejects real comments, tracked revisions, active content, PII, and local paths, and verifies required journal formatting and exact source-derived figure descriptions. The separate title-page mode permits only the intended visible identity, removes the same passive scaffolds and volatile metadata, converts the two reserved-DOI hyperlinks to verified plain text, rejects all remaining external relationships and active/review content, and preserves the required declarations. Rerender rather than finalizing a stale document.

4. Build the three Additional Files. Choose exactly one build command:

   For a first build when none of the generated submission files exists:

      python3 tools/build_additional_files.py

   To replace an existing complete, internally valid generated set:

      python3 tools/build_additional_files.py --replace-generated

   Then independently verify the installed set without modifying it:

      python3 tools/build_additional_files.py --verify-only

Do not use `--replace-generated` to bypass an incomplete or invalid pre-existing set. Resolve the reported integrity problem instead. The builder publishes all three Additional Files as one rollback-protected transaction and commits `submission/Additional_files_SHA256.csv` last.

The builder reconstructs this exact UTF-8 record from the currently executing tools and requires byte-for-byte equality with `outputs/diagnostics/software_versions_anonymous.txt`:

   R: 4.6.1
   Python: 3.14.3
   Quarto: 1.10.18
   Pandoc (bundled with Quarto): 3.10
   Tectonic: 0.17.0
   R dependencies: base packages only
   Python dependencies: standard library only

A version difference, line difference, or dependency-label difference stops packaging. The builder also captures one immutable snapshot of every allowlisted source and generated artifact before semantic validation, packages those exact bytes, records each path, size, and SHA-256 digest in `provenance/source_snapshot_manifest.csv`, rejects symlinks, unsafe archive members, active/review DOCX features, identifying metadata, forbidden data paths, and unallowlisted files, and verifies both internal and external SHA-256 manifests.

Before portal upload, authors must complete all author-only declarations and perform the separately documented Word/LibreOffice visual inspection and live-portal acceptance checks. Do not infer or invent author, ethics, funding, competing-interest, contribution, repository, reviewer, originality, or generative-AI facts.
