Prepare item and enemy event sort keys once

This commit is contained in:
2026-11-26 03:00:08 +00:00
parent 7077cee35e
commit 97e9d51db0
10 changed files with 176 additions and 57 deletions

View File

@@ -453,11 +453,11 @@ or stage interpreter is established by this finding.
### CAT-019 — Sorting Recomputes Invariant Evidence Keys
**Progress:** NPC and location occurrence normalizers prepare earliest valid
positions once per owned record; location kind rank is also prepared once.
Defensive comparators and genuine evidence tie comparisons remain. Literal
long-tie, non-monotonic, invalid-reference, duplicate, and existing validator
tests pass. Item and enemy-event work remains pending.
**Status:** Resolved. NPC, location, item, and enemy-event normalizers prepare
invariant sort keys once per owned record. Enemy invariant checks use canonical
comparisons only after evidence-order validation; defensive comparators and
genuine evidence tie comparisons remain. Literal non-monotonic, tied, invalid,
duplicate, and validator tests pass across the affected families.
**Assessment:** Local algorithmic opportunity; original P3.

View File

@@ -844,6 +844,13 @@ Comment canonical fast-path premises.
## Stage 31 — Prepare Item And Enemy Sort Keys Once
**Completed.** Item and enemy-event normalizers prepare chronology and scalar
comparison keys once per owned canonical record. Enemy invariant checks use the
canonical path only for evidence that passed order/uniqueness checks; defensive
comparators and item exact-equality buckets remain. Literal tie, invalid evidence,
identity/dedup, and existing nil/empty and kind-order tests pass with the
specified family, normalizer, and validator suites.
**Coverage:** CAT-019 completion. **Prerequisites:** Stage 30.
Apply local key preparation to item/enemy records. Remove enemy recanonicalization