Skip to content

Paper

paper

Paper checks — the invariants of a research paper, not of a package.

A paper carries none of a Python distribution's invariants (no Diataxis mkdocs, no Trusted Publishing, no CI matrix) but has its own: a paper/ directory, an experiments/ directory, a README, and a plan document declaring the intention through a YAML front-matter header.

check_paper_structure(project)

Check: the paper carries the entries its topology requires.

Four entries are unconditional (paper/, experiments/, README.md, PIPELINE.md). INDEX.md is conditional: it is generated from the experiment manifests, so a paper with no experiment yet carries none legitimately — but once experiments exist, its absence means the registry was never produced.

Parameters:

Name Type Description Default
project Path

Paper root directory.

required

Returns:

Type Description
CheckResult

A failed CheckResult naming every missing entry, or a passed one.

Source code in packages/axm-init/src/axm_init/checks/paper.py
Python
def check_paper_structure(project: Path) -> CheckResult:
    """Check: the paper carries the entries its topology requires.

    Four entries are unconditional (``paper/``, ``experiments/``,
    ``README.md``, ``PIPELINE.md``). ``INDEX.md`` is conditional: it is
    *generated* from the experiment manifests, so a paper with no experiment
    yet carries none legitimately — but once experiments exist, its absence
    means the registry was never produced.

    Args:
        project: Paper root directory.

    Returns:
        A failed ``CheckResult`` naming every missing entry, or a passed one.
    """
    entries = [
        ("paper/", (project / "paper").is_dir()),
        ("experiments/", (project / "experiments").is_dir()),
        ("README.md", (project / "README.md").is_file()),
        ("PIPELINE.md", (project / "PIPELINE.md").is_file()),
    ]
    if _holds_an_experiment(project):
        entries.append(("INDEX.md", (project / _INDEX_FILENAME).is_file()))
    missing = [label for label, present in entries if not present]
    if missing:
        return CheckResult(
            name="paper.paper_structure",
            category="paper",
            passed=False,
            weight=5,
            message=(
                f"Paper layout missing {len(missing)} entry(ies): {', '.join(missing)}"
            ),
            details=[f"Missing: {', '.join(missing)}"],
            fix=(
                f"Generate {_INDEX_FILENAME} from the experiment manifests "
                "(experiment_index)."
                if missing == [_INDEX_FILENAME]
                else (
                    "Create paper/, experiments/, README.md and PIPELINE.md "
                    "at the paper root."
                )
            ),
        )
    return CheckResult(
        name="paper.paper_structure",
        category="paper",
        passed=True,
        weight=5,
        message=(f"Paper layout complete ({', '.join(label for label, _ in entries)})"),
        details=[],
        fix="",
    )

check_plan_present(project)

Check: the plan document exists and declares a front-matter header.

Parameters:

Name Type Description Default
project Path

Paper root directory.

required

Returns:

Type Description
CheckResult

A failed CheckResult when PLAN.md is missing or carries no

CheckResult

non-empty YAML front-matter, a passed one otherwise.

Source code in packages/axm-init/src/axm_init/checks/paper.py
Python
def check_plan_present(project: Path) -> CheckResult:
    """Check: the plan document exists and declares a front-matter header.

    Args:
        project: Paper root directory.

    Returns:
        A failed ``CheckResult`` when ``PLAN.md`` is missing or carries no
        non-empty YAML front-matter, a passed one otherwise.
    """
    return _front_matter_document(
        project,
        _PLAN_FILENAME,
        "paper.plan_present",
        "the paper intention",
    )

check_research_present(project)

Check: the research protocol document exists and declares a header.

Purely formal, like every axm-init check: it grades the FORM (presence of RESEARCH.md plus a non-empty YAML front-matter) and never reads the substance of that header - no gap, no investigations, no status. The authoritative model lives in another package.

Parameters:

Name Type Description Default
project Path

Paper root directory.

required

Returns:

Type Description
CheckResult

A failed CheckResult when RESEARCH.md is missing or carries

CheckResult

no non-empty YAML front-matter, a passed one otherwise.

Source code in packages/axm-init/src/axm_init/checks/paper.py
Python
def check_research_present(project: Path) -> CheckResult:
    """Check: the research protocol document exists and declares a header.

    Purely formal, like every axm-init check: it grades the FORM (presence
    of ``RESEARCH.md`` plus a non-empty YAML front-matter) and never reads
    the substance of that header - no ``gap``, no ``investigations``, no
    status. The authoritative model lives in another package.

    Args:
        project: Paper root directory.

    Returns:
        A failed ``CheckResult`` when ``RESEARCH.md`` is missing or carries
        no non-empty YAML front-matter, a passed one otherwise.
    """
    return _front_matter_document(
        project,
        _RESEARCH_FILENAME,
        "paper.research_present",
        "the research protocol",
    )