Skip to content

fix(knowledge): the keyword leg keeps 々, 〆 and 〇 inside an unspaced run - #38498

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/project-thread-buhir9
Nov 29, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/project-thread-buhir9

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread
Part of #38411. This PR is the follow-up to #38469: the separator marks found in its review. Still open on the card: the BrightRule model-graded eval and Ask 3.

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:中文、日文提问里的「々」「〆」「〇」不再把词切断,「人々」「二〇二四年」这类写法在知识检索的关键词一路能被匹配到;其他提问不变。
  • 为什么做:知识平台专题,上一个中日韩关键词改动在审核中发现的遗漏。
  • 出错会怎样:最坏情况是含这三个符号的提问关键词排序变差,向量一路照常作答;不改索引、不需重建,可直接撤回。
  • 要你做什么:无。

What changes

  • keywordTerms in knowledge-turso/src/sql.ts and knowledge-pgvector/src/sql.ts (one rule, kept identical) split a query at the whole CJK symbols block ( -〿). That block also holds three marks written inside a word: 々 (U+3005), 〆 (U+3006) and 〇 (U+3007). A mark split the run it sat in, and a run of one character is then dropped, so 「人々」 gave no term and 「二〇二四年」 lost its first pieces. The split class is now  -〄〈-〿, and the three marks are named in UNSEGMENTED_RUN, whatever their script: 々 and 〇 are Han, 〆 is Common. 「、」, 「。」 and the brackets still split.
  • pgvector's UNSEGMENTED (which keeps a term off the tsvector) gains the same three marks, so a piece made only of 〆 is matched as a substring, not as a word.
  • New changeset .changeset/38411-cjk-separator-marks.md (patch, both stores). The fix(knowledge): the keyword leg ranks unspaced Chinese, Japanese and Korean questions by 2- and 3-character pieces #38469 changeset is left as main has it.

Tests

Pins, ablation, type check
  • New pin in both stores: 「人々」 gives ['人々']; 「二〇二四年」 gives ['二〇二', '〇二四', '二四年', '二〇', '〇二', '二四', '四年']; 「〆切日」 gives ['〆切日', '〆切', '切日']; 「出差、住宿。审批」 gives ['出差', '住宿', '审批']. pgvector also pins isWordTerm('〆〆〆') === false.
  • knowledge-turso: Test Files 4 passed (4), Tests 286 passed (286). knowledge-pgvector without a database: Test Files 4 passed | 7 skipped (11), Tests 20 passed | 91 skipped (111). Type check of both: green. One run under the verify lock: VERDICT command-exit 0.
  • Ablation: both sql.ts set to the merge base (blob hashes checked), the pins run, then both restored and their hashes checked again. turso: Tests 2 failed (the new pin, on :memory: and file:). pgvector: Tests 2 failed | 4 passed (6) (the new pin and the 〆〆〆 pin).
  • NOT MEASURED: the live pgvector suite, reason: no PostgreSQL in this container for this follow-up. CI covers it.

Verification

  • Read first: packages/plugins/knowledge-turso/src/sql.ts (UNSEGMENTED_RUN and the split class in keywordTerms).
  • Two-minute check: pnpm --filter @objectstack/knowledge-turso exec vitest run --maxWorkers=2 src/__tests__/acceptance.test.ts -t 'keeps 々' should show the pin passing twice.
Local gate subset at 86a724b (CI runs the full farm)
  • node scripts/pm/dispatch-gates.mjs --commands derived 66 families for the 5 changed files. Each was run with its exit code captured before any pipe: 62 exit 0. --ran reconciliation: 66 derived, 62 run, 2 NOT-MEASURED, 2 UNRUN.
    • NOT MEASURED: check-plugin-teardown-shape.mjs --self-test and check:dual-build-cjs-loads, reason: exit 3, PREREQUISITE NOT MET (shallow clone; not every package has a dist/).
    • NOT MEASURED: check:query-options-erasure and check:type-check-debt, reason: repo-wide scans stopped by the 240 s per-gate limit (exit 124). CI's Lint & Repo Gates and TypeScript Type Check run them.
  • overlap-check: VERDICT clean exit 0 against origin/main 430bbbf (no open PR shares a file).
  • 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>
… 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>
The split took the whole CJK symbols block as punctuation, so 々 (U+3005),
〆 (U+3006) and 〇 (U+3007) cut a run. With the drop-a-run-of-one rule,
「人々」 yielded no term and 「二〇二四年」 lost its first figure. The three
marks now belong to an unspaced run in both stores (and to pgvector's
UNSEGMENTED, so a piece of them is a substring term); 、 and 。 still split.

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

3 anchor(s) derived from 2 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • 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 — 2 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 430a3119d3cde3b0b0032acb7df26a4411097ea0 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 430a3119d3cde3b0b0032acb7df26a4411097ea0

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

Final green head for L1: 86a724b0543e554223cf1f2008554dc6d4e7c083 (2026-11-29T06:27Z).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

席位核对 — L1 ACCEPT · head 86a724b · 2026-11-29T06:29Z

Verdict: ACCEPT at 86a724b054. Checks: 39 success, 0 failed, 0 pending, mergeable clean. This PR carries item 1 of my #38469 must-fix (7250902792), which #38411 holds as record 7250976154. Part of #38411 is right, because the BrightRule graded eval and Ask 3 stay open on the card. Not governed: Clause-②: no, Metadata-protocol: none.

The fix

  • In both stores, the split class drops 々-〇 from the CJK symbols block. Instead UNSEGMENTED_RUN names those three code points, regardless of script (〆 is Common).
  • The pgvector UNSEGMENTED gains the same three marks. The two stores' UNSEGMENTED_RUN lines and split lines in the diff are byte-identical, as the body says ("one rule, kept identical").
  • 「、」, 「。」 and the brackets still split:  -〄 and 〈-〿 are kept.

My own runs (worktree at the head, pgvector keyword-terms.test.ts, 6 of 6 pass). Each part of the fix is pinned on its own:

  • A1, the split class restored alone: 1 failed.
  • A2, UNSEGMENTED_RUN restored alone: 1 failed.
  • A3, UNSEGMENTED restored alone (the 〆〆〆 pin): 1 failed.

Each ablation was restored after its run, git status was clean, and the worktree has been removed.

Probe of edge inputs:

  • 「時々刻々」 → 時々刻, 々刻々, 時々, 々刻, 刻々
  • 「二〇〇〇年」 → six pieces
  • 「、人々。」 → 人々
  • a lone 「〆」 or 「々」 → [], the existing drop of a run of one

Changeset 38411-cjk-separator-marks.md, read sentence by sentence.

  • It lists both stores as patch and states the cause and the result, with the same examples as the pins.
  • It says the libSQL and PostgreSQL matching is unchanged.
  • "A piece made only of 〆 … never as a tsvector word" is pinned.
  • "No index or fingerprint change, no reindex" holds, because only the query-side keywordTerms / UNSEGMENTED change.
  • This closes my changeset nit.

Nit (not blocking): the same class of split has 18 more members, all rare. The doc comment says the split "takes the rest of that block as punctuation". That is true of what the code does, but these code points in  -〿 are letters or numbers, not punctuation:

  • 〻 (U+303B, Han, the vertical-text iteration mark)
  • 〱–〵 (U+3031–3035, the kana repeat marks)
  • 〼 (U+303C)
  • the Hangzhou numerals 〡–〩 (U+3021–3029, Han)
  • 〸–〺 (U+3038–303A, Han)

Probed at this head:

  • 「人〻」 → []
  • 「いろ〳〵」 → いろ

None of these is likely in a typed question, so I do not ask for a head move. If the card thread wants it closed, one line on #38411 is enough: name the class as "every \p{L}\p{N} in U+3000–303F", or use a lookahead-based split.

Landing (card thread, not governed): Part of, so #38411 keeps pm:dispatched (landing rule B).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

Landing 2026-11-29T06:30Z · head 86a724b0543e554223cf1f2008554dc6d4e7c083

@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 46233875645 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Temporal Conformance (live PG + MySQL) — 失败步骤: Run the pgvector knowledge store against live PostgreSQL

    FAIL  src/__tests__/capability-mount.live-postgres.test.ts > a knowledge_source with no adapter and no requires — mounted by the item, bound to the marked store
      ↳ 失败原因: AssertionError: expected { deploymentAdapter: 'pgvector', …(1) } to deeply equal { deploymentAdapter: 'pgvector' }
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • src/__tests__/capability-mount.live-postgres.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 17 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

Re-landing 2026-11-29T08:38Z · head e04c8532991ff6982d8803c6663015a88645ab10

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit 688fddb Nov 29, 2026
55 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-buhir9 branch November 29, 2026 08:59
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/s 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