Skip to content

vox-codegen API Reference (generated)

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

Codegen + WebIR + hir_export extracted from vox-compiler. Consumes analysis types from vox-compiler.

Emit-side of the Vox compiler: codegen (Rust + TS), web_ir, hir_export, syntax_k.

This crate consumes analysis types (AST, HIR, typeck, etc.) from vox-compiler and produces output artifacts. The split decouples emit-stage rebuilds from analysis-stage iteration.

FeatureDefault / Enables
default—
standalone—
DependencyKind
vox-compilerNormal
vox-configNormal
vox-deploy-codegenNormal
vox-repositoryNormal
vox-secretsNormal
vox-sqlNormal
vox-tauri-codegenNormal
vox-dbDevelopment
vox-jsonschema-utilDevelopment
ModuleDescription
bundler—
canonical_ladder—
codegen_rust—
codegen_shared—
codegen_ts—
emission_profile—
frontend_backend—
hir_export—
projection_bundle—
syntax_k—
web_ir—
web_migration_env—
assets—
Dependency Topology, diagram 119 nodes, 18 edges: vox-codegen → vox-compiler; vox-codegen → vox-config; vox-codegen → vox-db; vox-codegen → vox-deploy-codegen; vox-codegen → vox-jsonschema-util; vox-codegen → vox-repository; vox-codegen → vox-secrets; vox-codegen → vox-sql; vox-codegen → vox-tauri-codegen; vox-cli → vox-codegen…vox-codegenvox-compilervox-configvox-dbvox-deploy-codegenvox-jsonschema-utilvox-repositoryvox-secretsvox-sqlvox-tauri-codegenvox-clivox-cli-researchvox-cli-testsvox-codegen-tsvox-integration-testsvox-langtoolvox-orchestrator-mcpvox-rn-codegenvox-workflow-runtime
Diagram source
graph {
direction: right
node vox_codegen: "vox-codegen"
node vox_compiler: "vox-compiler"
vox_codegen -> vox_compiler
node vox_config: "vox-config"
vox_codegen -> vox_config
node vox_db: "vox-db"
vox_codegen -> vox_db
node vox_deploy_codegen: "vox-deploy-codegen"
vox_codegen -> vox_deploy_codegen
node vox_jsonschema_util: "vox-jsonschema-util"
vox_codegen -> vox_jsonschema_util
node vox_repository: "vox-repository"
vox_codegen -> vox_repository
node vox_secrets: "vox-secrets"
vox_codegen -> vox_secrets
node vox_sql: "vox-sql"
vox_codegen -> vox_sql
node vox_tauri_codegen: "vox-tauri-codegen"
vox_codegen -> vox_tauri_codegen
node vox_cli: "vox-cli"
vox_cli -> vox_codegen
node vox_cli_research: "vox-cli-research"
vox_cli_research -> vox_codegen
node vox_cli_tests: "vox-cli-tests"
vox_cli_tests -> vox_codegen
node vox_codegen_ts: "vox-codegen-ts"
vox_codegen_ts -> vox_codegen
node vox_integration_tests: "vox-integration-tests"
vox_integration_tests -> vox_codegen
node vox_langtool: "vox-langtool"
vox_langtool -> vox_codegen
node vox_orchestrator_mcp: "vox-orchestrator-mcp"
vox_orchestrator_mcp -> vox_codegen
node vox_rn_codegen: "vox-rn-codegen"
vox_rn_codegen -> vox_codegen
node vox_workflow_runtime: "vox-workflow-runtime"
vox_workflow_runtime -> vox_codegen
}
Consumer CrateRole
vox-cliDirect workspace dependent
vox-cli-researchDirect workspace dependent
vox-cli-testsDirect workspace dependent
vox-codegen-tsDirect workspace dependent
vox-integration-testsDirect workspace dependent
vox-langtoolDirect workspace dependent
vox-orchestrator-mcpDirect workspace dependent
vox-rn-codegenDirect workspace dependent
vox-workflow-runtimeDirect workspace dependent
KindSymbolSignatureSourceDescription
structassets::AssetManifestpub struct AssetManifestcrates/vox-codegen/src/assets/mod.rs#L10-L14Resolved asset paths relative to a Vox.toml directory, staged under target/generated/....
fnassets::from_bundle_fragmentpub fn from_bundle_fragment(crates/vox-codegen/src/assets/mod.rs#L19Build a manifest from [bundle.assets] fragments (paths are relative to manifest_dir).
fnassets::validate_preflightpub fn validate_preflight(&self) -> Result<()>crates/vox-codegen/src/assets/mod.rs#L51-L64Ensure every referenced path exists under the manifest directory.
fnassets::stage_underpub fn stage_under(&self, dest_root: &Path) -> Result<()>crates/vox-codegen/src/assets/mod.rs#L67-L81Copy declared assets into dest_root, preserving relative paths beneath manifest_dir.
structcanonical_ladder::LadderFixturepub struct LadderFixturecrates/vox-codegen/src/canonical_ladder.rs#L10-L15One curated golden fixture and the language concerns it proves end-to-end.
structcanonical_ladder::CanonicalLadderpub struct CanonicalLaddercrates/vox-codegen/src/canonical_ladder.rs#L19-L23Parsed canonical ladder contract.
fncanonical_ladder::load_from_repo_rootpub fn load_from_repo_root(repo_root: &Path) -> Result<Self, String>crates/vox-codegen/src/canonical_ladder.rs#L27-L32Load ladder YAML from repo_root/contracts/pipeline/canonical-ladder.v1.yaml.
fncanonical_ladder::fixturepub fn fixture(&self, id: &str) -> Option<&LadderFixture>crates/vox-codegen/src/canonical_ladder.rs#L36-L38Find a fixture by stable id.
fncanonical_ladder::fixture_idspub fn fixture_ids(&self) -> BTreeSet<String>crates/vox-codegen/src/canonical_ladder.rs#L42-L44Stable fixture ids (for k-complexity budget scoping).
fncanonical_ladder::all_proves_tagspub fn all_proves_tags(&self) -> BTreeSet<String>crates/vox-codegen/src/canonical_ladder.rs#L48-L53Union of all proves tags across fixtures.
fncanonical_ladder::fixture_vox_pathpub fn fixture_vox_path(&self, repo_root: &Path, id: &str) -> Option<PathBuf>crates/vox-codegen/src/canonical_ladder.rs#L57-L59Absolute path to a golden .vox file under repo_root.
enumcodegen_rust::RustAppShellpub enum RustAppShellcrates/vox-codegen/src/codegen_rust/mod.rs#L21-L25Selects the generated Rust application shell for full-stack app bundles. - [RustAppShell::AxumLocalServer] — localhost Axum + embedded assets (native-binary, default vox build). - [RustAppShell::TauriApp] — Tauri 2 packaging path (vox compile --target desktop|mobile-*).
enumemission_profile::ProfileSeveritypub enum ProfileSeveritycrates/vox-codegen/src/emission_profile.rs#L22-L25Severity for profile-level diagnostics (mirrors WebIR advisory vs hard split).
structemission_profile::ProfileDiagnosticpub struct ProfileDiagnosticcrates/vox-codegen/src/emission_profile.rs#L29-L33Unified diagnostic emitted by [EmissionProfile].
structemission_profile::EmissionProfilepub struct EmissionProfilecrates/vox-codegen/src/emission_profile.rs#L37-L39Per-target validation rules for a lowered [ProjectionBundle].
fnemission_profile::for_targetpub fn for_target(target: Target) -> Selfcrates/vox-codegen/src/emission_profile.rs#L43-L45—
fnemission_profile::validate_bundlepub fn validate_bundle(&self, bundle: &ProjectionBundle) -> Vec<ProfileDiagnostic>crates/vox-codegen/src/emission_profile.rs#L49-L51Validate a full projection bundle for this target.
fnemission_profile::validate_bundle_with_registrypub fn validate_bundle_with_registry(crates/vox-codegen/src/emission_profile.rs#L55Validate with optional token registry (enables palette/contrast checks on web path).
fnemission_profile::validate_web_modulepub fn validate_web_module(crates/vox-codegen/src/emission_profile.rs#L70Validate a standalone WebIR module (emitter path that has not yet assembled full bundle).
fnemission_profile::web_ir_as_diagnosticspub fn web_ir_as_diagnostics(crates/vox-codegen/src/emission_profile.rs#L82Return web-IR diagnostics converted into the unified [Diagnostic] envelope so that vox check --for-llm callers see web-IR failures alongside typeck errors. Only the TypeScript / RustTauri targets produce WebIR; other targets return an empty vec.
fnemission_profile::hard_profile_errorspub fn hard_profile_errors(diags: &[ProfileDiagnostic]) -> Vec<ProfileDiagnostic>crates/vox-codegen/src/emission_profile.rs#L165-L171Returns hard (non-advisory) profile diagnostics only.
fnfrontend_backend::emit_frontendpub fn emit_frontend(crates/vox-codegen/src/frontend_backend.rs#L26Emit the frontend for target from a lowered hir. # Errors Returns Err if target is not a frontend emission target, or if the underlying emitter fails.
structhir_export::VoxIrModulepub struct VoxIrModulecrates/vox-codegen/src/hir_export/mod.rs#L12-L16The General Vox IR module structure, representing a machine-verifiable and platform-agnostic view of a Vox program.
structhir_export::VoxIrMetadatapub struct VoxIrMetadatacrates/vox-codegen/src/hir_export/mod.rs#L19-L23—
structhir_export::VoxIrContentpub struct VoxIrContentcrates/vox-codegen/src/hir_export/mod.rs#L27-L43The internal structure containing the lowered program logic.
structprojection_bundle::ProjectionBundlepub struct ProjectionBundlecrates/vox-codegen/src/projection_bundle.rs#L22-L28All machine-readable projections from one HirModule.
fnprojection_bundle::project_bundle_from_hirpub fn project_bundle_from_hir(hir: &HirModule) -> ProjectionBundlecrates/vox-codegen/src/projection_bundle.rs#L32-L40Lower and project every SSOT surface from hir in one pass.
fnprojection_bundle::project_and_validatepub fn project_and_validate(crates/vox-codegen/src/projection_bundle.rs#L43Project from HIR and run the unified [EmissionProfile] validate gate for target.
fnprojection_bundle::project_and_validate_with_registrypub fn project_and_validate_with_registry(crates/vox-codegen/src/projection_bundle.rs#L51Project and validate with optional token registry (palette / contrast on web targets).
structsyntax_k::SyntaxKCompressorResultpub struct SyntaxKCompressorResultcrates/vox-codegen/src/syntax_k.rs#L31-L36Per-compressor observation for one output payload.
structsyntax_k::SyntaxKNcdPerCompressorpub struct SyntaxKNcdPerCompressorcrates/vox-codegen/src/syntax_k.rs#L40-L43Per-compressor NCD against a baseline payload.
structsyntax_k::SyntaxKNcdSummarypub struct SyntaxKNcdSummarycrates/vox-codegen/src/syntax_k.rs#L47-L50NCD summary against a baseline payload.
structsyntax_k::SyntaxKEventpub struct SyntaxKEventcrates/vox-codegen/src/syntax_k.rs#L54-L70Versioned syntax_k_event payload shape for research_metrics.metadata_json.
structsyntax_k::SyntaxKInputpub struct SyntaxKInput<'a>crates/vox-codegen/src/syntax_k.rs#L74-L82Input for one syntax-K observation.
fnsyntax_k::sha3_hexpub fn sha3_hex(bytes: &[u8]) -> Stringcrates/vox-codegen/src/syntax_k.rs#L85-L89Canonical SHA3-256 lowercase hex digest of arbitrary bytes.
fnsyntax_k::canonical_web_ir_bytespub fn canonical_web_ir_bytes(module: &WebIrModule) -> Result<Vec<u8>, serde_json::Error>crates/vox-codegen/src/syntax_k.rs#L99-L103Deterministic JSON bytes for WebIR (sorted keys at every object depth).
fnsyntax_k::canonical_emitted_files_bytespub fn canonical_emitted_files_bytes(files: &[(String, String)]) -> Vec<u8>crates/vox-codegen/src/syntax_k.rs#L106-L117Deterministic canonical bytes for emitted file outputs.
structsyntax_k::RepresentabilityPayloadpub struct RepresentabilityPayloadcrates/vox-codegen/src/syntax_k.rs#L209-L215Pipeline stages for [enrich_syntax_k_support_metrics] (first_failing_stage).
fnsyntax_k::enrich_syntax_k_support_metricspub fn enrich_syntax_k_support_metrics(crates/vox-codegen/src/syntax_k.rs#L219Attach representability, optional llm_surface, and optional runtime_projection to Syntax-K support_metrics.
fnsyntax_k::measure_syntax_k_eventpub fn measure_syntax_k_event(input: SyntaxKInput<'_>) -> std::io::Result<SyntaxKEvent>crates/vox-codegen/src/syntax_k.rs#L277-L321Measure practical syntax-K event payload for one canonical output object.
enumweb_ir::WebIrVersionpub enum WebIrVersioncrates/vox-codegen/src/web_ir/mod.rs#L49-L53Increment when the schema gains breaking layout changes. ADR 012 CP-002.
enumweb_ir::ZTierpub enum ZTiercrates/vox-codegen/src/web_ir/mod.rs#L60-L68Normative Z-tiers for the seven-tier ladder (ADR 034 / VUV Layered Layout Discipline). Rule 2: within-tier ordering is deliberately unspecified.
fnweb_ir::from_strpub fn from_str(s: &str) -> Option<Self>crates/vox-codegen/src/web_ir/mod.rs#L73-L84—
fnweb_ir::to_strpub fn to_str(self) -> &'static strcrates/vox-codegen/src/web_ir/mod.rs#L86-L96—
fnweb_ir::z_valuepub fn z_value(self) -> i32crates/vox-codegen/src/web_ir/mod.rs#L102-L104Canonical z-index for this tier. Single source of truth for the z-ladder (tier N → N × 100); layer_emit::tier_z_index mirrors this for LayerTier, and the parity test ztier_and_layertier_agree_on_names_and_order keeps the two enums lock-step. Do NOT hand-roll per-tier z numbers elsewhere.