Skip to content

feat(platform-objects,service-segmenter): sys_search_term, the administrator's search-word object (step 1, PR 2 of 2) - #38891

Merged
hotlong merged 11 commits into
mainfrom
claude/issue-38710-search-term-object
Dec 1, 2026
Merged

hotlong merged 11 commits into
mainfrom
claude/issue-38710-search-term-object

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Refs #38710 (step 1, PR 2 of 2)

Clause-②: yes
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:暂时看不到。平台多了「检索词条」对象,但设置里不放入口,等第二步知识检索真正读它时再加。
  • 为什么做:属于「知识检索的中文问句按真实词语切分」这张卡的第一步,让管理员调整的词先有地方存。
  • 出错会怎样:只有平台管理员能读写;记录目前不影响任何检索,删除或回滚这个 PR 不丢用户数据。
  • 要你做什么:本卡累计超过 3000 行,需要你批准合并。

What changes

  • sys_search_term (检索词条) in packages/platform-objects/src/system/sys-search-term.object.ts: the administrator's search words, one set for the deployment.

    • managedBy: 'system-data' with userActions: { import: true }: New, Edit, Delete, Import and Export are the platform's own, and record history is on (enable.trackHistory; the field-level flags were dropped in rework round 1, because on these field types they change nothing).
    • systemFields: { tenant: false }, like sys_knowledge_sync_state: no organization column (ADR-0131 D7).
    • requiredPermissions: ['manage_platform_settings'] in the flat list form. That form gates every operation in the security middleware, reads and writes alike. The real-stack test below pins it for create, update and read.
  • Field mapping onto the contract (packages/spec/src/contracts/segmenter-service.ts, SegmenterEntry):

    Field Contract Notes
    term (text, required, max 64) term
    kind (word / stop_word, default word) kind Options equal SegmenterEntryKind.
    purpose (knowledge / record_search / both, default knowledge) purpose Options equal SegmenterEntryPurpose. Only knowledge retrieval is implemented, per the card.
    enabled (boolean, default on) enabled
    knowledge_source (text, optional) none See below.
    note (textarea) none For the next administrator.

    The contract has no scope member: it says "the contract carries the entries, never where they are stored". So knowledge_source is for the reader in step 2, which picks a source's records (its own and those with no source) before passing them as entries. Its type follows the sys_knowledge_sync_state.source precedent: a text field holding the source's name as callers spell it. Knowledge sources are governed metadata, not records, so a lookup does not apply.

  • The seat's platform-word cut is enforced at the object. The cross-field validation search_term_platform_word_not_disabled refuses kind: word with enabled: false for a platform word. Making that word a stop word is accepted, and so is disabling a platform stop word or one of the administrator's own words. To make this reachable without an import cycle, the 24 platform words move from service-segmenter to platform-objects as PLATFORM_SEARCH_WORDS. service-segmenter's PLATFORM_WORDS now is that list (same reference, pinned). A second validation, search_term_no_edge_space, refuses a term with a leading or trailing space, because the CEL in comparison would otherwise miss a padded platform word.

  • Registration: SegmenterServicePlugin.init() registers the object on the manifest service (SEARCH_TERM_BUNDLE_ID), the way the queue plugin registers sys_job_queue, and declares optionalDependencies: ['com.objectstack.engine.objectql'] (ADR-0116, check:init-service-contract). With no manifest service it logs once at info, not warn.

  • No Setup navigation in this PR. Nothing reads a record until step 2, so a record changes no search. AGENTS.md says never to advertise a capability the runtime does not deliver, so this PR shows administrators no screen. Step 2 adds the Setup entry together with the read path.

  • Translations: the extract config and the bundle-ownership roster gain the object. Every locale's bundle is regenerated (pnpm i18n:extract, node scripts/check-i18n-bundles.mjs --write), and all ten translated locales are hand-translated (zh-CN 「检索词条」), so only the id label keeps a source hash.

  • Registries that red without the new name (each measured red first):

Tests

  • packages/platform-objects/src/system/sys-search-term.object.test.ts (17 cases): the declaration. It parses; the options are the contract's types (the arrays are typed by the contract); system-data plus the import opt-in resolve to all five affordances, and without the opt-in import is off; history is on; each platform word equals its own normalised key (NFKC, trim, lower case, as the service's keyOf); both rules are evaluated, the regex through RegExp and the predicate through the canonical CEL engine.
  • packages/services/service-segmenter/src/search-term-object.integration.test.ts (5 cases) runs on a real stack: ObjectQL over SqlDriver (better-sqlite3), the real SecurityPlugin, and the object taken from the bundle the plugin hands the manifest:
    • registered, with no navigation contribution;
    • a caller with a full CRUD grant, and a caller holding modifyAllRecords, both without manage_platform_settings, are refused create, update, delete and read (PERMISSION_DENIED, 403), and nothing lands;
    • a caller holding the capability creates and updates; no organization is stamped; under the isolated tenancy wall, another organization's administrator and that organization's system context both read the same row (red to 0 rows when tenant: false is ablated);
    • disabling a platform word is refused on insert and on update (VALIDATION_FAILED on enabled, HTTP 400), and the three shapes the cut keeps are stored;
    • records read back map onto SegmenterEntry and change keywordTerms as the contract says: 年假 made a stop word is dropped, and the disabled platform stop word 是否 comes back.
  • packages/rest/src/import-search-term-csv.test.ts (3 cases, rework round 1) pins the import door through POST /api/v1/data/:object/import/jobs with the real SecurityPlugin, as import-exchange-rate-csv.test.ts and import-work-calendar-csv.test.ts do:
    • a capability holder imports 3 rows, with no organization stamped;
    • a row disabling 年假 is refused alone (rule_violation on enabled) while the other rows land;
    • a full-CRUD member gets every row PERMISSION_DENIED and nothing is stored.
  • deployment-level-no-tenant-column.test.ts: one row.
  • Ablations, each run on the committed head and restored with git checkout HEAD:
    • dropping requiredPermissions reds the write-gate case;
    • dropping the platform-word rule reds the refusal case;
    • dropping userActions.import reds the affordance case.

Acceptance notes

  • Uniqueness is not enforced. Two records for the same term and scope can coexist. The contract's "a later entry wins" needs an order, which step 2's reader must define (for example, by updated_at). A unique key on (term, knowledge_source) would not catch the empty-source case (NULLs are distinct) or case and NFKC variants.
  • Separators are not refused. A term holding a separator other than a single space (R&D, 《员工手册》) is stored but never matched, per the contract. The field's help text says so. A write-time refusal would need KEYWORD_SEPARATORS from @objectstack/core in the object package; that is left to the tuning-tools work.
  • record_search and both can be chosen (the ruled reserved field), and today a record with record_search changes nothing, as with every record until step 2.

Verification

Two-minute check: pnpm --filter @objectstack/service-segmenter exec vitest run src/search-term-object.integration.test.ts. Expected: 5 passed, including the 403 refusal for the member without the capability.

Read first, by risk:

  1. packages/platform-objects/src/system/sys-search-term.object.ts: the gate, the tenancy and the platform-word rule (the CEL in list built from PLATFORM_SEARCH_WORDS).
  2. packages/services/service-segmenter/src/segmenter-service-plugin.ts: the registration, with no navigation.
  3. packages/services/service-segmenter/src/platform-words.ts: the list now read from platform-objects.

L2: owed for Clause-②: yes and one line of packages/spec/src/**. The record and its delta read are on this PR.

Local gates (derived set, rework head a7f5fb6)
  • node scripts/pm/dispatch-gates.mjs --ran at a7f5fb61: 120 derived, 120 run, 0 NOT-MEASURED, 0 UNRUN (a derived zero: every command recorded exit 0). The original head aba78c9b6 read the same.
  • Fixed on the way: check:init-service-contract (the plugin now declares optionalDependencies: ['com.objectstack.engine.objectql']). check-plugin-teardown-shape --self-test first exited 3 (its fixture commit was outside the shallow clone); after fetching the commit it exits 0.
  • Head 7033962 only reverts this PR's service-segmenter/README.md edit, to stay inside the claim's narrowed surface. The derived set is byte-identical, and check:published-readme-exports, check:doc-authoring, check:issue-citations and check:published-files rerun at exit 0.
  • Package suites: @objectstack/service-segmenter 4 files / 36 tests passed, typecheck 0; @objectstack/platform-objects 131 files / 2242 tests passed; @objectstack/rest 444 files / 9148 passed, typecheck 0, typecheck 0; @objectstack/spec platform-object-names.test.ts 14 passed; @objectstack/cli organization-ownership-inventory.test.ts 26 passed.
  • Off the claimed surface, each one required by a gate or test: packages/spec/src/system/constants/platform-object-names.ts (1 line), packages/cli/src/utils/organization-ownership-inventory.ts (1 row), packages/platform-objects/scripts/i18n-extract.config.ts (the extractor's object list), packages/services/service-segmenter/vitest.config.ts (source aliases; check:test-source-alias exits 1 without them, naming the five workspace packages, @objectstack/types among them), and packages/rest/src/import-search-term-csv.test.ts (the import-door pin; the route is RestServer's, and the claim was amended to include it).

Generated by Claude Code

…tered by the segmenter service

Claude-Session: https://claude.ai/code/session_01RKKVnitBaUHnfQ8KzxmKkv
Co-authored-by: Claude <noreply@anthropic.com>
…egisters it without a Setup entry

Claude-Session: https://claude.ai/code/session_01RKKVnitBaUHnfQ8KzxmKkv
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKKVnitBaUHnfQ8KzxmKkv
Co-authored-by: Claude <noreply@anthropic.com>
…() reads the manifest service from

Claude-Session: https://claude.ai/code/session_01RKKVnitBaUHnfQ8KzxmKkv
Co-authored-by: Claude <noreply@anthropic.com>
…'s narrowed surface)

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

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 4 package(s): @objectstack/cli, @objectstack/platform-objects, @objectstack/service-segmenter, @objectstack/spec, touching 48 documentable anchor(s). ⚠️ 4 changed file(s) yielded no anchor (packages/platform-objects/src/system/index.ts, packages/services/service-segmenter/package.json, packages/services/service-segmenter/src/index.ts, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

71 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json be2df7538dd3ebbf0ac3c8c37c86f2b1e2bff726.

⛔ 20 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 4 changed file(s) yielded no anchor (packages/platform-objects/src/system/index.ts, packages/services/service-segmenter/package.json, packages/services/service-segmenter/src/index.ts, …) — pages documenting those are invisible to this run
  • 1 cross-cutting symbol(s) contributed no route anchor: isSystem (5 routes)
  • 1 anchor(s) matched too much of the corpus to be a work list: requiredPermissions (symbol, 42 pages)
  • 10 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 71 of 254 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 — 192 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 be2df7538dd3ebbf0ac3c8c37c86f2b1e2bff726 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json be2df7538dd3ebbf0ac3c8c37c86f2b1e2bff726

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@baozhoutao · baozhoutao · session_01RKKVngFfp7HBk6JUUr5vfN

Contract-review-claim: session_01RKKVngFfp7HBk6JUUr5vfN · head 7033962 · 2026-12-01T12:38Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@baozhoutao · baozhoutao · session_01RKKVngFfp7HBk6JUUr5vfN

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 7033962b7f263b372a906a105d0ef6c05b3a18aa
Local-runs: none
Scope: packages/spec/src/system/constants/platform-object-names.ts + packages/platform-objects/src/system/sys-search-term.object.ts, packages/platform-objects/src/system/sys-search-term.object.test.ts, packages/platform-objects/src/system/index.ts, packages/platform-objects/src/deployment-level-no-tenant-column.test.ts, packages/services/service-segmenter/src/segmenter-service-plugin.ts, packages/services/service-segmenter/src/platform-words.ts, packages/services/service-segmenter/src/index.ts, packages/services/service-segmenter/src/search-term-object.integration.test.ts, packages/services/service-segmenter/package.json
Security-touching: yes
Rule-change-verified: none

① Derived judgments

② Semver level

Four patch entries are right: kind none takes patch, a non-protocol widening ships patch, and all four packages move in src.

③ Boundary flags

  • Write gate: enforced on every door, by reading.
    • The flat list lands in the all bucket (plugin-security/src/security-plugin.ts:1005), applied to every operation, delete and export included.
    • The gate runs before the CRUD grant (security-plugin-authz-middleware.ts:1195), so modifyAllRecords does not pass it. A caller with no permission sets meets the deny baseline (:1305).
    • Import rows are written through the engine under the caller's context (core/src/utils/import-runner.ts:1532, :1614). Only isSystem bypasses.
  • Deployment-wide shape: matches ruling 7272462484. There is no organization column. manage_platform_settings is platform-scoped and organization_admin withholds it (security-plugin.ts:383). A tenant administrator can neither read nor write; a platform administrator can, from any organization.
  • should-fix: the import door is not pinned.
    • sys-search-term.object.ts:77 is the first object to combine tenant: false with userActions.import.
    • sys-search-term.object.test.ts:11-13 says the import door is pinned on a real stack, but the integration test has no import case.
    • Both earlier opt-ins carry one (packages/rest/src/import-exchange-rate-csv.test.ts, import-work-calendar-csv.test.ts).
    • Pin it: a capability holder lands rows, a row disabling a platform word is refused alone, a member is refused. Otherwise correct the sentence and narrow the changeset claim.
  • nit: the refusal case (search-term-object.integration.test.ts:121) covers insert, update and find. Add delete and a caller holding modifyAllRecords.
  • CEL rule (sys-search-term.object.ts:188-189): sound. It is refused on insert and on a merged update.
    • nit: it compares raw text, while the service compares NFKC, trimmed, lower case (segmenter-service.ts:43). That is exact for today's 24 Han words; a future Latin platform word would be evaded by case. Assert each word equals its own key.
  • Open question 1, option A: sound. The direction is service-segmenter → platform-objects → metadata-core and spec, with no cycle. Spec receives one name and no logic. B registers an object that differs from its declaration; C leaves the cut unenforced.
  • Declared-but-unenforced keys:
    • nit: the six field-level trackHistory: true (:96, :112, :129, :140, :151, :162) change nothing on these field types (spec/src/data/field.zod.ts:2869). Test line 71 pins them, and the PR body credits them for history.
    • record_search and both are reserved by the contract, and the help text says so.
  • SQL push-down: no reader, so no id materialisation or in-app join is added.
  • optionalDependencies (segmenter-service-plugin.ts:48) makes a missing manifest service a fact, and info is the right level.
  • The PR author is objectstack-fleet[bot]. The head has 74 check runs, all success or skipped.

④ Design judgment

  • No Setup navigation: consistent with Prime Directive 10. No composition on this head mounts SegmenterServicePlugin, so no shipped runtime registers the object.
    • nit (accepted deviation): the object and field descriptions state effects in the present tense, in every locale; the changeset discloses that nothing reads yet. Step 2 must land the mount, the reader and the Setup entry together.
  • knowledge_source as text suits step 2's reader. It stores the source's face, the spelling KnowledgeSourceRegistry.resolve answers and entry.face carries. Carry to the step 2 card:
    1. A typo or a renamed source silently never applies; surface or refuse it.
    2. Treat NULL and the empty string both as "every source".
    3. Pass enabled as a strict boolean: the service tests === false (segmenter-service.ts:83), and this test coerces with Boolean() (:143, :187).
  • Open question 2: accept A for this PR, with two conditions on step 2.
    • Do not order by updated_at. Under the contract a later disabled entry withdraws an earlier entry of the same kind, so disabling one duplicate would silently withdraw its enabled twin.
    • Order unscoped records first, then the source's own, with ties by created_at then id.
    • Add a normalised key (NFKC, trimmed, lower case), unique per key and source with empty stored as ''. Land it before the Setup entry, while the table is empty; later it needs a dedupe migration.
  • nit: the README Exports table omits SEARCH_TERM_BUNDLE_ID (the edit was reverted for the claim surface). Restore it with step 2.

No must-fix. One should-fix (import door pin) is open for a delta read.

Implemented-by: claude/issue-38710-search-term-object
Reviewed-by: session_01RKKVngFfp7HBk6JUUr5vfN

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@baozhoutao · baozhoutao · session_01RKKVngFfp7HBk6JUUr5vfN

2026-12-01T12:48Z · L1 verdict: REWORK (round 1 of at most 2) · head 7033962b · card #38710 step 1, PR 2 of 2.

The seat's L1 reading finds no must-fix. These all hold on the tree:

  • the rulings: deployment-wide (tenant: false), requiredPermissions: ['manage_platform_settings'], system-data with import and history, 「检索词条」, 用途 defaulting to knowledge, two layers only, no Setup entry;
  • the platform-word cut, by a CEL rule;
  • the 24 words moved byte-identical, with PLATFORM_WORDS the same reference;
  • the four reported deviations, all gate-required;
  • CI: 63 success, 11 skipped.

The L2 contract review above is PASS with one should-fix that owes a delta read. It and the L1 should-fixes are folded into this round.

Open question 1 (word list in platform-objects, option A): accepted. Both reviews endorse it: one list and one declared rule, with no new dependency direction.

Should-fix (this round)

  • P1, the import door is not pinned (L2). sys-search-term.object.ts:77 is the first object to combine tenant: false with userActions.import, and sys-search-term.object.test.ts:11-13 says the import door is pinned on a real stack, but the integration test has no import case. Pin it the way packages/rest/src/import-exchange-rate-csv.test.ts and import-work-calendar-csv.test.ts do:
    • a capability holder imports rows;
    • a row disabling a platform word is refused on its own;
    • a member without the capability is refused.
      If the import route is unreachable from this package's test stack, correct the sentence and narrow the changeset claim instead, and say why.
  • P2, the cross-organization read case does not test tenancy (L1). search-term-object.integration.test.ts:148-151 passes whether or not the object is tenant-less, because the capability is exempt from tenant filtering (plugin-security/src/security-plugin.ts:383-388). Read the row under SYS_CTX or another context that would filter by tenant, or rewrite the comment to name the real evidence (organization_id undefined plus the no-tenant-column row).
  • P3, the cut refusal lacks a status (L1). At :161 and :176, add the HTTP status the protocol maps it to, for example via resolveThrownHttpError(…).status === 400, beside VALIDATION_FAILED.
  • P4, the vitest.config.ts deviation: cite the check:test-source-alias exit that required it, in the report.

Nits (carry if cheap)

  • Add delete and a modifyAllRecords caller to the refusal case (L2).
  • Pin that each platform word equals its own NFKC / trim / lower-case key, so a future Latin word cannot slip past the raw-text CEL rule (L2).
  • Field-level trackHistory: true changes nothing on these field types (spec/src/data/field.zod.ts:2869). Drop the pins and PR-body credit, or say what they do.

Carried to step 2 (not this PR; the seat records them on #38710):

  • the entry-ordering rule: unscoped entries first, then the source's own, with ties by created_at then id; not updated_at;
  • a normalised unique key, landed before the Setup entry;
  • knowledge_source typo and rename handling;
  • NULL and '' both meaning every source;
  • a strict boolean enabled;
  • the mount, reader and Setup entry landing together;
  • the README SEARCH_TERM_BUNDLE_ID row.

After the push, post an updated os-dev-report on #38710 naming the new head and each item. Keep the PR draft, and keep the surface as amended. Do not knock any review seat.

…fusals carry their status

The real-stack suite boots under the isolated tenancy wall, so the
cross-organization read is a tenancy pin: the org_b system context reads
the org_a row only because the object has no organization column. The
refusal case adds delete and a modifyAllRecords caller; the platform-word
refusal is pinned at its boundary answer, 400 VALIDATION_FAILED.

The object drops the six field-level trackHistory flags, which change
nothing on these field types, and its test pins each platform word as its
own comparison key.

Claude-Session: https://claude.ai/code/session_01RKKVngFfp7HBk6JUUr5vfN
Co-authored-by: Claude <noreply@anthropic.com>
…hind the real security layer

A capability holder's file lands one record per line with no organization
stamped; a line disabling a platform word is refused alone on `enabled`
while the rest lands; a caller without manage_platform_settings gets every
row refused PERMISSION_DENIED and nothing lands.

Claude-Session: https://claude.ai/code/session_01RKKVngFfp7HBk6JUUr5vfN
Co-authored-by: Claude <noreply@anthropic.com>
…s under the wall

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack@baozhoutao · baozhoutao · session_01RKKVngFfp7HBk6JUUr5vfN

2026-12-01T18:03Z · Red check read as a flake, re-run once · head a7f5fb61497b6188e2f48a0e87122d80f4ce0f89 · run 46700024586.

Test Core (11/12) and its roll-up Test Core are red from ONE test:

The failed jobs get one re-run through the relay (rerun-failed.mjs). If the same signature fails again, it is real, and the seat files it as a flake card rather than re-running again.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@baozhoutao · baozhoutao · session_01RKKVngFfp7HBk6JUUr5vfN

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: a7f5fb61497b6188e2f48a0e87122d80f4ce0f89
Local-runs: none
Scope: packages/spec/src/system/constants/platform-object-names.ts + packages/platform-objects/src/system/sys-search-term.object.ts, packages/platform-objects/src/system/sys-search-term.object.test.ts, packages/platform-objects/src/system/index.ts, packages/platform-objects/src/deployment-level-no-tenant-column.test.ts, packages/services/service-segmenter/src/segmenter-service-plugin.ts, packages/services/service-segmenter/src/platform-words.ts, packages/services/service-segmenter/src/index.ts, packages/services/service-segmenter/src/search-term-object.integration.test.ts, packages/services/service-segmenter/package.json, packages/rest/src/import-search-term-csv.test.ts
Security-touching: yes
Rule-change-verified: none

① Derived judgments

Unchanged from 7033962. Clause-②: yes and Metadata-protocol: none hold: the delta touches no spec file, no export and no changeset line. The mapping onto SegmenterEntry is still 1:1.

② Semver level

Four patch entries, still right. The delta publishes nothing new: one test file in @objectstack/rest and one devDependency need no entry.

③ Boundary flags

  • Write gate: enforced on every door, now also pinned for delete, for a modifyAllRecords caller and for the import door.
  • Deployment-wide shape: now measured under the isolated wall.
  • No SQL push-down finding: the delta adds no query.
  • Author is objectstack-fleet[bot].

④ Design judgment

Unchanged. The step 2 carries stand as recorded in 7311679425 (ordering, normalised unique key, knowledge_source handling, strict boolean enabled, mount with reader and Setup entry).

Delta from 7033962

  1. Should-fix (import door): closed. packages/rest/src/import-search-term-csv.test.ts drives POST /api/v1/data/:object/import/jobs on a real RestServer, ObjectQL, SqlDriver and the real SecurityPlugin, with the platform's own object.
    • A capability holder lands three rows, none with an organization.
    • A row disabling 年假 is refused alone (rule_violation on enabled), and the other two rows land.
    • A full-CRUD member gets a failed job, every row PERMISSION_DENIED, and nothing is stored.
    • The 201 before per-row refusal is the door's documented shape (rest-server.ts:2998-3003).
    • sys-search-term.object.test.ts:11-16 now names both test homes correctly.
  2. Field-level trackHistory drop: no behaviour change. On text, select, boolean and textarea fields, true and absent read the same (spec/src/data/field.zod.ts:2869). enable.trackHistory stays and stays pinned. No generated file moves. nit: the PR body still credits the field keys.
  3. userActions.import not read by the import door: per spec, not a finding for this PR.
    • The spec declares userActions as the affordances "the UI surfaces" (object.zod.ts:4424).
    • system-data "carries no such guard"; the ledger's import evidence is console-only (spec/liveness/object.json).
    • The door is gated by API exposure and, per row, the security middleware, which the member case pins.
    • The key keeps a reader, but it is the console's import entry, which this object gets with step 2's Setup entry.
  4. New contract-face problems: none.
    • P2's harness change is sound: the cross-organization read now runs under the wall, for the administrator and for a system context.
    • The 400 assertions and the refusal loop (insert, update, delete, find; member and modifyAllRecords) match the middleware as read.
    • nit: the key pin restates the service's private keyOf (sys-search-term.object.test.ts:114); a change there would not move the pin.

Check runs on this head at read time: 61 success, 11 skipped, Test Core (11/12) in progress after the seat's re-run. Landing waits for green; that is not a contract finding.

No must-fix, no open should-fix.

Implemented-by: claude/issue-38710-search-term-object
Reviewed-by: session_01RKKVngFfp7HBk6JUUr5vfN

VERDICT: PASS

@objectstack-fleet

objectstack-fleet Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor Author

repo:objectstack@baozhoutao · baozhoutao · session_01RKKVngFfp7HBk6JUUr5vfN

2026-12-01T18:09Z · L1 verdict: ACCEPT · head a7f5fb61497b6188e2f48a0e87122d80f4ce0f89 · card #38710 step 1, PR 2 of 2 · Tier H by card size: a human approval is owed before merge

维护者速读

  • 做了什么:新增平台对象「检索词条」(sys_search_term):整个部署共用一份,只有 manage_platform_settings 权限能读写(新建、修改、删除、导入、导出都拦);内置词不能被停用,只能改成停用词。目前没有任何检索读取它,所以用户无感;设置菜单入口和读取在第二步一起上。
  • 为什么要你批:knowledge: Chinese questions are cut into real words by a dictionary segmenter, in one module both knowledge-turso and knowledge-pgvector use #38710 这张卡两个 PR 合计 3416 行(第一个 PR 1891 行已合并,本 PR 1525 行,大头是 11 种语言的翻译生成文件),超过 3000 行,按规则要人工批准。
  • 风险:权限闸门在真实环境测过(无权限的人包括「可改全部记录」的人都被拒、导入也被拒);对象不带租户列,已在租户隔离开启时测过。L2 契约审核两轮 PASS。
  • 要你做什么:在本 PR 上批准(review approve)。批准后席位挂自动合并。

Seat opinion: land it. Every ruling holds on the tree, and the write gate is pinned on every door, the import door included. The one design move, the 24 platform words living in platform-objects so the object can refuse disabling them, keeps one list and one declared rule. Nothing reads a record until step 2, which adds the reader, the mount and the Setup entry together.

席位核对

Check Result
Form Draft against main. Refs #38710 (step 1, PR 2 of 2). Clause-②: yes and Metadata-protocol: none in the body and the changeset. The PR body was refreshed by the seat to match the rework.
Rulings 7272436453 item 3, 7272455751, 7272462484 and the seat's platform-word cut. On the tree: tenant: false; requiredPermissions: ['manage_platform_settings']; managedBy: 'system-data' with import and history; name 「检索词条」; 用途 defaulting to knowledge; two layers only; no Setup entry; disabling a platform word refused by CEL on insert and update.
Tests test the risk Real stack (ObjectQL + SqlDriver + the real SecurityPlugin):
• a full-CRUD member and a modifyAllRecords caller without the capability are refused insert, update, delete and find with 403;
• the import door, in packages/rest: the holder lands rows, a platform-word row is refused alone, a member's rows are all refused;
• under the isolated tenancy wall, another organization's administrator and system context read the row, and this goes red to 0 when tenant: false is ablated;
• the cut refusal is 400 VALIDATION_FAILED.
The dev's ablations R1–R5 each went red, then were restored.
Rework round 1 (7311679425) P1–P4 fixed or cited; all three nits done. Taken over in-seat on the same branch (hand-over 7317969428).
L2 contract review PASS at 7033962b (7311660459) and on the delta at a7f5fb61 (record above), Served-tier: CONTRACT_REVIEW_TIER. No open should-fix.
Correction to the seat The rework measured my P2 premise wrong. The old cross-organization case passed because the harness ran with no tenancy wall at all, not because the capability is exempt from tenant filtering. The fix boots the wall and reads the row as the other organization's administrator and system context. Acknowledged here.
Accepted deviations • packages/spec/src/system/constants/platform-object-names.ts (1 line; red-first by its test; precedent #38307);
• packages/cli/src/utils/organization-ownership-inventory.ts (1 row; red-first);
• packages/platform-objects/scripts/i18n-extract.config.ts (the extractor list);
• packages/services/service-segmenter/vitest.config.ts (check:test-source-alias exit 1 cited);
• packages/rest/src/import-search-term-csv.test.ts (claim amendment 7320393617).
Gate check-runs a7f5fb61: 61 success, 11 skipped. The only red is Test Core (11/12) and its roll-up: a 5000 ms timeout in plugin-approvals flow-route.integration.test.ts, outside this diff, re-run once (7320345519). The hand-off for approval waits for that re-run to be green.
Size PR +1507/−18 (1525). Card total with #38744's 1891 lines: 3416, over 3000, so Tier H for this PR. check-governed-merges --pr reads one PR at a time and says under; the card sum is the seat's to add.
Carried to step 2 • Entry ordering: unscoped entries first, then by source, ties by created_at then id.
• A normalised unique key before the Setup entry.
• knowledge_source typo and rename handling.
• NULL and '' both read as every source.
• A strict boolean enabled.
• Mount, reader and Setup entry land together.
• Export keyOf so the key pin cannot drift.
• The README SEARCH_TERM_BUNDLE_ID row.
• userActions.import gates only the console entry, not the import door (per spec).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@baozhoutao · baozhoutao · session_01RKKVngFfp7HBk6JUUr5vfN

2026-12-01T18:26Z · Approval requested · head a7f5fb61497b6188e2f48a0e87122d80f4ce0f89 · ACCEPT 7320524384 · L2 PASS 7320456291

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Dec 1, 2026
@objectstack-fleet
objectstack-fleet Bot requested a review from os-zhuang December 1, 2026 18:27
@hotlong
hotlong marked this pull request as ready for review December 1, 2026 23:11
@hotlong
hotlong added this pull request to the merge queue Dec 1, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@baozhoutao · baozhoutao · session_01RKKVngFfp7HBk6JUUr5vfN

2026-12-01T23:11Z · Landed by hand, recorded by the seat · head a7f5fb61497b6188e2f48a0e87122d80f4ce0f89

  • The act: the account hotlong marked this PR ready at 2026-12-01T23:11Z and added it to the merge queue directly, not through the fleet relay.
  • What is on record: no APPROVE review and no approval comment. The authorised-approver list (GOVERNED_APPROVERS) is os-zhuang only. A person's own landing act is the review record for a PR that is Tier H by card size (SKILL.md: 人工直合即审核记录), so the seat does not dequeue it. None of the three dequeue causes holds: no base conflict, no self-caused red, no request from the author.
  • Checks before the act: ACCEPT 7320524384, L2 PASS 7320456291, approval request 7320960847. CI on this head was green, with 65 success and 13 skipped.
  • On merge: the seat removes pm:awaiting-merge, keeps knowledge: Chinese questions are cut into real words by a dictionary segmenter, in one module both knowledge-turso and knowledge-pgvector use #38710 open for step 2, and releases the step-1 claim.

Merged via the queue into main with commit 3872243 Dec 1, 2026
131 of 133 checks passed
@hotlong
hotlong deleted the claude/issue-38710-search-term-object branch December 1, 2026 23:37
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Dec 1, 2026
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 protocol:system size/xl 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.

3 participants