The question "What do you mean by grammatical?" is not at all a real question. It's either disingenuous -- and given the source, someone who has no problem declaring whether some of the sentences in ELU questions are or aren't grammatical, I'd say that this question is disingenuous -- or rhetorical or an elided isoform of "When you say that a sentence or expression is grammatical or ungrammatical, whose grammar book are you using to make this judgment, what dialect of English are you referring to, and what age of English do you have in mind, Beowulfian, Chaucerian, Shakesperian, Victorian, or Rupert Murdochian"? Specifically, "He's in hospital" in not grammatical in American English but is grammatical in British English. The question is trivial in such a case. "John the biting was bear a" is incontestably not grammatical in any brand of English. The question is trivial in such a case.
There are always reasonable judgments that can be made about specific utterances, but those judgments all depend on context, audience, register, intention, etc. They are mostly about whether something said or written is acceptable, idiomatic, natural, normal, commonplace, understandable, or stylistically good. Changing contexts often mean [NB: The verb can just as easily be singular (means) in this sentence] changing judgments.
I don't think that the terms valid/invalid are appropriate for usage questions. They are from the world of logic and syllogisms and have to do with the conclusions deduced and induced from the premises of an argument.
I don't think that professional linguists are scholars whose expertise prepares them for judging what is "good English" and what is "bad English". Those judgments are usually made by literary critics. A linguist can tell you whether it's grammatical, whether people use that particular expression, where and when native speakers are more or less likely to use it, and other kinds of technical information about language, but linguistic expertise does not necessarily imply aesthetic competence. Some professional linguists are great writers and literary critics, and others are no better (and even often worse) than those wonderful software generators of postmodernist gobbledygook.
"Rules/Guidelines" are usually well-intentioned, artificial, often arbitrary, and personal preferences. Except, of course, for the basic rules of English grammar that we all acquire as native speakers. Anything beyond that, as John Lawler says, falls into the category of the technological: Wanna Learn How to Write and Speak Well? Then RThisFM!
Your question What do we mean? is a good one. But it has to be rewritten to make sense because we don't agree on what we mean. "What do you mean?" can be answered.