Class: Insika::ConfigStore
- Inherits:
-
Object
- Object
- Insika::ConfigStore
- Defined in:
- lib/insika/config_store.rb
Overview
CONFIGURATION DOMAIN store. Unlike the
EXECUTION stores (session/task/checkpoint/pending/memory), this holds the
configuration the Studio authors at runtime: agents (profiles), general
settings, LLM providers and MCP instances. Scoped KV over any
Insika::Store — durable when the backend is SQLite (survives a restart,
like everything else).
logical scope -> physical namespace "config:
Defined Under Namespace
Classes: UnknownScope
Constant Summary collapse
- SCOPE_PREFIX =
"config"- SCOPES =
agent_files/skills: the CONTENT of per-agent prompts and shared skills lives in the Store (single source of truth, a SQLite backup), not on disk — disk becomes only seed/import. goldens: authored eval cases (RFC-0008 §3.1 / RFC-0013 §3.7) — config, like the prompts and skills: the corpus on disk is seed and export, the store is what a deployment runs and what the Studio edits. baselines: the ACCEPTED state of each agent's golden set (RFC-0013 §3.7.3). Config for the same reason: it is a curated decision ("this is the bar"), the file is its export, and the refinement gate reads it from inside a deployment that has no checkout.
%w[agents settings llm_providers mcp agent_files skills system_files tools goldens baselines].freeze
Instance Method Summary collapse
-
#all(scope) ⇒ Object
-> [Hash] all records of the scope (lexicographic key order).
-
#delete(scope, key) ⇒ Object
-> bool (did it exist?).
-
#get(scope, key) ⇒ Object
-> Hash | nil.
-
#initialize(store:) ⇒ ConfigStore
constructor
A new instance of ConfigStore.
-
#keys(scope) ⇒ Object
-> [String] keys of the scope, sorted lexicographically.
-
#put(scope, key, value) ⇒ Object
Upsert (last-write-wins).
Constructor Details
#initialize(store:) ⇒ ConfigStore
Returns a new instance of ConfigStore.
33 34 35 |
# File 'lib/insika/config_store.rb', line 33 def initialize(store:) @store = store end |
Instance Method Details
#all(scope) ⇒ Object
-> [Hash] all records of the scope (lexicographic key order)
59 60 61 62 |
# File 'lib/insika/config_store.rb', line 59 def all(scope) s = ns(scope) @store.list(s).filter_map { |k| @store.get(s, k) } end |
#delete(scope, key) ⇒ Object
-> bool (did it exist?)
49 50 51 |
# File 'lib/insika/config_store.rb', line 49 def delete(scope, key) @store.delete(ns(scope), key.to_s) end |
#get(scope, key) ⇒ Object
-> Hash | nil
44 45 46 |
# File 'lib/insika/config_store.rb', line 44 def get(scope, key) @store.get(ns(scope), key.to_s) end |
#keys(scope) ⇒ Object
-> [String] keys of the scope, sorted lexicographically
54 55 56 |
# File 'lib/insika/config_store.rb', line 54 def keys(scope) @store.list(ns(scope)) end |
#put(scope, key, value) ⇒ Object
Upsert (last-write-wins). -> value (the same Hash that was passed)
38 39 40 41 |
# File 'lib/insika/config_store.rb', line 38 def put(scope, key, value) @store.set(ns(scope), key.to_s, stringify(value)) value end |