# logicaffeine_cli > largo — the LOGOS build tool: projects, builds, tests, serving, proofs, and the package registry Every public module and item of `logicaffeine_cli`, module by module, each with its one-line summary and its address. Item pages hold the full signature, documentation, trait implementations and a link to the source. - Crate page: [logicaffeine_cli](https://docs.logicaffeine.com/logicaffeine_cli/) - All items on one page: [logicaffeine_cli/all](https://docs.logicaffeine.com/logicaffeine_cli/all) - Source: [src/logicaffeine_cli/lib.rs](https://docs.logicaffeine.com/src/logicaffeine_cli/lib.rs) - Every crate: [llms.txt](https://docs.logicaffeine.com/llms.txt) ## logicaffeine_cli - [mod analysis](https://docs.logicaffeine.com/logicaffeine_cli/analysis/): Re-export of analysis utilities from the compile crate. - [mod browser](https://docs.logicaffeine.com/logicaffeine_cli/browser/): A real browser as a page tier: headless Chrome, driven over the DevTools protocol. - [mod cli](https://docs.logicaffeine.com/logicaffeine_cli/cli/): LOGOS CLI (largo) — argument parsing and dispatch. - [mod compile](https://docs.logicaffeine.com/logicaffeine_cli/compile/): LOGOS Compilation Pipeline for CLI - [mod dap](https://docs.logicaffeine.com/logicaffeine_cli/dap/): `largo dap` — the LOGOS debugger served over the Debug Adapter Protocol. - [mod interface](https://docs.logicaffeine.com/logicaffeine_cli/interface/): Re-export of the LOGOS interface types from the kernel crate. - [mod mcp](https://docs.logicaffeine.com/logicaffeine_cli/mcp/): `largo mcp` — the LOGOS toolchain served over the Model Context Protocol. - [mod project](https://docs.logicaffeine.com/logicaffeine_cli/project/): Phase 36/37/39: Project Module System - [mod ui](https://docs.logicaffeine.com/logicaffeine_cli/ui/): Terminal output substrate for `largo`. - [fn assets_module](https://docs.logicaffeine.com/logicaffeine_cli/fn.assets_module): The generated `logos_assets` module a built site bakes into its binary — the REAL table, so a lock holds the headers that actually ship rather than the rule that computes them. - [fn cache_control_for](https://docs.logicaffeine.com/logicaffeine_cli/fn.cache_control_for): The `Cache-Control` a path is served with — immutable for a content-addressed name, revalidated for a name people link to. - [fn conditional_response](https://docs.logicaffeine.com/logicaffeine_cli/fn.conditional_response): Answer a conditional request: `(status, body length)` for an ETag and a client’s `If-None-Match`. - [fn content_hash](https://docs.logicaffeine.com/logicaffeine_cli/fn.content_hash): The short content digest an asset’s file name carries — see `web_bundle::content_hash`. - [fn content_type_for](https://docs.logicaffeine.com/logicaffeine_cli/fn.content_type_for): The content type largo serves a path as — the table `largo serve` and `largo build` both use. - [fn dev_page_html](https://docs.logicaffeine.com/logicaffeine_cli/fn.dev_page_html): The document `largo serve` sends for a page — the same pre-rendered markup `largo build` ships, so what a developer looks at is what their visitors get. - [fn etag_for](https://docs.logicaffeine.com/logicaffeine_cli/fn.etag_for): An asset’s quoted `ETag`. - [fn gzip_asset](https://docs.logicaffeine.com/logicaffeine_cli/fn.gzip_asset): gzip some bytes the way `largo build` does, or `None` when a compressed form is not worth shipping — exposed so `asset_compression_lock` measures the REAL compressor on a REAL asset rather than a copy of the rule. - [fn largo_main](https://docs.logicaffeine.com/logicaffeine_cli/fn.largo_main): The `largo` process: installs the native tier, runs `run_cli` on a worker whose stack is sized from the AST depth limit, renders any error, and exits with its code. `src/main.rs` is exactly this call, and so is the test crate’s `largo-under-test`, so the CLI suites spawn what ships. - [fn page_asset_base](https://docs.logicaffeine.com/logicaffeine_cli/fn.page_asset_base): The URL-and-filesystem-safe form of a page path (`/posts/:id` → `/posts/id`) — the shipped name, exposed so the lock holds the published bytes rather than a copy of the rule. - [fn page_html_paths](https://docs.logicaffeine.com/logicaffeine_cli/fn.page_html_paths): The URLs a page answers — the ONE rule `largo serve` and `largo build` both follow. - [fn page_path_matches](https://docs.logicaffeine.com/logicaffeine_cli/fn.page_path_matches): Does a concrete request path match a page’s declared `## Page` path? A `:name` segment matches any one segment — the same rule `web.lg`’s `matchRoute` applies inside the page, exposed so `page_pattern_routing_lock` holds the REAL matcher the router uses. - [fn parse_error_report](https://docs.logicaffeine.com/logicaffeine_cli/fn.parse_error_report): Everything `largo` writes to standard error for a program the compiler rejects with `pe`, whose span is in `text`, the text of `file`: the `error:` block with the explanation, the excerpt and the `--> file:line:col`, without terminal styles. Every backend `largo` drives reports a rejected program in exactly these bytes, and the tier-parity census holds the backends it drives in-process to them too. - [fn plan_site_assets](https://docs.logicaffeine.com/logicaffeine_cli/fn.plan_site_assets): A built site’s planned assets as `(path, content type, bytes)` — the REAL table `largo build` bakes into the binary, exposed so `asset_cache_lock` holds the shipped names and headers rather than a copy of the rule. - [fn prerender_page_html](https://docs.logicaffeine.com/logicaffeine_cli/fn.prerender_page_html): A built page’s document with its markup already in it — the static-render half of `largo build`. Public so `ssg_lock` exercises the REAL function the build calls, rather than a copy that could drift from it. - [fn stylesheet_links_for](https://docs.logicaffeine.com/logicaffeine_cli/fn.stylesheet_links_for): Which stylesheets a page links — the ONE rule `largo serve` and `largo build` both apply. ## logicaffeine_cli::analysis Re-export of analysis utilities from the compile crate. - [mod assemble](https://docs.logicaffeine.com/logicaffeine_cli/analysis/assemble/): Source-level assembly of a multi-file / multi-directory LOGOS project. - [mod callgraph](https://docs.logicaffeine.com/logicaffeine_cli/analysis/callgraph/) - [mod check](https://docs.logicaffeine.com/logicaffeine_cli/analysis/check/): Bidirectional type checker for the LOGOS compilation pipeline. - [mod defined_real](https://docs.logicaffeine.com/logicaffeine_cli/analysis/defined_real/): Which functions may define a real number: `the real number whose digits in base 3 are f`, `the real number approximated by f`. - [mod dependencies](https://docs.logicaffeine.com/logicaffeine_cli/analysis/dependencies/) - [mod dimension_check](https://docs.logicaffeine.com/logicaffeine_cli/analysis/dimension_check/): Dimension-aware static analysis — rejects dimension-incoherent quantity arithmetic at COMPILE time, before any code is generated. `2 meters + 1 gram` is a type error, not a runtime panic: a length and a mass have no common dimension, so adding them cannot mean anything. - [mod escape](https://docs.logicaffeine.com/logicaffeine_cli/analysis/escape/): Escape analysis for zone safety. - [mod import_hygiene](https://docs.logicaffeine.com/logicaffeine_cli/analysis/import_hygiene/): Import-hygiene lints — the pit-of-success guardrails that keep a project’s import blocks honest. An UNRESOLVABLE import is already a hard error at assembly (with a “did you mean” suggestion from the loader); this pass finds the problems that ASSEMBLE FINE but are still mistakes: an import that is never used, the same module imported twice, and a module importing itself. - [mod known_calls](https://docs.logicaffeine.com/logicaffeine_cli/analysis/known_calls/): Definition-time resolution of CALLED NAMES — a call to a name that exists NOWHERE in the program is a check error, not a native-build E0425 or a runtime surprise. - [mod liveness](https://docs.logicaffeine.com/logicaffeine_cli/analysis/liveness/) - [mod ownership](https://docs.logicaffeine.com/logicaffeine_cli/analysis/ownership/): Native ownership analysis for use-after-move detection. - [mod pipes](https://docs.logicaffeine.com/logicaffeine_cli/analysis/pipes/): Which function parameters carry a pipe. - [mod policy](https://docs.logicaffeine.com/logicaffeine_cli/analysis/policy/) - [mod readonly](https://docs.logicaffeine.com/logicaffeine_cli/analysis/readonly/) - [mod registry](https://docs.logicaffeine.com/logicaffeine_cli/analysis/registry/) - [mod relay](https://docs.logicaffeine.com/logicaffeine_cli/analysis/relay/): Whether a program’s pages talk to the relay — and so whether the backend serving them answers `/_relay` itself. - [mod tower](https://docs.logicaffeine.com/logicaffeine_cli/analysis/tower/): Which values of a program the exact extension reaches: the bindings, function results and parameters that can hold an infinitesimal, a hyperreal, an infinite integer, an algebraic number, a computable real, an ordinal, a residue-dependent value or a provisional answer. - [mod types](https://docs.logicaffeine.com/logicaffeine_cli/analysis/types/): Type inference pass for the LOGOS compilation pipeline. - [mod unify](https://docs.logicaffeine.com/logicaffeine_cli/analysis/unify/): Unification engine for the bidirectional type checker. - [struct AssembledProgram](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.AssembledProgram): One assembled compilation unit: the combined source plus the metadata later passes need for qualified-name resolution, collision diagnostics, and cross-file error attribution. - [struct CallInstance](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.CallInstance): One call of a generic function, as the checker solved it. - [struct CapabilityDef](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.CapabilityDef): A capability definition: `A User can publish the Document if...` - [struct DefSite](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.DefSite): A single definition site: which module (canonical path) declared a bare name, and the normalized content of the definition (its identity — two defs with the same normalized body are THE SAME definition). - [struct Dependency](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.Dependency): A dependency declaration found in the document’s abstract. - [struct DimensionChecker](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.DimensionChecker) - [struct DimensionError](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.DimensionError): A dimension coherence error. `trail` names the statements it propagated out through, innermost first — the statement that holds the incoherent arithmetic, then each block statement around it — so a diagnostic can point at the sentence at fault. - [struct DiscoveryPass](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.DiscoveryPass): Discovery pass that scans tokens before main parsing to build a TypeRegistry. - [struct DiscoveryResult](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.DiscoveryResult): Result of running the discovery pass - [struct EscapeChecker](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.EscapeChecker) - [struct EscapeError](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.EscapeError): Error type for escape violations - [struct FieldDef](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.FieldDef): Field definition within a struct - [struct FnSig](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.FnSig): Function signature for tracked functions. - [struct ImportLint](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.ImportLint): One import-hygiene finding. - [struct IndexedTypeError](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.IndexedTypeError): One typechecker finding with the top-level statement it belongs to. - [struct Instantiations](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.Instantiations): What the checker solved at every generic site of a program — the input to monomorphization. - [struct Located](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.Located): A combined-source offset resolved back to its origin. - [struct LocatedTypeError](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.LocatedTypeError): A type error and the top-level function it was found in — `None` for a `## Main` statement. A checked program has no source spans left (lowering writes functions of its own), so the function is the location a report can give. - [struct OwnershipChecker](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.OwnershipChecker): Ownership checker - tracks variable states through control flow - [struct OwnershipError](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.OwnershipError): Error type for ownership violations - [struct OwnershipFinding](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.OwnershipFinding): One ownership finding with its statement coordinates: the top-level statement that ERRED, and (when known) the one that CAUSED it by moving the variable — both map 1:1 onto `Parser::stmt_spans()` — plus the exact statements, nested ones included, for `Parser::nested_stmt_spans()`: `trail` is the erring statement and each one around it, innermost first, and `cause` is the statement that gave the value away. - [struct PolicyRegistry](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.PolicyRegistry): Registry for security policies defined in `## Policy` blocks. - [struct PredicateDef](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.PredicateDef): A predicate definition: `A User is admin if the user's role equals "admin".` - [struct Provenance](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.Provenance): Bare-name → the modules that define it. A bare name owned by more than one distinct module is ambiguous: a bare reference to it is a hard error, and the qualified form disambiguates. - [struct RustNames](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.RustNames): Centralized name resolution for Rust identifier output. - [struct ScopeInfo](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.ScopeInfo): Per-file lexical scope for the whole project: what each file is allowed to reference. A file sees its own definitions and the exports of the modules it directly imports — never anything reached only transitively. - [struct Segment](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.Segment): One contributed segment of the combined source: its `[start, end)` byte range in the combined string, the ORIGINAL file it came from, and — for a byte-intact segment — the offset in that file its `start` corresponds to. - [struct SourceMap](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.SourceMap): File-level attribution: for each contributed segment of the combined source, its byte range, originating file, and (for byte-intact segments) the offset-within-file mapping — so a diagnostic on the combined blob is attributed to the user’s own file and line. - [struct TypeEnv](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.TypeEnv): Type environment built by a forward pass over the AST. - [struct TypeRegistry](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.TypeRegistry) - [struct VariantDef](https://docs.logicaffeine.com/logicaffeine_cli/analysis/struct.VariantDef): Phase 33: Variant definition for sum types - [enum DefKind](https://docs.logicaffeine.com/logicaffeine_cli/analysis/enum.DefKind): The kind of a top-level definition, for collision messages. - [enum EscapeErrorKind](https://docs.logicaffeine.com/logicaffeine_cli/analysis/enum.EscapeErrorKind) - [enum FieldType](https://docs.logicaffeine.com/logicaffeine_cli/analysis/enum.FieldType): Type reference for struct fields (avoids circular deps with ast::TypeExpr) - [enum ImportLintKind](https://docs.logicaffeine.com/logicaffeine_cli/analysis/enum.ImportLintKind): What kind of import-hygiene problem was found. - [enum LintSeverity](https://docs.logicaffeine.com/logicaffeine_cli/analysis/enum.LintSeverity): The severity of an import lint. Warnings never block a build; errors do. - [enum LogosType](https://docs.logicaffeine.com/logicaffeine_cli/analysis/enum.LogosType): Structured type representation for LOGOS values. - [enum MaybeGivenIn](https://docs.logicaffeine.com/logicaffeine_cli/analysis/enum.MaybeGivenIn): Where a value may have been given away: the construct whose paths disagree about it. - [enum OwnershipErrorKind](https://docs.logicaffeine.com/logicaffeine_cli/analysis/enum.OwnershipErrorKind) - [enum PolicyCondition](https://docs.logicaffeine.com/logicaffeine_cli/analysis/enum.PolicyCondition): Condition in a policy definition. Represents the predicate logic for security rules. - [enum Site](https://docs.logicaffeine.com/logicaffeine_cli/analysis/enum.Site): A node of the checked program, by address. The checker and a later pass over the SAME statements agree on it without the AST carrying ids. - [enum TypeDef](https://docs.logicaffeine.com/logicaffeine_cli/analysis/enum.TypeDef) - [enum VarState](https://docs.logicaffeine.com/logicaffeine_cli/analysis/enum.VarState): Ownership state for a variable - [fn assemble_project](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.assemble_project): Assemble the whole project reachable from `entry_path` into one compilation unit. Returns an error only for unreadable/unresolvable imports; the combined source is then parsed by the normal pipeline. - [fn assemble_project_with_deps](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.assemble_project_with_deps): `assemble_project`, additionally linking the declared dependency roots so a bare `Import .` resolves against a `path`/`git`-local package outside the project root. `dep_roots` empty is byte-for-byte identical to `assemble_project`, so a single-project build is unchanged. - [fn check_program](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.check_program): Check a LOGOS program and return a typed `TypeEnv` for codegen. - [fn check_program_collect](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.check_program_collect): Collect EVERY failing top-level statement instead of bailing at the first. - [fn check_program_located](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.check_program_located): `check_program`, reporting which top-level function a failure is in. - [fn check_scopes](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.check_scopes): Enforce per-file scoping over the assembled program: a reference to a name that is another user module’s export, from a file that neither defines nor imports it, is a hard error (no transitive leakage). Builtins, stdlib, and a file’s own/imported names are always fine, so a valid program never trips. - [fn check_unknown_calls](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.check_unknown_calls): Reject the first call (in source order) to a name that exists nowhere in the post-prelude program. See the module docs for the KNOWN-name rule. - [fn check_unknown_calls_with_exports](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.check_unknown_calls_with_exports): `check_unknown_calls` for the mixed-document seam: `exports` is the callable surface of a bundled proven module (see `proven_module_exports`), whose names the imperative half calls by design (`use proven::*;`). - [fn discover_with_imports](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.discover_with_imports): Recursive discovery with module imports. - [fn first_section_header](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.first_section_header): A file’s first `## ` section header outside a ``` fence, as its 1-based line and its text: the line above which an `Import` must stand to import anything. - [fn infer_instantiations](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.infer_instantiations): Check `stmts` as far as each statement goes — a failing statement does not stop the rest — and answer what every generic site was solved at. The input to monomorphization; a backend with no generics of its own reads which instance each call and construction needs from here. - [fn lint_imports](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.lint_imports): Lint the entry file’s imports for unused / duplicate / self-import problems. Unresolvable imports are NOT reported here — the assembler already rejects those with a suggestion. Returns `Err` only if the entry can’t be read. - [fn lint_imports_with_deps](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.lint_imports_with_deps): `lint_imports`, resolving imports with the declared dependency roots so a `path`/`git`-local import is lint-checked too. `dep_roots` empty is identical to `lint_imports`. - [fn misplaced_imports](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.misplaced_imports): Every `Import` sentence below a file’s first `## ` header, each with its byte span. That is where `scan_dependencies` does not read, so such a sentence imports nothing: the module is never spliced and the program runs on without it. A caller refuses each at its own line. A line inside a - [fn proven_module_exports](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.proven_module_exports): The callable surface of a bundled proven module: every `pub fn` name. The Forge emits proven functions, `check_*` predicates, and non-nullary enum constructors all as `pub fn`s (a nullary constructor is a `pub const`, which is an identifier reference, not a call — outside this pass’s domain). - [fn refuse_retired_calls](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.refuse_retired_calls): The first call, in source order, to a builtin the language no longer has (`crate::semantics::builtins::retired_builtin`), refused in that builtin’s own sentence. A name the program defines or binds is its own and is called. Every tier’s front end runs this before the program runs, so each refuses the call in the same words, whether or not the call is ever reached. - [fn root_binding_types](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.root_binding_types): The type of every binding the program’s ROOT declares, as the checker settled it once the whole program was read. Exact where `TypeEnv` is not: its variables are one flat map, so a function’s own `x` and the program’s `x` share an entry there. - [fn scan_dependencies](https://docs.logicaffeine.com/logicaffeine_cli/analysis/fn.scan_dependencies): Scans the first paragraph (Abstract) of a LOGOS file for `[Alias](URI)` links. ## logicaffeine_cli::analysis::assemble Source-level assembly of a multi-file / multi-directory LOGOS project. - [struct AssembledProgram](https://docs.logicaffeine.com/logicaffeine_cli/analysis/assemble/struct.AssembledProgram): One assembled compilation unit: the combined source plus the metadata later passes need for qualified-name resolution, collision diagnostics, and cross-file error attribution. - [struct DefSite](https://docs.logicaffeine.com/logicaffeine_cli/analysis/assemble/struct.DefSite): A single definition site: which module (canonical path) declared a bare name, and the normalized content of the definition (its identity — two defs with the same normalized body are THE SAME definition). - [struct Located](https://docs.logicaffeine.com/logicaffeine_cli/analysis/assemble/struct.Located): A combined-source offset resolved back to its origin. - [struct Provenance](https://docs.logicaffeine.com/logicaffeine_cli/analysis/assemble/struct.Provenance): Bare-name → the modules that define it. A bare name owned by more than one distinct module is ambiguous: a bare reference to it is a hard error, and the qualified form disambiguates. - [struct ScopeInfo](https://docs.logicaffeine.com/logicaffeine_cli/analysis/assemble/struct.ScopeInfo): Per-file lexical scope for the whole project: what each file is allowed to reference. A file sees its own definitions and the exports of the modules it directly imports — never anything reached only transitively. - [struct Segment](https://docs.logicaffeine.com/logicaffeine_cli/analysis/assemble/struct.Segment): One contributed segment of the combined source: its `[start, end)` byte range in the combined string, the ORIGINAL file it came from, and — for a byte-intact segment — the offset in that file its `start` corresponds to. - [struct SourceMap](https://docs.logicaffeine.com/logicaffeine_cli/analysis/assemble/struct.SourceMap): File-level attribution: for each contributed segment of the combined source, its byte range, originating file, and (for byte-intact segments) the offset-within-file mapping — so a diagnostic on the combined blob is attributed to the user’s own file and line. - [enum DefKind](https://docs.logicaffeine.com/logicaffeine_cli/analysis/assemble/enum.DefKind): The kind of a top-level definition, for collision messages. - [fn assemble_project](https://docs.logicaffeine.com/logicaffeine_cli/analysis/assemble/fn.assemble_project): Assemble the whole project reachable from `entry_path` into one compilation unit. Returns an error only for unreadable/unresolvable imports; the combined source is then parsed by the normal pipeline. - [fn assemble_project_with_deps](https://docs.logicaffeine.com/logicaffeine_cli/analysis/assemble/fn.assemble_project_with_deps): `assemble_project`, additionally linking the declared dependency roots so a bare `Import .` resolves against a `path`/`git`-local package outside the project root. `dep_roots` empty is byte-for-byte identical to `assemble_project`, so a single-project build is unchanged. - [fn check_scopes](https://docs.logicaffeine.com/logicaffeine_cli/analysis/assemble/fn.check_scopes): Enforce per-file scoping over the assembled program: a reference to a name that is another user module’s export, from a file that neither defines nor imports it, is a hard error (no transitive leakage). Builtins, stdlib, and a file’s own/imported names are always fine, so a valid program never trips. ## logicaffeine_cli::analysis::callgraph - [struct CallGraph](https://docs.logicaffeine.com/logicaffeine_cli/analysis/callgraph/struct.CallGraph): Whole-program call graph for the LOGOS compilation pipeline. ## logicaffeine_cli::analysis::check Bidirectional type checker for the LOGOS compilation pipeline. - [struct CallInstance](https://docs.logicaffeine.com/logicaffeine_cli/analysis/check/struct.CallInstance): One call of a generic function, as the checker solved it. - [struct IndexedTypeError](https://docs.logicaffeine.com/logicaffeine_cli/analysis/check/struct.IndexedTypeError): One typechecker finding with the top-level statement it belongs to. - [struct Instantiations](https://docs.logicaffeine.com/logicaffeine_cli/analysis/check/struct.Instantiations): What the checker solved at every generic site of a program — the input to monomorphization. - [struct LocatedTypeError](https://docs.logicaffeine.com/logicaffeine_cli/analysis/check/struct.LocatedTypeError): A type error and the top-level function it was found in — `None` for a `## Main` statement. A checked program has no source spans left (lowering writes functions of its own), so the function is the location a report can give. - [enum Site](https://docs.logicaffeine.com/logicaffeine_cli/analysis/check/enum.Site): A node of the checked program, by address. The checker and a later pass over the SAME statements agree on it without the AST carrying ids. - [fn check_program](https://docs.logicaffeine.com/logicaffeine_cli/analysis/check/fn.check_program): Check a LOGOS program and return a typed `TypeEnv` for codegen. - [fn check_program_collect](https://docs.logicaffeine.com/logicaffeine_cli/analysis/check/fn.check_program_collect): Collect EVERY failing top-level statement instead of bailing at the first. - [fn check_program_located](https://docs.logicaffeine.com/logicaffeine_cli/analysis/check/fn.check_program_located): `check_program`, reporting which top-level function a failure is in. - [fn first_undeclared_type](https://docs.logicaffeine.com/logicaffeine_cli/analysis/check/fn.first_undeclared_type): The first type the program names that nothing supplies, with where it is named: the index of the top-level statement that names it, or `None` for a field of a declared record or variant (a declaration is not a statement). A name is supplied by the registry (a record, enum or alias the program declares or imports, a builtin, an intrinsic generic), by the language itself (`codegen::types::is_language_type_name`, and the dimension words `Quantity of ` takes, `Dimension::by_name`), or as a type parameter the declaration itself introduces. Run on the program the parser returned, whose top-level statements align with its statement spans, so a statement’s refusal is located. A written type counts wherever it stands: a construction, a collection’s element type, an annotation, a typed fetch, a function’s parameters and return type, a record’s or variant’s field types. - [fn infer_instantiations](https://docs.logicaffeine.com/logicaffeine_cli/analysis/check/fn.infer_instantiations): Check `stmts` as far as each statement goes — a failing statement does not stop the rest — and answer what every generic site was solved at. The input to monomorphization; a backend with no generics of its own reads which instance each call and construction needs from here. - [fn root_binding_types](https://docs.logicaffeine.com/logicaffeine_cli/analysis/check/fn.root_binding_types): The type of every binding the program’s ROOT declares, as the checker settled it once the whole program was read. Exact where `TypeEnv` is not: its variables are one flat map, so a function’s own `x` and the program’s `x` share an entry there. ## logicaffeine_cli::analysis::defined_real Which functions may define a real number: `the real number whose digits in base 3 are f`, `the real number approximated by f`. - [fn check](https://docs.logicaffeine.com/logicaffeine_cli/analysis/defined_real/fn.check): The first function the program defines a real number by that cannot define one, refused in words naming it; `Ok` when there is none. ## logicaffeine_cli::analysis::dependencies - [struct Dependency](https://docs.logicaffeine.com/logicaffeine_cli/analysis/dependencies/struct.Dependency): A dependency declaration found in the document’s abstract. - [struct SelectedName](https://docs.logicaffeine.com/logicaffeine_cli/analysis/dependencies/struct.SelectedName): One name selected by a per-name import (`Import double as dbl from Util.`). - [fn first_section_header](https://docs.logicaffeine.com/logicaffeine_cli/analysis/dependencies/fn.first_section_header): A file’s first `## ` section header outside a ``` fence, as its 1-based line and its text: the line above which an `Import` must stand to import anything. - [fn misplaced_imports](https://docs.logicaffeine.com/logicaffeine_cli/analysis/dependencies/fn.misplaced_imports): Every `Import` sentence below a file’s first `## ` header, each with its byte span. That is where `scan_dependencies` does not read, so such a sentence imports nothing: the module is never spliced and the program runs on without it. A caller refuses each at its own line. A line inside a - [fn scan_dependencies](https://docs.logicaffeine.com/logicaffeine_cli/analysis/dependencies/fn.scan_dependencies): Scans the first paragraph (Abstract) of a LOGOS file for `[Alias](URI)` links. ## logicaffeine_cli::analysis::dimension_check Dimension-aware static analysis — rejects dimension-incoherent quantity arithmetic at COMPILE time, before any code is generated. `2 meters + 1 gram` is a type error, not a runtime panic: a length and a mass have no common dimension, so adding them cannot mean anything. - [struct DimensionChecker](https://docs.logicaffeine.com/logicaffeine_cli/analysis/dimension_check/struct.DimensionChecker) - [struct DimensionError](https://docs.logicaffeine.com/logicaffeine_cli/analysis/dimension_check/struct.DimensionError): A dimension coherence error. `trail` names the statements it propagated out through, innermost first — the statement that holds the incoherent arithmetic, then each block statement around it — so a diagnostic can point at the sentence at fault. ## logicaffeine_cli::analysis::escape Escape analysis for zone safety. - [struct EscapeChecker](https://docs.logicaffeine.com/logicaffeine_cli/analysis/escape/struct.EscapeChecker) - [struct EscapeError](https://docs.logicaffeine.com/logicaffeine_cli/analysis/escape/struct.EscapeError): Error type for escape violations - [struct EscapeFinding](https://docs.logicaffeine.com/logicaffeine_cli/analysis/escape/struct.EscapeFinding): Tracks the “zone depth” of variables for escape analysis One escape finding: the top-level statement it belongs to (mapping onto `Parser::stmt_spans()`), and the erring statement with each one around it, innermost first (for `Parser::nested_stmt_spans()`). - [enum EscapeErrorKind](https://docs.logicaffeine.com/logicaffeine_cli/analysis/escape/enum.EscapeErrorKind) ## logicaffeine_cli::analysis::import_hygiene Import-hygiene lints — the pit-of-success guardrails that keep a project’s import blocks honest. An UNRESOLVABLE import is already a hard error at assembly (with a “did you mean” suggestion from the loader); this pass finds the problems that ASSEMBLE FINE but are still mistakes: an import that is never used, the same module imported twice, and a module importing itself. - [struct ImportLint](https://docs.logicaffeine.com/logicaffeine_cli/analysis/import_hygiene/struct.ImportLint): One import-hygiene finding. - [enum ImportLintKind](https://docs.logicaffeine.com/logicaffeine_cli/analysis/import_hygiene/enum.ImportLintKind): What kind of import-hygiene problem was found. - [enum LintSeverity](https://docs.logicaffeine.com/logicaffeine_cli/analysis/import_hygiene/enum.LintSeverity): The severity of an import lint. Warnings never block a build; errors do. - [fn lint_imports](https://docs.logicaffeine.com/logicaffeine_cli/analysis/import_hygiene/fn.lint_imports): Lint the entry file’s imports for unused / duplicate / self-import problems. Unresolvable imports are NOT reported here — the assembler already rejects those with a suggestion. Returns `Err` only if the entry can’t be read. - [fn lint_imports_with_deps](https://docs.logicaffeine.com/logicaffeine_cli/analysis/import_hygiene/fn.lint_imports_with_deps): `lint_imports`, resolving imports with the declared dependency roots so a `path`/`git`-local import is lint-checked too. `dep_roots` empty is identical to `lint_imports`. ## logicaffeine_cli::analysis::known_calls Definition-time resolution of CALLED NAMES — a call to a name that exists NOWHERE in the program is a check error, not a native-build E0425 or a runtime surprise. - [fn check_unknown_calls](https://docs.logicaffeine.com/logicaffeine_cli/analysis/known_calls/fn.check_unknown_calls): Reject the first call (in source order) to a name that exists nowhere in the post-prelude program. See the module docs for the KNOWN-name rule. - [fn check_unknown_calls_with_exports](https://docs.logicaffeine.com/logicaffeine_cli/analysis/known_calls/fn.check_unknown_calls_with_exports): `check_unknown_calls` for the mixed-document seam: `exports` is the callable surface of a bundled proven module (see `proven_module_exports`), whose names the imperative half calls by design (`use proven::*;`). - [fn proven_module_exports](https://docs.logicaffeine.com/logicaffeine_cli/analysis/known_calls/fn.proven_module_exports): The callable surface of a bundled proven module: every `pub fn` name. The Forge emits proven functions, `check_*` predicates, and non-nullary enum constructors all as `pub fn`s (a nullary constructor is a `pub const`, which is an identifier reference, not a call — outside this pass’s domain). - [fn refuse_retired_calls](https://docs.logicaffeine.com/logicaffeine_cli/analysis/known_calls/fn.refuse_retired_calls): The first call, in source order, to a builtin the language no longer has (`crate::semantics::builtins::retired_builtin`), refused in that builtin’s own sentence. A name the program defines or binds is its own and is called. Every tier’s front end runs this before the program runs, so each refuses the call in the same words, whether or not the call is ever reached. ## logicaffeine_cli::analysis::liveness - [struct FunctionLiveness](https://docs.logicaffeine.com/logicaffeine_cli/analysis/liveness/struct.FunctionLiveness): Per-function liveness table. - [struct LivenessResult](https://docs.logicaffeine.com/logicaffeine_cli/analysis/liveness/struct.LivenessResult): Liveness analysis result for a whole program. - [fn stmt_key](https://docs.logicaffeine.com/logicaffeine_cli/analysis/liveness/fn.stmt_key): The key a statement’s liveness is recorded under: its address in the arena the analysis walked. ## logicaffeine_cli::analysis::ownership Native ownership analysis for use-after-move detection. - [struct OwnershipChecker](https://docs.logicaffeine.com/logicaffeine_cli/analysis/ownership/struct.OwnershipChecker): Ownership checker - tracks variable states through control flow - [struct OwnershipError](https://docs.logicaffeine.com/logicaffeine_cli/analysis/ownership/struct.OwnershipError): Error type for ownership violations - [struct OwnershipFinding](https://docs.logicaffeine.com/logicaffeine_cli/analysis/ownership/struct.OwnershipFinding): One ownership finding with its statement coordinates: the top-level statement that ERRED, and (when known) the one that CAUSED it by moving the variable — both map 1:1 onto `Parser::stmt_spans()` — plus the exact statements, nested ones included, for `Parser::nested_stmt_spans()`: `trail` is the erring statement and each one around it, innermost first, and `cause` is the statement that gave the value away. - [enum MaybeGivenIn](https://docs.logicaffeine.com/logicaffeine_cli/analysis/ownership/enum.MaybeGivenIn): Where a value may have been given away: the construct whose paths disagree about it. - [enum OwnershipErrorKind](https://docs.logicaffeine.com/logicaffeine_cli/analysis/ownership/enum.OwnershipErrorKind) - [enum VarState](https://docs.logicaffeine.com/logicaffeine_cli/analysis/ownership/enum.VarState): Ownership state for a variable ## logicaffeine_cli::analysis::pipes Which function parameters carry a pipe. - [fn declare_pipe_params](https://docs.logicaffeine.com/logicaffeine_cli/analysis/pipes/fn.declare_pipe_params): The program with every pipe parameter declared as one: `ch: Real` a pipe parameter becomes `ch: Pipe of Real`, so each site that types a parameter by its declaration sees the pipe. - [fn pipe_params](https://docs.logicaffeine.com/logicaffeine_cli/analysis/pipes/fn.pipe_params): The positions of each function’s pipe parameters; a function with none is absent. ## logicaffeine_cli::analysis::policy - [struct CapabilityDef](https://docs.logicaffeine.com/logicaffeine_cli/analysis/policy/struct.CapabilityDef): A capability definition: `A User can publish the Document if...` - [struct PolicyRegistry](https://docs.logicaffeine.com/logicaffeine_cli/analysis/policy/struct.PolicyRegistry): Registry for security policies defined in `## Policy` blocks. - [struct PredicateDef](https://docs.logicaffeine.com/logicaffeine_cli/analysis/policy/struct.PredicateDef): A predicate definition: `A User is admin if the user's role equals "admin".` - [enum PolicyCondition](https://docs.logicaffeine.com/logicaffeine_cli/analysis/policy/enum.PolicyCondition): Condition in a policy definition. Represents the predicate logic for security rules. ## logicaffeine_cli::analysis::readonly - [struct MutableBorrowParams](https://docs.logicaffeine.com/logicaffeine_cli/analysis/readonly/struct.MutableBorrowParams): Mutable borrow parameter analysis result. - [struct ReadonlyParams](https://docs.logicaffeine.com/logicaffeine_cli/analysis/readonly/struct.ReadonlyParams): Readonly parameter analysis result. ## logicaffeine_cli::analysis::registry - [struct FieldDef](https://docs.logicaffeine.com/logicaffeine_cli/analysis/registry/struct.FieldDef): Field definition within a struct - [struct TypeRegistry](https://docs.logicaffeine.com/logicaffeine_cli/analysis/registry/struct.TypeRegistry) - [struct VariantDef](https://docs.logicaffeine.com/logicaffeine_cli/analysis/registry/struct.VariantDef): Phase 33: Variant definition for sum types - [enum FieldType](https://docs.logicaffeine.com/logicaffeine_cli/analysis/registry/enum.FieldType): Type reference for struct fields (avoids circular deps with ast::TypeExpr) - [enum TypeDef](https://docs.logicaffeine.com/logicaffeine_cli/analysis/registry/enum.TypeDef) - [const BUILTIN_STRUCT_NAMES](https://docs.logicaffeine.com/logicaffeine_cli/analysis/registry/constant.BUILTIN_STRUCT_NAMES): The structs the compiler hands to author code fully formed, rather than one an `## An X has:` declaration writes — the one list `TypeRegistry::with_primitives` registers them from and `TypeRegistry::is_builtin_struct` answers against, so a consumer never has to know their names itself. `crates/logicaffeine_compile/src/vm/wasm/kind.rs`’s `builtin_struct_types()` carries the same two shapes for the wasm backend’s own boundary-type resolution. - [fn builtin_generic_param_count](https://docs.logicaffeine.com/logicaffeine_cli/analysis/registry/fn.builtin_generic_param_count): How many type parameters a BUILT-IN generic takes — the one table the whole compiler asks. ## logicaffeine_cli::analysis::relay Whether a program’s pages talk to the relay — and so whether the backend serving them answers `/_relay` itself. - [fn component_uses_the_relay](https://docs.logicaffeine.com/logicaffeine_cli/analysis/relay/fn.component_uses_the_relay): Whether one declared page, component or store talks to the relay (see `pages_use_the_relay`). - [fn pages_use_the_relay](https://docs.logicaffeine.com/logicaffeine_cli/analysis/relay/fn.pages_use_the_relay): Whether any page, component or store this program declares talks to the relay: a `## Store … shared on`, a `When a message arrives on …` handler, or a `Publish … on …` in any action or handler, at any depth. - [fn source_uses_the_relay](https://docs.logicaffeine.com/logicaffeine_cli/analysis/relay/fn.source_uses_the_relay): `pages_use_the_relay` for a program’s source — a page file a site bundles. A source that does not parse uses nothing (its build refuses it on its own terms). ## logicaffeine_cli::analysis::tower Which values of a program the exact extension reaches: the bindings, function results and parameters that can hold an infinitesimal, a hyperreal, an infinite integer, an algebraic number, a computable real, an ordinal, a residue-dependent value or a provisional answer. - [struct TowerTypes](https://docs.logicaffeine.com/logicaffeine_cli/analysis/tower/struct.TowerTypes): The reached bindings, results and parameters of a program. - [type Scope](https://docs.logicaffeine.com/logicaffeine_cli/analysis/tower/type.Scope): Where a name lives: a function’s body, or the program’s root (`None`). ## logicaffeine_cli::analysis::types Type inference pass for the LOGOS compilation pipeline. - [struct FnSig](https://docs.logicaffeine.com/logicaffeine_cli/analysis/types/struct.FnSig): Function signature for tracked functions. - [struct RustNames](https://docs.logicaffeine.com/logicaffeine_cli/analysis/types/struct.RustNames): Centralized name resolution for Rust identifier output. - [struct TypeEnv](https://docs.logicaffeine.com/logicaffeine_cli/analysis/types/struct.TypeEnv): Type environment built by a forward pass over the AST. - [enum LogosType](https://docs.logicaffeine.com/logicaffeine_cli/analysis/types/enum.LogosType): Structured type representation for LOGOS values. ## logicaffeine_cli::analysis::unify Unification engine for the bidirectional type checker. - [struct TyVar](https://docs.logicaffeine.com/logicaffeine_cli/analysis/unify/struct.TyVar): A type variable used during inference. - [struct TypeScheme](https://docs.logicaffeine.com/logicaffeine_cli/analysis/unify/struct.TypeScheme): A quantified polymorphic type. - [struct TypeScope](https://docs.logicaffeine.com/logicaffeine_cli/analysis/unify/struct.TypeScope): Where the names in a written type are looked up while converting it: the program’s registry (so a user struct or enum is a `UserDefined`, not `Unknown`) and the type parameters in scope, each standing for the type it is currently bound to. - [struct UnificationTable](https://docs.logicaffeine.com/logicaffeine_cli/analysis/unify/struct.UnificationTable): Union-Find table implementing Robinson unification with occurs check. - [enum InferType](https://docs.logicaffeine.com/logicaffeine_cli/analysis/unify/enum.InferType): Inference-time type representation. - [enum TypeError](https://docs.logicaffeine.com/logicaffeine_cli/analysis/unify/enum.TypeError): A type error detected during unification or checking. - [fn infer_to_logos](https://docs.logicaffeine.com/logicaffeine_cli/analysis/unify/fn.infer_to_logos): Convert a zonked `InferType` to `LogosType`. - [fn unify_numeric](https://docs.logicaffeine.com/logicaffeine_cli/analysis/unify/fn.unify_numeric): Numeric promotion: Float wins; Int + Int = Int; Nat + Nat = Nat; Byte + Byte = Byte; Byte + Int (literal context) = Byte; otherwise error. ## logicaffeine_cli::browser A real browser as a page tier: headless Chrome, driven over the DevTools protocol. - [struct Answer](https://docs.logicaffeine.com/logicaffeine_cli/browser/struct.Answer): An answer for a request the page may make: `method path` answered with `status`, a `content-type` and `body`. `path` is relative to the page’s origin (`/api/todo`) or a full URL for another origin. - [struct Browser](https://docs.logicaffeine.com/logicaffeine_cli/browser/struct.Browser): A running headless Chrome. - [struct ChromeLauncher](https://docs.logicaffeine.com/logicaffeine_cli/browser/struct.ChromeLauncher): Launches a page in the shared, process-wide Chrome for one scenario, as its project serves it: the project’s `static/` files beside the page and its stylesheets linked from the document’s head, by the rule `largo serve` applies (`serve_web::stylesheet_links_for`). A page’s layout is its stylesheet’s as much as its markup’s — which element a click lands on depends on it — so a page tested bare is not the page a visitor gets. A launcher with no project serves the page alone. - [struct ConsoleLine](https://docs.logicaffeine.com/logicaffeine_cli/browser/struct.ConsoleLine): One console message the page logged. - [struct DomCounters](https://docs.logicaffeine.com/logicaffeine_cli/browser/struct.DomCounters): The renderer’s live object counts after a full garbage collection. - [struct HostCall](https://docs.logicaffeine.com/logicaffeine_cli/browser/struct.HostCall): One call across the host boundary, as the recorder saw it. Arguments and results are the decimal form of the raw wasm values (a Text argument is its handle). - [struct OpenOptions](https://docs.logicaffeine.com/logicaffeine_cli/browser/struct.OpenOptions): Setup applied before the page’s own scripts run. - [struct Page](https://docs.logicaffeine.com/logicaffeine_cli/browser/struct.Page): An open page. Closed, with its browser context, when dropped. - [struct PageBundle](https://docs.logicaffeine.com/logicaffeine_cli/browser/struct.PageBundle): A built page: files by URL path, and the path the browser opens. - [struct PageRequest](https://docs.logicaffeine.com/logicaffeine_cli/browser/struct.PageRequest): One request in the page’s own request table, as the page asked for it at the host boundary: its method, URL, body and headers as the page wrote them, and the timeout and abort it later asked for. - [struct RelayHub](https://docs.logicaffeine.com/logicaffeine_cli/browser/struct.RelayHub): A relay the pages of one test share: every page opened with it publishes into it and hears what the others publish. - [struct Snapshot](https://docs.logicaffeine.com/logicaffeine_cli/browser/struct.Snapshot): The page at one moment, as the browser holds it. - [enum BrowserError](https://docs.logicaffeine.com/logicaffeine_cli/browser/enum.BrowserError): Why a browser operation failed. - [enum CallKind](https://docs.logicaffeine.com/logicaffeine_cli/browser/enum.CallKind): Which way a traced call crossed the host boundary. - [enum DomNode](https://docs.logicaffeine.com/logicaffeine_cli/browser/enum.DomNode): One node of a snapshot document. An element carries its attributes sorted by name, and the two control PROPERTIES a visitor moves — `value` and `checked` — only where they differ from what the markup alone says (an untouched `` has no `value` entry; a typed-into one does). - [fn locate_chrome](https://docs.logicaffeine.com/logicaffeine_cli/browser/fn.locate_chrome): The Chrome (or Chromium) binary this machine has: `CHROME_BIN` when it names a file, otherwise the first of the usual names found on `PATH`. - [fn shared](https://docs.logicaffeine.com/logicaffeine_cli/browser/fn.shared): The one browser this process shares, launched from `chrome` on first use. ## logicaffeine_cli::cli LOGOS CLI (largo) — argument parsing and dispatch. - [struct Cli](https://docs.logicaffeine.com/logicaffeine_cli/cli/struct.Cli) - [enum Commands](https://docs.logicaffeine.com/logicaffeine_cli/cli/enum.Commands): Available CLI subcommands. - [enum RunEngine](https://docs.logicaffeine.com/logicaffeine_cli/cli/enum.RunEngine): The execution tier selected by `largo run --interpret`. - [fn run_cli](https://docs.logicaffeine.com/logicaffeine_cli/cli/fn.run_cli): Parse CLI arguments and execute the corresponding command. ## logicaffeine_cli::compile LOGOS Compilation Pipeline for CLI - [struct AotModule](https://docs.logicaffeine.com/logicaffeine_cli/compile/struct.AotModule): A compiled AOT-native module (HOTSWAP §Axis-3): the cdylib Rust SOURCE plus the exact exported `symbol` to resolve and its `arity` — everything the loader needs. - [struct CheckArtifacts](https://docs.logicaffeine.com/logicaffeine_cli/compile/struct.CheckArtifacts): Compile LOGOS source and write output to a directory as a Cargo project. - [struct CompileOutput](https://docs.logicaffeine.com/logicaffeine_cli/compile/struct.CompileOutput): Full compilation output including generated Rust code and extracted dependencies. - [struct CrateDependency](https://docs.logicaffeine.com/logicaffeine_cli/compile/struct.CrateDependency): A declared external crate dependency from a `## Requires` block. - [struct EngineOutcome](https://docs.logicaffeine.com/logicaffeine_cli/compile/struct.EngineOutcome): The outcome of a STRICT engine run. `engine_ran` is the honest identity: `Some(engine)` means that engine — and only that engine — executed the program; `None` means NOTHING ran (a parse failure, or the typed refusal of an engine that cannot run the program) and `error` says why. A strict run never silently substitutes the tree-walker for the VM. - [struct GenuineProjectionResult](https://docs.logicaffeine.com/logicaffeine_cli/compile/struct.GenuineProjectionResult): Result of a genuine Futamura projection via self-application. Contains the LOGOS source of the residual and the discovered entry points. - [struct RduArtifact](https://docs.logicaffeine.com/logicaffeine_cli/compile/struct.RduArtifact): What `largo emit rdu` writes: the `logos.spatial.neutral` v2 envelope, the placement text, the certificate (rechecked against the program, carrying the envelope’s digest), the MODELED report naming the lane, and — when the lane produced one — the Spatial source. - [struct RduBundle](https://docs.logicaffeine.com/logicaffeine_cli/compile/struct.RduBundle): A streamed model bundle’s manifest, the model constants it binds from files no checkpoint holds — each at the path the manifest binds it at, relative to the bundle — which are written with it, and the LOGOS text of the whole cut of the model’s one program the bundle deploys (`program.lg`), which the manifest’s `program` line identifies. - [struct RduModel](https://docs.logicaffeine.com/logicaffeine_cli/compile/struct.RduModel): A model the RDU bundle is compiled from: its spec, the name the manifest gives it, which of the weights the author declares Q8_0 its checkpoint stores Q8_0, and the per-frequency factors of a rotation that reads them (`rope_freqs.weight`). - [struct RduProgramFiles](https://docs.logicaffeine.com/logicaffeine_cli/compile/struct.RduProgramFiles): One lowered program of a streamed model bundle, rendered to the files a bundle directory holds. - [struct RunOutcome](https://docs.logicaffeine.com/logicaffeine_cli/compile/struct.RunOutcome): What a program run produced: every output line emitted before completion or failure, plus the error if it failed. The differential contract is `vm_outcome(src) == tw_outcome(src)` — output AND error. - [struct StepShape](https://docs.logicaffeine.com/logicaffeine_cli/compile/struct.StepShape): A step deployment’s shape: a KV cache of `ctx` positions per sequence, `batch` sequences per step, over `tp` chips of tensor parallelism — and, with `prefill: Some(chunk)`, a step that PREFILLS `chunk` tokens of one sequence (their hidden states stacked, the sequence’s state taken row by row: the model’s prefill cut) instead of decoding one token per sequence. - [enum Backend](https://docs.logicaffeine.com/logicaffeine_cli/compile/enum.Backend): A backend that lowers compiled bytecode WITHOUT the Rust runtime — the tiers `refuse_unlinkable` gates. What each one lowers is answered per construct against this type (see `crate::semantics::crdt::CrdtKind::lowered_by`), so adding a backend fails to compile until every such table classifies it. - [enum CompileError](https://docs.logicaffeine.com/logicaffeine_cli/compile/enum.CompileError): Errors that can occur during the LOGOS compilation pipeline. - [enum EngineId](https://docs.logicaffeine.com/logicaffeine_cli/compile/enum.EngineId): Which engine actually executed a strict run — the identity a caller can trust, because the strict entries never substitute one engine for another. - [enum ProjectScopeError](https://docs.logicaffeine.com/logicaffeine_cli/compile/enum.ProjectScopeError): Why a project fails `enforce_project_scope_with_deps`. - [enum RduLane](https://docs.logicaffeine.com/logicaffeine_cli/compile/enum.RduLane): Which lane a program takes — a function of its shape, printed by `largo emit rdu` as `lane: `. - [enum RuntimeCrateSource](https://docs.logicaffeine.com/logicaffeine_cli/compile/enum.RuntimeCrateSource): How a generated project resolves the `logicaffeine` runtime crates. - [enum TierVerdict](https://docs.logicaffeine.com/logicaffeine_cli/compile/enum.TierVerdict): The verdict of a cross-tier differential run (Wave 13, footgun F18). Program output must be byte-identical across every execution tier; a divergence is ALWAYS a compiler bug — the framework’s liability, never the user’s mistake — and carries a filed-ready reproduction bundle. - [const FIRST_CLASS_VALUE_KINDS](https://docs.logicaffeine.com/logicaffeine_cli/compile/constant.FIRST_CLASS_VALUE_KINDS): The CANONICAL set of value kinds that must be FIRST-CLASS as a function parameter AND return value on EVERY execution tier — the single source of truth SHARED across crates so the coverage locks cannot drift apart. The tests crate’s `param_return_tier_coverage_lock` asserts its PROBES name EXACTLY this set (executed on TW/VM/AOT-C/AOT-Rust, lowered on WASM), and this crate’s `wasm_aot_lock::first_class_param_return_round_trips_on_wasm` asserts it has an EXECUTABLE WASM program for every kind here. Adding a kind here makes BOTH locks RED until each covers it — anti-drift by construction, compiler-enforced (both crates reference this one `const`). Keep alphabetically grouped scalars → sequences → collections → aggregates for readability; order is not significant (compared as a set). - [const RDU_EMIT_REPORT_SCHEMA](https://docs.logicaffeine.com/logicaffeine_cli/compile/constant.RDU_EMIT_REPORT_SCHEMA) - [const RDU_STREAMED_MANIFEST_SCHEMA](https://docs.logicaffeine.com/logicaffeine_cli/compile/constant.RDU_STREAMED_MANIFEST_SCHEMA) - [fn aot_build_function](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.aot_build_function): On-demand AOT-native build + load (HOTSWAP §Axis-3): compile `fn_name` (and its callees) to an optimized cdylib (cached), `dlopen` it, and return the loaded `crate::vm::NativeFn` ready to install via `Vm::install_aot_native`. `None` if the function is absent / outside the scalar subset / the build or load failed — the caller keeps it on VM+JIT. Blocking (runs `rustc`); the background worker (`BgAotCompiler`) calls this off the interpreter thread. - [fn aot_cache_key](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.aot_cache_key): The cache key for an AOT-native artifact (HOTSWAP §Axis-3 / P16): a deterministic FNV-1a hash of the rustc toolchain version AND the optimized Rust source. The toolchain is in the key because Rust has no stable cross-version ABI — a different `rustc`/runtime yields a different key, so a stale, ABI-mismatched `.so` is NEVER reused (soundness over convenience). The source captures the function, its callees, and the optimization config (it IS the codegen output). - [fn aot_load_bundle](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.aot_load_bundle): Load every `native`-annotated function in `source` as a compiled-native `crate::vm::NativeFn` (HOTSWAP §Axis-3): the run path installs these via `Vm::install_aot_native`, so an annotated function dispatches to `rustc -O3` machine code from its first call. Uses the persistent cache, so a bundle pre-built by `largo build --native-functions` is a cache hit — no `rustc` on the run path. A function outside the scalar subset / failing to build is skipped (stays on VM+JIT). - [fn build_native_bundle](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.build_native_bundle): Pre-build every `native`-annotated function in `source` into the AOT bundle under `bundle_dir` (HOTSWAP §Axis-3 / P16 — the “tools to bundle them”). Returns the `(function_name, cdylib_path)` manifest. Functions outside the sound scalar subset are silently skipped — they keep running on VM+JIT, no gap at the seam. `Err` only on a genuine parse/type error. - [fn build_native_cdylib](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.build_native_cdylib): Build AOT-native cdylib Rust source (from `compile_function_to_native_rust`) into a loadable `cdylib` (HOTSWAP §Axis-3 / P16). Generates a minimal crate under `work_dir/`, copies the shared runtime crates (so the `.so` and the interpreter share the SAME `logicaffeine_data` ABI), and runs `cargo build --release`. Returns the path to the produced dynamic library. `panic = "unwind"` (the default) — NOT `abort` — so a panic in a loaded function can be contained rather than killing the host process. - [fn build_native_cdylib_cached](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.build_native_cdylib_cached): `build_native_cdylib` with a persistent cache (HOTSWAP §Axis-3 / P16). The artifact lives at `cache_dir/aot__/…` keyed by `aot_cache_key`; an identical function reuses its `.so` across runs (no rebuild), and a toolchain change yields a new key so the stale library is never loaded. - [fn build_native_pe_binary](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.build_native_pe_binary): Build (once, content-addressed) the compile-once native PE binary and return its path. Keyed on the generated Rust of `pe_native_source` + toolchain, so the one-time rustc compile of the whole PE engine happens exactly once per PE version and is reused across every program and session. This is the amortization that turns AOT from “recompile per program” into the 210x win. - [fn build_native_pe_cdylib](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.build_native_pe_cdylib): Build (and cache) the PE compiled as an IN-PROCESS cdylib exporting `logos_pe_specialize`. Mirrors `build_native_pe_binary` but emits a `cdylib` whose `lib.rs` is the generated PE engine (`pe_cdylib_source`) plus a hand-written `extern "C"` shim (`PE_CDYLIB_SHIM`) that decodes the wire `CProgram` and calls `peSpecializeOnce` directly — so the caller loads it once and specializes with a plain function call, no process, no pipe. Content-addressed on the (stable) cdylib PE source + shim + toolchain, so warm calls skip rustc. - [fn build_native_wasm](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.build_native_wasm): Build a function’s AOT module to a browser-loadable `wasm32-unknown-unknown` cdylib (HOTSWAP §Axis-3 / P17 — the browser analog of `build_native_cdylib`). The module is the same scalar-ABI shim; the wasm crate keeps `logicaffeine-data` + `logicaffeine-system` (both wasm-ready) but drops the desktop-only `tokio`, the `logicaffeine-system` `full` feature, and `target-cpu=native`. Returns the `.wasm` path; the browser then `WebAssembly.instantiate`s it and the entry calls into it through the warm-bytecode indirection. Requires the `wasm32-unknown-unknown` target. - [fn classify_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.classify_source): Classify the determinacy of a LOGOS program. - [fn compile_and_run](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_and_run): Compile and run a LOGOS program end-to-end. - [fn compile_file](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_file): Compile a LOGOS source file. For single-file compilation without dependencies. - [fn compile_function_to_native_rust](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_function_to_native_rust): Generate the Rust SOURCE for an AOT-native cdylib of ONE function (HOTSWAP §Axis-3 / P14b): the `target` function plus its transitive callees (`crate::codegen::function_slice`), emitted through the normal ARCHITECT codegen, with the `crate::codegen::codegen_native_tier_export` shim appended so the loader can resolve the `logos_native_` symbol. Mirrors `compile_program_full`’s front-end, then slices before codegen. - [fn compile_model_to_rdu_streamed](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_model_to_rdu_streamed): Lower a model to the RDU as the chip would run it: ONE program per layer kind plus the head, each lowered, certified and handed to `sink` in turn, and a manifest binding every layer to its kind. Returns the manifest JSON and the model constants the bundle ships: a decode deployment’s rotary caches (`{weights_dir}/Rcos.f`, `{weights_dir}/Rsin.f`, one pair per rotation the layers turn by — `rope_tables` at `ctx` positions, little-endian f32), which every step reads at its positions so the host hands in only tokens and positions. - [fn compile_program_backend_traced](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_program_backend_traced): Compile the Rust AOT backend with stage-separated optimization evidence. The ordinary compile path is unchanged; tracing only observes existing `mark_fired` sites and classifies them as shared optimizer vs Rust lowering. - [fn compile_program_full](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_program_full): Compile LOGOS source and return full output including dependency metadata. - [fn compile_program_full_deterministic](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_program_full_deterministic): `compile_program_full` for deterministic replay — the full output (rust + dependencies) with every scheduler operation lowered onto `logicaffeine_system::replay`. The seeded differential harness uses this so it gets the same dependency set as the default build. - [fn compile_program_full_with_proven](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_program_full_with_proven): Like `compile_program_full`, but bundles an extracted math/logic module (`proven`) into the generated Rust — the imperative half of a mixed document. The module is emitted as `pub mod proven { … } use proven::*;` so the imperative program can call its functions / `check_*` predicates by name. `None` (or a blank module) yields output byte-identical to `compile_program_full`. - [fn compile_program_full_with_wire](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_program_full_with_wire): Like `compile_program_full`, but every emitted (non-generic) `enum` also gets `WireEncode`/`WireDecode` impls over the shared `logicaffeine_data::wire` codec — byte-identical to the peer codec’s `encode_value_raw`. This lets a compile-once native partial evaluator receive a program AST as data over the same fast codec the interpreter uses. Ordinary compiles (the default) are byte-unchanged. - [fn compile_program_traced](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_program_traced): Compile `source` while recording which optimizations actually FIRED — the honest, single-compile alternative to `optimizations_used`’s O(N) diff. An optimization is “fired” when it actually changed the program or emitted its optimized form for this compile, under the effective (normalized) config. Reusable: any caller can compile a program and learn what fired, for tracing and tooling. - [fn compile_project](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_project): Compile a multi-file LOGOS project with dependency resolution. - [fn compile_project_with_deps](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_project_with_deps): `compile_project`, additionally linking the declared dependency roots (see `assemble_project_with_deps`). `dep_roots` empty is byte-for-byte identical to `compile_project`. - [fn compile_to_analog](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_analog): Compile to a mixed-signal analog artifact — the LOGOS → analog spatial fabric tier (`crate::codegen_ana`). Scans the Oracle-optimized bytecode through the fail-closed `crate::codegen_ana::analog_refusal` gate FIRST: concurrency/networking, a program with no float dataflow, or float inputs without declared ranges each get a NAMED `analog backend:` refusal — a correct artifact or a typed refusal, never a silently-wrong circuit. - [fn compile_to_c](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_c): Compile LOGOS source to C code. - [fn compile_to_c_stepped](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_c_stepped): `compile_to_c` with the program’s tasks as step functions over heap frames — the stepped tier, the one a GPU thread can run and the host walker runs — instead of coroutines on stacks of their own. - [fn compile_to_c_stepped_with_knobs](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_c_stepped_with_knobs): `compile_to_c_stepped` under an explicit `SchedulerKnobs`: the scheduler’s policy, workers, seed and default pipe capacity, as `#define`s its scheduler reads. - [fn compile_to_c_traced](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_c_traced): Direct AST→C compilation with stage-separated optimization evidence. The refusal probe runs before tracing so VM-only probe work cannot be misreported as a C optimization. - [fn compile_to_c_via_bytecode](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_c_via_bytecode): ★ Phase 1 — compile to C by lowering the bytecode `CompiledProgram` directly (the `codegen_c::from_program` Op-walker), the bytecode-IR-as-source-of-truth path that REPLACES the AST-based `compile_to_c`. It lowers the OPTIMIZED IR (`compile_to_program_optimized`) — the SAME `optimize_program` the AST `compile_to_c` runs, honoring the LOGOS source’s `## No`/`## Require` opt decorators — so the whole AOT optimizer lattice (constant-fold, SCCP, egraph, LICM, deforest, supercompile, closed-form, bound_version) reaches the C. One pristine, optimal pipeline: source → (opt flags honored) optimized bytecode → Op-walker → C. Grown op-by-op behind `c_bytecode_lock`; returns a typed `Err` on any op not yet lowered (callers fall back to the AST emitter until the Op-walker covers the corpus). - [fn compile_to_c_via_bytecode_offloaded](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_c_via_bytecode_offloaded): The bytecode→C walker with an offload table: `offloads` chooses, from the optimized program and the interner that names its functions, the functions a device may answer (`crate::codegen_c::from_program::compile_program_to_c_offloaded`). An empty table is `compile_to_c_via_bytecode`. - [fn compile_to_c_via_bytecode_traced](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_c_via_bytecode_traced): Optimized-bytecode→C compilation with stage-separated optimization evidence. Fallbacks to the syntax-tree C tiers are recorded explicitly. - [fn compile_to_c_via_bytecode_with_knobs](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_c_via_bytecode_with_knobs): The bytecode→C walker with an explicit `SchedulerKnobs` for the concurrency path — the tunable deterministic scheduler (ready-queue `policy`, `workers`, `clock`, channel capacity, `seed`). A non-concurrency program ignores the knobs (its sequential C is knob-independent). The default-knob wrapper is `compile_to_c_via_bytecode`; a determinism lock drives this with each policy to prove the knob is a real, output-preserving tunable on the determinate corpus. - [fn compile_to_cuda](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_cuda): Compile to a single-file CUDA program — the LOGOS → CUDA AOT tier. Lifts the C tier’s program body (`compile_to_c`, byte-for-byte ≡ the VM) onto one GPU thread as `__device__` code, over a `printf`-based `Show` preamble, plus a host launcher. Uses the SAME Oracle-optimized bytecode to refuse anything outside the integer/bool scalar fragment (a GPU thread has no dynamic C runtime), returning a `Custom` `ParseError` — a sound refusal, never wrong code. Returns the emitted `crate::codegen_cuda::CudaArtifact`. - [fn compile_to_cuda_forward](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_cuda_forward): Recognize the ordered tensor-op stages of a MULTI-STAGE forward and lower it to ONE CUDA program that chains their parallel kernels through shared device buffers — the whole-forward orchestrator (`crate::codegen_cuda::qwen_emit`). Where `compile_to_cuda_tensor_op` emits ONE op’s kernel, this composes a sequence (`rmsnorm → matmul → softmax → …`). Refuses (typed) if no stage is recognized. - [fn compile_to_cuda_forward_holding](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_cuda_forward_holding): The older forward of `source` at `kind`’s numerics with the optimizer’s steps `held` held back: each kernel it would fuse emitted apart, the program the fused one is held equal to. - [fn compile_to_cuda_forward_q8](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_cuda_forward_q8): `compile_to_cuda_forward_weighted` with an INT8 (Q8_0) weight manifest: any tensor variable named in `q8` is loaded resident as int8 quants + f32 block scales, and a matmul against it becomes a dequant-in-kernel GEMV. This is what fits real 8B weights on a 12 GB card (8 GB int8, not 32 GB f32) and the DP4A path that beats llama.cpp — see `crate::codegen_cuda::qwen_emit::Q8Ref`. - [fn compile_to_cuda_forward_q8_dp4a](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_cuda_forward_q8_dp4a): `compile_to_cuda_forward_q8` emitting the INT8-activation DP4A MMQ kernel for each Q8 matmul: the activation is quantized to int8 per 32-block and `__dp4a`’d against the int8 weight (int32 accumulate) — the same kernel shape llama.cpp’s fast path uses, and the shipped batch-1 default. Numerically the int8-activation approximation of the dequant GEMV (small quantization error), not bit-identical; the `TwoPassInt8` mode recovers ~14-bit activation exactness at two `__dp4a` per block. - [fn compile_to_cuda_forward_q8_moe](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_cuda_forward_q8_moe): `compile_to_cuda_forward_q8` with a MoE weight manifest: any `moe` op in the source lowers to grouped-expert CUDA (router GEMV → top-K route → per-expert SwiGLU → weighted combine), its router/gate/up/ down weights loaded int8-resident from the files named in `moe` (keyed by the block’s output variable). This is the Qwen3-30B-A3B FFN — the SAME emitter as the dense 8B forward, plus the MoE stage. - [fn compile_to_cuda_forward_q8_moe_dp4a](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_cuda_forward_q8_moe_dp4a): `compile_to_cuda_forward_q8_moe` emitting the sparse top-K, deeply-fused, coalesced int8-activation MoE path — THE SHIPPED DEFAULT: only the K selected experts’ weights are gathered per token (the “A3B = 3B active” sparsity), and the FFN collapses to three kernels — router+topk, gate+up+SwiGLU fused, down+combine fused — so every intermediate stays off HBM. One `__dp4a` per 32-block (single-pass int8 activation) is the shortest dependency chain, the fastest batch-1 path at llama.cpp-matched activation precision (the A100 head-to-head beat: identical greedy token, more tok/s). For logits within ~1e-3 of the f64 reference — the correctness mode llama.cpp does not have — use `compile_to_cuda_forward_q8_moe_exact`. - [fn compile_to_cuda_forward_q8_moe_exact](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_cuda_forward_q8_moe_exact): `compile_to_cuda_forward_q8_moe_dp4a`’s LOGIT-EXACT sibling: the same sparse top-K deeply-fused kernel shape, but the activation is quantized TWO-PASS (hi byte + lo residual byte ⇒ ~14-bit) and every block runs two `__dp4a` (hi and lo) — ~2× the activation math for logits within ~1e-3 of the f64 reference, so a near-tie greedy token does NOT flip (single int8 activation flips it — llama.cpp included). Weights are still read once, so the memory-bound cost is unchanged; the measured price of exactness is ~6% tok/s. - [fn compile_to_cuda_forward_weighted](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_cuda_forward_weighted): `compile_to_cuda_forward` with a WEIGHT MANIFEST: `var name → (file path, float count)`. Any tensor variable named in the manifest is loaded from that file by the emitted host at runtime instead of being inlined — the mechanism the real-8B forward needs, since the Qwen weights are gigabytes (extracted from the GGUF checkpoint). Every other input still uses its literal `Set` values / the deterministic fill. - [fn compile_to_cuda_gemm](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_cuda_gemm): Emit an int8 weight-stationary GEMM CUDA program for `O(m×n) = A(m×k)·W(k×n)` — the DP4A kernel path of the CUDA tier. Uses a deterministic int8 sample (`crate::codegen_cuda::sample_gemm_data`) baked into the `.cu`; its numerics are anchored to the certified `eval_systolic` reference by `cuda_matrix_lock`. Refuses (typed) if the RDU-shaped target lacks int8 weight-stationary GEMM. - [fn compile_to_cuda_matmul](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_cuda_matmul): Genuinely LOWER an ordinary LOGOS matmul program to an optimized CUDA GEMM kernel — the CUDA analog of `compile_to_tenstorrent_matmul`. Recognizes the GEMM idiom with the SAME backend-agnostic `crate::tensor_recognize::recognize_matmul`, extracts `(M,N,K)` from the source, and emits a CUDA program whose dims are the program’s (a function of the source, not a canned template); a non-matmul is REFUSED (typed). Returns the recognized `(spec, kernel_cu)`; the emitted program’s checksum equals the VM’s `Show` byte-for-byte. - [fn compile_to_cuda_matmul_with](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_cuda_matmul_with): Knob-driven counterpart of `compile_to_cuda_matmul` — recognize the matmul, then lower it under an explicit `crate::codegen_cuda::knobs::CudaKnobs` point in the optimization lattice (e.g. the `Int8Dp4a` precision fast path). This is the user-facing surface the CLI/API drive to select a trade-off; a non-matmul is refused (typed) regardless of the knobs. - [fn compile_to_cuda_tensor_op](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_cuda_tensor_op): Recognize ANY supported tensor op — `matmul` OR elementwise (`plus`/`hadamard`) — in a LOGOS program and lower it to CUDA. The unified accelerator entrypoint: tries the GEMM idiom first, then the elementwise idiom, and REFUSES (typed) only if neither is present. This is what closes the tensor-op × backend matrix to zero gaps on the CUDA cell. - [fn compile_to_dir](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_dir) - [fn compile_to_isa](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_isa): Compile LOGOS source DIRECTLY to a self-contained WebAssembly module — no rustc, no cargo, no wasm-bindgen, no toolchain. Uses the SAME front-end as `vm_outcome` (`crate::ui_bridge::with_parsed_program` → `crate::vm::Compiler::compile_with_types`), so the emitted module runs the IDENTICAL bytecode the VM does; the AOT WebAssembly backend then lowers the whole program to `.wasm`. - [fn compile_to_plasticine](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_plasticine): Compile to the Plasticine target — the open RDU (Prabhakar et al., ISCA 2017), the LOGOS → Plasticine lane. The region unit is the FIRST function, which must be a counted range loop (Spatial `Foreach` over `lo..=hi`): it is lowered through the certified `crate::codegen_sva::fabric_rtl::LoopFabric`, modeled as one metapipeline stage under Spatial’s II definition, placed on the ISCA’17 checkerboard, anchored to the VM at sample inputs, SAT-certified when its body is ALU-only, and emitted as Spatial source. Any other shape gets a NAMED `plasticine backend:` refusal — an artifact or a typed refusal, never a wrong model. - [fn compile_to_program](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_program): ★ THE CANONICAL `source → CompiledProgram` PATH ★ — the single bytecode-IR entry every backend and every invariant lock reuses (no drift). This is the RAW-AST lowering (Oracle-analyzed, but WITHOUT the AOT `optimize_program` lattice) — identical to what `vm_outcome`/`compile_to_riscv`/`compile_to_wasm` compile today, so `program_outcome(compile_to_program(src)) == vm_outcome(src)` by construction. The optimized variant (`optimize_program` applied → the finalized source-of-truth IR every backend will lower) is added with the optimizer-soundness lock; see the refactor plan. - [fn compile_to_program_optimized](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_program_optimized): ★ THE FINALIZED, OPTIMIZED SOURCE-OF-TRUTH IR ★ — `compile( optimize_program( resolve_divisions(AST) ) )`. This is the exact front-end `compile_to_c`/`compile_to_rust` run (prelude + `## No`/`## Require` decorators - [fn compile_to_program_optimized_named](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_program_optimized_named): `compile_to_program_optimized` with each function’s name, in function order: what a consumer that reports on functions by name (the accelerator region discovery) reads beside the program. - [fn compile_to_rdu](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_rdu): Compile to the SambaNova RDU — ONE front door, three lanes chosen by program shape: the tensor lane (a tensor program lifted through the spatial IR, placed on the chip’s descriptor and certified), the loop lane (a counted-range-loop function through the Plasticine metapipeline model on the RDU mesh descriptor), and the whole-program lane (any construct the fabric’s decision datapath covers, as `Scalar` stages). Every lane ends in the same certified neutral envelope, honestly SDK-gated for the vendor config bytes. A tensor program the chip cannot host is refused BY NAME on the tensor lane, never handed on; a program no lane hosts gets a `rdu backend:` refusal naming every lane’s verdict. - [fn compile_to_riscv](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_riscv): Compile to RV64GC assembly text — the LOGOS → RISC-V AOT tier. Lowers from the SAME Oracle-optimized bytecode the VM/WASM tiers use (so DivPow2 / bounds-elim forms match), then `crate::codegen_riscv::codegen_program_riscv` emits the assembly. A RISC-V GCC assembles+links it; `qemu-user` runs it byte-for-byte identical to the VM. Returns a `Custom` `ParseError` when the program uses an op/shape outside the currently-lowered fragment (a sound refusal, never wrong code). - [fn compile_to_rust](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_rust): Compile LOGOS source to Rust source code. - [fn compile_to_rust_checked](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_rust_checked): Compile LOGOS source to Rust with ownership checking enabled. - [fn compile_to_rust_deterministic](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_rust_deterministic): Compile for deterministic replay: identical to `compile_to_rust` for a program that never touches the scheduler; a program that does runs its tasks, pipes, timers and selects on `logicaffeine_system::replay`, the interpreter’s scheduler ported, so a binary run under `LOGOS_SEED=…` prints what the interpreter prints at that seed. Used by the seeded differential harness. - [fn compile_to_rust_observed](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_rust_observed): Compile to Rust in the OBSERVED profile (Wave 13): the emitted program EMITS observation events — `logicaffeine_system::obs::record`/`span_enter`/ `span_exit` calls for `Note`/`Warn`/`Record`/`During` — instead of eliding them. The default `compile_to_rust` stays the elided (release) profile, byte-identical to the observation-free program (§0.7). - [fn compile_to_rust_traced](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_rust_traced): One compile returning the generated Rust, the fired-optimization keywords, AND the `(winner, loser)` precedence decisions made — what an interactive viewer calls per toggle state to show the firing opts and the conflicts that occurred. - [fn compile_to_rust_with_proven](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_rust_with_proven): Compile imperative LOGOS to Rust with an extracted math/logic module bundled in. `proven` is a main-less Rust module body (the Forge’s extraction); it is emitted as `pub mod proven { … } use proven::*;` so the imperative program can call its functions / `check_*` predicates by name. See `compile_program_full_with_proven`. - [fn compile_to_sol_solution](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_sol_solution): Compile a LOGOS fused-row program straight into a SOL-ExecBench submission — recognize the op and emit the `solution.json` + torch-binding CUDA kernel the benchmark evaluates on the B200. `definition` is the problem’s Definition name; `inputs`/`output` are the tensor names in Definition order. This closes the loop from English LOGOS to a submittable, compiler-generated kernel. - [fn compile_to_tenstorrent](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_tenstorrent): Compile to a single-Tensix-core TT-Metalium program — the LOGOS → Tenstorrent AOT tier. The compute body is the C translation (`compile_to_c`, byte-for-byte ≡ the VM), wrapped by `crate::codegen_tt` as a data-movement kernel on one baby RISC-V core (`RISCV_0`) plus a host orchestrator. Uses the SAME Oracle-optimized bytecode to scan for ops outside the single-baby-core fragment — CONCURRENCY (channels/tasks/select need a `ucontext` scheduler; the mesh tier lowers those) — returning a `Custom` `ParseError`, a sound refusal, never wrong code. OFFLINE networking rides the newlib-clean C net runtime on-core. Returns the emitted `crate::codegen_tt::TtArtifact`. - [fn compile_to_tenstorrent_concurrency](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_tenstorrent_concurrency): Recognize a producer/consumer pipe program and lower its CONCURRENCY onto the Tensix mesh — the task on one baby RISC-V, main on the other, the pipe as a circular buffer. Returns the recognized spec + the complete 2-core program, or an error if the program is not the recognized pattern (the caller then falls back to the sound single-core refusal). The mesh output is ≡ the VM’s deterministic interleaving. - [fn compile_to_tenstorrent_dynamic](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_tenstorrent_dynamic): Recognize a dynamic-channel program (a loop-driven producer feeding the pipe with computed values) and lower it to a 2-core program: the producer loops pushing `f(i)` onto a bounded circular buffer; the consumer folds the stream. Order-deterministic FIFO ⇒ ≡VM. - [fn compile_to_tenstorrent_fanout](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_tenstorrent_fanout): Recognize a fan-out program (N distinct tasks each send one value into a shared pipe; main folds all N) and lower its concurrency onto the Tensix mesh — one core per task, main folding via a NoC + semaphore barrier. The commutative fold makes the mesh’s arrival order irrelevant, so it is ≡VM. Errors if the program is not the fan-out pattern (the caller falls back to the sound refusal). - [fn compile_to_tenstorrent_matmul](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_tenstorrent_matmul): Genuinely LOWER an ordinary LOGOS matmul program (a triple-loop `C[i][j] += A[i][k]*B[k][j]`) to a tiled Tensix matrix-engine compute kernel — the compiler recognizes the GEMM idiom (affine index analysis) and generates the kernel from the program’s dimensions, or REFUSES (typed) if the program is not a matmul. This is the honest counterpart to the hand-written template kernels: the kernel is a function of the source, not a canned string. Returns the recognized `(spec, kernel_cpp)`. - [fn compile_to_tenstorrent_multi_racy](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_tenstorrent_multi_racy): Recognize a multi-task race (≥2 tasks each sleep then send; main awaits receive-or-timeout) and lower it to a coordinator + N-task program. The coordinator collects every task’s `(value, send-vtime)`, picks the global-minimum send-vtime, and compares it to the timeout — the VM’s deterministic winner. ≡VM. - [fn compile_to_tenstorrent_racy_select](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_tenstorrent_racy_select): Recognize a racy select (a task sleeps then sends; main awaits a receive-or-timeout) and lower it to a coordinator + task program. The coordinator compares the reported send virtual-time against the timeout — the VM’s deterministic scheduler rule — so the outcome is ≡VM on both branches, independent of real hardware timing. - [fn compile_to_tenstorrent_select](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_tenstorrent_select): Recognize a select (`Await the first of { Receive … / After … }`) on a ready channel and lower it to a single-core program whose non-blocking readiness check reproduces the VM’s deterministic arm choice. - [fn compile_to_tenstorrent_tensor_op](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_tenstorrent_tensor_op): The Tenstorrent analog of `compile_to_cuda_tensor_op`: recognize `matmul` OR elementwise and lower to a Tensix compute kernel, refusing (typed) if neither is present. Closes the Tenstorrent cell of the matrix. - [fn compile_to_wasm](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_wasm) - [fn compile_to_wasm_checked](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_wasm_checked): `compile_to_wasm` as a check-mode module: the same program through the same pipeline, with the heap census exported (`crate::vm::wasm::assemble_program_checked`) for a heap test to read every true count back through. A shipped page never carries it. - [fn compile_to_wasm_linked](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_wasm_linked): Compile LOGOS source to a LINKED WebAssembly module that uses the real `logicaffeine_base::BigInt` runtime for arbitrary-precision integer arithmetic: an overflowing integer expression (`Show 99999999999 * 99999999999`, `Show 2 to the power of 200`) computes the EXACT big number — matching the VM’s promote-on-overflow — instead of trapping, and `Show` prints its decimal. - [fn compile_to_wasm_observed](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_wasm_observed): Compile to WebAssembly in the OBSERVED profile (Wave 13): `Note`/`Warn`/ `Record`/`During` lower to `Op::Obs`, which the WASM backend emits as calls to the host `obs(site_id)` import — the browser-tracing analog of the VM’s observation emission. Returns the module bytes AND the `observation_sites` table: the host (which compiled the program) resolves each `site_id` to its category / message / span kind. The default `compile_to_wasm` stays the elided profile, byte-identical to the observation-free program (§0.7). - [fn compile_to_wasm_relocatable](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_wasm_relocatable): The RELOCATABLE object `compile_to_wasm_linked` hands the linker: the program monomorphized, compiled with the optimizer’s oracle, peephole-coalesced, checked linkable, lowered by the BigInt-aware emitter (`crate::vm::wasm::assemble_program_linked`) and carried with its relocations — not yet linked, so a caller can link it against a runtime of its own. - [fn compile_to_wasm_with](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.compile_to_wasm_with): `compile_to_wasm` for a host that enters the module by name beyond `main`: the components a test mounts at a statement of its own (`crate::vm::reach::HostEntries`). A shipped page’s entries are the default, and its module is exactly the one `compile_to_wasm` writes. - [fn copy_runtime_crates](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.copy_runtime_crates): Copy the runtime crates to the output directory. Copies logicaffeine_data and logicaffeine_system. - [fn core_interp_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.core_interp_source): The self-interpreter (`coreEval` / `coreExecBlock`) as a first-class committed artifact — the Logos program the genuine P2/P3 projections specialize (Futamura: `pe(pe, coreEval)` is a compiler). Promoted out of the `phase_futamura` test fixture so it is a real source file, not a string constant; the fixture now `include_str!`s this exact file (parity is structural). - [fn core_types_for_pe_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.core_types_for_pe_source): The canonical inductive type catalog the Futamura projections are built on (`CStmt`/`CExpr`/`CVal`/…). Every statement the tree-walker executes has a `C…` constructor here; the partial-evaluator dialects dispatch on it. Exposed so cross-tier lock tests can prove this catalog and every tier stay in sync — a statement added to the language must appear here or it is dropped from the projections (see `tier_parity_lock.rs`). - [fn count_dispatch](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.count_dispatch): The Jones-optimality oracle: count the units of interpreter dispatch remaining in a residual program. - [fn decode_value_raw](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.decode_value_raw): Decode a value produced by `encode_value_raw` (or by an AOT-generated `wire_encode`) back into a `RuntimeValue`. `None` on any malformed or trailing-byte input. - [fn decompile_source_text](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.decompile_source_text) - [fn display_float_like_logos](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.display_float_like_logos): Format an `f64` exactly as a `Show` of a `Float` would — i.e. byte-identical to the tree-walker / VM (`RuntimeValue::to_display_string`). The direct-WASM host’s `print_f64` sink uses this so a `Show` of a float matches every other engine. Delegating to the real formatter (rather than re-deriving it) makes drift impossible. - [fn encode_program_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.encode_program_source): Encode a LOGOS program (given as source) into CProgram construction source. - [fn encode_program_source_compact](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.encode_program_source_compact): Compact encoding: inlines simple expressions (literals, variables) to reduce encoding size by ~3x. Same semantics as encode_program_source but produces fewer Let statements. - [fn encode_value_raw](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.encode_value_raw): Encode ONE value as the plain, self-describing recursive wire form — no envelope, no framing, no columnar/compression/dedup transforms. This is the exact format the shared `logicaffeine_data::wire` core decodes, so a `RuntimeValue` encoded here round-trips through an AOT-generated type’s `wire_decode` (and vice versa). The speed-first form used to hand a program AST to a compile-once native partial evaluator. - [fn enforce_project_scope](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.enforce_project_scope): Enforce per-file scoping for a project WITHOUT codegen. The interpreter and other lightweight tiers call this so transitive leakage is rejected uniformly with `largo build` — a program that fails scoping on one tier fails on all. Returns `Ok(())` when every reference stays within its file’s scope, else the clean scope-violation message. - [fn enforce_project_scope_with_deps](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.enforce_project_scope_with_deps): `enforce_project_scope`, additionally linking the declared dependency roots. `dep_roots` empty is identical to `enforce_project_scope`. - [fn finish_projection1_residual](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.finish_projection1_residual): The post-processing applied to a raw PE residual (the `Any`-type safety net + `## Main` normalization). - [fn first_parallel_block_independent](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.first_parallel_block_independent): Phase 0 test seam: is the first `Simultaneously:` / `Attempt all of the following:` block in `source` made of data-independent branches? `None` if the program contains no such block. - [fn genuine_p2_on_target_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.genuine_p2_on_target_source): The whole program `run_genuine_p2_on_target` runs, so a harness can run it on any backend. - [fn genuine_p3_on_target_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.genuine_p3_on_target_source): The whole program `run_genuine_p3_on_target` runs, so a harness can run it on any backend. - [fn genuine_projection2_residual](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.genuine_projection2_residual): Run genuine PE(pe_source, pe_mini(targetStmts)) and return the specialized compiler residual as LOGOS source code. - [fn genuine_projection3_residual](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.genuine_projection3_residual): Run genuine PE(pe_source, pe_bti(targetExpr)) and return the specialized cogen residual as LOGOS source code. - [fn implied_crate_deps](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.implied_crate_deps): The third-party crates the generated Rust names DIRECTLY (not through the runtime crates), each as its `[dependencies]` line: declared iff the code uses it, and never when a `## Requires` already brought it in (a duplicate key is a manifest error). The ONE list every generated manifest — the `largo build` project and the staged checking project — takes its implied dependencies from. - [fn interpret_bootstrap](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.interpret_bootstrap): `interpret_program` for one of the compiler’s own LOGOS programs — the partial evaluator, its dialects, the self-interpreter, a compiler a projection produced — inside the bootstrap scope (`with_reference_semantics`): those programs thread their state through `mutable` parameters and are written for the in-place writes of reference semantics. A user program never runs here. - [fn interpret_program](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.interpret_program): Interpret LOGOS source and return output as a string. - [fn native_export_function_names](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.native_export_function_names): The names of functions annotated for the AOT-native tier — `## To … is exported for native:` (HOTSWAP §Axis-3 selectivity). These are the functions `largo build --native-functions` pre-bundles; everything else stays on VM+JIT. - [fn native_pe_cdylib_lib_rs](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.native_pe_cdylib_lib_rs): The PE cdylib’s `lib.rs`: `pe_cdylib_source` through the Rust emitter, under the reference collection semantics, followed by `PE_CDYLIB_SHIM`. - [fn next_inspect_otherwise_idx](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.next_inspect_otherwise_idx): The next `Inspect`-with-`Otherwise` flag index (post-increment). Called at the START of each such Inspect’s desugaring in BOTH encoders, so a nested Inspect gets a strictly higher index than its enclosing one — no two live flags ever collide. - [fn optimization_dependencies](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.optimization_dependencies): The per-program DEPENDENCY edges for `source`, discovered by evaluating with all optimizations on and probing: disabling a fired optimization `dep` that makes another fired optimization `dependent` STOP firing means `dependent` depended on `dep` for this program. Stops already explained by a declared `requires`-cascade (`normalize` would disable the dependent anyway) are excluded — those are captured by the static registry graph. What remains are the EMERGENT, program-specific dependencies (e.g. dead-code elimination only had work because scalarization produced the dead code): returned as `(dependent, dep)` keyword pairs, sorted and deduped (deterministic). - [fn optimization_graph](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.optimization_graph): The complete per-program optimization graph from one all-on evaluation: the optimizations that `fired`, the `blockers` (`(winner, loser)` preemptions that occurred), and the emergent `dependencies` (`(dependent, dep)` — see `optimization_dependencies`). Everything the menu-tree needs, baked once per benchmark so the UI never probes in the hot path. All on the AOT codegen path (the one that produces the shown Rust), so the three views agree. - [fn optimization_preemptions](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.optimization_preemptions): The `(winner, loser)` precedence decisions the compiler made for `source` — the conflicts traced at their source (`mark_preempted`), under the effective config. - [fn optimization_trace_run](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.optimization_trace_run): The optimizations that fired on the RUN path — the VM/interpreter optimizer (`optimize_for_run`) — for `source`. The run-path analogue of `optimizations_fired` (which traces the AOT codegen path); it surfaces the run-path-only passes — inlining, loop-carried CSE, float strength reduction — the AOT trace cannot see. Respects file-level `## No ` decorators. - [fn optimization_trace_vm](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.optimization_trace_vm): The optimizations that fired while compiling `source` to VM bytecode — the third path, after AOT codegen and the run-path optimizer. Surfaces the VM-compile-time opts (constant-divisor magic division, VM `i32` narrowing) the other two traces cannot see. Compiles only (no execution), so it is fast and needs no program arguments. - [fn optimizations_fired](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.optimizations_fired): The decorator keywords of the optimizations that fired for `source` (registry order), under the default/effective config. One compile, exact. - [fn optimizations_fired_run](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.optimizations_fired_run) - [fn optimizations_fired_vm](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.optimizations_fired_vm) - [fn optimizations_fired_with](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.optimizations_fired_with): The optimizations that fired for `source` under an explicit config — re-traces an arbitrary toggle state (turning some off can make others fire). Realised by disabling that config’s off-keywords on the source, then tracing. - [fn optimizations_used](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.optimizations_used): Which optimizations actually FIRE for `source`: an optimization is “used” when disabling it (via a file-level `## No ` decorator) changes the generated Rust. Lets the benchmarks UI show, per program, which optimizations it USES vs the full set it CAN use. O(number of optimizations) compiles — intended for per-benchmark, not hot-path, use. Returns the decorator keywords of the firing optimizations (in registry order). - [fn pe_bti_source_text](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.pe_bti_source_text) - [fn pe_cdylib_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.pe_cdylib_source): The PE as an IN-PROCESS cdylib entry: the identical engine to `pe_native_source`, but the driver is a single-shot `## To peSpecializeOnce (__prog: CProgram) -> Text` that RETURNS the residual instead of writing it to stdout — no `readWireProgram`/`writeWireResidual`, no stdin loop. The exported cdylib (`build_native_pe_cdylib`) decodes the wire bytes to a `CProgram` in its `extern "C"` shim and calls this function directly, so the resident server’s process/pipe round-trip is gone. The driver `is exported for native`: host code calls it, so it keeps the signature it declares, its program taken by value, whatever the emitter would lend an internal function. `## Main` is a trivial stub (a cdylib never runs it). - [fn pe_combined_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.pe_combined_source): Assemble the full PE-run source (core types + PE + decompiler + encoded input + driver) — the exact program `projection1_source_real_fast` executes. Public so differential harnesses can run it on a specific engine. - [fn pe_mini_source_text](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.pe_mini_source_text) - [fn pe_native_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.pe_native_source) - [fn pe_source_text](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.pe_source_text): Returns the source text of the partial evaluator written in LOGOS. - [fn prelude_user_offset](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.prelude_user_offset): The offset in the author’s own text that byte `pos` of the prelude-expanded text came from, through the runs `crate::loader::apply_prelude_mapped` reports. A position inside spliced stdlib text came from no byte the author wrote and maps to `None`; a run’s END maps too, so an exclusive span end and the end of the file translate. - [fn prelude_user_span](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.prelude_user_span): A span of the prelude-expanded text as a span of the author’s own text — `None` when either end lies in spliced stdlib text. The one inversion of the prelude splice: every surface that reports a location against the author’s file translates through this. - [fn program_covered_by_native_builder](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.program_covered_by_native_builder): Whether the native Core-IR value builder covers `program` (the fast marshal path is taken, not the interpreter fallback). For test coverage assertions. - [fn program_lines_concurrent](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.program_lines_concurrent): `program_outcome_concurrent` with the shown lines kept apart (see `tw_lines`). - [fn program_outcome](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.program_outcome): Run an ALREADY-COMPILED `CompiledProgram` straight-line on the VM and return its outcome — the plain- sequential counterpart to `program_outcome_scheduled`/`program_outcome_concurrent`. This is the missing primitive that lets the source-of-truth invariants be expressed against the SAME bytecode IR every backend lowers: `VM(opt P)` is `program_outcome(&optimized_program)`, so a backend’s output can be differenced against the exact IR it consumed. Partial output on error is preserved (matching the VM). - [fn program_outcome_concurrent](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.program_outcome_concurrent): Run an ALREADY-COMPILED (possibly HAND-AUTHORED) program through the FULL cooperative scheduler (the same `VmTask`/`run_with_seed` driver `run_vm_concurrent` uses, seed 0), returning its output. Unlike the reversible `program_outcome_scheduled`, this services ops the reverse machinery does not yet cover (`TaskAbort`) — so it is the oracle for the fabric’s `TaskAbort` tile. - [fn program_outcome_scheduled](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.program_outcome_scheduled): Run an ALREADY-COMPILED (possibly HAND-AUTHORED) program through the reversible cooperative scheduler (`RevCoop`) and return its main output. The scheduler-only ops that no LOGOS source emits — `ChanClose`, `TaskAwait`, `SpawnHandle` — BLOCK on the plain VM (`requires the scheduler driver`), so their fabric tile is proven by hand-building a raw `CompiledProgram` and differencing the fabric tape against THIS oracle (the same seam `codegen_sva/rtl.rs`’s soft-core differential uses for those ops). - [fn program_to_core_wire_bytes](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.program_to_core_wire_bytes): Serialize a program’s Core-IR `CProgram` (a `CProg` with its functions and main block) to the plain wire form — the bytes a compile-once native partial evaluator reads on stdin. FAST PATH: `program_to_core` on `WireSink` emits the wire bytes in ONE pass straight from the AST — no intermediate `RuntimeValue` tree and no second `encode_value_raw` walk (byte-for-byte identical to the old two-pass form; locked by `native_builder_is_byte_identical_to_the_interpreter`). FALLBACK: for a construct the native builder does not cover, run the constructor source on the tree-walker (`wireBytes`). Both are decoded identically by the native binary’s generated `CProgram::wire_decode`. - [fn program_to_core_wire_bytes_two_pass](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.program_to_core_wire_bytes_two_pass): The TWO-PASS marshal that `program_to_core_wire_bytes` replaced: build the full `RuntimeValue` Core-IR tree (`TreeSink`) then `encode_value_raw` it. Kept as the correctness ORACLE and the speed BASELINE for the single-pass (`WireSink`) form — the two are byte-identical by construction (`WireSink` emits exactly what `encode_value_raw` would), and the single pass avoids the tree allocation + the second encode walk. `None` if a construct is uncovered. - [fn program_to_core_wire_bytes_via_interpreter](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.program_to_core_wire_bytes_via_interpreter): The REFERENCE marshal: always the interpreter path (construct the `CProgram` via the tree-walker, `wireBytes`-serialize it). The native builder’s output must be BYTE-IDENTICAL to this — locked by `native_pe_wire::native_builder_is_byte_identical_to_the_interpreter`. Kept public so the lock can force the reference regardless of native-builder coverage. - [fn projection1_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.projection1_source): First Futamura Projection: PE(interpreter, program) = compiled_program - [fn projection1_source_real](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.projection1_source_real): Real Futamura Projection 1: pe(program) = compiled_program - [fn projection1_source_real_fast](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.projection1_source_real_fast): In-process variant of `projection1_source_real`. - [fn projection1_source_real_fast_on_vm](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.projection1_source_real_fast_on_vm): VM-driven twin of `projection1_source_real_fast`. - [fn projection2_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.projection2_source): Second Futamura Projection: PE(PE, interpreter) = compiler - [fn projection2_source_real](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.projection2_source_real): Genuine Futamura Projection 2 via self-application: PE(pe_source, pe_mini(targetStmts)) - [fn projection3_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.projection3_source): Third Futamura Projection: PE(PE, PE) = compiler_generator - [fn projection3_source_real](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.projection3_source_real): Genuine Futamura Projection 3 via self-application: PE(pe_source, pe_bti(targetStmts)) - [fn quote_pe_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.quote_pe_source): Encodes the partial evaluator as CProgram construction source code. - [fn refuse_unlinkable](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.refuse_unlinkable): The entry gate of every backend that lowers bytecode WITHOUT the Rust runtime (C, RISC-V, WebAssembly, the soft core): refuse — by name — what only the interpreter, the VM, and the Rust tier provide, rather than lower it as something else. A standard-library native kernel is Rust code; a CRDT kind the backend does not lower is refused by its type name. Only code that can run is judged (`crate::vm::reach`): the loader splices whole standard-library modules, and a function nothing calls refuses nothing. - [fn refuse_unlinkable_with](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.refuse_unlinkable_with): `refuse_unlinkable`, judging what the host’s own `entries` reach as well as Main — the same roots a module built with those entries lowers. - [fn remap_project_errors](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.remap_project_errors): Remap every rustc error over a project’s GENERATED Rust back to the LOGOS source line it came from — the build path uses this so a generated-code failure points at the LOGOS the user wrote, not `main.rs`. Compiles with the source-mapped codegen (whose line numbers the map indexes), runs `cargo check --message-format=json`, and remaps each diagnostic’s primary span. Returns `Ok(vec![])` when nothing maps (caller falls back to raw cargo output). - [fn run_genuine_p2_on_target](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.run_genuine_p2_on_target): Run genuine P2 on a specific target: PE(pe_source, pe_mini(target)) - [fn run_genuine_p3_on_target](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.run_genuine_p3_on_target): Run genuine P3 on a specific target: PE(pe_source, pe_bti(target)) - [fn run_logos_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.run_logos_source): Compile and run LOGOS source, returning stdout. - [fn run_native_pe](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.run_native_pe): Specialize `program` on the compile-once native PE — the DEFAULT entry and the pit of success. Prefers the IN-PROCESS cdylib path (`run_native_pe_inprocess`; no process/pipe boundary) and falls back to the resident server (`run_native_pe_server`) only if the in-process build/load fails (e.g. no toolchain), so the fast+correct route is what every caller gets by default. The two paths are proven byte-identical by `native_pe_wire`. - [fn run_native_pe_inprocess](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.run_native_pe_inprocess): Specialize `program` on the compile-once native PE, IN PROCESS: marshal it to wire bytes, hand them to the `dlopen`ed PE cdylib’s `logos_pe_specialize` as a plain function call, and reclaim the residual bytes. No child process, no pipe — the ~59 µs IPC round-trip of the resident server is gone; all that remains is the host marshal + native `peBlock` + one FFI call. The cdylib is built + loaded ONCE per thread and cached. Residual-identity with the server / tree-walker is locked by `native_pe_wire`. - [fn run_native_pe_server](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.run_native_pe_server) - [fn run_strict_tw](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.run_strict_tw): Run `source` STRICTLY on the tree-walker. Identical pipeline to `tw_outcome` (same front-end, same oracle engine — concurrency runs on the tree-walker’s deterministic scheduler), plus the honest engine identity: `engine_ran` is `Some(TreeWalker)` whenever the program executed, `None` for a parse failure (nothing ran on any engine). - [fn run_strict_tw_with_args](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.run_strict_tw_with_args): `run_strict_tw` with the program argument vector for the `args()` system native (full argv; index 0 is the program name). - [fn run_strict_vm](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.run_strict_vm): Run `source` STRICTLY on the bytecode VM. Identical pipeline to `vm_outcome` (same front-end, same oracle-range compile), with the strict contract: a program the VM cannot run — one that needs the async runtime, one that needs the scheduler driver, or one its compiler rejects — is a TYPED REFUSAL (`engine_ran: None`, `error` says why). The tree-walker is NEVER silently substituted. - [fn run_strict_vm_with_args](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.run_strict_vm_with_args): `run_strict_vm` with the program argument vector for the `args()` system native. Honors the thread’s armed fuel (the MCP `step_budget`) exactly as the live sync path does. - [fn rustc_check](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.rustc_check): Run rustc’s analysis over a LOGOS program and translate every finding back to English with real user-source spans — the flycheck engine. - [fn rustc_check_artifacts](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.rustc_check_artifacts): Compile for CHECKING: the same front as `compile_program_full` but with the optimizer off and mapped codegen, so every generated line ties back to its statement span and the map stays 1:1 (the optimizer may fuse or drop statements; a check build has no use for its output anyway). - [fn send_check_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.send_check_source): Run the Send/escape analysis over a program. - [fn stmts_to_core_wire_bytes](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.stmts_to_core_wire_bytes): The PARSE-FREE marshal: emit a program’s Core-IR wire bytes directly from an ALREADY-PARSED AST, skipping the lex + discovery + `parse_program` that dominates `program_to_core_wire_bytes` (~90% of a specialization). An integrated caller that parsed the program once for compilation reuses that AST here to feed the native PE at a fraction of the cost. `variant_fields` maps each variant constructor name to its ordered field names (the caller derives it from its type registry, as `program_to_core` does). `None` if a construct is uncovered. Byte-identical to `program_to_core_wire_bytes` on the same program — same `build_core`/`WireSink` spine. - [fn tier_differential](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.tier_differential): Run `source` on every always-available execution tier — the tree-walker oracle and the register VM — and classify the result (Wave 13; the engine behind `largo test --tiers all` and the F18 “works-on-my-tier” guard). - [fn tw_lines](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.tw_lines): `tw_outcome` with the shown lines kept apart. The exact bytes a run writes to standard output are every line followed by a newline, which is what a compiled binary writes; the joined `output` of a `RunOutcome` cannot tell no output from one empty line, so a byte-exact comparison starts here. - [fn tw_lines_with_args](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.tw_lines_with_args): `tw_lines` with the program argument vector for the `args()` system native (full argv; index 0 is the program name). - [fn tw_outcome](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.tw_outcome): Run `source` on the TREE-WALKER (the oracle), capturing partial output and the error, if any. This entry point always uses the tree-walker — the dispatching `interpret_for_ui_sync` now runs the VM for the sync path, and the differential suites need the oracle by itself. - [fn tw_outcome_located](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.tw_outcome_located): `tw_outcome`, with a failed run’s error LOCATED (see `locate_runtime_failure`) — same front- end, same interpreter, same error TEXT; this only decides what goes in FRONT of it. A concurrent program (many `Interpreter` instances, one per task) has no single “the current site” to show, so it falls back to `tw_outcome`’s own unlocated shape rather than guessing which task’s site to name. - [fn tw_outcome_with_args](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.tw_outcome_with_args): `tw_outcome` with the program argument vector for the `args()` system native (full argv; index 0 is the program name) — the seam the benchmark corpus differential uses to run `main.lg` programs that read their size from argv. - [fn verify_no_overhead_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.verify_no_overhead_source): Verify that a LOGOS program has no interpretive overhead. - [fn vm_lines_net](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.vm_lines_net): `vm_outcome_net` with the shown lines kept apart (see `tw_lines`). - [fn vm_outcome](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.vm_outcome): Run `source` on the bytecode VM, capturing partial output and the error, if any. Same front-end as `tw_outcome`. - [fn vm_outcome_bg](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.vm_outcome_bg): `vm_outcome_with_args` driven through the BACKGROUND native compiler (HOTSWAP §6): hot functions compile on a worker thread off the interpreter’s path. Requires a process-installed tier (the P8 gate installs one first). The compiled chain is identical to the synchronous one — only WHEN it is produced differs — so output must match the synchronous/tree-walker engines exactly. - [fn vm_outcome_concurrent](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.vm_outcome_concurrent): The VM outcome for a CONCURRENT program — drives the bytecode VM on the cooperative scheduler (`VmTask` on `run_with_seed`, seed 0) exactly as the browser/playground does, so a `Pipe`/task/ `Select` program runs on the VM byte-identical to the tree-walker’s async path. The plain `vm_outcome` errors on any concurrency op (`requires the scheduler driver`); this is the oracle the AOT concurrency lock compares against so tw == VM == AOT is verifiable for the concurrent set. - [fn vm_outcome_located](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.vm_outcome_located): `vm_outcome`, with a failed run’s error LOCATED (see `locate_runtime_failure`). Uses the plain `Compiler::compile_with_oracle` → `Vm::run` path directly (not `page_host::drive_main`’s page-driving split) — every failure-site fixture this lane’s tests drive is a single-turn action failure, which that plain path already covers exactly as `vm_failure_site_lock.rs` proves. A run is a fresh process: it starts with nothing stored. - [fn vm_outcome_net](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.vm_outcome_net): The VM outcome for a peer-NETWORKING program — drives the resumable bytecode VM and services each `VmBlock::Net*` through the shared LOCAL `NetInbox` (the same inbox the tree-walker’s offline mode uses), so `Listen`/`Send`/`Sync`/`PeerAgent` run on the VM byte-identical to the tree-walker. The AOT networking lock compares against this so tw == VM == AOT holds for the local-mode net set. - [fn vm_outcome_observed](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.vm_outcome_observed): Run `source` on the bytecode VM in the OBSERVED profile (Wave 13): the VM emits the same observation events (`Note`/`Warn`/`Record`/`During`) the tree-walker does, into the `observe` channel — program output is byte- identical to `vm_outcome`. Pair with `observe::install()`/`drain()` to capture the emitted event stream. - [fn vm_outcome_tiered](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.vm_outcome_tiered): `vm_outcome_with_args`, but the statements pass through the run-path optimizer at an explicit hotness `tier` (HOTSWAP §4) before reaching the VM — the seam the `tier_invariance` gate drives at every tier T0..T3 to assert byte-identical output. `tier = Tier::T3` reproduces today’s optimized run path. - [fn vm_outcome_with_args](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.vm_outcome_with_args): `vm_outcome` with the program argument vector and an optional private native tier (so a differential test can observe THAT program’s JIT compile counters in isolation — the process-wide tier’s counters are shared by every test in the binary). - [fn vm_run_source](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.vm_run_source): Parse LOGOS source and execute it on the register bytecode VM, returning the captured output. Uses the SAME front-end as the tree-walker (`crate::ui_bridge::with_parsed_program`: lex → MWE → discovery → parse), so differential tests compare two engines on one program, never two programs. Returns `Err` for programs outside the VM’s supported subset (the compiler reports `vm: unsupported …`). - [fn write_cargo_project](https://docs.logicaffeine.com/logicaffeine_cli/compile/fn.write_cargo_project): Write a generated program as a runnable cargo project: `src/main.rs`, `Cargo.toml` (runtime deps + user `## Requires`), `.cargo/config.toml`, and — only inside a checkout — the staged runtime crates. Shared by `compile_to_dir` and `rustc_check`. ## logicaffeine_cli::dap `largo dap` — the LOGOS debugger served over the Debug Adapter Protocol. - [struct DapServer](https://docs.logicaffeine.com/logicaffeine_cli/dap/struct.DapServer): The DAP server state machine: an optional live session and a monotone output sequence counter (DAP stamps every message the adapter sends with a `seq`). - [fn cmd_dap](https://docs.logicaffeine.com/logicaffeine_cli/dap/fn.cmd_dap): `largo dap` — speak DAP over stdio with `Content-Length` framing until the peer disconnects. Stdout carries nothing but framed DAP messages. ## logicaffeine_cli::interface Re-export of the LOGOS interface types from the kernel crate. - [mod lean](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/): Lean 4 kernel export (NDJSON 3.1) as an input surface of the LOGOS kernel. - [mod literate_parser](https://docs.logicaffeine.com/logicaffeine_cli/interface/literate_parser/): Literate Specification Parser for the Kernel. - [mod match_compile](https://docs.logicaffeine.com/logicaffeine_cli/interface/match_compile/): The equation compiler: surface patterns → the kernel’s positional `Match` tree. - [mod printer](https://docs.logicaffeine.com/logicaffeine_cli/interface/printer/): The kernel’s surface, written back: the exact inverse of `term_parser` and `command_parser`. - [mod surface](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/): The SURFACE environment — user-declared notation, fixity and macros. - [struct BinderSurface](https://docs.logicaffeine.com/logicaffeine_cli/interface/struct.BinderSurface): Everything the SURFACE says about ONE parameter that the kernel’s three-field `Term::Pi` cannot hold: how it is supplied, and what fills it when the caller does not. - [struct Clause](https://docs.logicaffeine.com/logicaffeine_cli/interface/struct.Clause): One equation: one pattern per column, and the body those patterns’ variables are free in. - [struct CompileReport](https://docs.logicaffeine.com/logicaffeine_cli/interface/struct.CompileReport): What the compiler noticed on the way through, beyond the term itself. - [struct DeclarationSurface](https://docs.logicaffeine.com/logicaffeine_cli/interface/struct.DeclarationSurface): A declared type split into the pure kernel type the context is keyed at and the per-parameter surface information that has to be recorded beside it. - [struct InductiveMember](https://docs.logicaffeine.com/logicaffeine_cli/interface/struct.InductiveMember): One member of an `Command::InductiveBlock`. - [struct Repl](https://docs.logicaffeine.com/logicaffeine_cli/interface/struct.Repl): The Vernacular REPL. - [struct Surface](https://docs.logicaffeine.com/logicaffeine_cli/interface/struct.Surface): The surface environment: a stack of scopes, innermost last. - [struct TermParser](https://docs.logicaffeine.com/logicaffeine_cli/interface/struct.TermParser): Recursive descent parser for Term syntax. - [enum Assoc](https://docs.logicaffeine.com/logicaffeine_cli/interface/enum.Assoc): Which way a chain of one operator nests. - [enum BinderKind](https://docs.logicaffeine.com/logicaffeine_cli/interface/enum.BinderKind): How a parameter is SUPPLIED at a call site – Lean’s four binder kinds. - [enum Command](https://docs.logicaffeine.com/logicaffeine_cli/interface/enum.Command): A command in the Vernacular language. - [enum InterfaceError](https://docs.logicaffeine.com/logicaffeine_cli/interface/enum.InterfaceError): Errors that can occur in the interface layer. - [enum OperatorForm](https://docs.logicaffeine.com/logicaffeine_cli/interface/enum.OperatorForm): The shape a fixity command implies for its operator. - [enum ParseError](https://docs.logicaffeine.com/logicaffeine_cli/interface/enum.ParseError): Parse errors for the Vernacular. - [enum Pattern](https://docs.logicaffeine.com/logicaffeine_cli/interface/enum.Pattern): A surface pattern, exactly as a `When` clause spells it. - [enum PrintError](https://docs.logicaffeine.com/logicaffeine_cli/interface/enum.PrintError): A term or command the LOGOS surface cannot spell (yet). - [enum SurfaceDecl](https://docs.logicaffeine.com/logicaffeine_cli/interface/enum.SurfaceDecl): A declaration that extends the SURFACE rather than the context. Emitted by the command parser, applied by the REPL — so the one place a parser extension can land is the surface environment. - [fn compile_clauses](https://docs.logicaffeine.com/logicaffeine_cli/interface/fn.compile_clauses): Compile a clause matrix against a list of scrutinees. - [fn compile_clauses_reporting](https://docs.logicaffeine.com/logicaffeine_cli/interface/fn.compile_clauses_reporting): `compile_clauses`, plus what the compiler noticed. - [fn parse_command](https://docs.logicaffeine.com/logicaffeine_cli/interface/fn.parse_command): Parse ONE command, and require it to be the WHOLE input. - [fn parse_command_in_ctx](https://docs.logicaffeine.com/logicaffeine_cli/interface/fn.parse_command_in_ctx): Parse ONE command with the kernel CONTEXT available, and require it to be the whole input. - [fn parse_command_prefix_in](https://docs.logicaffeine.com/logicaffeine_cli/interface/fn.parse_command_prefix_in): Parse ONE command off the FRONT of `input`, returning it with the number of bytes consumed. - [fn parse_command_prefix_in_ctx](https://docs.logicaffeine.com/logicaffeine_cli/interface/fn.parse_command_prefix_in_ctx): Parse ONE command off the FRONT of `input` with the kernel CONTEXT available, returning it with the number of bytes consumed. - [fn print_command](https://docs.logicaffeine.com/logicaffeine_cli/interface/fn.print_command): Spell `command` as one vernacular command, terminated by its period. - [fn print_term](https://docs.logicaffeine.com/logicaffeine_cli/interface/fn.print_term): Spell `term` in the kernel term surface. - [fn print_term_in](https://docs.logicaffeine.com/logicaffeine_cli/interface/fn.print_term_in): Spell `term` read in a context whose locals are `locals`: each prints as its own name. A goal and its hypotheses are spelled this way for a reader; a closed term’s round trip is `print_term`’s, which refuses a free name because the surface would read it as a global. - [fn standard_context](https://docs.logicaffeine.com/logicaffeine_cli/interface/fn.standard_context): A context of its own for a REPL or a document to extend: a copy-on-write clone of the process’s one standard library registration, `crate::prelude::StandardLibrary::context`. ## logicaffeine_cli::interface::lean Lean 4 kernel export (NDJSON 3.1) as an input surface of the LOGOS kernel. - [mod emit](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/): LOGOS source for an imported Lean environment: one literate `.lg` document — prose headings, literate English forms where they express a declaration exactly, kernel vernacular for the rest — plus the correspondence between Lean and LOGOS names. The document is reparsed and rechecked in a fresh context before anyone may publish it. - [mod intake](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/): Intake: the strict front door of a Lean → LOGOS result. - [mod native_decide](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/native_decide/): `native_decide`, re-proved by the LOGOS kernel’s own evaluation. - [mod package](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/): The portable proof package (`logos-lean-package/1` and `/2`) and its replay. - [mod pipeline](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/pipeline/): The Lean → LOGOS pipeline, one named stage at a time, and the benchmark protocol’s dispatch. - [mod receipt](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/receipt/): The stages a Lean → LOGOS result passes through, named separately so that no result is ever one unexplained “verified” Boolean (competition rule R1). The names are the contract’s wire names. - [mod reference](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/reference/): The reference translator: a deliberately small, unoptimized reading of a Lean export’s declaration TYPES into kernel terms, sharing no code with the production reader’s conversion, sharing or caching machinery. It is the independent oracle a result’s statement is compared against (competition rule R8): a faulty production translation and a faulty emitter cannot agree with it by construction. - [mod taint](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/taint/): The taint path of every assumption a refused result rests on: the declarations through which the target reaches it. - [struct DeclarationAudit](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/struct.DeclarationAudit) - [struct ImportReport](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/struct.ImportReport) - [struct ImportRequest](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/struct.ImportRequest): How `import_with` imports. - [struct ImportedContext](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/struct.ImportedContext): Owned imported artifacts keep the importer’s stack discipline when released. - [struct InternalHelper](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/struct.InternalHelper): Checked conservative definitions introduced to preserve source DAG sharing. - [struct MetadataLoss](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/struct.MetadataLoss) - [struct Reason](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/struct.Reason): A refusal’s code and message, and where it arose when that is known. Dereferences to the message, so a reason reads as the text the reader has always reported. - [struct RuntimeDeclaration](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/struct.RuntimeDeclaration): Source-only runtime metadata. No corresponding axiom or body enters Context. - [enum DiagnosticCode](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/enum.DiagnosticCode): Why the reader (or the intake around it) refused. Stable across releases: the wire name is `DiagnosticCode::as_str`, and a renamed wire name is a protocol break. - [enum Outcome](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/enum.Outcome): The outcome of a `logos-lean-result/1` document, with the contract’s exit code. - [enum RetainSource](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/enum.RetainSource): Which checked declarations an import copies out, type and body, beyond what the context keeps. A theorem’s or opaque’s proof is opaque in the context; only retention keeps it. - [enum Verdict](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/enum.Verdict): The kernel’s decision on an input it did not accept. `Reject`: the input is wrong. `Decline`: the input may be right, but this reader does not accept it (and never approximates it). - [fn check_str](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/fn.check_str) - [fn check_str_with_declaration_audit](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/fn.check_str_with_declaration_audit) - [fn check_str_with_report](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/fn.check_str_with_report) - [fn import](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/fn.import): Import the export and return its checked context: no audit, nothing retained, Lean’s binder names carried. - [fn import_audited](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/fn.import_audited) - [fn import_audited_retaining](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/fn.import_audited_retaining): Import with the declaration audit, retaining the checked type and body of every named declaration that has one — a target and its dependency closure (`intake::Intake::closure`). Nothing outside `names` is copied: retention costs the closure, never the whole environment. - [fn import_audited_retaining_source](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/fn.import_audited_retaining_source): Import and additionally retain the checked type and body of one named declaration, including an opaque theorem’s proof. Only that declaration is copied; every other import retains nothing extra. - [fn import_retaining_closure](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/fn.import_retaining_closure): The pipeline’s import of `target`: audited, retaining `target`’s dependency closure, with `target` as the `retained_source`. - [fn import_with](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/fn.import_with): Import as `request` asks. This is LOGOS’s import surface: every `native_decide` step is read as its re-derivation by kernel evaluation and listed in the report’s `native_decisions` (`native_decide`); the Arena protocol (`check_str`) reads the export exactly as exported. - [fn lean_binder_name](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/fn.lean_binder_name): The Lean binder name an imported binder carries, when the import kept one. - [fn lean_type](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/fn.lean_type) - [fn run_cli](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/fn.run_cli): The Lean Kernel Arena benchmark protocol: one input path, `ACCEPT` on stdout and exit 0 on acceptance, exit 1 on rejection, exit 2 on decline. Kept byte-for-byte for benchmark consumers. ## logicaffeine_cli::interface::lean::emit LOGOS source for an imported Lean environment: one literate `.lg` document — prose headings, literate English forms where they express a declaration exactly, kernel vernacular for the rest — plus the correspondence between Lean and LOGOS names. The document is reparsed and rechecked in a fresh context before anyone may publish it. - [struct Correspondence](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/struct.Correspondence): One Lean declaration and the LOGOS declaration that carries it. - [struct EmittedDocument](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/struct.EmittedDocument): An emitted document. - [enum DeclarationKind](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/enum.DeclarationKind): What a declaration is, as the kernel holds it. - [enum EmissionFault](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/enum.EmissionFault): Why an emitted document does not reparse to the imported declarations. Every variant names the LOGOS declaration it concerns. - [enum Form](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/enum.Form): Which surface carries a declaration in the document. - [enum LeanPart](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/enum.LeanPart): One component of a Lean name. - [enum Origin](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/enum.Origin): Where a LOGOS declaration came from. - [enum Published](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/enum.Published): What a publication left in place. - [const DOCUMENT_EXTENSION](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/constant.DOCUMENT_EXTENSION): The published document’s extension. - [const FAILURE_EXTENSION](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/constant.FAILURE_EXTENSION): The extension of a failed run’s diagnostic record. - [const MAX_SOURCE_BYTES](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/constant.MAX_SOURCE_BYTES): The largest document the emitter writes. - [fn check_statement](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/fn.check_statement): Rule R8: the target’s REPARSED statement against `reference`, an independent translation of the Lean declaration (`reference::reference_declaration`) in the importer’s names. The reference is carried into LOGOS names through the correspondence alone — the emitter’s own terms play no part — and must name the target, bind the same universe parameters in the same order, and state the same type up to α. - [fn emit_context](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/fn.emit_context): `emit_document` over any checked context whose constants carry the importer’s key scheme. `proofs` hands back the checked proof of an opaque theorem, which a context does not keep. - [fn emit_document](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/fn.emit_document): The dependency closure of `target`, as a LOGOS document. - [fn publish](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/fn.publish): Publish `outcome` under `dir/.lg`, or its failure under `dir/.failure.txt`. - [fn publish_through](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/fn.publish_through): `publish`, writing every file’s bytes through `write` — the seam a test uses to make a write fail half way. - [fn verify](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/emit/fn.verify): Reparse `document.source` in a fresh context and compare every declaration with what it must be. Returns the checked context. ## logicaffeine_cli::interface::lean::intake Intake: the strict front door of a Lean → LOGOS result. - [struct Declaration](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/struct.Declaration): One declared constant. - [struct Header](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/struct.Header): The export’s first record. - [struct Intake](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/struct.Intake): An export that passed intake. - [struct Profile](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/struct.Profile): The toolchain and assumption profile a result is produced under. - [enum Component](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/enum.Component): One component of a Lean name. - [enum DeclarationKind](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/enum.DeclarationKind): What a declaration record declares. - [const EXPORTER_FLAGS](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/constant.EXPORTER_FLAGS): The exporter flags every result is produced with: metadata and unsafe declarations are exported so that the reader, not the exporter, decides what they mean. - [const EXPORTER_REVISION](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/constant.EXPORTER_REVISION): The pinned lean4export revision. - [const EXPORTER_SOURCES](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/constant.EXPORTER_SOURCES): SHA-256 of the pinned exporter’s sources at `EXPORTER_REVISION`. The exporter is identified by its content, never by the name of the directory holding it. - [const STAGE_A](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/constant.STAGE_A): Stage A: Lean 4.14.0, lean4export 3.1.0 (revision `EXPORTER_REVISION`), export format 3.1.0, Lean core only, and Lean’s three standard axioms. - [const TOOLCHAIN](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/constant.TOOLCHAIN): The elan toolchain name of the pinned Lean. - [fn components](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/fn.components): The components of a kernel identity, when it is the encoding of a Lean name. - [fn encode](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/fn.encode): The structural encoding of a Lean name, before the reader’s reserved identities apply. - [fn kernel_name](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/fn.kernel_name): The kernel identity the reader registers the dotted Lean name `lean` under. - [fn lean_name](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/fn.lean_name): The dotted Lean name a kernel identity encodes, as Lean prints it; a kernel name that encodes no Lean name is returned unchanged. - [fn parse_lean_name](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/fn.parse_lean_name): Parse a dotted Lean name as Lean prints it: components separated by `.`, a component that is not an identifier written `«…»`, a component of digits numeric. - [fn print_lean_name](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/fn.print_lean_name): Print components as Lean prints a name. - [fn read](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/fn.read): Read and validate an export under `profile`. - [fn read_header](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/intake/fn.read_header): The header, held to the profile: the format version first (a newer format may legitimately add fields), then the header’s own fields, then the producing toolchain. ## logicaffeine_cli::interface::lean::native_decide `native_decide`, re-proved by the LOGOS kernel’s own evaluation. - [struct Elimination](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/native_decide/struct.Elimination): What a target’s closure rests on once its leaves are re-derived. - [struct NativeDecision](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/native_decide/struct.NativeDecision): One recognized leaf: Lean’s appeal to its compiler, and the pieces its re-derivation keeps. - [struct NativeDecisions](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/native_decide/struct.NativeDecisions): The native decisions of one export. - [struct Rederivation](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/native_decide/struct.Rederivation): One declaration whose type or value holds re-derived leaves. - [const ELIMINATED_AXIOM](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/native_decide/constant.ELIMINATED_AXIOM): The trust escape a re-derived leaf no longer rests on, as Lean’s `#print axioms` names it. - [const INFORMATION_CATEGORY](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/native_decide/constant.INFORMATION_CATEGORY): The information-change category a re-derivation is disclosed under. - [const METHOD](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/native_decide/constant.METHOD): How a disclosed step was re-derived. ## logicaffeine_cli::interface::lean::package The portable proof package (`logos-lean-package/1` and `/2`) and its replay. - [struct AssumptionRecord](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/struct.AssumptionRecord) - [struct Build](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/struct.Build): A built package and the producing run’s receipt. A build never claims more than its receipt: `assemble` is the door that refuses to hand out a package whose receipt is not clean. - [struct BuildOptions](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/struct.BuildOptions): What the producing run knows that the export does not say. - [struct CorrespondenceFile](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/struct.CorrespondenceFile) - [struct CorrespondenceRow](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/struct.CorrespondenceRow) - [struct EmissionRecord](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/struct.EmissionRecord) - [struct InformationLoss](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/struct.InformationLoss) - [struct LeanRun](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/struct.LeanRun): A pinned Lean toolchain’s run over the original source. - [struct Manifest](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/struct.Manifest) - [struct PackageLimits](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/struct.PackageLimits): Limits enforced on a package before any work. - [struct SourceIdentity](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/struct.SourceIdentity) - [struct StageRecord](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/struct.StageRecord) - [struct TargetIdentity](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/struct.TargetIdentity) - [struct Toolchain](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/struct.Toolchain) - [const ALLOWED_AXIOMS](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/constant.ALLOWED_AXIOMS): Lean’s three standard axioms, in the kernel’s spelling of their Lean names — the only assumptions a verified result may rest on. - [const CERTIFICATE](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/constant.CERTIFICATE) - [const CORRESPONDENCE](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/constant.CORRESPONDENCE) - [const CORRESPONDENCE_SCHEMA](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/constant.CORRESPONDENCE_SCHEMA) - [const EXPORT](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/constant.EXPORT) - [const MANIFEST](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/constant.MANIFEST) - [const NATIVE_REDERIVED_SCHEMA](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/constant.NATIVE_REDERIVED_SCHEMA): The schema of a package whose proof is the export’s with the native decisions of the target’s closure re-derived by kernel evaluation. - [const PACKAGE_SCHEMA](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/constant.PACKAGE_SCHEMA): The schema of a package whose proof is the export’s own, checked as exported. - [const PACKAGE_SCHEMAS](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/constant.PACKAGE_SCHEMAS): Every package schema this crate writes and replays. - [const REPLAY_SCHEMA](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/constant.REPLAY_SCHEMA) - [const TRUSTED_BASE](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/constant.TRUSTED_BASE): The trusted computing base shared by the checks a package’s receipt names. Two checkers that share this much are two implementations of typing, not two independent theorem provers, and the manifest says so in every package. - [fn assemble](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.assemble): Build the package for `target` from a Lean export, and require that every stage the producing run can establish passed. A package is returned only when it would replay clean. - [fn assemble_observed](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.assemble_observed): `assemble_with`, holding the result’s assumptions against what the pinned Lean’s own `#print axioms` reported for the target (Lean names), as the package’s contract says: any difference in either direction, and a native-rederived proof without Lean’s report, is an `assumption_disagreement`, and no package is handed out. - [fn assemble_with](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.assemble_with): `assemble` with the producing run’s own evidence. - [fn build](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.build): Build a package and its producing receipt. Refuses only when no package can be formed at all (an export the importer does not accept, a target it does not declare); a package whose checks fail is returned with the failure on its receipt, so a refusal can be inspected and replayed. - [fn build_observed](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.build_observed): `build`, with the pinned Lean’s `#print axioms` for the target when the producing run has it. - [fn canonical_certificate](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.canonical_certificate): The certificate’s canonical encoding: compact, newline-terminated. - [fn canonical_json](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.canonical_json): The one canonical encoding of a package JSON file: pretty-printed, newline-terminated. - [fn document_path](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.document_path): The document’s file name for a Lean target: its name with anything outside letters, digits, `_`, `-` and `.` written as `_`, then `.lg`. - [fn publish](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.publish): Write a package to `dir` atomically: every file is written and synced in a staging directory beside it, which is then renamed into place. An existing `dir` is never replaced — a published result is immutable — and a failure leaves nothing behind. - [fn publishable](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.publishable): The package of `build`, when every stage the producing run can establish passed and the package replays clean in this process; otherwise the first stage that did not pass, as a refusal. - [fn read_directory](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.read_directory): Read a package directory, enforcing the file-count, size and path limits before reading any content. Symbolic links and special files are refused. - [fn receipt_document](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.receipt_document): The replay receipt as a `logos-lean-replay/1` document. - [fn replay](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.replay): Replay a package from its bytes alone, under the default limits. - [fn replay_with](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.replay_with): Replay a package from its bytes alone, under `limits`. - [fn result_id](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.result_id): The result identity of a `logos-lean-package/1` package: the target and every non-manifest file’s path and digest. - [fn result_id_in](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.result_id_in): The result identity under `schema`, which is the preimage’s domain: the same files under two contracts have two identities. - [fn sha256_hex](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/fn.sha256_hex): The lowercase hexadecimal SHA-256 of `bytes`. - [type PackageFiles](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/package/type.PackageFiles): A package’s files, keyed by published relative path. ## logicaffeine_cli::interface::lean::pipeline The Lean → LOGOS pipeline, one named stage at a time, and the benchmark protocol’s dispatch. - [struct Checked](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/pipeline/struct.Checked): A result and, when every stage up to packaging passed, the package to publish and replay. - [struct Diagnostic](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/pipeline/struct.Diagnostic): One typed, located diagnostic of a result. - [struct LeanResult](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/pipeline/struct.LeanResult): A `logos-lean-result/1` document under construction. - [struct Limits](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/pipeline/struct.Limits): Budgets declared before any work. - [struct Loss](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/pipeline/struct.Loss): Information the result does not carry from the Lean input. - [struct PackageRef](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/pipeline/struct.PackageRef): A published package, as the result names it. - [enum LeanEvidence](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/pipeline/enum.LeanEvidence): What the run observed of Lean itself. - [const RESULT_SCHEMA](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/pipeline/constant.RESULT_SCHEMA) - [fn check_export](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/pipeline/fn.check_export): Run every in-process stage over a Lean export for the dotted Lean name `target`: intake, import and check, independent recheck, assumption policy, emission and package assembly. `fresh_replay` is left to the caller, which must replay the published package in a new process. - [fn run_cli](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/pipeline/fn.run_cli): The Lean Kernel Arena benchmark protocol: one input path, `ACCEPT` on stdout and exit 0 on acceptance, exit 1 on rejection, exit 2 on decline. Kept byte-for-byte for benchmark consumers. - [fn self_verification_failure](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/pipeline/fn.self_verification_failure): A refusal of LOGOS’s own artifact — emission, packaging, replay — once every check of the user’s input passed. Unsupported capabilities, budgets and environment failures keep their codes; any other refusal (a rejection, a malformed or ill-typed artifact of our own making) is an `InternalInconsistency`: the fault is ours, and it is never reported as the user’s mathematics being wrong. ## logicaffeine_cli::interface::lean::receipt The stages a Lean → LOGOS result passes through, named separately so that no result is ever one unexplained “verified” Boolean (competition rule R1). The names are the contract’s wire names. - [struct Receipt](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/receipt/struct.Receipt): A receipt: one entry per stage in `STAGES`, in order. Verified only when every stage passed. - [struct Stage](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/receipt/struct.Stage) - [enum StageStatus](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/receipt/enum.StageStatus): What happened in one stage. `NotRun` and `Unsupported` are never a pass. - [const REPLAY_STAGES](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/receipt/constant.REPLAY_STAGES): The stages a replay establishes from a package’s bytes alone. `lean_accepted` is not among them: a replay never runs Lean, and says so rather than inheriting the producing run’s word. - [const STAGES](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/receipt/constant.STAGES): Every stage, in the order a result passes through them. ## logicaffeine_cli::interface::lean::reference The reference translator: a deliberately small, unoptimized reading of a Lean export’s declaration TYPES into kernel terms, sharing no code with the production reader’s conversion, sharing or caching machinery. It is the independent oracle a result’s statement is compared against (competition rule R8): a faulty production translation and a faulty emitter cannot agree with it by construction. - [struct Reference](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/reference/struct.Reference): An export read once, for reading many declarations from it. - [struct ReferenceDeclaration](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/reference/struct.ReferenceDeclaration): One declaration as the reference translator reads it. - [enum ReferenceKind](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/reference/enum.ReferenceKind): What a Lean declaration record is, as far as the statement binding needs to know. - [const REFERENCE_NODE_BUDGET](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/reference/constant.REFERENCE_NODE_BUDGET): The largest term (in tree nodes) the reference translation will build. Exports share subexpressions as a DAG; a tree unfolding is bounded so a hostile export cannot make the oracle allocate without limit. - [fn kernel_name_of_components](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/reference/fn.kernel_name_of_components): The kernel spelling of a Lean name given as its hierarchical components. - [fn reference_declaration](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/reference/fn.reference_declaration): The whole reference reading of one declaration: kernel name, kind, universe parameters and type. - [fn reference_type](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/reference/fn.reference_type): The type of `declaration` as the reference translator reads it from `export`. ## logicaffeine_cli::interface::lean::taint The taint path of every assumption a refused result rests on: the declarations through which the target reaches it. - [struct TaintPath](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/taint/struct.TaintPath): One assumption and the Lean declarations through which the target reaches it, target first and the assumption last, in Lean’s spelling. - [const STAGE](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/taint/constant.STAGE): The receipt stage whose refusal a taint path explains. - [fn diagnostics](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/taint/fn.diagnostics): One `disallowed_assumption` diagnostic of the assumption-policy stage per assumption outside Lean’s three standard axioms that `target` (a kernel name, printed as `target_lean`) rests on, naming its taint path. `assumptions` are the result’s (Lean names). - [fn taint_paths](https://docs.logicaffeine.com/logicaffeine_cli/interface/lean/taint/fn.taint_paths): The taint path of each of `assumptions` (Lean names) from `target` (a kernel name), in the order `assumptions` lists them. An assumption the target does not reach through the environment has no path and is left out. ## logicaffeine_cli::interface::literate_parser Literate Specification Parser for the Kernel. - [const ONE_SHOT_TACTICS](https://docs.logicaffeine.com/logicaffeine_cli/interface/literate_parser/constant.ONE_SHOT_TACTICS): The closed one-shot tactic vocabulary of the literate `Proof:` surface: the keyword a mathematician writes, and the reflected tactic it applies to the reified goal. Adding a tactic is a row here — `parse_proof_tactic` and `parse_single_tactic` both read this table, so the two doors can never drift apart again. - [fn measure_definition](https://docs.logicaffeine.com/logicaffeine_cli/interface/literate_parser/fn.measure_definition): The EXTENT of the `## To` block at the front of `input` — where it ends — read from its syntax alone. See `measure_theorem`. - [fn measure_theorem](https://docs.logicaffeine.com/logicaffeine_cli/interface/literate_parser/fn.measure_theorem): The EXTENT of the `## Theorem:` block at the front of `input`, read from its syntax alone. - [fn parse_definition](https://docs.logicaffeine.com/logicaffeine_cli/interface/literate_parser/fn.parse_definition): Parse “## To [name] (params) -> RetType:” into Command::Definition - [fn parse_definition_in](https://docs.logicaffeine.com/logicaffeine_cli/interface/literate_parser/fn.parse_definition_in): `parse_definition`, with the kernel context the equation compiler needs. - [fn parse_definition_scoped](https://docs.logicaffeine.com/logicaffeine_cli/interface/literate_parser/fn.parse_definition_scoped): `parse_definition_in`, reading every name in the namespace scope `scope` — the door the REPL reads through, so a literate definition’s names mean exactly what they mean to every other door. - [fn parse_inductive](https://docs.logicaffeine.com/logicaffeine_cli/interface/literate_parser/fn.parse_inductive): Parse “A [Name] is either…” into Command::Inductive - [fn parse_let_definition](https://docs.logicaffeine.com/logicaffeine_cli/interface/literate_parser/fn.parse_let_definition): Parse “Let [name] be [term].” into Command::Definition (constant, not function) - [fn parse_theorem](https://docs.logicaffeine.com/logicaffeine_cli/interface/literate_parser/fn.parse_theorem): Parse “## Theorem: [name] Statement: [proposition].” into Command::Definition - [fn parse_theorem_in](https://docs.logicaffeine.com/logicaffeine_cli/interface/literate_parser/fn.parse_theorem_in): `parse_theorem`, with the kernel context. - [fn parse_theorem_scoped](https://docs.logicaffeine.com/logicaffeine_cli/interface/literate_parser/fn.parse_theorem_scoped): `parse_theorem_in`, reading every name in the namespace scope `scope`. The statement is reflected into syntax only after its names are resolved, so a theorem about `add` in a session that shadows `add` is a theorem about the session’s `add`. ## logicaffeine_cli::interface::match_compile The equation compiler: surface patterns → the kernel’s positional `Match` tree. - [struct Clause](https://docs.logicaffeine.com/logicaffeine_cli/interface/match_compile/struct.Clause): One equation: one pattern per column, and the body those patterns’ variables are free in. - [struct CompileReport](https://docs.logicaffeine.com/logicaffeine_cli/interface/match_compile/struct.CompileReport): What the compiler noticed on the way through, beyond the term itself. - [enum Pattern](https://docs.logicaffeine.com/logicaffeine_cli/interface/match_compile/enum.Pattern): A surface pattern, exactly as a `When` clause spells it. - [fn compile_clauses](https://docs.logicaffeine.com/logicaffeine_cli/interface/match_compile/fn.compile_clauses): Compile a clause matrix against a list of scrutinees. - [fn compile_clauses_reporting](https://docs.logicaffeine.com/logicaffeine_cli/interface/match_compile/fn.compile_clauses_reporting): `compile_clauses`, plus what the compiler noticed. - [fn pattern_binder_types](https://docs.logicaffeine.com/logicaffeine_cli/interface/match_compile/fn.pattern_binder_types): The types a pattern’s binders take when it is matched against a value of `disc_ty`. ## logicaffeine_cli::interface::printer The kernel’s surface, written back: the exact inverse of `term_parser` and `command_parser`. - [enum PrintError](https://docs.logicaffeine.com/logicaffeine_cli/interface/printer/enum.PrintError): A term or command the LOGOS surface cannot spell (yet). - [fn inductive_command](https://docs.logicaffeine.com/logicaffeine_cli/interface/printer/fn.inductive_command): The vernacular command that registers the inductive block `name` belongs to, EXACTLY as `ctx` holds it — its universe telescope, each member’s written parameters (the context’s declared parameter count), its arity past them, and each constructor’s type past them. - [fn print_command](https://docs.logicaffeine.com/logicaffeine_cli/interface/printer/fn.print_command): Spell `command` as one vernacular command, terminated by its period. - [fn print_term](https://docs.logicaffeine.com/logicaffeine_cli/interface/printer/fn.print_term): Spell `term` in the kernel term surface. - [fn print_term_in](https://docs.logicaffeine.com/logicaffeine_cli/interface/printer/fn.print_term_in): Spell `term` read in a context whose locals are `locals`: each prints as its own name. A goal and its hypotheses are spelled this way for a reader; a closed term’s round trip is `print_term`’s, which refuses a free name because the surface would read it as a global. - [fn structure_commands](https://docs.logicaffeine.com/logicaffeine_cli/interface/printer/fn.structure_commands): The commands that make `name` a STRUCTURE exactly as `ctx` holds it: each projection’s definition (under the inductive’s universe telescope), then `Structure name := proj₀ … projₙ.` Empty when `ctx` holds no structure information for `name`. Emit them right after the block from `inductive_command`, before anything — a recursor whose body is written through the projections, say — relies on structure η. ## logicaffeine_cli::interface::surface The SURFACE environment — user-declared notation, fixity and macros. - [struct Env](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/struct.Env): The environment a written name is resolved against — the two questions resolution asks of it, as closures, which is what keeps the kernel out of the surface. - [struct Name](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/struct.Name): A hierarchical name — Lean’s `Name`, which is a LIST of components and not a string with dots. - [struct Namespaces](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/struct.Namespaces): The namespace scope: what is CURRENT, and what is OPEN. - [struct OpenClause](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/struct.OpenClause): One `open` clause: a namespace, and WHICH of its names it brings in, under WHICH spelling. - [struct ScopeMark](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/struct.ScopeMark): Where a scope stood, so a scoped `Open … in …` (or a declaration’s own implicit namespace) can be wound back EXACTLY, without knowing what it pushed. - [struct Surface](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/struct.Surface): The surface environment: a stack of scopes, innermost last. - [enum Assoc](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/enum.Assoc): Which way a chain of one operator nests. - [enum OperatorForm](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/enum.OperatorForm): The shape a fixity command implies for its operator. - [enum Resolution](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/enum.Resolution): What a written name denotes, once the scope has had its say. - [enum SurfaceDecl](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/enum.SurfaceDecl): A declaration that extends the SURFACE rather than the context. Emitted by the command parser, applied by the REPL — so the one place a parser extension can land is the surface environment. - [const ANONYMOUS_SECTION](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/constant.ANONYMOUS_SECTION): How an ANONYMOUS section is named in a report. Lean’s `section` may be written with no name at all, and a scope with no name still has to be reportable — as an unclosed scope at the end of a document, and as the scope a mismatched `End` failed to close. - [const ROOT_ESCAPE](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/constant.ROOT_ESCAPE): The one name that is never relative: `_root_.x` is the absolute `x`, whatever is open. - [fn fill_defaults](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/fn.fill_defaults): Fill every OMITTED DEFAULT ARGUMENT in `term`, at every application spine in it. - [fn resolve_names](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/fn.resolve_names): `resolve_names_in` against an environment that is only its declared keys — `known` — and shadows nothing. - [fn resolve_names_in](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/fn.resolve_names_in): Resolve every global name written in `term` against the scope, BEFORE any elaboration sees it — Lean’s staging, and the whole content of “name resolution completes before translation begins”. - [fn respell_names](https://docs.logicaffeine.com/logicaffeine_cli/interface/surface/fn.respell_names): The inverse of `resolve_names_in`, for a term already in KEY space: every global is re-spelled so that resolving the result in this same scope reaches exactly the key it holds now. ## logicaffeine_cli::mcp `largo mcp` — the LOGOS toolchain served over the Model Context Protocol. - [struct McpServer](https://docs.logicaffeine.com/logicaffeine_cli/mcp/struct.McpServer): The MCP server state machine. - [fn cmd_mcp](https://docs.logicaffeine.com/logicaffeine_cli/mcp/fn.cmd_mcp): Handle `largo mcp`: serve MCP over stdio until EOF. ## logicaffeine_cli::project Phase 36/37/39: Project Module System - [mod build](https://docs.logicaffeine.com/logicaffeine_cli/project/build/): Phase 37: Build Orchestration - [mod build_c](https://docs.logicaffeine.com/logicaffeine_cli/project/build_c/): The C build: `largo build [--release] --emit c|c-bytecode`. - [mod credentials](https://docs.logicaffeine.com/logicaffeine_cli/project/credentials/): Phase 39: Credential Management - [mod deps](https://docs.logicaffeine.com/logicaffeine_cli/project/deps/): G10 — local dependency linking: resolve `Largo.toml` `[dependencies]` into the loader’s admitted dependency roots, and describe the assembled linked closure. - [mod manifest](https://docs.logicaffeine.com/logicaffeine_cli/project/manifest/): Phase 37: Largo.toml Manifest Parser - [mod registry](https://docs.logicaffeine.com/logicaffeine_cli/project/registry/): Phase 39: Registry Client - [mod shape](https://docs.logicaffeine.com/logicaffeine_cli/project/shape/): What a project IS — decided once, read by every `largo` command. - [struct Loader](https://docs.logicaffeine.com/logicaffeine_cli/project/struct.Loader): Module loader that handles multiple URI schemes. - [struct ModuleSource](https://docs.logicaffeine.com/logicaffeine_cli/project/struct.ModuleSource): A loaded module’s source content and metadata. ## logicaffeine_cli::project::build Phase 37: Build Orchestration - [struct BuildConfig](https://docs.logicaffeine.com/logicaffeine_cli/project/build/struct.BuildConfig): Configuration for a build operation. - [struct BuildResult](https://docs.logicaffeine.com/logicaffeine_cli/project/build/struct.BuildResult): Result of a successful build operation. - [struct CargoFailure](https://docs.logicaffeine.com/logicaffeine_cli/project/build/struct.CargoFailure): A classified `cargo build` failure. The full output already streamed to the terminal; this carries the verdict plus the retained tail for programmatic callers. - [enum Backend](https://docs.logicaffeine.com/logicaffeine_cli/project/build/enum.Backend): Native executable backend selected by `largo build` / `largo run`. - [enum BuildError](https://docs.logicaffeine.com/logicaffeine_cli/project/build/enum.BuildError): Errors that can occur during the build process. - [enum CargoFailureKind](https://docs.logicaffeine.com/logicaffeine_cli/project/build/enum.CargoFailureKind): What actually went wrong when `cargo build` failed, judged from its stderr tail. - [fn build](https://docs.logicaffeine.com/logicaffeine_cli/project/build/fn.build): Build a LOGOS project. - [fn build_backend](https://docs.logicaffeine.com/logicaffeine_cli/project/build/fn.build_backend): Build through an explicitly selected native executable backend. - [fn classify_cargo_failure](https://docs.logicaffeine.com/logicaffeine_cli/project/build/fn.classify_cargo_failure): Judge a failed `cargo build` from its stderr tail. - [fn find_project_root](https://docs.logicaffeine.com/logicaffeine_cli/project/build/fn.find_project_root): Find the project root by walking up the directory tree. - [fn requires_component_is_safe](https://docs.logicaffeine.com/logicaffeine_cli/project/build/fn.requires_component_is_safe): Whether a `## Requires` crate name / version / feature is safe to write into the generated Cargo.toml verbatim: strictly alphanumerics plus the characters cargo specs actually use. Anything else (quotes, newlines, brackets) could smuggle TOML structure into the manifest. - [fn run](https://docs.logicaffeine.com/logicaffeine_cli/project/build/fn.run): Execute a built LOGOS project. ## logicaffeine_cli::project::build_c The C build: `largo build [--release] --emit c|c-bytecode`. - [enum CLowering](https://docs.logicaffeine.com/logicaffeine_cli/project/build_c/enum.CLowering): Which LOGOS → C lowering a C build runs. - [const C_DEBUG_FLAGS](https://docs.logicaffeine.com/logicaffeine_cli/project/build_c/constant.C_DEBUG_FLAGS): The optimization flags of a debug C build. - [const C_RELEASE_FLAGS](https://docs.logicaffeine.com/logicaffeine_cli/project/build_c/constant.C_RELEASE_FLAGS): The optimization flags of a release C build: full optimization, the host CPU, link-time optimization, and no floating-point contraction — `a*b + c` stays two rounded operations, as it is on the Rust tier and the VM, so every tier computes the same bits. - [fn c_compiler](https://docs.logicaffeine.com/logicaffeine_cli/project/build_c/fn.c_compiler): The C compiler a build runs: `$CC`, else `cc`. - [fn c_compiler_args](https://docs.logicaffeine.com/logicaffeine_cli/project/build_c/fn.c_compiler_args): The complete compiler argument list for `source` → `output` under `release`, linking `links` after the source: what the generated C asks for beyond the C library (the exact extension’s value runtime, `logicaffeine_compile::codegen_c::value_runtime::link_args`). ## logicaffeine_cli::project::credentials Phase 39: Credential Management - [struct Credentials](https://docs.logicaffeine.com/logicaffeine_cli/project/credentials/struct.Credentials): Persistent storage for registry authentication tokens. - [enum CredentialsError](https://docs.logicaffeine.com/logicaffeine_cli/project/credentials/enum.CredentialsError): Errors that can occur when loading or saving credentials. - [fn credentials_path](https://docs.logicaffeine.com/logicaffeine_cli/project/credentials/fn.credentials_path): Get the path to the credentials file - [fn get_token](https://docs.logicaffeine.com/logicaffeine_cli/project/credentials/fn.get_token): Get the token for a registry, checking env var first then credentials file ## logicaffeine_cli::project::deps G10 — local dependency linking: resolve `Largo.toml` `[dependencies]` into the loader’s admitted dependency roots, and describe the assembled linked closure. - [struct BuildManifest](https://docs.logicaffeine.com/logicaffeine_cli/project/deps/struct.BuildManifest): A machine-readable account of a linked build: the local package identity, feature selection, every resolved dependency, the transitive closure (each linked `.lg` file tagged with its source dependency), and the registry state. - [struct ClosureFile](https://docs.logicaffeine.com/logicaffeine_cli/project/deps/struct.ClosureFile): One file in the assembled closure, tagged with the dependency it came from. - [struct ManifestDep](https://docs.logicaffeine.com/logicaffeine_cli/project/deps/struct.ManifestDep): A resolved dependency as it appears in the build manifest. - [struct PackageIdentity](https://docs.logicaffeine.com/logicaffeine_cli/project/deps/struct.PackageIdentity): The local package’s identity in the build manifest. - [struct RegistryState](https://docs.logicaffeine.com/logicaffeine_cli/project/deps/struct.RegistryState): Whether — and how — a registry was consulted assembling the closure. - [fn build_manifest](https://docs.logicaffeine.com/logicaffeine_cli/project/deps/fn.build_manifest): Assemble the linked closure for `entry` and describe it as a `BuildManifest`. - [fn resolve_dep_roots](https://docs.logicaffeine.com/logicaffeine_cli/project/deps/fn.resolve_dep_roots): Resolve the manifest’s linkable dependencies against `project_root` into the loader’s `DepRoot`s. A resolution failure (a floating git rev, a missing path, an unlinkable form) surfaces as a clean `CliError`, so every command that links deps reports the same message. ## logicaffeine_cli::project::manifest Phase 37: Largo.toml Manifest Parser - [struct DependencyDetail](https://docs.logicaffeine.com/logicaffeine_cli/project/manifest/struct.DependencyDetail): Detailed dependency specification. - [struct Manifest](https://docs.logicaffeine.com/logicaffeine_cli/project/manifest/struct.Manifest): Project manifest (`Largo.toml`). - [struct Package](https://docs.logicaffeine.com/logicaffeine_cli/project/manifest/struct.Package): Package metadata from the `[package]` section. - [struct ResolvedDep](https://docs.logicaffeine.com/logicaffeine_cli/project/manifest/struct.ResolvedDep): Where a declared dependency’s source is rooted on disk, resolved from the manifest against a canonical project root. - [struct TestSection](https://docs.logicaffeine.com/logicaffeine_cli/project/manifest/struct.TestSection): The `[test]` section: conscious debt budgets for the test runner. - [struct WebSection](https://docs.logicaffeine.com/logicaffeine_cli/project/manifest/struct.WebSection): The `[web]` section: a site’s opt-out of the framework’s built-in theme. - [enum DepSource](https://docs.logicaffeine.com/logicaffeine_cli/project/manifest/enum.DepSource): The origin a `ResolvedDep` was resolved from. - [enum DependencyError](https://docs.logicaffeine.com/logicaffeine_cli/project/manifest/enum.DependencyError): An error resolving a `[dependencies]` declaration into a `ResolvedDep`. - [enum DependencySpec](https://docs.logicaffeine.com/logicaffeine_cli/project/manifest/enum.DependencySpec): Dependency specification. - [enum ManifestError](https://docs.logicaffeine.com/logicaffeine_cli/project/manifest/enum.ManifestError): Errors that can occur when loading a manifest ## logicaffeine_cli::project::registry Phase 39: Registry Client - [struct PublishMetadata](https://docs.logicaffeine.com/logicaffeine_cli/project/registry/struct.PublishMetadata): Metadata submitted when publishing a package. - [struct PublishResult](https://docs.logicaffeine.com/logicaffeine_cli/project/registry/struct.PublishResult): Response from a successful publish operation. - [struct RegistryClient](https://docs.logicaffeine.com/logicaffeine_cli/project/registry/struct.RegistryClient): HTTP client for the LOGOS package registry API. - [struct UserInfo](https://docs.logicaffeine.com/logicaffeine_cli/project/registry/struct.UserInfo): User information returned from the registry’s `/auth/me` endpoint. - [enum PackageError](https://docs.logicaffeine.com/logicaffeine_cli/project/registry/enum.PackageError): Errors that can occur when creating a package tarball. - [enum RegistryError](https://docs.logicaffeine.com/logicaffeine_cli/project/registry/enum.RegistryError): Errors that can occur during registry API operations. - [fn create_tarball](https://docs.logicaffeine.com/logicaffeine_cli/project/registry/fn.create_tarball): Create a gzipped tarball from a LOGOS project. - [fn is_git_dirty](https://docs.logicaffeine.com/logicaffeine_cli/project/registry/fn.is_git_dirty): Check if the git working directory has uncommitted changes. ## logicaffeine_cli::project::shape What a project IS — decided once, read by every `largo` command. - [struct Project](https://docs.logicaffeine.com/logicaffeine_cli/project/shape/struct.Project): A project on disk: its manifest, its entry program if it has one, and its directories. - [enum BuildPlan](https://docs.logicaffeine.com/logicaffeine_cli/project/shape/enum.BuildPlan): What a plain `largo build` produces. - [enum ProjectShape](https://docs.logicaffeine.com/logicaffeine_cli/project/shape/enum.ProjectShape): What a project is. Decided by `Project::shape`; every command reads it rather than re-deriving a piece of it. - [enum ServePlan](https://docs.logicaffeine.com/logicaffeine_cli/project/shape/enum.ServePlan): What `largo serve` stands up. ## logicaffeine_cli::ui Terminal output substrate for `largo`. - [struct CliError](https://docs.logicaffeine.com/logicaffeine_cli/ui/struct.CliError): A user-facing CLI error: a message, an optional `help:` hint, and the exit code the process should terminate with. - [enum ColorMode](https://docs.logicaffeine.com/logicaffeine_cli/ui/enum.ColorMode): The `--color` mode selected on the command line. - [const CLAP_STYLES](https://docs.logicaffeine.com/logicaffeine_cli/ui/constant.CLAP_STYLES): The cargo help palette for clap: bold-green headers/usage, bold-cyan literals, cyan placeholders. - [const ERROR_STYLE](https://docs.logicaffeine.com/logicaffeine_cli/ui/constant.ERROR_STYLE): Bold red — the `error:` prefix. - [const EXIT_FAILURE](https://docs.logicaffeine.com/logicaffeine_cli/ui/constant.EXIT_FAILURE): Process exit code for a command failure (build error, proof failure, dirty `fmt --check`, parse error, …). - [const EXIT_OK](https://docs.logicaffeine.com/logicaffeine_cli/ui/constant.EXIT_OK): Process exit code for success. - [const EXIT_USAGE](https://docs.logicaffeine.com/logicaffeine_cli/ui/constant.EXIT_USAGE): Process exit code for a usage error (bad arguments, reserved verb). Matches clap’s own convention for argument errors. - [const HELP_STYLE](https://docs.logicaffeine.com/logicaffeine_cli/ui/constant.HELP_STYLE): Bold cyan — the `help:` prefix. - [const PHASE_STYLE](https://docs.logicaffeine.com/logicaffeine_cli/ui/constant.PHASE_STYLE): Bold green — phase headers (`Compiling`, `Finished`, …), cargo-style. - [const WARN_STYLE](https://docs.logicaffeine.com/logicaffeine_cli/ui/constant.WARN_STYLE): Bold yellow — the `warning:` prefix. - [fn error](https://docs.logicaffeine.com/logicaffeine_cli/ui/fn.error): Print one `error:` block to stderr — for a command that reports several errors before it returns the last as its own. - [fn info](https://docs.logicaffeine.com/logicaffeine_cli/ui/fn.info): Print an informational line to stdout unless `--quiet` is active. - [fn init](https://docs.logicaffeine.com/logicaffeine_cli/ui/fn.init): Install the global output state from the parsed CLI flags. - [fn is_quiet](https://docs.logicaffeine.com/logicaffeine_cli/ui/fn.is_quiet): Whether `--quiet` was passed: informational output should be suppressed. - [fn note](https://docs.logicaffeine.com/logicaffeine_cli/ui/fn.note): Print a note to stderr unless `--quiet` is active — the line that accompanies an artifact on stdout (which lane, which chip) without polluting a redirect. - [fn phase](https://docs.logicaffeine.com/logicaffeine_cli/ui/fn.phase): Print a cargo-style phase header (right-aligned bold-green verb) to stderr unless `--quiet` is active. - [fn render_error](https://docs.logicaffeine.com/logicaffeine_cli/ui/fn.render_error): Render any top-level error to stderr in the `error:`/`help:` style and return the exit code the process should use. - [fn verbosity](https://docs.logicaffeine.com/logicaffeine_cli/ui/fn.verbosity): The `-v` count: `0` normal, `1+` increasingly chatty. - [fn warning](https://docs.logicaffeine.com/logicaffeine_cli/ui/fn.warning): Print one `warning:` block to stderr unless `--quiet` is active.