{
  "part": 11,
  "title": "source.targetSnapshotList (already partially covered in Part 9b)",
  "reset": "standard",
  "steps": [
    { "id": "11.1-setup", "title": "Deliver S1 and S2 normally, then force S1 to be the only viable base (setup for 11.1)",
      "_comment": "No config.mutations here, deliberately - see part09.json's 9.2-setup comment for why: source.targetSnapshotList must not be active for these two ordinary deliveries, or they incorrectly read a stale, leftover inventory file instead of using the normal status-file path. Snapshot names embed a real date (now_suffix primitive) - parseSnapshotDateTime/findCommonBaseSnapshot only consider dated snapshot names as base-selection candidates.",
      "actions": [
        { "do": "now_suffix", "store_as": "SUF1_111" },
        { "do": "zfs_snapshot", "dataset": "{SRC}/ds1@S1_$SUF1_111" },
        { "do": "run_sneakernet", "servername": "test-source", "verbosity": 1, "expect_exit": 0 },
        { "do": "run_sneakernet", "servername": "test-target", "verbosity": 1, "expect_exit": 0 },
        { "do": "sleep", "seconds": 1 },
        { "do": "now_suffix", "store_as": "SUF2_111" },
        { "do": "zfs_snapshot", "dataset": "{SRC}/ds1@S2_$SUF2_111" },
        { "do": "empty_dir", "path": "{TRANSPORT}" },
        { "do": "run_sneakernet", "servername": "test-source", "verbosity": 1, "expect_exit": 0 },
        { "do": "run_sneakernet", "servername": "test-target", "verbosity": 1, "expect_exit": 0 },
        { "do": "sleep", "seconds": 1 },
        { "do": "now_suffix", "store_as": "SUF3_111" },
        { "do": "zfs_snapshot", "dataset": "{SRC}/ds1@S3_$SUF3_111" },
        { "do": "zfs_destroy", "dataset": "{SRC}/ds1@S2_$SUF2_111", "recursive": 0, "missing_ok": 0 },
        { "do": "zfs_list_snapshots", "dataset": "{DST}/ds1", "capture": { "name": "TARGET_INVENTORY_111", "reduce": "lines" } },
        { "do": "write_file", "path": "{TMP}/target_inventory_11_1.txt", "content": "$TARGET_INVENTORY_111\n" }
      ]
    },
    { "id": "11.1", "title": "Confirm it produces an exact match with zero fallback warnings", "depends_on": ["11.1-setup"],
      "config": { "mutations": [ { "op": "set", "path": "source.targetSnapshotList", "value": "{TMP}/target_inventory_11_1.txt" } ], "restore": "none" },
      "actions": [
        { "do": "empty_dir", "path": "{TRANSPORT}" },
        { "do": "run_sneakernet", "servername": "test-source", "verbosity": 4, "log": "part11_1", "expect_exit": 0,
          "capture": { "name": "LOG111" } }
      ],
      "assertions": [
        { "type": "regex_present", "var": "LOG111", "pattern": "(?i)Using operator-supplied target snapshot list", "message": "log confirms the supplied file is in use" },
        { "type": "regex_present", "var": "LOG111", "pattern": "(?i)confirmed present in the recorded target snapshot state", "message": "resolution is a clean exact match" },
        { "type": "regex_absent", "var": "LOG111", "pattern": "(?i)inferred substitute base", "message": "no 'inferred' warning appears at all" }
      ]
    },
    { "id": "11.1-cleanup", "title": "Restore targetSnapshotList: ''", "depends_on": ["11.1"],
      "config": { "restore": "none", "mutations": [
        { "op": "set", "path": "source.targetSnapshotList", "value": "", "style": "single" }
      ] }
    }
  ]
}
