Skip to content

Commit 3afb7d3

Browse files
Add helper transport usage boundary architecture guard
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 2099789 commit 3afb7d3

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ This runs lint, format checks, compile checks, tests, and package build.
112112
- `tests/test_extension_route_constants_usage.py` (extension manager route-constant usage enforcement),
113113
- `tests/test_extract_payload_helper_usage.py` (extract start-payload helper usage enforcement),
114114
- `tests/test_guardrail_ast_utils.py` (shared AST guard utility contract),
115+
- `tests/test_helper_transport_usage_boundary.py` (manager-helper transport usage boundary enforcement through shared model request helpers),
115116
- `tests/test_job_fetch_helper_boundary.py` (centralization boundary enforcement for retry/paginated-fetch helper primitives),
116117
- `tests/test_job_fetch_helper_usage.py` (shared retry/paginated-fetch defaults helper usage enforcement),
117118
- `tests/test_job_operation_metadata_usage.py` (shared scrape/crawl/extract operation-metadata usage enforcement),

tests/test_architecture_marker_usage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"tests/test_agent_stop_helper_usage.py",
1818
"tests/test_agent_terminal_status_helper_usage.py",
1919
"tests/test_guardrail_ast_utils.py",
20+
"tests/test_helper_transport_usage_boundary.py",
2021
"tests/test_manager_model_dump_usage.py",
2122
"tests/test_manager_helper_import_boundary.py",
2223
"tests/test_manager_parse_boundary.py",
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
5+
pytestmark = pytest.mark.architecture
6+
7+
8+
ALLOWED_TRANSPORT_HELPER_MODULES = {
9+
"hyperbrowser/client/managers/model_request_utils.py",
10+
}
11+
12+
13+
def test_helper_modules_centralize_transport_usage_in_model_request_utils():
14+
violating_modules: list[str] = []
15+
for module_path in sorted(
16+
Path("hyperbrowser/client/managers").rglob("*.py")
17+
):
18+
module_text = module_path.read_text(encoding="utf-8")
19+
if "client.transport." not in module_text:
20+
continue
21+
normalized_path = module_path.as_posix()
22+
if normalized_path not in ALLOWED_TRANSPORT_HELPER_MODULES:
23+
violating_modules.append(normalized_path)
24+
25+
assert violating_modules == []

0 commit comments

Comments
 (0)