Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

mod host bridge - Verification and traceability

Platform spec article

mod host bridge - Verification and traceability

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

This article documents verification and traceability for mod host bridge.

AnchorRole
compiler/crates/beskid_aot/src/mod_artifact.rsMod AOT artifact build, cache key tuple, descriptor emission.
compiler/crates/beskid_analysis/src/mod_host/Reference mod host orchestration: discovery, capabilities, validation, contract dispatch, typed merge / reparse, analyze / rewrite.
compiler/crates/beskid_analysis/src/mod_host/diagnostics.rsStructured ModHostIssue / ModHostDiagnostics with E1828, E1829, E1830, E1831, E1851, E1852, E1853, E1854, E1855.
compiler/crates/beskid_analysis/src/mod_host/validate.rsPre-mod.collect cross-artifact validation pass.
compiler/crates/beskid_analysis/src/mod_host/invoker.rsContractInvoker trait + StubContractInvoker / ScriptedContractInvoker test surfaces.
compiler/crates/beskid_analysis/src/services/front_end.rsFront-end integration for run_through_generate before semantic diagnostics and run_analyze_rewrite after semantic work.
compiler/crates/beskid_codegen/src/services.rsLowering / codegen integration for mod host phases before lower.ready.
compiler/crates/beskid_pipeline/src/phases.rsLiteral mod.load, mod.collect, mod.generate, mod.analyze, mod.rewrite phase ids.
AnchorCoverage
compiler/crates/beskid_analysis/src/mod_host/api.rs (unit tests)Skip mod phases on no-mod plans, dispatch all four contract kinds through StubContractInvoker, abort on duplicate (contractId, typeId) registration with E1829.
compiler/crates/beskid_analysis/src/mod_host/validate.rs (unit tests)Per-issue assertions for E1828, E1829, E1851, E1852, E1853, E1854, plus a clean-load pass.
compiler/crates/beskid_tests/src/mods/contract_dispatch.rsEnd-to-end dispatch through every contract kind against the sample_mod fixture; canonical pipeline phase order.
compiler/crates/beskid_tests/src/mods/conflicts.rsEnd-to-end E1828, E1829, E1853, E1854 scheduling abort tests against the sample_mod fixture.
compiler/crates/beskid_tests/fixtures/mods/sample_mod/Reference compiler-mod fixture exercising Collector, Generator, AttributeGenerator, Analyzer, Rewriter.
compiler/crates/beskid_engine/tests/mod_host.rsEngine-level integration: drives the full pipeline and JIT-compiles the lowered host program.
compiler/crates/beskid_tests/src/analysis/pipeline/mod_phases.rsPipeline-phase ordering subsequence assertions and FULL_BUILD_PHASE_ORDER regression.
  • Phase ids — Unit or integration tests must assert the literal strings from Compiler Mods / Mod projects and pipeline phase ids appear in beskid_pipeline observations (see Stage ordering / verification).
  • Contract dispatchContractInvoker is dispatched once per scheduled (contractId, typeId, entrySymbol) tuple per phase, with Collector / Generator outcomes returned from run_through_generate and Analyzer / Rewriter outcomes returned from run_analyze_rewrite_with_invoker.
  • Capabilities — Table-driven tests in compiler/crates/beskid_analysis/src/mod_host/capabilities.rs verify each capability grants / denies the documented effect and emits codes from the E1821–E1835 band on denial.
  • AOT artifacts — Tests assert descriptor schema, cache key invalidation, and E1821–E1835 on deliberate load failures (AOT artifact contract).
  • Scheduling conflicts — Tests assert E1828, E1829, E1851–E1855 short-circuit scheduling before mod.collect is observed (see compiler/crates/beskid_tests/src/mods/conflicts.rs and the scheduling-conflict band in AOT artifact contract).
  • Merge — Tests assert atomic typed-emit commit at syntax.generation: partial emit never reaches lower.ready (pair with Typed emitter / verification once populated).
  • Incremental traces — Optional goldens validate invalidation when syntax edits move spans tied to mod contract registrations (Incremental scheduling / verification).
  • Update this bundle whenever public Beskid.Compiler.* shapes or host policies change.