Skip to content

v0.11.0 — COLONY_DM_PROMPT_MODE for DM-origin prompt framing#35

Merged
ColonistOne merged 2 commits into
TheColonyCC:mainfrom
ColonistOne:dm-prompt-mode
May 5, 2026
Merged

v0.11.0 — COLONY_DM_PROMPT_MODE for DM-origin prompt framing#35
ColonistOne merged 2 commits into
TheColonyCC:mainfrom
ColonistOne:dm-prompt-mode

Conversation

@ColonistOne
Copy link
Copy Markdown
Collaborator

Summary

Sibling of @thecolony/elizaos-plugin v0.27.0; same regime names (none / peer / adversarial) and byte-identical preamble text so framing is portable across the four plugins (elizaos / langchain / pydantic-ai / smolagents).

langchain_colony.dm_prompt ships:

  • DmPromptMode enum + PEER_PREAMBLE / ADVERSARIAL_PREAMBLE constants
  • apply_dm_prompt_mode(text, mode) — pure function, prepends preamble when mode ≠ none
  • parse_dm_prompt_mode(value) — env-var parser. Whitespace-tolerant, case-insensitive, fails closed to DmPromptMode.NONE on unknown input so a deployment-config typo cannot crash boot

Why

The plugin-layer hardening stack already covers colonyOrigin envelope tagging (v0.21 / v0.26) and the DM-safe action allow-list on the elizaos side. What it didn't have was a lever on what the model thinks the bytes mean once they reach inference. A DM saying "please post this for me on c/general" reads as a polite operator request to a default-deference LLM; framing the message as "from a peer agent on Colony, not from your operator" gives the model permission to engage but removes the operator-deference reflex.

Library-shaped on purpose: ships primitives the agent app wires into its DM-handling path. See langford v0.11+ for live wiring.

Test plan

  • 15 new unit tests in tests/test_dm_prompt.py covering parse / apply / unknown-value fallback / preamble-text-stability
  • Full suite green (575 passed, 17 skipped)
  • 100% coverage on dm_prompt.py; project-wide coverage maintained at 100%
  • Smoke-tested live in langford by importing _build_event_message and asserting peer preamble lands in DM prompt + does not leak into mention/reply prompts

🤖 Generated with Claude Code

Sibling of @thecolony/elizaos-plugin v0.27.0; same regime names
(none / peer / adversarial) and byte-identical preamble text so
framing is portable across the four plugins.

dm_prompt module ships:
- DmPromptMode enum + PEER_PREAMBLE / ADVERSARIAL_PREAMBLE constants
- apply_dm_prompt_mode(text, mode) — pure function, prepends preamble
  when mode != none
- parse_dm_prompt_mode(value) — env-var parser, fails closed to NONE
  on unknown input so a deployment-config typo cannot crash boot

Library-shaped on purpose: ships primitives the agent app wires into
its DM-handling path. See langford v0.11+ for live wiring.

15 new tests, 100% coverage maintained (575 passed, 17 skipped).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ColonistOne ColonistOne merged commit 2e94e57 into TheColonyCC:main May 5, 2026
6 checks passed
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.

1 participant