Architecture¶
truST is one language/runtime/tooling stack, not a loose collection of disconnected tools.
Acronyms
ST = Structured Text.
LSP = Language Server Protocol.
DAP = Debug Adapter Protocol.
HIR = High-level Intermediate Representation.
.tpi = program image: the project compiled into native code for one CPU.
Figure: Source files move through Build+Validate into artifacts
(program.tpi, runtime.toml, io.toml), and the same runtime then
serves I/O drivers, the browser IDE at /ide, and runtime control.
The Main Architectural Rule¶
Editor, runtime, web UI, debugger, harness, and agent APIs should reuse the same project semantics and execution model instead of inventing separate paths.
Main Layers¶
1. Language and semantics¶
trust-syntaxparses IEC 61131-3 Structured Texttrust-hirowns semantic analysis and typingtrust-ideexposes diagnostics, symbols, navigation, formatting, and code actions
2. Runtime and control¶
trust-runtime buildcompiles the project into a program image (program.tpi) of native code, andtrust-runtimeruns it with the same kernel every truST device runs- runtime configuration comes from
runtime.toml,io.toml, andsimulation.toml - control, reload, status, and testing interfaces are exposed through CLI, web UI, and agent methods
3. Tooling interfaces¶
trust-lspserves standard LSP editor workflowstrust-debugserves DAP over stdio for debugger integrationtrust-harnessprovides deterministic in-process cycle executiontrust-dev agent serveexposes a stable automation contract outside VS Code
4. Browser-hosted interfaces¶
/ideexposes the browser IDE for project editing- runtime-cloud APIs expose topology, preflight, and dispatch operations
One Project, Many Interfaces¶
The same project should move through these interfaces without being rewritten for each tool:
- authoring in an editor or browser IDE
- build and validation
- runtime execution
- deterministic harness or test execution
- diagnostics and repair through agents
- runtime control APIs
If a feature only works in one interface because it depends on product-specific glue, that is usually an architectural smell in truST.
Shared Contracts¶
The main shared contracts are:
- the project layout (
src/, config files) - semantic analysis from the compiler/language stack
- compilation into a program image and runtime execution
- deterministic cycle stepping for tests and automation
- machine-readable control and agent APIs
That is why the docs repeatedly route readers back to the same config and workflow pages instead of documenting separate "editor mode" and "runtime mode" worlds.
Non-goals¶
truST avoids the common PLC-tool split where:
- the editor uses one project model
- the runtime uses a different deployment model
- the browser UI is a third system
- automation or AI integrations only work by screen-scraping editor features
The platform is easier to maintain when agent tooling, runtime control, web UI, and editor integrations all sit on top of the same project and execution model.
Why this matters¶
The same project should behave consistently whether you:
- build it from the CLI
- edit it in VS Code
- run diagnostics from an agent
- drive it through the deterministic harness
- inspect it in the web UI
That shared execution contract is the main design rule in truST.