Skip to main content

Module validate

Module validate 

Source
Expand description

Manifest validator — semantic rules over a parsed Manifest. Mirrors packages/mesofact-runtime/src/validate.ts. Used by the proxy on boot (refuse a malformed manifest, keep the old one live) and by the build to reject forbidden shapes before HTML hits R2.

Structural validation comes “for free” from serde — call validate only after serde_json::from_str::<Manifest>(...) succeeds.

Rules enforced:

  • R1 (Mode1ScopedSource) — a Mode::Static route whose source_reads names any non-global source is rejected.
  • R2 (Mode1RequiresUser) — a Mode::Static route whose requires contains Requires::User is rejected.
  • R3 (UnknownHook) — a hooks entry naming a hook the engine does not invoke is rejected (R756-F6 / W311 §2).

See .yah/docs/architecture/mesofact.md §“Render axis × source axis”.

Structs§

ValidationError

Enums§

SourceScope
ValidationErrorKind

Constants§

HOOK_NAMES
Every Mode 2 hook name the engine knows how to invoke. Mirrors HOOK_NAMES in packages/mesofact-runtime/src/hooks.ts and mesofact_render::route_config.

Functions§

validate

Type Aliases§

SourceCatalog