Give the toolbox files headers that explain their role, callers and pitfalls

Document the storage chain (optimistic state, write queue, compare-and-write
transactions, cross-tab sync), the tool registry, actions and pages, the
contract a tool receives through its context, and the encrypted sharing
whose key never reaches the server. The compactor registry header no longer
calls itself strict: a missing compactor writes data as-is, now tracked in
sokko-g-afbw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-12-01 10:14:46 +01:00
parent 34b412d968
commit fe21c2d899
25 changed files with 210 additions and 24 deletions

View file

@ -1,5 +1,17 @@
/**
* @file Encapsule les opérations IndexedDB génériques utilisées par les toolboxes.
* @file Accès IndexedDB des toolboxes (base `sokkog`, stores `kv` et `modules`) : lectures, écritures simples,
* transaction de mutation avec contrôle de conflit, instantané pour l'export, estimation du quota.
*
* Contexte : couche la plus basse du stockage local ; elle ne connaît pas le format des outils.
* Points d'entrée : `mutateToolboxStorage` (transaction comparer-puis-écrire), `getToolboxSnapshot`,
* `getModuleDataEntries`, `getAllModuleData`, `getSetting` / `setSetting`, `getStorageEstimate`,
* `StorageConflictError`.
* Utilisé par : features/toolboxes/storage/ (useIndexedToolboxes.js, storageMutation.js, useAutoBackup.js).
* Attention :
* - `kv` garde le registre des toolboxes, les associations jeu → toolbox et les réglages locaux ; `modules`
* garde les données de chaque outil sous la clé `<toolboxId>:<moduleId>`.
* - Le cache hors connexion du TCG utilise une autre base (features/cards/cardCache.js).
* @see docs/STORAGE_SCHEMA.md
*/
const DB_NAME = "sokkog";