---
id: WF-PFM-ELG-016
title: Publish and resolve attention at source
trigger: >-
  A provider’s business transaction publishes, refreshes or resolves its own
  attention condition; its sweep repairs unconfirmed occurrences.
product_area: platform
module: eligibility
revision: 1
status: draft
design_intent: confirmed
origin: >-
  Responsibilities and attention architecture D-03 (items persisted, written at
  source, repaired by sweeps), D-05 (providers write scope chains) and D-13
  (restricted write functions), approved by Andrew 2026-10-18 (PLAT-M15
  "Decisions"); PLAT-M15 D1 (Accounting publishing switch on in dev, production
  off)
implementation_evidence: observed
inference: []
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
implements:
  - CAP-PFM-ELG-016
  - CAP-PFM-ELG-017
moves:
  - STATE-PFM-ELG-007
crosses:
  - SVC-PFM-ELG-attention
idempotency: >-
  Publishing an open key refreshes that occurrence; repeat resolution reports
  whether it changed an open item. Sweep resolution compares the confirmation
  cutoff.
concurrency: >-
  Publishing creates or locks the key row. Provider business data and attention
  write share the same transaction.
hops:
  - 'n': 1
    actor_or_service: Owning application (its own transaction)
    action: >-
      Publish the declared kind, key, about record, provider scope chain,
      audiences, typed facts, timing and destination under the owning service.
    anchor: >-
      services-platform:db/migrations/20261019130938_attention.sql:platform.publish_attention_item
    seam: sync
    on_failure: >-
      Foreign ownership, missing or retired kinds and invalid facts or audiences
      raise.
    left_inconsistent: The failed attention write rolls back with the provider change.
    observer: The provider’s caller sees the error.
    provenance: observed
    source: >-
      services-platform:modules/attention/services/persistence/items.ts:publishItem
  - 'n': 2
    actor_or_service: Publish function
    action: >-
      Lock the key, refresh the existing occurrence or create a new one,
      preserve escalation audiences and compute rank and effective surfaces.
    anchor: >-
      services-platform:db/migrations/20261019130938_attention.sql:platform.attention_priority_rank
    seam: sync
    on_failure: A database error aborts the caller transaction.
    left_inconsistent: No partial item update commits.
    observer: The provider receives the database error.
    provenance: observed
    source: 'services-platform:docs/attention.md#2. The write functions'
  - 'n': 3
    actor_or_service: Owning application
    action: Resolve the key with a short outcome when its condition clears.
    anchor: >-
      services-platform:db/migrations/20261019130938_attention.sql:platform.resolve_attention_item
    seam: sync
    on_failure: A refused resolve aborts its transaction.
    left_inconsistent: >-
      No inconsistent source commit is introduced by a successful transactional
      resolve.
    observer: The owning application sees whether an item closed.
    provenance: observed
    source: >-
      services-platform:modules/attention/services/persistence/items.ts:resolveItem
  - 'n': 4
    actor_or_service: Owning application's sweep
    action: >-
      Republish conditions that still hold, resolve older unconfirmed items
      within the sweep scope and record completion.
    anchor: >-
      services-platform:db/migrations/20261019130938_attention.sql:platform.resolve_unconfirmed_attention_items
    seam: schedule
    on_failure: Provider sweep failure handling determines retry.
    left_inconsistent: >-
      Conditions cleared without a source write can remain open until a
      successful sweep.
    observer: The catalogue’s last sweep stamp exposes freshness.
    provenance: observed
    source: >-
      services-platform:db/migrations/20261019130938_attention.sql:platform.attention_sweep_completed
branches:
  - >-
    Provider integrations can be gated off by their own approved release
    switches; this contract does not establish a deployment state outside its
    source boundary.
waits: []
evidence:
  - >-
    services-platform at ad3f6a6: db/migrations/20261019130938_attention.sql,
    20261021142357_attention_lifecycle.sql;
    modules/attention/services/persistence/items.ts; docs/attention.md §2;
    docs/milestones/PLAT-M15-home-attention-and-responsibilities.md (D1).
controls: [TC-AVL-004, TC-AVL-005, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-005, TC-AZ-006, TC-CHG-001, TC-CHG-002, TC-CHG-003, TC-CHG-004, TC-CHG-005, TC-CHG-006, TC-CHG-007, TC-CRY-001, TC-CRY-002, TC-CRY-003, TC-CRY-004, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-DAT-004, TC-IAM-001, TC-IAM-002, TC-IAM-003, TC-IAM-004, TC-IAM-005, TC-IAM-006, TC-LOG-001, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-LOG-005, TC-MON-001, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-PRV-001, TC-PRV-002, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-TEN-004, TC-VEN-001, TC-VEN-002, TC-VEN-003]
---
# Publish and resolve attention at source

## What It Does

A provider’s business transaction publishes, refreshes or resolves its own attention condition; its sweep repairs unconfirmed occurrences.

## The Flow

```mermaid
flowchart TD
  H1["Owning application (its own transaction)" ]
  H2["Publish function" ]
  H1 --> H2
  H3["Owning application" ]
  H2 --> H3
  H4["Owning application's sweep" ]
  H3 --> H4
```

Publish the declared kind, key, about record, provider scope chain, audiences, typed facts, timing and destination under the owning service. Lock the key, refresh the existing occurrence or create a new one, preserve escalation audiences and compute rank and effective surfaces. Resolve the key with a short outcome when its condition clears. Republish conditions that still hold, resolve older unconfirmed items within the sweep scope and record completion.

## When Something Fails

Foreign ownership, missing or retired kinds and invalid facts or audiences raise. The failed attention write rolls back with the provider change. A database error aborts the caller transaction. No partial item update commits. A refused resolve aborts its transaction. No inconsistent source commit is introduced by a successful transactional resolve. Provider sweep failure handling determines retry. Conditions cleared without a source write can remain open until a successful sweep.

## Open Design Questions

Provider integrations can be gated off by their own approved release switches; this contract does not establish a deployment state outside its source boundary.
