project-nomad/admin/app/models
Chris Sherwood 68e1bd5ff2 feat(KB): ratio registry for disk + time estimates (Phase 1B of RFC #883)
Foundation for the cost estimates and partial-stall detection that
Phase 2 will surface. No consumers yet — this PR just lays the table,
the seed rows, and the lookup helper so subsequent UI work has
estimates available without a per-ZIM benchmark.

## What lands

- New table `kb_ratio_registry` (pattern, chunks_per_mb, sample_count,
  notes). Migration creates and seeds heuristic defaults from the RFC
  appendix: devdocs (1100/MB), Wikipedia variants (270/MB), iFixit
  (50/MB), Stack Exchange Q&A (200/MB), video-only ZIMs (0), plus a
  catch-all fallback at 100/MB.
- `KbRatioRegistry` model with static `lookup()` and `estimateChunks()`.
- Pure helper `kb_ratio_lookup.ts` doing longest-prefix-match — a
  specific entry (`wikipedia_en_simple_`) overrides a broader one
  (`wikipedia_en_`). 9 unit tests covering the lookup boundary.
- `sample_count` starts at 0 (heuristic seed) and is reserved for
  Phase 4 self-calibration to increment as observed ZIMs update each row.

## Not in scope

- Self-calibration on successful ingestion (Phase 4)
- UI consumers — Warning B (partial-embed stall) and the storage budget
  meter / time estimates land in Phase 2.

## Tested

- Type-check clean
- 9 unit tests pass for `findChunksPerMb` and `estimateChunkCount`
- Migration applied on NOMAD3 via hot-patch; 9 seed rows verified in DB
2026-05-16 20:23:47 -07:00
..
benchmark_result.ts feat(benchmark): Require full benchmark with AI for community sharing (#99) 2026-01-25 00:24:31 -08:00
benchmark_setting.ts feat: Add system benchmark feature with NOMAD Score 2026-01-22 21:48:12 -08:00
chat_message.ts feat: [wip] native AI chat interface 2026-01-31 20:39:49 -08:00
chat_session.ts feat: [wip] native AI chat interface 2026-01-31 20:39:49 -08:00
collection_manifest.ts feat: curated content system overhaul 2026-02-11 15:44:46 -08:00
custom_library_source.ts feat(Content): custom ZIM library sources with pre-seeded mirrors (#593) 2026-05-04 11:30:59 -07:00
installed_resource.ts feat: curated content system overhaul 2026-02-11 15:44:46 -08:00
kb_ingest_state.ts feat(KB): per-file ingest state machine (Phase 1 of RFC #883) (#888) 2026-05-15 22:51:06 -07:00
kb_ratio_registry.ts feat(KB): ratio registry for disk + time estimates (Phase 1B of RFC #883) 2026-05-16 20:23:47 -07:00
kv_store.ts feat(AI Assistant): custom name option for AI Assistant 2026-03-04 20:05:14 -08:00
map_marker.ts feat(maps): add scale bar and location markers (#636) 2026-04-03 14:26:50 -07:00
service.ts feat: support for updating services 2026-03-11 14:08:09 -07:00
wikipedia_selection.ts feat: Add dedicated Wikipedia Selector with smart package management 2026-01-31 21:00:51 -08:00