# lawref.population_bind

*module*

`population-binding/0.1` — эталон материализации таблиц микроданных в
пакет-дело [§168.4](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/24-part-xxiii-cases-snapshots-evaluation.ru.md#1684-пакет-дело-и-операция-ask-decision-0165) (DECISION-0264, трек О).

Оркестрация без семантики (инвариант CLAUDE.md №5): адаптер ничего не
вычисляет и не выводит из права. Каждая ячейка источника становится литералом
факта дела `origin case_input` по объявленному в привязке типу, каждая строка
корневой таблицы — делом и строкой банка. Результат детерминирован и не
зависит от порядка строк во входных файлах: дела пишутся в байтовом порядке
имён, факты — в порядке записей привязки и ключей дочерних строк, строки
манифеста — в порядке `rowId`.

Поток (все отказы операции — до записи, [§8](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/03-part-iii-architecture-and-conformance.ru.md#8-conformance-профили) решения):

    USAGE                                   флаги (--binding, --clir, --out)
    → каталог --out не существует           (POPULATION_BIND_OUT_EXISTS)
    → привязка: схема, самопин, структура   (POPULATION_BINDING_INVALID)
    → класс данных synthetic                (POPULATION_BINDING_DATA_CLASS)
    → CLIR модели: semanticHash, предикаты,
      арность, типы, перечисления, сущности (POPULATION_BINDING_MODEL_MISMATCH)
    → таблицы: файл, закрытое подмножество CSV [§3](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/02-part-ii-goals-and-scope.ru.md#3-цели-law-dsl-core-01), ключи, сироты,
      дубликаты rowId и имён дел             (POPULATION_SOURCE_INVALID)
    → дело каждой корневой строки: rowId → имя → вес → дата → факты;
      сбой значения — отказ строки в манифест (ROW_*), не исчезновение
    → пакет (law.toml, package.law, cases/*.lawcase) и манифест
      law.population.materialization/0.1 (канон [§208](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/28-part-xxvii-canonical-legal-ir.ru.md#208-canonical-serialization), самопин).

Код выхода: 0 — все строки материализованы; 4 — есть отказанные строки
(INCOMPLETE: пакет и манифест записаны); 2 — отказ операции, ничего не
записано.

## lawref.population_bind.BINDING_INVALID

*attribute* · *module attribute*

```python
BINDING_INVALID = 'POPULATION_BINDING_INVALID'
```

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

## lawref.population_bind.CASE_NAME_RE

*attribute* · *module attribute*

```python
CASE_NAME_RE = re.compile('^[A-Za-z_][A-Za-z0-9_]*$')
```

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

## lawref.population_bind.CURRENCY_RE

*attribute* · *module attribute*

```python
CURRENCY_RE = re.compile('^[A-Z]{3}$')
```

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

## lawref.population_bind.DATA_CLASS

*attribute* · *module attribute*

```python
DATA_CLASS = 'POPULATION_BINDING_DATA_CLASS'
```

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

## lawref.population_bind.DATE_RE

*attribute* · *module attribute*

```python
DATE_RE = re.compile('^(\\d{4})-(\\d{2})-(\\d{2})$')
```

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

## lawref.population_bind.DEFAULT_FALSE

*attribute* · *module attribute*

```python
DEFAULT_FALSE = ['false', '0']
```

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

## lawref.population_bind.DEFAULT_TRUE

*attribute* · *module attribute*

```python
DEFAULT_TRUE = ['true', '1']
```

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

## lawref.population_bind.ENTITY_ID_RE

*attribute* · *module attribute*

```python
ENTITY_ID_RE = re.compile('^[A-Za-z][A-Za-z0-9+.-]*:[^\\s\\"\\\\]+$')
```

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

## lawref.population_bind.FACT_LIMIT

*attribute* · *module attribute*

```python
FACT_LIMIT = 9999
```

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

## lawref.population_bind.INCOMPLETE_EXIT

*attribute* · *module attribute*

```python
INCOMPLETE_EXIT = 4
```

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

## lawref.population_bind.INSTANT_RE

*attribute* · *module attribute*

```python
INSTANT_RE = re.compile('^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(\\.\\d{1,6})?(Z|[+-]\\d{2}:\\d{2})$')
```

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

## lawref.population_bind.LITERAL_KINDS

*attribute* · *module attribute*

```python
LITERAL_KINDS = {STD + 'Integer': 'integer', STD + 'Decimal': 'decimal', STD + 'Money': 'money', STD + 'Boolean': 'boolean', STD + 'Text': 'text', STD + 'Date': 'date', STD + 'Instant': 'instant'}
```

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

## lawref.population_bind.MANIFEST_SCHEMA_VERSION

*attribute* · *module attribute*

```python
MANIFEST_SCHEMA_VERSION = 'law.population.materialization/0.1'
```

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

## lawref.population_bind.MODEL_MISMATCH

*attribute* · *module attribute*

```python
MODEL_MISMATCH = 'POPULATION_BINDING_MODEL_MISMATCH'
```

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

## lawref.population_bind.NAME_RE

*attribute* · *module attribute*

```python
NAME_RE = re.compile('^[A-Za-z0-9_.-]+$')
```

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

## lawref.population_bind.OK_EXIT

*attribute* · *module attribute*

```python
OK_EXIT = 0
```

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

## lawref.population_bind.OUT_EXISTS

*attribute* · *module attribute*

```python
OUT_EXISTS = 'POPULATION_BIND_OUT_EXISTS'
```

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

## lawref.population_bind.PLACEHOLDER_RE

*attribute* · *module attribute*

```python
PLACEHOLDER_RE = re.compile('\\{([^{}]+)\\}')
```

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

## lawref.population_bind.REFUSED_EXIT

*attribute* · *module attribute*

```python
REFUSED_EXIT = 2
```

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

## lawref.population_bind.ROW_CARDINALITY

*attribute* · *module attribute*

```python
ROW_CARDINALITY = 'ROW_CARDINALITY'
```

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

## lawref.population_bind.ROW_DATE_INVALID

*attribute* · *module attribute*

```python
ROW_DATE_INVALID = 'ROW_DATE_INVALID'
```

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

## lawref.population_bind.ROW_ENUM_UNKNOWN

*attribute* · *module attribute*

```python
ROW_ENUM_UNKNOWN = 'ROW_ENUM_UNKNOWN'
```

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

## lawref.population_bind.ROW_FACT_LIMIT

*attribute* · *module attribute*

```python
ROW_FACT_LIMIT = 'ROW_FACT_LIMIT'
```

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

## lawref.population_bind.ROW_KEY_NULL

*attribute* · *module attribute*

```python
ROW_KEY_NULL = 'ROW_KEY_NULL'
```

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

## lawref.population_bind.ROW_REQUIRED_NULL

*attribute* · *module attribute*

```python
ROW_REQUIRED_NULL = 'ROW_REQUIRED_NULL'
```

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

## lawref.population_bind.ROW_TYPE_INVALID

*attribute* · *module attribute*

```python
ROW_TYPE_INVALID = 'ROW_TYPE_INVALID'
```

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

## lawref.population_bind.ROW_WEIGHT_INVALID

*attribute* · *module attribute*

```python
ROW_WEIGHT_INVALID = 'ROW_WEIGHT_INVALID'
```

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

## lawref.population_bind.SCHEMA_VERSION

*attribute* · *module attribute*

```python
SCHEMA_VERSION = 'law.population.binding/0.1'
```

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

## lawref.population_bind.SOURCE_INVALID

*attribute* · *module attribute*

```python
SOURCE_INVALID = 'POPULATION_SOURCE_INVALID'
```

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

## lawref.population_bind.STD

*attribute* · *module attribute*

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

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

## lawref.population_bind.TOOL

*attribute* · *module attribute*

```python
TOOL = 'population-bind'
```

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

## lawref.population_bind.USAGE

*attribute* · *module attribute*

```python
USAGE = 'POPULATION_BIND_USAGE'
```

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

## lawref.population_bind.USAGE_TEXT

*attribute* · *module attribute*

```python
USAGE_TEXT = 'python -m lawref population-bind --binding <привязка.json> --clir <модель.lawir.json> --out <каталог> [--json]'
```

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

## lawref.population_bind.BindRefusal

*class*

```python
class BindRefusal(Exception)
```

Bases: `Exception`

Отказ операции: код, текст; строка stderr по контракту [§8](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/03-part-iii-architecture-and-conformance.ru.md#8-conformance-профили).

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

### lawref.population_bind.BindRefusal.code

*attribute* · *instance attribute*

```python
code = code
```

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

### lawref.population_bind.BindRefusal.message

*attribute* · *instance attribute*

```python
message = message
```

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

### lawref.population_bind.BindRefusal.line

*method*

```python
def line() -> str
```

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

## lawref.population_bind.Materialized

*class* · *dataclass*

```python
class Materialized
```

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

### lawref.population_bind.Materialized.exit_code

*attribute* · *instance attribute*

```python
exit_code: int
```

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

### lawref.population_bind.Materialized.files

*attribute* · *instance attribute*

```python
files: dict[str, bytes]
```

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

### lawref.population_bind.Materialized.manifest

*attribute* · *instance attribute*

```python
manifest: dict
```

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

### lawref.population_bind.Materialized.manifest_bytes

*attribute* · *instance attribute*

```python
manifest_bytes: bytes
```

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

## lawref.population_bind.RowRefusal

*class*

```python
class RowRefusal(Exception)
```

Bases: `Exception`

Отказ строки: попадает в манифест, не прерывает операцию.

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

### lawref.population_bind.RowRefusal.code

*attribute* · *instance attribute*

```python
code = code
```

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

### lawref.population_bind.RowRefusal.detail

*attribute* · *instance attribute*

```python
detail = detail
```

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

### lawref.population_bind.RowRefusal.key

*attribute* · *instance attribute*

```python
key = key
```

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

### lawref.population_bind.RowRefusal.table

*attribute* · *instance attribute*

```python
table = table
```

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

## lawref.population_bind.TableData

*class* · *dataclass*

```python
class TableData
```

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

### lawref.population_bind.TableData.by_key

*attribute* · *instance attribute*

```python
by_key: dict[tuple[str, ...], dict[str, str | None]]
```

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

### lawref.population_bind.TableData.content_hash

*attribute* · *instance attribute*

```python
content_hash: str
```

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

### lawref.population_bind.TableData.rows

*attribute* · *instance attribute*

```python
rows: list[dict[str, str | None]]
```

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

### lawref.population_bind.TableData.spec

*attribute* · *instance attribute*

```python
spec: TableSpec
```

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

## lawref.population_bind.TableSpec

*class* · *dataclass*

```python
class TableSpec
```

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

### lawref.population_bind.TableSpec.columns

*attribute* · *instance attribute*

```python
columns: dict[str, dict]
```

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

### lawref.population_bind.TableSpec.entity_type

*attribute* · *instance attribute*

```python
entity_type: dict
```

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

### lawref.population_bind.TableSpec.file

*attribute* · *instance attribute*

```python
file: str
```

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

### lawref.population_bind.TableSpec.id_pattern

*attribute* · *instance attribute*

```python
id_pattern: str
```

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

### lawref.population_bind.TableSpec.key

*attribute* · *instance attribute*

```python
key: list[str]
```

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

### lawref.population_bind.TableSpec.name

*attribute* · *instance attribute*

```python
name: str
```

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

### lawref.population_bind.TableSpec.order

*attribute* · *instance attribute*

```python
order: list[str]
```

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

### lawref.population_bind.TableSpec.parent

*attribute* · *instance attribute*

```python
parent: dict | None
```

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

## lawref.population_bind.binding_content_hash

*function*

```python
def binding_content_hash(binding: dict) -> str
```

Самопин привязки: канон [§208](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/28-part-xxvii-canonical-legal-ir.ru.md#208-canonical-serialization) без поля `contentHash` (как у `screen`).

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

## lawref.population_bind.canonical_number

*function*

```python
def canonical_number(raw: str, separator: str, allow_fraction: bool) -> str | None
```

Канон Integer/Decimal [§208](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/28-part-xxvii-canonical-legal-ir.ru.md#208-canonical-serialization) из текста источника: знак, цифры,
необязательно разделитель и цифры. None — не число.

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

## lawref.population_bind.check_binding

*function*

```python
def check_binding(binding: object) -> dict[str, TableSpec]
```

Форма по схеме, самопин и структурные проверки [§2](https://github.com/arxohq/law/blob/master/spec/SPEC.ru/01-part-i-audit.ru.md#2-что-необходимо-исправить) решения.

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

## lawref.population_bind.check_model

*function*

```python
def check_model(binding: dict, tables: dict[str, TableSpec], document: dict) -> dict[str, dict]
```

Привязка против CLIR модели: semanticHash, сущности, перечисления,
предикаты, арность и типы аргументов (побайтово как JSON TypeRef).
Возвращает предикат → объявление.

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

## lawref.population_bind.literal

*function*

```python
def literal(column: dict, raw: str, source: dict, model_name: str) -> str
```

Литерал `.lawcase` из ячейки по типу колонки; ValueError с кодом ROW_*.

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

## lawref.population_bind.load_binding

*function*

```python
def load_binding(path: Path) -> dict
```

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

## lawref.population_bind.load_clir

*function*

```python
def load_clir(path: Path) -> dict
```

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

## lawref.population_bind.main

*function*

```python
def main(argv: list[str]) -> int
```

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

## lawref.population_bind.materialize

*function*

```python
def materialize(binding_path: Path, clir_path: Path) -> Materialized
```

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

## lawref.population_bind.parse_boolean

*function*

```python
def parse_boolean(column: dict, raw: str) -> bool
```

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

## lawref.population_bind.parse_csv

*function*

```python
def parse_csv(data: bytes, delimiter: str, where: str) -> list[list[str]]
```

RFC 4180 без переводов строки в полях: UTF-8 без BOM, заголовок,
`\n` или `\r\n`, кавычки удваиваются, управляющие символы — отказ.
Возвращает записи (первая — заголовок).

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

## lawref.population_bind.parse_time

*function*

```python
def parse_time(raw: str) -> tuple[str, str] | None
```

(вид, литерал без `@`) для Date или Instant; None — ни то, ни другое.

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

## lawref.population_bind.read_table

*function*

```python
def read_table(base: Path, spec: TableSpec, source: dict) -> TableData
```

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

## lawref.population_bind.render_text

*function*

```python
def render_text(manifest: dict) -> str
```

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

## lawref.population_bind.substitute

*function*

```python
def substitute(pattern: str, row: dict[str, str | None]) -> str
```

Подстановка `{колонка}` сырым значением; ValueError(ROW_KEY_NULL) при NULL.

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

## lawref.population_bind.write_out

*function*

```python
def write_out(result: Materialized, out: Path) -> None
```

`<out>/package/**` и `<out>/materialization.json`; каталог создаётся здесь.

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