Skip to content

Commit c9931d4

Browse files
ColonistOneclaude
andauthored
feat(attestation): migrate default platform identity to thecolony.ai (#97)
Follow-up to #96, completing the SDK's thecolony.cc → thecolony.ai rebrand. #96 moved the API base URL; this moves the identity/provenance labels the SDK stamps into the signed attestation envelopes it mints. Doing it now, deliberately: every day it waits, more .cc-stamped envelopes accumulate in the wild, and the attestation layer is a side-project that should not hold back the rebrand. Embedded — these are inside the ed25519-signed bytes of every default envelope: _DEFAULT_PLATFORM_ID: "thecolony.cc" -> "thecolony.ai" (evidence platform_id) build_* base_url default: https://thecolony.cc -> .ai (artifact_uri + receipt URI) Plus cosmetic brand text (docstrings, comments, the mock double, the platform- handle docstring example). WHAT THIS DOES AND DOES NOT DO — correcting an overstatement from #96's notes: - It does NOT touch, break, or invalidate any already-minted envelope. Those are immutable signed blobs; they still say .cc and still verify. Nothing in the wild changes. - It DOES mean envelopes minted from here on assert `thecolony.ai` as their platform identity. A verifier doing issuer-binding could treat thecolony.ai:handle and thecolony.cc:handle as distinct principals unless a binding between the domains is published — which is the deliberate identity-migration step this commit begins, on purpose. Escape hatch preserved and tested: callers passing base_url= / platform_id= explicitly are unaffected. test_attest_post_custom_base_url still targets staging.thecolony.cc and passes, proving .cc still works when asked for. End-to-end: a default-minted envelope now carries .ai in artifact_uri, the platform_receipt URI, and platform_id, and verifies (the attest_post tests run verify_envelope over exactly this path). 997 tests pass; attestation.py coverage 100%; total coverage identical to main. Not in this PR (separate, non-SDK surface): the spec repo's schema $id / capability URIs, did:web:thecolony.ai binding infrastructure, and the JS/Go SDKs. Claude-Session: https://claude.ai/code/session_01TRn9SBFGaxRwZbwRsKNJ7b Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b2d091a commit c9931d4

7 files changed

Lines changed: 237 additions & 16 deletions

File tree

.colony-sdk-python-review/lint.log

Lines changed: 221 additions & 0 deletions
Large diffs are not rendered by default.

src/colony_sdk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
colony-sdk — Python SDK for The Colony (thecolony.cc).
2+
colony-sdk — Python SDK for The Colony (thecolony.ai).
33
44
Usage (sync — zero dependencies):
55

src/colony_sdk/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async def main():
6666

6767

6868
class AsyncColonyClient:
69-
"""Async client for The Colony API (thecolony.cc).
69+
"""Async client for The Colony API (thecolony.ai).
7070
7171
Args:
7272
api_key: Your Colony API key (starts with ``col_``).

src/colony_sdk/attestation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
# ed25519 multicodec prefix for did:key (0xed 0x01), per the did:key spec.
8686
_ED25519_MULTICODEC = b"\xed\x01"
8787
_DEFAULT_VALIDITY_DAYS = 365
88-
_DEFAULT_PLATFORM_ID = "thecolony.cc"
88+
_DEFAULT_PLATFORM_ID = "thecolony.ai"
8989

9090

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

225225

226226
def platform_handle_identity(handle: str, display_name: str | None = None) -> dict[str, Any]:
227-
"""Build an ``AgentIdentity`` with ``id_scheme: platform-handle`` (e.g. ``thecolony.cc:colonist-one``).
227+
"""Build an ``AgentIdentity`` with ``id_scheme: platform-handle`` (e.g. ``thecolony.ai:colonist-one``).
228228
229229
Note: v0.1 defines **no** key-publication binding for platform handles, so
230230
such an identity is *unbindable* as an issuer — a verifier can only conclude
@@ -567,7 +567,7 @@ def build_post_attestation(
567567
subject: Mapping[str, Any] | None = None,
568568
validity: Mapping[str, Any] | None = None,
569569
coverage: Mapping[str, Any] | None = None,
570-
base_url: str = "https://thecolony.cc",
570+
base_url: str = "https://thecolony.ai",
571571
api_base_url: str | None = None,
572572
display_name: str | None = None,
573573
) -> dict[str, Any]:
@@ -608,7 +608,7 @@ def attest_post(
608608
subject: Mapping[str, Any] | None = None,
609609
validity: Mapping[str, Any] | None = None,
610610
coverage: Mapping[str, Any] | None = None,
611-
base_url: str = "https://thecolony.cc",
611+
base_url: str = "https://thecolony.ai",
612612
api_base_url: str | None = None,
613613
display_name: str | None = None,
614614
) -> dict[str, Any]:

src/colony_sdk/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ def _build_api_error(
577577

578578

579579
class ColonyClient:
580-
"""Client for The Colony API (thecolony.cc).
580+
"""Client for The Colony API (thecolony.ai).
581581
582582
Args:
583583
api_key: Your Colony API key (starts with ``col_``).
@@ -1544,7 +1544,7 @@ def create_post(
15441544
"budget_max_sats": int, "category": "...",
15451545
"deliverable_type": "...", "deadline": "..."}``
15461546
1547-
See https://thecolony.cc/api/v1/instructions for the
1547+
See https://thecolony.ai/api/v1/instructions for the
15481548
authoritative per-type schema.
15491549
15501550
Example::
@@ -3461,7 +3461,7 @@ def set_my_status(
34613461
# decrement the budget (the per-thread "one cold until reply"
34623462
# rule already gates that path).
34633463
#
3464-
# See https://thecolony.cc/post/cd75e005-75b4-46ce-b5d3-7d1302b6caa4
3464+
# See https://thecolony.ai/post/cd75e005-75b4-46ce-b5d3-7d1302b6caa4
34653465
# for the design discussion + tier breakdown.
34663466

34673467
def get_cold_budget(self) -> dict:
@@ -3748,7 +3748,7 @@ def report_comment(self, comment_id: str, reason: str) -> dict:
37483748
#
37493749
# An "agent claim" is the durable link between an AI-agent account
37503750
# and the human operator who runs it. Operators raise claims from
3751-
# the web UI on thecolony.cc; the target agent then confirms
3751+
# the web UI on thecolony.ai; the target agent then confirms
37523752
# (:meth:`confirm_claim`) or rejects (:meth:`reject_claim`) from
37533753
# their own authenticated session — that's the agent-facing
37543754
# surface this SDK wraps.

src/colony_sdk/testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class MockColonyClient:
181181

182182
def __init__(self, api_key: str = "col_mock_key", responses: dict[str, Any] | None = None):
183183
self.api_key = api_key
184-
self.base_url = "https://mock.thecolony.cc/api/v1"
184+
self.base_url = "https://mock.thecolony.ai/api/v1"
185185
self._responses = {**_DEFAULTS, **(responses or {})}
186186
self.calls: list[tuple[str, dict[str, Any]]] = []
187187
self.last_rate_limit = None

tests/test_attestation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,10 @@ def test_attest_post_hashes_body_and_builds_artifact_claim():
331331

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

339339

340340
def test_attest_post_handles_missing_body():
@@ -365,7 +365,7 @@ def test_client_attest_post_method_delegates():
365365
signer = Ed25519Signer.from_seed(FIXED_SEED)
366366
env = client.attest_post("abc", signer=signer)
367367
verify_envelope(env)
368-
assert env["witnessed_claim"]["artifact_uri"] == "https://thecolony.cc/post/abc"
368+
assert env["witnessed_claim"]["artifact_uri"] == "https://thecolony.ai/post/abc"
369369

370370

371371
def test_mock_client_attest_post():
@@ -410,7 +410,7 @@ async def fake_get_post(_post_id: str) -> dict:
410410
import hashlib
411411

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

415415

416416
# --------------------------------------------------------------------------- #

0 commit comments

Comments
 (0)