> For the complete documentation index, see [llms.txt](https://docs.durohub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.durohub.com/library-configuration/revisions.md).

# Revision Scheme

## Overview

The revision scheme configuration system allows you to define how component revisions are managed throughout their lifecycle. It enables you to:

* Define revision formats for different lifecycle stages
* Configure validation rules for revision transitions
* Specify allowed characters and patterns
* Set up automatic increment rules
* Establish consistent revision naming across your library

This configuration serves as the foundation for maintaining traceable and well-structured revision control in your product development process.

## Schema

The revision scheme is defined in a YAML file that specifies how revisions should be formatted and validated at each lifecycle stage.

### Basic Structure

```yaml
version: "1.0"
schema_type: "revision_scheme_config"

defaults:
  segments:
    integer:
      min_value: 1
      max_value: 999
    letter:
      min_value: "A"
      max_value: "ZZ"
  delimiter: "."
  empty_value: "-"
```

### Define Status Order

Establish the progression of lifecycle stages:

```yaml
status_order:
  - "Design"
  - "Prototype"
  - "Production"
  - "Obsolete"
```

### Configure Revision Schemes

Define revision formats for each status:

```yaml
schemes:
  - status: "Design"
    description: "Initial design phase revisions"
    segments:
      major:
        type: "letter"
        delimiter: ""
        required: true
      minor:
        type: "integer"
        min_value: 1
        max_value: 99
        required: false
    examples:
      - "A"
      - "A.1"
```

### Segment Types

#### Letter Segment

```yaml
major:
  type: "letter"
  delimiter: ""
  required: true
  min_value: "A"
  max_value: "Z"
```

#### Integer Segment

```yaml
minor:
  type: "integer"
  delimiter: "."
  required: false
  min_value: 1
  max_value: 99
```

#### Either Type Segment

```yaml
identifier:
  type: "either"  # Allows both letter and integer
  delimiter: ""
  required: true
```

### Validation Rules

Define rules for revision transitions and validation:

```yaml
validation:
  allowed_segment_types:
    - "integer"
    - "letter"
    - "either"

  required_fields:
    - "status"
    - "segments.major"

  transitions:
    allowed:
      - from: "Design"
        to: ["Prototype", "Obsolete"]
      - from: "Prototype"
        to: ["Production", "Obsolete"]
```

### Character Blacklist

Specify characters to exclude from revision schemes:

```yaml
blacklist:
  - "I"  # Avoid confusion with 1
  - "O"  # Avoid confusion with 0
  - "Q"  # Avoid confusion with 0
  - "S"  # Avoid confusion with 5
```

## Common Patterns

### Simple Letter-Based Revisions

```yaml
schemes:
  - status: "Design"
    segments:
      major:
        type: "letter"
        required: true
```

### Letter with Numeric Suffix

```yaml
schemes:
  - status: "Production"
    segments:
      major:
        type: "letter"
        required: true
      minor:
        type: "integer"
        delimiter: "."
        required: true
```

### Mixed Format for Obsolescence

```yaml
schemes:
  - status: "Obsolete"
    segments:
      major:
        type: "either"
        required: true
```

## Best Practices

1. **Revision Format**
   * Keep formats simple and intuitive
   * Use consistent delimiters
   * Consider future scaling needs
2. **Lifecycle Stages**
   * Define clear progression paths
   * Limit revision format changes between stages
   * Document transition rules
3. **Validation**
   * Blacklist confusing characters
   * Set appropriate value ranges
   * Define clear transition rules
4. **Documentation**
   * Include examples for each scheme
   * Document special cases
   * Maintain transition matrices

## Examples

### Basic Development Scheme

```yaml
schemes:
  - status: "Design"
    segments:
      major:
        type: "letter"
    examples:
      - "A"
      - "B"
      - "C"
```

### Production Scheme

```yaml
schemes:
  - status: "Production"
    segments:
      major:
        type: "letter"
      minor:
        type: "integer"
        delimiter: "."
    examples:
      - "A.1"
      - "B.2"
      - "C.10"
```

**Note:** Examples should reflect your actual use cases and common scenarios.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.durohub.com/library-configuration/revisions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
