TOC Toolkit API - v0.1.0
    Preparing search index...

    toc-toolkit/engine

    The scheduler that exposes eight typed formal-language operations through an in-process host and a worker host. It checks request data, delegates the mathematical work to the toc facade, encodes complete reports as JSON, and keeps bounded model and decision state. Callers supply the clock, limits and cancellation signal.

    • Operations. Check, run, run many, convert, operate, decide, analyze and simplify. An algorithm that runs out of resources returns an exhaustion report, and every other expected failure is a Result. (EngineMethod, ENGINE_OPERATIONS)
    • Hosts. An in-process host, and a worker host with an interactive and a background FIFO lane, caller-supplied worker connections and an optional backstop timer. (InProcessHost, WorkerHost, serveEngine, EngineLane)
    • Typed client. Wraps a host and decodes every successful response. (createEngine)
    • Model cache. A least-recently-used cache of checked models keyed by the draft key, with one artifact cache that the hosts hand to each decision's root budget, so that decisions over the same model reuse its compiled forms, recognizers and word tables until the host is disposed. (ModelCache)
    • Session store. A least-recently-used store of open decision sessions. (SessionStore)
    • Budgets and cancellation. Builds call limits from the caller options, and observes the cancellation signal during work and again before the report is returned. The limit builder accepts native or owner-wire amounts, fills absent resources from the defaults and writes the full nine-resource wire back. (callLimits, encodeCallLimits, CallOptions, CancellationSignal)
    • Transport limits. Checks the size and shape of a request before it is decoded. (checkWire, WIRE_LIMITS, REQUEST_CAPS)
    • Codecs. Decoders for requests and reports, and encoders that project reports to JSON. (REQUEST_DECODERS, REPORT_DECODERS, REPORT_ENCODERS)
    • Question keys. Builds an injective identity text of a decision question from its kind, operand drafts, words, alphabet, policy and witness policy. (questionKey)
    • Run records. Encode and decode checked run outcomes and pair lines for the corpus tools, each with a decoder, an encoder and a codec that takes a budget. (RunRecord, runRecordDecoder, encodeRunRecord, runRecordCodec, PairLine, pairLineDecoder, encodePairLine, pairLineCodec)
    • Record ids. Build the id of a source row or of a physical pair line, and validate external id text without aliases. (recordIdOf, pairRecordIdOf, asRecordId, recordIdDecoder)
    • Enumerations. Name the closed sets of strings that the types and the wire data of the package use. (EngineFailureKind, RecordIssueCode, RecordedCheckStatus, RunLineKind, RunScope, WireIssueCode)