---
id: ADR-PFM-LLM-009
title: Replace Limits at the Inspected Version
product_area: platform
module: llm
revision: 1
status: proposed
design_intent: confirmed
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
decision: >-
  Submit complete editable limits with the inspected version, reject stale changed values and treat matching
  existing values as an unchanged replay.
constrains:
  - DOM-PFM-LLM-003
  - WF-PFM-LLM-007
  - SVC-PFM-LLM-llm
  - SCR-PFM-LLM-007
origin: >-
  Record Write Contracts W1 and W2 (Andrew's ruling D-05, 2026-10-19: a current version on every
  field-changing write, 400 missing, 409 stale; a no-op changes nothing)
  (services-platform:docs/standards/record-write-contracts.md#W1. Version preconditions on field-changing
  writes (D-05, D-35, D-52); #W2. A no-op write changes nothing (D-05)).
alternatives:
  - option: Save isolated fields without a complete intended state
    why_not: It makes the intended replacement harder to inspect; this service instead uses a full value set.
  - option: Use last-writer-wins saves
    why_not: It can silently replace another manager’s changes.
consequences:
  - A matching existing row returns unchanged without another audit or version increment.
  - Omitted optional cap and note select their replacement defaults.
  - The future editor must submit the displayed version and complete editable values.
  - >-
    Identical competing first inserts can still conflict before an existing row is available for replay
    comparison.
supersedes: []
evidence:
  - >-
    services-platform at ad3f6a6: modules/llm/services/limits/tenant-limits.ts; services/persistence/limits.ts
    (writeTenantLimits); aws/api/llm-usage-api-mapper.ts (limitsVersionOf); tests/e2e/llm-limits.e2e.spec.js.
---

# Replace Limits at the Inspected Version

## Context

Two managers must be able to detect a conflicting configuration edit without losing each other’s work.

## Decision

Submit complete editable limits with the inspected version, reject stale changed values and treat matching existing values as an unchanged replay.

## Alternatives Considered

Save isolated fields without a complete intended state: It makes the intended replacement harder to inspect; this service instead uses a full value set.

Use last-writer-wins saves: It can silently replace another manager’s changes.

## Consequences

A matching existing row returns unchanged without another audit or version increment. Omitted optional cap and note select their replacement defaults. The future editor must submit the displayed version and complete editable values. Identical competing first inserts can still conflict before an existing row is available for replay comparison.
