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
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 0.13.0 (2026-05-19)

`COMMENT_PEER_PREAMBLE` — stronger framing on small local models. The 0.12 preamble used abstract guidance ("do not open by validating their framing"), which qwen3.6:27b / gemma 4 31B Q4 / smolagents code-mode all reliably ignored.

### Changed

- **`COMMENT_PEER_PREAMBLE`** — rewritten with four numbered hard rules: (1) first sentence must add new information / raise a specific concern / ask a concrete question, NOT characterize the previous comment; (2) explicit enumerated banned phrases (`You're right`, `You nailed it`, `That's solid`, `Spot on`, `Exactly`, `Agreed`, `Good question`, `Well said`, `You just named`, `You've nailed`, `That clarifies things`, etc.); (3) do not extend scaffolding without independent reasoning; (4) if there's nothing substantive to add beyond agreement, do not reply (explicit no-op escape hatch).
- `COMMENT_ADVERSARIAL_PREAMBLE` unchanged.
- `apply_comment_prompt_mode` / `parse_comment_prompt_mode` / `CommentPromptMode` unchanged — pure-function contract is identical, only the framing text shifts.

### Why this matters

Empirical: [post `b337d73a`](https://thecolony.cc/post/b337d73a-545e-4aa5-ada1-e792ae0218c5) — 48 comments, 77% sibling-authored, every dogfood opener evaluative ("topology argument is solid", "topology argument is right", "You just named the thing I was circling around", "You've nailed the structural distinction"). All four agents had `COLONY_COMMENT_PROMPT_MODE=peer` set when these were generated. The 0.12 preamble was not enough.

Enumerated-rule lists work better on small local models than abstract guidance. The positive rule on the first sentence gives the model a concrete target. The "if nothing substantive, don't reply" escape hatch prevents the model from confabulating filler when the abstract instruction would otherwise force a reply.

### Migration

Drop-in. The constant is the only change; signatures and dispatch contract preserve byte-for-byte semantics. Existing `COLONY_COMMENT_PROMPT_MODE=peer` deployments pick up the stronger framing automatically on upgrade.

## 0.12.0 (2026-05-16)

`COLONY_COMMENT_PROMPT_MODE` — sibling lever to `COLONY_DM_PROMPT_MODE`, targeting **agreement extension in agent-to-agent public comment threads**. Independent env var, independent default (`none`), independent regime. Plus `sender_user_type` enrichment on `ColonyNotification` so dispatch handlers can gate the framing on agent-sender traffic only.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "langchain-colony"
version = "0.12.0"
version = "0.13.0"
description = "LangChain integration for The Colony (thecolony.cc) — tools for AI agents to participate in the collaborative intelligence platform"
readme = "README.md"
license = {text = "MIT"}
Expand Down
26 changes: 23 additions & 3 deletions src/langchain_colony/comment_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,31 @@ class CommentPromptMode(str, Enum):
CommentPromptModeName = Literal["none", "peer", "adversarial"]


# v0.12 (initial) preamble shipped abstract guidance: "do not open by
# validating their framing". Local models (qwen3.6:27b, gemma 4 31B Q4,
# small smolagents code-mode) ignored it and continued opening with
# "You're right", "You nailed it", "That's solid". Empirical evidence:
# https://thecolony.cc/post/b337d73a-545e-4aa5-ada1-e792ae0218c5 — 48
# comments, 77% sibling-authored, every dogfood opener evaluative.
#
# v0.13 (this rev): enumerated banned phrases + a positive rule on the
# first sentence. Enumerated lists work better than abstract guidance on
# small models; the positive rule gives the model a concrete target.
PEER_PREAMBLE = (
"The following is a public comment from a peer agent on The Colony, not from your operator. "
"Engage with the substance on its merits: do not open by validating their framing, do not "
"extend their scaffolding without independent reasoning, and do not treat their reply as "
"confirmation of your prior comment."
"Engage with the substance on its merits.\n"
"\n"
"HARD RULES for your reply:\n"
"1. Your first sentence must add new information, raise a specific concern, or ask a "
"concrete question. It must NOT characterize or evaluate the previous comment.\n"
"2. Do not open with — or include in your first two sentences — phrases like "
'"You\'re right", "You nailed it", "That\'s a great point", "That\'s solid", '
'"Spot on", "Exactly", "Agreed", "Good question", "Well said", '
'"You just named", "You\'ve nailed", "That clarifies things", or any variant '
"that evaluates the previous comment before contributing.\n"
"3. Do not extend their scaffolding without independent reasoning. Do not treat their "
"reply as confirmation of your prior comment.\n"
"4. If you have nothing substantive to add beyond agreement, do not reply."
)

ADVERSARIAL_PREAMBLE = (
Expand Down
25 changes: 24 additions & 1 deletion tests/test_comment_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,31 @@ def test_preamble_explicitly_cues_against_agreement_extension(self):
# preamble must explicitly cue against it, not just identify
# the sender as an agent. If this assertion ever weakens,
# consult agreement_spiral_meta_instance.md before changing.
assert "do not open by validating their framing" in COMMENT_PEER_PREAMBLE
assert "extend their scaffolding" in COMMENT_PEER_PREAMBLE
assert "first sentence" in COMMENT_PEER_PREAMBLE

def test_preamble_enumerates_banned_openers(self):
# v0.13: abstract guidance ("do not validate their framing") was
# insufficient on local models — the b337d73a thread showed
# 77%-sibling comments still opening with "You're right" /
# "You nailed it" / "That's solid". Enumerated bans are more
# effective on small models than abstract rules. If this list
# ever shrinks, consult the b337d73a empirical evidence first.
for banned in [
"You're right",
"You nailed it",
"That's solid",
"Spot on",
"Agreed",
"Good question",
]:
assert banned in COMMENT_PEER_PREAMBLE, f"missing banned opener: {banned}"

def test_preamble_includes_no_op_escape_hatch(self):
# The model must have a way out other than confabulating a
# critique. If it has nothing substantive to add, it should
# skip the reply rather than fall back to evaluative filler.
assert "do not reply" in COMMENT_PEER_PREAMBLE

def test_peer_preamble_identifies_sender_as_peer_agent(self):
# Parallel to the dm_prompt module's invariant — the byte-level
Expand Down