I would check out any of the HealthKit WWDC talks.
There is a 'user entered' metadata key, but that relies on the app to use that flag when the user saves a workout.
You can't edit samples. You can only create new ones, or delete data from your app.
Hard to answer, are you trying to sync the data with a backend or just present changes locally to the user? There are version metadata keys that will be mutated by Apple. Again, up to the third party developer to do the right thing.
This one is fairly obvious if you check the docs or watch some old videos. Checkout the route builder and route query types. Ask for workout route permissions and you can query any route against workouts. Do note you can have more than one route per workout. As to will route data exist? That depends on the app that saved the workout. Apple does this for outdoor workouts.
Aside from 'delete all records of all apps', you app should be able to do almost everything that Apple Fitness and Apple Health allow. When deleting data, you can only delete data that you created. This is there to prevent an app with a bug that wipes out the users whole health database.
https://developer.apple.com/videos/all-videos/?topic=health%20%26%20fitness
Topic:
App & System Services
SubTopic:
Health & Fitness
Tags: