---
id: ADR-ACC-CLS-005
title: Command Replay Compares the Saved Request
product_area: accounting
module: close
revision: 1
status: proposed
design_intent: confirmed
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
decision: >-
  A workspace command key should identify the complete close or reopen request,
  including requester, and return the original run only when every compared fact
  matches.
constrains:
  - DOM-ACC-CLS-003
  - SVC-ACC-CLS-fiscal-close
  - WF-ACC-CLS-001
  - WF-ACC-CLS-002
  - SCR-ACC-CLS-001
origin: >-
  services-accounting:docs/milestones/ACCT-M4-contracts-and-events-for-commerce.md#Rulings
  recorded during the milestone (2026-10-21 09:47 ET: another requester reusing
  a key is a conflict); docs/architecture/accounting-2.0/06-integrity-model.md
  FC-19
alternatives:
  - option: Compare only month and action kind.
    why_not: >-
      Changed notes and acknowledgements would be discarded while the caller
      believes they were retained.
  - option: Create fresh work for every repeated key.
    why_not: >-
      Network recovery could create another request for the same intended
      action.
consequences:
  - >-
    A newly opened confirmation dialog reserves a new key for a deliberate
    request.
  - >-
    The implemented comparison omits requester identity and therefore does not
    yet meet the recorded ruling.
  - >-
    A competing insert can return a conflict instructing the client to replay
    and read the saved run.
  - Customer export excludes command keys.
supersedes: []
evidence:
  - >-
    services-accounting at f47cb263:
    modules/fiscal-close/services/persistence/period-close-runs.ts:createPeriodCloseRun,
    sameRequest; db/period-close-runs.table.ts.
---

# Command Replay Compares the Saved Request

## Context

Resending a request after losing its response must neither repeat the financial action nor silently replace the recorded request.

## Decision

Treat command replay as retrieval of the identical original request. The recorded product direction includes requester identity even though current comparison omits it.

## Alternatives Considered

Compare only month and action kind. Changed notes and acknowledgements would be discarded while the caller believes they were retained.

Create fresh work for every repeated key. Network recovery could create another request for the same intended action.

## Consequences

A newly opened confirmation dialog reserves a new key for a deliberate request. The implemented comparison omits requester identity and therefore does not yet meet the recorded ruling. A competing insert can return a conflict instructing the client to replay and read the saved run. Customer export excludes command keys.
