## TL;DR

Seeds do full loads, so re-seeding mid-day briefly empties the lookup table and anything joining it breaks. Restore the table from the CSV with a full-refresh seed now, then move seed updates to off-hours and gate them behind approval.

## Error

```text
agent seed replace truncated the lookup table mid-day
```

## Steps

1. Rebuild the lookup table immediately: dbt seed --select the_seed --full-refresh.
   Expected: The table is repopulated from the CSV.

2. Verify downstream: check row counts and spot-check the dashboards or models that join the lookup.
   Expected: Downstream reads are correct again.

3. Check whether anything failed during the empty window: look at dbt run logs and dashboard error windows for the truncated period.
   Expected: You know the blast radius and can rerun affected models.

4. Policy: seed updates happen off-hours or against a staging schema first, and agents need approval to run dbt seed on production.
   Expected: No more mid-day seed truncations.

## When to use

- an agent ran dbt seed mid-day and a lookup table went empty
- dashboards broke during a seed update window
- a seed table has zero rows unexpectedly

## When not to use

- the seed update was planned for off-hours (that is normal operations)
- the CSV itself is wrong (fix the file, then reseed)
- the table is empty for another reason (check the seed logs)

## Tool compatibility

- dbt seed --full-refresh to rebuild
- dbt run logs to find the empty-window impact
- scheduling to move seed updates off-hours

## Variant phrasings

### agent seeded the wrong file into the lookup
Same recovery (full-refresh with the right CSV), plus verify the CSV in version control before seeding.

### seed truncation during a demo
Same fix, more embarrassment. The off-hours policy is the real deliverable.

## Why it happens

dbt seed replaces the whole table, and between the drop and the reload the table is empty or gone. Mid-day, that window hits live dashboards and joins. Agents run seed whenever the CSV changes without thinking about timing.

## Edge cases

- For large or critical lookups, consider an incremental load pattern instead of seeds; seeds are best for small stable reference data.
- Some warehouses support transactional seed loads; check your adapter, but do not rely on it as the only guard.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_aPGtSKMq3twqhPTh1iQfiw
