fix: accept schema-2 composite module manifests

This commit is contained in:
codex
2026-08-10 11:02:22 +03:00
parent 4a84c268f8
commit 4a351d9b44
3 changed files with 5 additions and 3 deletions
@@ -14,7 +14,9 @@ internal static class CompositeModuleManifest
var path = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(assemblyPath)!, "..", "module-manifest.json"));
if (!File.Exists(path)) throw new InvalidOperationException("COMPOSITE_MODULE_MANIFEST_MISSING");
var manifest = JsonSerializer.Deserialize<CompositeManifest>(File.ReadAllText(path), new JsonSerializerOptions { PropertyNameCaseInsensitive = true }) ?? throw new InvalidOperationException("COMPOSITE_MODULE_MANIFEST_INVALID");
if (manifest.SchemaVersion != 1 || !string.Equals(manifest.Package, "P_Rec_Annot", StringComparison.Ordinal) || manifest.Modules.Count == 0) throw new InvalidOperationException("COMPOSITE_MODULE_MANIFEST_INVALID");
// Schema 2 adds the package-wide file manifest while preserving the
// required composite module/assembly contract consumed here.
if (manifest.SchemaVersion is not (1 or 2) || !string.Equals(manifest.Package, "P_Rec_Annot", StringComparison.Ordinal) || manifest.Modules.Count == 0) throw new InvalidOperationException("COMPOSITE_MODULE_MANIFEST_INVALID");
foreach (var item in manifest.Assemblies.Where(value => value.Required))
{
var file = Path.Combine(Path.GetDirectoryName(assemblyPath)!, item.Name);