Repository navigation
Extension namespaces: session_ext + kv_store (schema v4, #3069) - #3070
Conversation
…v4) (#3056) Two generic tables give host/plugin/UI features a durable home in the unified index without per-feature schema migrations: - session_ext (session_id, key) → value_json: per-session arbitrary state, swept by deleteSession (no pin semantics — checkpoint instead); - kv_store (namespace, key) → value_json: namespaced cross-session state (lane-level / per-agent / global), caller-managed lifecycle (deleteKv("lane:<id>") retires a lane namespace). Keys/namespaces: non-empty printable ≤256 chars (namespaced by convention: "r3:", "web:", "plugin:<name>:", "lane:<id>:"). Values: inline JSON ≤4 MiB (large payloads belong in the content CAS). LIKE metacharacters escaped in listKv key-prefix filters. Kernel state NEVER migrates here — kstate_json stays the kernel's and the tables are outside the LegacySessionLike view (zero digest parity churn). Available in shadow AND full (side-table substrate like checkpoints); legacy-only fails fast with the 501-able message. Store: set/get/list/delete for both tables; deleteSession sweeps session_ext inside its transaction. SessionStore: thin liveShadow() wrappers. Migration v3→v4 is two idempotent CREATE TABLE IF NOT EXISTS. Tests: round-trips/upsert/prefix-isolation, sweep-vs-kv survival, guards, v3→v4 in-place migration + idempotence, legacy 501 class. Schema version assertions 3→4.
… in passing) Master-side regression, reproduced on plain origin/master (c800ed1): the #3067 merge (effectiveConfig embeds preserveRecentMessages 3) landed after 8f93c33's regen, so the metadata section digest drifted on all four wires; master's push CI skips the test matrix, so nobody saw. State/blockContents/stats sections are byte-identical. Same in-passing pattern as a937803.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3518-pr.3070.101c8a8This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3070.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Starting review of #3070 (extension namespaces: session_ext + kv_store, schema v4). Located the branch Working through: original issue direction (#3069) → regression surface → code logic → test validity → diff cleanliness. Will post the structured verdict (eight questions) once done. |
…(fixed in passing)" This reverts commit bf32bbb.
The v4 extension-namespaces feature (session_ext + kv_store) is tracked in #3069; every provenance comment and the CHANGELOG line cited #3056, which is an unrelated, already-closed codex inline auto-compact PR. Correct the 10 references so grep-based archaeology lands on the right issue. No logic change; comments/CHANGELOG only.
[bot] 🏷 PR #3070 审核结论(extension namespaces / schema v4) 一句话判定:功能代码本身正确、可合;但分支在审核中途被改动——「顺手 golden 重生成」被 revert,当前 背景:给统一索引加两张通用表—— 结构化八问:
发现与处置:
次要观察(不阻断,未扩大范围): 门禁状态(审核时点):static-gates / kernel-guard / pi-subagents-guard / config-surface-guard / version-guard / unused-exports / docs-* / build-artifact / 各 real-client e2e lane 全绿; 收工判定:代码批准;合并 hold——等 storage-render lane 绿(恢复重生成或先落配套 golden 修复)后再由人工合并。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.390-master.b8e2144 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #3069.
What
Two generic tables in the unified index, so host/plugin/UI features get a durable home WITHOUT per-feature schema migrations (the zero-baggage window before the full-default flip):
session_ext(session_id, key) → value_json— per-session arbitrary state. Swept inside thedeleteSessiontransaction (state dies with the session; checkpoint it if it must survive). No pin semantics.kv_store(namespace, key) → value_json— namespaced cross-session state (lane-level / per-agent / global). Caller-managed lifecycle:deleteKv("lane:<id>")retires a lane namespace;deleteSessionnever touches it.Design edges (deliberate)
kstate_jsonstays the kernel's. Both tables sit OUTSIDE the LegacySessionLike view → zero digest parity churn (corpus + goldens prove it)."r3:"","web:","plugin::","lane::"`). Guards reject control chars, oversize and non-serializable values.listKvkey-prefix filters escape LIKE metacharacters (%/_/\\are literal).Surface
UnifiedStore:set/get/list/deleteSessionExt,set/get/list/deleteKv.UnifiedShadow: passthroughs.SessionStore: thinliveShadow()wrappers.Migration
v3 → v4 = two idempotent
CREATE TABLE IF NOT EXISTSinside the existing migration transaction. Fresh DBs create v4 directly. Tests: round-trips/upsert/prefix isolation, sweep-vs-kv survival on deleteSession, guards, v3→v4 in-place + idempotent reopen, legacy 501 class, schema assertions 3→4.In passing: golden regen REVERTED (phantom drift, my stale kernel/dist)
I first believed the 4 storage-render goldens were red on master and regen'd them (bf32bbb). Wrong: my local kernel/dist predated #3058's
preserveRecentMessages5→3 flip, so my drive produced the pre-flip digests. Aftercd kernel && npm run build, master's committed goldens (8f93c33) pass byte-for-byte — reverted in daebe97. tsc does NOT catch a stale kernel dist (no new exports involved); the only guard is building kernel before regen. Suggested hardening (in #3075): freshness assertion inside update-storage-render-goldens.ts.Known master-side red (NOT from this PR): #1387 stop-signal tests
Plain origin/master (c800ed1, fresh kernel build) fails the two #1387 tail tests — the #3058 preserve 5→3 flip changed drain/partial-failure stop-signal semantics the tests pin. Filed #3075 for the owner to decide (test update vs kernel floor). The test-matrix legs failing on this PR are exactly those two; every other check including typecheck/lint/goldens is green.
Tests
prepared by an agent under the local git identity (ranxianglei), human merge required