# PipelineLabel

## Description

PipelineLabel is a pipeline-scoped, free-form classification tag that can be attached to any number of items within the same pipeline. Each label has a name, an optional color, and an optional description. Labels do not have ordering — they are presented as an unordered set per item. Each pipeline maintains its own label catalog; labels cannot be shared across pipelines.

## Domain Model Definitions

### Model type

Standard

### Command Definitions

- [CreatePipelineLabel](../command/CreatePipelineLabel.md) - Create a new label on a pipeline
- [UpdatePipelineLabel](../command/UpdatePipelineLabel.md) - Update mutable fields (name, color, description) of an existing label
- [DeletePipelineLabel](../command/DeletePipelineLabel.md) - Remove a label and detach it from every item that carried it

### Query Definitions

- [ListPipelineLabelsByPipeline](../query/ListPipelineLabelsByPipeline.md) - List all labels defined on a pipeline, ordered by name

### Models

- PipelineLabel

### Invariants

- Pipeline ID is required and must reference an existing pipeline
- PipelineLabel name is required and must be non-empty
- PipelineLabel name must be unique within the same pipeline (backed by a unique index, with a friendly duplicate check in the create/update commands)
- Color is optional and stored verbatim (no validation at module layer)
- Description is optional
- Deleting a label cascades to remove every PipelineItemLabel join row that references it

### Relationships

- **Belongs To Pipeline**: Each label belongs to a pipeline via `pipelineId`
- **Has Many PipelineItemLabel**: A label is referenced by zero or more PipelineItemLabel join rows
