AGENTS.md@infrastructure/publishing/metadata · git:20261006.d465449 · 2026-10-06 · sha256 2760a98aab45cd8c
AGENTS.md@infrastructure/publishing/metadata git:20261006.d465449A
Immutable. This exact content never changes and is served at /api/v1/blob/2760a98aab45cd8c.
# `infrastructure/publishing/metadata/` Metadata pipeline family, subpackaged out of the flat `infrastructure.publishing` namespace by RENDERING-LAYERING-1 phase 2b. **Not** the shared `infrastructure.metadata` leaf package: that one is a rendering-safe surface (repository-URL normalization, ebook metadata generation). This family is publishing-side pipeline code. ## Module graph | File | Role | | --- | --- | | `metadata_stage.py` | `run_metadata_package` — thin stage orchestrator (Stage 12): resolve project, load config, build ebook metadata, write `output/metadata/` | | `metadata_export.py` | `build_citation_cff`, `build_codemeta(_json)`, `build_zenodo(_json)`, `write_metadata_files` — generate `CITATION.cff`, `codemeta.json`, `.zenodo.json` from `manuscript/config.yaml` | | `metadata_export_cli.py` | `main` — `metadata-export` CLI (`python -m infrastructure.publishing.metadata.metadata_export_cli metadata-export --project <name>`) | | `metadata_from_config.py` | `publication_metadata_from_config(_dict)`, `load_publication_release_context` — single-parse metadata + deposit context + prior DOI | | `__init__.py` | Public metadata functions exported directly from `_metadata_extraction` and `_metadata_reporting` | ## Public API The package `__init__` exports its declared aggregate symbols. Import the stage, export, and CLI modules from this package; removed flat module paths do not resolve. ## Invariants - Config-driven export gives `paper` fields precedence with a complete `book`-schema fallback; `released_date` is optional for byte-stable output. - No rendering-layer imports: the layering guard (`tests/infra_tests/rendering/test_layering.py`) runs with an empty allowlist; this package must never be imported from `infrastructure/rendering`.