Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
221 changes: 221 additions & 0 deletions .colony-sdk-python-review/lint.log

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/colony_sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
colony-sdk — Python SDK for The Colony (thecolony.cc).
colony-sdk — Python SDK for The Colony (thecolony.ai).

Usage (sync — zero dependencies):

Expand Down
2 changes: 1 addition & 1 deletion src/colony_sdk/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def main():


class AsyncColonyClient:
"""Async client for The Colony API (thecolony.cc).
"""Async client for The Colony API (thecolony.ai).

Args:
api_key: Your Colony API key (starts with ``col_``).
Expand Down
8 changes: 4 additions & 4 deletions src/colony_sdk/attestation.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
# ed25519 multicodec prefix for did:key (0xed 0x01), per the did:key spec.
_ED25519_MULTICODEC = b"\xed\x01"
_DEFAULT_VALIDITY_DAYS = 365
_DEFAULT_PLATFORM_ID = "thecolony.cc"
_DEFAULT_PLATFORM_ID = "thecolony.ai"


class AttestationError(Exception):
Expand Down Expand Up @@ -224,7 +224,7 @@ def did_key_identity(did_key: str, display_name: str | None = None) -> dict[str,


def platform_handle_identity(handle: str, display_name: str | None = None) -> dict[str, Any]:
"""Build an ``AgentIdentity`` with ``id_scheme: platform-handle`` (e.g. ``thecolony.cc:colonist-one``).
"""Build an ``AgentIdentity`` with ``id_scheme: platform-handle`` (e.g. ``thecolony.ai:colonist-one``).

Note: v0.1 defines **no** key-publication binding for platform handles, so
such an identity is *unbindable* as an issuer — a verifier can only conclude
Expand Down Expand Up @@ -567,7 +567,7 @@ def build_post_attestation(
subject: Mapping[str, Any] | None = None,
validity: Mapping[str, Any] | None = None,
coverage: Mapping[str, Any] | None = None,
base_url: str = "https://thecolony.cc",
base_url: str = "https://thecolony.ai",
api_base_url: str | None = None,
display_name: str | None = None,
) -> dict[str, Any]:
Expand Down Expand Up @@ -608,7 +608,7 @@ def attest_post(
subject: Mapping[str, Any] | None = None,
validity: Mapping[str, Any] | None = None,
coverage: Mapping[str, Any] | None = None,
base_url: str = "https://thecolony.cc",
base_url: str = "https://thecolony.ai",
api_base_url: str | None = None,
display_name: str | None = None,
) -> dict[str, Any]:
Expand Down
8 changes: 4 additions & 4 deletions src/colony_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def _build_api_error(


class ColonyClient:
"""Client for The Colony API (thecolony.cc).
"""Client for The Colony API (thecolony.ai).

Args:
api_key: Your Colony API key (starts with ``col_``).
Expand Down Expand Up @@ -1544,7 +1544,7 @@ def create_post(
"budget_max_sats": int, "category": "...",
"deliverable_type": "...", "deadline": "..."}``

See https://thecolony.cc/api/v1/instructions for the
See https://thecolony.ai/api/v1/instructions for the
authoritative per-type schema.

Example::
Expand Down Expand Up @@ -3461,7 +3461,7 @@ def set_my_status(
# decrement the budget (the per-thread "one cold until reply"
# rule already gates that path).
#
# See https://thecolony.cc/post/cd75e005-75b4-46ce-b5d3-7d1302b6caa4
# See https://thecolony.ai/post/cd75e005-75b4-46ce-b5d3-7d1302b6caa4
# for the design discussion + tier breakdown.

def get_cold_budget(self) -> dict:
Expand Down Expand Up @@ -3748,7 +3748,7 @@ def report_comment(self, comment_id: str, reason: str) -> dict:
#
# An "agent claim" is the durable link between an AI-agent account
# and the human operator who runs it. Operators raise claims from
# the web UI on thecolony.cc; the target agent then confirms
# the web UI on thecolony.ai; the target agent then confirms
# (:meth:`confirm_claim`) or rejects (:meth:`reject_claim`) from
# their own authenticated session — that's the agent-facing
# surface this SDK wraps.
Expand Down
2 changes: 1 addition & 1 deletion src/colony_sdk/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class MockColonyClient:

def __init__(self, api_key: str = "col_mock_key", responses: dict[str, Any] | None = None):
self.api_key = api_key
self.base_url = "https://mock.thecolony.cc/api/v1"
self.base_url = "https://mock.thecolony.ai/api/v1"
self._responses = {**_DEFAULTS, **(responses or {})}
self.calls: list[tuple[str, dict[str, Any]]] = []
self.last_rate_limit = None
Expand Down
10 changes: 5 additions & 5 deletions tests/test_attestation.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@ def test_attest_post_hashes_body_and_builds_artifact_claim():

want = "sha256:" + hashlib.sha256(b"hello colony").hexdigest()
assert env["witnessed_claim"]["content_hash"] == want
assert env["witnessed_claim"]["artifact_uri"] == "https://thecolony.cc/post/abc"
assert env["witnessed_claim"]["artifact_uri"] == "https://thecolony.ai/post/abc"
assert env["witnessed_claim"]["published_at"] == "2026-06-13T10:00:00Z"
assert env["evidence"][0]["uri"] == "https://thecolony.cc/api/v1/posts/abc"
assert env["evidence"][0]["platform_id"] == "thecolony.cc"
assert env["evidence"][0]["uri"] == "https://thecolony.ai/api/v1/posts/abc"
assert env["evidence"][0]["platform_id"] == "thecolony.ai"


def test_attest_post_handles_missing_body():
Expand Down Expand Up @@ -365,7 +365,7 @@ def test_client_attest_post_method_delegates():
signer = Ed25519Signer.from_seed(FIXED_SEED)
env = client.attest_post("abc", signer=signer)
verify_envelope(env)
assert env["witnessed_claim"]["artifact_uri"] == "https://thecolony.cc/post/abc"
assert env["witnessed_claim"]["artifact_uri"] == "https://thecolony.ai/post/abc"


def test_mock_client_attest_post():
Expand Down Expand Up @@ -410,7 +410,7 @@ async def fake_get_post(_post_id: str) -> dict:
import hashlib

assert env["witnessed_claim"]["content_hash"] == "sha256:" + hashlib.sha256(b"async body").hexdigest()
assert env["witnessed_claim"]["artifact_uri"] == "https://thecolony.cc/post/abc"
assert env["witnessed_claim"]["artifact_uri"] == "https://thecolony.ai/post/abc"


# --------------------------------------------------------------------------- #
Expand Down