"""DOC-09 / AP-10 — PUBLIC_API.md lists every public __all__ name."""

from __future__ import annotations

import importlib
from pathlib import Path


def _root() -> Path:
    p = Path(__file__).resolve()
    for a in p.parents:
        if (a / "pyproject.toml").exists():
            return a
    raise RuntimeError


def test_md_lists_every_all_name() -> None:
    md = (_root() / "PUBLIC_API.md").read_text(encoding="utf-8")
    mod = importlib.import_module("mgf.vm.firecracker")
    missing = [n for n in mod.__all__ if f"`{n}`" not in md]
    assert not missing, f"PUBLIC_API.md missing: {missing}"
