\section{Engineering}\label{sec:engineering} The engine is built against its specification, and the specification is the unit of accountability. This section describes how the engine goes from the specification to the release, and how that is made true rather than intended: how a requirement of \DspecPages{} pages of prose becomes code, how the code is shown to do what the requirement says, how the release is frozen and reproduced, and how the engine is run, on one laptop, by a user or by a language model. \subsection{From requirement to receipt}\label{sec:eng-trace} A requirement counts as implemented only when three things exist: an implementing module, a passing test, and an effective receipt, which is either a mutant of the implementing code that the tests kill or a kernel proof (\cref{fig:pipeline}): every requirement, each traced to the printed page of its source, reaches the release only through the three. The binding is mechanical in both directions. Every implementing declaration in Lean carries an attribute that names its requirements, and every implementing function in Python a decorator; the traceability tooling reads them, joins them with the test receipts and the mutation receipts, and writes the traceability matrix, one row per requirement (\cref{fig:trace}). The status printed beside each requirement in the specification is generated from that matrix and from nothing else, so that the specification cannot claim more than the code delivers. \begin{figure}[t] \centering \includegraphics[width=\textwidth]{figures/fig-pipeline.pdf} \caption{From requirement to receipt: every requirement traced to its source, its implementing module, a passing test, an effective receipt and the frozen release.}\label{fig:pipeline} \end{figure} \begin{figure}[t] \centering \includegraphics[width=\textwidth]{figures/fig-trace.pdf} \caption{A row of the traceability matrix: every requirement has exactly one row, and every row names a requirement. Figure of the specification.}\label{fig:trace} \end{figure} Of the \DspecReqs{} requirements, \DspecImpl{} are implemented. The records that cross interfaces are generated rather than written: the data dictionary of the specification, \DdictEntries{} entries, is compiled into \DrecordTypes{} Lean structures in \DrecordModules{} modules and into the Python schemas, and a gate refuses any hand edit of the generated code. The licence table and the contract register are generated in the same way. \subsection{Tests, mutants and shared vectors}\label{sec:eng-tests} The engine has two implementations of everything that both a Lean module and a Python module compute, and they are required to agree. Lean is the reference for every judgment of the trusted ring; Python carries the orchestration, the experts and the records. \Dvectors{} shared test vectors are evaluated by both, and the release requires that they agree on every one, with none diverging. The Python package has \DtestFiles{} test files and \Dtests{} tests, run under two versions of Python. Effectiveness of the tests is measured, not assumed, by mutation testing \cite{JiaHarman2011}: each implementing function is mutated, and a requirement's receipt is a mutant that the tests kill. \DmutAll{} mutants are killed, \DmutPy{} in Python and \DmutLean{} in Lean; a mutant that survived would be a requirement whose tests do not test it. The type checker runs in its strict mode, and an architectural linter enforces the layering of the package, so that a module of the proposing ring cannot import a capability of the trusted one. \subsection{Gates and the frozen release}\label{sec:eng-gates} The release is decided by \Dgates{} software gates, each a conjunct of the kind described in \cref{sec:ver-audit}: the lock of the specification is intact; no tool has changed a file of the sealed works; the generated code, the licence tables, the contract register, the Unicode tables and the canonical vectors have not drifted from their sources; the Lean library builds and passes the axiom audit; Lean agrees with the shared vectors; the linters, the strict type checker and the architectural linter pass; the tests pass under both versions of Python; the mutation receipts, in Python and in Lean, are all effective; every failure code is registered; every method skeleton is sound; the benchmarks, probe sets and task sets of the research campaigns are frozen; and the traceability matrix has not drifted. A release that fails one gate is not a release, whatever the others report. The release is frozen before it is measured. Its baseline is a tree of \DbaseFiles{} files whose digest is recorded, and every result of \cref{sec:eval} was computed once on that tree. The records of the release name every input by its \mbox{SHA-256}; the Lean toolchain, Mathlib, the Python dependencies and the model files are pinned, so that a party who installs the release obtains the code and the models that were measured, and can repeat every run with the commands of \cref{app:reproduce}. \subsection{The kernel service and the runtime}\label{sec:eng-runtime} The trusted ring runs as one Lean process that loads Mathlib and the engine's library once and answers requests over standard input and output. It exposes \DrpcMethods{} methods: \code{info}, \code{check}, \code{judge}, four methods of the method library, \code{tactic.step}, \code{index.resolve}, \code{index.premises} and \code{world.admit}. The method \code{check} replays a statement and a proof through the kernel and reports the axiom closure; \code{judge} dispatches to the kernel's \Djudgments{} decision procedures, each a Lean function of the library. A component outside the trusted ring that needs a verdict asks for one; it never computes one. Around the service, the runtime of the specification \cite[Part~XII]{Spec2026} supplies a content-addressed store of exact bytes, a scheduler of declared budgets and a durable event log, and its governing property is that it widens nothing: the workflow fabric records what happened, and none of its parts proves, signs, promotes, activates, publishes or rolls back. \subsection{Interfaces and the command line}\label{sec:interfaces}\label{sec:if-cli} The engine is used from a terminal, from a program, or from any language model that speaks the Model Context Protocol \cite{MCP2025}. Every interface reaches the same kernel and the same Topos-MoE, and none of them carries authority: an interface can prove, but cannot sign or admit. The command \texttt{gaimua} has five verbs. \begin{description} \item[\texttt{gaimua kernel info}, \texttt{gaimua kernel check}] the kernel's identity and consistency hash; the check of a statement with a proof. \item[\texttt{gaimua prove}] proves a Lean statement with Topos-MoE and prints the proof the kernel accepted, with the expert of every goal and the records of the run, or the obstruction. \item[\texttt{gaimua doctor}] reports what the host can run, and the profile chosen for it. \item[\texttt{gaimua models pull}] fetches the model files and checks each against its digest. \item[\texttt{gaimua mcp-serve}] serves the kernel and the engine to an MCP client. \end{description} The statement of \cref{sec:moe-run} is proved by one command: \begin{center}\small \verb|gaimua prove "" --open Finset| \end{center} \subsection{The MCP server}\label{sec:if-mcp} The command \verb|gaimua mcp-serve --prove| serves the engine over standard input and output, as five tools. \begin{description} \item[\code{lean_check}] check a proof with the Lean kernel, on the three standard axioms. \item[\code{lean_step}] run a tactic prefix and report the goals that remain. \item[\code{lean_resolve}] current names for names the library no longer has. \item[\code{lean_premises}] the theorems of the library most relevant to a statement. \item[\code{prove}] prove a statement with Topos-MoE: the proof the kernel accepted, with the expert of every goal, or the obstruction. \end{description} The server holds neither a store writer nor a signing key, as requirement \code{GM-MAT-005} demands. A model connected to it can test any idea against the kernel, and can admit, sign or promote nothing. This is the place at which a conversational model meets the engine, and its role there is that of a proposer: it may supply statements and candidate proofs, and the kernel decides on each. \Cref{fig:interface} shows the boundary. \begin{figure}[t] \centering \includegraphics[width=\textwidth]{figures/fig-interface.pdf} \caption{The interface boundary. A client can test any idea against the kernel; the server holds no store writer and no signing key.}\label{fig:interface} \end{figure} \subsection{Pinned models}\label{sec:if-models} GAI-MUA Math 1.0 trains no model. Its experts use open-weight models under their own licences, downloaded by the user and never redistributed; each file is pinned by revision and \mbox{SHA-256} (requirement \code{GM-MAT-006}) and checked when it is fetched. The models are quantised for a single consumer GPU and served by \code{llama.cpp} \cite{LlamaCpp}. \begin{table}[ht] \centering\footnotesize \input{generated/tab-models.tex} \caption{The pinned model files of the experts.}\label{tab:models} \end{table} \subsection{Installation and requirements}\label{sec:if-doctor} The minimum configuration is a Linux, macOS, or Windows machine with Python \DpyMin{} or \DpyMax{}, \DmemMinGB~GB of memory and \DdiskMinGB~GB of free disk; the Lean kernel is built once. A GPU is not required: without one the engine runs the closers and the kernel alone (\code{cpu}), and every proof is still checked. The expert models are optional and need an NVIDIA GPU, llama.cpp, and \DmodelsGB~GB of free disk for their files. The installation check reports every check it runs, with the remedy for each that fails, and selects the profile from what it finds (requirement \code{GM-MAT-013}): both proof experts resident at \DprofWorkMiB~MiB of GPU memory or more (\code{workstation-24g}); one after the other at \DprofLapMiB~MiB or more (\code{laptop-8g}), each model server started for its phase and stopped after it; otherwise the closers and the kernel alone (\code{cpu}). \subsection{The optional external proposer}\label{sec:if-external} The expert \(\Ex5\) is a reserved slot for an external proposer. It is off unless two switches are both on: a campaign manifest that enables it, by digest, and a switch on the host that runs the campaign. Its credentials are never handled by the engine. It is a proposer like any other: its outputs are candidates, its proofs pass the same kernel check, and it is not routed by \code{prove} in version 1.0. It was off in every run of \cref{sec:eval}.