---
id: ADR-CRM-REG-006
title: The Policy Is Edited Whole or One Rule at a Time Under One Lock
product_area: crm
module: regions
revision: 2
status: proposed
design_intent: proposed
source_sha:
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
decision: >-
  Full policy saves and individual-rule operations coordinate through an existing settings-row lock, but full
  replacement recreates retained rules and resets their versions.
constrains:
  - DOM-CRM-REG-002
  - STATE-CRM-REG-002
  - WF-CRM-REG-004
  - SVC-CRM-REG-regions
  - SCR-CRM-REG-003
origin: >-
  Andrew, 2026-10-11 (rules are managed one at a time) and 2026-10-15 (a read-only tab with its own editor
  screen), cited in services-crm:docs/migrations/crm-regions/README.md; DEF-CRM-0339
alternatives:
  - option: Keep only complete-policy replacement.
    why_not: >-
      The recorded earlier choice introduced individual-rule maintenance, and clients may depend on that
      surface.
  - option: Keep only individual-rule updates.
    why_not: The approved console experience stages a complete policy and saves it in one request.
  - option: Update retained rules in place and increment their versions.
    why_not: This remains the recommended unresolved option rather than an adopted implementation decision.
consequences:
  - A versioned full-policy save conflicts after a newer individual-rule write.
  - Resetting retained rules to version one can admit an older individual edit.
  - A full editor save must include every rule intended to remain.
supersedes: []
evidence:
  - >-
    services-crm at a8d1364f: modules/regions/services/persistence/region-assignment-settings.ts
    (saveRegionAssignmentSettings, insertRule, stampRulesChanged).
---

# The Policy Is Edited Whole or One Rule at a Time Under One Lock

## Context

The API retains individual-rule maintenance while the console stages one complete policy. Both paths must coordinate without silently losing coverage edits.

## Decision

Individual changes increment settings version and generation. Full saves check settings version when supplied and replace the complete rule list, retaining submitted identifiers. Initialization races and reset rule versions remain gaps.

## Alternatives Considered

Keep only complete-policy replacement. The recorded earlier choice introduced individual-rule maintenance, and clients may depend on that surface.

Keep only individual-rule updates. The approved console experience stages a complete policy and saves it in one request.

Update retained rules in place and increment their versions. This remains the recommended unresolved option rather than an adopted implementation decision.

## Consequences

A versioned full-policy save conflicts after a newer individual-rule write. Resetting retained rules to version one can admit an older individual edit. A full editor save must include every rule intended to remain.
