> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canary.effectiveai.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Sections, types and annotations

> Every section, type, rounding mode and annotation key that RSL reads.

*Generated from the `rslc` compiler.*

This page lists every name that RSL 0.4.1 reads. [The language reference](https://docs.canary.effectiveai.app/rsl/reference/language.md) explains each one.

## Sections

A file holds these sections, in this order. A guideline is a file that uses a rater.

| Section | File | Declares |
| - | - | - |
| `spec` | Any | Names the RSL version, the carrier, the state, the product and the effective date. |
| `import` | Rater | Reads the declarations of another RSL file or of a standard-library package. |
| `package` | Rater | Names a shared-facts package and its version, so that raters bind its facts by name. |
| `use` | Guideline | Links a rater under an alias, so that a guideline reads its records and outcomes. |
| `Sources` | Any | Names the documents that citations point to. |
| `Types` | Any | Declares named types: enumerations, bands, value lists, codes and refined numbers. |
| `Constants` | Any | Declares fixed values, each with its citation. |
| `Tables` | Any | Declares rate tables: their key dimensions, their columns and their CSV files. |
| `Geographies` | Rater | Declares territories as shapes on a map, read with `locate`. |
| `Stages` | Rater | Names the stages of the rating manual, in reading order. |
| `Roles` | Guideline | Declares the roles that answer questions and sign off referrals, each chain lowest first. |
| `Acts` | Guideline | Gives the `quote` and `bind` acts to roles. |
| `Records` | Any | Declares each record: its inputs, its rules and its calculations. |
| `RatingOutcomes` | Any | Selects the calculations a program returns, each under a public name. |
| `Scenario` | Rater | Holds one set of inputs with expected values, for `rslc eval`. |

## Types

| Type | Written as | Holds |
| - | - | - |
| `Num` | `Num {precision: int}` | An exact number. An input states its precision. |
| `Premium` | `Premium` | An exact number of dollars charged. One outcome or more has this type. |
| `Rate` | `Rate` | An exact number of dollars for each unit of exposure. |
| `Factor` | `Factor` | An exact multiplier. |
| `Pct` | `Pct` | An exact ratio: `0.05` is five percent. |
| `Bool` | `Bool` | `true` or `false`. |
| `Date` | `Date` | A calendar day, written `2026-01-01`. |
| `Source` | `name: Source = { artifact: artifact("…"), kind: pdf }` | A cited document. Only the `Sources` section declares one. |
| `Option` | `Option(T)` | A value that is present, `Some(value)`, or absent, `None`. |
| `List` | `List(Record)` | A list of records. A plain list keeps the order sent; a `keyed by` list is a map from key to record. |
| `Ref` | `Ref(Record)` | A reference to one record of a list, by its key. |
| `Key` | `Key(Table)` | A value that is a filed key of a table. |
| `Enum` | `Name = Enum` | An enumeration whose members come from `enums/Name.csv`. |
| `IntBands` | `IntBands(1, 4, 7, 10..)` | Bands of whole numbers, each named by where it starts. |
| `DecimalBands` | `DecimalBands(scale: 2; ..<100.00, 100.00, 1000.00..)` | Bands of decimal numbers at a stated scale. |
| `IntValues` | `IntValues(25000, 50000, 100000)` | A fixed list of whole numbers. |
| `DecimalValues` | `DecimalValues(scale: 2; 0.25, 0.50)` | A fixed list of decimal numbers at a stated scale. |
| `Code` | `Code(pattern: "[0-9]{5}")` | A coded value that matches a pattern, such as a postal code. |

## Rounding modes

`round`, `root`, `pow` and `interpolate!` each take one of these modes.

| Mode | Rounds |
| - | - |
| `half_up` | To the nearest step. A tie goes away from zero. |
| `half_down` | To the nearest step. A tie goes toward zero. |
| `half_even` | To the nearest step. A tie goes to the even step. |
| `up` | Away from zero. |
| `down` | Toward zero. |
| `ceiling` | Toward positive infinity. |
| `floor` | Toward negative infinity. |

## Source kinds

A `Source` declares its `kind`. The kind sets how a citation names a region.

| Kind | A citation names |
| - | - |
| `pdf` | `p33` or `pp20-24` |
| `xlsx` | `'Sheet name'!A2` or `'Sheet name'!A2:AQH2` |
| `csv` | `row 12` or `rows 12-20` |
| `html` | `anchor "fragment-id"` |
| `zip` | `member "path/in/archive"` |
| `png` | `image` |
| `parquet` | `row 12` or `rows 12-20` (records start at 1) |

## Annotations

An annotation follows a declaration in square brackets: `[key: value]` or `[key]`.

### Sources

| Key | Written as | On | Says | Contract key |
| - | - | - | - | - |
| `cite` | `cite: source:region` | A table, constant, step, calculation, input, rule or stage | Points to the region of a source document that states the value or rule. | |
| `reason` | `reason: "…"` | A table, constant or rounding | Says why a number that the filing leaves unstated is in the rater. | |

### Rules

| Key | Written as | On | Says | Contract key |
| - | - | - | - | - |
| `code` | `code: "CODE"` | A refinement | Makes a refinement a business rule: a request that breaks it is refused with this code. | |
| `message` | `message: "…"` | A refinement with a `code` | Gives the words a person reads when the rule refuses a request. | |
| `skip` | `skip: "id":"reason"` | A step | Marks a step of the manual that the rater leaves out, with the reason. | |

### Labels and notes

| Key | Written as | On | Says | Contract key |
| - | - | - | - | - |
| `label` | `label: "…"` | A record, step, table, value, stage or enumeration member | Gives a short display name. On an enumeration member, it gives the words a person reads. | |
| `note` | `note: "…"` | A record, step, table, value or stage | Explains a value in one sentence of 200 characters or fewer. | |
| `collect` | `collect: a + b..c` | A calculation that heads a group | Names the values a group gathers. | |
| `title` | `title: "…"` | A calculation with `collect` | Gives the title of a group. | |

### Questions

| Key | Written as | On | Says | Contract key |
| - | - | - | - | - |
| `group` | `group: "Policy"` | An input | Names the section of the questionnaire the question belongs to. | `x-group` |
| `description` | `description: "…"` | An input | Describes the input for a reader of the input contract. | `description` |
| `unit` | `unit: "miles"` | An input | Names the unit of the input for a reader of the input contract. | `x-unit` |
| `api_default` | `api_default: "100000"` | An input | Gives the value used when a request leaves the field out. A `choice` requires one. | `default` |
| `ask` | `ask: "What is {name}'s date of birth?"` | An input | Gives the question a person is asked, as a template. | `x-ask` |
| `ask_you` | `ask_you: "What is your date of birth?"` | An input of a list item | Gives the question when the item is the person who answers. | `x-ask-you` |
| `help` | `help: "…"` | An input | Gives help text shown with the question. | `x-help` |
| `why` | `why: "…"` | An input or a fact binding | Says why this rater asks a question that the shared facts leave out. | `x-why` |
| `format` | `format: "vin"` | An input | Names the format of the answer, from a fixed list. | `format` |
| `labels` | `labels: "own=I own it, lease=I lease it"` | An enumeration input, or a number with `refers` | Gives the words a person reads for each value. | `x-labels` |
| `none_answer` | `none_answer: "I don't have it"` | A follow-up input | Gives an answer that sets the `Bool` question before it to false. | `x-none-answer` |
| `short` | `short: "Annual miles"` | An input | Names the answer in a summary, in 40 characters or fewer. | `x-short` |
| `picker` | `picker: "logo"` | An input | Names how a host shows the answers of a long list, as one lowercase word. | `x-picker` |
| `earliest` | `earliest: "today"` | A `Date` input | Gives the first date an answer takes: `today`, a date input or a root path, plus or minus a period. | `x-earliest` |
| `latest` | `latest: "today + 1 year"` | A `Date` input | Gives the last date an answer takes, written as `earliest` is. | `x-latest` |
| `date_precision` | `date_precision: "month"` | A `Date` input | Asks for a month and saves its first day. | `x-date-precision` |
| `priced_on` | `priced_on` | A `Date` input | Marks the date that a price is for. | `x-priced-on` |

### Lists of records

| Key | Written as | On | Says | Contract key |
| - | - | - | - | - |
| `complete` | `complete: "Any more drivers?"` | A list of records | Gives the question that asks whether the list is complete. | `x-complete` |
| `add` | `add: "Add a roommate"` | A list of records | Gives the words of the button that adds an item. | `x-add` |
| `item_name` | `item_name: "First name"` | A list of records | Asks each item for a name under this label; the host keeps the name. | `x-item-name` |
| `called` | `called: "{model_year} {make}\|car {#}"` | A list of records | Says how each item is named in a question. | `x-label` |
| `you` | `you: "relationship = applicant"` | A list of records | Says which item is the person who answers. | `x-you` |
| `look_back` | `look_back: 10` | A list of records | Gives the longest window, in years, that the list covers. | `x-look-back-years` |
| `inline` | `inline` | A list of records | Asks for the items on the list's own screen. | `x-inline` |
| `rows` | `rows` | An input of a list item | Asks the question of every item on one screen. | `x-rows` |
| `refers` | `refers: "Policy.drivers"` | An input | Names the list whose item the value picks. | `x-ref` |

### Choices

| Key | Written as | On | Says | Contract key |
| - | - | - | - | - |
| `choice` | `choice` | An input | Marks an input as something the person buys, such as a limit or a deductible. | `x-choice` |
| `shape` | `shape: "limit"` | A `choice` input | Names the kind of choice, from a fixed list. | `x-shape` |
| `coverage` | `coverage: "collision"` | A `choice` input | Names the shared coverage code that the choice belongs to. | `x-code` |
| `steps` | `steps: "30000/60000, 50000/100000"` | A `limit_pair` or `per_day` choice | Lists the pairs of limits that are sold. | `x-steps` |
| `closed` | `closed` | An input | Says that only the narrowed values are answers. | `x-closed` |
| `choices` | `choices` | An enumeration in `Types` | Marks the one list of shared coverage codes. | |
| `listed` | `listed` | A CSV-backed enumeration in `Types` | Lists the enumeration's members in the input contract. | `enum` |

### Answers a host fills

| Key | Written as | On | Says | Contract key |
| - | - | - | - | - |
| `filled_by` | `filled_by: "vin_decode(vin_pattern).drive_type"` | An input | Names the host function that fills the input, so that the question is skipped. | `x-filled-by` |
| `reduce` | `reduce: "1-8,'0',10"` | An input | Cuts a longer answer down to the form the field holds. | `x-reduce` |
| `check` | `check: "at 9 mod 11 ten X weights … values …"` | An input | States the check digit that an answer carries. | `x-check` |

### Documents and checklists

| Key | Written as | On | Says | Contract key |
| - | - | - | - | - |
| `found_on` | `found_on: "declarations_page"` | An input | Names the documents that print the answer. | `x-evidence` |
| `gives` | `gives: "declarations_page"` | A `Bool` input | Names the document a person has when the answer is true. | `x-documents` |
| `checklist` | `checklist: "Cars"` | A `Bool` input or a pick-any list | Places the input as a row of a named checklist. | `x-checklist` |
| `statement` | `statement: "…"` | A checklist row | Gives the words of a checklist row. | `x-statement` |
| `statement_you` | `statement_you: "You smoke"` | A checklist row with a `statement` | Gives the words of the row for the person who answers. | `x-statement-you` |
| `attestation` | `attestation` | A `Bool` input | Asks the input as a question of its own that the person confirms. | `x-attestation` |

## Answer formats

The `format` annotation takes one of these names: `vin`, `postal-code`, `money`, `year`, `country`, `subdivision`.

## Choice shapes

The `shape` annotation takes one of these names: `limit`, `limit_pair`, `deductible`, `per_day`, `included`, `tier`, `term`.

## Removed names

A file that writes one of these names gets the message shown, with the form that replaces it.

| Name | Kind | Message |
| - | - | - |
| `Axes` | Section | [`E-AXES-REMOVED`](https://docs.canary.effectiveai.app/rsl/reference/check-messages/older#e-axes-removed) |
| `Entities` | Section | [`E-RELATION-REMOVED`](https://docs.canary.effectiveai.app/rsl/reference/check-messages/older#e-relation-removed) |
| `Text` | Type | [`E-TEXT-REMOVED`](https://docs.canary.effectiveai.app/rsl/reference/check-messages/older#e-text-removed) |
| `reject` | Function | [`E-REJECT-REMOVED`](https://docs.canary.effectiveai.app/rsl/reference/check-messages/older#e-reject-removed) |
| `checked` | Function | [`E-CHECKED-REMOVED`](https://docs.canary.effectiveai.app/rsl/reference/check-messages/older#e-checked-removed) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.