feat(source): persist typed semantic reviews in schema five

This commit is contained in:
2026-09-06 04:46:41 +03:00
parent ab02b1b255
commit ab960cbebb
24 changed files with 1223 additions and 74 deletions
@@ -1,4 +1,4 @@
//! Source3 data upgrade through token edits; authored modules, nesting and trivia survive.
//! Source3/4 upgrade through token edits; authored modules, nesting and trivia survive.
use super::*;
pub(super) fn upgrade(
@@ -15,6 +15,7 @@ pub(super) fn upgrade(
let changed: BTreeSet<_> = report
.semantic_defaults
.iter()
.filter(|default| default.field != "baseline.semantic")
.map(|default| default.object)
.collect();
let aliases: BTreeMap<_, _> = project
@@ -61,6 +62,7 @@ pub(super) fn upgrade(
old_aliases: &aliases,
new_aliases: &aliases,
legacy_value_paths: true,
identity_origins: None,
};
update.value(
&actual.fields,
@@ -78,7 +80,7 @@ pub(super) fn upgrade(
edits
.entry(current.bundle.entry.clone())
.or_default()
.push((version, "4".into()));
.push((version, crate::SCHEMA_VERSION.to_string()));
// New allocation relations are emitted into the allocating interface's
// existing module, outside its lexical element body. Existing source never moves.
let mut added: BTreeMap<String, String> = BTreeMap::new();
@@ -117,7 +119,7 @@ pub(super) fn upgrade(
&bundle.entry,
Span::default(),
"migration_source_mismatch",
"Targeted source3 upgrade did not reproduce the migrated project.",
"Targeted source upgrade did not reproduce the migrated project.",
)]);
}
result.decoded.migration = Some(report.clone());