Skip to content

feat(service-knowledge): register EMBEDDER_SERVICE from the ai.embedder_* settings when the knowledge service is mounted - #37265

Draft
objectstack-fleet[bot] wants to merge 10 commits into
mainfrom
claude/issue-37094-open-embedder-settings
Draft

objectstack-fleet[bot] wants to merge 10 commits into
mainfrom
claude/issue-37094-open-embedder-settings

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ
Fixes #37094

Clause-②: yes (widening) — @objectstack/embedder-openai gains one export, documentedMaxBatchSize(model): number | undefined
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:开源部署挂上知识服务后,管理员在设置页「嵌入服务」里保存服务商和密钥、重启,知识检索就能用上这个嵌入器;设置页提示改动需重启生效。
  • 为什么做:知识检索平台化专题的开源版嵌入器一项——此前设置页的嵌入配置在开源版没人读,应用只能自己写代码注册嵌入器。
  • 出错会怎样:没配置时照常启动,需要嵌入的检索和建索引会报错并点名缺哪项设置,不向外发任何请求;已有嵌入器(云版注册的)保持不动;保存的批量大小超过模型公布上限时按上限发送。可直接撤回。
  • 要你做的:无。

What changes

  • KnowledgeServicePlugin registers EMBEDDER_SERVICE from the ai.embedder_* settings (packages/services/service-knowledge/src/knowledge-service-plugin.ts). Read once, at kernel:bootstrapped:
    • Already registered → kept. One info line, settings not applied. A registration the sync accessor cannot hand out (an async factory) counts as registered too.
    • Saved and complete → an @objectstack/embedder-openai embedder for the saved provider: its preset endpoint, or the saved Base URL (custom / Azure). "Saved" = any layer but the manifest default (source !== 'default', the same reading plugin-email uses for branding.workspace_name); an OS_* override counts as saved. "Complete" = the settings page's own Test embedder check (aiTestEmbedderActionHandler), handed only the saved values: reused, not forked.
    • Batch size passed only when saved, held to the model's documented cap. Unsaved (default 64) → the embedder batches at the model's documented cap. Saved → Math.min(saved, documentedMaxBatchSize(model)) when the saved model has a documented cap, the saved size as saved otherwise (no saved model, or a model the table does not know).
    • Nothing configured (no provider saved, none saved, incomplete, settings service absent, or the ai namespace without the embedder keys) → an UnconfiguredEmbedder is registered: embed() (non-empty) and dimensions refuse with a message naming the missing settings, where to save them and that a restart is needed. Boot succeeds; nothing is sent. Boot line is info when nothing asked for an embedder, warn when saved settings do not build one.
    • The API key never reaches a log line or an error message (pinned).
  • Restart note on the settings page: a description on embedder_provider in ai.manifest.ts ("Read when the server starts: a saved change to any embedder setting takes effect after the next restart."), and its help copy in all 11 locale bundles. The translations are required by the gate: settings-translation-coverage.test.ts reds a described field with no keys.KEY.help in any locale.
  • @objectstack/embedder-openai exports documentedMaxBatchSize(model): number | undefined (seat direction, issue comment 7156326561): the documented per-request cap, read from the SAME module table OpenAIEmbedder batches by. No copy, and the constructor now reads the table through the same function. OpenAIEmbedder is unchanged: an explicit maxBatchSize is still used as given, above the cap included (pinned).
  • Docs: content/docs/ai/knowledge-rag.mdx gains "Configuring the embedder from Settings".
  • Dependency edge (one, workspace, no external): @objectstack/service-knowledge → @objectstack/embedder-openai. Why this side: service-knowledge already depends on core (plugin contract) and service-settings (the settings reader and the reused completeness check), so the knowledge plugin needs exactly one new edge; a plugin in embedder-openai would need core and service-settings (two edges, a crypto library among the transitive ones) and a host would have to mount it by hand, which is the gap the card is about. Services depending on plugins has precedent (service-storage, service-print, service-automation). embedder-openai depends only on spec: no cycle.

Why kernel:bootstrapped (the phase measurement)

ObjectKernel.bootstrap() / LiteKernel.bootstrap() run every init(), then every start(), then kernel:ready handlers in plugin order, then kernel:bootstrapped once every kernel:ready handler has settled (plugin-lifecycle-events.ts). An embedder registered in init(), start() or any kernel:ready handler (where a settings-reading provider would register, since the settings engine binds in kernel:ready) is therefore visible at kernel:bootstrapped, regardless of plugin order. Pinned both ways: a host embedder registered at init and one registered in a kernel:ready handler are each kept. Only a registration in kernel:bootstrapped / kernel:listening or after boot would collide; the changeset says so. Settings are read after kernel:ready for the same reason the settings plugin documents: a read in the pre-bind window answers the default without consulting the store.

Tests

New top-level describe in the knowledge+settings harness file (src/__tests__/knowledge-settings-contribution.test.ts), through the real registration path: settings SAVED via SettingsService.setMany in a kernel:ready handler, provider reached through a stubbed global fetch, and an adapter that looks up EMBEDDER_SERVICE where it embeds. No hand-built embedder.

  • saved settings → indexDocument sends one POST https://api.openai.com/v1/embeddings with the saved key and model; nothing sent at boot; key in no log line
  • custom endpoint → the saved Base URL
  • pre-registered at init / at kernel:ready → same instance kept, zero requests, one info line
  • unsaved batch size on DashScope text-embedding-v3 → requests of 10, 10, 5 (not one of 25: the default 64 is not a saved value)
  • saved batch size 4 → requests of 4, 4, 1
  • pin (a) saved 64 on text-embedding-v3 (documented 10) → requests of 10, 10, 5, and the boot line names the saved 64
  • pin (b) saved 50 on a custom model with no documented cap → requests of 50, 10 (kept as saved)
  • embedder-openai: documentedMaxBatchSize answers 10 / 2048 / undefined (unknown, and a prototype key); the embedder with no maxBatchSize batches at exactly that value; an explicit maxBatchSize: 25 on a cap-10 model still sends 25
  • no settings → boot succeeds; indexDocument and the adapter's search reject naming ai.embedder_provider and the restart; KnowledgeService.search answers [] and logs that error per source; dimensions refuses; zero requests; boot line info
  • none saved → refusal says so; incomplete (provider without key) → the page check's own message, boot line warn

Ablations (one-shot, scripts/ablation-replace.mjs, each mutation landed and restored to blob == HEAD, git diff HEAD empty):

  • treating the manifest default as saved (if (!entry) return undefined;) → 1 failed / 8 passed: exactly "an unsaved batch size leaves the model its own cap".
  • clamp removed (the Math.min line → savedBatch) → 1 failed / 10 passed: exactly pin (a). The first attempt at this one was a no-op: the replacement text already occurred in the anchor, the tool refused before running, and it was re-run with a distinct replacement.

Acceptance notes

  • The clamp needed a surface widening, ruled by the seat (comment 7156326561, option A): one read-only export from embedder-openai. With no saved model the embedder uses its own default model; no cap is looked up for a model the plugin does not name, so the saved size passes as saved. The field's maximum (2048) equals that default model's documented cap.
  • Contract review owed: Clause-② is yes, so the seat's direction asks for a same-head contract review at the tier these paths require, on top of L1.
  • Declared beyond the named surface (mechanically forced): packages/services/service-knowledge/vitest.config.ts gains one alias for @objectstack/embedder-openai (without it check:test-source-alias reds: the tests would read the embedder's dist/); pnpm-lock.yaml records the new workspace edge.
  • Search reports, it does not throw. KnowledgeService.search already catches a per-source adapter failure, logs it at error and answers no hits from that source; with no embedder that logged error is the named reason. Indexing throws it. That catch lives in knowledge-service.ts, outside this card.
  • No open-edition adapter consumes EMBEDDER_SERVICE yet (knowledge-memory uses its own sparse vectors; knowledge-ragflow embeds server-side), so in the open edition today the registered embedder is used by custom adapters and by the coming pgvector adapter. The EMBEDDER_SERVICE doc comment in packages/spec/src/contracts/embedder.ts still says it is "Registered by @objectstack/service-ai"; spec prose was not touched here.
  • An unknown model with no saved batch size still gets the embedder's own fallback of 10 and its one construction warning, unchanged.

Verification

Two-minute check: pnpm --filter @objectstack/service-knowledge exec vitest run src/__tests__/knowledge-settings-contribution.test.ts -t 37094 → 11 passed.

Read first, by risk:

  1. knowledge-service-plugin.ts provideEmbedder() and embedderFromSettings(): the phase, the registered check, the saved-vs-default reading, the clamp.
  2. UnconfiguredEmbedder: a registered placeholder means EMBEDDER_SERVICE is never absent once the knowledge service is mounted.
  3. embedder-openai/src/index.ts documentedMaxBatchSize and the constructor's use of it.

Local readings, head f329965b, all in this worktree:

Package tests, typecheck, derived gates
  • pnpm --filter @objectstack/embedder-openai test → 31/31; build + typecheck (tsc + check:test-typecheck) exit 0.
  • pnpm --filter @objectstack/service-knowledge test → Test Files 8/8, Tests 181/181; typecheck exit 0, 0 errors.
  • pnpm --filter @objectstack/service-settings test → Test Files 77/77, Tests 1523/1523; typecheck exit 0 (head 35c742d2; the later commits do not touch service-settings).
  • Dependency closure built with declarations first.
  • node scripts/pm/dispatch-gates.mjs --commands (21 paths): 115 commands, each exit captured before any pipe: 114 exit 0, among them check:startup-registry-verdict, check:test-source-alias, check:undeclared-dep-imports, check:workspace-manifest-cycles, check:published-readme-links, check:dual-build-cjs-loads, check:settings-bind-window, check:doc-authoring, check:issue-citations, check:nul-bytes, check:changeset-fixed, check-empty-changeset, check-changeset-no-major, check-adr-0087-registration, check:type-check-coverage.
  • 1 exit 3, PREREQUISITE NOT MET, so NOT MEASURED here (CI runs it): check-plugin-teardown-shape --self-test (shallow clone cannot read its pinned fixture).
  • dispatch-gates --ran: 115 derived, 115 run, 0 unrun.
  • Repo-wide scans (pnpm lint) and dogfood are CI's (no ! in the title, no narrowing arm).

Signed: repo:objectstack#4 · os-justin · session_01QSeKYofJfCPWsxaVYkmaVF

Provenance

Opened by seat repo:objectstack#4 on the maintainer's authorization in the seat session (「#37094 开 PR 被拦:放行」). The developer's own pr_create in zone a4-K's dev session was refused twice by a permission check; the dev stopped without retrying and handed the material over. Branch claude/issue-37094-open-embedder-settings @ f329965bd6888bfae8e6901e1ca230c8f37e81f9.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (spec untouched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (No formatter ran; pnpm lint was not run locally — CI's run decides.)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: n/a.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English (the 维护者速读 block is the fleet's required Chinese summary).
  • The Before Submitting list in CONTRIBUTING.md is done. (Not walked item by item; the local readings above are what ran.)

🤖 Generated with Claude Code

https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ

…olds a saved batch size to the model's documented cap

Claude-Session: https://claude.ai/code/session_01QSeKYofJfCPWsxaVYkmaVF
Co-authored-by: Claude <noreply@anthropic.com>
…ed cap; changeset names the export

Claude-Session: https://claude.ai/code/session_01QSeKYofJfCPWsxaVYkmaVF
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/embedder-openai, @objectstack/service-knowledge, @objectstack/service-settings, touching 24 documentable anchor(s). ⚠️ 2 changed file(s) yielded no anchor (packages/services/service-knowledge/package.json, packages/services/service-knowledge/vitest.config.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

6 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/ai/knowledge-rag.mdx (via KnowledgeServicePlugin (symbol, a top-level class), documentedMaxBatchSize (symbol, a top-level function))
  • content/docs/automation/webhooks.mdx (via batchSize (symbol, a field of type EmbedderFromSettings))
  • content/docs/frontend/data-source.mdx (via batchSize (symbol, a field of type EmbedderFromSettings))
  • content/docs/protocol/kernel/config-resolution.mdx (via getNamespace (symbol, a method of interface EmbedderSettingsReader))
  • content/docs/protocol/knowledge.mdx (via KnowledgeServicePlugin (symbol, a top-level class))
  • content/docs/ui/views.mdx (via batchSize (symbol, a field of type EmbedderFromSettings))
What this run could not see
  • 2 changed file(s) yielded no anchor (packages/services/service-knowledge/package.json, packages/services/service-knowledge/vitest.config.ts) — pages documenting those are invisible to this run
  • 12 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 12 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 8032d958f2f2892d02e7e4b3cb13da2242f747bb → packageMentionDocs.

Which tree this was computed on

This run read content/docs from c284f53c0dbc17abdc182268d6ac461aeb12631a — the merge of head 8e8243da69d7103fcb461c37b131dfe737d77ba6 into base 8032d958f2f2892d02e7e4b3cb13da2242f747bb, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin c284f53c0dbc17abdc182268d6ac461aeb12631a && git checkout c284f53c0dbc17abdc182268d6ac461aeb12631a
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8032d958f2f2892d02e7e4b3cb13da2242f747bb 8e8243da69d7103fcb461c37b131dfe737d77ba6 && git checkout -B drift-repro 8032d958f2f2892d02e7e4b3cb13da2242f747bb && git merge --no-ff 8e8243da69d7103fcb461c37b131dfe737d77ba6

node scripts/docs-audit/affected-docs.mjs --json 8032d958f2f2892d02e7e4b3cb13da2242f747bb

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 8032d958f2f2892d02e7e4b3cb13da2242f747bb → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

objectstack-fleet Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: f329965bd6888bfae8e6901e1ca230c8f37e81f9
Local-runs: probe — pins (a) and (b), the two ablations, the env-override and key-leak readings and the ObjectKernel phase reading could only be measured by running vitest at this head, in a throwaway worktree that is now removed
Scope: no hits (the paths decide no face; the Clause-②: yes (widening) line alone owes the review, so the owed tier is TIER_DEFAULT, declaration face; served at the higher tier) + packages/plugins/embedder-openai/src/index.ts, packages/services/service-knowledge/src/knowledge-service-plugin.ts, packages/services/service-knowledge/package.json, packages/services/service-knowledge/vitest.config.ts, packages/services/service-settings/src/manifests/ai.manifest.ts, the 11 bundles under packages/services/service-settings/src/translations/, .changeset/37094-open-embedder-from-settings.md, content/docs/ai/knowledge-rag.mdx, pnpm-lock.yaml, and the two test files

① Derived judgments

  • PR feat(service-knowledge): register EMBEDDER_SERVICE from the ai.embedder_* settings when the knowledge service is mounted #37265 for card Open edition: register EMBEDDER_SERVICE from the ai.embedder_* settings when the knowledge service is mounted #37094, epic 专题:知识检索平台化(应用写一份知识源配置就有可用的检索:开源、托管、企业版都能用) #37000, seat direction 7156326561 (option A). 21 files, +695/−5. Opened by the seat on the maintainer's authorization; the dev's facts are in the PR body.
  • record-recognisers --template --paths refuses to pick a face from the paths (no schema, no governed path) and defers to the changeset's Clause-②: line: yes (widening) ⇒ declaration face, TIER_DEFAULT.
  • Check-runs at this head, read 2026-11-25T09:49Z: 62 success, 9 skipped, 0 failed, 0 running. The skipped ones are opt-in or queue-only jobs (18.x upgrade harness, packed-tarball smoke, the two queue verdicts, the schedule gate, Temporal Conformance, UI Published Artifacts, Dogfood Verify CLI, one Dogfood matrix placeholder).
  • landing-k --pr 37265 against origin/main 376377cc0c54: K = 4, OK; no new locale pack under this label PR; no shared book moved. git merge-tree against that main is clean (tree 0e04038d1aab). Main moved pnpm-lock.yaml after the merge-base; it merges clean.
  • Local at this head: pnpm install --frozen-lockfile exit 0 (the lockfile agrees with the manifests); dependency closure built; knowledge-settings-contribution.test.ts -t 37094 11/11; service-knowledge 8 files, 181/181; embedder-openai 31/31.
  • Pin (a), saved 64 on text-embedding-v3 → 10, 10, 5 and the boot line names the saved 64: green. Pin (b), saved 50 on a custom model → 50, 10: green. The explicit maxBatchSize: 25 on a cap-10 model still sends 25, 5: green.
  • Ablation, clamp removed (Math.min(savedBatch, documentedCap) → savedBatch): 1 failed / 10 passed, exactly pin (a). Matches the body. Restored.
  • Ablation, manifest default counted as saved (if (!entry) return undefined;): 11 passed, 0 failed. It does NOT match the body, which reports 1 failed / 8 passed. See S2.
  • Phase, read in packages/core/src/kernel.ts (lines 618 to 642) and lite-kernel.ts (lines 146 to 156): both kernels await every kernel:ready handler, then dispatch kernel:bootstrapped, then kernel:listening; all three propagate a throw. plugin-lifecycle-events.ts says the same. So a registration in init(), start() or any kernel:ready handler is visible to this hook whatever the plugin order.
  • "Already registered → kept": init and kernel:ready are pinned on LiteKernel. On ObjectKernel I measured by probe: an async factory is kept (Service 'embedder' is async - use await is not the not-found message, so it reads as registered; one info line, no id); nothing registered → the placeholder; a registration in a later kernel:bootstrapped handler fails the boot with [Kernel] Service 'embedder' already registered, as the changeset warns.
  • API key: the pin is in the first Open edition: register EMBEDDER_SERVICE from the ai.embedder_* settings when the knowledge service is mounted #37094 case (lines.filter((l) => l.line.includes(API_KEY)) is empty), which covers the log lines of the configured path. By reading, no log line and no error built in this diff interpolates the key: the boot lines carry provider, model and batch size; the refusal reasons carry the page check's message, the settings read error or the embedder's constructor error, none of which holds the key. By probe: a saved key with incomplete settings, and a provider answering 401, put the key in no log line and no error text. OpenAIEmbedder's own request errors carry the base URL, the status and 200 characters of the response body, not the key.
  • i18n: ai.keys.embedder_provider.help is present in all 11 bundles (ar, de, en, es-ES, fr, ja-JP, ko, pt-BR, ru, zh-CN, zh-Hant); the en text equals the manifest description.
  • Dependency edge: embedder-openai depends on spec only; service-settings depends on neither of the other two; no cycle. check:workspace-manifest-cycles is green in CI.
  • Overlap, of the open PRs only feat(service-knowledge): documents carry their organization, and search hands the adapter the caller's organizations #37256 touches a file of this diff (knowledge-service-plugin.ts: one import and one constructor option in init()). git merge-tree of the two heads is clean. service-knowledge: one service-layer splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key #37098 has no PR yet.

② Semver level

  • Clause-②: yes (widening) holds: documentedMaxBatchSize(model): number | undefined is a new export of a published package, nothing is removed or tightened, and it is named in the body and in the changeset as the direction required.
  • Metadata-protocol: none holds: the diff adds a description to one existing specifier of the platform's own ai manifest and its help copy. No key, accepted value, default or metadata type changes for an author.
  • patch on service-knowledge, service-settings and embedder-openai is the level AGENTS.md Post-Task step 3 gives: none takes patch, and a non-protocol widening ships patch.
  • OpenAIEmbedder is unchanged for a caller, with one edge: the constructor now reads the table through hasOwnProperty, so a model named like an Object.prototype key (constructor) falls back to 10 where it used to take a function as its batch size. A correction, pinned.
  • The changeset carries the migration sentence for a host that registers the name after kernel:ready. That is the one behaviour change for an existing host; see S3.

③ Boundary flags

  • Seat direction 7156326561, all four conditions met: the body reads Clause-②: yes and names the export; the changeset names it and says an explicit maxBatchSize is unchanged; a pin reddens when the clamp goes (re-measured); a second pin keeps an unknown model's saved size.
  • Declared beyond the named surface: the vitest alias and the lockfile entry are both mechanically forced. Accepted.
  • "Search reports, it does not throw": accepted. The catch is in knowledge-service.ts, outside the diff; the logged error is the named reason (pinned).
  • "No open-edition adapter consumes EMBEDDER_SERVICE yet": confirmed, no other reader of the name exists under packages/.
  • The stale EMBEDDER_SERVICE doc comment in spec: N1.
  • Saved versus default: savedValue returns a value only when source is not default, so an OS_* override (source: 'env') counts. The completeness check is handed the saved map only; its payload is empty, so nothing unsaved reaches it. The map holds every saved ai key, not only the embedder ones (N5). The handler sends no request (read, and pinned by the zero-request assertions).
  • SQL push-down (Prime Directive 5): no query in this diff.

④ Design judgment

  • M1 (must-fix) — a credential-handling defect in how saved embedder settings are applied. Under the security-findings rules its mechanism is not recorded here; the finding and the required fix and pin were handed to the dev through the zone's dispatch. Closure is read at the next head.
  • S1 (should-fix) — an OS_AI_EMBEDDER_DIMENSIONS override is dropped without a line. The key has no default, so the settings service hands the env value over as a string ("256", source: 'env'); typeof saved.embedder_dimensions === 'number' is false; the embedder reports the model's default (measured: 1536) and sends no dimensions. An adapter then sizes its column from the wrong number. The body says an OS_* override counts as saved. Asked: accept a numeric string for the two number keys, or refuse it at warn; one case.
  • S2 (should-fix) — the saved-versus-default reading has no pin at this head, and the body's ablation line for it is stale. Since the clamp commit, a default 64 counted as saved is clamped to 10 on text-embedding-v3, the same 10, 10, 5 the case expects, so the mutation is green. The difference shows only on a model with no documented cap: measured, 70 inputs on my-gateway-model with no saved batch size send 10 × 7 at head and 64, 6 under the mutation. Asked: that case, and the body's ablation line corrected.
  • S3 (should-fix) — the cloud ordering claim is NOT MEASURED. The cloud source is not readable from this session (repository access was refused), so "cloud registers before kernel:bootstrapped" rests on the body alone. What this repository does say (packages/spec/CHANGELOG.md, entry 4f9e9d4): service-ai builds its embedder in bindSettings(), leaves the service unset when the provider is none, and on settings:changed "registers / replaces" it without a restart. With this PR a deployment that mounts the knowledge service and boots with no embedder has the placeholder under the name. If cloud's hot path calls registerService when it holds no embedder of its own, it now throws already registered; if it calls replaceService, it works. And if bindSettings() runs later than kernel:ready, the boot fails as measured above. Asked of the seat before landing: one reading in cloud of the phase bindSettings() runs in and of the call its hot path makes, recorded on the PR.
  • N1 — the EMBEDDER_SERVICE doc comment in packages/spec/src/contracts/embedder.ts still says the service is registered by service-ai and may be absent. A follow-up outside this surface.
  • N2 — the restart help is shown wherever the embedder section is, also where another plugin's embedder is kept and may apply changes without a restart.
  • N3 — any getService error other than not-found reads as "already registered", and the info line then says so. Right for an async factory; wider than the comment states.
  • N4 — the async-factory keep and the ObjectKernel path have no case; every Open edition: register EMBEDDER_SERVICE from the ai.embedder_* settings when the knowledge service is mounted #37094 case boots LiteKernel.
  • N5 — the completeness check is handed every saved ai key, chat provider keys included. It reads only embedder_*; the map could be narrowed to that prefix.
  • N6 — the API-key pin asserts the configured path's log lines only; the same assertion on the incomplete case and on a provider error would pin what the body claims for errors.
  • For the second lander of this file set (service-knowledge: one service-layer splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key #37098, feat(service-knowledge): documents carry their organization, and search hands the adapter the caller's organizations #37256): keep the documentedMaxBatchSize export and the constructor reading the table through it; keep the kernel:bootstrapped hook above the enableEventSync early return in start(), provideEmbedder and both import hunks; keep embedder_provider.description in ai.manifest.ts and embedder_provider.help in all 11 bundles (the coverage test reddens a described field with no help).

Implemented-by: claude/issue-37094-open-embedder-settings
Reviewed-by: session_01QSeKYpEsWWE9Y5YtSsDgqZ

VERDICT: FAIL

@objectstack-fleet

objectstack-fleet Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — REWORK · L1 · head f329965bd6888bfae8e6901e1ca230c8f37e81f9 · 2026-11-25T09:52Z

  • PR feat(service-knowledge): register EMBEDDER_SERVICE from the ai.embedder_* settings when the knowledge service is mounted #37265 for Open edition: register EMBEDDER_SERVICE from the ai.embedder_* settings when the knowledge service is mounted #37094, epic 专题:知识检索平台化(应用写一份知识源配置就有可用的检索:开源、托管、企业版都能用) #37000, zone a4-K. Fixes #37094; Clause-②: yes (widening); Metadata-protocol: none. Opened by the seat on the maintainer's authorization, because the dev's own pr_create was refused.
  • The os-dev report was relayed by zone a4-K at 2026-11-25T09:10Z because the dev's own post was refused; this L1 carries its facts, read from the PR body.
  • Size: 21 files, +695/−5. Every file is inside the card's surface or mechanically forced (the vitest alias, the lockfile entry).
  • Changeset: patch on service-knowledge, service-settings and embedder-openai. Correct by AGENTS.md Post-Task step 3: Metadata-protocol: none takes patch, and a non-protocol widening ships patch. Both declaration lines are in the body and in the changeset; the changeset names the export and says an explicit maxBatchSize is unchanged.
  • Check-runs at head, read 2026-11-25T09:49Z: 62 success, 9 skipped (opt-in and queue-only jobs), 0 failed, 0 running.
  • K = 4 against origin/main 376377cc0c54 (landing-k OK); git merge-tree against it is clean.
  • Local at head in a throwaway worktree (removed): frozen-lockfile install exit 0; the Open edition: register EMBEDDER_SERVICE from the ai.embedder_* settings when the knowledge service is mounted #37094 cases 11/11; service-knowledge 181/181; embedder-openai 31/31.
  • Phase: verified in both kernels. Every kernel:ready handler settles before kernel:bootstrapped is dispatched, in ObjectKernel and in LiteKernel. A registration at init, at kernel:ready (both pinned) or as an async factory (measured on ObjectKernel) is kept. A registration in a later kernel:bootstrapped handler fails the boot, as the changeset says.
  • Saved versus default: source !== 'default', an OS_* override counts; the page's own completeness check is handed saved values only and sends nothing.
  • Clamp: pins (a) and (b) are green; removing the clamp reddens exactly pin (a); an explicit maxBatchSize given straight to OpenAIEmbedder is used as given (pinned).
  • Placeholder: the refusals name the missing settings and the restart; no request is sent; the boot line is info when nothing asked for an embedder and warn when saved settings build none (both pinned).
  • API key: in no log line and no error. Pinned for the configured path's log lines; read and probed for the error paths (incomplete settings, a provider 401).
  • i18n: embedder_provider.help is in all 11 bundles. Dependency edge: no cycle; the lockfile is consistent.
  • Seat direction 7156326561: all four conditions are met.
  • Owed review tier: TIER_DEFAULT (declaration face). The review was served at CONTRACT_REVIEW_TIER; record written for this head: FAIL.
  • M1 (must-fix) — a credential-handling defect in how saved embedder settings are applied. Under the security-findings rules its mechanism is not recorded here; the finding and the required fix and pin were handed to the dev through the zone's dispatch. Closure is read at the next head.
  • S1 (should-fix) — OS_AI_EMBEDDER_DIMENSIONS reaches the plugin as a string and is dropped without a line; the embedder then reports the model's default dimensions (measured: 1536 for a requested 256).
  • S2 (should-fix) — the saved-versus-default reading is unpinned at this head: counting the default as saved leaves all 11 cases green, while the body reports 1 failed. The clamp commit hollowed that case. One case on a model with no documented cap closes it (10 × 7 at head, 64 + 6 under the mutation), and the body's ablation line needs correcting.
  • S3 (should-fix) — the cloud ordering claim is not measured: the cloud source cannot be read from this session. This repository's own CHANGELOG says service-ai leaves the service unset under none and "registers / replaces" it on a later save. With the placeholder under the name, a registerService on that path would now throw. The seat owes one reading in cloud (the phase of bindSettings(), and register or replace) before this lands.
  • N1 — the EMBEDDER_SERVICE doc comment in spec is stale; follow-up.
  • N2 — the restart help also shows where another plugin's embedder is kept.
  • N3 — any getService error other than not-found reads as "already registered".
  • N4 — no case for the async factory or for ObjectKernel.
  • N5 — the completeness check is handed every saved ai key, not only embedder_*.
  • N6 — the API-key assertion is on one case; repeat it on an error case.
  • Overlap: feat(service-knowledge): documents carry their organization, and search hands the adapter the caller's organizations #37256 touches knowledge-service-plugin.ts (one import, one constructor option); the two heads merge clean. service-knowledge: one service-layer splitter (whole / recursive / markdown, Chinese-aware), the chunk channel and the split key #37098 has no PR yet. Whichever lands second keeps: the documentedMaxBatchSize export and the constructor reading through it; the kernel:bootstrapped hook above the enableEventSync early return, with provideEmbedder and both import hunks; embedder_provider.description and its help in all 11 bundles.
  • Next: M1, S1 and S2 back to zone a4-K; the seat takes S3 to cloud; re-review at the new head.

… Azure; number keys read from text; boot line names the endpoint host

Claude-Session: https://claude.ai/code/session_01QSeKYofJfCPWsxaVYkmaVF
Co-authored-by: Claude <noreply@anthropic.com>
…r keys from text; changeset

Claude-Session: https://claude.ai/code/session_01QSeKYofJfCPWsxaVYkmaVF
Co-authored-by: Claude <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open edition: register EMBEDDER_SERVICE from the ai.embedder_* settings when the knowledge service is mounted

2 participants