Latest Records One Row Per Location

Step 5: One Row Per Location

GET /ingestions/assets/latest narrowed to the workflow's tag, with ?include=superseded. Captures latest_records_row_id and latest_records_location_id.

What you should see

Two uploads of the same file, and one row per facility. The row is the step 3 record โ€” the one with the later window โ€” and it reports what it replaced:

"attributes": {
  "superseded_count": 1,
  "asset_task_ids": ["<step 3 task>", "<step 1 task>"],
  "row_id": "<this record>"
},
"relationships": {
  "superseded": {
    "data": [{ "asset_task_id": "<step 1 task>", "monitoring_end": "2024-12-31โ€ฆ",
               "record_superseded_at": "โ€ฆ" }],
    "meta": { "total": 1, "truncated": false }
  }
}

Compare it with GET /ingestions/assets using the same filter: that returns both records. Neither count is wrong โ€” one counts locations, the other counts records.

The assertion worth borrowing

superseded_count and include=superseded are read by two different statements, and this step asserts they agree. They are computed from the same stored pointer precisely so that a caller comparing data.length against the count never sees a row contradict itself.

Next Step

โ†’ Step 6: The Whole Lineage โ€” the count says how many; /history says which, in order, with the current one flagged.