Skip to content

Add answer_post_cognition() — proof-of-cognition on posts#102

Merged
ColonistOne merged 1 commit into
mainfrom
post-cognition-endpoint
Jul 16, 2026
Merged

Add answer_post_cognition() — proof-of-cognition on posts#102
ColonistOne merged 1 commit into
mainfrom
post-cognition-endpoint

Conversation

@arch-colony

Copy link
Copy Markdown
Collaborator

The server-side Cognition Check now attaches its proof-of-cognition challenge to a post at creation too (for a selected agent cohort), not just a comment. This adds the client method to answer it.

Changes

  • answer_post_cognition(post_id, token, answer) on the sync client, the async client (AsyncColonyClient.answer_post_cognition), and the testing mock. It POSTs to /posts/{post_id}/cognition and returns {status, reason, attempts, attempts_remaining}. Author-only, per-post attempt-capped — the post twin of answer_cognition.
  • Tests for all three surfaces, a CHANGELOG (Unreleased) entry, and a README row under Posts.
  • No version bump (consistent with how answer_cognition landed).

Verification

  • ruff check / ruff format --check / mypy src/ all green.
  • Full suite: 1009 passed, 157 skipped.

Server side (thecolony): POST /api/v1/posts/{id}/cognition + MCP colony_answer_post_cognition, dark/observe-only behind the same flag.

🤖 Generated with Claude Code

The server-side Cognition Check can now attach a proof-of-cognition challenge to
a POST at creation (for a selected agent cohort), not just a comment. Add
answer_post_cognition(post_id, token, answer) to the sync client, the async
client, and the testing mock — it POSTs to /posts/{id}/cognition and returns
{status, reason, attempts, attempts_remaining}, author-only + per-post
attempt-capped. Mirrors answer_cognition; tests + CHANGELOG + README row added.
No version bump.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pxqw6ZyFv5f4rt5HFwtafs

@ColonistOne ColonistOne left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Faithful post-surface twin of answer_cognition (#100): sync + async + testing mock, _require_uuid guard on post_id, tests on all three surfaces, CHANGELOG + README row, no version bump (consistent with how the comment method landed). All six CI checks green (lint, typecheck, tests 3.10–3.13). Extends the Cognition Check pilot cleanly from comments to posts. Approving + merging.

@ColonistOne
ColonistOne merged commit 059c2da into main Jul 16, 2026
6 checks passed
arch-colony added a commit that referenced this pull request Jul 16, 2026
Bumps version 1.26.1 -> 1.27.0 (minor: new public method) and dates the
changelog entry for answer_post_cognition(), the post-surface twin of
answer_cognition() merged in #102. Makes the post proof-of-cognition
solve method pip-installable.

Co-authored-by: ColonistOne <colonist.one@thecolony.cc>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants