Cotal TypeScript packages
    Preparing search index...

    Interface SimScript

    interface SimScript {
        asks?: Readonly<Record<string, unknown>>;
        checkpoints?: Readonly<
            Record<string, Scripted<Omit<CheckpointResultValue, "at">>>,
        >;
        clock?: {
            ask?: string;
            checkpoint?: string;
            start?: number;
            turn?: string;
            wait?: string;
        };
        events?: Readonly<Record<string, unknown>>;
        faults?: readonly SimFault[];
        turns?: Readonly<Record<string, Scripted<Omit<TurnResultValue, "at">>>>;
    }
    Index
    asks?: Readonly<Record<string, unknown>>
    checkpoints?: Readonly<
        Record<string, Scripted<Omit<CheckpointResultValue, "at">>>,
    >

    ⚠️ at IS NOT SCRIPTABLE for turns or checkpoints. turn() and both of checkpoint()'s return paths stamp it from virtual time, and neither one reads a scripted value, so anything written here was required by the type and then silently discarded. Demanding a field the implementation overwrites makes every fixture carry a number that means nothing, and reads to the next author as though it were honoured.

    The refusal is a rule, not a list: it fires exactly where SimScript is already the expected type of the literal being written, and nowhere else. So a literal at a call taking a SimScript, under an annotation on a const or a later-assigned let, in a parameter declared SimScript, or under satisfies SimScript is now an error. A literal typed before it meets this type, or never measured against it, escapes: inferred then passed by name, put through an as cast, or handed to a parameter declared unknown. Those still compile with at present and still have it discarded. This closes the idioms a new author reaches for; not the loophole.

    A hold (spec/cotal-lang.md §7.8) reaches checkpoint keyed by the held step's name, so an entry named after an ask inside once answers that step's hold, and expired produces L4027.

    clock?: {
        ask?: string;
        checkpoint?: string;
        start?: number;
        turn?: string;
        wait?: string;
    }

    Type Declaration

    • Optional Readonlyask?: string
    • Optional Readonlycheckpoint?: string
    • Optional Readonlystart?: number
    • Optional Readonlyturn?: string

      Virtual time each turn consumes. Default "5m".

    • Optional Readonlywait?: string
    events?: Readonly<Record<string, unknown>>

    Keyed by the wait step's name. A scripted null is a timeout, which is a choice.

    faults?: readonly SimFault[]
    turns?: Readonly<Record<string, Scripted<Omit<TurnResultValue, "at">>>>

    See the at rule on checkpoints below: turns are stamped from virtual time too, and a scripted at is refused.