feat(truth): schema_version 2 read path, v2 only
Replaces the v1 shape rather than accepting both. `anneal_sec` and the top-level `sample_fps` are deleted, not zeroed; `extraction` and `cut` blocks arrive; `scenes` become objects carrying belief and route, so a window records how far to trust it instead of being a bare float pair. `TruthSchema.IsSupported` is the single gate and is applied on all four read paths — sidecar, managed store load, managed PUT, and converted manifest. Previously only the controller checked, so the version the plugin claimed to require and the one it would actually parse were free to drift. Rejections name the file and the version found, so an item that looks empty is distinguishable from one that was refused. `ManifestConverter` carries belief, route and both provenance blocks through: dropping them would silently downgrade every fetched manifest against a locally extracted one. TRACES: JR-002, JR-003 | SR-003
This commit is contained in:
@@ -25,7 +25,7 @@ public class PresenceLookupTests
|
||||
var actor = new TruthActor { Name = "Steve Buscemi", TmdbId = "884" };
|
||||
foreach (var w in windows)
|
||||
{
|
||||
actor.Scenes.Add(w);
|
||||
actor.Scenes.Add(new TruthScene { Start = w[0], End = w[1] });
|
||||
}
|
||||
|
||||
return actor;
|
||||
@@ -102,18 +102,22 @@ public class PresenceLookupTests
|
||||
// JR-004: served exactly as given. A round trip through the serializer
|
||||
// is where a silent normalisation would show up.
|
||||
const string Json = """
|
||||
{"schema_version":1,"movie":"/m.mkv","sample_fps":1,"anneal_sec":2,
|
||||
{"schema_version":2,"movie":"/m.mkv",
|
||||
"extraction":{"sample_fps":1,"extinction_sec":12},
|
||||
"cut":{"runtime_sec":6420.5},
|
||||
"actors":[{"name":"A","imdb_id":"","tmdb_id":"884","jellyfin_id":"",
|
||||
"scenes":[[0.0,10.0],[10.0,20.0],[30.0,30.0]]}]}
|
||||
"scenes":[{"start":0.0,"end":10.0},
|
||||
{"start":10.0,"end":20.0},
|
||||
{"start":30.0,"end":30.0}]}]}
|
||||
""";
|
||||
|
||||
var parsed = JsonSerializer.Deserialize<TruthFile>(Json, new JsonSerializerOptions(JsonSerializerDefaults.Web))!;
|
||||
var windows = parsed.Actors[0].Scenes;
|
||||
|
||||
Assert.Equal(3, windows.Count);
|
||||
Assert.Equal([0.0, 10.0], windows[0]);
|
||||
Assert.Equal([10.0, 20.0], windows[1]);
|
||||
Assert.Equal([30.0, 30.0], windows[2]);
|
||||
Assert.Equal((0.0, 10.0), (windows[0].Start, windows[0].End));
|
||||
Assert.Equal((10.0, 20.0), (windows[1].Start, windows[1].End));
|
||||
Assert.Equal((30.0, 30.0), (windows[2].Start, windows[2].End));
|
||||
}
|
||||
|
||||
// UT-023
|
||||
@@ -129,7 +133,7 @@ public class PresenceLookupTests
|
||||
var actor = Actor();
|
||||
for (var w = 0; w < 1000; w++)
|
||||
{
|
||||
actor.Scenes.Add([w * 10.0, (w * 10.0) + 4.0]);
|
||||
actor.Scenes.Add(new TruthScene { Start = w * 10.0, End = (w * 10.0) + 4.0 });
|
||||
}
|
||||
|
||||
truth.Actors.Add(actor);
|
||||
|
||||
Reference in New Issue
Block a user