Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Entities and state

An entity has a stable quoted identity and explicit components. OSL accepts description, capacities, properties, traits, and conditions sections.

entity "van-110" {
    description {
        name = "White VW van"
        plate = "ABC-123"
    }

    capacities {
        payload_mass = 800 kg
    }

    properties {
        payload_mass = 0 kg
        speed = 70 km/h
    }

    traits [vehicle van diesel]

    conditions {
        readiness = ready
    }
}

Description

description contains named string values for human-readable metadata.

description {
    name = "White VW van"
    drop former_name
}

Properties and capacities

properties contains current state values. capacities contains named limits or available resource amounts. Their expressions use the same syntax.

capacities {
    payload_mass = 800 kg
}

properties {
    payload_mass = 120 kg
    depot = @"hq".properties.located_at
}

The parser accepts condition symbols, quantities, component references, location(...), parentheses, unary operators, and binary arithmetic or comparison operators. Current change generation handles condition symbols, quantities, references, groups, and binary expressions. Unary lowering is not implemented safely. Location lowering also has known coordinate order, scale, and range defects, so do not use location values as an operational contract yet.

Current change generation does not check that a capacity has a matching property, compare value kinds or units, resolve referenced entities, or reject duplicate component names. Those checks belong to later engine validation and are not wired into the CLI today.

Traits

Traits are identifier labels for capabilities or classifications.

traits [vehicle van diesel]

A trait path names one trait on an entity or mutation role:

@"van-110".traits.vehicle
@vehicle.traits.vehicle

Conditions

conditions contains named condition values. See Conditions for declaration and validation limits.

Entry removal

Every entity section accepts drop entries. A top-level removal deletes the whole entity.

entity "van-110" {
    properties {
        drop legacy_speed
    }
}

drop entity "retired-van"