fix: update all Stage 2 references to Stage 3 CANONICAL type counts

Comprehensive update of type count references from Stage 2 (31 nouns + 40 verbs)
to Stage 3 CANONICAL (42 nouns + 127 verbs) across entire codebase.

Changes (23 files):
- Core architecture: Memory tracking comments, speedup calculations
- Tests: Type count assertions, enum index expectations, memory benchmarks
- CLI: User-visible type count output
- Augmentations: Type detection comments
- Documentation: Architecture docs, guides, performance docs
- Type embeddings: Regenerated for all 169 types (338KB)

Specific updates:
- 31 → 42 (noun count): 38 occurrences
- 40 → 127 (verb count): 24 occurrences
- 124 → 168 bytes (noun array size): 5 occurrences
- 160 → 508 bytes (verb array size): 5 occurrences
- 284 → 676 bytes (total type tracking): 12 occurrences
- Enum indices updated to match Stage 3 reordering

Type embeddings regenerated:
- 42 noun embeddings (64.5 KB)
- 127 verb embeddings (194.8 KB)
- Total: 338 KB (was 108.8 KB)

All constants, arrays, and tests now consistent with Stage 3 taxonomy.

Fixes #v5.5.1-type-count-migration
This commit is contained in:
David Snelling 2025-11-06 09:40:33 -08:00
parent f57732be90
commit 823cd5cf1b
23 changed files with 106 additions and 106 deletions

View file

@ -35,8 +35,8 @@ describe('MetadataIndexManager - Phase 1b: Type-Aware Features', () => {
expect(managerAny.verbCountsByTypeFixed.length).toBe(VERB_TYPE_COUNT)
})
it('should have 99.76% memory reduction vs Maps', () => {
// Fixed-size arrays: 31 × 4 bytes + 40 × 4 bytes = 284 bytes
it('should have 99.44% memory reduction vs Maps', () => {
// Fixed-size arrays: 42 × 4 bytes + 127 × 4 bytes = 676 bytes
const fixedSize = (NOUN_TYPE_COUNT + VERB_TYPE_COUNT) * 4
// Map overhead: ~120KB for string keys, pointers, hash table
@ -44,8 +44,8 @@ describe('MetadataIndexManager - Phase 1b: Type-Aware Features', () => {
const reduction = ((mapSize - fixedSize) / mapSize) * 100
expect(fixedSize).toBe(284)
expect(reduction).toBeGreaterThan(99.7)
expect(fixedSize).toBe(676)
expect(reduction).toBeGreaterThan(99.4)
})
it('should track entity counts in Uint32Arrays when adding entities', async () => {
@ -309,8 +309,8 @@ describe('MetadataIndexManager - Phase 1b: Type-Aware Features', () => {
const verbArraySize = managerAny.verbCountsByTypeFixed.byteLength
const totalFixedSize = nounArraySize + verbArraySize
// Should be exactly 284 bytes
expect(totalFixedSize).toBe(284)
// Should be exactly 676 bytes
expect(totalFixedSize).toBe(676)
})
})