Skip to content

Platform Update Projector

Middle-core adopts platform.messaging.update-system by hosting the webhook projection seam for platform update subscriptions.

Contract

The projector consumes the hub-owned platform-update-subscription contract:

  • Source: https://github.com/nickpclarke/AgentArmy/blob/main/contracts/platform-update-subscription.schema.json
  • Capability: platform.messaging.update-system
  • Adoption issue: https://github.com/nickpclarke/middle-core/issues/132
  • Hub tracking issue: https://github.com/nickpclarke/AgentArmy/issues/417

NATS JetStream remains the high-speed canonical bus. Webhooks are projections for agents and systems that cannot subscribe to NATS directly.

Runtime Shape

agent_runtime.platform_updates maps one webhook subscription to:

  • a durable JetStream consumer spec over the PLATFORM stream,
  • MECE subject-family validation,
  • a structured CloudEvent webhook POST,
  • auth headers for none, bearer, hmac-sha256, and cloudflare-access-service-token,
  • redacted delivery evidence on platform.adoption.webhook.delivery.

The module keeps the live NATS client and HTTP transport behind ports. This lets tests prove contract behavior offline while leaving deployment-specific broker wiring to the container/runtime integration.

Subject Families

Subscriptions must stay inside one MECE family:

  • platform.capability
  • platform.adoption
  • platform.hvfs
  • fleet.agent
  • platform.security

Do not mix capability, adoption, HVFS, fleet-agent, and security meanings in one subscription.

Validation

Run:

python -m pytest -q agent_runtime/tests/test_platform_updates.py

The test suite covers subject filtering, auth/header behavior, replay-policy mapping, and redacted delivery evidence.