{"evidenceTier":"self-signed","executor":{"implName":"manual-demand-test","implVersion":"1","mode":"manual","model":"claude-sonnet-5 (solve), reviewed"},"generatedAt":"2026-07-28T12:21:39.442Z","participant":{"agentEoa":"0x654862876C8Ddaa048Fa9E0D32D5e0e81bD4Bd20"},"payload":{"branch":"fix/models-lazy-import-1536","commitSha":"8cb71f1","patchDiff":"From 8cb71f1546a5dc9ab067f571291265d83e41c769 Mon Sep 17 00:00:00 2001\nFrom: Oaksprout <oaksproutthetan@gmail.com>\nDate: Tue, 28 Jul 2026 13:10:22 +0100\nSubject: [PATCH] fix(models): break the models/Rekor-client circular import at\n its root\n\n#1496 moved `ClientTrustConfig`/`SigningConfig`/`TrustedRoot` into\n`sigstore/models.py`. `SigningConfig.get_tlogs()` needs `RekorClient`\nand `RekorV2Client`, and those clients need `TransparencyLogEntry` to\ntype their responses -- a genuine circular import at the module level,\nworked around with a function-local (lazy) import in `get_tlogs()`.\n\n#1667 tried to fix this by moving the lazy import to the other side of\nthe cycle (Rekor clients importing `TransparencyLogEntry` lazily\ninstead), but a maintainer noted it was still just a lazy import in a\ndifferent spot, not a real fix.\n\nThis resolves the cycle instead of relocating it, by moving the shared\ntype out of `models.py` into a leaf module:\n\n* `TransparencyLogEntry` now lives in `sigstore/_internal/rekor/entry.py`,\n  which only depends on Rekor/merkle/trust internals -- never on\n  `sigstore.models` or the Rekor clients. Both `models.py` (via\n  `SigningConfig.get_tlogs()`) and the Rekor clients (`client.py`,\n  `client_v2.py`) now import it directly, at module scope, with no lazy\n  imports anywhere in the graph.\n* `InvalidBundle`/`IncompatibleEntry` move to `sigstore/errors.py`\n  (alongside the rest of the exception hierarchy), since\n  `TransparencyLogEntry` raises them and `errors.py` has no dependency\n  on `models.py` either.\n* `sigstore.models` re-exports all three via `__all__` for backwards\n  compatibility (`from sigstore.models import TransparencyLogEntry` /\n  `InvalidBundle` keep working) and so they keep their generated\n  API-reference entries under `docs/api/models.md`.\n\nAdds `test/unit/test_imports.py`, which imports every module that used\nto sit on the cycle first, in a fresh interpreter, to guard against a\nregression, and checks that `SigningConfig.get_tlogs()` no longer needs\na lazy import.\n\nNo behavioral or public API change: `sigstore.models.TransparencyLogEntry`,\n`InvalidBundle`, and `IncompatibleEntry` are unchanged in name, contents,\nand import path.\n\nFixes #1536\n\nSigned-off-by: Oaksprout <oaksproutthetan@gmail.com>\n---\n sigstore/_internal/merkle.py           |   2 +-\n sigstore/_internal/rekor/__init__.py   |   2 +-\n sigstore/_internal/rekor/checkpoint.py |   2 +-\n sigstore/_internal/rekor/client.py     |   2 +-\n sigstore/_internal/rekor/client_v2.py  |   2 +-\n sigstore/_internal/rekor/entry.py      | 213 +++++++++++++++++++++\n sigstore/errors.py                     |  41 +++++\n sigstore/models.py                     | 246 +++----------------------\n test/unit/test_imports.py              | 107 +++++++++++\n 9 files changed, 393 insertions(+), 224 deletions(-)\n create mode 100644 sigstore/_internal/rekor/entry.py\n create mode 100644 test/unit/test_imports.py\n\ndiff --git a/sigstore/_internal/merkle.py b/sigstore/_internal/merkle.py\nindex 1eab298..122de69 100644\n--- a/sigstore/_internal/merkle.py\n+++ b/sigstore/_internal/merkle.py\n@@ -30,7 +30,7 @@ import typing\n from sigstore.errors import VerificationError\n \n if typing.TYPE_CHECKING:\n-    from sigstore.models import TransparencyLogEntry\n+    from sigstore._internal.rekor.entry import TransparencyLogEntry\n \n \n _LEAF_HASH_PREFIX = 0\ndiff --git a/sigstore/_internal/rekor/__init__.py b/sigstore/_internal/rekor/__init__.py\nindex 50bdad7..6e39dd3 100644\n--- a/sigstore/_internal/rekor/__init__.py\n+++ b/sigstore/_internal/rekor/__init__.py\n@@ -31,7 +31,7 @@ from sigstore.dsse import Envelope\n from sigstore.hashes import Hashed\n \n if typing.TYPE_CHECKING:\n-    from sigstore.models import TransparencyLogEntry\n+    from sigstore._internal.rekor.entry import TransparencyLogEntry\n \n __all__ = [\n     \"_hashedrekord_from_parts\",\ndiff --git a/sigstore/_internal/rekor/checkpoint.py b/sigstore/_internal/rekor/checkpoint.py\nindex c077037..23f95b1 100644\n--- a/sigstore/_internal/rekor/checkpoint.py\n+++ b/sigstore/_internal/rekor/checkpoint.py\n@@ -31,8 +31,8 @@ from sigstore._utils import KeyID\n from sigstore.errors import VerificationError\n \n if typing.TYPE_CHECKING:\n+    from sigstore._internal.rekor.entry import TransparencyLogEntry\n     from sigstore._internal.trust import RekorKeyring\n-    from sigstore.models import TransparencyLogEntry\n \n \n @dataclass(frozen=True)\ndiff --git a/sigstore/_internal/rekor/client.py b/sigstore/_internal/rekor/client.py\nindex 56e686f..c4e0a98 100644\n--- a/sigstore/_internal/rekor/client.py\n+++ b/sigstore/_internal/rekor/client.py\n@@ -37,9 +37,9 @@ from sigstore._internal.rekor import (\n     RekorClientError,\n     RekorLogSubmitter,\n )\n+from sigstore._internal.rekor.entry import TransparencyLogEntry\n from sigstore.dsse import Envelope\n from sigstore.hashes import Hashed\n-from sigstore.models import TransparencyLogEntry\n \n _logger = logging.getLogger(__name__)\n \ndiff --git a/sigstore/_internal/rekor/client_v2.py b/sigstore/_internal/rekor/client_v2.py\nindex 4fc6b1c..f1e8b70 100644\n--- a/sigstore/_internal/rekor/client_v2.py\n+++ b/sigstore/_internal/rekor/client_v2.py\n@@ -37,9 +37,9 @@ from sigstore._internal.rekor import (\n     RekorClientError,\n     RekorLogSubmitter,\n )\n+from sigstore._internal.rekor.entry import TransparencyLogEntry\n from sigstore.dsse import Envelope\n from sigstore.hashes import Hashed\n-from sigstore.models import TransparencyLogEntry\n \n _logger = logging.getLogger(__name__)\n \ndiff --git a/sigstore/_internal/rekor/entry.py b/sigstore/_internal/rekor/entry.py\nnew file mode 100644\nindex 0000000..35b574b\n--- /dev/null\n+++ b/sigstore/_internal/rekor/entry.py\n@@ -0,0 +1,213 @@\n+# Copyright 2026 The Sigstore Authors\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#      http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+\"\"\"\n+The `TransparencyLogEntry` model.\n+\n+This lives in its own leaf module (rather than in `sigstore.models`, where it\n+used to live) so that it can be imported by both `sigstore.models` and the\n+Rekor client modules (`sigstore._internal.rekor.client`,\n+`sigstore._internal.rekor.client_v2`) without a circular import: `models.py`\n+needs `RekorClient`/`RekorV2Client` to implement `SigningConfig.get_tlogs()`,\n+and the Rekor clients need `TransparencyLogEntry` to type their responses.\n+`sigstore.models` re-exports `TransparencyLogEntry` for backwards\n+compatibility.\n+\"\"\"\n+\n+from __future__ import annotations\n+\n+import base64\n+import logging\n+from typing import TYPE_CHECKING, Any\n+\n+import rfc8785\n+from pydantic import TypeAdapter\n+from rekor_types import Dsse, Hashedrekord, ProposedEntry\n+from sigstore_models.common import v1 as common_v1\n+from sigstore_models.rekor import v1 as rekor_v1\n+from sigstore_models.rekor.v1 import TransparencyLogEntry as _TransparencyLogEntry\n+\n+from sigstore._internal.merkle import verify_merkle_inclusion\n+from sigstore._internal.rekor.checkpoint import verify_checkpoint\n+from sigstore._utils import KeyID\n+from sigstore.errors import InvalidBundle, VerificationError\n+\n+if TYPE_CHECKING:\n+    from sigstore._internal.trust import RekorKeyring\n+\n+_logger = logging.getLogger(__name__)\n+\n+\n+class TransparencyLogEntry:\n+    \"\"\"\n+    Represents a transparency log entry.\n+    \"\"\"\n+\n+    def __init__(self, inner: _TransparencyLogEntry) -> None:\n+        \"\"\"\n+        Creates a new `TransparencyLogEntry` from the given inner object.\n+\n+        @private\n+        \"\"\"\n+        self._inner = inner\n+        self._validate()\n+\n+    def _validate(self) -> None:\n+        \"\"\"\n+        Ensure this transparency log entry is well-formed and upholds our\n+        client invariants.\n+        \"\"\"\n+\n+        inclusion_proof: rekor_v1.InclusionProof | None = self._inner.inclusion_proof\n+        # This check is required by us as the client, not the\n+        # protobuf-specs themselves.\n+        if not inclusion_proof or not inclusion_proof.checkpoint:\n+            raise InvalidBundle(\"entry must contain inclusion proof, with checkpoint\")\n+\n+    def __eq__(self, value: object) -> bool:\n+        \"\"\"\n+        Compares this `TransparencyLogEntry` with another object for equality.\n+\n+        Two `TransparencyLogEntry` instances are considered equal if their\n+        inner contents are equal.\n+        \"\"\"\n+        if not isinstance(value, TransparencyLogEntry):\n+            return NotImplemented\n+        return self._inner == value._inner\n+\n+    @classmethod\n+    def _from_v1_response(cls, dict_: dict[str, Any]) -> TransparencyLogEntry:\n+        \"\"\"\n+        Create a new `TransparencyLogEntry` from the given API response.\n+        \"\"\"\n+\n+        # Assumes we only get one entry back\n+        entries = list(dict_.items())\n+        if len(entries) != 1:\n+            raise ValueError(\"Received multiple entries in response\")\n+        _, entry = entries[0]\n+\n+        # Fill in the appropriate kind\n+        body_entry: ProposedEntry = TypeAdapter(ProposedEntry).validate_json(\n+            base64.b64decode(entry[\"body\"])\n+        )\n+        if not isinstance(body_entry, Hashedrekord | Dsse):\n+            raise InvalidBundle(\"log entry is not of expected type\")\n+\n+        raw_inclusion_proof = entry[\"verification\"][\"inclusionProof\"]\n+\n+        # NOTE: The type ignores below are a consequence of our Pydantic\n+        # modeling: mypy and other typecheckers see `ProtoU64` as `int`,\n+        # but it gets coerced from a string due to Protobuf's JSON serialization.\n+        inner = _TransparencyLogEntry(\n+            log_index=str(entry[\"logIndex\"]),  # type: ignore[arg-type]\n+            log_id=common_v1.LogId(\n+                key_id=base64.b64encode(bytes.fromhex(entry[\"logID\"]))\n+            ),\n+            kind_version=rekor_v1.KindVersion(\n+                kind=body_entry.kind, version=body_entry.api_version\n+            ),\n+            integrated_time=str(entry[\"integratedTime\"]),  # type: ignore[arg-type]\n+            inclusion_promise=rekor_v1.InclusionPromise(\n+                signed_entry_timestamp=entry[\"verification\"][\"signedEntryTimestamp\"]\n+            ),\n+            inclusion_proof=rekor_v1.InclusionProof(\n+                log_index=str(raw_inclusion_proof[\"logIndex\"]),  # type: ignore[arg-type]\n+                root_hash=base64.b64encode(\n+                    bytes.fromhex(raw_inclusion_proof[\"rootHash\"])\n+                ),\n+                tree_size=str(raw_inclusion_proof[\"treeSize\"]),  # type: ignore[arg-type]\n+                hashes=[\n+                    base64.b64encode(bytes.fromhex(h))\n+                    for h in raw_inclusion_proof[\"hashes\"]\n+                ],\n+                checkpoint=rekor_v1.Checkpoint(\n+                    envelope=raw_inclusion_proof[\"checkpoint\"]\n+                ),\n+            ),\n+            canonicalized_body=entry[\"body\"],\n+        )\n+\n+        return cls(inner)\n+\n+    def _encode_canonical(self) -> bytes:\n+        \"\"\"\n+        Returns a canonicalized JSON (RFC 8785) representation of the transparency log entry.\n+\n+        This encoded representation is suitable for verification against\n+        the Signed Entry Timestamp.\n+        \"\"\"\n+        # We might not have an integrated time if our log entry is from rekor\n+        # v2, i.e. was integrated synchronously instead of via an\n+        # inclusion promise.\n+        if self._inner.integrated_time is None:\n+            raise ValueError(\n+                \"can't encode canonical form for SET without integrated time\"\n+            )\n+\n+        payload: dict[str, int | str] = {\n+            \"body\": base64.b64encode(self._inner.canonicalized_body).decode(),\n+            \"integratedTime\": self._inner.integrated_time,\n+            \"logID\": self._inner.log_id.key_id.hex(),\n+            \"logIndex\": self._inner.log_index,\n+        }\n+\n+        return rfc8785.dumps(payload)\n+\n+    def _verify_set(self, keyring: RekorKeyring) -> None:\n+        \"\"\"\n+        Verify the inclusion promise (Signed Entry Timestamp) for a given transparency log\n+        `entry` using the given `keyring`.\n+\n+        Fails if the given log entry does not contain an inclusion promise.\n+        \"\"\"\n+\n+        if self._inner.inclusion_promise is None:\n+            raise VerificationError(\"SET: invalid inclusion promise: missing\")\n+\n+        signed_entry_ts = self._inner.inclusion_promise.signed_entry_timestamp\n+\n+        try:\n+            keyring.verify(\n+                key_id=KeyID(self._inner.log_id.key_id),\n+                signature=signed_entry_ts,\n+                data=self._encode_canonical(),\n+            )\n+        except VerificationError as exc:\n+            raise VerificationError(f\"SET: invalid inclusion promise: {exc}\")\n+\n+    def _verify(self, keyring: RekorKeyring) -> None:\n+        \"\"\"\n+        Verifies this log entry.\n+\n+        This method performs steps (5), (6), and optionally (7) in\n+        the top-level verify API:\n+\n+        * Verifies the consistency of the entry with the given bundle;\n+        * Verifies the Merkle inclusion proof and its signed checkpoint;\n+        * Verifies the inclusion promise, if present.\n+        \"\"\"\n+\n+        verify_merkle_inclusion(self)\n+        verify_checkpoint(keyring, self)\n+\n+        _logger.debug(\n+            f\"successfully verified inclusion proof: index={self._inner.log_index}\"\n+        )\n+\n+        if self._inner.inclusion_promise and self._inner.integrated_time:\n+            self._verify_set(keyring)\n+            _logger.debug(\n+                f\"successfully verified inclusion promise: index={self._inner.log_index}\"\n+            )\ndiff --git a/sigstore/errors.py b/sigstore/errors.py\nindex a21ef7f..76fba4b 100644\n--- a/sigstore/errors.py\n+++ b/sigstore/errors.py\n@@ -19,6 +19,7 @@ Exceptions.\n import sys\n from collections.abc import Mapping\n from logging import Logger\n+from textwrap import dedent\n from typing import Any, NoReturn\n \n \n@@ -134,3 +135,43 @@ class CertValidationError(VerificationError):\n \n     This is used by CLI to hint that an incorrect Sigstore instance may have been used\n     \"\"\"\n+\n+\n+class InvalidBundle(Error):\n+    \"\"\"\n+    Raised when the associated `Bundle` is invalid in some way.\n+    \"\"\"\n+\n+    def diagnostics(self) -> str:\n+        \"\"\"Returns diagnostics for the error.\"\"\"\n+\n+        return dedent(\n+            f\"\"\"\\\n+        An issue occurred while parsing the Sigstore bundle.\n+\n+        The provided bundle is malformed and may have been modified maliciously.\n+\n+        Additional context:\n+\n+        {self}\n+        \"\"\"\n+        )\n+\n+\n+class IncompatibleEntry(InvalidBundle):\n+    \"\"\"\n+    Raised when the log entry within the `Bundle` has an incompatible KindVersion.\n+    \"\"\"\n+\n+    def diagnostics(self) -> str:\n+        \"\"\"Returns diagnostics for the error.\"\"\"\n+\n+        return dedent(\n+            f\"\"\"\\\n+        The provided bundle contains a transparency log entry that is incompatible with this version of sigstore-python. Please upgrade your verifying client.\n+\n+        Additional context:\n+\n+        {self}\n+        \"\"\"\n+        )\ndiff --git a/sigstore/models.py b/sigstore/models.py\nindex 2237b77..9d72df9 100644\n--- a/sigstore/models.py\n+++ b/sigstore/models.py\n@@ -24,17 +24,12 @@ from collections import defaultdict\n from collections.abc import Iterable\n from enum import Enum\n from pathlib import Path\n-from textwrap import dedent\n-from typing import Any\n \n-import rfc8785\n from cryptography.hazmat.primitives.serialization import Encoding\n from cryptography.x509 import (\n     Certificate,\n     load_der_x509_certificate,\n )\n-from pydantic import TypeAdapter\n-from rekor_types import Dsse, Hashedrekord, ProposedEntry\n from rfc3161_client import TimeStampResponse, decode_timestamp_response\n from sigstore_models.bundle import v1 as bundle_v1\n from sigstore_models.bundle.v1 import Bundle as _Bundle\n@@ -44,15 +39,14 @@ from sigstore_models.bundle.v1 import (\n from sigstore_models.bundle.v1 import VerificationMaterial as _VerificationMaterial\n from sigstore_models.common import v1 as common_v1\n from sigstore_models.common.v1 import MessageSignature, RFC3161SignedTimestamp\n-from sigstore_models.rekor import v1 as rekor_v1\n-from sigstore_models.rekor.v1 import TransparencyLogEntry as _TransparencyLogEntry\n from sigstore_models.trustroot import v1 as trustroot_v1\n \n from sigstore import dsse\n from sigstore._internal.fulcio.client import FulcioClient\n-from sigstore._internal.merkle import verify_merkle_inclusion\n from sigstore._internal.rekor import RekorLogSubmitter\n-from sigstore._internal.rekor.checkpoint import verify_checkpoint\n+from sigstore._internal.rekor.client import RekorClient\n+from sigstore._internal.rekor.client_v2 import RekorV2Client\n+from sigstore._internal.rekor.entry import TransparencyLogEntry\n from sigstore._internal.timestamp import TimestampAuthorityClient\n from sigstore._internal.trust import (\n     CertificateAuthority,\n@@ -62,8 +56,30 @@ from sigstore._internal.trust import (\n     RekorKeyring,\n )\n from sigstore._internal.tuf import DEFAULT_TUF_URL, STAGING_TUF_URL, TrustUpdater\n-from sigstore._utils import KeyID, cert_is_leaf, cert_is_root_ca, is_timerange_valid\n-from sigstore.errors import Error, MetadataError, TUFError, VerificationError\n+from sigstore._utils import cert_is_leaf, cert_is_root_ca, is_timerange_valid\n+from sigstore.errors import (\n+    Error,\n+    IncompatibleEntry,\n+    InvalidBundle,\n+    MetadataError,\n+    TUFError,\n+    VerificationError,\n+)\n+\n+# `TransparencyLogEntry`, `InvalidBundle`, and `IncompatibleEntry` are\n+# defined elsewhere (see above) and re-exported here for backwards\n+# compatibility: they used to be defined directly in this module.\n+__all__ = [\n+    \"Bundle\",\n+    \"ClientTrustConfig\",\n+    \"IncompatibleEntry\",\n+    \"InvalidBundle\",\n+    \"SigningConfig\",\n+    \"TimestampVerificationData\",\n+    \"TransparencyLogEntry\",\n+    \"TrustedRoot\",\n+    \"VerificationMaterial\",\n+]\n \n # Versions supported by this client\n REKOR_VERSIONS = [1, 2]\n@@ -75,170 +91,6 @@ OIDC_VERSIONS = [1]\n _logger = logging.getLogger(__name__)\n \n \n-class TransparencyLogEntry:\n-    \"\"\"\n-    Represents a transparency log entry.\n-    \"\"\"\n-\n-    def __init__(self, inner: _TransparencyLogEntry) -> None:\n-        \"\"\"\n-        Creates a new `TransparencyLogEntry` from the given inner object.\n-\n-        @private\n-        \"\"\"\n-        self._inner = inner\n-        self._validate()\n-\n-    def _validate(self) -> None:\n-        \"\"\"\n-        Ensure this transparency log entry is well-formed and upholds our\n-        client invariants.\n-        \"\"\"\n-\n-        inclusion_proof: rekor_v1.InclusionProof | None = self._inner.inclusion_proof\n-        # This check is required by us as the client, not the\n-        # protobuf-specs themselves.\n-        if not inclusion_proof or not inclusion_proof.checkpoint:\n-            raise InvalidBundle(\"entry must contain inclusion proof, with checkpoint\")\n-\n-    def __eq__(self, value: object) -> bool:\n-        \"\"\"\n-        Compares this `TransparencyLogEntry` with another object for equality.\n-\n-        Two `TransparencyLogEntry` instances are considered equal if their\n-        inner contents are equal.\n-        \"\"\"\n-        if not isinstance(value, TransparencyLogEntry):\n-            return NotImplemented\n-        return self._inner == value._inner\n-\n-    @classmethod\n-    def _from_v1_response(cls, dict_: dict[str, Any]) -> TransparencyLogEntry:\n-        \"\"\"\n-        Create a new `TransparencyLogEntry` from the given API response.\n-        \"\"\"\n-\n-        # Assumes we only get one entry back\n-        entries = list(dict_.items())\n-        if len(entries) != 1:\n-            raise ValueError(\"Received multiple entries in response\")\n-        _, entry = entries[0]\n-\n-        # Fill in the appropriate kind\n-        body_entry: ProposedEntry = TypeAdapter(ProposedEntry).validate_json(\n-            base64.b64decode(entry[\"body\"])\n-        )\n-        if not isinstance(body_entry, Hashedrekord | Dsse):\n-            raise InvalidBundle(\"log entry is not of expected type\")\n-\n-        raw_inclusion_proof = entry[\"verification\"][\"inclusionProof\"]\n-\n-        # NOTE: The type ignores below are a consequence of our Pydantic\n-        # modeling: mypy and other typecheckers see `ProtoU64` as `int`,\n-        # but it gets coerced from a string due to Protobuf's JSON serialization.\n-        inner = _TransparencyLogEntry(\n-            log_index=str(entry[\"logIndex\"]),  # type: ignore[arg-type]\n-            log_id=common_v1.LogId(\n-                key_id=base64.b64encode(bytes.fromhex(entry[\"logID\"]))\n-            ),\n-            kind_version=rekor_v1.KindVersion(\n-                kind=body_entry.kind, version=body_entry.api_version\n-            ),\n-            integrated_time=str(entry[\"integratedTime\"]),  # type: ignore[arg-type]\n-            inclusion_promise=rekor_v1.InclusionPromise(\n-                signed_entry_timestamp=entry[\"verification\"][\"signedEntryTimestamp\"]\n-            ),\n-            inclusion_proof=rekor_v1.InclusionProof(\n-                log_index=str(raw_inclusion_proof[\"logIndex\"]),  # type: ignore[arg-type]\n-                root_hash=base64.b64encode(\n-                    bytes.fromhex(raw_inclusion_proof[\"rootHash\"])\n-                ),\n-                tree_size=str(raw_inclusion_proof[\"treeSize\"]),  # type: ignore[arg-type]\n-                hashes=[\n-                    base64.b64encode(bytes.fromhex(h))\n-                    for h in raw_inclusion_proof[\"hashes\"]\n-                ],\n-                checkpoint=rekor_v1.Checkpoint(\n-                    envelope=raw_inclusion_proof[\"checkpoint\"]\n-                ),\n-            ),\n-            canonicalized_body=entry[\"body\"],\n-        )\n-\n-        return cls(inner)\n-\n-    def _encode_canonical(self) -> bytes:\n-        \"\"\"\n-        Returns a canonicalized JSON (RFC 8785) representation of the transparency log entry.\n-\n-        This encoded representation is suitable for verification against\n-        the Signed Entry Timestamp.\n-        \"\"\"\n-        # We might not have an integrated time if our log entry is from rekor\n-        # v2, i.e. was integrated synchronously instead of via an\n-        # inclusion promise.\n-        if self._inner.integrated_time is None:\n-            raise ValueError(\n-                \"can't encode canonical form for SET without integrated time\"\n-            )\n-\n-        payload: dict[str, int | str] = {\n-            \"body\": base64.b64encode(self._inner.canonicalized_body).decode(),\n-            \"integratedTime\": self._inner.integrated_time,\n-            \"logID\": self._inner.log_id.key_id.hex(),\n-            \"logIndex\": self._inner.log_index,\n-        }\n-\n-        return rfc8785.dumps(payload)\n-\n-    def _verify_set(self, keyring: RekorKeyring) -> None:\n-        \"\"\"\n-        Verify the inclusion promise (Signed Entry Timestamp) for a given transparency log\n-        `entry` using the given `keyring`.\n-\n-        Fails if the given log entry does not contain an inclusion promise.\n-        \"\"\"\n-\n-        if self._inner.inclusion_promise is None:\n-            raise VerificationError(\"SET: invalid inclusion promise: missing\")\n-\n-        signed_entry_ts = self._inner.inclusion_promise.signed_entry_timestamp\n-\n-        try:\n-            keyring.verify(\n-                key_id=KeyID(self._inner.log_id.key_id),\n-                signature=signed_entry_ts,\n-                data=self._encode_canonical(),\n-            )\n-        except VerificationError as exc:\n-            raise VerificationError(f\"SET: invalid inclusion promise: {exc}\")\n-\n-    def _verify(self, keyring: RekorKeyring) -> None:\n-        \"\"\"\n-        Verifies this log entry.\n-\n-        This method performs steps (5), (6), and optionally (7) in\n-        the top-level verify API:\n-\n-        * Verifies the consistency of the entry with the given bundle;\n-        * Verifies the Merkle inclusion proof and its signed checkpoint;\n-        * Verifies the inclusion promise, if present.\n-        \"\"\"\n-\n-        verify_merkle_inclusion(self)\n-        verify_checkpoint(keyring, self)\n-\n-        _logger.debug(\n-            f\"successfully verified inclusion proof: index={self._inner.log_index}\"\n-        )\n-\n-        if self._inner.inclusion_promise and self._inner.integrated_time:\n-            self._verify_set(keyring)\n-            _logger.debug(\n-                f\"successfully verified inclusion promise: index={self._inner.log_index}\"\n-            )\n-\n-\n class TimestampVerificationData:\n     \"\"\"\n     Represents a TimestampVerificationData structure.\n@@ -304,46 +156,6 @@ class VerificationMaterial:\n         return None\n \n \n-class InvalidBundle(Error):\n-    \"\"\"\n-    Raised when the associated `Bundle` is invalid in some way.\n-    \"\"\"\n-\n-    def diagnostics(self) -> str:\n-        \"\"\"Returns diagnostics for the error.\"\"\"\n-\n-        return dedent(\n-            f\"\"\"\\\n-        An issue occurred while parsing the Sigstore bundle.\n-\n-        The provided bundle is malformed and may have been modified maliciously.\n-\n-        Additional context:\n-\n-        {self}\n-        \"\"\"\n-        )\n-\n-\n-class IncompatibleEntry(InvalidBundle):\n-    \"\"\"\n-    Raised when the log entry within the `Bundle` has an incompatible KindVersion.\n-    \"\"\"\n-\n-    def diagnostics(self) -> str:\n-        \"\"\"Returns diagnostics for the error.\"\"\"\n-\n-        return dedent(\n-            f\"\"\"\\\n-        The provided bundle contains a transparency log entry that is incompatible with this version of sigstore-python. Please upgrade your verifying client.\n-\n-        Additional context:\n-\n-        {self}\n-        \"\"\"\n-        )\n-\n-\n class Bundle:\n     \"\"\"\n     Represents a Sigstore bundle.\n@@ -757,12 +569,8 @@ class SigningConfig:\n         result: list[RekorLogSubmitter] = []\n         for tlog in self._tlogs:\n             if tlog.major_api_version == 1:\n-                from sigstore._internal.rekor.client import RekorClient\n-\n                 result.append(RekorClient(tlog.url))\n             elif tlog.major_api_version == 2:\n-                from sigstore._internal.rekor.client_v2 import RekorV2Client\n-\n                 result.append(RekorV2Client(tlog.url))\n             else:\n                 raise AssertionError(f\"Unexpected Rekor v{tlog.major_api_version}\")\ndiff --git a/test/unit/test_imports.py b/test/unit/test_imports.py\nnew file mode 100644\nindex 0000000..bad7391\n--- /dev/null\n+++ b/test/unit/test_imports.py\n@@ -0,0 +1,107 @@\n+# Copyright 2026 The Sigstore Authors\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#      http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+\"\"\"\n+Regression tests for the `sigstore.models` <-> `sigstore._internal.rekor`\n+import cycle (see #1536).\n+\n+`sigstore.models` needs `RekorClient`/`RekorV2Client` (to implement\n+`SigningConfig.get_tlogs()`) and the Rekor client modules need\n+`TransparencyLogEntry` (to type their responses). Both used to live in\n+`sigstore.models`, which forced a lazy, function-local import in\n+`get_tlogs()` to avoid a circular import at module load time.\n+`TransparencyLogEntry` now lives in the leaf module\n+`sigstore._internal.rekor.entry`, which neither `sigstore.models` nor the\n+Rekor clients need to import lazily.\n+\n+Each of the modules below sits somewhere on the former cycle. We import each\n+one first, in its own fresh interpreter (so that Python's module cache can't\n+paper over an ordering bug), to prove that no matter which module a caller\n+happens to import first, the whole graph resolves without a\n+`ImportError`/`AttributeError` from a partially initialized module.\n+\"\"\"\n+\n+from __future__ import annotations\n+\n+import subprocess\n+import sys\n+\n+import pytest\n+\n+# Every module that either used to be involved in the cycle, or now sits\n+# between the two former halves of it.\n+_CYCLE_MODULES = [\n+    \"sigstore.models\",\n+    \"sigstore._internal.rekor.entry\",\n+    \"sigstore._internal.rekor.client\",\n+    \"sigstore._internal.rekor.client_v2\",\n+    \"sigstore._internal.rekor.checkpoint\",\n+    \"sigstore._internal.merkle\",\n+]\n+\n+\n+@pytest.mark.parametrize(\"module\", _CYCLE_MODULES)\n+def test_import_first_in_fresh_interpreter(module: str) -> None:\n+    \"\"\"\n+    Each formerly-cyclic module can be the very first `sigstore` import in a\n+    fresh process, regardless of which other modules end up pulling in the\n+    rest of the package.\n+    \"\"\"\n+    proc = subprocess.run(\n+        [sys.executable, \"-c\", f\"import {module}\"],\n+        capture_output=True,\n+        text=True,\n+    )\n+    assert proc.returncode == 0, proc.stderr\n+\n+\n+def test_get_tlogs_does_not_lazily_import_rekor_clients() -> None:\n+    \"\"\"\n+    `SigningConfig.get_tlogs()` previously had to work around the import\n+    cycle with function-local (lazy) imports of `RekorClient` and\n+    `RekorV2Client`. Assert that `sigstore.models` now imports them eagerly,\n+    at module scope, like every other dependency.\n+    \"\"\"\n+    import sigstore.models as models\n+    from sigstore._internal.rekor.client import RekorClient\n+    from sigstore._internal.rekor.client_v2 import RekorV2Client\n+\n+    assert models.RekorClient is RekorClient\n+    assert models.RekorV2Client is RekorV2Client\n+\n+\n+def test_transparency_log_entry_is_reexported_not_duplicated() -> None:\n+    \"\"\"\n+    `sigstore.models.TransparencyLogEntry` must be the same object as\n+    `sigstore._internal.rekor.entry.TransparencyLogEntry`, not a second,\n+    shadow definition.\n+    \"\"\"\n+    from sigstore._internal.rekor.entry import TransparencyLogEntry as _Entry\n+    from sigstore.models import TransparencyLogEntry\n+\n+    assert TransparencyLogEntry is _Entry\n+\n+\n+def test_invalid_bundle_is_reexported_not_duplicated() -> None:\n+    \"\"\"\n+    `sigstore.models.InvalidBundle`/`IncompatibleEntry` must be the same\n+    objects as `sigstore.errors.InvalidBundle`/`IncompatibleEntry`, not\n+    second, shadow definitions.\n+    \"\"\"\n+    from sigstore.errors import IncompatibleEntry as _IncompatibleEntry\n+    from sigstore.errors import InvalidBundle as _InvalidBundle\n+    from sigstore.models import IncompatibleEntry, InvalidBundle\n+\n+    assert InvalidBundle is _InvalidBundle\n+    assert IncompatibleEntry is _IncompatibleEntry\n-- \n2.50.1 (Apple Git-155)\n\n","testEvidence":"175 passed offline in python:3.12 container; 9 new import-cycle tests, 4 fail on pre-fix code; mypy strict + full lint clean; mkdocs doc-parity confirmed"},"role":"solution","schemaVersion":"jinn.execution.v1","signature":{"algo":"secp256k1","hash":"0x1cdb24f58e09508ecaeddf0ab33df92ffaac063121c1fea567d521e2435cf128","sig":"0xb6a5d3cbd3eb41a3a357f6fe5142115a93c05d4b733d733bf4898196f15e3c2304d644a96fbafcc02b54c0becd029858404f3cf3bacfc8daa20d72e3008fa63d00","signer":"0x654862876C8Ddaa048Fa9E0D32D5e0e81bD4Bd20"},"solverType":"external-repo-fix.manual.v1","task":{"baseCommit":"181074f4dc11b7e85ef44556e25248ef14fcb554","cid":"bafkreihcwy4fraehjt3tfotkn5kiq326gfwlgjnxflovxap5fyodyjj6ci","onchainCreationTx":"0x07caef3bfbf3f48fef6d759416bdb88b56dcf17604c2edd7c2080c4bebc3d409","repo":"sigstore/sigstore-python","requestId":"0xae1fad7e0b83319a0f206dc6dc25beaa4e681b27d880958f3f9f40ac66040972"}}