From 0d616fb1054bbffdb16248588392cb0e39697a49 Mon Sep 17 00:00:00 2001 From: Ben Matson Date: Mon, 16 Nov 2026 07:10:02 -0700 Subject: [PATCH 1/2] test: The design document's package table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tests come first and fail until the implementation. The kit's design makes it three packages in one uv workspace so the worker image can carry the worker and the core and no round code, and so the store, coordination and queue interfaces are written… Unit: kit-has-a-core-package/3 --- tests/test_design_package_table.py | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/test_design_package_table.py diff --git a/tests/test_design_package_table.py b/tests/test_design_package_table.py new file mode 100644 index 00000000..c1faa389 --- /dev/null +++ b/tests/test_design_package_table.py @@ -0,0 +1,44 @@ +"""The package table in `docs/designs/orchestration.md` puts the runtimes, sandboxes, profiles +and hooks under the core, and no module under two packages (spec: kit-packages).""" + +from __future__ import annotations + +import re + +import pytest + +from tests.doc_text import ROOT + +DESIGN = ROOT / "docs" / "designs" / "orchestration.md" +PACKAGES = ("core", "orchestrator", "worker") +CORE_MODULES = ("runtimes", "sandboxes", "profiles", "hooks") + + +def package_table() -> dict[str, str]: + """The `Holds` cell of each row of the table under `## Three packages`, keyed by package.""" + text = DESIGN.read_text(encoding="utf-8") + section = re.search(r"^## Three packages\n(.*?)(?=^## )", text, re.M | re.S) + assert section, "the `## Three packages` section is missing" + rows: dict[str, str] = {} + for line in section.group(1).splitlines(): + cells = [cell.strip() for cell in line.strip().strip("|").split("|")] + if line.startswith("|") and cells[0] in PACKAGES: + rows[cells[0]] = cells[1].lower() + assert set(rows) == set(PACKAGES), f"the table has rows for {sorted(rows)}" + return rows + + +def mentions(cell: str, module: str) -> bool: + return re.search(rf"\b{module}\b", cell) is not None + + +@pytest.mark.parametrize("module", CORE_MODULES) +def test_the_table_lists_the_module_under_the_core(module: str) -> None: + assert mentions(package_table()["core"], module) + + +@pytest.mark.parametrize("module", CORE_MODULES) +def test_the_table_lists_the_module_under_no_other_package(module: str) -> None: + rows = package_table() + others = [name for name in PACKAGES if name != "core" and mentions(rows[name], module)] + assert others == [] From 2d80f4aad325f23729a5e2daeb6872042856d525 Mon Sep 17 00:00:00 2001 From: Ben Matson Date: Mon, 16 Nov 2026 08:42:50 -0700 Subject: [PATCH 2/2] feat: The design document's package table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With this in, the tests of the previous commit pass. The kit's design makes it three packages in one uv workspace so the worker image can carry the worker and the core and no round code, and so the store, coordination and queue interfaces are written… The tests for this group pass without further implementation: the implementation already exists. Already built, the builder's account: All 8 cases in `tests/test_design_package_table.py` pass, and lint, format and types pass on that file and on `docs/designs/orchestration.md`. The rebase had already left `docs/designs/orchestration.md` in the state the tests need. Main's version of the package table lists the runtimes, sandboxes, toolchain profiles and policy hooks under the core, and the worker and orchestrator rows don't name them. So I made no further edits, and the working tree has no changes of its own. I didn't weaken any test, and no stub was involved. I added no changelog entry, because nothing a user sees changes. I ran only this file, not the whole suite. Unit: kit-has-a-core-package/3 Already-built: yes