How are visas. residence permits, and bilateral agreements recorded at EU Schengen borders?
If you have a visa, residence permit, or are using a bilateral visa waiver agreement, then the regular rule of 90 days per 180 days in Schengen doesn't apply to you and you can legally stay longer than 90 days. But how is this recorded in the computers and databases of the border guards, and how is this information shared with other countries?
For example say I spend 89 days in Slovakia and then another 89 days in Italy using a bilateral visa waiver agreement. Then I fly directly from Italy home to the US. The Italian border guard blindly stamps my passport without asking any questions. Is there a chance that even though the guard let me through his computer will automatically flag me and create problems the next time I come back to Europe, even though my stay there was 100% legal?
I'm not asking for information on how visas, residence permits, and bilateral visa waiver agreements work, but only about how the information is recorded and shared.