Static copy
Copied from docs/en/trajectory/wave-1-contracts.md in https://github.com/poppy-team/aipo-lang (MIT). Pinned to revision ce47c4e070404fc41722ccd8e2b7b808b99062a8, blob ba0fe72f95adf12941edb20a26399f5cb2402814. The source repository remains canonical; this copy is refreshed through a sync pull request, not live.
Wave 1 elevated Aipo beyond conventional interpreters by introducing its defining architectural paradigm: structural data guarantees through signature contracts, atomic rollback invariants, and formal interfaces.
init and invariant) init() hook ensures that newly instantiated structures undergo validation and normalization before exposure to consumer code.invariant() block was integrated into stable mutation boundaries. Whenever a struct field is mutated, the runtime rigorously validates declared logical assertions.attempt ... recover attempt block initiates recording of all subsequent object mutations into a rollback journal.fail) occurs or an invariant() assertion is violated, the journal atomically reverts all modified structs to their pre-attempt state before transferring execution to the recover block.self receiver compatibility.FillSelfCapture bytecode instruction.impl methods and closures.