test(workspace): enforce cloud package ownership
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
## 2. Cloud Package Extraction
|
||||
|
||||
- [x] 2.1 Move the existing `cloud` package under `packages/cloud-platform` while preserving every `cloud.*` import path.
|
||||
- [ ] 2.2 Remove `cloud*` from the root distribution's setuptools discovery and update path-sensitive composition tests or tooling.
|
||||
- [x] 2.2 Remove `cloud*` from the root distribution's setuptools discovery and update path-sensitive composition tests or tooling.
|
||||
- [ ] 2.3 Add packaging tests that identify the owning distribution for Runtime and cloud modules and reject reverse cloud dependencies.
|
||||
|
||||
## 3. Locking And Developer Commands
|
||||
|
||||
@@ -30,7 +30,6 @@ members = ["packages/cloud-platform"]
|
||||
include = [
|
||||
"agents*",
|
||||
"api*",
|
||||
"cloud*",
|
||||
"core*",
|
||||
"device*",
|
||||
"driver*",
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
"""Composition safety checks (task 9.1).
|
||||
|
||||
Verifies that ``cloud/`` is purely additive: every existing module that
|
||||
``cloud/`` composes (``runtime.task``, ``workflow.runner``, ``driver.registry``,
|
||||
``api.console``) is itself unchanged by this change, and remains unaware of the
|
||||
``cloud`` package in its source.
|
||||
Verifies that the cloud workspace package is purely additive: every existing
|
||||
module it composes (``runtime.task``, ``workflow.runner``, ``driver.registry``,
|
||||
``api.console``) remains unaware of the ``cloud`` package in its source.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -13,6 +12,7 @@ import os
|
||||
from pathlib import Path
|
||||
|
||||
PROJECT_ROOT = Path(__file__).resolve().parent.parent
|
||||
CLOUD_SOURCE_ROOT = PROJECT_ROOT / "packages" / "cloud-platform" / "cloud"
|
||||
|
||||
|
||||
def _module_source(path: Path) -> str:
|
||||
@@ -82,10 +82,9 @@ def test_cloud_dispatch_imports_existing_runners_by_name() -> None:
|
||||
assert "WorkflowRunner" in source or "workflow_runner_factory" in source
|
||||
|
||||
|
||||
def test_cloud_source_files_exist_only_under_cloud_directory() -> None:
|
||||
"""The cloud/ change adds files only under cloud/ (and tests/, pyproject.toml, openspec)."""
|
||||
cloud_dir = PROJECT_ROOT / "cloud"
|
||||
assert cloud_dir.exists()
|
||||
def test_cloud_source_files_exist_only_under_cloud_workspace_member() -> None:
|
||||
"""Cloud source files are owned by the cloud-platform workspace member."""
|
||||
assert CLOUD_SOURCE_ROOT.exists()
|
||||
expected_files = {
|
||||
"__init__.py",
|
||||
"config.py",
|
||||
@@ -100,7 +99,7 @@ def test_cloud_source_files_exist_only_under_cloud_directory() -> None:
|
||||
"sdk/models.py",
|
||||
}
|
||||
found: set[str] = set()
|
||||
for path in cloud_dir.rglob("*.py"):
|
||||
found.add(str(path.relative_to(cloud_dir)).replace(os.sep, "/"))
|
||||
for path in CLOUD_SOURCE_ROOT.rglob("*.py"):
|
||||
found.add(str(path.relative_to(CLOUD_SOURCE_ROOT)).replace(os.sep, "/"))
|
||||
missing = expected_files - found
|
||||
assert not missing, f"missing cloud source files: {sorted(missing)}"
|
||||
|
||||
Reference in New Issue
Block a user