Skip to content

WebIR / HIR split-brain inventory (2026)

This document is the baseline split-brain map for the WebIR/HIR unification compare-both ADR. It lists where semantics are duplicated, bridged, or owned by a single projection so follow-up work can remove drift without guessing.

StageCrate / moduleRole
AST → HIRvox-compiler / hir::lowerTyped module shape (HirModule), migration fields, endpoints, reactive components.
HIR → WebIRvox-codegen / web_ir::lowerlower_hir_to_web_ir — routes, styles, behaviors, DOM arena + view_roots.
WebIR validatevox-codegen / web_ir::validateStructural + a11y + route contract gates (VOX_WEBIR_VALIDATE, default on).
HIR → TS (legacy compat)vox-codegen / codegen_ts::hir_emitemit_hir_expr / JSX string emit; must stay aligned with web_ir::emit_tsx attribute matrix (hir_emit::compat, web_ir::primitives).
HIR → TS (reactive bridge)vox-codegen / codegen_ts::reactiveWebIR emit_component_view_tsx is canonical for view:; emit_hir_expr is parity-only; blocking WebIR issues fail fast (see ReactiveViewBridgeStats).
HIR → AppContractvox-compiler / app_contractHTTP + @endpoint surface (also bundle.app via projection_bundle).
HIR → RuntimeProjectionvox-compiler / runtime_projectionDB plan snapshots + task capability hints (explicitly not WebIR); also bundle.runtime.
HIR → ShellProjectionvox-compiler / shell_projectionTyped @back_button / @deep_link / @push mirror consumed as bundle.shell (e.g. mobile_emit).
HIR → RequiredRuntimeCapabilitiesvox-compiler / required_capabilitiesSorted capability id set for packaging (bundle.capabilities → Tauri projection subset in vox compile).
HIR → mobile.tsvox-codegen / codegen_ts::mobile_emitEmits from ShellProjectionModule (not raw HirModule fields).
Tauri packagingvox-tauri-codegentauri.conf.json hints under target/generated/tauri-packaging/; see packaging SSOT.

1. Reactive view: — WebIR canonical (legacy fallback removed)

Section titled “1. Reactive view: — WebIR canonical (legacy fallback removed)”
  • Files: crates/vox-codegen/src/codegen_ts/reactive.rs, crates/vox-codegen/src/web_ir/emit_tsx.rs, crates/vox-codegen/src/codegen_ts/hir_emit/mod.rs.
  • Mechanism: Validated WebIR view TSX is always selected for the emitted return; emit_hir_expr runs only to classify parity (WebIrViewEmitted vs WebIrViewEmittedParityMismatch). Blocking validate_web_ir diagnostics or missing Web IR view roots fail fast (placeholder return + reactive_view_emit_failures).
  • Risk: Divergence in JSX attribute names, primitive kwargs (web_ir::primitives vs transform_hir_view_kwargs), or handler await threading.
  • Mitigation in tree: Shared map_jsx_attr_name, expand_bind_hir_attribute / lower_jsx_attr_pair, transform_hir_view_kwargs used from web_ir::lower.
  • Tests: crates/vox-compiler/tests/reactive_smoke_test.rs (reactive_codegen_uses_webir_canonical_view), web_ir_lower_emit_test.rs, integration pipeline tests.
  • Files: crates/vox-codegen/src/codegen_ts/route_manifest.rs (WebIrModule route trees; comment // Source: WebIR RouteTree → TS).
  • Risk: Low if lower_hir_to_web_ir is the single route-tree source; HIR-only route emitters must not bypass WebIR for manifest rows.

3. Mobile / shell primitives — ShellProjection + required capabilities

Section titled “3. Mobile / shell primitives — ShellProjection + required capabilities”
Test / artifactWhat it proves
crates/vox-compiler/tests/projection_parity_test.rsBundle + per-projection canonical bytes are deterministic; bundle fixture asserts distinct hashes and expected capability_ids; @back_button fixture guards shell + triplet stability.
web_ir_lower_emit_test.rsLower + validate + serde round-trip + validator edge cases.
reactive_smoke_test.rsreactive_codegen_uses_webir_canonical_view (non-ignored) pins Path C WebIR emit + bridge stats.
vox-arch-check [[forbidden_pattern]] (projection-bundle-*-emit-boundary in layers.toml)Bans direct lower_hir_to_web_ir / project_* in codegen_ts/** and codegen_rust/** outside projection_bundle.rs.
web_ir_environment_gates_test.rsVOX_WEBIR_VALIDATE fail-closed behavior.

Quantitative grep anchors (maintenance signal)

Section titled “Quantitative grep anchors (maintenance signal)”

Rough reference counts under crates/vox-codegen (subject to churn):

  • emit_hir_expr — concentrated in hir_emit/mod.rs (compat string emitter + WebIR lowering helper).
  • lower_hir_to_web_ir / validate_web_irweb_ir/*, emitter.rs, build.rs, integration pipeline.
  • Interpretation: Unification is not “delete WebIR calls” until hir_emit JSX paths are retired or folded behind a single printer; see ADR Option B recommendation.