Reply router

Classify inbound replies to governed sends, durably suppress recipients who explicitly unsubscribe, route ordinary replies without sending, and stop ambiguous or untrusted cases for review.

You’re reading version sha-a5a8c28f45c0. Go to the current version

Overview

reply-router turns a bounded inbound reply into exactly one governed outcome:

  1. an explicit unsubscribe tied to a sealed original-send receipt is appended to a recipient-keyed suppression stream;
  2. an ordinary reply becomes a routing decision for a separate governed lane;
  3. an ambiguous reply, mismatched recipient, or unsealed receipt stops with needs_agent.

It never sends a message. A routed reply names send-as as a possible downstream governed action, but this skill neither invokes it nor grants sending authority.

In the manual

Runner

  • route

Declared by its execution profile. Read the profile

SKILL.md

Reply Router

reply-router turns a bounded inbound reply into exactly one governed outcome:

  1. an explicit unsubscribe tied to a sealed original-send receipt is appended to a recipient-keyed suppression stream;
  2. an ordinary reply becomes a routing decision for a separate governed lane;
  3. an ambiguous reply, mismatched recipient, or unsealed receipt stops with needs_agent.

It never sends a message. A routed reply names send-as as a possible downstream governed action, but this skill neither invokes it nor grants sending authority.

Inputs

  • inbound_reply — JSON with a stable reply_id, sender (from.address or from), body, and optional subject/timestamp.
  • original_send_receipt — the runx.receipt.v1 produced by the original governed send. Suppression requires status: sealed, a checksum, a principal, a send plan, and an audience that matches the inbound sender.
  • suppression_policy — declared unsubscribe phrases and the suppression data source. data_source_ref and resource may be supplied; conservative defaults are used otherwise.

Outcomes

Explicit unsubscribe

The deterministic classifier requires a sealed, checksummed original-send receipt and an exact recipient match. The graph then:

  1. reads the recipient-keyed stream with registry:runx/data-store@0.1.2;
  2. takes projection.version from that read;
  3. calls the same pinned skill's append_event runner with that value as expected_version and a stable idempotency key; and
  4. emits a runx.reply.routing.v1 suppression result containing the committed data-operation evidence.

Only a digest-derived recipient aggregate id is stored; the event contains no raw reply body or recipient address.

Ordinary reply

The skill emits a runx.reply.routing.v1 handoff decision. It identifies the queue and a separate governed action family, but performs no network or send side effect.

Ambiguous or untrusted reply

The graph enters an operator agent-task. Without an explicit caller answer the receipt seals as needs_agent. No data-store step or routing-result step runs on this branch.

Deterministic policy

  • Phrase matching is normalized and boundary-aware; substrings such as unstoppable do not count as stop.
  • stop by itself is deliberately ambiguous unless an operator has explicitly included it in suppression_policy.unsubscribe_phrases.
  • Receipt shape, sealed status, checksum, principal, send plan, reply id, and recipient correspondence are checked before suppression is allowed.
  • Idempotency keys are derived from receipt id, reply id, and recipient digest, making retries stable without exposing recipient data.

Harness

The inline harness contains the required cases:

  • sealed_unsubscribe_suppression must seal after a real read-then-CAS append;
  • stop_ambiguous_or_unsealed must return needs_agent, with no write and no routing decision.

Run it with runx CLI 0.6.14 or newer:

bash
runx harness ./skills/reply-router --json

Published execution profile

The execution profile published with sha-a5a8c28f45c0, shown as its exact bytes.

Runner
  • route
Profile digestsha256:27d1e491a49b5bc5c8df02bf039467825a0f605166c9f9243d417ecdcb179282
skill: reply-router
version: 0.1.1
catalog:
  kind: graph
  audience: public
  visibility: public
  role: canonical
  category: growth
connectors:
  store:
    operations:
      - events.append
      - projection.read
runners:
  route:
    default: true
    inputs:
      inbound_reply:
        type: json
        required: true
        description: The bounded inbound reply, including a stable reply id, sender, body, and observed timestamp.
      original_send_receipt:
        type: json
        required: true
        description: The sealed runx receipt for the governed outbound message that this reply references.
      suppression_policy:
        type: json
        required: true
        description: Recipient suppression policy and the declared data source used for durable append-only suppression events.
    steps:
      - id: classify
        label: deterministically classify the inbound reply
        skill: ./graph/classify-reply
        inputs:
          inbound_reply: $input.inbound_reply
          original_send_receipt: $input.original_send_receipt
          suppression_policy: $input.suppression_policy
      - id: read-suppression
        label: read the recipient suppression stream version
        when:
          equals: suppress
          value: $steps.classify.reply_classification.route
        operation: store/projection.read
        input:
          data_source_ref: $steps.classify.reply_classification.data_source_ref
          resource: $steps.classify.reply_classification.resource
          aggregate_id: $steps.classify.reply_classification.aggregate_id
      - id: append-suppression
        label: append the unsubscribe event with compare-and-swap
        when:
          equals: suppress
          value: $steps.classify.reply_classification.route
        operation: store/events.append
        idempotency_key: $steps.classify.reply_classification.idempotency_key
        input:
          data_source_ref: $steps.classify.reply_classification.data_source_ref
          resource: $steps.classify.reply_classification.resource
          aggregate_id: $steps.classify.reply_classification.aggregate_id
          expected_version: $steps.read-suppression.provider_operation.result.projection.version
          event: $steps.classify.reply_classification.suppression_event
      - id: suppression-result
        label: emit the committed suppression result
        when:
          equals: suppress
          value: $steps.classify.reply_classification.route
        skill: ./graph/emit-result
        inputs:
          classification: $steps.classify.reply_classification.classification
          route: $steps.classify.reply_classification.route
          reason: $steps.classify.reply_classification.reason
          suppression_result: $steps.append-suppression.provider_operation.result
      - id: routing-result
        label: emit a handoff decision without sending
        when:
          equals: route
          value: $steps.classify.reply_classification.route
        skill: ./graph/emit-result
        inputs:
          classification: $steps.classify.reply_classification.classification
          route: $steps.classify.reply_classification.route
          reason: $steps.classify.reply_classification.reason
          routing_decision: $steps.classify.reply_classification.routing_decision
      - id: stop-for-review
        label: stop ambiguous or untrusted replies for an operator
        when:
          equals: stop
          value: $steps.classify.reply_classification.route
        agent:
          role: operator
          task: reply-routing-review
        outputs:
          review_decision:
            required: false
        inputs:
          classification: $steps.classify.reply_classification.classification
          reason: $steps.classify.reply_classification.reason
          receipt_trust: $steps.classify.reply_classification.receipt_trust
          evidence: $steps.classify.reply_classification.evidence
harness:
  cases:
    - name: sealed_unsubscribe_suppression
      inputs:
        inbound_reply:
          reply_id: reply-unsubscribe-001
          from:
            address: subscriber@example.test
          subject: "Re: Product update"
          body: Please unsubscribe me from these messages.
          received_at: 2026-06-29T10:00:00Z
        original_send_receipt:
          schema: runx.receipt.v1
          status: sealed
          receipt_id: receipt-send-001
          checksum: sha256:fixture-sealed-send-001
          principal:
            type: account
            ref: account:campaign-operator
          send_plan:
            action_family: send-as
            channel: email
            audience:
              type: recipient
              ref: subscriber@example.test
        suppression_policy:
          data_source_ref: local://reply-router/harness
          store_id: reply-router-harness-v1
          resource: reply_suppressions
          unsubscribe_phrases:
            - unsubscribe me
            - remove me
      expect:
        status: sealed
      operator_journeys:
        - mode: standalone
          confusors:
            - inbox-triage
            - send-as
          request: Route this inbound reply.
          expected_outcome: Append a suppression for unsubscribes or return a bounded routing decision, sending nothing.
        - mode: composed
          request: Continue this reply-router work from evidence already gathered upstream.
          expected_outcome: Append a suppression for unsubscribes or return a bounded routing decision, sending nothing.
          prior_evidence:
            - The inbound reply and the original send receipt already supplied.
          must_not_repeat:
            - Do not reply to the sender.
    - name: stop_ambiguous_or_unsealed
      inputs:
        inbound_reply:
          reply_id: reply-stop-001
          from:
            address: subscriber@example.test
          subject: "Re: Product update"
          body: Stop.
          received_at: 2026-06-29T10:05:00Z
        original_send_receipt:
          schema: runx.receipt.v1
          status: open
          receipt_id: receipt-send-unsealed-001
          principal:
            type: account
            ref: account:campaign-operator
          send_plan:
            action_family: send-as
            channel: email
            audience:
              type: recipient
              ref: subscriber@example.test
        suppression_policy:
          data_source_ref: local://reply-router/harness
          store_id: reply-router-harness-v1
          resource: reply_suppressions
          unsubscribe_phrases:
            - unsubscribe me
            - remove me
      expect:
        status: needs_agent

Published package and test evidence.

This exact version passed its recorded harness run: 2 checks passed · 0 failed.

Test result

Harness resultPassed
Tested versionsha-a5a8c28f45c0
Recorded result2 checks passed · 0 failed
Result sourceReported by the publisher (runx_registry_publish)
Suiterunx-harness
Test recorded
Declared cases2
Test recordOpen the recorded run
Inspect receipt referencessha256:be750a4e8e99b9073b336cfda69a868090964c8434f8c080ecc6f8e35466c92bsha256:82f30e9cf7436c23a95b043ac26844c389ff9de93044aa63b78b14d09e4027d4

Package identity

Published revisionsha-a5a8c28f45c0
Content digestsha256:a5a8c28f45c0232a4dcfdc921e8a0ea7a085cc0ef32239e5f4555d949cc385eb
SKILL.md digestsha256:b7b233e998e908a1db33b63170c23746fd530baa214074a5cb8328b775e902c3
Execution profile digestsha256:27d1e491a49b5bc5c8df02bf039467825a0f605166c9f9243d417ecdcb179282
Publisher identityUnverified publisher · hengyiming720-ui
Trust tierCommunityPublished through the registry without publisher verification. This tier is not a code assessment.
Attestations
  • Publisher · Declaredhengyiming720-ui · 17 Oct 2026
Source provenanceNot published with this version

Version history

  1. 0.1.2Content digest sha256:3fccb79fdf5b7e9793bfa6f7902fd611ede8a9b55d98b7deb78fd4aa65046494
  2. sha-a5a8c28f45c0ViewingContent digest sha256:a5a8c28f45c0232a4dcfdc921e8a0ea7a085cc0ef32239e5f4555d949cc385eb
  3. sha-f04bdb0bcd83Content digest sha256:f04bdb0bcd834447e9b8761a8c6558d8bbc49dee6932e9f0ddad0de209c234fe
  4. sha-ba64a93d3f7bContent digest sha256:ba64a93d3f7b8469f40da838f5308ecae0adf1ba6fa4c737d970f424cccb700d
  5. sha-63f71f2009c0Content digest sha256:63f71f2009c09ca7ab2691059ac10f8a9755b0cc48593155d46490dcaab8606d