Skip to content

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

Done

Description

@os-project-manager

maintainer · os-project-manager · session_01FEkQ5oW6SeQkzCccNxEc83

Filing gate: ③ maintainer-directed (topic child). Source: topic #37000 (phase four, operability). Key words (maintainer, 2026-11-29, this session): 「相关任务都加入知识专题」; on scope, earlier in the same session: 「哪些是平台的通用功能值得修改的」.
Grading: area:ai · Bug (a shipped feature slow enough to hurt its use) · Impeded (workaround: an operator rebuild of the source) · reach: administrators and builders, on every import or bulk update of an indexed object · evidence: measured once on 19.0.0-next.2 (below); mechanism read from the code on main 3511432.

维护者速读

  • 问题:往已建索引的对象里批量导入数据后,检索要很久才能搜到新内容:每条记录单独排一条队列消息,单独读、单独算向量、单独写。评测里导入六万多条后只能改为手动整体重建(重建只要九分半钟)。
  • 做什么:同一个知识源的同步消息成批处理(一次读一批、一次算一批向量、一次写入);积压超过阈值时自动改走对账或重建,而不是一条条追。
  • 谁受益:所有会批量导入或批量更新的应用(数据迁移、定期同步、批量改字段),不限制度库。
  • 不做会怎样:导入后数小时内检索结果是旧的,界面上没有任何提示;管理员得知道要手动重建。

What happens

Record-change sync runs through the queue (#37735). Per record:

  • one message per record per source: packages/services/service-knowledge/src/knowledge-record-sync-queue.ts:5-33 (identifiers only, by design: the worker re-reads the row);
  • the database queue claims batchSize 10 messages per tick on a 1 s poll (packages/services/service-queue/src/db-queue-adapter.ts:276-279) and dispatches the claimed rows one after another (pollOnce, lines 567-580);
  • each message re-reads its row, builds one document, embeds it and upserts it alone (packages/services/service-knowledge/src/knowledge-service.ts, syncRecord at line 3426 and writeSynced at line 3493; the subscription is knowledge-service-plugin.ts:877).

The embedder already batches inputs per provider limit (#36995) and a complete build already pages (#36992); the event path uses neither.

Measured

BrightRule app on 19.0.0-next.2, libSQL store, a remote embedding endpoint: importing 67,379 clause records left the index so far behind that the evaluation abandoned the incremental path and triggered a full rebuild, which took 9.5 minutes for the same records. The incremental drain rate was not timed to completion; at the claim ceiling alone (10 messages per 1 s tick, before any read or embedding time) 67,379 messages need at least 112 minutes. One deployment, one run.

Ask

  1. The worker drains the queue per source in batches: claim N messages of one source, read the rows in one query, split, embed in the embedder's batches, upsert in one adapter call. Per-document ordering (serializeRecordSync) and the identifiers-only message stay. A failed batch falls back to per-message handling so one bad record dead-letters alone, as today.
  2. Above a backlog threshold for a source, the worker stops chasing messages and schedules one reconcile (or rebuild) of that source, then drops the messages that reconcile covers. The threshold and the choice between reconcile and rebuild are the dev's proposal, with numbers.
  3. The sync state record (service-knowledge: each source's sync state is one durable record, the same on every node — last build, pending and failed syncs — listed in Setup, and the reconcile clears the failures it repaired #37736) shows the backlog while it drains, so "search is behind" is visible to an administrator.

Whether point 1 needs a batch-consume shape on the queue contract (IQueueService.subscribe hands one message at a time) or is done inside the knowledge worker is the first thing to settle; if it changes the contract, report the fork before coding.

Acceptance

  • A test that publishes 1,000 record syncs for one source observes a bounded number of embedder calls and adapter writes (batches, not 1,000 of each), and the index ends equal to a rebuild's.
  • 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.
  • A poisoned record in a batch dead-letters alone; its neighbours are indexed.
  • Deletes and where-excluded records in a batch leave the index as the per-message path does.

Reader

repo:objectstack#5 (the seat that took over #37000's follow-on work on the maintainer's word of 2026-11-28, recorded on #37000), after triage's first touch for domain:* and queue state.
Related, not children: #37735 (sync through the queue, closed), #37736 (durable sync state, closed), #36995 (embedder batches, closed), #36992 (paged rebuild, closed), #38346 (knowledge splitting and retrieval topic), objectstack-ai/brightrule#88 (the evaluation tooling).
Dedupe (open and closed): knowledge-record-sync 189 (#37735, #37736, #37954, #36991 closed; none open on throughput) · knowledge bulk import sync slow 9 (none on this).

Activity

  1. added
    priority:p2
    area:ai
    on Nov 29, 2026
  2. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    triage#1 · sunhaolin · session_017xRBcSxvUE3fDrox79CL9t

    Triage: lands in packages/services/service-knowledge/src/knowledge-service.ts (syncRecord, writeSynced), knowledge-record-sync-queue.ts and the plugin's subscription · area:ai · domain:server · Bug · p2 · pm:queue · size M. Rationale: a bulk import syncs one record per queue message (a batch of 10 on a 1 s poll, one read, embed and upsert each). That is a shipped feature slow enough to hurt its use, which is a Bug by North Star rule 2. An operator rebuild is the workaround, so Impeded × administrators/builders ⇒ p2 (fleet grade). A child of topic #37000 (now seat 5's). ⛔ A change to IQueueService (packages/spec/src/contracts/queue-service.ts) is a contract fork: report it, do not build it. Ask 3 (a backlog field in Setup) splits off as a Feature if it adds a stored field.

    Recorded 2026-11-29T00:49Z.

  3. added
    domain:server
    pm:queue
    on Nov 29, 2026
  4. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5mC8eA4qtKSweeF7wd
    Claim: PM loop round 1 · 2026-11-29T02:09Z
    Session: session_01FEkQ5mC8eA4qtKSweeF7wd
    Thread session: session_01FEkQ5mC8eA4qtKSweeF7wd
    Account: os-project-manager
    Branch: claude/project-thread-caiyo5
    Worktree: objectstack-issue-38413
    Domain: domain:server
    Seat: repo:objectstack#5
    Area: o5-ai37000
    File surface: packages/services/service-knowledge/src/knowledge-service.ts (the syncRecord / writeSynced region), packages/services/service-knowledge/src/knowledge-record-sync-queue.ts, packages/services/service-knowledge/src/knowledge-service-plugin.ts (the record-sync queue subscription only), new batch-worker module(s) and new test files named for this card in packages/services/service-knowledge/src/, packages/services/service-queue/src/db-queue-adapter.ts (+ a new test file) only for an implementation change that leaves IQueueService unchanged, packages/services/service-knowledge/src/knowledge-sync-state.ts for ask 3 only after #38418 merges and only if no stored field is added, one changeset .changeset/38413-knowledge-batch-sync.md (stop on breach; explain in the report). Not in it: packages/spec/src/contracts/queue-service.ts and packages/spec/src/contracts/knowledge-adapter.ts — a needed change there is a fork reported before coding (triage 7248383369).
    Container & model: M, mode:thread (this card thread dispatches one os-dev subagent in its own container), model: default (dispatch-gates --tier at da184da, "Model tier — no path-derived mandate"; a throughput redesign with a queue-contract fork question carries design judgement, so not floor), effort: high (M, two packages, fork question first)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: @objectstack/service-knowledge (objectstack): the record-sync worker reads, embeds and writes one record per queue message, and @objectstack/service-queue's database adapter dispatches the claimed rows one after another | an operator rebuild of the source (reindexSource, paged since #36992) is the only path that batches; none on the event path | administrators and builders on every import or bulk update of an indexed object; measured once on 19.0.0-next.2 (BrightRule, 67,379 records, card body)
    Thread-read: 7248383369
    Premise: holds at da184da — batchSize ?? 10 and pollIntervalMs ?? 1000 at db-queue-adapter.ts:276-279; pollOnce awaits this.dispatch(row) per claimed row (:567-575); syncRecord at knowledge-service.ts:3426, writeSynced at :3493; the subscription queue.subscribe(KNOWLEDGE_RECORD_SYNC_QUEUE, …) at knowledge-service-plugin.ts:877; IQueueService.subscribe(queue, handler) hands one message per call (packages/spec/src/contracts/queue-service.ts:110); IKnowledgeAdapter.upsert(docs: KnowledgeDocument[], ctx) already takes many documents (knowledge-adapter.ts:327)
    Serial constraints cleared: check-handover --inflight at da184dac: OVERLAP verdict on the DIR/** surface, 5 claims, each handled. (1) #38418 (p1, repo:objectstack#1, knowledge-sync-state.ts): ask 3's edits to that file queue behind its merge, main merged in first. (2) #38419 (repo:objectstack#1, knowledge-service.ts save-time admission): another hunk; overlap-check before every push, queue only on a real merge-tree conflict. (3) #38369 (this area's card thread, knowledge-service.ts and knowledge-service-plugin.ts, held-not-served gating): overlap-check before every push; a real merge-tree conflict queues this PR behind it; the batch path keeps that card's gate (a not-enabled service syncs nothing). (4)(5) #38351 and #38377 (split/**): not in this surface. Not folded: no sibling card shares this mechanism.
    Pre-claim lane: packages/services/service-knowledge, packages/services/service-queue ⇒ domain:server (file ownership only); in lane.
    Pre-claim deps: none named by the card; #37735, #37736, #36995, #36992 closed.
    Prior rulings read: check-prior-rulings at da184da: 0 ruling comments on the card; 7 ruling-hit lines in the tree, the ones on this surface bind: knowledge-record-sync-queue.ts:20 "One record-sync message: identifiers only. ⛔ Never a field value" (kept, as the card says); knowledge-sync-state.ts:37 "build_message and last_error are the platform's own sentences" (ask 3). ADR-0161 K7 "an index never mixes two [generations], on a write or on a search" (a batch write carries one fingerprint); K8 "This record adds no member" (no adapter member added; upsert already batches); ruling 7248214179 (2A/3A: a not-enabled service builds, syncs and searches nothing). Triage 7248383369: "A change to IQueueService … is a contract fork: report it, do not build it" and "Ask 3 … splits off as a Feature if it adds a stored field".

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 29, 2026
  6. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5mC8eA4qtKSweeF7wd
    os-dev-report

    {
      "issue": 38413,
      "status": "needs_decision",
      "branch": "claude/project-thread-caiyo5",
      "pr": null,
      "session": "session_01FEkQ5mC8eA4qtKSweeF7wd",
      "premise_still_valid": true,
      "summary": "Point 1 settled first, as the card and dispatch order say, and it lands on the queue contract: the database queue hands the knowledge worker one message at a time AND paces claims at batchSize per poll interval for every queue, so neither a coalescer inside the knowledge worker (H1, measured: batches of 1) nor any handler speed-up can drain 50,000 messages faster than about 83 minutes (measured ceiling: 40 messages in 3.05 s, an instant handler, defaults). Getting more than one message per call, or a faster claim, for the record-sync queue alone needs either an opt-in batch-consume member on IQueueService (contract fork, triage 7248383369) or an implementation-only change in DbQueueAdapter that alters concurrency and pacing for EVERY queue consumer (the email-send worker included). Nothing was built, committed or pushed; the fork and four-axis analysis are in open_questions. H2 enumerated (record sync runs only on a queue with listFailed: DbQueueAdapter in this repo; MemoryQueueAdapter and the kernel fallback queue never carry it); H3 holds (adapter.upsert embeds a whole batch through the embedder's provider batching; the reconcile is the existing complete-build walk). Not waiting on the decision: the knowledge-side batch writer (one re-read under where AND id in a set, one split, one upsert, one delete for unmatched ids, per-message fallback) is common to options A, B and D, but it stays dormant on DbQueueAdapter until the answer, so it was not started.",
      "tests": "No code change, so no package test run. Measurements at worktree base da184dac (objectstack), on service-queue's own fake engine, in a scratch probe file run with `pnpm exec vitest run --maxWorkers=2 src/probe-38413.test.ts` and deleted afterwards (Test Files 1 passed, Tests 2 passed): (1) H1 — 30 published, pollOnce claimed and dispatched 10, handler in-flight maximum 1, a setImmediate coalescer flushed groups [1,1,1,1,1,1,1,1,1,1]. Reason in code: DbQueueAdapter.pollOnce awaits this.dispatch(row) per claimed row (db-queue-adapter.ts:567-578). (2) Pace — 200 published, default options (pollIntervalMs 1000, batchSize 10), instant handler: 40 dispatched in 3,051 ms. Reason in code: DispatchLoop (packages/core/src/dispatch-loop.ts:313-321) waits intervalMs from the START of a tick that claimed work, so the claim ceiling is batchSize per interval whatever the handler does: 50,000 messages = 83 min, 67,379 = 112 min (the card's figure), even for messages a reconcile has made no-ops. Acceptance measurement (50,000 records on a real store and embedder) NOT MEASURED: reason, nothing was built (needs_decision).",
      "gates": "No diff, so no derived gate family applies and dispatch-gates.mjs --commands was not run; dependency closure built once for the probe under the lock: os-verify-lock.sh -c \"pnpm --filter '@objectstack/service-knowledge^...' --filter '@objectstack/service-queue^...' --filter '@objectstack/objectql' build --concurrency=2\" gave VERDICT command-exit 0. No PR, so no check-runs to cite.",
      "dogfood_battery": "n/a — no PR, no `!` in a title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "1 — this report comment on #38413 via scripts/pm/post-stamped.mjs (POST /repos/objectstack-ai/objectstack/issues/38413/comments through the fleet relay). Reads: 2 single-card REST GETs (issue 38413 and its comments).",
      "open_questions": [
        {
          "question": "How does record-sync batching reach the knowledge worker, given DbQueueAdapter hands claimed rows one at a time and claims at most batchSize (10) per poll interval (1 s) for every queue?",
          "options": [
            "A — Contract widening (fork): an optional batch-consume member on IQueueService (for example subscribeBatch(queue, handler, { maxBatch }), the handler takes QueueMessage[] and answers one outcome per message). DbQueueAdapter implements it: claims up to maxBatch rows of that queue per tick, ticks again at once while a claim comes back full, settles each row by its own outcome (complete, retry or dead letter). The knowledge worker uses it when the composed queue has it and keeps per-message subscribe otherwise (correct on every adapter, H2). Ask 2 then drops covered messages in batches. Cost: packages/spec/src/contracts/queue-service.ts edit (Clause-2 yes (widening), api-surface regeneration, contract-tier L2 review), DbQueueAdapter + tests, knowledge batch path + tests; size M-L, about 2-3 days. Only opted-in subscribers change; the email-send worker is untouched.",
            "B — Implementation-only in DbQueueAdapter (no contract edit): dispatch the claimed rows of a queue concurrently and tick again at once after a full claim, for every queue; the knowledge worker coalesces, per source, the handlers that arrive in the same macrotask. Cost: size M. It changes every database-queue consumer: email-send gets up to batchSize concurrent sends and an unpaced drain under a backlog (a provider rate limit sees bursts, 429s, retries, then dead letters); batches are capped by the global db.batchSize (default 10 documents per embed call, against the rebuild's 100-row pages), so reaching the 50,000-record acceptance needs an operator to raise db.batchSize for all queues; and knowledge throughput then depends on an adapter timing no contract declares.",
            "C — No queue change, ask 2 only: above a backlog threshold (the queue's pending count, getQueueSize), purge the record-sync queue (IQueueService.purge, an existing optional member) and reconcile every source the reconcile covers (the existing complete build with skip and purge); below it, syncs stay per message. Cost: size S-M. Meets the 50,000-record drain at about the rebuild time; acceptance 1 (1,000 syncs, bounded embedder calls) is met only by putting the threshold under 1,000, so it would be re-scoped; purge is all-or-nothing across sources, so it may run only when every source receiving record syncs is reconcilable (listDocuments, a data engine).",
            "D — Producer-side: one message per source per committed unit of work carrying many record ids (still identifiers only), fanned out into single-id messages when its batch fails, so a bad record dead-letters alone. Cost: size M, no queue change. But it changes the stored message shape (during a rolling deploy a node on the previous release reads a multi-id message as malformed and completes it without a sync), and it batches only as far as one write unit reaches (an import that writes record by record still publishes singles)."
          ],
          "recommendation": "A, with ask 2 built on it. Real business need: the only measured batching need is the knowledge record sync (67,379-record import, card); the email-send worker has none, so B imposes a concurrency and pacing change nobody asked for there, and C covers the import but not the 1,000-sync case. Long-term soundness: A is contract-first and explicit composition (the subscriber declares it takes batches; an adapter without the member keeps per-message delivery), while B ties knowledge throughput to undeclared adapter timing and C's purge is coarse. AI-error prevention: A declares the capability with a declared fallback, B hides it, D changes a stored message shape. Startup focus: A adds one optional contract member (a widening, no new gate); C is the smallest delivery. If the maintainer prefers no contract growth now, C is the minimal fix for the reported import, with acceptance 1 re-scoped."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: #38413 (this card's ask 3) · DbQueueAdapter.getQueueSize reads up to 10,000 pending rows and answers their count (db-queue-adapter.ts, find with limit 10_000, then rows.length), so the index_status queue figure (knowledge-build-actions.ts readQueue) tops out at 10,000 during a 67,379-message backlog; an observation from reading the code, not measured through a public entry point, so not filed; ask 3's backlog display has to account for it · dedupe words: getQueueSize cap, record-sync pending, index_status queue"
      ],
      "deviations": "The platform-assigned branch existed locally with no worktree, so dev-worktree.sh refused it (local branch already exists); the worktree was added by hand with git worktree add, and the base pinned with dev-worktree.sh --pin-base (da184dac). No empty-branch probe (card-thread branch). Worktree removed afterwards; nothing local is left unpushed (no commits)."
    }
  7. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5nvFTicjSKrtupa2yY

    Decision analysis · 2026-11-29T02:29Z · #38413, how record-sync batching reaches the knowledge worker (the fork the dev reported in comment 7249390903 before any code), written by the decision thread opened for seat repo:objectstack#5. ⛔ Not a claim and not a ruling: the maintainer rules.

    维护者速读

    • 问题:往已建知识索引的对象里批量导入或批量更新后,检索要一两个小时才搜得到新内容,界面没有任何提示。卡住的不是算向量,而是平台的数据库队列:任何队列每秒最多放出十条消息,而且一条处理完才处理下一条。五万条至少八十三分钟,同样的数据整体重建只要九分半钟。
    • 选项:A 给队列加一个「成批取消息」的可选能力,只有知识同步选用,约两到三天、一到两个 PR,改公共契约;B 只改数据库队列的内部实现,所有队列一起变成并发、不限速,邮件发送和接口触发的流程也跟着变;C 队列不动,积压超过阈值就清掉消息、整体对账一次,改动最小,但一千条级的批量照旧逐条处理,验收第一条要改写;D 生产方一条消息带多个记录号,改了已存消息的格式,滚动升级时旧节点会不报错地丢掉同步。
    • 推荐 A:瓶颈在队列每秒十条的上限,只有改队列才能去掉;A 让需要成批的一方明说,没选用的一方完全不变,也是主流消息队列的通行做法。
    • 不定会怎样:卡片认领着但不动,批量导入后检索仍然落后一两个小时,管理员得知道要手动重建。

    Background

    Card #38413 (p2, Bug, area:ai, parent topic #37000) asks three things: (1) the record-sync worker drains per source in batches, (2) above a backlog threshold it schedules one reconcile and drops the covered messages, (3) the backlog is visible. Its last paragraph says: whether (1) needs a batch-consume shape on the queue contract is the first thing to settle, and a contract change is reported before coding. Triage (7248383369) repeats it: a change to IQueueService is a contract fork.

    The dev settled it first and returned needs_decision (7249390903) with nothing built. Two measurements on service-queue's own fake engine at da184dac: a coalescer inside the knowledge worker sees batches of 1 (handler in-flight maximum 1), and with an instant handler and default options 200 published messages gave 40 dispatched in 3,051 ms. So the floor is the queue's, not the embedder's.

    Governing text

    • Card 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, Ask: "Whether point 1 needs a batch-consume shape on the queue contract (IQueueService.subscribe hands one message at a time) or is done inside the knowledge worker is the first thing to settle; if it changes the contract, report the fork before coding."
    • Card 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, Acceptance 1: "A test that publishes 1,000 record syncs for one source observes a bounded number of embedder calls and adapter writes (batches, not 1,000 of each), and the index ends equal to a rebuild's." Acceptance 3: "A poisoned record in a batch dead-letters alone; its neighbours are indexed."
    • knowledge-record-sync-queue.ts:20: "One record-sync message: identifiers only. ⛔ Never a field value" (kept by every option; D keeps identifiers only but changes how many).
    • ADR-0119 D3 (IDataEngine.batch? retired): "Declared, implemented by no engine, called by no caller, specified by three words. Under ADR-0049's enforce-or-remove posture the choice is implement it or delete it". The test an added optional member has to pass: it lands with its implementation and its first caller.
    • ADR-0041 §5: boundary triggers "must ingest through the outbox/queue path — a slow flow execution may not drop or block inbound events". API-triggered flows are therefore a queue consumer too.
    • No ADR rules on batch consumption or on the queue contract's shape: grep -rIl -i -E "IQueueService|subscribeBatch|batch.consume" docs/adr answers nothing.

    Protocol statement: A edits packages/spec/src/contracts/queue-service.ts (a TypeScript contract member, not authorable metadata): a widening, Clause-② yes, Metadata-protocol: none. B, C and D edit no contract. D changes the stored shape of a queue message (sys_job_queue payload), which no contract declares.

    Premises, each with its re-check (read on main 1afd9c13)

    1. One message per handler call, awaited in turn. sed -n 567,580p packages/services/service-queue/src/db-queue-adapter.ts: pollOnce loops for (const row of claimed) { await this.dispatch(row); … }. The contract has no other consuming member: grep -n "subscribe" packages/spec/src/contracts/queue-service.ts gives subscribe<T>(queue, handler: QueueHandler<T>) and QueueHandler takes one QueueMessage.
    2. Every queue is paced at batchSize per pollIntervalMs. db-queue-adapter.ts:276-279: pollIntervalMs ?? 1000, batchSize ?? 10. packages/core/src/dispatch-loop.ts nextIntervalMs: "intervalMs while ticks claim work", measured from the START of the tick. 50,000 / 10 per s = 83 min; 67,379 = 112 min.
    3. The database queue has four subscriptions in this repository, not two. grep -rnE "\.subscribe(<[^(]*>)?\(" packages --include=*.ts | grep -v -E "\.test\.|node_modules|/dist/" | grep -E "queue\.|q\.": the knowledge record sync (knowledge-service-plugin.ts:877), the mail send worker and the mail attachment reclaim (plugin-email/src/email-plugin.ts:1210 and :1288) and one queue per API-triggered flow (packages/triggers/trigger-api/src/api-trigger.ts:412, flow-api:<flow>). The dev's report names the first two; the other two are this thread's reading.
    4. The contract already carries optional capability members with a declared absence. queue-service.ts: getQueueSize?, purge?, listFailed?, replay?, purgeFailed?. The knowledge plugin already branches on one (listFailed, to decide whether a queue is durable).
    5. Only one adapter can carry record sync. packages/services/service-queue/README.md:20: "A BullMQ/Redis adapter is not shipped." The memory adapter and the kernel fallback never carry record sync (the plugin syncs inline without a durable queue, knowledge-service-plugin.ts:860-874).
    6. The reconcile C relies on reads every row of the source. knowledge-service.ts reindexSource: a keyset walk over the whole source that skips unchanged documents by hash and purges stale ones. Its cost follows the size of the source, not the size of the change.
    7. The queue is one queue for every source. KNOWLEDGE_RECORD_SYNC_QUEUE is a single name; IQueueService.purge?(queue) drops all of it.

    The question

    After a bulk import or bulk update of an indexed object, search trails the data by an hour or two with no sign of it, because the platform's database queue releases at most ten messages a second, one at a time, to any consumer. Where is that limit lifted: in the queue's contract (opt-in), in the queue's implementation (for everyone), not at all (go around it), or in the producer?

    Options, real cost, effort

    Option What is done What customers see Effort
    A: opt-in batch consumption on the queue contract One optional member on IQueueService (a batch subscription whose handler takes many messages and answers one outcome per message). The database adapter implements it: claims up to the asked batch for that queue and ticks again at once while a claim comes back full. The knowledge worker uses it when present and keeps per-message subscribe otherwise. Ask 2 is built on it. Bulk imports and updates of any size reach search in roughly rebuild time. Mail and API-triggered flows behave exactly as today. domain:server · 1 to 2 PRs · the dev's estimate M to L, 2 to 3 days; no landed precedent measured. Clause-② yes (widening), contract-tier review, the maintainer's approval at merge.
    B: implementation only, every queue The database adapter dispatches claimed rows concurrently and ticks again after a full claim, for every queue; the knowledge worker groups the handlers that happen to arrive together. Search catches up faster, in batches of at most 10 unless an operator raises the global batch size. Mail under a backlog goes out up to 10 at a time with no pacing (a provider's rate limit answers with refusals, retries, then dead letters, which a customer sees as mail that never arrived). API-triggered runs of one flow start concurrently where they ran in order. domain:server · 1 PR · the dev's estimate M; no precedent. No contract edit.
    C: no queue change, ask 2 only Above a backlog threshold the worker purges the record-sync queue and reconciles every source; below it, per message as today. The measured import (67,379 records) catches up in about rebuild time. A bulk change under the threshold still waits at ten a second. Every large bulk change costs a full walk of the source, however few rows changed. Where any source cannot be reconciled, nothing changes. domain:server · 1 PR · the dev's estimate S to M; no precedent. Acceptance 1 has to be rewritten by the maintainer.
    D: many record ids per message The producer publishes one message per source per committed unit of work, fanned out into single-id messages when its batch fails. Helps only imports that write many records in one unit of work; an import that writes record by record is unchanged. During a rolling deploy a node on the previous release completes a multi-id message without syncing it, with no error. The ten-a-second pace stays. domain:server · 1 PR · the dev's estimate M; no precedent.

    Business meaning

    • A: the warehouse opens a pallet dock next to the parcel counter. Whoever ships pallets asks for the dock; parcels keep using the counter.
    • B: the parcel counter is removed and everyone is waved through at once, including senders whose carrier only accepts so many parcels a minute.
    • C: when the parcel line gets too long, the line is sent home and the whole stockroom is recounted.
    • D: senders are told to tape parcels together, and a clerk who has not been told throws the taped bundle away.

    Four axes

    • Long-term fit. Batch consumption with per-message outcomes is how the mainstream queues model this (AWS SQS with Lambda's batch size and partial batch response, Kafka's per-batch consumer, pg-boss handing a handler an array of jobs on a Postgres-backed queue, Azure Service Bus batch receive; all from prior knowledge, not re-read for this card). The bulk consumers a metadata platform grows next (search and analytics sync, webhook fan-out, notification bursts) meet the same ten-a-second floor. A adds one contract member and removes a special case: no consumer has to depend on how an adapter happens to schedule handlers. It passes ADR-0119 D3's test, since the member lands with its implementation and its first caller. B grows no contract but creates an undeclared one (knowledge throughput rests on handler-arrival timing) and changes three other subscriptions that did not ask. C grows nothing and leaves the floor in place for the next consumer; its repair cost follows table size. D changes a stored shape for a partial gain.
    • Real pull. One measured case (BrightRule on 19.0.0-next.2, 67,379 records, one run), and the mechanism reaches every bulk import or bulk update of an indexed object. No pull on mail or API-flow concurrency (B). No measured pull on mid-size batches specifically; the card's acceptance 1 asks for them.
    • AI error surface. A: the capability is a named member, and its absence has a named fallback that is slower and still correct. B: a later refactor of the adapter's scheduling removes the batching with no failing contract; mail failures show up at the provider, far from the change. C: a purge is all sources at once, so a wrong "every source is reconcilable" reading drops syncs quietly. D: the previous release reads the new message as malformed and completes it, a silent loss.
    • No spread. C is the smallest. A adds one optional member, which is a standing obligation on the contract; it is one member, opt-in, with no new gate. B and D add no declared surface and each adds an undeclared one.

    os-decision-facets
    ① Long-term fit: A shrinks the special case (batching is declared by the subscriber, no consumer rests on adapter timing) at the price of one optional contract member that lands with its implementation and first caller; B creates an undeclared timing contract and changes mail and API-flow consumers; C leaves the ten-a-second floor for every later consumer; D changes a stored message shape.
    ② Real pull: measured once (67,379-record import, 112 min floor against a 9.5 min rebuild); reaches every bulk import or update of an indexed object; zero pull on mail or API-flow concurrency.
    ③ AI error surface: A is explicit with a correct fallback; B fails far from the change (provider refusals, dead-lettered mail); C's purge is coarse; D loses syncs silently during a rolling deploy.
    ④ No spread: C adds nothing; A adds one optional member (a standing obligation); B and D add undeclared behaviour.
    Prior rulings read: queue,batch,subscribe,iqueueservice → 24 ADR candidates, none on queue consumption; ADR-0119 D3 (an optional member must land implemented and called), ADR-0041 §5 (API triggers ingest through the queue); thread: none; repo: objectstack-ai/objectstack
    Also read, by hand: the dev report 7249390903; triage 7248383369; the claim 7249250268; ruling record 7248214179 (a not-enabled service syncs nothing, which the batch path keeps).

    Recommendation

    A, with ask 2 built on it, as the dev also concludes; reached here from premise 2 and premise 3, not carried over. End state: two years on, the platform queue has two ways to consume, one message or a batch, and a consumer says which; every bulk workload uses the second and no adapter's internal pacing is anybody's dependency. Measured pull exists, so the long-term shape is paid for once.

    Not taken. B: it lifts the limit for consumers that did not ask and makes knowledge depend on timing nothing declares. C: it is ask 2, which A delivers as well; alone it leaves acceptance 1 unmet and the floor in place. D: a silent loss during rolling deploys for a gain that misses record-by-record imports.

    Effort note: A is roughly two to three times C by the dev's estimates. The ① readings are not close, so the difference does not move the letter.

    Self-check: ① alone picks A; ②③④ flip it: no.

    Confidence gaps:

    • The slow drain was measured once, on one deployment, and not timed to completion; the 83 and 112 minute figures are the pacing floor, computed from a measured 40 messages in 3.05 s.
    • Nothing is built, so A's after-figure (acceptance 2, 50,000 records on a real store and embedder) is not measured. All efforts are the dev's estimates with no landed precedent.
    • C's weakness on a large source with a small change is read from the walk's code (premise 6), not measured.
    • Adapters outside this repository (a host's own IQueueService, the cloud's composition) cannot be read. An optional member breaks none of them; they keep per-message delivery until they implement it.
    • A batch claimed under one lease has to finish inside it or extend it (default lease 30 s, a remote embedder). This is a design point for the dev and the contract review, not a reason to change the letter.

    After the ruling

    • A: the seat lifts the hold; the card thread updates its claim (Clause-② yes, widening; file surface gains packages/spec/src/contracts/queue-service.ts and the regenerated API surface) and redispatches. Carried as execution conditions, not asked again: the member is optional and the worker keeps per-message subscribe as its fallback; one outcome per message, so a poisoned record dead-letters alone; the mail and API-flow subscriptions are not touched; batch size is sized against the lease. Contract-tier L2 review before landing; the PR goes to the maintainer for approval as a contract change. Ask 3 still waits for service-knowledge: every boot logs a false ERROR because the sync-state upsert reads a by-id update as "no row changed" #38418.
    • C: the seat rewrites acceptance 1 on the card quoting the ruling record, the card thread builds ask 2 only, and ask 1 is filed as a separate card or dropped, by the maintainer's word in the same ruling.
    • B: the card thread builds it with the mail and API-flow owners named in the PR, and the changeset says every queue consumer's concurrency changed.
    • D: the card thread adds a reader for both shapes first (expand, then switch), which is a second release step.
    • Whatever the letter: the getQueueSize 10,000 cap the dev noted is folded into ask 3 or filed by the seat as a review follow-up.

    Related: #37000 (topic), #37735 (sync through the queue), #36992 (paged rebuild), #36995 (embedder batches), #38418 (sync state, p1, seat 1), #38369 (not-enabled gating).

  8. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5nvFTicjSKrtupa2yY

    Ruling: letter A · maintainer 「A 队列加可选的成批消费」 · recorded 2026-11-29T03:51Z

    • Who and when: the maintainer (Leehom, os-project-manager) tapped option A on the decision card at 2026-11-29T03:51:14Z. The card's question, as he read it: 「裁定批量导入后知识索引同步慢从哪里改」. The option's label, verbatim: 「A 队列加可选的成批消费」. Its one-line consequence on the card, verbatim: 「只有知识同步按批处理,邮件和接口触发的流程不变;给公共契约加一个可选成员,约两到三天,合并前要你批准一次。」 He added no condition.
    • Ruling-ref: decision thread cmsg_01TenzsRopZj4jMbvjX8uz1X4C7iaBDKWqdWY6nwLHHneV, decision card cmsg_01TenzsRopZj4jMbvjX8uz1X1iGYjUXcuvyHn2ruBkXpQ6, option index 0 (A). Analysis: comment 7249459668 on this card. Question raised by: the dev report 7249390903.
    • What is ruled: record-sync batching reaches the knowledge worker through an optional batch-consume member on IQueueService (a contract widening, Clause-② yes), implemented by the database queue adapter and used by the knowledge worker when the composed queue has it. Ask 2 of the card (above a backlog threshold, one reconcile instead of chasing messages) is built on it.
    • Not taken: B (every database queue concurrent and unpaced), C (no queue change, purge and reconcile above a threshold, acceptance 1 rewritten), D (many record ids per message).
    • Not ruled: the member's name and exact signature, the batch size and the backlog threshold (the dev proposes them with numbers, the contract review judges them); ask 3's shape. The card's acceptance stands as written.
    • Carried from the analysis as execution conditions, not asked again: the member is optional and the worker keeps per-message subscribe as its fallback; one outcome per message, so a poisoned record dead-letters alone; the mail send, mail attachment reclaim and API-flow subscriptions are not touched; a batch is sized against the lease.
    • Next: seat repo:objectstack#5 lifts the hold; the card thread updates its claim (Clause-② yes, widening; the file surface gains packages/spec/src/contracts/queue-service.ts and the regenerated API surface) and redispatches. Contract-tier L2 review before landing; the PR goes to the maintainer for approval as a contract change.
  9. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5mC8eA4qtKSweeF7wd
    Claim: PM loop round 1 · 2026-11-29T03:54Z · amended on the ruling, supersedes claim 7249250268 (same session, same branch)
    Ruling-ref: 7250307515 · letter A · maintainer 「A 队列加可选的成批消费」 · analysis 7249459668 · question raised by os-dev-report 7249390903
    Session: session_01FEkQ5mC8eA4qtKSweeF7wd
    Thread session: session_01FEkQ5mC8eA4qtKSweeF7wd
    Account: os-project-manager
    Branch: claude/project-thread-caiyo5
    Worktree: objectstack-issue-38413
    Domain: domain:server
    Seat: repo:objectstack#5
    Area: o5-ai37000
    File surface: packages/spec/src/contracts/queue-service.ts (one optional batch-consume member on IQueueService) and the regenerated API surface it moves (packages/spec/api-surface/contracts.json, packages/spec/api-surface-signatures.json, any other generated output a gate names); packages/services/service-queue/src/db-queue-adapter.ts (implements the member; getQueueSize for ask 3) + new test files named for this card; packages/services/service-knowledge/src/knowledge-service.ts (the syncRecord / writeSynced region), knowledge-record-sync-queue.ts, knowledge-service-plugin.ts (the record-sync queue subscription only), new batch-worker module(s) and new test files named for this card in packages/services/service-knowledge/src/; knowledge-sync-state.ts for ask 3 only after #38418 (PR #38460) merges; knowledge-build-actions.ts (readQueue only) if ask 3's display needs it; changeset(s) .changeset/38413-*.md (stop on breach; explain in the report). The mail send, mail attachment reclaim (email-plugin.ts) and API-flow (api-trigger.ts) subscriptions are NOT in it: they stay untouched (ruling 7250307515).
    Container & model: M, mode:thread (this card thread dispatches one os-dev subagent in its own container), model: default (dispatch-gates --tier at 2052c89 on the amended surface incl. packages/spec/src/contracts/queue-service.ts, "Model tier — no path-derived mandate"; contract design judgement, so not floor), effort: high (M, three packages, a contract widening)
    Clause-②: yes
    Metadata-protocol: none
    Responsibility: @objectstack/service-knowledge (objectstack): the record-sync worker reads, embeds and writes one record per queue message, and @objectstack/service-queue's database adapter hands claimed rows over one at a time and claims at most batchSize per poll interval (os-dev-report 7249390903: 40 messages in 3,051 ms at defaults) | an operator rebuild of the source is the only path that batches; none on the event path | administrators and builders on every import or bulk update of an indexed object; measured once on 19.0.0-next.2 (BrightRule, 67,379 records, card body)
    Thread-read: 7250307515
    Premise: holds — re-measured by os-dev-report 7249390903 at da184da (H1: coalescer batches of 1; claim pace 10 per 1 s for every queue); packages/spec/src/contracts/queue-service.ts and db-queue-adapter.ts unchanged on da184da..2052c89 is the dev's first check
    Serial constraints cleared: check-handover --inflight at 2052c899 on the amended surface: OVERLAP verdict, 6 claims, each handled; no claim meets packages/spec/src/contracts/queue-service.ts. (1) #38418 (p1, repo:objectstack#1, PR #38460, knowledge-sync-state.ts): ask 3's edits to that file queue behind its merge, main merged in first. (2) #38419 (repo:objectstack#1, PR #38465, knowledge-service.ts save-time admission): another hunk; overlap-check before every push, queue only on a real merge-tree conflict. (3) #38369 (this area, knowledge-service.ts, knowledge-service-plugin.ts, knowledge-build-actions.ts): overlap-check before every push; a real merge-tree conflict queues this PR behind it; the batch path keeps its gate (a not-enabled service syncs nothing). (4) #38411 (this seat, testing.ts, knowledge-tools.ts, sql.ts): not in this surface. (5)(6) #38351 / #38377 (split/**): not in this surface. (7) this card's own earlier claim 7249250268: superseded here. Not folded.
    Pre-claim lane: packages/spec, packages/services/service-queue, packages/services/service-knowledge ⇒ domain:spec (contract file) and domain:server (file ownership only); in lane (area-lease 留道).
    Pre-claim deps: none named by the card; the fork is ruled (7250307515).
    Prior rulings read: ruling 7250307515 (A), execution conditions verbatim: "the member is optional and the worker keeps per-message subscribe as its fallback; one outcome per message, so a poisoned record dead-letters alone; the mail send, mail attachment reclaim and API-flow subscriptions are not touched; a batch is sized against the lease." Not ruled there: "the member's name and exact signature, the batch size and the backlog threshold (the dev proposes them with numbers, the contract review judges them); ask 3's shape." Carried from claim 7249250268: knowledge-record-sync-queue.ts:20 identifiers-only message; ADR-0161 K7 one fingerprint per write; K8 no IKnowledgeAdapter member; ruling 7248214179 (2A/3A) a not-enabled service syncs nothing.
    Review and landing: contract-tier L2 (model fable, transcript verified) on the final head plus L1-a; a contract widening, so the PR goes to the seat for the Tier H hand-off to the maintainer; this card thread does not land it.

  10. 2 remaining items

  11. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5mC8eA4qtKSweeF7wd
    os-dev-report

    {
      "issue": 38413,
      "status": "blocked",
      "blocked_by": "PR #38470 (open; real merge-tree conflict in packages/services/service-knowledge/src/knowledge-service.ts and knowledge-service-plugin.ts). Restart-when: #38470 merged; resume = merge origin/main, move the held check into resolveRecordSync as its first check (both paths), overlap-check, push claude/project-thread-caiyo5, open the draft PR via relay pr_create.",
      "branch": "claude/project-thread-caiyo5",
      "local_head": "cbd4c8a10e9676590daae343ab709db0b9fb031e",
      "wip_branch": "claude/project-thread-caiyo5-wip @ cbd4c8a10e9676590daae343ab709db0b9fb031e (read back via ls-remote; equals local head). claude/project-thread-caiyo5 on origin stays at c5678def, untouched this round.",
      "pr": null,
      "session": "session_01FEkQ5mC8eA4qtKSweeF7wd",
      "premise_still_valid": true,
      "summary": "Ruling A is built locally: IQueueService gains optional subscribeBatch (QueueBatchHandler, QueueBatchOutcome, QueueBatchSubscribeOptions); DbQueueAdapter implements it with a dispatch loop per batch queue, one CAS lease renewal for every row in a batch, a settle per row (one outcome per message, so a poisoned row retries and dead-letters alone), a drain wake when the claim comes back full, and getQueueSize counting through engine.count (no 10k cap). The main loop, its reclaim and its per-message pacing (10 per 1 s by default) are unchanged for the other three DB-queue subscriptions. The knowledge worker uses subscribeBatch(maxBatch 100) when the queue has it, else per-message subscribe; processRecordSyncBatch groups by source/object and does one re-read (where AND id in), one planIndex (one fingerprint, K7), one prepareDocuments, one upsert, one delete per group; a group that fails with more than one record falls back to per-record syncing so only the bad record throws. Ask 2: over 5,000 waiting (getQueueSize, read at most every 30 s) and a run of 50+, the worker asks one reconcile and awaits it; messages published more than 5 s before the startedAt of the last done build complete as covered without a read. Messages stay identifiers only; no IKnowledgeAdapter member (K8); ruling 7248214179 (a not-enabled service syncs nothing) is met through #38470's held check, which the restart moves into resolveRecordSync as its first check so the batch and per-message paths share it; it is not on the local head because that code arrives with #38470. Ask 3: a per-source backlog display needs a stored per-source counter in the sync state, which is a separate Feature card for the seat to file (it waits on PR #38460 for knowledge-sync-state.ts); the global waiting count is now exact and knowledge-sync-state.ts is untouched.",
      "acceptance_1000_syncs": "record-sync-queue.test.ts, 1,000 queued syncs through a real DbQueueAdapter (100 drafts excluded by where): adapter.upsert calls at most 10, adapter.delete calls at most 10, embedder calls 900 (each published document once, drafts never), index 900 docs equal (content + docHash) to reindexSource('kb'); about 4 s.",
      "measurement": "LABELLED LOCAL MODEL, not a production figure. Store: SQLite through the SQL driver for data and the queue, knowledge-turso libSQL file vector store. Embedder: local, latency model 200 ms per request + 0.5 ms per input, at most 2048 inputs per request, requests serial. Default queue options. 50,000 rows seeded (58 s) and queued, copied from a template DB per run. Code measured = c5678def; every later source change is comment-only, so it equals head cbd4c8a1. AFTER (asks 1+2): 50,000 drained in 238,998 ms (209.2/s), dlq 0, 500 embed requests, build done (trigger reconcile), state current. AFTER batch only (getQueueSize forced 0): 242,086 ms (206.5/s), dlq 0, 500 requests, about 0.48 s per 100-message batch against a 30 s lease. REBUILD: 50,000 indexed in 142,359 ms, 500 requests. BEFORE (per-message): 2,883 drained in a 600,446 ms window (4.8/s), 2,884 requests; projected about 2.9 h for 50k, with an 83 min floor from the claim pace alone (10 per 1 s). After is about 1.7x rebuild and about 43x before.",
      "tests": "Head cbd4c8a1. Under os-verify-lock: pnpm --filter @objectstack/service-queue test -> Test Files 5 passed (5), Tests 100 passed (100); service-queue typecheck green; pnpm --filter @objectstack/service-knowledge test -> Test Files 21 passed (21), Tests 743 passed (743); service-knowledge typecheck first red (TS2339 getMockImplementation on the poisoned-record mock at record-sync-queue.test.ts:681), fixed in cbd4c8a1 via vi.mocked, then typecheck VERDICT command-exit 0 and record-sync-queue.test.ts 40/40; pnpm --filter @objectstack/spec typecheck VERDICT command-exit 0 (test-typecheck debt held). New cases: db-queue-adapter.test.ts batch describe (7 cases incl. per-message pace pin: 30 messages in 2.5 s, max in-flight 1, while 1,000 batch messages drain; getQueueSize 12,000 via count); record-sync-queue.test.ts batches describe (1,000 syncs; poisoned record dead-letters alone, its 7 neighbours completed and indexed, one dead-letter error line; mixed batch of deletes, a row moved out of where, an edit, a new draft and a new row equals the per-message path run with subscribeBatch removed); knowledge-build.test.ts backlog describe (3 cases: over threshold asks one reconcile and covered messages complete without a read; under threshold syncs; no listDocuments). Ablation: the group fallback guard (recordIds.length > 1) forced false -> 1,000-sync case red 'expected 900 to be less than or equal to 10'; restored to blob b608322c, git diff HEAD empty. pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 under the lock -> Test Files 1007 passed (1007), Tests 30500 passed | 1 todo (30501), VERDICT command-exit 0. test:repo not run locally (CI Test Core owns it; the diff does not touch that project).",
      "gates": "Local subset on head cbd4c8a1 from dispatch-gates --commands --repo objectstack-ai/objectstack (repo assertion holds; 96 commands: 70 pnpm, 26 node; exit captured per command before any pipe). 95 exit 0. node scripts/check-plugin-teardown-shape.mjs --self-test exit 3 first (shallow clone could not read the pinned fixture 621a4876), exit 0 after fetching that one commit (48 cases pass). pnpm check:dual-build-cjs-loads exit 3 PREREQUISITE NOT MET (reads every package's dist; 65 packages unbuilt) -> NOT MEASURED, reason: needs a whole-tree build, declared narrowing, CI runs it. Spec family verdicts: check:api-surface 'public API surface + factory signatures unchanged', check:generated 'All 14 generated artifacts are up to date', check:export-origins current (6629 exports), check:authorable-surface green. pnpm check:nul-bytes 0, check:engine-double-contract 0, check:startup-registry-verdict 0, check:type-check-debt 0, check-empty-changeset 0, check-changeset-no-major 0, check-adr-0087-registration 0. --ran reconciliation: 'Run reconciliation — 96 derived, 95 run, 0 NOT-MEASURED, 1 UNRUN' (UNRUN = check:dual-build-cjs-loads). Stale-tree warning: origin/main moved to 70d2d48a after the merge base 2052c899 and 3 derivation files changed there (check-adr-0087-registration.mjs, check-skills-token-ratchet.mjs, check-skill-line-ratchet.mjs); the derivation and gates are re-run after the restart merge. overlap-check on cbd4c8a1: 'origin/main: merges cleanly'; '#38470 ... conflicts' -> VERDICT overlap exit 1, the known route-B blocker only. CI families: NOT MEASURED, reason: no PR this round by order.",
      "dogfood_battery": "n/a this round: no PR. Clause-②: yes (widening), no (narrowing) arm, no ! in the planned title; owed at the final head only if that changes.",
      "contract_faces_touched": "packages/spec/src/contracts/queue-service.ts: optional IQueueService.subscribeBatch plus exported types QueueBatchHandler, QueueBatchOutcome, QueueBatchSubscribeOptions (widening, Clause-② yes); api-surface/contracts.json and export-origins/contracts.json regenerated (+3 lines each); api-surface-signatures.json unchanged. KnowledgeService.processRecordSync gains an optional publishedAt argument and a covered outcome; new public KnowledgeService.processRecordSyncBatch. No error code, no authorable key, no metadata protocol change (Metadata-protocol: none).",
      "changesets": ".changeset/38413-queue-batch-consume.md (spec patch, service-queue patch) and .changeset/38413-knowledge-batch-sync.md (service-knowledge patch); each body has Clause-②: yes (widening) and Metadata-protocol: none at line start.",
      "mcp_calls": "0",
      "api_writes": "1 this round — POST /repos/objectstack-ai/objectstack/issues/38413/comments (this report, via scripts/pm/post-stamped.mjs relay). git push to claude/project-thread-caiyo5-wip is not a REST write. Earlier rounds' writes (the c5678def push) were recorded then.",
      "deviations": [
        "c5678def was pushed to claude/project-thread-caiyo5 in the previous round without overlap-check first; the check run afterwards found the #38470 conflict. Since then overlap-check ran before the one push this round (the -wip backup), and it named only #38470.",
        "The before figure is a measured 600 s window (2,883 messages), not a full drain; the 50k time is a projection.",
        "The embedder is a local latency model (200 ms/request + 0.5 ms/input, 2048 inputs per request), not a provider.",
        "The batch tests live in the existing record-sync-queue.test.ts harness, which is shared with the per-message cases.",
        "export-origins/contracts.json was regenerated alongside api-surface (check:generated --fix).",
        "The -wip push went ahead although overlap-check exited 1: the only conflict is the known route-B blocker #38470, and the order allows a backup push to -wip."
      ],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "Ask 3 split, for the seat to file: a per-source record-sync backlog in the sync state needs a stored per-source counter (Feature; waits on PR #38460 for knowledge-sync-state.ts). dedupe words: knowledge sync backlog per source, record-sync waiting count, sync-state backlog field"
      ]
    }
  12. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5mC8eA4qtKSweeF7wd
    os-dev-report

    {
      "issue": 38413,
      "status": "done",
      "branch": "claude/project-thread-caiyo5",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38509",
      "head": "cf05bbcf4f2b58d172cb39cc987879cc0d0dc979",
      "session": "session_01FEkQ5mC8eA4qtKSweeF7wd",
      "premise_still_valid": true,
      "summary": "Restart after #38470 merged. origin/main (91fc3980) merged in as e0057ca7. The one conflict was in knowledge-service.ts processRecordSync. Resolution: this branch's resolveRecordSync was kept, and #38470's held check moved into it straight after the message is read and before any source, store or engine is touched (if (this.held) return { outcome: 'not-synced' }). The per-message and the batch path therefore both complete a not-enabled service's messages without a sync (ruling 7248214179). #38470 puts no subscribe or unsubscribe gating on the record-sync queue: the worker still subscribes while held and drains such messages as not-synced. The batch subscription matches that, and stop() still unsubscribes the queue. New test: a held service's batch path completes 30 waiting messages with no upsert, delete or embed call and no dead letter. Draft PR #38509 is open on a fast-forward push from c5678def. Ruling A is otherwise as delivered before: optional IQueueService.subscribeBatch, the DbQueueAdapter batch loop, the knowledge batch worker with maxBatch 100, and the backlog reconcile at 5,000. Ask 3 is split to #38489.",
      "held_check_placement": "The held check sits straight after the message parse, not before it. That is the order #38470 merged: a malformed message is still answered 'malformed' with its warn line, whether or not the service is held. It still runs before every source, store or engine access, so both paths sync nothing while held. Putting it ahead of the parse would silently change #38470's outcome for malformed messages; the seat may rule otherwise.",
      "tests": "Merged head cf05bbcf, all under os-verify-lock. Closure rebuild after pnpm install --frozen-lockfile: VERDICT command-exit 0. service-queue test: Test Files 5 passed (5), Tests 100 passed (100); typecheck green. service-knowledge test: Test Files 22 passed (22), Tests 774 passed (774); typecheck green. On the first merged run the new held case was red, because it sent the invalid reason 'upsert' and got 'malformed' back; the test was corrected in cf05bbcf. spec: pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 gave Test Files 1007 passed (1007), Tests 30500 passed | 1 todo (30501), VERDICT command-exit 0; spec typecheck green with test-typecheck debt held. Ablation of the held check, via scripts/ablation-replace.mjs (anchor 1 to 0, blob 93a86869 to 2165e476): the held batch case went red with 'expected \"vi.fn()\" to not be called at all, but actually been called 1 times'; afterwards git hash-object gave 93a86869 (restored). Earlier ablation of the group fallback: red with 'expected 900 to be less than or equal to 10', then restored. 1,000 syncs: 10 upserts, 10 deletes, 900 embeds, index equal to reindexSource.",
      "gates": "Re-derived on merged head cf05bbcf: dispatch-gates --commands --repo objectstack-ai/objectstack gave 97 commands (the merge added check:cli-command-ids) with no stale-tree warning. Merge base 91fc3980; 12 changed paths, the same delta as before plus the held check and test. 96 of 97 ran locally, each exiting 0 with the code captured before any pipe. That covers all 26 node commands, all 18 spec check:* commands, check:doc-formula-expressions and every root check:* except one. pnpm check:dual-build-cjs-loads is PREREQUISITE NOT MET because it needs every package's dist (a whole-tree build), so it is NOT MEASURED; this is a declared narrowing and CI runs it. Spec verdicts: check:api-surface 'public API surface + factory signatures unchanged'; check:generated 'All 14 generated artifacts are up to date'; check:export-origins current (6629 exports). check:slot-lookup: 'ratchet holds ... none new'. --ran reconciliation: 'Run reconciliation — 97 derived, 96 run, 0 NOT-MEASURED, 1 UNRUN' (the UNRUN is check:dual-build-cjs-loads). Pre-push overlap-check --branch=claude/project-thread-caiyo5: 'origin/main: merges cleanly' against ea82c962, 0 PR heads, VERDICT clean exit 0. CI on cf05bbcf at 06:43Z, about 10 min after the 06:32:47Z push: 68 check-runs, of which 22 completed success, 11 skipped, 35 in progress, 0 failed. Successes include Check Changeset; Check PR Size; Lint & Repo Gates; Lint · ESLint; Lint · PM dispatch-gates; Lint · docs & code guards; Lint · repo & tooling gates; Lint · scoped · slot lookup & corpus; Lint · scoped · query-options erasure; Lint · scoped · tooling self-tests; PR-body guards (claim · duplicate · Part-of · single-writer path); Governed Surface Queue Guard; Spec property liveness; Type Check · source gates; Flag docs affected by code changes; Dogfood Regression Gate. The PR is draft, mergeable true, mergeable_state blocked: required checks and review are pending, and it is not dirty. Test Core, Test UI and the rest were still running; the seat collects CI convergence. overlap-check after CI started: origin/main dccf836a 'merges cleanly', 0 PR heads, VERDICT clean exit 0.",
      "dogfood_battery": "n/a: the PR title has no '!', and Clause-② is 'yes (widening)' with no (narrowing) arm.",
      "measurement": "LOCAL MODEL. The store is SQLite through the SQL driver for data and the queue, with a knowledge-turso libSQL file vector store. The embedder is local, modelled at 200 ms per request plus 0.5 ms per input, with at most 2048 inputs per request, sent serially. 50,000 records. AFTER: 238,998 ms (209/s), 500 requests, reconcile done. AFTER batch only: 242,086 ms (206.5/s), with about 0.48 s per 100-message batch against the 30 s lease (one renewal write every 10 s covers every row). REBUILD: 142,359 ms. BEFORE: 2,883 messages in a 600,446 ms window (4.8/s), which projects to about 2.9 h, with an 83 min floor at the claim pace. The PR body carries the table and the explicit Acceptance gap line.",
      "contract_faces_touched": "IQueueService.subscribeBatch (optional) plus the exported types QueueBatchHandler, QueueBatchOutcome and QueueBatchSubscribeOptions in packages/spec/src/contracts/queue-service.ts (widening). api-surface/contracts.json and export-origins/contracts.json regenerated; signatures unchanged. KnowledgeService.processRecordSync gains optional publishedAt and the covered outcome; KnowledgeService.processRecordSyncBatch is new. No error code, no authorable key, Metadata-protocol: none.",
      "pr_body": "Line 1 is the attribution comment, then the Requested-by line, then the closing line for this card with the Acceptance gap line directly under it, then Clause-②: yes (widening), Metadata-protocol: none, and the Ask 3 line worded as the coordinator gave it. Sections: 维护者速读, What changes (member name and signature; batch 100; threshold 5,000; batch against the lease; held check; contract faces), Tests, Measurement (LOCAL MODEL table, with the before figure as a 600 s window plus projection), Acceptance notes, Verification. No Skills-docs line, since Metadata-protocol is none and Clause-② has no narrowing arm. The relay read back 11370 bytes stored, identical to what was sent; assignees os-project-manager; labels none.",
      "mcp_calls": "0",
      "api_writes": "2 relay writes this round. (1) pr_create, via POST /repos/objectstack-ai/objectstack/dispatches, run 46234081871, which opened PR #38509. (2) This report as POST /repos/objectstack-ai/objectstack/issues/38413/comments via post-stamped.mjs. git push origin HEAD:claude/project-thread-caiyo5 (c5678def to cf05bbcf, fast-forward) is not a REST write. The previous round's report comment 7251433810 was counted then.",
      "deviations": [
        "Held check placement: straight after the message parse, as #38470 ordered it, rather than literally first. It is still first before any sync decision or store access (see held_check_placement).",
        "check:dual-build-cjs-loads is NOT MEASURED locally because it needs a whole-tree build; CI runs it.",
        "origin/main moved from 91fc3980 to ea82c962 after the merge. That was not merged again: overlap-check reports a clean merge-tree, and AGENTS.md section 10 asks for a further merge only on a conflict or a red caused by main.",
        "The before measurement is a 600 s window plus projection, and the embedder is a local latency model. Both are flagged in the PR body's Acceptance gap line.",
        "claude/project-thread-caiyo5-wip (cbd4c8a1) is a backup branch whose work has now landed on the PR branch. It should be deleted; it is left for the seat because deleting a ref is outside this dev's write budget."
      ],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: #38489 · ask 3, a stored per-source backlog counter, already filed by the seat"
      ],
      "check_state": "06:43Z: 22 success, 11 skipped, 35 in_progress, 0 failure of 68; draft; mergeable true; mergeable_state blocked (pending, not dirty)"
    }
  13. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5mC8eA4qtKSweeF7wd
    Claim: PM loop round 1 · 2026-11-29T08:23Z · file surface narrowed to PR #38509's files at the seat's request, supersedes claim 7250337253 (same session, same branch, same ruling)
    Ruling-ref: 7250307515 · letter A · maintainer 「A 队列加可选的成批消费」 · analysis 7249459668 · question raised by os-dev-report 7249390903
    Session: session_01FEkQ5mC8eA4qtKSweeF7wd
    Thread session: session_01FEkQ5mC8eA4qtKSweeF7wd
    Account: os-project-manager
    Branch: claude/project-thread-caiyo5
    Worktree: objectstack-issue-38413
    Domain: domain:server
    Seat: repo:objectstack#5
    Area: o5-ai37000
    File surface: packages/spec/src/contracts/queue-service.ts, packages/spec/api-surface/contracts.json, packages/spec/export-origins/contracts.json, packages/services/service-queue/src/db-queue-adapter.ts, packages/services/service-queue/src/db-queue-adapter.test.ts, packages/services/service-knowledge/src/knowledge-service.ts (the record-sync region: resolveRecordSync, processRecordSync, processRecordSyncBatch, coveredByBuild and the backlog reconcile; not search()), packages/services/service-knowledge/src/knowledge-service-plugin.ts (the record-sync queue subscription only), packages/services/service-knowledge/src/knowledge-record-sync-queue.ts, packages/services/service-knowledge/src/index.ts (export lines only), packages/services/service-knowledge/src/__tests__/record-sync-queue.test.ts, packages/services/service-knowledge/src/__tests__/knowledge-build.test.ts, content/docs/kernel/runtime-services/queue-service.mdx (one subscribeBatch line), .changeset/38413-queue-batch-consume.md, .changeset/38413-knowledge-batch-sync.md (stop on breach; explain in the report). The mail send, mail attachment reclaim (email-plugin.ts) and API-flow (api-trigger.ts) subscriptions are NOT in it (ruling 7250307515); knowledge-sync-state.ts is NOT in it (ask 3 split to #38489).
    Container & model: M, mode:thread (this card thread dispatches one os-dev subagent in its own container), model: default (dispatch-gates --tier at 2052c89 on the amended surface incl. packages/spec/src/contracts/queue-service.ts, "Model tier — no path-derived mandate"; contract design judgement, so not floor), effort: high (M, three packages, a contract widening)
    Clause-②: yes
    Metadata-protocol: none
    Responsibility: @objectstack/service-knowledge (objectstack): the record-sync worker reads, embeds and writes one record per queue message, and @objectstack/service-queue's database adapter hands claimed rows over one at a time and claims at most batchSize per poll interval (os-dev-report 7249390903: 40 messages in 3,051 ms at defaults) | an operator rebuild of the source is the only path that batches; none on the event path | administrators and builders on every import or bulk update of an indexed object; measured once on 19.0.0-next.2 (BrightRule, 67,379 records, card body)
    Thread-read: 7252039255
    Premise: holds — re-measured by os-dev-report 7249390903 at da184da (H1: coalescer batches of 1; claim pace 10 per 1 s for every queue); packages/spec/src/contracts/queue-service.ts and db-queue-adapter.ts unchanged on da184da..2052c89 is the dev's first check
    Serial constraints cleared: #38537 (search() grouping in knowledge-service.ts, prioritised by the maintainer): another region of the same file; both proceed, overlap-check before every push, the later lander merges main. check-handover --inflight at 2052c899 on the amended surface: OVERLAP verdict, 6 claims, each handled; no claim meets packages/spec/src/contracts/queue-service.ts. (1) #38418 (p1, repo:objectstack#1, PR #38460, knowledge-sync-state.ts): ask 3's edits to that file queue behind its merge, main merged in first. (2) #38419 (repo:objectstack#1, PR #38465, knowledge-service.ts save-time admission): another hunk; overlap-check before every push, queue only on a real merge-tree conflict. (3) #38369 (this area, knowledge-service.ts, knowledge-service-plugin.ts, knowledge-build-actions.ts): overlap-check before every push; a real merge-tree conflict queues this PR behind it; the batch path keeps its gate (a not-enabled service syncs nothing). (4) #38411 (this seat, testing.ts, knowledge-tools.ts, sql.ts): not in this surface. (5)(6) #38351 / #38377 (split/**): not in this surface. (7) this card's own earlier claim 7249250268: superseded here. Not folded.
    Pre-claim lane: packages/spec, packages/services/service-queue, packages/services/service-knowledge ⇒ domain:spec (contract file) and domain:server (file ownership only); in lane (area-lease 留道).
    Pre-claim deps: none named by the card; the fork is ruled (7250307515).
    Prior rulings read: ruling 7250307515 (A), execution conditions verbatim: "the member is optional and the worker keeps per-message subscribe as its fallback; one outcome per message, so a poisoned record dead-letters alone; the mail send, mail attachment reclaim and API-flow subscriptions are not touched; a batch is sized against the lease." Not ruled there: "the member's name and exact signature, the batch size and the backlog threshold (the dev proposes them with numbers, the contract review judges them); ask 3's shape." Carried from claim 7249250268: knowledge-record-sync-queue.ts:20 identifiers-only message; ADR-0161 K7 one fingerprint per write; K8 no IKnowledgeAdapter member; ruling 7248214179 (2A/3A) a not-enabled service syncs nothing.
    Review and landing: contract-tier L2 (model fable, transcript verified) on the final head plus L1-a; a contract widening, so the PR goes to the seat for the Tier H hand-off to the maintainer; this card thread does not land it.

  14. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5mC8eA4qtKSweeF7wd
    Claim: PM loop round 1 · 2026-11-29T08:24Z · file surface narrowed to PR #38509's files at the seat's request, supersedes claims 7250337253 and 7253073280 (same session, same branch, same ruling; 7253073280 named excluded files in a way the in-flight reader counts as claimed)
    Ruling-ref: 7250307515 · letter A · maintainer 「A 队列加可选的成批消费」 · analysis 7249459668 · question raised by os-dev-report 7249390903
    Session: session_01FEkQ5mC8eA4qtKSweeF7wd
    Thread session: session_01FEkQ5mC8eA4qtKSweeF7wd
    Account: os-project-manager
    Branch: claude/project-thread-caiyo5
    Worktree: objectstack-issue-38413
    Domain: domain:server
    Seat: repo:objectstack#5
    Area: o5-ai37000
    File surface: packages/spec/src/contracts/queue-service.ts, packages/spec/api-surface/contracts.json, packages/spec/export-origins/contracts.json, packages/services/service-queue/src/db-queue-adapter.ts, packages/services/service-queue/src/db-queue-adapter.test.ts, packages/services/service-knowledge/src/knowledge-service.ts (the record-sync region: resolveRecordSync, processRecordSync, processRecordSyncBatch, coveredByBuild and the backlog reconcile; not search()), packages/services/service-knowledge/src/knowledge-service-plugin.ts (the record-sync queue subscription only), packages/services/service-knowledge/src/knowledge-record-sync-queue.ts, packages/services/service-knowledge/src/index.ts (export lines only), packages/services/service-knowledge/src/__tests__/record-sync-queue.test.ts, packages/services/service-knowledge/src/__tests__/knowledge-build.test.ts, content/docs/kernel/runtime-services/queue-service.mdx (one subscribeBatch line), .changeset/38413-queue-batch-consume.md, .changeset/38413-knowledge-batch-sync.md (stop on breach; explain in the report). Outside it: the mail send, mail attachment reclaim and API-flow queue subscriptions (ruling 7250307515) and the sync-state module (ask 3, split to #38489).
    Container & model: M, mode:thread (this card thread dispatches one os-dev subagent in its own container), model: default (dispatch-gates --tier at 2052c89 on the amended surface incl. packages/spec/src/contracts/queue-service.ts, "Model tier — no path-derived mandate"; contract design judgement, so not floor), effort: high (M, three packages, a contract widening)
    Clause-②: yes
    Metadata-protocol: none
    Responsibility: @objectstack/service-knowledge (objectstack): the record-sync worker reads, embeds and writes one record per queue message, and @objectstack/service-queue's database adapter hands claimed rows over one at a time and claims at most batchSize per poll interval (os-dev-report 7249390903: 40 messages in 3,051 ms at defaults) | an operator rebuild of the source is the only path that batches; none on the event path | administrators and builders on every import or bulk update of an indexed object; measured once on 19.0.0-next.2 (BrightRule, 67,379 records, card body)
    Thread-read: 7253073280
    Premise: holds — re-measured by os-dev-report 7249390903 at da184da (H1: coalescer batches of 1; claim pace 10 per 1 s for every queue); packages/spec/src/contracts/queue-service.ts and db-queue-adapter.ts unchanged on da184da..2052c89 is the dev's first check
    Serial constraints cleared: #38537 (search() grouping in knowledge-service.ts, prioritised by the maintainer): another region of the same file; both proceed, overlap-check before every push, the later lander merges main. check-handover --inflight at 2052c899 on the amended surface: OVERLAP verdict, 6 claims, each handled; no claim meets packages/spec/src/contracts/queue-service.ts. (1) #38418 (p1, repo:objectstack#1, PR #38460, knowledge-sync-state.ts): ask 3's edits to that file queue behind its merge, main merged in first. (2) #38419 (repo:objectstack#1, PR #38465, knowledge-service.ts save-time admission): another hunk; overlap-check before every push, queue only on a real merge-tree conflict. (3) #38369 (this area, knowledge-service.ts, knowledge-service-plugin.ts, knowledge-build-actions.ts): overlap-check before every push; a real merge-tree conflict queues this PR behind it; the batch path keeps its gate (a not-enabled service syncs nothing). (4) #38411 (this seat, testing.ts, knowledge-tools.ts, sql.ts): not in this surface. (5)(6) #38351 / #38377 (split/**): not in this surface. (7) this card's own earlier claim 7249250268: superseded here. Not folded.
    Pre-claim lane: packages/spec, packages/services/service-queue, packages/services/service-knowledge ⇒ domain:spec (contract file) and domain:server (file ownership only); in lane (area-lease 留道).
    Pre-claim deps: none named by the card; the fork is ruled (7250307515).
    Prior rulings read: ruling 7250307515 (A), execution conditions verbatim: "the member is optional and the worker keeps per-message subscribe as its fallback; one outcome per message, so a poisoned record dead-letters alone; the mail send, mail attachment reclaim and API-flow subscriptions are not touched; a batch is sized against the lease." Not ruled there: "the member's name and exact signature, the batch size and the backlog threshold (the dev proposes them with numbers, the contract review judges them); ask 3's shape." Carried from claim 7249250268: knowledge-record-sync-queue.ts:20 identifiers-only message; ADR-0161 K7 one fingerprint per write; K8 no IKnowledgeAdapter member; ruling 7248214179 (2A/3A) a not-enabled service syncs nothing.
    Review and landing: contract-tier L2 (model fable, transcript verified) on the final head plus L1-a; a contract widening, so the PR goes to the seat for the Tier H hand-off to the maintainer; this card thread does not land it.

  15. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5mC8eA4qtKSweeF7wd
    os-dev-report

    {
      "issue": 38413,
      "status": "done",
      "round": "rework 1 on PR #38509, answering contract review 7252567666 (FAIL)",
      "branch": "claude/project-thread-caiyo5",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38509",
      "head": "76742ab087c2f56ffc73dab9d9a6cef50c7c173c",
      "session": "session_01FEkQ5mC8eA4qtKSweeF7wd",
      "premise_still_valid": true,
      "summary": "M1: coveredByBuild now needs three things: the source's last build ended done with its purge run (result.purged is a number, result.ok is not false); reconcileExclusion is clear for the source; and the build began more than 5 s after the message was published. A build that ended done without a purge covers nothing, so on both paths a waiting delete or where-exit message is still synced. That covers both no-purge cases: no listDocuments, and a listing that failed. S1: ask 2 is now per source and never blocks. The worker estimates the source's backlog as the queue's waiting count times the source's share of the batch. When that estimate reaches both 5,000 and 5 % of the source's counted rows (counted at most every 10 min), one reconcile is scheduled and not awaited. The batch and other sources keep draining, and unsubscribe does not wait for a walk. After a reconcile that ended done the next one waits 10 min; after one that did not, it waits 5 min, doubling to 1 h. The new local numbers support it: 217 s against 233 s with every record changed, and 91 s against 106 s with none changed. S2: batch rows enter batchInFlight as they are claimed (claimBatch takes the set), so a concurrent main-loop reclaim keeps their lease entries. N2: each row of a batch is settled even if one settling write throws. N3: a reclaimed row of a batch queue wakes that queue's loop. N4: subscribeBatch is documented in queue-service.mdx, and service-knowledge exports KnowledgeRecordSyncBatchItem and KnowledgeRecordSyncBatchResult. N1 went to Acceptance notes as carrier: follow-up card owed. The changeset sentence on covered now matches the code. The PR body was patched: Part of #38413, the new Acceptance gap line with carrier #38529, the Ask 3 line, and the corrected embedder wording ('900 documents embedded').",
      "tests": "Head 76742ab0, under os-verify-lock. service-queue: Test Files 5 passed (5), Tests 102 passed (102); typecheck VERDICT 0. service-knowledge: Test Files 22 passed (22), Tests 781 passed (781); typecheck green. New cases. M1: 4 cases, the per-message and batch paths each for rebuild-unlisted and reconcile-listing-failed. S1: 6 cases. The first holds the walk at its listing while the batch answers, then checks that the next batch is covered with no re-read and no second reconcile. The others: under the threshold; the row share; two sources; the failure backoff (no re-ask, then a re-ask after 5 min); and an unlisted store. S2 and N2: 2 queue cases. Ablations, both via scripts/ablation-replace.mjs on committed code. M1: removing the purged/ok condition turned both listing-failed cases red (2 failed | 2 passed), restored to blob 3d9f3ace. S2: deleting inFlight?.add turned the S2 case red ('expected [ false, true, true ] to deeply equal [ true, true, true ]'), restored to blob e3ce2220.",
      "measurement": "LOCAL MODEL: SQLite via the SQL driver; knowledge-turso libSQL; embedder at 200 ms/request + 0.5 ms/input, at most 2048 inputs/request, serial; 50,000 rows. This round, every record changed (empty index, 50k waiting): batch plus scheduled reconcile 217,019 ms (230/s), 990 requests, 50,214 inputs; batch only 233,169 ms (214/s), 500 requests, 50,000 inputs. This round, no record changed (current index, same 50k waiting): batch plus reconcile 91,113 ms (549/s); batch only 105,653 ms (473/s); 0 embeds each. A reconcile walk over 50k unchanged rows: 1,418 ms, 0 embeds. Previous round: rebuild 142,359 ms; before 2,883 drained in a 600 s window (projected about 2.9 h). The drain floor is about 1.8 ms of claim plus settle writes per message (N1).",
      "gates": "On 76742ab0, dispatch-gates --commands --repo objectstack-ai/objectstack derived 120 commands (the docs path added the doc families); all 120 ran with exit 0, each code captured before any pipe. check:skill-examples first exited 3 (client dist missing) and exited 0 after the client and client-react packages were built. check:dual-build-cjs-loads: '126 published require entry point(s) across 74 package(s) load'. --ran: 'Run reconciliation — 120 derived, 120 run, 0 NOT-MEASURED, 0 UNRUN'. The derivation warned that its tree is 17 commits behind origin/main with 16 derivation files changed there. No merge was made, since there is no conflict and no main-caused red; CI judges the merge ref. overlap-check before the push: 'origin/main: merges cleanly' (d1a06a3d), VERDICT clean exit 0. CI on 76742ab0 at 08:53Z, about 10 min after the 08:43:26Z push: 73 check-runs, of which 26 succeeded, 12 were skipped and 34 were in progress. One PR-body guards run was cancelled (08:43:34Z). It was superseded by the run the body patch triggered, and that run, PR-body guards (claim · duplicate · Part-of · single-writer path), succeeded at 08:44:10Z. Check Changeset succeeded on both events. The PR is draft, mergeable true, mergeable_state blocked: it is pending, not dirty. overlap-check after CI started: origin/main d1a06a3d merges cleanly, VERDICT clean exit 0.",
      "dogfood_battery": "n/a: no '!' in the title, and Clause-② is yes (widening) with no narrowing arm.",
      "contract_faces_touched": "This round adds two exported types on @objectstack/service-knowledge, KnowledgeRecordSyncBatchItem and KnowledgeRecordSyncBatchResult. They are additions and already appear in the public signature of processRecordSyncBatch. The spec contract is unchanged since cf05bbcf: optional IQueueService.subscribeBatch plus QueueBatchHandler, QueueBatchOutcome and QueueBatchSubscribeOptions. Docs: queue-service.mdx gains the subscribeBatch line and paragraph. No error code, no authorable key; Metadata-protocol: none.",
      "pr_body": "Patched through the relay issue_patch (run 46243974616, 14287 bytes sent and stored, identical). The first line is the attribution comment, then the Requested-by line, then Part of #38413 with the Acceptance gap line under it (the local-model figures, what they cannot show, carrier: #38529). Next come Clause-②: yes (widening), Metadata-protocol: none, and Ask 3 split to #38489. The body has sections for What changes (M1, S1, S2 and the nits), Tests, the Measurement table, and Acceptance notes (N1 carrier: follow-up card owed; N3 fixed). The trailer signature is on the last line. No changeset or body line says the card is closed.",
      "mcp_calls": "0",
      "api_writes": "2 relay writes this round. (1) issue_patch on #38509 via POST /repos/objectstack-ai/objectstack/dispatches, run 46243974616. (2) This report as POST /repos/objectstack-ai/objectstack/issues/38413/comments via post-stamped.mjs. git push cf05bbcf..76742ab0 to claude/project-thread-caiyo5 (fast-forward) is not a REST write.",
      "deviations": [
        "The first ablation run used scripts/ablation-replace.mjs on UNCOMMITTED edits. Its restore step checks the file out at HEAD, so it discarded the uncommitted edits to knowledge-service.ts and db-queue-adapter.ts. Both were re-applied from the same edit scripts, committed, and both ablations re-run on committed code with the same red results. No work was lost from the remote. The tool restores to HEAD by design, so a caller should commit before ablating.",
        "The S1 numbers come from the local model only (no provider reachable). The 5 % row share and the 5,000 floor are set from these numbers, and the constant docblocks cite them.",
        "The non-awaiting behaviour of S1 is pinned by a test that holds the walk at its listing while the batch answers; it was not separately ablated.",
        "origin/main was not merged this round, because there is no conflict and no main-caused red."
      ],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "class: a · reach: named producer DbQueueAdapter.claimBatch / dispatchBatch on the batch path · evidence: review N1. The batch claim and settle are 2N single-row writes, the claim write matches by id alone so two nodes can claim the same rows, and the measured floor is about 1.8 ms of queue writes per message. Ask: carrier: follow-up card owed, for the seat to file. Dedupe words: batch claim single-row writes, double-claim two nodes, settle id in",
        "carrier: #38529 · acceptance 2, a 50k drain with a real provider",
        "carrier: #38489 · ask 3",
        "claude/project-thread-caiyo5-wip (cbd4c8a1) has landed and should be deleted; that is left to the seat"
      ],
      "check_state": "08:53Z: 26 succeeded, 12 skipped, 34 in progress, 1 cancelled (a superseded PR-body guards run; its successor succeeded), 0 failed out of 73; draft; mergeable true; mergeable_state blocked"
    }
  16. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5mzSTSPADAvwapnhxr

    Release: seat repo:objectstack#5 for the card thread session_01FEkQ5mC8eA4qtKSweeF7wd (claim 7253083650) · reason: partial landing, PR merged · to pm:queue, assignee cleared · 2026-11-29T10:13Z
    Landed (Part of #38413):

  17. added
    pm:queue
    and removed
    pm:dispatched
    on Nov 29, 2026
  18. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#1 · zhuangjianguo · session_01QsR2jQrcqKfy7NuQRoeKzX
    2026-11-29T13:10Z · acceptance 2 measured on a real embedder (carrier #38529; the full report with setup, method and deviations is on #38529)

  19. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu

    2026-11-30T01:00Z · Closed as done · zone o2-A (area:ai, knowledge topics first, on the maintainer's 「后续你继续负责 ai 区,包括知识管理专题优先开发」, 2026-11-30T00:21Z).

    Read at origin/main f5da514b:

    What remains is carried elsewhere, not here: Ask 3 (the per-source backlog shown in the sync state) is #38489, which this closure unblocks; the reconcile's double embedding during an import is #38591.

  20. removed
    pm:queue
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:aidomain:serverpriority:p2

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions