When adding or editing statements, Wikibase automatically adds the value to the edit summary:
Created claim: Oxford Reference overview ID (P12582): 20110803095349707
When the value is an entity ID, it is shown as a link with a nicely formatted label:
Added reference to claim: instance of (P31): human (Q5)
The raw edit summary contains a wikilink like [[Q5]], and then a hook handler formats that link on display.
However, the way the wikilink is emitted is currently a bit hacky. The values are ostensibly formatted for the edit summary as “plain text”; however, the WikibaseRepo.SummaryFormatter service wiring modifies the entity type definitions to replace the formatter factory callbacks, so that an EntityIdPlainLinkFormatter is used to format entity ID values when “plain text” is requested.
This is kinda hacky, confusing (wikilinks aren’t plain text!), and doesn’t work for entity ID values that aren’t registered as full entity types (i.e. EntitySchema values). It would instead be cleaner to introduce a new snak format for edit summaries, alongside plain text, wikitext and HTML. (Note that SnakFormatter:FORMAT_* already includes several variants of HTML, so we could likewise consider the “summary” format to be a variant of wikitext; see also SnakFormat with its two methods getBaseFormat() and isPossibleFormat().)