feat(daemon): extension switchover to daemon-aware store selection (phase 4)#26
Conversation
…hase 4)
TDD red→green. The extension now selects its KnowledgeStore at startup:
RpcKnowledgeStore when the daemon socket is bind-mounted in (container
topology, contract §2.4), else the local MykbStore (host operator / no
daemon). MYKB_STORE=local|rpc forces; else socket presence auto-detects.
- store-selection.ts: selectKnowledgeStore(brainPath) → {store,mode};
socket = MYKB_SOCKET ?? <brain>/.mykbd.sock (mirrors daemon/main.ts).
5 unit tests (local default, socket-present, MYKB_SOCKET, both forces).
- DIP: every extension hook + tool retyped from the concrete MykbStore
to the KnowledgeStore interface (one-line alias import per file, 10
files) so RpcKnowledgeStore is LSP-substitutable with zero call-site
change. index.ts swaps MykbStore.open → selectKnowledgeStore.
- Contract-faithful fix surfaced by the retype: KnowledgeStore.search
was missing the excludeZone arg the concrete impl + contract §5.3
(exclude_zone) already support — aligned the interface and threaded it
through RpcKnowledgeStore.search and the dispatcher search verb (not
cast away). +1 RPC parity test for exclude_zone over the wire.
Full suite 645/645; zero regressions from the interface retype +
extension swap (LSP evidence). Build + lint clean.
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (17)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Phase 4 of the v2 privileged-write-channel (issue #1). The Pi extension
now picks its store at startup based on whether the daemon socket is
present — the in-container switchover the parent DESIGN's Phase 4
requires. Builds on merged Phases 1–3 (#21/#22/#24).
What landed (TDD red→green)
store-selection.ts—selectKnowledgeStore(brainPath):MYKB_STORE=local|rpcforces; else the daemon socket's presenceauto-selects (contract §2.4 "socket present → use it"). Socket =
MYKB_SOCKET ?? <brain>/.mykbd.sock(mirrorsdaemon/main.ts). 5unit tests.
MykbStoreto theKnowledgeStoreinterface (one-line alias importper file ×10).
index.tsswapsMykbStore.open→selectKnowledgeStore.RpcKnowledgeStoreis now LSP-substitutable with zero call-sitechange — the payoff of the sync-bridge decision.
KnowledgeStore.searchlacked theexcludeZonearg the concreteimpl + contract §5.3 (
exclude_zone) already support. Aligned theinterface and threaded it through
RpcKnowledgeStore.search+ thedispatcher
searchverb (not cast away). +1 RPC parity test.Evidence
Full suite 645/645, zero regressions from the interface retype +
extension store swap (strong LSP evidence). Build + tsc + lint clean.
64/64 daemon tests post-rebase.
Note: in-container the sync bridge blocking the extension's event loop
while the separate-process host daemon serves the call is exactly the
synchronous semantics
fs.appendFileSynchas today — no behaviour changefor the agent's turn.