test(battle-node): lock copy-op parse vs prod capture line 196

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-06-04 10:12:20 -04:00
parent b6edfbcf15
commit 61080adace

View File

@@ -353,6 +353,28 @@ public class CaptureConformanceTests
Assert.That(ourEntry.GetProperty("to").GetInt32(), Is.EqualTo(20));
}
[Test]
public void MineCopyTokens_extracts_the_prod_capture_copy_op_shape()
{
// Prod copy op (battle-traffic_tk2_regular.ndjson:196) — the ONLY copy op in any capture, an
// isSelf:0 Echo: {add:{idx:[49], isSelf:0, card:{baseIdx:21, isPremium:0}}}. No later play-reveal
// of idx 49 exists, so this locks the copy-op PARSE + map-resolution only (spec §5), not a reveal.
var orderList = new List<object?>
{
new Dictionary<string, object?> { ["add"] = new Dictionary<string, object?>
{ ["idx"] = new List<object?> { 49L }, ["isSelf"] = 0L,
["card"] = new Dictionary<string, object?> { ["baseIdx"] = 21L, ["isPremium"] = 0L } } },
};
// baseIdx 21 lives in the opponent's (isSelf:0 -> otherMap) index space. The capture never reveals
// idx 21's cardId, so seed a sentinel; this verifies parse + resolution of the op shape, not an id.
var otherMap = new Dictionary<int, long> { [21] = 123_456_789L };
var mined = SVSim.BattleNode.Sessions.Dispatch.KnownListBuilder
.MineCopyTokens(orderList, new Dictionary<int, long>(), otherMap)
.ToList();
Assert.That(mined, Is.EquivalentTo(new[] { (49, 123_456_789L, 0) }));
}
[Test]
public void SynthesizedChoiceGeneration_matches_prod_recv_keyAction_and_knownList_shape()
{