Skip to content

vox-compiler API Reference (generated)

Crate: vox-compiler · Version: 0.6.0 · Target: Library (lib.rs)

Unified Vox compiler crate containing lexer, parser, AST, HIR, typechecker, and codegen.

Unified Vox compiler pipeline.

This crate consolidates all core compiler stages: lexing, parsing, AST definition, HIR lowering, type checking, and code generation.

Generated Rust/TS outputs are subject to the same premature-completion policy as hand-written code: after emitting a tree, run vox ci completion-audit (optionally scoped to the output root) or extend CI to scan target/ / app output dirs; see contracts/operations/completion-policy.v1.yaml.

FeatureDefault / Enables
default—
DependencyKind
vox-astNormal
vox-bounded-fsNormal
vox-configNormal
vox-cryptoNormal
vox-evalNormal
vox-foundationNormal
vox-grammar-exportNormal
vox-language-surfaceNormal
vox-python-bridgeNormal
vox-repositoryNormal
vox-secretsNormal
vox-shell-stdlib-typesNormal
vox-telemetryNormal
vox-jsonschema-utilDevelopment
vox-test-harnessDevelopment
ModuleDescription
annotations—
app_contract—
ast_eval—
builtin_registry—
canonical_json—
codegen_ts—
contract_ir—
eval—
feature_matrix—
fmt—
generated_vox—
hir—
language_surface—
lexer—
llm_prompt—
lowering_shared—
module—
parser—
pipeline—
python_array_support—
python_frame_support—
react_bridge—
required_capabilities—
runtime_projection—
rust_interop_support—
serialization—
shell_projection—
target—
tokens—
typeck—
web_prefixes—
Dependency Topology, diagram 125 nodes, 24 edges: vox-compiler → vox-ast; vox-compiler → vox-bounded-fs; vox-compiler → vox-config; vox-compiler → vox-crypto; vox-compiler → vox-eval; vox-compiler → vox-foundation; vox-compiler → vox-grammar-export; vox-compiler → vox-jsonschema-util; vox-compiler → vox-language-surface; vox-co…vox-compilervox-astvox-bounded-fsvox-configvox-cryptovox-evalvox-foundationvox-grammar-exportvox-jsonschema-utilvox-language-surfacevox-python-bridgevox-repositoryvox-secretsvox-auditvox-clivox-cli-civox-cli-researchvox-cli-testsvox-codegenvox-codegen-tsvox-corpusvox-doc-pipelinevox-integration-testsvox-langtoolvox-lsp
Diagram source
graph {
direction: right
node vox_compiler: "vox-compiler"
node vox_ast: "vox-ast"
vox_compiler -> vox_ast
node vox_bounded_fs: "vox-bounded-fs"
vox_compiler -> vox_bounded_fs
node vox_config: "vox-config"
vox_compiler -> vox_config
node vox_crypto: "vox-crypto"
vox_compiler -> vox_crypto
node vox_eval: "vox-eval"
vox_compiler -> vox_eval
node vox_foundation: "vox-foundation"
vox_compiler -> vox_foundation
node vox_grammar_export: "vox-grammar-export"
vox_compiler -> vox_grammar_export
node vox_jsonschema_util: "vox-jsonschema-util"
vox_compiler -> vox_jsonschema_util
node vox_language_surface: "vox-language-surface"
vox_compiler -> vox_language_surface
node vox_python_bridge: "vox-python-bridge"
vox_compiler -> vox_python_bridge
node vox_repository: "vox-repository"
vox_compiler -> vox_repository
node vox_secrets: "vox-secrets"
vox_compiler -> vox_secrets
node vox_audit: "vox-audit"
vox_audit -> vox_compiler
node vox_cli: "vox-cli"
vox_cli -> vox_compiler
node vox_cli_ci: "vox-cli-ci"
vox_cli_ci -> vox_compiler
node vox_cli_research: "vox-cli-research"
vox_cli_research -> vox_compiler
node vox_cli_tests: "vox-cli-tests"
vox_cli_tests -> vox_compiler
node vox_codegen: "vox-codegen"
vox_codegen -> vox_compiler
node vox_codegen_ts: "vox-codegen-ts"
vox_codegen_ts -> vox_compiler
node vox_corpus: "vox-corpus"
vox_corpus -> vox_compiler
node vox_doc_pipeline: "vox-doc-pipeline"
vox_doc_pipeline -> vox_compiler
node vox_integration_tests: "vox-integration-tests"
vox_integration_tests -> vox_compiler
node vox_langtool: "vox-langtool"
vox_langtool -> vox_compiler
node vox_lsp: "vox-lsp"
vox_lsp -> vox_compiler
}
Consumer CrateRole
vox-auditDirect workspace dependent
vox-cliDirect workspace dependent
vox-cli-ciDirect workspace dependent
vox-cli-researchDirect workspace dependent
vox-cli-testsDirect workspace dependent
vox-codegenDirect workspace dependent
vox-codegen-tsDirect workspace dependent
vox-corpusDirect workspace dependent
vox-doc-pipelineDirect workspace dependent
vox-integration-testsDirect workspace dependent
vox-langtoolDirect workspace dependent
vox-lspDirect workspace dependent
vox-ml-cliDirect workspace dependent
vox-orchestrator-mcpDirect workspace dependent
vox-plugin-mens-candle-cudaDirect workspace dependent
vox-plugin-mens-candle-metalDirect workspace dependent
vox-research-shimDirect workspace dependent
vox-rn-codegenDirect workspace dependent
vox-speechDirect workspace dependent
vox-tauri-codegenDirect workspace dependent
vox-terminal-coreDirect workspace dependent
vox-workflow-runtimeDirect workspace dependent
KindSymbolSignatureSourceDescription
structapp_contract::AppContractModulepub struct AppContractModulecrates/vox-compiler/src/app_contract.rs#L24-L37—
structapp_contract::AppMcpToolContractpub struct AppMcpToolContractcrates/vox-compiler/src/app_contract.rs#L41-L45MCP tool surface derived from HIR (@mcp.tool).
structapp_contract::AppMcpResourceContractpub struct AppMcpResourceContractcrates/vox-compiler/src/app_contract.rs#L49-L53MCP resource surface derived from HIR (@mcp.resource).
structapp_contract::AppHttpRouteContractpub struct AppHttpRouteContractcrates/vox-compiler/src/app_contract.rs#L56-L61—
structapp_contract::AppServerFnContractpub struct AppServerFnContractcrates/vox-compiler/src/app_contract.rs#L64-L68—
structapp_contract::AppMutationContractpub struct AppMutationContractcrates/vox-compiler/src/app_contract.rs#L71-L76—
structapp_contract::AppServerConfigContractpub struct AppServerConfigContractcrates/vox-compiler/src/app_contract.rs#L78-L84—
fnapp_contract::project_app_contractpub fn project_app_contract(module: &HirModule) -> AppContractModulecrates/vox-compiler/src/app_contract.rs#L92-L187—
fnapp_contract::canonical_app_contract_bytespub fn canonical_app_contract_bytes(crates/vox-compiler/src/app_contract.rs#L190Canonical JSON bytes for stable app-contract hashing (sorted object keys at every depth).
structast_eval::AstEvalReportpub struct AstEvalReportcrates/vox-compiler/src/ast_eval.rs#L14-L25Result of parsing and analysing a Vox code snippet through the real compiler frontend.
fnast_eval::coverage_scorepub fn coverage_score(&self) -> f64crates/vox-compiler/src/ast_eval.rs#L32-L37Coverage score in [0.0, 1.0] based on the number of distinct construct kinds. Saturates at 8 distinct kinds (fn, type, actor, workflow, table, test, server, query).
fnast_eval::eval_modulepub fn eval_module(module: &Module) -> AstEvalReportcrates/vox-compiler/src/ast_eval.rs#L42-L51Analyse an already-parsed module without re-lexing/re-parsing.
fnast_eval::ast_evalpub fn ast_eval(code: &str) -> AstEvalReportcrates/vox-compiler/src/ast_eval.rs#L58-L70Parse a Vox code snippet through the real compiler pipeline and return a structured report. This replaces the regex-based vox_eval::detect_constructs with a true parser-backed analysis, addressing research Gap G-15 (regex eval misses syntactic context).
enumbuiltin_registry::BuiltinArgKindpub enum BuiltinArgKindcrates/vox-compiler/src/builtin_registry.rs#L7-L11Parameter kind for registry-driven codegen (str lowers with .as_str()).
structbuiltin_registry::BuiltinRegistryEntrypub struct BuiltinRegistryEntrycrates/vox-compiler/src/builtin_registry.rs#L15-L26Builtin callable shape shared by typecheck and codegen lookup.
fnbuiltin_registry::builtin_entry_param_tyspub fn builtin_entry_param_tys(entry: BuiltinRegistryEntry) -> Option<Vec<Ty>>crates/vox-compiler/src/builtin_registry.rs#L30-L54Parameter types for a registry entry (shared by typecheck namespace methods).
fnbuiltin_registry::builtin_entry_result_typub fn builtin_entry_result_ty(entry: BuiltinRegistryEntry) -> Tycrates/vox-compiler/src/builtin_registry.rs#L58-L64Result type for a registry entry (Result[str] or Result[unit]).
fnbuiltin_registry::builtin_registry_entriespub fn builtin_registry_entries() -> &'static [BuiltinRegistryEntry]crates/vox-compiler/src/builtin_registry.rs#L68Stable subset of builtins with shared registry ownership.
fnbuiltin_registry::lookup_builtinpub fn lookup_builtin(crates/vox-compiler/src/builtin_registry.rs#L504—
fnbuiltin_registry::std_root_field_typub fn std_root_field_ty(field: &str) -> Option<Ty>crates/vox-compiler/src/builtin_registry.rs#L529-L555std.<field> type members on the root namespace.
fnbuiltin_registry::std_namespace_method_typub fn std_namespace_method_ty(namespace: &str, method: &str) -> Option<Ty>crates/vox-compiler/src/builtin_registry.rs#L559std.<namespace>.<method> signatures used by type checking.
fnbuiltin_registry::std_namespace_runtime_callpub fn std_namespace_runtime_call(crates/vox-compiler/src/builtin_registry.rs#L850Shared runtime call lowering for std.<namespace>.<method> in Rust codegen.
fnbuiltin_registry::namespace_builtin_ownedpub fn namespace_builtin_owned(namespace: &str) -> boolcrates/vox-compiler/src/builtin_registry.rs#L1372-L1376True if namespace is owned by the canonical [NAMESPACE_BUILTINS] table (i.e. its full method set is declared there). Used by the typecheck gate.
fnbuiltin_registry::namespace_builtin_listedpub fn namespace_builtin_listed(namespace: &str, method: &str) -> boolcrates/vox-compiler/src/builtin_registry.rs#L1380-L1384True if (namespace, method) is listed in [NAMESPACE_BUILTINS].
fncanonical_json::sort_json_value_keyspub fn sort_json_value_keys(v: &mut serde_json::Value)crates/vox-compiler/src/canonical_json.rs#L10-L31Recursively sort JSON object keys for cross-toolchain-stable canonical bytes.
structcodegen_ts::GeneratedFilespub struct GeneratedFilescrates/vox-compiler/src/codegen_ts.rs#L17-L20Output of TypeScript code generation.
fncodegen_ts::generatepub fn generate(_hir: &HirModule) -> Result<GeneratedFiles, String>crates/vox-compiler/src/codegen_ts.rs#L29-L36Generate TypeScript/TSX code from HIR. # Errors Returns Err with diagnostic code E0404 when the TS codegen backend is not available in this build. Callers in production use vox-codegen directly; this shim is for compiler-internal test utilities only.
structcodegen_ts::EmitCtxpub struct EmitCtx<'a>crates/vox-compiler/src/codegen_ts.rs#L45-L47Emission context stub.
fncodegen_ts::newpub fn new(state_names: &'a HashSet<String>) -> Selfcrates/vox-compiler/src/codegen_ts.rs#L51-L55Create stub context.
fncodegen_ts::emit_hir_exprpub fn emit_hir_expr(_expr: HirExpr, _ctx: &EmitCtx<'_>) -> Stringcrates/vox-compiler/src/codegen_ts.rs#L59-L61Stub emit function.
fncodegen_ts::map_jsx_attr_namepub fn map_jsx_attr_name(name: &str) -> Stringcrates/vox-compiler/src/codegen_ts.rs#L64-L66Stub for JSX attribute mapping.
fncodegen_ts::nooppub fn noop()crates/vox-compiler/src/codegen_ts.rs#L71Marker for backwards compatibility.
structcontract_ir::ContractIrpub struct ContractIrcrates/vox-compiler/src/contract_ir/mod.rs#L41-L46The wire-format projection of a Vox HIR module.
structcontract_ir::ContractTypepub struct ContractTypecrates/vox-compiler/src/contract_ir/mod.rs#L50-L53A single named type at the wire boundary.
enumcontract_ir::ContractTypeKindpub enum ContractTypeKindcrates/vox-compiler/src/contract_ir/mod.rs#L57-L62Shape of a [ContractType].
structcontract_ir::ContractFieldpub struct ContractFieldcrates/vox-compiler/src/contract_ir/mod.rs#L66-L72A field on a struct or variant.
structcontract_ir::ContractVariantpub struct ContractVariantcrates/vox-compiler/src/contract_ir/mod.rs#L76-L80One variant of a sum type.
enumcontract_ir::WireTypepub enum WireTypecrates/vox-compiler/src/contract_ir/mod.rs#L90-L113Wire-level type alphabet. Reflects the encoding rules of wire-format-v1: - Decimal → string (precision-preserving) - BigInt → string (JSON Number can’t hold > 2^53 safely) - Date / DateTime → RFC 3339 UTC string - Option<T> → presence-or-absence of key (carried on [ContractField::optional])
structcontract_ir::ContractEndpointpub struct ContractEndpointcrates/vox-compiler/src/contract_ir/mod.rs#L117-L129A request-response endpoint at the wire boundary.
enumcontract_ir::ContractEndpointKindpub enum ContractEndpointKindcrates/vox-compiler/src/contract_ir/mod.rs#L133-L137Mirrors [HirEndpointKind] without exposing it as a public name.
enumcontract_ir::HttpMethodpub enum HttpMethodcrates/vox-compiler/src/contract_ir/mod.rs#L141-L146HTTP method bound to an endpoint.
fncontract_ir::as_strpub fn as_str(&self) -> &'static strcrates/vox-compiler/src/contract_ir/mod.rs#L149-L156—
fncontract_ir::projectpub fn project(hir: &HirModule) -> ContractIrcrates/vox-compiler/src/contract_ir/mod.rs#L163-L168Project a HIR module into Contract IR. This is the single wire-format-aware traversal of HIR. All wire-format emitters should consume the result rather than walking HIR themselves.
fncontract_ir::project_typepub fn project_type(ty: &HirType) -> WireTypecrates/vox-compiler/src/contract_ir/mod.rs#L174-L176Map a [HirType] to its wire representation. Public so emitters can lift function-parameter and return types into the same wire alphabet without re-implementing the rules.
fncontract_ir::default_methodpub fn default_method(self) -> HttpMethodcrates/vox-compiler/src/contract_ir/mod.rs#L194-L199Default HTTP method for a given endpoint kind. Query is GET (cacheable, idempotent, no body). Mutation and Server are POST. Phase 3 (@endpoint(method: …)) will let users override this.