Skip to content

feat: add nearby agent messaging - #12

Merged
christopherjnelson merged 2 commits into
mainfrom
feat/0007-nearby-agent-messaging
Aug 14, 2026
Merged

christopherjnelson merged 2 commits into
mainfrom
feat/0007-nearby-agent-messaging

Conversation

@christopherjnelson

Copy link
Copy Markdown
Member

Implementation

  • Adds message as a first-class, exclusive agent turn action across shared contracts, the deterministic world engine, both providers, the API, World Lab, telemetry, and exports.
  • Delivers typed accepted-message events and bounded recent communication observations.
  • Adds chronological inbound/outbound communication entries to the event log and selected-agent inspector.

Messaging rules

  • The authoritative server trims content and requires 1–280 plain-text characters.
  • A recipient must exist, cannot be the sender, and must be within inclusive H3 grid distance three at the beginning of the turn; co-located agents are eligible.
  • Accepted messaging consumes the entire turn. Rejected actions deliver no message and produce no accepted event.
  • Recent observation context is chronological and capped at six inbound/outbound messages. Replies are optional and never automatic.

Architecture and security

  • The deterministic world engine remains the sole authority for recipient and range validation and world mutation.
  • Agent-authored message text is bounded, treated as untrusted subordinate content, and rendered as React text rather than HTML.
  • Fixed instructions explicitly preserve game-rule and prompt authority over received claims or instructions.
  • No raw prompts, provider responses, private reasoning, credentials, authorization data, or unbounded diagnostics are exposed.
  • Communication memory is derived from accepted world events; reset clears it, and process restart remains non-persistent.

Telemetry and schema v2

  • Experiment exports now require schemaVersion: 2, reflecting the message action, communication records, messaging metrics, and communication-aware agent filtering.
  • Adds requested/delivered message and sent/received communication metrics.
  • A communication is relevant to both sender and recipient, while a turn remains owned by its acting agent. Agent-scoped exports include that agent's accepted inbound and outbound messages and exclude unrelated communications.
  • Rejected message attempts remain visible only through relevant rejected sender turns and are never represented as delivered communications.
  • Canonical communication records remain separate from non-communication world events; initial and current world snapshots remain state-only.
  • Agentborne does not ingest exports, so this change intentionally adds no v1 migration or compatibility layer.

Automated testing

  • Adds deterministic shared-contract, engine/service, provider/runtime, telemetry/export, API, React, and Playwright coverage for messaging, rejection, bounded context, escaping, filtering, reset, and schema v2.
  • Final local gate passed: formatting, lint, type checking, 146 unit/integration tests, the production build, and the deterministic Playwright flow.
  • Chromium installation was checked with pnpm exec playwright install chromium; no live-provider smoke test was run.

Genuine-provider manual validation

  • A previously completed opt-in experiment produced 81 accepted turns: 56 moves, 23 infections, and two accepted Mingle-to-Ember messages, both at distance zero.
  • Mingle retained its earlier outbound context, and Ember received both messages in subsequent observations.
  • The run had no provider errors, rejected turns, or unsafe export fields.
  • An Ember-only, message-only export contained zero Ember-owned message turns, both inbound communications, and no unrelated communication records.
  • Downloaded exports and screenshots are intentionally not included in this PR.

Deferred functionality

  • Relationships, reputation, alliances, factions, teams, shared missions, persistent or semantic memory, group chat, broadcasts, player messaging, notifications, automatic replies, persistence/databases, provider configuration UI, and map communication animations remain out of scope.

@christopherjnelson
christopherjnelson marked this pull request as ready for review August 14, 2026 11:58
@christopherjnelson
christopherjnelson merged commit cd3952a into main Aug 14, 2026
2 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