HANDOFF NOTE: project "importer" (only this project; ignore all archive-* records)

CONTRACT (fixed)
evaluate(payload) -> {records:[{id,fields}], audit:[string]}
Events: id string, integer version, deleted boolean, fields JSON object.

ALGORITHM (fixed)
1. Normalize id: optional trim (trim_ids), then ASCII case folding iff fold_case.
2. An empty normalized id is skipped or raises ValueError according to empty_id. Do normalization and the empty check BEFORE discarding versions below version_floor, so an empty id errors even if its version is below the floor.
3. Discard events with version < version_floor.
4. Deduplicate by normalized (id, version). The group keeps the first insertion position, but the selected event is first or last according to duplicate_policy. Sorting uses the selected event's actual original index.
5. Process in order of (version, selected original index). Save each normalized id's first processed index.
6. Deletion removes the record. With tombstone_wins, it also permanently blocks later non-deletions. A deletion is applied only if a record existed or it installs a new sticky tombstone. A redundant deletion is blocked/no change.
7. Otherwise merge fields, creating {} if needed.
   - Null values ignore or delete the existing key according to null_mode.
   - With nested_merge, recursively merge two objects; otherwise the new object replaces the old.
   - Two arrays: replace, or with list_merge=unique append new items not structurally equal (JSON equality) to any item in the old array. No deduplication among the new items themselves.
8. Filter top-level fields to name, tags, meta only iff unknown_fields=drop.
9. Audit: with audit_all, record every processed event; otherwise only applied ones. Format normalized_id:version:applied or normalized_id:version:blocked. Preserve processing order.
10. Sort records lexically by normalized id for order=id; otherwise by first processed index, then id.
11. Do not mutate the input.

CURRENT SETTINGS (after Updates 1-5)
- trim_ids = false
- fold_case = false
- duplicate_policy = "last"
- tombstone_wins = false (deletions do not create sticky tombstones; a deletion applies only if a record existed)
- version_floor = 3
- list_merge = "unique"
- nested_merge = false (object values replace)
- null_mode = "delete"
- empty_id = "error" (raise ValueError)
- audit_all = false (audit only applied events)
- order = "id"
- unknown_fields = "keep" (no filtering)

NOTES
- Settings are all explicitly resolved; no unresolved items or exceptions are open.
- With tombstone_wins=false, a deletion with no existing record is blocked, and later non-deletions can recreate the record.
- With audit_all=false, blocked events do not appear in the audit.
- With nested_merge=false, null_mode still applies to top-level keys only.
- Later updates will replace only the keys they name; the others stay unchanged.
- The next update and later questions are not yet available.