macro_rules! assert_stage_contract {
($stage:expr) => { ... };
}Expand description
Assert that a stage satisfies all seven universal contracts defined in the Normy white paper.
This macro is the single source of truth for stage correctness. Every stage must pass it. It is deliberately exhaustive and unforgiving — because production NLP pipelines demand it.
§The Seven Universal Contracts:
zero_copy_when_no_changes→ no allocation when input == outputfused_path_equivalent_to_apply→ static fused path produce identical results to apply()stage_is_idempotent→ applying twice yields same result as onceneeds_apply_is_accurate→ correctly predicts whether apply() would change texthandles_empty_string_and_ascii→ graceful on edge casesno_panic_on_mixed_scripts→ survives pathological real-world input- (Implicit)
Send + Sync + 'static→ required by trait bounds
Failure of any contract is a critical bug.