Repository navigation
Description
repo:objectstack#5 · os-project-manager · session_01FEkQ5mC8eA4qtKSweeF7wd
Filing gate: ② seat split. Source: #38413 acceptance 2 ("A measured drain of at least 50,000 records on a real store and embedder, before and after, in the report; the after figure is within a small multiple of the rebuild time for the same records"). Seat repo:objectstack#5 ruled on 2026-11-29T07:38Z that PR #38509 is Part of #38413 and that acceptance 2 is not closed by its local measurement, following the #38411 precedent (seat's words: 「PR #38509 改成 Part of #38413,验收 2 不算闭 … 另立后续卡:用真嵌入供应商做 50k 排空实测」). Child of epic #37000.
Grading: area:ai · Task (measurement) · p2 (closes #38413's acceptance) · reach: deployments that bulk-import into a record-sourced knowledge source with a remote embedder · evidence: PR #38509 body (local model figures) and dev report 7251433810.
维护者速读
- 做什么:用真实的向量化服务(不是本地模拟)实测一次「导入 5 万条后检索追上」要多久,并和同样数据的整体重建对比。
- 为什么单立:service-knowledge: a bulk import syncs one record per queue message, read, embedded and written alone, so the index trails the data for hours #38413 的批量同步(PR feat(service-knowledge): record sync consumes the database queue in batches of 100, and a large backlog is reconciled #38509)只在容器里用本地模拟的向量化服务测过:5 万条约 4 分钟,重建约 2.4 分钟,约 1.7 倍。容器里没有真实服务的密钥,所以卡上要求的“真实存储和向量化服务”这一条还没满足。
- 影响:只测量、出报告,不改代码。
- 要你做的:无。
What
- On a real store and a real remote embedding provider (the BrightRule evaluation environment, 评测:经 MCP 作答和盲评可交给本机 claude CLI;向量命中按条款所属制度计读 brightrule#88's tooling, or the verification seat), with PR feat(service-knowledge): record sync consumes the database queue in batches of 100, and a large backlog is reconciled #38509 merged: import or bulk-update at least 50,000 records of one indexed object, and time the record-sync drain from the first publish to an empty record-sync queue with the source's sync state current.
- On the same deployment and records, time a full rebuild of the source.
- If the deployment is on a release without feat(service-knowledge): record sync consumes the database queue in batches of 100, and a large backlog is reconciled #38509, the before figure is the per-message drain on that release, which may be stopped early and projected; say so.
Acceptance
- The report gives: store, embedder provider and model, record count, after drain time, rebuild time, the after/rebuild ratio, embed request count for both, and dead letters (expected 0).
- The ratio is within a small multiple of the rebuild, as service-knowledge: a bulk import syncs one record per queue message, read, embedded and written alone, so the index trails the data for hours #38413 asks; if it is not, the report names where the time went (claim/settle writes, embed latency or the re-read) and a card is filed for it.
- Reported on service-knowledge: a bulk import syncs one record per queue message, read, embedded and written alone, so the index trails the data for hours #38413 and here; this card closes service-knowledge: a bulk import syncs one record per queue message, read, embedded and written alone, so the index trails the data for hours #38413's acceptance 2.
Known from the local run (PR #38509, labelled LOCAL MODEL)
SQLite store and libSQL vector store; embedder modelled at 200 ms per request + 0.5 ms per input, up to 2,048 inputs per request, serial. After: 50,000 drained in about 239 s with 500 requests; rebuild: about 142 s with 500 requests (about 1.7x); before: 4.8 messages/s (projected about 2.9 h). Because after and rebuild send the same number of serial requests, a slower provider should move the ratio toward 1; that is not measured. Per-row claim and settle writes (contract review 7252567666, N1) may show on a remote store.
Blocked-by: #38509
Not in scope: code changes (a finding goes to its own card).
Dedupe: knowledge drain real embedder 7 (none on this; #38413 itself) · record-sync drain measurement 8 (none on this) · knowledge 50,000 drain 1 (#38413 itself).
Activity
objectstack-fleet commentedon Nov 29, 2026
triage#1 · zhuangjianguo · session_01QsR2jRH2X4frz9bBiZHNk4
Triage: a measurement on
packages/services/service-knowledgewith a real embedding provider · area:ai · domain:server · Task · p2 (it closes acceptance 2 of #38413, which it blocks) · pm:blocked (the body'sBlocked-by: #38509, an open PR) · size M. Rationale: the card had no triage audit and no type. Type set to Task at this touch.objectstack-fleet commentedon Nov 29, 2026
triage#1 · zhuangjianguo · session_01QsR2jRH2X4frz9bBiZHNk4
Unlocked by the unlock scan: the body's
Blocked-by: #38509merged (a5fe764), sopm:blocked→pm:queue.objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#1 · zhuangjianguo · session_01QsR2jTsdScTh3o2fSjbxSz
Claim: PM loop round 3
Session:
session_01QsR2jTsdScTh3o2fSjbxSzThread session:
session_01QsR2jQrcqKfy7NuQRoeKzXAccount:
zhuangjianguoBranch:
claude/project-thread-ybli6gWorktree:
objectstack-issue-38529Domain:
domain:serverSeat:
repo:objectstack#1Area:
o1-knowFile surface:
packages/services/service-knowledge/read only, no file changed — a measurement on origin/main; report comments on #38529 and #38413 only; one-off scripts stay in the scratchpad (stop on breach; explain in the report)Container & model: M, mode:thread, model: default (no path-derived mandate; no code change), effort: high
Clause-②: no — no code change
Metadata-protocol: none
Responsibility:
n/a — not a defect cardThread-read: 7254400087
Premise: holds (#38509 merged a5fe764; the maintainer supplied a real embedding provider through the Vercel AI Gateway as an environment variable, and ruled the store a local Turso (libSQL) instance in the container)
Serial constraints cleared: the surface is read only and changes no file, so an in-flight claim on
packages/services/service-knowledge/does not wait on it, nor it on them; noneobjectstack-fleet commentedon Nov 29, 2026
repo:objectstack#1 · zhuangjianguo · session_01QsR2jQrcqKfy7NuQRoeKzX
2026-11-29T13:09Z · measurement report for #38529 (acceptance 2 of #38413): a 50,000-record import drained with a real embedding provider, against a rebuild of the same records
维护者速读
Setup
30141766(contains feat(service-knowledge): record sync consumes the database queue in batches of 100, and a large backlog is reconciled #38509a5fe7645and fix(service-knowledge): widen the record-sync covered margin to the queue lease #38577). No code change; a one-off harness outside the repo.TursoDriverwith afile:URL (local mode, which runs on better-sqlite3). The vectors are onKnowledgeTursoPluginwith afile:URL (@libsql/client). Both are files in the container; no remotelibsql://database was used.OpenAIEmbedderfrompackages/plugins/embedder-openai,baseUrlhttps://ai-gateway.vercel.sh/v1, modelopenai/text-embedding-3-small, 1,536 dimensions. A gateway model name is not in the known-model tables, somaxBatchSize: 2048andmaxInputTokens: 8192(OpenAI's documented caps) anddimensions: 1536were set explicitly. Requests go through the container's egress proxy, so the latencies below include it.ObjectQLPlugin,QueueServicePlugin({ adapter: 'db' })with default options,KnowledgeServicePluginwith one object source (contract_clause, contenttitle+body, nowhere),buildAtBoot: false.sys_knowledge_sync_statewas registered, so the sync state below is the durable one.current), thenql.insertin arrays of 500, which publishes one record-sync message per record. The drain is timed from the first publish to a queue with nopendingorrunningmessage.rebuildSource(…, { trigger: 'operator' }), timed to its end.Results
current, builddone, failures 0current, failures 0current, builddoneresilientFetchretried. None reached the queue: 0 dead letters, 0 failed syncs.syncedand 0covered, in 501 handler calls (499 of 100 messages, plus one of 75 and one of 25).Where the time went
Batch only, 805.7 s:
upsert: about 210 s (26 %), that isupsert670 s minus its embed time;processRecordSyncBatchoutsideupsert: about 18 s;Rebuild, 591.4 s: embed 406 s (69 %), writes about 168 s, reads about 17 s.
The batch-only drain is 214 s slower than the rebuild:
With the default configuration, the backlog reconcile began 6 s after the first publish. It walked all 49,551 records it found, so it is a second full build running beside the batch path. The two embed streams run at once, which is why the drain beats the batch-only time and lands slightly under the rebuild.
Finding for the seat (no card filed here)
With the default configuration, every record was embedded through two paths: 985 requests against the rebuild's 503, and 99,551 documents written against 50,000. The duplicated inputs mostly went unsent (101,305 inputs against 100,667 passages), because each path finds the passages the other already wrote. The requests and the writes were still doubled.
The reason: a message completes as
coveredonly when it was published at leastRECORD_SYNC_COVER_MARGIN_MS(30 s since #38577) before the build began (knowledge-service.ts, thepublishedAt < startedAt - RECORD_SYNC_COVER_MARGIN_MScheck). This import published all 50,000 messages within 34 s, and the reconcile began 6 s after the first one, so the rule covered none of them. The batch path synced every message the reconcile had already indexed.This run did not count outcomes; the batch-only run did. That the default run covered none of its messages follows from the margin rule and the timestamps. Because the backlog reconcile starts as soon as about 5,000 messages wait, it begins early in any bulk import, and no message published less than 30 s before it began, or after, can be covered. So for a typical import the reconcile is pure extra work. It does not change acceptance 2, but on a paid provider it doubles the requests and the writes. Two possible fixes are to not schedule the backlog reconcile while every waiting message is inside the margin, or to cover by the walk's own read of each row. The choice is the seat's.
Deviations
maxInputsPerRequest. The option ismaxBatchSize, set to 2048.libsql://store are not measured; review N1's per-row writes would cost more there.running. The rebuild boot reclaimed and synced them, which accounts for 12 extra adapter documents. It is negligible against 50,000.considerBacklogReconcilein the harness, because no plugin option turns it off (reconcile: falsegoverns the scheduled reconcile only).NODE_USE_ENV_PROXY=1in this container. Without it, one request took 28 s.objectstack-fleet commentedon Nov 29, 2026
repo:objectstack#1 · zhuangjianguo · session_01QsR2jTsdScTh3o2fSjbxSz
2026-11-29T13:19Z · Done, with no PR: a measurement card. The report is 7256340769 (#38413 got 7256348494). Acceptance 2 holds: drain ÷ rebuild is 0.96 on the default configuration and 1.36 on the batch path alone, both a small multiple. The out-of-scope finding is filed as #38591. Claim 7255569219 closes with this comment;
pm:dispatchedcomes off and the card closes as completed.feat(service-knowledge): record sync consumes the database queue in b…
fix(service-knowledge): defer a backlog reconcile asked for during a …