STATE-WP-0093: per-recipient broadcast receipts and standing notices (T01-T06).
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s
Build and Publish Multi-Context Image / build-and-push (push) Successful in 53s

Founder approved T01 on 2026-09-22 (D2, D3, D6 as recommended).
- T02: message_receipts table; kind/expires_at/supersedes_id on
  agent_messages; migration d7e8f9a0b1c2 archives existing broadcasts,
  leaves direct messages untouched, reversible.
- T03: reader-aware mark-read (unattributed broadcast mark-read is a
  metered, deprecated no-op), delivery receipts on the scoped unread inbox,
  POST /messages/{id}/ack, news/standing kinds, expiry, supersede, broadcast
  archive no longer stamps read_at, reply writes the replier's receipt.
- T04 (state-hub part): Codex MCP reader param and acknowledge_notice;
  hub-core part handed off (message 69fc387c).
- T05: GET /messages/notices, standing_notices in /state/summary,
  dashboard standing-notices panel.
- T06: 17 new tests; full suite green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 63291@bnt-lap001
Assistant-Session: 8bd77868-ca68-4f49-bb1e-d539ecc0d703
This commit is contained in:
tegwick 2026-09-22 00:26:33 +02:00
parent 740068fcf1
commit ef541f58cf
18 changed files with 1256 additions and 52 deletions

View file

@ -10,6 +10,7 @@ from __future__ import annotations
import json
import os
from typing import Any
from urllib.parse import quote
import httpx
from fastmcp import FastMCP
@ -59,9 +60,22 @@ def get_messages(to_agent: str, unread_only: bool = True) -> str:
@mcp.tool()
def mark_message_read(message_id: str) -> str:
"""Mark one coordination message as read."""
return _json(_request("PATCH", f"/messages/{message_id}/read", {}))
def mark_message_read(message_id: str, reader: str | None = None) -> str:
"""Mark one coordination message as read.
Pass ``reader`` (your repository slug) so a broadcast is marked read for
you only; without it a broadcast stays visible and the call is deprecated.
"""
path = f"/messages/{message_id}/read"
if reader:
path += f"?reader={quote(reader, safe='')}"
return _json(_request("PATCH", path, {}))
@mcp.tool()
def acknowledge_notice(message_id: str, agent: str) -> str:
"""Acknowledge a standing notice after acting on it (clears it for ``agent``)."""
return _json(_request("POST", f"/messages/{message_id}/ack", {"agent": agent}))
@mcp.tool()