# property.generic

## Intent

A reusable generic definition or a reusable application of another generic definition.

Exact selection subject:

```yaml
subject: property.generic
```

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.generic: GenericPropertyContext`      |
| `all`                 | `properties.generics: GenericPropertyContext[]` |
| 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.generic.id`                       | `string`                    | Opaque stable semantic identity.                     |
| `property.generic.name`                     | `NameContext`               | Stable semantic identity and finite naming variants. |
| `property.generic.description`              | `string\|null`              | Human semantic description.                          |
| `property.generic.tags`                     | `string[]`                  | Semantic classifiers; empty when none.               |
| `property.generic.explanations`             | `ExplanationContext[]`      | Advisory usage/security/implementation notes.        |
| `property.generic.group`                    | `SemanticLinkContext\|null` | Owning semantic group.                               |
| `property.generic.feature`                  | `SemanticLinkContext\|null` | Canonical owning feature, when present.              |
| `property.generic.lifecycle`                | `LifecycleContext`          | Deprecation/removal semantics.                       |
| `property.generic.kind`                     | `definition\|application`   | Structural variant.                                  |
| `property.generic.parameters`               | `GenericParameterContext[]` | Definition parameters.                               |
| `property.generic.parameters[].name`        | `NameContext`               | Parameter name.                                      |
| `property.generic.parameters[].description` | `string\|null`              | Parameter meaning.                                   |
| `property.generic.value`                    | `TypeContext\|null`         | Definition body.                                     |
| `property.generic.target`                   | `SemanticLinkContext\|null` | Generic definition referenced by an application.     |
| `property.generic.arguments`                | `TypeContext[]`             | Application arguments.                               |

## Usage rules

- Definition/application remain one subject because they are structural forms of the same semantic concept.
- Raw `#/properties/generics/...` is resolved to a semantic link.

## Runtime IR implications to audit

- Properties should gain universal metadata.

## Template example — Handlebars / TypeScript generic

```hbs
{{#if (eq property.generic.kind "definition")}}
export type {{file.symbol}}<{{#each property.generic.parameters}}{{name.pascal}}{{#unless @last}}, {{/unless}}{{/each}}> =
  {{renderType property.generic.value}};
{{/if}}
```

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.generic 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?
