different context implementations will be used depending on the kind
of remodel, and those will play the roles/implement as needed
snapstate.DeviceContext, storecontext.DeviceBackend and
registrationContext:
* same brand/model, brand store => updateRemodel
this is just a contextual carrier for the new model
* same brand/model different brand store => storeSwitchRemodel this
mediates access to device state kept on the remodel change, it also
create a store that uses that and refers to the new brand store
* different brand/model, maybe different brand store => reregRemodel
similar to storeSwitchRemodel case after a first phase that performs
re-registration where the context plays registrationContext's role
(NOT IMPLEMENTED YET)
This converts the singleton asserts.ErrNotFound to a richer asserts.NotFoundError struct carrying Type and optionally PrimaryKey, similar to store.AssertionNotFoundError which then gets folded with this.
This means code doesn't have to worry anymore which is which or to convert between the two. And when possible there is more information around. Though Backstores can continue to return minimal information (Type but not Headers in the new error).
A helper asserts.IsNotFound is also added to cover the simple old ==/!= asserts.ErrNotFound needs.
This also fixes/adjust some error handling to usually not repeat the richer information twice.
Always try to get a serial even on classic, but if there is no gadget nor no non-default store wait until some snaps are installed or being installed, use the hard coded 'generic/generic-classic' model as fallback for the cases where there is no model/seeding data.
This introduces a base-declaration assertion with the default policies (for now about interfaces) that govern all snaps.
This has the assertion definition itself, the first pass at plumbing to have the content defined in interfaces/builtin, while the forward compatible (with the idea to revision/distribute this through the store) interface to it is asserstate.BaseDeclaration.
The assertion is not used yet in any way.