From 814790a9eb2e3610f5f7af18e37e90bc651514b9 Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Tue, 16 Jun 2026 08:09:11 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20(deps):=20Require=20my?= =?UTF-8?q?py=20>=3D=201.11=20for=20PEP=20695=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PEP 695 (the `type` statement + type-parameter syntax) is supported from mypy 1.11; bump the floor so the typing standard is enforced. Co-Authored-By: Claude Opus 4.8 (1M context) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b5a8a8dc..530ad46d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,7 +61,7 @@ dev = [ ] lint = [ "ruff>=0.1.0", - "mypy>=1.2.0,<3", + "mypy>=1.11,<3", ] test = [ "pytest>=8.1.1,<10", From a9ed619eec8151679d9f17f9dfbb82d39f35f158 Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Tue, 16 Jun 2026 08:09:11 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20(types):=20Use=20PEP?= =?UTF-8?q?=20695=20type=20statement=20for=20CallStackNodeKind?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The module docstring already states aliases use the PEP 695 `type` statement, but the code used legacy assignment. Convert it so the code matches the documented standard. Annotation-only; no behaviour change. Co-Authored-By: Claude Opus 4.8 (1M context) --- agent_assembly/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent_assembly/types.py b/agent_assembly/types.py index eabde1f7..2f01379b 100644 --- a/agent_assembly/types.py +++ b/agent_assembly/types.py @@ -21,7 +21,7 @@ # ── Event types (AAASM-1435) ────────────────────────────────────────────────── -CallStackNodeKind = Literal["llm", "tool", "result"] +type CallStackNodeKind = Literal["llm", "tool", "result"] """Discriminator for a [`CallStackNode`] — open-ended on the wire (proto uses `string kind`) but typed here as a `Literal` for the three values the dashboard currently renders.""" From b70bbb01c0a662ba07dd1602c8f6911da6a1d1b8 Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Tue, 16 Jun 2026 08:09:11 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=93=9D=20(contributing):=20Document?= =?UTF-8?q?=20PEP=20695=20typing=20convention?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a Type annotations (PEP 695) section: prefer the `type` alias statement and `class C[T]`/`def f[T]` generics, requiring mypy >= 1.11. Co-Authored-By: Claude Opus 4.8 (1M context) --- CONTRIBUTING.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 35a41d5f..0fbc005d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -137,6 +137,22 @@ uv run pre-commit run --all-files # full pre-commit suite (isort + black + au Pre-commit hooks block commits that fail any of the above. Do not bypass with `--no-verify`; fix the underlying issue. +### Type annotations (PEP 695) + +The SDK targets Python ≥ 3.12, so use **[PEP 695](https://peps.python.org/pep-0695/)** syntax for new typing: + +- **Type aliases** use the `type` statement, not bare assignment or `typing.TypeAlias`: + + ```python + type CallStackNodeKind = Literal["llm", "tool", "result"] # ✅ PEP 695 + CallStackNodeKind = Literal["llm", "tool", "result"] # ❌ legacy form + ``` + + `type` aliases are lazily evaluated, which avoids quoting/`from __future__` gymnastics for forward references. See `agent_assembly/types.py` for the canonical examples. +- **Generics** (when introduced) use the type-parameter syntax: `class Box[T]:` / `def first[T](xs: list[T]) -> T:` — not `TypeVar`/`Generic[...]`. + +This requires `mypy >= 1.11` (PEP 695 support), pinned in `pyproject.toml`. + ## Branch naming and commit style - **Branch**: `//` — e.g. `v0.0.0/AAASM-1122/author_readme_contributing`. Type slug optional but recommended (`feat`, `fix`, `refactor`, `test`, `docs`, `config`, `deps`, `remove`, `lint`). From ff59ba081c950c098ed52f53450bdb2dca9b345f Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Tue, 16 Jun 2026 08:10:07 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=94=A7=20(deps):=20Sync=20uv.lock=20f?= =?UTF-8?q?or=20mypy=20>=3D=201.11=20floor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 (1M context) --- uv.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uv.lock b/uv.lock index a3602c4c..9d4bb9a4 100644 --- a/uv.lock +++ b/uv.lock @@ -84,7 +84,7 @@ provides-extras = ["runtime", "all"] dev = [ { name = "coverage", specifier = "~=7.10" }, { name = "grpcio-tools", specifier = ">=1.66,<2" }, - { name = "mypy", specifier = ">=1.2.0,<3" }, + { name = "mypy", specifier = ">=1.11,<3" }, { name = "pydantic-ai", specifier = ">=0.3.0" }, { name = "pytest", specifier = ">=8.1.1,<10" }, { name = "pytest-asyncio", specifier = ">=0.23.0,<2" }, @@ -105,11 +105,11 @@ docs = [ { name = "mkdocstrings-python", specifier = ">=1.10.0,<3" }, ] lint = [ - { name = "mypy", specifier = ">=1.2.0,<3" }, + { name = "mypy", specifier = ">=1.11,<3" }, { name = "ruff", specifier = ">=0.1.0" }, ] pre-commit-ci = [ - { name = "mypy", specifier = ">=1.2.0,<3" }, + { name = "mypy", specifier = ">=1.11,<3" }, { name = "pre-commit", specifier = ">=3.5.0,<5" }, { name = "pylint", specifier = ">=3.1.0,<5" }, { name = "ruff", specifier = ">=0.1.0" },