ScopedStoreCopy
A throwaway copy of an LLM registry store.
In the namespace opal_bench. Declared in src/tools/opal-bench/StoreCopy.hpp.
Detailed description
Why a copy
Both checks in this program said they opened the operator's store READ ONLY, so that a measurement could never rewrite provider settings. Since the Claude Code work that stopped being true: `LLMRegistry::activate()` calls `refreshClaudeCodeAvailability()`, which seeds the alias rows (`opus`, `sonnet`, `fable`) and persists them. A run of `vision-e2e` on 2026-09-27 added three model rows to the store it was handed and set the provider's validation status (opal-vision §OVT-2.1d).
Harmless against a throwaway store, and wrong against the file the app's provider settings write. Rather than keep a claim the code does not honor, the checks now open a copy and leave the original alone.
The copy carries the credential
An online provider's row holds its key, so this is not a neutral temporary file. Two consequences, both handled here:
- The directory is removed on every exit path, including an early return, because the lifetime is the object's.
- The copy is owner-read/write only. The source's own permissions are not trusted to carry over.