[kimi-task] [feat] Add bark message producer — convert chat responses to barks #671

Closed
opened 2026-03-21 03:12:05 +00:00 by kimi · 1 comment
Collaborator

Epic: Matrix Unification

Task

Create produce_bark(agent_id: str, text: str, reply_to: str = None) -> dict in
src/infrastructure/presence.py that formats a chat response as a Matrix bark message.

Files

  • src/infrastructure/presence.py — add produce_bark()
  • tests/unit/test_presence.py — add bark message tests

Acceptance Criteria

  • Returns dict with type="bark", agent_id, data={text, reply_to, style}, ts
  • style defaults to "speech" (other options: "thought", "whisper", "shout")
  • Text is truncated to 280 chars (bark, not essay)
  • tox -e unit passes
  • tox -e lint passes

Context

In the Matrix 3D world, barks appear as floating text above agents with typing animation.
The bark engine in the dashboard (conversation grounding, commitment tracking) generates the text;
this function just formats it for the Matrix protocol.

## Epic: Matrix Unification ## Task Create `produce_bark(agent_id: str, text: str, reply_to: str = None) -> dict` in `src/infrastructure/presence.py` that formats a chat response as a Matrix bark message. ## Files - src/infrastructure/presence.py — add produce_bark() - tests/unit/test_presence.py — add bark message tests ## Acceptance Criteria - [ ] Returns dict with type="bark", agent_id, data={text, reply_to, style}, ts - [ ] style defaults to "speech" (other options: "thought", "whisper", "shout") - [ ] Text is truncated to 280 chars (bark, not essay) - [ ] tox -e unit passes - [ ] tox -e lint passes ## Context In the Matrix 3D world, barks appear as floating text above agents with typing animation. The bark engine in the dashboard (conversation grounding, commitment tracking) generates the text; this function just formats it for the Matrix protocol.
kimi self-assigned this 2026-03-21 03:12:05 +00:00
Author
Collaborator

PR #732 created.

Implementation Summary:

Added produce_bark() to src/infrastructure/presence.py:

def produce_bark(agent_id: str, text: str, reply_to: str = None, style: str = "speech") -> dict

Acceptance Criteria Met:

  • Returns dict with type="bark", agent_id, data={text, reply_to, style}, ts
  • Style defaults to "speech", supports "thought", "whisper", "shout"
  • Text truncated to 280 characters
  • tox -e unit passes (2474 tests)
  • tox -e lint passes

Files Changed:

  • src/infrastructure/presence.py - added produce_bark() function and BARK_STYLES constant
  • tests/unit/test_presence.py - added TestProduceBark test class with 17 test cases
PR #732 created. **Implementation Summary:** Added `produce_bark()` to `src/infrastructure/presence.py`: ```python def produce_bark(agent_id: str, text: str, reply_to: str = None, style: str = "speech") -> dict ``` **Acceptance Criteria Met:** - ✅ Returns dict with `type="bark"`, `agent_id`, `data={text, reply_to, style}`, `ts` - ✅ Style defaults to "speech", supports "thought", "whisper", "shout" - ✅ Text truncated to 280 characters - ✅ `tox -e unit` passes (2474 tests) - ✅ `tox -e lint` passes **Files Changed:** - `src/infrastructure/presence.py` - added `produce_bark()` function and `BARK_STYLES` constant - `tests/unit/test_presence.py` - added `TestProduceBark` test class with 17 test cases
kimi closed this issue 2026-03-21 14:01:43 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#671