.. _api-concepts: Concepts and model ================== The API module is a command-oriented boundary above the PUQ, MAT, and DIP libraries. It does not implement a second scientific model. Instead, it collects arguments, invokes the native implementation, and formats or returns the result in a form intended for applications and services. Command objects --------------- Most operations follow a configure-then-execute lifecycle: 1. Construct a command with its expression, input, or snapshot. 2. Set options through ``argument_*`` methods or a small set of command-specific setters. 3. Call ``execute()`` to perform the operation. The command object is a request boundary. It is not a persistent replacement for a native PUQ quantity, MAT object, or DIP environment. Result forms ------------ PUQ commands return formatted text. DIP parse and comparison commands return formatted text or structured comparison records, while semantic DIP operations return versioned JSON. MAT commands are the exception: they return typed ``MatElementResult``, ``MatSubstanceResult``, and ``MatMaterialResult`` records so the CLI and other callers do not have to parse MAT presentation text. Use the native module APIs when an application needs typed in-memory objects or operations outside the command surface. The API module owns orchestration, argument validation, and interface-oriented output, not physics or parsing semantics. Build and failure model ----------------------- The facade is built with the API module. MAT commands require ``ENABLE_MAT``; report generation requires report support in the build. API errors use the SNT exception hierarchy, including ``api::Exception``, ``api::ArgumentException``, and ``api::MissingException`` for unavailable functionality. The installed command headers live in ``include/snt/api``. The PUQ commands and ``DIPParse`` currently have application-internal headers under ``src/snt/api``; they are documented for source-checkout consumers but are not installed with the package. Their C++ examples require the matching checkout's ``src`` directory on the include path. The :doc:`getting-started` example uses an installed MAT command header. Continue with :doc:`Getting started ` for the first command call, or :doc:`Workflows ` for PUQ, MAT, and DIP task sequences.