fix: the search index lives in IndexedDB and a refused save is reported (#363) #403
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.48) × (1 − Review Confidence (0.55)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 504 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 94% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.372
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #403"
general
weight: 0.35
qwts
Closes #363.
The chosen layout (proposed for review)
A new storage-layer file,
src/utils/indexStorage.js, owns where the index lives;useSemanticSearch.jsstays the hook that owns the rules. The issue's "durable fix" — IndexedDB behind the same read/write shape — is what lands; vector compaction andunlimitedStorageare deliberately not taken (quantisation slightly changes retrieval quality, and the new permission stays rejected per #13's direction).bookmarkitdatabase whosesettingsstore holds the index under the same name,bookmarkit.semanticIndex, as the plain object — structured clone moves it without a JSON pass over every float, so a 5,000-bookmark index is neither stringified nor capped by the 10 MiB quota.readSetting/writeSetting: the fallback where IndexedDB is missing or refuses to open (jsdom, some webviews), and the migration path — a read that finds nothing in IndexedDB adopts what the settings store holds, writes it into IndexedDB, and drops the old copy, the wayadoptLegacyLocalStoragemoved the web build's settings. An unparsable legacy value reads as no index rather than breaking the read.writeIndexStorereturns the boolean #36 taughtwriteSettingto return, the hook latchesindexSaveFaileduntil a write lands, and BookmarkApp renders it as arole="status"panel beside the organizer bar — one report, not a failure per search. A refused save costs the next session its index, not this one's.Acceptance
writeSetting: without IndexedDB the helper writes through to it, so the test breakslocalStorage.setItemfor that link (useSemanticSearch.test.jsx). The report clears when a later write lands.Tests
src/utils/indexStorage.test.js: IndexedDB primary (plain object, no JSON), settings-store fallback, boolean honest when every store refuses, fallback when IndexedDB refuses to open, legacy adoption + drop, unparsable legacy, empty everywhere. Shared fake insrc/test/fakeIndexedDB.js(everyopen()answers its own request).useSemanticSearch.test.jsx: the three #363 cases above; the existing suite passes unchanged through the new read/write shape.npm run cigreen (version policy, notices, format, lint, 1,534 tests, Chrome + Storybook builds).Verified in the real extension
A forced-failure check ran the built extension in Brave: IndexedDB removed from the page and
chrome.storage.local.setthrowing for the index key only, the provider pointed at a mock whose chat endpoint fails fast (so the ask falls back to a plain search plan whose widening embeds against the mock embeddings endpoint). The notice rendered once, stayed exactly one through a second ask window, search still worked (thesemanticMatchesplan filtered the list), the index key never appeared inchrome.storage.local, and the console stayed clean.Changeset: patch.
<!-- agent-bot-write: ghw_33e41ff96cd8e16d session=acad26a80cec bot=trueline-zcode-agent[bot] -->