> why do we need this duplication?
It's a little different between loading package from package and DB, the type can be identified from the extensions name, ".wgt" or ".xpk", when loading app package, but for loading from DB, checking manifest content is the only way to do it.
> Can it be just obtained once from the package itself and do without heuristic in Manifest (can just keep assertions there)?
Save the type information into DB is the only way to do so. But IMO, it duplicates with identifying with manifest content.