---
id: WF-ACC-REC-009
title: Publish and sweep blocker attention
trigger: >-
  Blocker writes invoke attention synchronization, and the hourly handler
  repairs eligible attention records.
product_area: accounting
module: reconciliation
revision: 3
status: draft
design_intent: proposed
implementation_evidence: observed
inference: []
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
implements:
  - CAP-ACC-REC-015
  - CAP-ACC-REC-016
  - CAP-ACC-REC-017
moves:
  - STATE-ACC-REC-005
crosses:
  - SVC-ACC-REC-reconciliation
idempotency: >-
  The exception identity is the attention dedupe key. Enabled sweeps republish
  active blockers and clear unconfirmed items; overlapping pages and source
  writes do not prove permanent agreement.
concurrency: >-
  The sweep function has reserved concurrency one, but source writes can overlap
  its separate page transactions.
hops:
  - 'n': 1
    actor_or_service: 'Exception write (raise, reopen, resolve, clear, accept approval)'
    action: Invoke blocker synchronization within the exception mutation transaction.
    anchor: >-
      services-accounting:modules/reconciliation/services/persistence/reconciliation-blocker-items.ts:syncBlockerAttention
    seam: sync
    on_failure: Enabled publication failure aborts the exception write.
    left_inconsistent: No partial business and attention change commits in that transaction.
    observer: The calling operation reports the error.
    provenance: observed
    source: >-
      services-accounting:modules/reconciliation/services/persistence/reconciliation-blocker-items.ts:syncBlockerAttention
  - 'n': 2
    actor_or_service: Accounting attention publisher
    action: >-
      Apply Platform attention writes only when the deployment switch permits
      publication.
    anchor: 'services-accounting:lib/attention.ts:attentionPublishingEnabled'
    seam: sync
    on_failure: Platform write failure propagates when enabled.
    left_inconsistent: Disabled publication leaves blocker records without attention items.
    observer: Pinned production configuration disables publication.
    provenance: observed
    source: 'services-accounting:aws/accounting.names.ts:attentionPublishingEnabled'
  - 'n': 3
    actor_or_service: Platform attention
    action: >-
      Attach business-unit scope, responsibility audience and overview
      destination to the item.
    anchor: >-
      services-accounting:modules/reconciliation/attention/reconciliation-blockers.attention.ts:reconciliationBlockers
    seam: sync
    on_failure: Audience presentation and delivery remain Platform responsibilities.
    left_inconsistent: An existing item does not prove a holder has seen it.
    observer: Platform attention views are the intended presentation.
    provenance: observed
    source: >-
      services-accounting:modules/reconciliation/attention/reconciliation-blockers.attention.ts:reconciliationBlockers
  - 'n': 4
    actor_or_service: Hourly reconciliation attention pass
    action: >-
      Bootstrap schedules, publish blocker pages per unit, then clear
      unconfirmed items and complete the pass.
    anchor: >-
      services-accounting:modules/reconciliation/services/attention/reconciliation-blockers-sweep.ts:sweepReconciliationBlockers
    seam: schedule
    on_failure: >-
      Workspace and invocation failure handling belongs to the unavailable
      shared wrapper.
    left_inconsistent: A failed pass can leave attention or schedule bootstrap stale.
    observer: The local function declares error and silence monitoring.
    provenance: observed
    source: >-
      services-accounting:modules/reconciliation/aws/lambda/RECONCILIATION_ATTENTION_SWEEP.ts:handler
branches:
  - >-
    Bank disagreement concerns are warnings and do not publish blocker
    attention.
waits: []
evidence:
  - >-
    services-accounting at f47cb263:
    modules/reconciliation/attention/reconciliation-blockers.attention.ts;
    services/persistence/reconciliation-blocker-items.ts;
    services/rules/blocker-attention.ts;
    services/attention/reconciliation-blockers-sweep.ts;
    aws/lambda/RECONCILIATION_ATTENTION_SWEEP.ts;
    aws/logic/reconciliation-attention-sweep.lambda.ts; lib/attention.ts;
    aws/accounting.names.ts; aws/cdk.json.
controls: [TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-005, TC-AZ-006, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-TEN-004, TC-DAT-001, TC-LOG-001, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-LOG-005, TC-AVL-001, TC-AVL-004, TC-MON-001, TC-MON-002, TC-MON-004, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005]
---
# Publish and sweep blocker attention

## What It Does

Blocker mutations call attention in their own transaction; the hourly pass supplies a repair path. The publishing switch determines whether those calls change Platform records.

## The Flow

```mermaid
sequenceDiagram
  participant W as Exception write
  participant A as Attention publisher
  participant P as Platform attention
  participant H as Hourly pass
  W->>A: sync the blocker (same transaction)
  alt switch on
    A->>P: publish or resolve
  else switch off
    A-->>W: nothing to publish
  end
  H->>H: ensure daily schedules
  H->>P: republish open blockers per unit
  H->>P: resolve unconfirmed items as cleared
```

## When Something Fails

With publishing disabled, business writes succeed without alerts. Enabled publication errors can abort business writes, while failed sweep pages wait for later repair. The local handler does not prove bootstrap runs when the shared wrapper disables a pass.

## Open Design Questions

Production attention enablement and separate schedule bootstrap remain unresolved. Exception navigation should be reviewed against the existing detail panel.
