# property.enum

## Intent

A reusable finite value set. Member names must be explicit so templates do not depend on dictionary-key iteration behavior.

Exact selection subject:

```yaml
subject: property.enum
```

The current Runtime IR is evidence, not authority. Target improvements needed for a usable template contract are called out explicitly.

## Scope envelope

| Scope                 | Context                                   |
| --------------------- | ----------------------------------------- |
| `each`                | `property.enum: EnumPropertyContext`      |
| `all`                 | `properties.enums: EnumPropertyContext[]` |
| collection candidates | `collects.group`, `collects.feature`      |

For `collects.<dimension>`, the singular collector is added beside the plural selected-subject array. A collector is valid only when ownership is semantically provable.

## Context tree

| Context path                         | Type                        | Meaning / template use                               |
| ------------------------------------ | --------------------------- | ---------------------------------------------------- |
| `property.enum.id`                   | `string`                    | Opaque stable semantic identity.                     |
| `property.enum.name`                 | `NameContext`               | Stable semantic identity and finite naming variants. |
| `property.enum.description`          | `string\|null`              | Human semantic description.                          |
| `property.enum.tags`                 | `string[]`                  | Semantic classifiers; empty when none.               |
| `property.enum.explanations`         | `ExplanationContext[]`      | Advisory usage/security/implementation notes.        |
| `property.enum.group`                | `SemanticLinkContext\|null` | Owning semantic group.                               |
| `property.enum.feature`              | `SemanticLinkContext\|null` | Canonical owning feature, when present.              |
| `property.enum.lifecycle`            | `LifecycleContext`          | Deprecation/removal semantics.                       |
| `property.enum.examples`             | `CanonicalValue[]`          | Examples.                                            |
| `property.enum.ordered`              | `boolean`                   | Whether member order is semantic.                    |
| `property.enum.values`               | `EnumValueContext[]`        | Deterministic explicit members.                      |
| `property.enum.values[].name`        | `NameContext`               | Member symbolic name.                                |
| `property.enum.values[].value`       | `string\|number\|boolean`   | Serialized value.                                    |
| `property.enum.values[].title`       | `string\|null`              | Display title.                                       |
| `property.enum.values[].description` | `string\|null`              | Member meaning.                                      |

## Usage rules

- Current `values` map becomes an array with explicit member names.
- When `ordered=false`, output order is deterministic but carries no semantic meaning.

## Runtime IR implications to audit

- Properties should gain universal metadata.
- If `ordered=true`, canonical IR needs an explicitly preserved semantic order, not accidental map insertion order.

## Template example — Handlebars / TypeScript enum

```hbs
export enum
{{file.symbol}}
{
{{#each property.enum.values}}
  {{name.constant}}
  = "{{value}}",
{{/each}}
}
```

The example uses semantic context only. Any `renderType`/`render_type` helper shown is a pack-owned macro/partial consuming the documented `TypeContext`, not hidden Dryv context.

## Audit questions

- Can a real property.enum pack generate code without parsing raw IR storage conventions?
- Is any field here present only because the current IR happens to store it?
- Does any nested item need first-class selection of its own?
