AGENTS.md@infrastructure/publishing/arxiv · git:20261030.fdb7bef · 2026-10-30 · sha256 2d313e11adef1c0d

AGENTS.md@infrastructure/publishing/arxiv git:20261030.fdb7befA

Immutable. This exact content never changes and is served at /api/v1/blob/2d313e11adef1c0d.

# `infrastructure/publishing/arxiv/`

Local arXiv submission tarball preparation (no network API).

## Public API

```python
from infrastructure.publishing.arxiv import prepare_arxiv_submission
```

### `prepare_arxiv_submission`

```python
prepare_arxiv_submission(output_dir: Path) -> Path
```

Prefers the renderer-owned `output/pdf/_combined_manuscript.tex`, stages it at
the archive root with its stem-matched `.bbl`, rendered bibliography files, and
`output/figures/`, and adapts renderer-relative figure references to that flat
layout. Rendered TeX must use that exact canonical root. Projects authored directly
in TeX can instead provide a sibling `manuscript/` source tree, preserved by relative path.

The helper fails closed on a missing/empty or ambiguous TeX root, symlinks,
special files, and non-identical path collisions. It removes all older
date-named packages before building and never leaves a partial package after a
failure. `SOURCE_DATE_EPOCH` controls the UTC filename date and normalized
tar/gzip metadata; invalid or negative explicit values fail. Identical inputs
and epoch must produce byte-identical archives.

Public tracked packages are post-render artifacts: package after the final
Stage 3 render, refresh the current artifact manifest, then rerun Stage 4 so its
validation report and rendered-provenance receipt attest the updated output
tree. Do not run `refresh_rendered_provenance.py` afterward because that helper
rerenders first and cleans the package. The exact command sequence is in
[`README.md`](README.md).

## Tests

```bash
uv run pytest tests/infra_tests/publishing/test_platforms.py::TestPrepareArxivSubmission -v
```

## See also

- [`README.md`](README.md)
- [`../registry.py`](../registry.py) — canonical platform discovery