HOUSTON — Major League Baseball, we know, is governed by both a comprehensive set of official rules and a vague code of unwritten ones. The latter have been so frequently, thoroughly and convincingly decried in recent seasons that the take is now long past tired, to the point that even the league itself is now in on the fun.

But an incident in Sunday’s ALCS Game 2 between the Red Sox and Astros highlights how at least one of the sport’s unwritten rules seems to serve its players well. During Red Sox reliever Matt Barnes’ appearance, television cameras caught him touching one specific portion of his glove arm with his throwing hand between pitches, and — unsurprisingly — fans took notice:

Here’s a look at Barnes’ left arm during Game 2. If you look closely, you can see where it’s a little discolored and shiny.

Rule 6.02(c)(4) in Major League Baseball’s rulebook states, “The pitcher shall not apply a foreign substance of any kind to the ball,” and that violation of the rule is grounds for immediate ejection and a 10-game suspension.

The existence of the rule makes sense: Foreign substances like pine tar or vaseline can be used to doctor baseballs and create unnatural movement on pitches. That’s cheating, and the rule exists to prevent it from happening.

But in an era in which baseballs are replaced more frequently during play than ever before, and especially after an apparent change to the constitution of the official balls to make them slicker and their seams lower, pitchers across the league rely on sticky substances to enhance their grips. Subtly applied pine tar, hair gel or sunscreen — possibly mixed with rosin from the bag on the back of the mound — help guys maintain more control of the baseball, and no one in the game seems to mind.

“Honestly, it’s not even something that’s crossed my mind,” said Astros manager A.J. Hinch on Monday, when told about Barnes’ viral moment. “There’s a lot of attention on everything. There’s an answer for everything. There’s a lot of experts. There’s a lot of curiosities. I think there are so many good storylines in this series that I hope that something like that doesn’t even really get more than one click.

“There’s so much difference between doctoring a ball versus kind of what goes on nowadays.”

Hinch’s Astros are hardly immune to outside criticisms like those now facing Barnes. Earlier this season, Indians pitcher Trevor Bauer strongly implied the Houston club was using a foreign substance to improve spin rates on fastballs. Umpires checked catcher Martin Maldonado’s glove during Game 1 of this series.

“Seems like always those videos always come out in October — I wonder why,” Red Sox manager Alex Cora said. “You have to ask the hitters. They like guys that can control their stuff. So I just leave it at that.

“It is what it is. Everybody knows.”

Cora is right: Inside baseball, everybody knows. Everybody knows that many pitchers find substances to apply to their fingers to better grip baseballs. Hitters abide it because they prefer if the guy about to throw a 100-mph fastball in their direction has some sense of where it’s going, and because they know at least one guy on their side is doing the same thing.

So why not just change the written rules? Legalizing foreign substances for pitchers could open avenues for guys to abuse them, and there’s a huge distinction in the effects of a guy applying a little pine tar to his fingers and a guy using it to coat the whole ball. It is, as I’ve written before, something umpires need to be able to enforce in egregious cases, but also something practically every player and manager will put up with when done with restraint.

At some point, maybe, some incident will force a pine-tar reckoning, and the league will need to determine exactly how and when pitchers can use sticky substances on the mound. But right now, it seems, the status quo is working: Flout the rules and you’ll get busted, subtly circumvent them and no one will care.