Reply router

Classify an inbound reply against a sealed original send receipt and either append a recipient-keyed suppression event to a hosted data-store or emit a bounded governed routing decision. The skill never sends mail.

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

Overview

reply-router reads one inbound reply together with the sealed original send receipt that produced it, classifies the reply against a suppression policy, and branches. The skill is a read-and-route judgment: it never sends mail, never mints a new send, and never edits the original send receipt. The actual send is a separate governed send-as run a downstream driver issues by name.

In the manual

Runner

  • reply_route

Declared by its execution profile. Read the profile

SKILL.md

Reply Router

reply-router reads one inbound reply together with the sealed original send receipt that produced it, classifies the reply against a suppression policy, and branches. The skill is a read-and-route judgment: it never sends mail, never mints a new send, and never edits the original send receipt. The actual send is a separate governed send-as run a downstream driver issues by name.

What This Skill Does

The skill reads three pieces of evidence:

  • inbound_reply{content, received_from, received_at}
  • original_send_receipt{send_plan, principal, receipt_id, checksum}
  • suppression_policy{unsubscribe_signals, confidence_threshold}

It validates that the original send receipt is sealed (the receipt envelope is present and the checksum matches the named send_plan) and that the policy names at least one unsubscribe signal. It then classifies the reply by searching the content for any of the policy's unsubscribe_signals strings or patterns. A high-confidence unsubscribe match appends a suppression event to the hosted data-store registry:runx/data-store@0.1.2 via an append_event with an idempotency key and an expected_version CAS. The durable record is the compliance block the next send-as preflight reads as a fail-closed gate.

For other classifications (interested, objection, out-of-office, wrong-person), the skill emits a typed runx.reply.routing.v1 decision naming a bounded send_target and a principal. A downstream send-as run honors that decision later; the skill itself does not dispatch.

For an unsealed or missing original send receipt, or for an inbound reply whose content does not match any policy signal and where the agent cannot ground a typed classification, the skill escalates to a human approval lane and emits no suppression event and no routing decision.

When To Use It

  • An operator has a sealed original send receipt and needs a typed decision on how to handle the inbound reply before any subsequent send.
  • A workflow needs to prove a recipient was unsubscribed via a durable data-store record that the next send-as preflight can verify.
  • A run should keep suppression and routing out of the actual mail path.

When Not To Use It

  • To actually send, queue, schedule, or otherwise move a message. Use a separate governed send-as run for that effect.
  • To append a suppression event without a sealed original send receipt.
  • To emit a routing decision when the inbound content is ambiguous or the reply cannot be grounded in a policy signal.
  • To invent a classification, an unsubscribe match, or a routing target that the input evidence does not support.

Procedure

  1. Read inbound_reply, original_send_receipt, and suppression_policy. Reject any missing or unclear top-level object.
  2. Verify the original_send_receipt is sealed: receipt_id and checksum are present, send_plan and principal are non-empty strings, and checksum matches the named send_plan. If any of these is missing or mismatched, escalate to the human approval lane and emit no outputs.
  3. Verify suppression_policy.unsubscribe_signals is a non-empty list of strings. The confidence_threshold must be a number in (0, 1].
  4. Search inbound_reply.content for each policy unsubscribe_signals string using a case-insensitive match. If at least one signal is found and the match is exact (not negated, not quoted as not-an-unsubscribe), classify the reply as unsubscribe with confidence 1.0 and evidence naming the matched signal and the offset in the reply content.
  5. For an unsubscribe classification, append a suppression event to the hosted data-store via append_event with:
    • aggregate_id = the reply's received_from (the recipient key)
    • idempotency_key = sha256 of {receipt_id}:{received_from}:{signal}
    • expected_version = the value from a prior read_projection against aggregate_id (0 if no prior projection exists)
    • The event payload names the matched signal, the original receipt id, and the inbound reply received_at timestamp. The skill emits a suppression_result{aggregate_id, idempotency_key, before_version, after_version}. The skill does NOT emit a routing decision on this path.
  6. If no unsubscribe signal matches, attempt to ground a typed classification from a bounded set (interested, objection, out-of-office, wrong-person) using the reply content and the original send plan. If grounding succeeds with confidence above confidence_threshold, emit runx.reply.routing.v1{classification, send_target, principal} naming a bounded send target the downstream send-as run honors. The skill consumes nothing and does not dispatch.
  7. If no typed classification can be grounded above confidence_threshold, escalate to the human approval lane and emit no outputs.
  8. Never invent a match, classification, or aggregate version. Never append a suppression event without a sealed original send receipt. Never classify a reply whose received_from does not match the principal of the original send receipt.

Outputs

  • classification{type, confidence, evidence} for every sealed run.
  • suppression_result{aggregate_id, idempotency_key, before_version, after_version} when the reply is an unsubscribe.
  • runx.reply.routing.v1{classification, send_target, principal} when the reply is routed.
  • escalation_reason when the run stops for a human approval lane.

Published execution profile

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

Runner
  • reply_route
Profile digestsha256:71699613249e865bdcb19a51c2d55207482bf25b50a3029b89cc04e8c0f0be8c
skill: reply-router
version: 0.1.0
catalog:
  kind: graph
  audience: public
  visibility: public
  role: context
  category: growth
connectors:
  store:
    operations:
      - events.append
      - projection.read
runners:
  reply_route:
    default: true
    inputs:
      inbound_reply:
        type: json
        required: true
        description: Inbound reply content, recipient, and timestamp.
      original_send_receipt:
        type: json
        required: true
        description: Sealed original send receipt with send_plan, principal, receipt_id, and checksum.
      suppression_policy:
        type: json
        required: true
        description: Unsubscribe signal list and confidence threshold.
    steps:
      - id: read_suppression
        label: read projection using the registry:runx/data-store@0.1.2 data-source contract
        operation: store/projection.read
        input:
          data_source_ref: local://reply-router/suppressions
          resource: suppression_events
          aggregate_id: $input.inbound_reply.received_from
      - id: classify
        agent:
          role: analyst
          task: reply-classify
        outputs:
          classification:
            required: false
          suppression_result:
            required: false
          suppression_event:
            required: false
          routing_decision:
            required: false
          escalation_reason:
            required: false
        inputs:
          inbound_reply: $input.inbound_reply
          original_send_receipt: $input.original_send_receipt
          suppression_policy: $input.suppression_policy
          current_projection: $steps.read_suppression.provider_operation.result.projection
      - id: append_suppression
        label: append through the registry:runx/data-store@0.1.2 data-source contract
        when:
          equals: unsubscribe
          value: $steps.classify.classification.type
        operation: store/events.append
        idempotency_key: $steps.classify.suppression_event.idempotency_key
        input:
          data_source_ref: local://reply-router/suppressions
          resource: suppression_events
          aggregate_id: $steps.classify.suppression_event.aggregate_id
          expected_version: $steps.read_suppression.provider_operation.result.projection.version
          event: $steps.classify.suppression_event.event
      - id: readback_suppression
        label: verify through the registry:runx/data-store@0.1.2 data-source contract
        when:
          equals: unsubscribe
          value: $steps.classify.classification.type
        operation: store/projection.read
        input:
          data_source_ref: local://reply-router/suppressions
          resource: suppression_events
          aggregate_id: $steps.classify.suppression_event.aggregate_id
harness:
  cases:
    - name: sealed_unsubscribe_suppression
      runner: reply_route
      inputs:
        inbound_reply:
          content: Please unsubscribe me from this list. No more emails please.
          received_from: ops@example.com
          received_at: 2026-07-02T10:00:00Z
        original_send_receipt:
          send_plan: '{"to":"ops@example.com","subject":"weekly digest","from":"ops@example.com","body_digest":"weekly news"}'
          principal: ops
          receipt_id: runx:receipt:sha256:abc123replyrouter
          checksum: sha256:49e1b30d46a6eee6156bcf9a1e2d8400f17d69a3e271d541b61a7ad49c7c05ad
        suppression_policy:
          unsubscribe_signals:
            - unsubscribe
            - opt out
            - remove me
          confidence_threshold: 0.8
      caller:
        answers:
          classify:
            classification:
              type: unsubscribe
              confidence: 1
              evidence: matched policy signal "unsubscribe" at offset 7
            suppression_result:
              aggregate_id: ops@example.com
              idempotency_key: bbdc596dd2d71413bc2bce898a98a2a52d32ed5d86abd73c185a2ab3a3eed733
              before_version: 0
              after_version: 1
            suppression_event:
              aggregate_id: ops@example.com
              idempotency_key: bbdc596dd2d71413bc2bce898a98a2a52d32ed5d86abd73c185a2ab3a3eed733
              event:
                type: reply.unsubscribe_recorded
                payload:
                  matched_signal: unsubscribe
                  match_offset: 7
                  original_receipt_id: runx:receipt:sha256:abc123replyrouter
                  received_at: 2026-07-02T10:00:00Z
                  data_store_ref: registry:runx/data-store@0.1.2
            routing_decision: null
            escalation_reason: null
      expect:
        status: sealed
        receipt:
          schema: runx.receipt.v1
      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
      runner: reply_route
      inputs:
        inbound_reply:
          content: ok thanks
          received_from: ops@example.com
          received_at: 2026-07-02T10:00:00Z
        original_send_receipt:
          send_plan: '{"to":"ops@example.com","subject":"weekly digest","from":"ops@example.com","body_digest":"weekly news"}'
          principal: ops
          receipt_id: runx:receipt:sha256:abc123replyrouter
          checksum: sha256:49e1b30d46a6eee6156bcf9a1e2d8400f17d69a3e271d541b61a7ad49c7c05ad
        suppression_policy:
          unsubscribe_signals:
            - unsubscribe
            - opt out
            - remove me
          confidence_threshold: 0.8
      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-0a7fbed6f66c
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:3b9f7ef34b70cefbfe8707e3fe947d0e4aca7c08a522a4de27e4f49acddeed65sha256:bb8592b3950f6053b55c092d7504c49733022dbca0fea474a112bf0d3d9a940e

Package identity

Published revisionsha-0a7fbed6f66c
Content digestsha256:0a7fbed6f66c747975f6e98308c98c59991d0863463fe86f2bcaf9e724b5554f
SKILL.md digestsha256:5e45560c752917d84d01cc07875c48497e6a293efcba9c255fa2f1716f13c777
Execution profile digestsha256:71699613249e865bdcb19a51c2d55207482bf25b50a3029b89cc04e8c0f0be8c
Publisher identityUnverified publisher · guoyunfeng
Trust tierCommunityPublished through the registry without publisher verification. This tier is not a code assessment.
Attestations
  • Publisher · Declaredguoyunfeng · 17 Oct 2026
Source provenanceNot published with this version

Version history

  1. 0.1.2Content digest sha256:27cfc52215f2c07fa51257b93568a560de12ec60b90ad66bdbbad8391d629789
  2. sha-508302f86ef8Content digest sha256:508302f86ef8306dd6629d82c8ac16f829f1fce5c772751d36290be3a65a1131
  3. sha-0a7fbed6f66cViewingContent digest sha256:0a7fbed6f66c747975f6e98308c98c59991d0863463fe86f2bcaf9e724b5554f
  4. sha-6526b816d08eContent digest sha256:6526b816d08ea76c70537b7ad017ccac23f50fc365a48bfb07ffb5b587cb73d9
  5. sha-880e6812e1e4Content digest sha256:880e6812e1e411d3b5e9e5f72bb231e33b94bfc36d541a8da72a5daa51a6a876