Skip to content

fix(knowledge): the keyword leg ranks unspaced Chinese, Japanese and Korean questions by 2- and 3-character pieces - #38469

Draft
objectstack-fleet[bot] wants to merge 5 commits into
mainfrom
claude/project-thread-buhir9
Draft

objectstack-fleet[bot] wants to merge 5 commits into
mainfrom
claude/project-thread-buhir9

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread
Part of #38411. This PR covers Ask 1, Ask 2 and the first two Acceptance items, plus the model-free half of the eval, and on pgvector the cheaper matcher for a caseless piece (LIKE instead of ILIKE). Still open: the BrightRule model-graded before/after (needs a running BrightRule environment and model credentials), and Ask 3 (not measured, see below).

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:在本地 libSQL 和 PostgreSQL 两种存储上,用中文、日文或韩文不加空格整句提问时,知识检索的关键词一路终于能匹配到段落;英文提问不受影响。
  • 为什么做:属于知识平台专题,解决混合检索在中文问题上实际只剩向量一路的问题。
  • 出错会怎样:代价是检索变慢(数字见下),最坏情况是关键词一路排序变差,向量一路照常作答;不改索引、不需重建,可直接撤回。
  • 要你做什么:无。

取舍数字(合成制度题集,约 6.7 万段落,218 道中文题):

  • 中文题关键词一路前 5 名命中率:0.028 → 0.495。
  • 本地 libSQL 关键词一路 p95:约 0.12 秒 → 约 0.5 秒。
  • 本地 libSQL 混合检索 p95:0.41 秒 → 0.84 秒。
  • PostgreSQL 关键词一路 p95:约 0.6 秒 → 约 1.9 秒(本 PR 已把中文片段改成更便宜的匹配方式,排序不变;改之前约 3 秒)。
  • 检索词上限 16 是实测拐点:再往上每多约 40% 耗时只多约 1 个点命中率。
  • 想再降延迟的两个杠杆:把上限降到 12(命中率 0.459,libSQL 关键词 p95 约 0.31 秒);PostgreSQL 上给段落正文加三元组索引,已立后续卡 knowledge-pgvector: the keyword leg scans nearly every row once per Chinese piece, so keyword p95 at 67k passages is about 1.9 s (a trigram GIN index on passage content) #38473,不在本 PR。
  • 未测:BrightRule 模型评分的前后对比,需要运行环境和模型凭据。

What changes

  • keywordTerms in knowledge-turso/src/sql.ts and knowledge-pgvector/src/sql.ts (one body, kept identical) cuts a run of Han, Hiragana, Katakana (including the prolonged sound mark) or Hangul inside a term into overlapping pieces of three characters and of two. A run of two characters is one piece. A run of one is dropped, because it would match nearly every passage. Figures and codes next to a run (2000, X-200) stay whole terms. Latin-script and spaced queries get exactly the terms they had before.
  • Selection rule (Ask 2). MAX_KEYWORD_TERMS stays at 16, re-decided by measurement (below). The cap is filled in this order: figures, codes and words; then pieces of three characters and runs of two; then pieces of two characters. A long question therefore keeps the pieces the libSQL trigram index serves; a short one fills the cap with pieces of two. Matching is unchanged. No index change, no fingerprint change, no reindex.
  • pgvector matcher (round 2). A keyword term the tsvector does not serve is matched as a substring by LIKE when it holds no cased letter (containsOperator in knowledge-pgvector/src/sql.ts: term.toLowerCase() === term.toUpperCase(); a Han, kana or Hangul piece, a figure), and by ILIKE otherwise. Case folding can find nothing more for such a term, so the rankings are identical. Nothing else in the Search section changes. libSQL is unchanged.
  • Docs. content/docs/protocol/knowledge.mdx (the contract's optional keywordLeg case; both Search bullets: the CJK pieces, and on pgvector LIKE / ILIKE) and both plugin READMEs. The turso README said "a Chinese question is one term", which this change made false.
  • Contract (H2 placement, Clause-② yes). @objectstack/service-knowledge/testing: KnowledgeAdapterContractOptions.implements gains an optional keywordLeg member (absent means false). When an adapter declares it, the shared suite asks the unspaced question 「出差住宿费超标的话2000元以下除外的情况还要部门经理审批吗」 over one passage holding 「2000元以下除外」 and five passages holding the question's characters one by one but none of its words. The passage must be ranked at topK 3. knowledge-turso and knowledge-pgvector declare it. knowledge-memory and the service stubs have no keyword leg and are untouched. No placement with zero new exported members exists: the memory adapter and the stubs run the same suite and have no keyword leg, and the spec contract has no capability flag to read. The member is optional, so existing callers compile unchanged; that makes it widening.

Tests

Unit pins, contract case, ablation (head b511770)
  • knowledge-turso acceptance.test.ts: the Latin and spaced pin is kept exactly (What is the X-200 pump? … gives today's 10 terms; 出差 住宿 gives ['出差','住宿']; cap 16). New pin: an unspaced question gives its figure and then its pieces; X-200型号的保修期 keeps X-200; runs of two and one; kana and Hangul.
  • knowledge-pgvector keyword-terms.test.ts (new, no database): the same pins, plus which matcher each term goes to (isWordTerm).
  • Contract case: knowledge-turso on :memory: and on a file: URL, and knowledge-pgvector on a live PostgreSQL 16 with pgvector 0.6.0 started in this container.
  • Results, local: knowledge-turso Test Files 4 passed, Tests 284 passed; knowledge-pgvector live (OS_TEST_POSTGRES_URL set, OS_EXPECT_LIVE_DIALECT_MATRIX=1) Test Files 11 passed, Tests 108 passed; service-knowledge 21 files, 726 tests passed; knowledge-memory 3 files, 66 tests passed. Type check is green for knowledge-turso, knowledge-pgvector, service-knowledge and knowledge-memory.
  • Ablation (base sql.ts swapped in, checked by blob hash, then restored and checked by hash again): turso goes red with 4 failures (the piece pin and the contract case, on both store kinds; the Latin pin stays green); pgvector, live, goes red with 3 failures (the contract case and two pins).
  • Reverse type check: the turso type check first read a dist/testing.d.ts built before this change and refused keywordLeg (TS2353). After the rebuild it passes.
Round 2: the pgvector matcher (head cde0bbe; code identical to 81be16f)
  • keyword-terms.test.ts gains two pins. containsOperator gives LIKE for 元以下, 出差, コー, 휴가, 42 and ILIKE for ab, X-200, É. A statement pin runs adapter.search('出差 ab', …) against a recording pool and reads, from the ranking statement itself, the operator in front of the placeholder each pattern is bound to: %出差% gets content LIKE, %ab% gets content ILIKE.
  • knowledge-pgvector live (PostgreSQL 16 + pgvector 0.6.0, OS_EXPECT_LIVE_DIALECT_MATRIX=1), contract case included: Test Files 11 passed (11), Tests 110 passed (110), verify lock VERDICT command-exit 0.
  • pnpm --filter @objectstack/knowledge-pgvector typecheck: VERDICT command-exit 0.
  • Ablation: with the adapter reverted to b511770 (blob hash checked, then restored and checked again), the statement pin fails: Tests 1 failed | 4 passed (5).
  • CI on b511770 (job 141221631158) and on 923c009 (jobs 141222136228 and 141222139195): every failing step is an aggregator reading a cancelled lane (for example "type-check lane typecheck-workspace concluded cancelled -- expected success"). Each later push to this branch cancelled the run in flight. 923c009 also held one real error, TS2353 in the new statement pin (recipeHash is not a member of the search options' index), fixed in 81be16f and green locally as above.

Measurement

Every harness is a scratch script outside the repository. Corpus: the BrightRule synthetic set (scripts/eval/build.ts --distractors 1500, brightrule @ 07e21ac). Passages are cut one per article or section, with attachments kept on their own and each passage prefixed 【unit|title|attachment】 path, as the app's clause hook does. Each document is indexed through TursoKnowledgeAdapter.upsert (the real write path). Two tables:

  • 11k: 1,577 documents, 11,025 passages.
  • 67k: the same plus 8,000 distractors from seeds 11 to 14, giving 9,577 documents and 67,421 passages. The card's table had 67,379.

Questions: the 218 zh questions whose expected policies are Chinese (230 counting the zh-to-English ones). A hit means a passage of an expected policy (P) or of the expected article (C) in the keyword leg's top 5 or top 10. The keyword leg is isolated with an all-zero query vector, which turns the vector leg off. Intervals are 95% bootstrap intervals over questions (2,000 resamples). Retrieval is deterministic: each side was run 3 times and the rankings were identical on every run, on both stores and both tables. So the interval comes from the question sample, not from run noise.

Keyword leg, libSQL store, before and after
table side P@5 P@10 C@5 C@10 questions with any hit p50 p95
11k before 0.032 [0.009, 0.055] 0.037 [0.014, 0.064] 0.028 [0.009, 0.051] 0.032 [0.009, 0.060] 31 0.7 ms 20 ms
11k after 0.500 [0.431, 0.569] 0.514 [0.450, 0.583] 0.486 [0.421, 0.556] 0.500 [0.435, 0.569] 206 52 to 56 ms 80 to 93 ms
67k before 0.028 [0.009, 0.050] 0.032 [0.009, 0.060] 0.028 [0.009, 0.051] 0.032 [0.009, 0.060] 31 1.4 ms 113 to 132 ms
67k after 0.495 [0.427, 0.564] 0.500 [0.431, 0.569] 0.486 [0.421, 0.556] 0.491 [0.421, 0.560] 206 305 to 328 ms 491 to 516 ms

All 230 zh questions, 67k: P@5 goes from 0.026 [0.009, 0.048] to 0.470 [0.404, 0.530].

Choosing the cap and the order (67k, keyword leg alone)
order / cap P@5 p50 p95
pieces of three and runs of two only (no pieces of two) 0.404 7 ms 155 ms
three-first, cap 12 0.459 136 ms 314 ms
three-first, cap 16 (shipped) 0.495 321 ms 507 ms
three-first, cap 20 0.505 440 ms 690 ms
three-first, cap 24 0.509 552 ms 910 ms
by position, cap 16 0.495 445 ms 746 ms
by position, cap 32 (every piece of every question but a few) 0.518 670 ms 1,277 ms

The questions are 16 characters at the median and 24 at p90, which gives 23 uncapped terms at the median and 34 at p90; 202 of 230 exceed 16. On the 67k table, a piece of two characters costs one scan of the rows in scope, about 23 ms (LIKE and instr cost the same). A piece of three is served by the trigram index and is nearly free, except for a trigram most passages hold: about 30 ms to materialise one held by 48,000 rows. Past 16, recall gains about one point for each further 40% of latency, and every interval overlaps. Cap 16 with the three-first order is the knee. Keeping a one-character run measured no recall change.

Hybrid search latency, libSQL 67k with a 1024-wide vector column (exact scan)
side p50 p95
before 258 ms 410 ms
pieces of three only 266 ms 429 ms
after (three-first, cap 16) 563 ms 837 ms
three-first, cap 24 818 ms 1,244 ms

The vector leg here is a bag-of-characters fake embedder, used for its cost only. Its fused ranking is not reported: a lexical stand-in for an embedder measures the fusion of two lexical legs, not hybrid retrieval.

pgvector, live PostgreSQL 16 + pgvector 0.6.0, the same 67k passages, keyword leg alone
side P@5 p50 p95
before (3 runs) 0.028 132 to 150 ms 617 to 691 ms
pieces, every substring term by ILIKE (b511770, 3 runs) 0.495 538 to 563 ms 2,883 to 3,085 ms
pieces, a caseless term by LIKE (this head, 3 runs) 0.495 187 to 195 ms 1,832 to 1,925 ms

The rankings are identical on every run, identical between the ILIKE and the LIKE heads, and the same hit set as libSQL. The tail is questions holding 公司: its pieces are held by 67,125 of 67,421 passages, because every clause prefix names its company, so nearly every row becomes a candidate. On this server ILIKE '%公司%' costs 90 ms per scan against 18 ms for LIKE or strpos, with identical counts; that is the matcher change in this PR. What remains of the tail is one substring scan per piece over nearly every row, and the candidate tsvector computed for each of them.

Commands, all run from a scratch directory outside the repository:

pnpm run eval:build -- --distractors 1500 --out EVALSET                    (in a scratch copy of brightrule, pnpm install --ignore-scripts)
pnpm run eval:build -- --distractors 2000 --seed 11..14 --out EVALSET-sN   (distractors only, keys suffixed)
python3 -I prep.py CORPUS docs.json                                        (clause passages)
tsx eval.ts index docs.json DB 8 zero        and        tsx eval.ts search docs.json DB questions.json VARIANT out.json
tsx eval.mts index / search                  (pgvector, the same shape)
python3 -I score.py zh RUN.json …            (recall, bootstrap intervals, p50/p95)

All timings are seconds on a shared 4-core container, with sibling agents running.

  • NOT MEASURED: BrightRule model-graded eval, reason: it needs a running BrightRule environment and model credentials, and this container has neither. The keyword-leg retrieval above is the model-free stand-in.
  • NOT MEASURED: fused hybrid recall, reason: no real embedder in this container. A lexical stand-in would measure the fusion of two lexical legs.
  • NOT MEASURED: Ask 3 (a larger per-leg pool before fusion), reason: it is judged on fused ranking, which needs a real embedder. Ask 3 also reaches knowledge-tools.ts, which is outside this claim.

Acceptance notes

  • pgvector keyword-leg cost (carrier: knowledge-pgvector: the keyword leg scans nearly every row once per Chinese piece, so keyword p95 at 67k passages is about 1.9 s (a trigram GIN index on passage content) #38473, filed by the seat). With the LIKE matcher in, pgvector's keyword-leg p95 on the 67k table goes from about 0.6 s to about 1.9 s. Two levers remain, both outside this claim. First, compute the candidate tsvector only when a word term needs it (a Search-section change). Second, a pg_trgm GIN index on the passage content, which serves LIKE / ILIKE substrings. That is an index change: a second DDL beside keywordIndexDdl (knowledge-pgvector/src/sql.ts), created through ensureKeywordIndex (pgvector-adapter.ts), plus a pg_trgm extension dependency next to the vector one. It is not a fingerprint change: the index fingerprint hashes only the embedding model, variant, dimensions and split, and an older table gets the keyword index at its first search without a rebuild.
  • A lower cap is the cheapest lever on both stores: cap 12 measured P@5 0.459 and libSQL keyword p95 314 ms (cap 16: 0.495 and 507 ms).
  • libSQL: a piece of two characters costs one scan of the rows in scope. Scoring pieces of two only among the candidates that the index-served terms recruit would remove that scan. It is a Search-section change and moves each piece's document frequency, so it needs its own measurement.
  • Pre-existing, unchanged: the separator class  -〿 contains 々 (U+3005) and 〆 (U+3006), so 「人々」 splits at 々. This is an observation only.
  • To run the pgvector live suites, this container installed postgresql-16-pgvector (0.6.0, Ubuntu noble) and ran a private cluster on a random port, removed afterwards.

Verification

  • Read first: packages/plugins/knowledge-turso/src/sql.ts (keywordTerms: the run split and the final order and cap), packages/services/service-knowledge/src/testing.ts (the optional keywordLeg member and its case), packages/plugins/knowledge-pgvector/src/pgvector-adapter.ts (the keyword branch of the ranking statement, where containsOperator picks LIKE or ILIKE).
  • Two-minute check: pnpm --filter @objectstack/knowledge-turso exec vitest run --maxWorkers=2 src/__tests__/contract.test.ts should show the case the keyword leg › an unspaced question ranks the passage … passing on both :memory: and file:.
Local gate subset at cde0bbe (CI runs the full farm)
  • Tests and type checks: listed under Tests above.
  • node scripts/pm/dispatch-gates.mjs --commands derived 101 families for the 12 changed files (70 at b511770, plus 31 the docs edit brings in). Each ran with its exit code captured before any pipe. The 31 docs families and 8 families that read the round-2 files were run at cde0bbe; the others read files unchanged since b511770 and carry that reading. --ran reconciliation at cde0bbe: 101 derived, 101 run, 0 NOT-MEASURED, 0 UNRUN. Exit codes: 96 exit 0, and five not measured:
    • NOT MEASURED: check:skill-examples, reason: exit 3, PREREQUISITE NOT MET, it needs the client SDK's dist/. No skill file is touched.
    • NOT MEASURED: check-plugin-teardown-shape.mjs --self-test, reason: PREREQUISITE NOT MET, its pinned positive-control commit is beyond this shallow clone.
    • NOT MEASURED: check:dual-build-cjs-loads, reason: PREREQUISITE NOT MET, it needs every package's dist/.
    • NOT MEASURED: check:query-options-erasure and check:type-check-debt, reason: repo-wide ESLint and tsc scans that passed the 240 s per-gate limit. CI's Lint & Repo Gates and TypeScript Type Check carry them.
  • overlap-check before the push: VERDICT clean against origin/main and the two open PRs that share knowledge.mdx (docs(knowledge): one passage per unit recipe, and the settings page names chunk_target the longest passage #38468, feat(service-knowledge)!: a knowledge service the runtime mounts holds its sources without an embedder or its deployment store #38470), and clean against origin/claude/project-thread-mu3i0t.
  • Self-scan of the changed files for control bytes: no hits.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5pfJqySEaVD3CKvevm

…3-character pieces

keywordTerms in knowledge-turso and knowledge-pgvector (one body, kept
identical) cuts a run of Han, kana or Hangul inside a term into overlapping
pieces of three characters and of two; figures and codes around a run stay
whole terms. Under the unchanged cap of 16: words first, then the pieces of
three and the runs of two, then the pieces of two.

The shared adapter contract suite gains an optional implements.keywordLeg
member and one case: an unspaced question ranks the passage holding its
figure and exception words. Both stores declare it.

Claude-Session: https://claude.ai/code/session_01FEkQ5pfJqySEaVD3CKvevm
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5pfJqySEaVD3CKvevm
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m 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 29, 2026
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/knowledge-pgvector, @objectstack/knowledge-turso, @objectstack/service-knowledge, touching 8 documentable anchor(s). ⚠️ 2 changed file(s) yielded no anchor (packages/plugins/knowledge-pgvector/README.md, packages/plugins/knowledge-turso/README.md), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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

  • content/docs/protocol/knowledge.mdx (via keywordLeg (symbol, a field of interface KnowledgeAdapterContractOptions), runKnowledgeAdapterContract (symbol, a top-level function))
What this run could not see
  • 2 changed file(s) yielded no anchor (packages/plugins/knowledge-pgvector/README.md, packages/plugins/knowledge-turso/README.md) — pages documenting those are invisible to this run
  • the SDK route bridge reached 69 of 253 client-bound route-ledger rows — the other 184 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 184: 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; 125 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 — 4 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 4d07ddbf5df041567ffa7344c1483d4d52c0ef8e → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 9ef5e368cbe31b97f903a8816deb3651d2028b76 — the merge of head cde0bbe28a47e3cbeac3947796bdf287315b24b0 into base 4d07ddbf5df041567ffa7344c1483d4d52c0ef8e, 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 9ef5e368cbe31b97f903a8816deb3651d2028b76 && git checkout 9ef5e368cbe31b97f903a8816deb3651d2028b76
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4d07ddbf5df041567ffa7344c1483d4d52c0ef8e cde0bbe28a47e3cbeac3947796bdf287315b24b0 && git checkout -B drift-repro 4d07ddbf5df041567ffa7344c1483d4d52c0ef8e && git merge --no-ff cde0bbe28a47e3cbeac3947796bdf287315b24b0

node scripts/docs-audit/affected-docs.mjs --json 4d07ddbf5df041567ffa7344c1483d4d52c0ef8e

⚠️ 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 4d07ddbf5df041567ffa7344c1483d4d52c0ef8e → pass the list as
args.docs, on the commit named under Which tree this was computed on.

… ILIKE

A substring term with no cased letter (a Han, kana or Hangul piece, a
figure) gains nothing from ILIKE's case folding and costs about five times
as much per row read; it is matched by LIKE, and a term holding a cased
letter keeps ILIKE. Both READMEs describe the pieces and the operator.

Claude-Session: https://claude.ai/code/session_01FEkQ5pfJqySEaVD3CKvevm
Co-Authored-By: Claude <noreply@anthropic.com>
… matches a caseless piece by LIKE; the contract's keywordLeg case

Claude-Session: https://claude.ai/code/session_01FEkQ5pfJqySEaVD3CKvevm
Co-Authored-By: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

Contract review

Served-tier: TIER_DEFAULT
Head-sha: cde0bbe28a47e3cbeac3947796bdf287315b24b0
Local-runs: none
Scope: packages/services/service-knowledge/src/testing.ts + packages/plugins/knowledge-turso/src/tests/contract.test.ts, packages/plugins/knowledge-pgvector/src/tests/contract.live-postgres.test.ts
Security-touching: no
Rule-change-verified: none

① Derived judgments

The face is the Clause-②: yes (widening) declaration alone: no packages/spec/src/** path and no governed path in the committed tree. The widening is one OPTIONAL member, KnowledgeAdapterContractOptions.implements.keywordLeg?: boolean, on the published @objectstack/service-knowledge/testing export; absent reads as false, so the shared suite's other two callers (knowledge-memory contract.test.ts, service-knowledge contract-stubs.test.ts) compile and run unchanged, and only the two adapters that declare it (turso, pgvector) run the new case. No other contract member changes: IKnowledgeAdapter, AdapterSearchOptions, the fingerprint and the index DDL are untouched by the diff.

② Semver level

Metadata-protocol: none ⇒ patch on every moved package (AGENTS.md, Post-Task Checklist step 3: "a non-protocol change, widening or breaking, ships patch"). The changeset names @objectstack/service-knowledge, @objectstack/knowledge-turso, @objectstack/knowledge-pgvector at patch, with Clause-②: yes (widening) and Metadata-protocol: none line-initial in the changeset body and the PR body. Agrees.

③ Boundary flags

Dev flags answered: Clause-② moved from the claim's no to yes (claim amended on #38411); the BrightRule model-graded eval is NOT MEASURED and the PR is Part of #38411 (seat route, 2026-11-29T02:14Z); Ask 3 not measured and out of the surface; pgvector latency carried to #38473. No open_questions. SQL push-down: the pgvector change swaps ILIKE for LIKE inside the existing ranking SQL for terms with no cased letter; no id materialisation and no in-app join is added. Author: the PR's user.login is objectstack-fleet[bot] (opened through the relay).

Implemented-by: claude/project-thread-buhir9
Reviewed-by: session_01FEkQ5pfJqySEaVD3CKvevm

VERDICT: PASS

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

documentation Improvements or additions to documentation size/m 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.

2 participants