pub fn apply_patch( state: &CognitiveState, patch: &Patch, ) -> Result<CognitiveState, Vec<Diagnostic>>