List hygiene judge

Decide whether a contact should be verified, suppressed, or re-permissioned from read engagement and bounce evidence, record the consent transition through data-store, and leave the send to a separate governed run.

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

Overview

List hygiene is the judgment that sits between engagement decay and suppression, and the dangerous part is the durable consent-state transition. This skill is a graph runner: it reads a contact through the hosted data-store keyed by the contact as the domain entity, decides whether to verify, suppress, or re-permission, and records the transition by appending exactly one event to that contact's stream.

The decision is a thin act{form: review} over content-keyed memory: the seal proves the read and the verdict. The state write is an ungated compare-and-set append_event under idempotency_key plus expected_version — not a proposal and not a mint.

The skill never sends. The recorded consent state is honored later by send-as, which is a separate governed run dispatched by naming: send-as reads the recorded state at send time and gates delivery, so a suppressed contact cannot receive a campaign. send-as is the downstream enforcer of the recorded state, never a consumer of this skill's output.

In the manual

Runners

  • decide
  • judge

Declared by its execution profile. Read the profile

SKILL.md

List Hygiene Judge

List hygiene is the judgment that sits between engagement decay and suppression, and the dangerous part is the durable consent-state transition. This skill is a graph runner: it reads a contact through the hosted data-store keyed by the contact as the domain entity, decides whether to verify, suppress, or re-permission, and records the transition by appending exactly one event to that contact's stream.

The decision is a thin act{form: review} over content-keyed memory: the seal proves the read and the verdict. The state write is an ungated compare-and-set append_event under idempotency_key plus expected_version — not a proposal and not a mint.

The skill never sends. The recorded consent state is honored later by send-as, which is a separate governed run dispatched by naming: send-as reads the recorded state at send time and gates delivery, so a suppressed contact cannot receive a campaign. send-as is the downstream enforcer of the recorded state, never a consumer of this skill's output.

Inputs

  • data_source_ref and store_id: the pinned data-store binding.
  • resource: the data-store resource holding the contact consent stream (default contacts).
  • aggregate_id: the contact entity id, used as the data-store aggregate id.
  • expected_version: the stream version the caller read. A mismatch against the projection is a stale-evidence stop, never a write.
  • idempotency_key: stable append key, so a retry with the same key returns the recorded version instead of double-applying the transition.
  • engagement_history: opens_count, clicks_count, hard_bounces, recency_days.
  • bounce_policy: hard_bounce_action, decay_threshold_days.
  • current_consent_state: the consent state the caller believes is current. An active unsubscribe marker in the store outranks it.

Output Contract

The output packet is runx.list.hygiene_judge.v1 data:

  • decision{state,reason} always appears. state is one of re_permission, suppress, no_change, or stop.
  • recorded_transition and contact_event appear only when a transition is warranted, and carry the aggregate_id / expected_version / idempotency_key binding of the append.
  • stop_state appears instead whenever no append is emitted.
  • There is no operational_proposal envelope and no minted grant.

The Judgment

Decided in this order, and every branch is grounded in state that was read:

  1. Evidence gate. A missing opens_count, clicks_count, hard_bounces, or recency_days counter is a stop, not a zero. An unreadable contact projection is a stop. A missing bounce_policy is a stop.
  2. Stale expected_version. Checked before deciding: if the projection is at a different version than the caller passed, our read is behind the stream and any append would apply against state we never saw. Stop, escalate.
  3. Ambiguous bounce recovery. The contact hard-bounced and has since engaged inside the decay window. Suppressing would drop a live human; re-permissioning would ignore a real delivery failure. Neither is decidable from the evidence, so neither is taken — escalate to a human approval lane.
  4. Suppress. hard_bounces > 0 read from the store. This is the only path to suppression: the judgment refuses to suppress without hard-bounce evidence.
  5. Active unsubscribe marker. Refuse to re-permission a contact carrying one, and escalate instead.
  6. Re-permission. recency_days exceeds bounce_policy.decay_threshold_days with no unsubscribe marker and no hard bounces.
  7. Otherwise no_change, and no event is appended.

State Write

read_projection on the contact entity, decide, then append_event with idempotency_key + expected_version compare-and-set against the pinned store_id. The append and the read-back are both guarded on decision.writes == true, so every stop path provably emits no append.

Harness

Three inline cases, run with runx harness ./skills/list-hygiene-judge:

  • sealed_decay_re_permission — recency_days 400 over a 180-day threshold, no unsubscribe marker, no bounces → re_permission, one append.
  • sealed_hard_bounce_suppress — hard_bounces 2 → suppress, one append.
  • stop_missing_or_stale_evidence — engagement_history absent → stop, and the guards block both the append and the read-back.

Install and Run

bash
runx add <owner>/list-hygiene-judge@<version>
runx skill <owner>/list-hygiene-judge@<version> --json \
  -i data_source_ref=<ref> -i store_id=<store> \
  -i aggregate_id=<contact-id> -i expected_version=0 \
  -i idempotency_key=<key> \
  --input-json engagement_history='{"opens_count":0,"clicks_count":0,"hard_bounces":0,"recency_days":400}' \
  --input-json bounce_policy='{"hard_bounce_action":"suppress","decay_threshold_days":180}' \
  -i current_consent_state=subscribed
runx verify --receipt <receipt.json> --json

Published execution profile

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

Runners
  • decide
  • judge
Profile digestsha256:9bf8efc9bde22f242420941c6bd3d0913b07c78c61a37eae67ca7369c3b6261c
skill: list-hygiene-judge
version: 0.1.1
catalog:
  kind: graph
  audience: public
  visibility: public
  role: canonical
  execution: plan
  completion: runtime_receipt
  approval: none
  category: growth
connectors:
  store:
    operations:
      - events.append
      - projection.read
runners:
  decide:
    inputs:
      data_source_ref:
        type: string
        required: false
        description: Logical data-store binding, echoed into the evidence resource ref.
      resource:
        type: string
        required: false
        description: data-store resource holding the contact consent stream; defaults to contacts.
      aggregate_id:
        type: string
        required: true
        description: The contact entity id used as the data-store aggregate.
      expected_version:
        type: number
        required: true
        description: Stream version the caller read; a mismatch against the projection is a stale-evidence stop, never a write.
      idempotency_key:
        type: string
        required: true
        description: Stable append key so a retry returns the recorded version instead of double-applying the transition.
      engagement_history:
        type: json
        required: false
        description: engagement_history{opens_count,clicks_count,hard_bounces,recency_days}; a missing counter is a stop, not a zero.
      bounce_policy:
        type: json
        required: false
        description: bounce_policy{hard_bounce_action,decay_threshold_days} declared by the caller, never inferred.
      current_consent_state:
        type: string
        required: false
        description: Consent state the caller believes is current; the store projection's unsubscribe marker outranks it.
      contact_read:
        type: json
        required: false
        description: The data-store read_projection result for the contact, passed whole so an empty projection reads as empty-but-read.
    steps:
      - id: decide
        tool:
          command: node
          args:
            - run.mjs
        inputs:
          data_source_ref: $input.data_source_ref
          resource: $input.resource
          aggregate_id: $input.aggregate_id
          expected_version: $input.expected_version
          idempotency_key: $input.idempotency_key
          engagement_history: $input.engagement_history
          bounce_policy: $input.bounce_policy
          current_consent_state: $input.current_consent_state
          contact_read: $input.contact_read
        artifacts:
          wrap_as: list_hygiene_judgment
  judge:
    default: true
    inputs:
      data_source_ref:
        type: string
        required: true
        description: Logical data-store binding for the contact consent event stream.
      store_id:
        type: string
        required: true
        description: Pinned data-store id so harness and dogfood receipts are deterministic.
      resource:
        type: string
        required: false
        description: data-store resource holding the contact consent stream; defaults to contacts.
      aggregate_id:
        type: string
        required: true
        description: The contact entity id used as the data-store aggregate id.
      expected_version:
        type: number
        required: true
        description: Current stream version required by the CAS append_event that records the consent transition.
      idempotency_key:
        type: string
        required: true
        description: Stable append key so retries do not double-apply the consent transition.
      engagement_history:
        type: json
        required: false
        description: engagement_history{opens_count,clicks_count,hard_bounces,recency_days} read for this contact.
      bounce_policy:
        type: json
        required: false
        description: bounce_policy{hard_bounce_action,decay_threshold_days}; missing policy produces a stop with no append.
      current_consent_state:
        type: string
        required: false
        description: Consent state as the caller has it; an active unsubscribe marker in the store escalates instead of re-permissioning.
    result_from:
      - decide
      - readback
    policy:
      guards:
        - step: append-transition
          value: $steps.decide.list_hygiene_judgment.decision.writes
          equals: true
        - step: readback
          value: $steps.decide.list_hygiene_judgment.decision.writes
          equals: true
    steps:
      - id: read-contact
        operation: store/projection.read
        input:
          data_source_ref: $input.data_source_ref
          resource: contacts
          aggregate_id: $input.aggregate_id
      - id: decide
        label: judge the consent-state transition without sending anything
        skill: .
        runner: decide
        inputs:
          data_source_ref: $input.data_source_ref
          resource: $input.resource
          aggregate_id: $input.aggregate_id
          expected_version: $input.expected_version
          idempotency_key: $input.idempotency_key
          engagement_history: $input.engagement_history
          bounce_policy: $input.bounce_policy
          current_consent_state: $input.current_consent_state
          contact_read: $steps.read-contact.provider_operation.result
      - id: append-transition
        operation: store/events.append
        idempotency_key: $input.idempotency_key
        input:
          data_source_ref: $input.data_source_ref
          resource: contacts
          aggregate_id: $input.aggregate_id
          expected_version: $input.expected_version
          event: $steps.decide.list_hygiene_judgment.contact_event
      - id: readback
        operation: store/projection.read
        input:
          data_source_ref: $input.data_source_ref
          resource: contacts
          aggregate_id: $input.aggregate_id
harness:
  cases:
    - name: sealed_decay_re_permission
      runner: judge
      inputs:
        data_source_ref: local://runx-list-hygiene-judge/harness
        store_id: list-hygiene-judge-harness-v1
        resource: contacts
        aggregate_id: contact:acct-4242:c-1001
        expected_version: 0
        idempotency_key: contact:acct-4242:c-1001:hygiene:v1
        engagement_history:
          opens_count: 0
          clicks_count: 0
          hard_bounces: 0
          recency_days: 400
        bounce_policy:
          hard_bounce_action: suppress
          decay_threshold_days: 180
        current_consent_state: subscribed
      expect:
        status: sealed
        receipt:
          schema: runx.receipt.v1
      operator_journeys:
        - mode: standalone
          confusors:
            - send-as
            - data-store
          request: Decide whether to verify, suppress or re-permission this contact.
          expected_outcome: Return the judgment and record the consent transition with one compare-and-set append, sending nothing.
        - mode: composed
          request: Continue this list-hygiene-judge work from evidence already gathered upstream.
          expected_outcome: Return the judgment and record the consent transition with one compare-and-set append, sending nothing.
          prior_evidence:
            - The contact read from the data store already sealed.
          must_not_repeat:
            - Do not append the same transition twice.
    - name: sealed_hard_bounce_suppress
      runner: judge
      inputs:
        data_source_ref: local://runx-list-hygiene-judge/harness
        store_id: list-hygiene-judge-harness-v1
        resource: contacts
        aggregate_id: contact:acct-4242:c-1002
        expected_version: 0
        idempotency_key: contact:acct-4242:c-1002:hygiene:v1
        engagement_history:
          opens_count: 0
          clicks_count: 0
          hard_bounces: 2
          recency_days: 30
        bounce_policy:
          hard_bounce_action: suppress
          decay_threshold_days: 180
        current_consent_state: subscribed
      expect:
        status: sealed
        receipt:
          schema: runx.receipt.v1
    - name: stop_missing_or_stale_evidence
      runner: judge
      inputs:
        data_source_ref: local://runx-list-hygiene-judge/harness
        store_id: list-hygiene-judge-harness-v1
        resource: contacts
        aggregate_id: contact:acct-4242:c-1003
        expected_version: 0
        idempotency_key: contact:acct-4242:c-1003:hygiene:v1
        bounce_policy:
          hard_bounce_action: suppress
          decay_threshold_days: 180
        current_consent_state: subscribed
      expect:
        status: policy_denied
        receipt:
          schema: runx.receipt.v1

Published package and test evidence.

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

Test result

Harness resultPassed
Tested versionsha-aa9afeeabb60
Recorded result3 checks passed · 0 failed
Result sourceReported by the publisher (runx_registry_publish)
Suiterunx-harness
Test recorded
Declared cases3
Test recordOpen the recorded run
Inspect receipt referencessha256:9fbb2e05c7f49894d7d111aa7d5f0761b118979d81cfdfd974d38e1575f1c17asha256:0b2c6d6a627b7231099469477f5c12289d993556ff990c85f0fa260c107532ddsha256:87cfefc7cc6b9f5474f2a905c567e80c1928a68583d11356f092237fdf7b932f

Package identity

Published revisionsha-aa9afeeabb60
Content digestsha256:aa9afeeabb609fb672ba2fa959ffeceb5ef72fe525f8fc904588974f253e4771
SKILL.md digestsha256:dbf551d2d19aa12fe3a6c834920fdb15d2b496cd19b5653e630b7addf8f4667a
Execution profile digestsha256:9bf8efc9bde22f242420941c6bd3d0913b07c78c61a37eae67ca7369c3b6261c
Publisher identityUnverified publisher · charlie-morrison
Trust tierCommunityPublished through the registry without publisher verification. This tier is not a code assessment.
Attestations
  • Publisher · Declaredcharlie-morrison · 17 Oct 2026
Source provenanceNot published with this version

Version history

  1. 0.1.2Content digest sha256:443262c01080446aeb48d241b416c1f6c5de40eebfd87401b78328f439df1eff
  2. sha-aa9afeeabb60ViewingContent digest sha256:aa9afeeabb609fb672ba2fa959ffeceb5ef72fe525f8fc904588974f253e4771
  3. sha-1171bbb0410eContent digest sha256:1171bbb0410e279f6012c39848190c946efe9988b73615dcac51bfc07f2892a6
  4. sha-04c26976caceContent digest sha256:04c26976cace06e892d41abf9f3072f5b97c9b3623f41a3792c1b743eabe15db
  5. sha-3638f1f5e827Content digest sha256:3638f1f5e82778859db4155f1facbec13a9e078a0e127b704a53f494c24a89a8