# Template: Meta-Research Project A self-referential research study that programmatically analyzes and documents the Docxology Template repository's own architecture, pipeline, and security layer. **Location:** git-tracked public exemplar at `projects/templates/template_template/` in the public template checkout. ## When to use this template Use this template when your research subject is **the repository itself** — programmatic introspection of architecture, pipeline DAGs, module inventories, and security layers, rendered as a manuscript whose every metric is computed live (autopoietic: the paper regenerates itself from the code it describes). It is the reference for binding `${var}` metric tokens to introspection code. If you are studying an external subject rather than the repo, start from [`template_code_project`](../template_code_project/) (computational research) or [`template_prose_project`](../template_prose_project/) (editorial pipeline). Full roster: [`projects/AGENTS.md`](../../AGENTS.md#permanent-canonical-exemplars). ## Publication and rendering The publishing metadata and per-platform status below are **compiled from `manuscript/config.yaml`** by `infrastructure.publishing.status_report` — do not hand-edit between the markers; update the config and regenerate (see the legend). **A template/ approach to Reproducible Generative Research** · v1.0.9 · Apache-2.0 · Daniel Ari Friedman Concept DOI: [10.5281/zenodo.20419007](https://doi.org/10.5281/zenodo.20419007) | Version DOI: [10.5281/zenodo.20976048](https://zenodo.org/records/20976048) | Repository: [docxology/template_template](https://github.com/docxology/template_template) Publishing surface — 20 platforms, 9 published: | Platform | Tier | Status | Reference | Credentials | | --- | --- | --- | --- | --- | | zenodo | first-class | ✅ published | [10.5281/zenodo.20419007](https://doi.org/10.5281/zenodo.20419007) | `ZENODO_API_TOKEN` | | github | first-class | ✅ published | [docxology/template_template](https://github.com/docxology/template_template) | `GITHUB_TOKEN` | | arxiv | first-class | ⚪ available | — | — | | pypi | first-class | ✅ published | [https://test.pypi.org/project/template-template-meta-project/1.0.9/](https://test.pypi.org/project/template-template-meta-project/1.0.9/) | `PYPI_TOKEN`, `TESTPYPI_TOKEN` | | ipfs_pinata | first-class | ✅ published | [https://gateway.pinata.cloud/ipfs/QmVr4UREM1NeaSfY1pNJdjFjrRrGMZLvnNqCY2cRaGadry](https://gateway.pinata.cloud/ipfs/QmVr4UREM1NeaSfY1pNJdjFjrRrGMZLvnNqCY2cRaGadry) | `PINATA_JWT` | | ipfs_web3storage | first-class | ⚪ available | — | `WEB3_STORAGE_TOKEN` | | software_heritage | first-class | ✅ published | [https://archive.softwareheritage.org/browse/origin/?origin_url=https://github.com/docxology/template_template](https://archive.softwareheritage.org/browse/origin/?origin_url=https://github.com/docxology/template_template) | — | | github_pages | first-class | ✅ published | [https://docxology.github.io/template_template/](https://docxology.github.io/template_template/) | `GITHUB_TOKEN` | | cloudflare_pages | first-class | ⚪ available | — | `CLOUDFLARE_API_TOKEN` | | netlify | first-class | ✅ published | [https://6a44431e738f1faeef68e5f6--tranquil-kleicha-0c9203.netlify.app](https://6a44431e738f1faeef68e5f6--tranquil-kleicha-0c9203.netlify.app) | `NETLIFY_AUTH_TOKEN` | | huggingface_hub | first-class | ✅ published | [https://huggingface.co/datasets/ActiveInference/template_template](https://huggingface.co/datasets/ActiveInference/template_template) | `HUGGINGFACE_TOKEN`, `HF_TOKEN` | | osf | first-class | ✅ published | [https://osf.io/byf23/](https://osf.io/byf23/) | `OSF_TOKEN` | | amazon_kdp | documented | 🟡 planned | — | `AMAZON_KDP_EMAIL`, `AMAZON_KDP_PASSWORD` | | google_play_books | documented | 🟡 planned | — | `GOOGLE_PLAY_BOOKS_SERVICE_ACCOUNT_JSON` | | gumroad | documented | 🟡 planned | — | `GUMROAD_ACCESS_TOKEN` | | leanpub | documented | 🟡 planned | — | `LEANPUB_API_KEY` | | lulu | documented | 🟡 planned | — | `LULU_CLIENT_KEY`, `LULU_CLIENT_SECRET` | | draft2digital | documented | 🟡 planned | — | `DRAFT2DIGITAL_API_TOKEN` | | stripe | documented | 🟡 planned | — | `STRIPE_SECRET_KEY`, `STRIPE_PUBLISHABLE_KEY` | | ingramspark | documented | 🟡 planned | — | `INGRAMSPARK_CLIENT_ID`, `INGRAMSPARK_CLIENT_SECRET` | _Keywords: reproducible research, infrastructure-as-code, steganography, cryptographic provenance, LaTeX rendering, modular infrastructure, publication integrity, zero-mock testing, thin orchestrator, two-layer architecture, FAIR4RS, research software engineering._ _Status legend: ✅ published (durable identifier recorded in `config.yaml`) · 🔵 reserved (identifier reserved but not yet registered by final publication) · ⚪ available (adapter implemented and locally verifiable) · 🟡 planned. This block is generated — edit `manuscript/config.yaml`, then regenerate with `uv run python -m infrastructure.publishing.status_report --project --write`._ The 3 platforms still shown ⚪ available are not automatable to "published" with current tooling/credentials, not an oversight: **arXiv** has no submission API in this codebase (`infrastructure.publishing.arxiv` only prepares a local tarball — a human must upload it via arxiv.org and the resulting `arxiv` URL would then be added to `publication.published_artifacts`); **Cloudflare Pages** needs a `CLOUDFLARE_ACCOUNT_ID` the configured API token cannot auto-discover; **IPFS (Web3.Storage)** has no `WEB3_STORAGE_TOKEN` configured. - Canonical renderer: [docxology/template](https://github.com/docxology/template) with `--project templates/template_template` - Tracked outputs: [`output/`](output/) in this project and `output/templates/template_template/` in the monorepo; public output files above 50 MB stay out of git. To regenerate this exemplar from the public monorepo: ```bash git clone https://github.com/docxology/template cd template uv sync ./run.sh --project templates/template_template --pipeline --core-only uv run python scripts/pipeline/stage_04_validate.py --project templates/template_template uv run python scripts/pipeline/stage_05_copy.py --project templates/template_template ``` Standalone repositories are publication mirrors for source, DOI metadata, and tracked rendered artifacts. Use the monorepo above when you need the full shared infrastructure, pipeline stages, or cross-template validation. ## Overview - **Repository introspection:** `src/template_template/introspection.py` loads the YAML pipeline DAG, discovers modules/projects, and aggregates file counts. - **Metrics injection:** `src/template_template/metrics.py` computes manuscript variables; `inject_metrics.py` renders `${var}` tokens into `output/manuscript/`. - **Figures:** `scripts/generate_architecture_viz.py` produces four PNGs from live introspection data. ## Quick Start From the public template repo root: ```bash uv run pytest projects/templates/template_template/tests/ \ --cov=projects/templates/template_template/src/template_template --cov-fail-under=90 -v uv run python projects/templates/template_template/scripts/generate_architecture_viz.py uv run python projects/templates/template_template/scripts/generate_manuscript_metrics.py ./run.sh --project templates/template_template --pipeline ``` ## Directory Structure | Folder | Contents | |--------|----------| | `manuscript/` | Numbered Markdown chapters + `config.yaml` (+ `config.yaml.example` copy-and-customize starting point) + `references.bib` | | `scripts/` | Two thin orchestrators (figures, metrics) | | `src/template_template/` | Introspection, metrics, injection, visualization | | `tests/` | Full suite with the coverage floor declared in `pyproject.toml` | | `output/` | PDF, figures, metrics JSON, rendered manuscript | ## Pipeline Outputs | Artifact | Path | |----------|------| | Rendered PDF | `output/pdf/template_template_combined.pdf` | | Metrics JSON | `output/data/metrics.json` | | Rendered chapters | `output/manuscript/*.md` | | Figures | `output/figures/*.png` | See [`docs/VERIFICATION.md`](docs/VERIFICATION.md) for the full gate checklist. ## Template integrity - Forward backlog: [`TODO.md`](TODO.md). - Copy-and-customize config: [`manuscript/config.yaml.example`](manuscript/config.yaml.example). - Project validation: `uv run pytest projects/templates/template_template/tests/ --cov=projects/templates/template_template/src --cov-fail-under=90`. - Repo drift validation: `uv run python scripts/audit/check_template_drift.py --strict`. ## Directory & sub-document map Navigation links to in-tree documents (keeps them discoverable): - [AGENTS — figures](figures/AGENTS.md) - [figures](figures/README.md) - [AGENTS: scripts/ — Thin Orchestrator Scripts](scripts/AGENTS.md) - [Template Scripts](scripts/README.md) - [Template Project Tests](tests/README.md)