refactor: isolate runtime contracts and enforce import boundaries (#6166)

* test: enforce Python import ownership boundaries

* test: protect client import boundaries and rehome shared UI contracts

* refactor: remove gateway and client dependency inversions

* fix: detect dynamic imports in conditional expressions

* refactor(tools): keep configuration contracts with their owners

* docs: keep design guidance focused on ownership and checks

* fix: preserve default threaded turn delivery
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-13 13:56:28 +08:00
1 parent cd2a863710
commit 328e933d36
162 files changed
+3449 -1888

No files matched your search

+25 -1
View File
@@ -104,6 +104,10 @@ jobs:
python_required=true
docker_required=true
;;
scripts/check_client_import_boundaries.*)
webui_required=true
tui_required=true
;;
tests/*|conftest.py|uv.lock|scripts/*)
python_required=true
;;
@@ -172,6 +176,10 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Check Python import boundaries
if: matrix.coverage
run: python -m scripts.check_import_boundaries
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
@@ -195,7 +203,7 @@ jobs:
# later uv run sync pruning the packages installed by the previous step.
- name: Lint with ruff
if: matrix.coverage
run: uv run --no-sync ruff check nanobot tests conftest.py
run: uv run --no-sync ruff check nanobot tests conftest.py scripts/check_import_boundaries.py
- name: Type check with BasedPyright (strict)
if: matrix.coverage
@@ -290,6 +298,14 @@ jobs:
working-directory: webui
run: bun install --frozen-lockfile
- name: Check WebUI import boundaries
working-directory: webui
run: bun run check:imports
- name: Test client import checker with WebUI dependencies
working-directory: webui
run: bun run test:imports
- name: Lint WebUI
working-directory: webui
run: bun run lint
@@ -331,6 +347,14 @@ jobs:
working-directory: tui
run: bun install --frozen-lockfile
- name: Check TUI import boundaries
working-directory: tui
run: bun run check:imports
- name: Test client import checker with TUI dependencies
working-directory: tui
run: bun run test:imports
- name: Check TUI
working-directory: tui
run: bun run check