mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-05-30 08:06:51 +02:00
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 |
||
|---|---|---|
| .. | ||
| 1751086751801_create_services_table.ts | ||
| 1763499145832_update_services_table.ts | ||
| 1764912210741_create_curated_collections_table.ts | ||
| 1764912270123_create_curated_collection_resources_table.ts | ||
| 1768170944482_update_services_add_installation_statuses_table.ts | ||
| 1768453747522_update_services_add_icon.ts | ||
| 1769097600001_create_benchmark_results_table.ts | ||
| 1769097600002_create_benchmark_settings_table.ts | ||
| 1769300000001_add_powered_by_and_display_order_to_services.ts | ||
| 1769300000002_update_services_friendly_names.ts | ||
| 1769324448000_add_builder_tag_to_benchmark_results.ts | ||
| 1769400000001_create_installed_tiers_table.ts | ||
| 1769400000002_create_kv_store_table.ts | ||
| 1769500000001_create_wikipedia_selection_table.ts | ||
| 1769646771604_create_create_chat_sessions_table.ts | ||
| 1769646798266_create_create_chat_messages_table.ts | ||
| 1769700000001_create_zim_file_metadata_table.ts | ||
| 1770269324176_add_unique_constraint_to_curated_collection_resources_table.ts | ||
| 1770273423670_drop_installed_tiers_table.ts | ||
| 1770849108030_create_create_collection_manifests_table.ts | ||
| 1770849119787_create_create_installed_resources_table.ts | ||
| 1770850092871_create_drop_legacy_curated_tables_table.ts | ||
| 1771000000001_add_update_fields_to_services.ts | ||
| 1771000000002_pin_latest_service_images.ts | ||
| 1771100000001_migrate_kiwix_to_library_mode.ts | ||
| 1771200000001_create_map_markers_table.ts | ||
| 1775100000001_create_custom_library_sources_table.ts | ||
| 1776000000001_create_kb_ingest_state_table.ts | ||
| 1776100000001_create_kb_ratio_registry_table.ts | ||