# lawref.evaluator.norms

*module*

L2: жизненный цикл норм — SPEC [§134](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#134-positioninstance-statuses)–[§143](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#143-chains) (DECISION-0003).

Norm creation [§135](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#135-activation), статусы [§134](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#134-positioninstance-statuses)–[§138](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#138-deadline) как проекция support-пар condition,
публикация статусов institutional literals [§140](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#140-violation) — их потребляют обычные
правила следующей итерации, чем и держится цепочка [§143](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#143-chains).

## lawref.evaluator.norms.NORM_STD

*attribute* · *module attribute*

```python
NORM_STD = 'urn:law:std#'
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/norms.py#L29-L29)

## lawref.evaluator.norms.OCCURRENCE_REF

*attribute* · *module attribute*

```python
OCCURRENCE_REF = 'urn:law:std#occurrence'
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/norms.py#L277-L277)

## lawref.evaluator.norms.AmbiguousAsOf

*class*

```python
class AmbiguousAsOf(Exception)
```

Bases: `Exception`

[§135.1](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#1351-активация-событием-decision-0156) (F10в): статус позиции меняется внутри гражданских суток даты.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/norms.py#L292-L301)

### lawref.evaluator.norms.AmbiguousAsOf.issue

*attribute* · *instance attribute*

```python
issue = {'code': 'AMBIGUOUS_AS_OF', 'severity': 'fatal', 'message': 'статус позиции меняется внутри гражданских суток legal_time; ответ на дату не определён — задайте legal_time мгновением (§82.1, §134, §135.1)'}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/norms.py#L296-L300)

## lawref.evaluator.norms.RecurrenceLimit

*class*

```python
class RecurrenceLimit(Exception)
```

Bases: `Exception`

[§238](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/31-part-xxx-scalability.ru.md#238-resource-limits): расписание конечно, но длиннее предела `maxOccurrences`.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/norms.py#L367-L377)

### lawref.evaluator.norms.RecurrenceLimit.issue

*attribute* · *instance attribute*

```python
issue = {'code': 'RESOURCE_LIMIT', 'severity': 'fatal', 'message': семантический лимит maxOccurrences = {limit} превышен; вывод остановлен без частичного результата (SPEC §238, §211), 'details': {'counter': 'maxOccurrences', 'limit': limit}}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/norms.py#L371-L376)

## lawref.evaluator.norms.RecurrencePolicy

*class*

```python
class RecurrencePolicy(Exception)
```

Bases: `Exception`

[§86](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/12-part-xii-events-actions-temporal-model.ru.md#86-deadline-policy)/[§84.2](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/12-part-xii-events-actions-temporal-model.ru.md#842-calendarperiod): календарный шаг без явной политики — `MISSING_POLICY`.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/norms.py#L380-L386)

### lawref.evaluator.norms.RecurrencePolicy.issue

*attribute* · *instance attribute*

```python
issue = {'code': 'MISSING_POLICY', 'severity': 'fatal', 'message': message}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/norms.py#L384-L385)

## lawref.evaluator.norms.RecurrenceRefusal

*class*

```python
class RecurrenceRefusal(Exception)
```

Bases: `Exception`

[§124.4.1](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/18-part-xvii-normative-positions.ru.md#12441-исполнимое-расписание-decision-0156): расписание не конечно — fatal `RECURRENCE_UNBOUNDED` до вывода.

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/norms.py#L280-L289)

### lawref.evaluator.norms.RecurrenceRefusal.issue

*attribute* · *instance attribute*

```python
issue = {'code': 'RECURRENCE_UNBOUNDED', 'severity': 'fatal', 'message': 'расписание `recurring` не конечно в окне `over`; число экземпляров позиции не ограничено, вывод не выполнялся (§124.4, §124.4.1)'}
```

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/norms.py#L284-L288)

## lawref.evaluator.norms.norm_lifecycle

*function*

```python
def norm_lifecycle(store: SupportStore, nodes: list[dict], legal_time: str, registry: ProofRegistry, issues: list[dict], manifest_id: str, limits: dict | None = None, env: Any = None, world: Any = None, status_time: str | None = None) -> list[dict]
```

L2-срез (DECISION-0003): norm creation [§135](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#135-activation) и статусы [§134](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#134-positioninstance-statuses)–[§138](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#138-deadline).

Два времени, и они разные (errata E-0212). `legal_time` выбирает ПРАВО:
окно `effective` [§87](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/12-part-xii-events-actions-temporal-model.ru.md#87-rule-temporal-qualifiers) правила, редакции [§92](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/13-part-xiii-context-scope-applicability.ru.md#92-edition-applicability), значения параметров во
времени. `status_time` — момент «ПО СОСТОЯНИЮ НА», на который спрашивается
лестница [§134](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#134-positioninstance-statuses): наступил ли срок, истёк ли он, исполнено ли. До errata
оба вопроса отвечались одной осью, и «право на дату L, статус на дату
решения D» было невыразимо. `None` означает «тот же момент» — так зовут
этот срез хосты, не различающие два времени, и путь байтово прежний.

Правило с head norm_template_ref порождает PositionInstance на каждое
ground-приложение (proof-узел norm_creation). Статусы — проекция [§134](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#134-positioninstance-statuses):
- ДО открытия окна [§135](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#135-activation) п. 3: обязанность и запрет — PENDING, полномочие,
  иммунитет и свобода — CREATED (у них своя таблица kinds в [§134](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#134-positioninstance-statuses), без
  `pending`). Позиция при этом СОЗДАЁТСЯ: норма, вступающая в силу позже,
  обязана быть видна и адресуема, а не исчезать из ответа;
- achievement [§136](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#136-achievement-satisfaction): satisfied при TRUE_ONLY condition; после window —
  violated ТОЛЬКО при explicit non-performance (FALSE_ONLY condition —
  explicit negative/closure [§70](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#70-closed-world-declarations)), иначе UNDETERMINED; до due — ACTIVE [§138](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#138-deadline);
- maintenance [§137](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#137-maintenance-satisfaction): counterexample (FALSE_ONLY) — VIOLATED; satisfied
  после window лишь при closure-политике [§70](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/10-part-x-propositions-and-four-valued-support.ru.md#70-closed-world-declarations) на предикат условия;
  иначе UNDETERMINED; в window — ACTIVE;
- condition BOTH — CONFLICTED ([§134](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#134-positioninstance-statuses)) с обеими опорами в supports.

Вне среза ([§123](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/18-part-xvii-normative-positions.ru.md#123-duty)/[§135.2](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#135-activation)/[§139](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/19-part-xviii-norm-lifecycle-fulfillment-violation.ru.md#139-waiver-suspension-termination)): allocation/discharge/violation policies,
activation events, waiver/suspension/termination, deontic-конфликты
[§105.1](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/16-part-xv-defeasible-semantics-and-conflict-resolution.ru.md#1051-базовые-normative-conflict-patterns) (defeat норм — с priorities вехой L2+).

[View source](https://github.com-arxohq/arxo-io/law/blob/2edc2b92ce22b52e03f4081d2769a58229684379/engines/lawref/lawref/evaluator/norms.py#L846-L1281)
