feat: improve service version migration and data version handling

Extract get_data_version into a shared function used by both effects
and service_map. Use the actual data version (instead of the previous
package version) when computing migration targets, and skip migrations
when the target range is unsatisfiable. Also detect install vs update
based on the presence of a data version file rather than load
disposition alone.
This commit is contained in:
Aiden McClelland
2026-03-08 21:40:55 -06:00
parent efd90d3bdf
commit 95a519cbe8
5 changed files with 87 additions and 37 deletions

View File

@@ -331,6 +331,9 @@ export class VersionGraph<CurrentVersion extends string>
target: VersionRange | ExtendedVersion | null,
): Promise<void> {
if (target) {
if (isRange(target) && !target.satisfiable()) {
return
}
const from = await getDataVersion(effects)
if (from) {
target = await this.migrate({