Repository navigation
fix(lint)!: a knowledge source is checked for its object, its fields and the search gates that need no caller, also at publish - #37971
Conversation
…rincipal-free gates (WIP) Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
…s fit one line Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
… source checks Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
📓 Docs Drift CheckThis PR changes 2 package(s): 5 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin d4c6fcda00e5521fb61505af59d9858757983a16 && git checkout d4c6fcda00e5521fb61505af59d9858757983a16
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin bfc0dd054ba4e05ba35cc3f77d8260c0e144f2bd 830150985dc08854ae7c5e59e7e2878b9a181a67 && git checkout -B drift-repro bfc0dd054ba4e05ba35cc3f77d8260c0e144f2bd && git merge --no-ff 830150985dc08854ae7c5e59e7e2878b9a181a67
node scripts/docs-audit/affected-docs.mjs --json bfc0dd054ba4e05ba35cc3f77d8260c0e144f2bd
|
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract-review-claim: session_016WV4czzx9dtSEm3jWWL9c3 · head f2c9aff · 2026-11-27T15:02Z |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract reviewServed-tier: Inputs read: card #37307 body and its four comments (7165478297, 7216413780, 7219690738, 7219789648), PR #37971 body, file list (12 files) and net diff against main, PR comments (docs-drift 7219696503, review claim 7221551422), and the check-runs on the head. Every check-run on the head concluded success or skipped; none failed. ① Derived judgmentsWhat the diff changes, each named right or wrong.
(a) The five findings, read against the platform's real rules. The door's universe.
Could a refusal hit a source main serves correctly today? Yes, in two shapes: M1 (a member naming (e) Transcript counts. (h) Tests. The 37 cases pin each of the five ids through ② Semver level
Upgrade entry. Shape: all four required The changeset, sentence by sentence.
③ Boundary flags
④ Design judgmentThe narrowing itself. K4 on main says a M1 (must-fix) — a source member naming S1 (should-fix) — on the CLI, an unprefixed object the stack and its artifact do not define is an error, and that refuses a package whose source indexes an object of a declared dependency the artifact does not carry. The door admits that same source: under the closure a declared dependency's object is in reach, and the door's own remedy is "Declare a dependency on the package that defines ...". An author who follows it then fails S2 (should-fix) — the prescriptions tell a refused author to grant N1 (nit) — "a source that carries one indexes nothing" is the stated reason for the error level in the rule header, N2 (nit) — N3 (nit) — at the door with no closure, a platform-prefixed name nothing registers only warns and a known platform name that is absent is skipped, although the door holds the whole host universe and K4 says refused. Lenient, never a false refusal, and the same as the ladder it copies. A N4 (nit) — the N5 (nit) — the seat's "keep gating" ruling should stand in the thread as the seat's own comment; today only the dev session's attribution exists. The K4 text is enough for this record. N6 (nit) — the entry has no Implemented-by: VERDICT: FAIL |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): REWORK at head 席位核对Shape and gates. Check-runs at f2c9aff: 60 success, 10 skipped, 0 failed. The two timeouts outside the diff passed on the one re-run. Contract review. Record 7221784031 at this head is a FAIL, served at the contract tier ( Owed before ACCEPT.
Nits.
On the new head I will do one delta read with a delta contract review. |
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
…unseen declared dependency, `list`-based search prescription - M1: a member's existence is judged through `injectedColumnsFor`, so `id` (driver-provisioned, absent from `injectedColumnDefsFor`) resolves. - S1: on the CLI, while the manifest declares a dependency the artifact does not carry, an unresolved object is a warning with the hedge; under a stated closure or against the whole collection (door) it stays an error. - S2/N2: the search gate prescribes `list` with `searchable` not false; `searchable: false` refuses only beside an `apiMethods` list. - N1: per-verdict wording of what each finding costs. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
…d collection Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract-review-claim: session_016WV4czzx9dtSEm3jWWL9c3 · head 8301509 · 2026-11-27T17:00Z |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 Contract reviewServed-tier: Delta round on the record in PR comment 7221784031 (head Inputs read: card #37307 body and its six comments (the seat ruling 7221816104 and the rework report 7223340311 among them), PR #37971 body and its five comments, the two author commits, the net diff against main, and the check-runs on the head: 60 success, 12 skipped, none failed, none pending. Merge resolution. First-parent order is merge ① Derived judgments
The three fixes, each read in the tree.
The object split. The search gate. Read against ② Semver level
The changeset rewrite, sentence by sentence.
③ Boundary flags
④ Design judgmentThe narrowing is unchanged in kind: K4's own refusal made real at the door, through the spec's predicates. The delta removes the three places where the previous head disagreed with the platform, and adds no new one. M1 (must-fix): closed Existence resolves through S1 (should-fix): closed Judged against the seat's ruling: the door refuses in both of its readings, and the warning exists only on the CLI while the manifest declares a dependency the artifact does not carry. The door's remedy (declare the dependency) and the CLI verdict now agree: declaring it turns the CLI error into the hedged warning and clears the publish under the closure. The hint, the explain entry, FROM → TO line 1 and the entry's S2 (should-fix): closed Every prescription names N1 (nit): closed N2 (nit): closed N5 (nit): closed N3 (nit) — carried, unchanged by the delta: at the door a known platform name the host does not serve is skipped, and a platform-prefixed name nothing registers warns. The rule now receives N4 (nit) — carried: the N6 (nit) — carried: no N7 (nit) — the changeset still reads N8 (nit) — amendment 7221575164 on #37310 was written before the rework. Its one-line account of No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): ACCEPT (delta) at head 席位核对Delta. The author's change is two commits, 15b32e6 and 2677e83, both in Contract review. Delta record 7224039424 at this head: PASS at the contract tier (
Before the seat's handoff. Follow-ups, not blocking. Record nits N3 (an absent platform-prefixed name is not judged against the whole collection; now a one-condition follow-up), N4 and N6 should become cards. The area should file them under #37307. N8 needs one line on #37310 so its amendment carries the CLI warning arm and the Landing: narrowing ( |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs Seat record · 2026-11-27T18:40Z · PR #37971 (Fixes #37307) · head 维护者速读
Seat opinion: land. 席位核对 — ACCEPT · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs Approval request · @os-zhuang — a |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46088679290 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46090926789 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
both land (#37435) PR #37971 and this PR each add one authoring rule and each moved the same four transcript lines from 86 to 87. The edits were byte-identical, so the merge of main was clean, but the registry now derives 88. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibx7DSQZnugnuX8CpCM
…ipped vs run-time mount, package-scoped identity) (objectstack-ai#38053) repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP Part of objectstack-ai#37310 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用 AI(技能文档或 MCP 搭建)写知识源的作者,现在看到的是新写法:知识源是一份元数据,用 `name`、逐个列出要索引的字段、可以不写存储;MCP 新建知识源暂不提供起始模板(模板里的占位对象和字段会被当成真实值存进去),等设置页表单从作者输入构建 `source` 后再加。 - 为什么做:知识库检索专题(按调用者权限过滤的知识检索)第三阶段的教学一行,替照着技能写知识源的 AI 解决"照文档写出来却被拒绝"的问题。 - 出错会怎样:最坏是技能里某句教法不准,AI 写出的知识源在保存时被明确拒绝并给出修法;不会悄悄索引错的字段;改动可直接撤回。 - 要你做什么:合并(技能文档是受治理面,由你亲手落地);本 PR 只完成卡片的一部分:发布校验的五条规则名要等对应的校验改动(objectstack-ai#37971)合并后再补,新建模板要等设置页表单,所以卡片保持打开。 ## What changes **`skills/objectstack-ai/SKILL.md`, § Knowledge Sources (RAG)** (ADR-0161 K4, K5, K6 item 6; rows 3a and 3b as merged): - A source is a `knowledge_source` item: shipped in a package (`knowledgeSources`, `*.knowledge-source.ts` / `.yml`) or authored in Studio or over MCP. `KnowledgeServicePlugin({ sources })` and `registerSource` are a second door for the same schema, and a code registration and an environment item of one name are one slot, the second refused. A source's identity is its package and `name`: `search_knowledge` lists a package's source as `NAMESPACE-NAME` (bare for a source no package holds). A shipped item (a `knowledgeSources` entry) mounts the knowledge service and its store with no `requires: ['knowledge']` (objectstack-ai#37306, PR objectstack-ai#38026); an app that ships no source and authors its sources at run time needs `requires: ['knowledge']`, or its items are never indexed (as main's `knowledge-rag.mdx` § Turning it on says). - The key table is the v1 keys of K4: `name`, `label` / `description`, `adapter` (optional; omitted ⇒ the deployment's store, else the only one registered, refused naming them when several and none is the deployment's), `source.kind`, `source.object`, `source.content` (an explicit non-empty list; why `'*'` is refused: embedding is egress, K5), `source.metadataFields`, `source.where`, `source.split`, `refresh.onRecordChange`, `aiExposed`. The old Hygiene column's advice (meaningful text only, never ids or system fields; `where` keeps drafts out) now lives in the `content` and `where` rows, and says `content`. - Egress and cost (K4): the first build sends every listed field of every matching record to the embedding provider; a run-time save needs `manage_knowledge_sources` beside `manage_metadata` and passes save-time admission. - The retired keys by name, each with its fix, as the tombstones read: `id` → `name`, `contentFields` → `content`, `embedding`, `vectorStore`, `adapterConfig`, `refresh.cron`, and the `file` / `http` arms with their four keys; `os migrate meta --from 18` for a stack, by hand for a registration in code. - The checked example drops `adapter: 'pgvector'` (the deployment's store) and its comments; it is otherwise row 3a's block. - `split`: `strategy` is required once `split` is written (`recursive` only when `split` is omitted); the adapter-list aside is gone. - The closing note: `topK` is a `search_knowledge` argument; rerank and hybrid weighting are no source key, and no shipped store has a setting for either (`knowledge-pgvector` and `knowledge-turso` fuse their legs by RRF with a fixed `RRF_K = 60`, `pgvector-adapter.ts:124`, `turso-adapter.ts:95`; no store plugin's options interface has a rerank, weight or fusion key). - The routing line in `skills/objectstack-mcp-build/SKILL.md` ("An agent skill, tool or knowledge source | objectstack-ai") stays true: the section name is unchanged, so it is not edited. **Not in this PR, on purpose (amendments 7221575164 and 7224082428):** the five `os validate` / publish rule ids of PR objectstack-ai#37971 (`knowledge-source-object-unknown`, `knowledge-source-field-unknown`, `knowledge-source-object-not-searchable`, `knowledge-source-system-object-not-ai-readable`, `knowledge-source-field-never-indexed`). objectstack-ai#37971 is still open, so this PR is `Part of objectstack-ai#37310`: that part follows on this branch after objectstack-ai#37971 lands (the keyword then returns to `Fixes`), or on a later PR if this one lands first. The create seed is also left open: it waits for the Studio form (objectstack-ai#37309, row 5). **`skills/objectstack-ai/evals/skills-tools-knowledge.json`.** Case 3 (kb_article on PostgreSQL) and case 9 (policy_doc, `markdown` split) now expect `name` and `content`, and forbid a written `contentFields:` key; case 3 also forbids a written wildcard (`['*'],`, `['*'] }`), `embedding:` and `vectorStore:`, and its `topK` token becomes `topK:` (the key written) because the skill now names `topK` as a search argument. Case 9 also requires `name:` and forbids an `id:` spelling; case 13 forbids the double-quoted wildcard forms. New case 14 asks for an app that ships no source and authors one at run time, and requires the `requires: ['knowledge']` line (either quote style), with no `contentFields:`. New case 13 asks for a source that indexes "every text field" and expects an explicit list, the wildcard declined because embedding is egress, and no written `contentFields:` or wildcard. **`packages/spec/src/kernel/metadata-create-seeds.ts`: unchanged (byte-identical to `main`).** A `knowledge_source` create seed was tried and withdrawn at `4c965f4a5e` (comment 7229668414). Its object binding and content list sit inside `source`, and the Studio create flow (`buildCreateModeBody` / `seedPlaceholderKeys` in app-shell's `createBody.ts`) clears placeholder identity at the top level only, so it would have saved `example_object` / `example_field` into a new source: the objectui#12810 defect. No schema-valid seed avoids this, because `source.object` and a non-empty `content` (K5) are required and nested. `knowledge_source` stays on `KNOWN_UNSEEDED`, whose comment now gives the reason: a seed waits until the Studio form (objectstack-ai#37309, row 5) builds `source` from the author's input. The card allows this ("or the type stays on `KNOWN_UNSEEDED` with the reason"). **`packages/runtime/src/domains/mcp-authoring.test.ts`.** One case beside the flow contract case, over the real protocol and the boot type registry: `list_metadata_items` with `contract: true` for `knowledge_source` serves no `createSeed`; `contractPath` `/properties/source/properties/content` serves the content rule (`minItems: 1`, `minLength: 1`, a pattern that refuses `*` and admits `body`); the served schema carries no `id` or `contentFields` tombstone; a hand-written source with one object and one field saves as a draft; the same item with `content: ['*']`, with an `id`, or with `contentFields` is refused `422 INVALID_METADATA`, the last two naming their tombstone's prescription ("use `name`", "use `content`"); nothing else is written. **Platform catalog (review round, `6f2e756f58`).** The generator's Boot cell (`packages/spec/scripts/lib/platform-catalog.ts`) reads ``on `requires`, or a shipped `knowledgeSources` item`` for a provider that declares `mountedBy`; `packages/spec/scripts/platform-catalog.test.ts` pins that cell, with `record-context` as the control that still reads ``on `requires` ``. `skills/objectstack-project/references/platform-catalog.md` is regenerated. **Token ratchet.** The standing ruling, verbatim and untranslated: 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B). Paid down first, in the same file: the wiring paragraph's package list, the old `source.kind` Hygiene column (folded into two rows), the example's four comments restating table rows and its `refresh: { onRecordChange: true }` line restating the default, and the split passage's adapter aside. The row moves 6609 → 6639, the measured remainder, pinned at the measurement. Review round (`6f2e756f58`): after paying down the intro's restating clause, its separate `search_knowledge` sentence, the "one name is one source" clause and the longer closing note, the row moves 6639 → 6695 (+56, the measured remainder) under the same ruling. Reproduction: `ceil(($(wc -c < skills/objectstack-ai/SKILL.md) - 27) / 4)` = ceil(26779 / 4) = 6695. ## Tests **Review round at `6f2e756f58`** (merges `main` at `58be6770ab`; note 7230668192): unlocked, 35 commands, each exit 0, including `check-skills-token-ratchet` (row 6695), `check:nul-bytes`, `check-empty-changeset`, `check-adr-0087-registration`, `check-changeset-no-major`, `check:issue-citations`, `check:doc-authoring`, `check:skill-links`, `check:skill-identifier-liveness`, `check:skill-frame-sync`, `check:published-files`; `gen:skill-refs` exit 0. NOT MEASURED locally (verify lock never acquired in six tries): `check:skill-docs`, `check:skill-refs`, `check:yaml-examples`, the platform-catalog test, `metadata-create-seeds.test.ts`, the MCP contract case, eval case 14. CI on this head is the reading for them. overlap-check: `VERDICT overlap exit 1`, the same objectstack-ai#36158-against-main conflict in the ratchet file; `origin/main`, objectstack-ai#38032 and objectstack-ai#38013 merge cleanly. The lock was saturated: about 70 minutes of queueing, two dogfood runs ahead. One locked round ran at `3407f7fe6e`; the second round was not reached. What was not measured locally is marked below, and CI runs it. <details><summary>Locked round at 3407f7f (VERDICT command-exit 0, held 365s)</summary> - `pnpm turbo run build --filter='@objectstack/runtime^...' --concurrency=2`: exit 0, `Tasks: 41 successful, 41 total`. - `metadata-create-seeds.test.ts` (spec): the seed pin run here (`Tests 20 passed (20)`) belonged to the withdrawn seed; the file is back to `main`'s, so CI `Test Core` is the reading. **Patch round at `4c965f4a5e`:** the app-shell `createBody.seedPlaceholders-12810.test.ts` (red at `19f3e118f2`, 2 failures, unedited), the spec create-seeds test and the rewritten MCP case are NOT MEASURED locally (verify lock saturated); their inputs equal `main`'s, so CI `Test UI` and `Test Core` on this head are the evidence. Unlocked gates at `4c965f4a5e`, exit 0 each: `check-skills-token-ratchet` (6639/6639), `check-empty-changeset`, `check-adr-0087-registration`, `check-changeset-no-major`, `check:nul-bytes`, `check:issue-citations`, `check:doc-authoring`. The changeset no longer lists `@objectstack/spec`. - `pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/mcp-authoring.test.ts`: exit 1, `Tests 1 failed | 73 passed (74)`. The failing assertion is the new case's tombstone half: it expected the served schema to carry `/properties/id`, and the served schema drops tombstones (see Acceptance notes). Its content-rule and seed assertions, which run before it, passed. The tombstone half is rewritten in `01cf7515c2` to assert absence plus the save refusal. **NOT MEASURED locally after that rewrite** (the second locked round never acquired); CI `Test Core` runs it. - `pnpm --filter @objectstack/spec run check:yaml-examples`: exit 0, `19 tagged YAML example(s) across 1 file(s) validate`. - `pnpm --filter @objectstack/spec run check:skill-docs`: exit 0, `Skill docs in sync`. - `pnpm --filter @objectstack/spec run check:skill-refs`: exit 0, `10 generated files in sync with packages/spec`. The generated skill references needed no regeneration: the section rewrite changes no reference input. - `pnpm --filter @objectstack/spec typecheck`: exit 0. - `pnpm --filter @objectstack/runtime typecheck`: exit 1. `tsc --noEmit` is clean. `check:test-typecheck` names 3 files this diff does not touch (`boolean-written-spelling-row-scope.test.ts`, `meta-object-publish-column-changes.test.ts`, `organization-ownership-boot-guard.turso-remote.kernel.test.ts`). `mcp-authoring.test.ts` is not among them. They are read here as the closure build's gaps (only `runtime^...` was built) and not as this diff's; CI `TypeScript Type Check` decides. - `pnpm --filter @objectstack/spec run check:skill-examples`: exit 3, PREREQUISITE NOT MET (the `@objectstack/client-react` dist is outside the built closure). **NOT MEASURED**; CI runs it. </details> <details><summary>Unlocked gates (35 derived families, each exit 0, at 3407f7f; the ratchet and nul-bytes re-run at 19f3e11)</summary> - `node scripts/check-skills-token-ratchet.mjs`: exit 0, `skills/objectstack-ai/SKILL.md is 6639 tokens (ceiling 6639; headroom 0)`; with `--self-test` exit 0. - Exit 0 each: `check-adr-0087-registration` (both forms), `check-changeset-no-major`, `check-closing-keyword-parity` (both), `check-declaration-mirrors` (both), `check-empty-changeset` (both), `check-issue-citations`, `check-self-test-wired` (both), `docs-audit/check-affected-docs`, `docs-audit/check-drift-comment`, and `pnpm check:` `agent-test-spelling`, `changeset-gate-self-tests`, `closed-ceremony-text`, `corpus-claim-drift`, `cross-package-test-inputs`, `doc-authoring`, `issue-citations`, `keyed-text-bounds`, `nul-bytes`, `pm-skill-id-lint`, `published-files`, `ratchet-remedy-authority`, `role-word`, `skill-compatibility`, `skill-frame-sync`, `skill-identifier-liveness`, `skill-links`, `test-source-alias`, `tier-file-adoption`. - `dispatch-gates --ran`: `116 derived, 38 run, 0 NOT-MEASURED, 78 UNRUN`. That is a declared narrowing: the lock was saturated, and CI runs the 78. - Local-only: `check-skill-frame-freshness` exit 0. `check-dev-prereqs` exit 1 ("69 of 110 workspace packages … not on disk"), which is the closure-only build and not a finding. </details> <details><summary>Eval runner and the ablation (`skill-evals`, claude-code-cli 2.1.332, oauth login, served claude-opus-5-5)</summary> Cases 3, 9 and 13 of `objectstack-ai/skills-tools-knowledge`, both arms, one repeat each: | skill text | objectstack-ai#3 with-skill | objectstack-ai#9 with-skill | objectstack-ai#13 with-skill | no-skill (all three) | |:--|:--|:--|:--|:--| | this PR | pass | pass | pass | fail | | `main`'s `SKILL.md` (`8d34c4404f`, hash `88a20cb583`), new cases (ablation) | fail: `contentFields:` written; `name:`, `content:` missing | fail: `contentFields:` written; `content:` missing | fail: `contentFields:`, `['*'],` and `id: 'faq` written; no egress reason | fail | The ablation restored `main`'s `SKILL.md` into the working tree only (`git restore --source=8d34c4404f`, `git hash-object` = `88a20cb583`). The run ran, and then `HEAD`'s file came back (`fc845724ac` both on disk and at `HEAD`). An earlier run of case 13 on this text failed with-skill only on the token `['*']`, which a correct answer quoted while explaining the refusal. The forbidden token is now the written wildcard (`['*'],` / `['*'] }`), and the table above is after that change. </details> ## Acceptance notes - The acceptance grep (`git grep -n -E "contentFields|'\*'|adapter: 'ragflow'" skills/objectstack-ai`) returns eight lines. In `SKILL.md`, three: the `content` row ("`'*'` is refused") and two lines of the retired-keys paragraph. In the eval file, five: the reference answers of cases 3 and 13, which name both as retired, and the `must_not_contain` lists of cases 3, 9 and 13, which forbid a written `contentFields:` and a written wildcard (`['*'],`, `['*'] }`). The card itself asks the eval to fail on `contentFields` or `'*'`, which puts the forbidden token on the assertion line. The reviewer decides whether those lines count as "naming a retired key as retired". - `adapter: 'ragflow'` has no hit: objectstack-ai#37004 already removed it. - The new MCP pin is an `it` inside the existing real-protocol `describe` of `mcp-authoring.test.ts`, beside the flow contract case, because that describe holds the real-protocol harness (`realProtocol`, `STUDIO_BASE`). It is in the shared harness file, not a new file. - **Premise correction (card item 3).** The card asks the served contract to carry "the tombstones' prescriptions as the describes read". It does not, by design: the served JSON Schema drops every `retiredKey()` tombstone (`{ not: {} }`; see the note in `packages/metadata-protocol/src/protocol-meta-type-schema.ts`: the served schema publishes what an author MAY write). The prescription reaches an MCP author through the save refusal instead. The pin asserts both halves: the tombstone is absent from the served schema, and a save that writes the retired key is refused naming its replacement. - The save half of the MCP pin covers row 3a's parse. Row 4's checks (objectstack-ai#37971) are not on main, so a hand-written draft is not yet judged by them here. Today the save passes with no knowledge service mounted ("no knowledge service judges nothing"). - overlap-check before the PR: `VERDICT overlap exit 1`. `origin/main`, objectstack-ai#38032 and objectstack-ai#38013 merge cleanly. objectstack-ai#36158 (a draft last updated 2026-11-25) conflicts in `scripts/check-skills-token-ratchet.mjs`. That conflict is objectstack-ai#36158's own against `origin/main`: `git merge-tree origin/main` with objectstack-ai#36158's head conflicts in the same file, and every conflict hunk is at line 798 or later, away from this branch's hunk near line 453. Reported here, not resolved. ## Verification Files to read first, by risk: 1. `skills/objectstack-ai/SKILL.md` § Knowledge Sources (RAG): the `adapter` and `content` rows and the retired-keys paragraph. 2. `packages/spec/src/kernel/metadata-create-seeds.test.ts`: the `KNOWN_UNSEEDED` reason for `knowledge_source` (no seed; `metadata-create-seeds.ts` is byte-identical to `main`). 3. `packages/runtime/src/domains/mcp-authoring.test.ts`: the new contract case. Two-minute check: `node scripts/check-skills-token-ratchet.mjs`. Expect `skills/objectstack-ai/SKILL.md is 6695 tokens (ceiling 6695; headroom 0)`. Readings: `skills/objectstack-ai/SKILL.md` 464 → 469 lines, 26462 → 26806 bytes (6609 → 6695 priced tokens, in two moves). Every published `SKILL.md` summed: 4936 → 4941 lines, 261366 → 261485 bytes (65342 → 65372 tokens). The eval file is 125 → 137 lines and 13611 → 15185 bytes; eval fixtures are measured, not ratcheted. --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…ts refused at publish, ai_context accepts id, search refusal names list (objectstack-ai#38038) repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP Fixes objectstack-ai#38019 Clause-②: no (narrowing) Metadata-protocol: narrowed Skills-docs: follow-up objectstack-ai#37310 ## 维护者速读 - 用户能看到什么变化:写知识源的作者在保存被拒时,看到的原因和修法改为「开放 list、不要关掉 searchable」;发布一个指向平台不存在的系统对象的知识源会直接被拒;AI 上下文里写 `id` 不再被提示字段不存在;升级指南只对用到知识源的应用列出相关条目。 - 为什么做:知识库检索这条线(PR 37971 知识源校验)评审留下的四个收尾问题。 - 出错会怎样:最坏是某个发布被多拒或提示文字不准,作者按提示改对象名即可;本改动可直接回退。 - 要你做什么:无。 **Was stacked on PR objectstack-ai#37971**, which merged as 3550665. `main` (f72f335) is merged here (2634eef, no rebase); the diff against `main` is now this card's 11 files, +150/−24. The add/add conflicts the squash left were resolved to this branch's side for `validate-knowledge-source.ts`, its test and the step-19 entry (main's blob equals the stack base 8301509 for each), and `rule-explanations.ts` merged three-way clean against that base. ## What changes 1. **N4, the save-door wording** (`service-knowledge`). The `object-api-not-served` refusal of `admitAuthoredSource` now uses the wording PR objectstack-ai#37971 settled for its S2 fix: the cause is `enable.apiEnabled` false, an `enable.apiMethods` list that does not grant `list` (from which search derives), or `list` beside `enable.searchable: false`; the fix is to keep `apiEnabled` true and include `list` with `searchable` not false, or index another object. It no longer tells the author to grant `search`, a retired list value the parse strips. The admission module's gate-2 header says the same. 2. **`ai_context` and `id`** (`validate-ai-context.ts`). Field existence (`fields`, a related list's `fields`, `where`, `orderBy`, `body.field`) is now asked through `injectedColumnsFor`, as `system-fields.ts` prescribes for an existence check, beside the effective field map. `id` (driver-provisioned, absent from `injectedColumnDefsFor` by contract) is no longer `ai-context-field-unknown`; a `body.field` of `id` is reported as not long text. The type questions (body type, sortability, links) still read the definition map. 3. **N3, a platform name at the door** (`validate-knowledge-source.ts`). Against the whole collection the host serves (no package scope at publish), an absent platform-prefixed name and an absent known platform name (`sys_user`) are now `knowledge-source-object-unknown` errors, as an unprefixed name already was. The CLI arms stay: a prefixed name no known package registers warns, a known platform name the stack does not carry is not judged. Under a stated closure nothing changes. The `os explain` entry and the upgrade entry's `surface` say which arm is the CLI's. 4. **N6, `relevantWhen`** (spec). `knowledge-source-publish-refuses-missing-references-and-gated-objects` carries `relevantWhen: { kind: 'stack-declares', keys: ['knowledgeSources'] }`; `semantic-relevance.test.ts`'s reviewed table gains the row (30 entries, 3 of protocol 19: `main` had meanwhile added `19:action-locations-page-parts-retired`, so the merge corrected the counts). The four sibling `19.knowledge-source-*` entries are deliberately left without one: each names a surface outside the stack (a source registered in code through `KnowledgeServicePlugin({ sources })` / `registerSource`, or host calls to `indexDocument`), and `SemanticMigration.relevantWhen`'s contract says to omit the question unless the surface lives ONLY under the keys it names, so a stack with no `knowledgeSources` is not proven clear of them. Declaration: item 3 narrows the publish accept set (a source over an absent platform object was published with a warning or unjudged, and is now refused 422), hence `no (narrowing)` and `Metadata-protocol: narrowed` (a value refused). Item 2 widens no published accept set. Under `--strict`, where a warning fails the run, a pack naming `id` is now accepted; the refusal it removes is one the published contract already denies, since `id` exists on every object: `packages/spec/src/data/injected-system-columns.ts` names it the primary key the driver provisions on every physical table (`PRIMARY_KEY_COLUMN = 'id'`, around lines 74-79), and `packages/lint/src/system-fields.ts` reports it from `injectedColumnsFor`, the existence helper (its note near line 100 says `injectedColumnDefsFor` leaves it out by design). Removing a refusal the contract already denies, with that text cited, reads as `no`; so the PR stays `Clause-②: no (narrowing)`, the narrowing being item 3 alone. The claim carried `Metadata-protocol: none`; the dispatch left the kind to the diff, and AGENTS.md's definition ("a value refused ... is `narrowed`") fits item 3. ## Tests - `packages/services/service-knowledge/src/__tests__/knowledge-source-admission.test.ts`: a `list` + `searchable: false` row in the refusal table; a pin that the not-served refusal names `does not grant \`list\`` and `include \`list\` with \`enable.searchable\` not false`, and never prescribes a `search` grant, for all three not-served shapes. - `packages/lint/src/validate-ai-context.test.ts`: `id` in `fields`, related `fields`, `where` and `orderBy` is clean, through the rule and through `runAuthoringRules('validate', …)`; a control misspelling is still reported; `body.field: 'id'` is not long text, never unknown. - `packages/lint/src/validate-knowledge-source.test.ts`: at the door with no scope, `sys_kb_article` (prefixed, unregistered) and `sys_user` (known platform) absent from the served collection are refused as errors; the CLI arms stay (warning, not judged); a control with the platform object served publishes clean. - `packages/spec/src/migrations/semantic-relevance.test.ts`: the enumeration table and its counts. Local runs at head `4cdbceedc2`, each under `scripts/pm/os-verify-lock.sh` (verdict `command-exit 0`): - `@objectstack/lint`: 244 test files, 9859 tests passed. - `@objectstack/service-knowledge`: 19 files, 648 tests passed. - `@objectstack/spec` `src/migrations`: 5 files, 207 tests passed. - Typecheck of lint, service-knowledge and spec: clean. - Ablation (at 80a26df, the same blobs): with the four fixed files restored from 8301509, lint 3 failed (the two `id` pins and the whole-collection platform pin), service-knowledge 1 failed (the wording pin), spec 2 failed (the enumeration table and CHAIN `absentTodos`); restored, all green. - Dogfood battery (the `(narrowing)` arm): 490 files passed, 3 skipped; 4144 tests passed, 68 skipped; no failures. <details><summary>Gates at head 4cdbcee</summary> - `dispatch-gates --commands`: 98 commands derived over the 11 paths, all 98 run, each exit 0 (two first answered "not built yet" inside the lock job, `migrate-meta-engine-guidance` vitest and `check:dual-build-cjs-loads`, and exit 0 once the dogfood closure build had built their packages). - `node scripts/check-adr-0087-registration.mjs --base origin/main`: exit 0, reading the marker as `not-required (already-registered)`. - `node scripts/pm/overlap-check.mjs`: VERDICT clean exit 0 against origin/main 5b8ca36, objectstack-ai#38107 and objectstack-ai#38060. </details> ## Acceptance notes - The ADR-0087 marker is now `not-required (already-registered knowledge-source-publish-refuses-missing-references-and-gated-objects)`: objectstack-ai#37971 registered the entry and this PR only edits it (commit 4cdbcee). - Full dogfood ran on the final head `4cdbceedc2` and is green (above). - Follow-up objectstack-ai#38041 carries N1 (a known platform name absent under a stated closure, including the question of `cloud_` and `ai_` names), N2 (the rule header and explain text on which platform arm applies where) and N6 (the stack/manifest wording at a write that names no package). ## Verification Read first: `packages/lint/src/validate-knowledge-source.ts` (the `whole` condition on the two platform rungs, the one behavioural narrowing), `packages/lint/src/validate-ai-context.ts` (`fieldExists` and the `body.field` branch), `packages/services/service-knowledge/src/knowledge-service.ts` (the `object-api-not-served` text). Two minutes: `pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-knowledge-source.test.ts src/validate-ai-context.test.ts` after building lint's closure: all green, including "against the whole collection, an absent platform name, prefixed or known, is refused as an unprefixed one is". 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP --------- Co-authored-by: Claude <noreply@anthropic.com>
repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP
Fixes #37307
Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: #37310 (amendment 7221575164: the five rule ids and their fixes)
Premise corrected: card #37307 item 3 ("follow the refuse-or-warn verdict the
ai_contextrow took") conflicts with ADR-0161 K4; K4 wins, so this rule isgatingat publish (refuses), not advisory. Seat 1 ruling on this PR: keep gating (seat record: #37307 comment 7221816104).Ruling-ref:
docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.mdK4 — "It defines no object, extends none, and is refused when the object or a named field does not exist (the lint andos validatechecks are row 4)." and "An object whose package is disabled, that the API exposure refuses for search, or that is a system object withoutenable.aiReadable, and a field the author may not query, each refuse the save with a coded refusal that names the object or the field. A packaged item meets the gates that need no principal inos validateand at publish (row 4)."维护者速读
os validate和发布知识源时,就能看到知识源写错的对象名、字段名,或指向不允许检索的对象(API 不开放检索、系统对象未开放 AI 读取),报错写明是哪个对象、哪个字段。What changes
ADR-0161 K4, row 4: a knowledge source is checked against the objects it names, by
os validate/build/lintand by the runtime publish gate, with one set of rule ids and messages.packages/lint/src/validate-knowledge-source.ts(new):validateKnowledgeSource, five rule ids, exported frompackages/lint/src/index.ts.knowledge-source-object-unknown— error.source.objectnames no object of the stack, of a package of its artifact (packages[]), or at the door of the objects the host serves. Under a stated package closure it is worded for the closure withclosureDependencyRemedy; at the door with no closure (the whole collection the host serves) it is an error too, and an empty served collection is no universe. On the CLI, while the manifest declares a dependency the artifact does not carry, it is a warning with the hedge (the build cannot see that package's objects; the publish judges the source against the closure, which holds them), theflow-trigger-unknown-objectsplit. The laddervalidateObjectReferencesuses: a known platform object (isPlatformProvidedObjectName) is not judged when the stack does not carry its definition; a platform-prefixed name no known package registers is a warning.knowledge-source-field-unknown— error. Asource.content/source.metadataFieldsmember names no field of the object: declared (the stack's own extensions folded in,objectsAsServed) or addressable without a declaration (injectedColumnsFor:id, which the driver provisions, and the injected system columns).knowledge-source-object-not-searchable— error.canServeApiOperation(enable, 'search')is false (the admission module's gate 2):enable.apiEnabled: false, anenable.apiMethodslist that does not grantlist(search derives from it;searchitself is a retired list value the parse strips), or one that grantslistbesideenable.searchable: false. With noapiMethodslist,searchable: falsedoes not refuse it. The fix prescribed: keepapiEnabledtrue and, where the object declaresapiMethods, includelistwithsearchablenot false; or index another object.knowledge-source-system-object-not-ai-readable— error. Asys_object for whichisAiReadExposedis false (the admission module's gate 3).knowledge-source-field-never-indexed— warning. A member names a credential-class field (isMaskedOnReadFieldType, the spec declaration the service's withheld set asks) or aninternal: truefield. The index never carries either (K5). This addition goes past the Execution row, under ADR-0078.authoring-rules.ts: one entry,tier: 'gating', all three commands,surfaces: CLI_AND_RUNTIME,runtimeTypes: ['knowledge_source'], with the package scope passed through, andwholeCollectionset at the door when no scope is stated.runtime-gate.ts:knowledge_source: 'knowledgeSources'.rule-explanations.ts: oneos explainentry for each of the five ids.packages/spec/src/migrations/entries/semantic/19.knowledge-source-publish-refuses-missing-references-and-gated-objects.ts: the upgrade-guide entry.check:adr-0087-registrationrequires it:Metadata-protocol: narrowedrefusesno-migration-prescriptionoutright. This file is outside the claim's declared file surface..changeset/37307-knowledge-source-references.md:@objectstack/lintminor,@objectstack/specpatch, BREAKING, registered disposition.The at-publish verdict: refuse, not advise, against the
ai_contextprecedentThe
ai_contextrow (validateAiContext) is advisory at publish. Its reason is that a pack still reads what resolves (ADR-0160 D1). This row departs from it, for three reasons. ADR-0161 K4 says an item "is refused when the object or a named field does not exist (the lint andos validatechecks are row 4)". It also says that "a packaged item meets the gates that need no principal inos validateand at publish". And each of the four errors defeats retrieval (a missing object leaves nothing to index, a missing field indexes no text for that member, a gated object is never searched for a caller the service judges), so the card's severity section (all four are errors) has the same reading. The rule is thereforegating: its errors refuse the publish (422 with the rule id, path, message and hint), and its warnings ride the 2xxadvisories. The card's sentence "follow the refuse-or-warn verdict theai_contextrow took" and its severity section cannot both hold. The ADR text decides between them, and the departure is stated in the rule header, the registry entry and the runtime-gate row.What this narrows at publish, measured on the code paths:
403(authoredKnowledgeSourceRefusal), before this gate runs. Where no author judgement is reached, the publish is now refused422: a host with no knowledge service, or a system-context write.canServeApiOperation(undefined)is true, and with no security service the field gate is masked-only).os validate/build/lintexit 1 on the same source.Declarations: the claim expected
Clause-②: no/Metadata-protocol: none. The measured reading isClause-②: yes (narrowing), because five new exports widen@objectstack/lint's public surface and a new refusal narrows the accept set, andMetadata-protocol: narrowed, because a requirement is tightened. So the lint bump isminorand the title carries!.Tests
packages/lint/src/validate-knowledge-source.test.ts(44 cases):runAuthoringRules('validate'): a missing object, content field or metadata field;apiEnabled: false; anapiMethodslist that does not grant search;searchable: false; asys_object withoutaiReadable. Each prints exactly one finding, with its rule id, severity, path, and the object or field named. A clean source prints none.internalwarnings.runRuntimeAuthoringRuleswithtype: 'knowledge_source'). Errors land inerrors(refused) and warnings inadvisories, and the face (rule, severity, where, message, hint) equals theos validateface.packageScope, with a non-vacuous control: declaring the dependency clears it.packages[], a known platform object skipped, an unknown platform-prefixed name as a warning,listgrantingsearch.metadataFields: ['id']andcontent: ['id']resolve (CLI and door);enable.searchable: falsewith noapiMethodslist is clean.packages[]does not carry, an error when every declared dependency is carried or none is declared; against the whole collection an error beside the same unseen dependency; an empty served collection at the door judges no object.explainRuleanswers all five ids.Readings (lint suite at 73441db; the head 3ea6b3c adds only the four docs transcript counts)
pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2(with spec and lint rebuilt, then linttypecheck): lock VERDICT command-exit 0, Test Files 243 passed (243), Tests 9836 passed (9836); typecheck exit 0 (check:test-typecheckincluded;tsc -p tsconfig.test.json --listFileslists the new test file, 1 hit).pnpm --filter @objectstack/spec exec vitest run src/migrationsafter the spec build: 5 files, 206 tests passed.scripts/ablation-replace.mjs, a trap restore, andgit diff HEADempty after restore. Every leg went red: the runtime-gate row removed (12 red); the object-unknown error made a warning (3); the API gate off (6); the system-object gate off (2); the withheld warning off (4); the injected-column merge off (1); the artifactpackages[]resolution off (1); the closure branch off (1); the platform-object skip off (1); the stack extensions not folded (1).objectstack validateinexamples/app-showcaseexits 0 with zeroknowledge-source-*findings, so the shipped corpus is clean. The same command withcontentmutated to['title', 'notez', 'secret_note']exits 1 with twoknowledge-source-field-unknownfindings atknowledgeSources[0].source.content[1]and[2], and the file is restored.objectstack explain knowledge-source-object-unknownandobjectstack explain knowledge-source-system-object-not-ai-readableboth answer.pnpm --filter @objectstack/dogfood test, lock VERDICT command-exit 1, head 73441db): Test Files 14 failed / 476 passed / 3 skipped (493); Tests 20 failed / 4113 passed / 79 skipped (4212). The failures were 17Test timed out in 5000ms, 2 hook timeouts, the cascadingalready has a live bootStack kernelerrors, and 1 assertion inside a timed-out file. None names aknowledge-source-*rule. The 14 failed files re-run alone on the same head: 14 passed (14), 164 passed (164), VERDICT command-exit 0. Read as shared-box contention, not this diff.Rework readings (review 7221784031: M1, S1, S2, N1, N2; head 8301509)
turbo run build --filter='@objectstack/lint...'5/5 tasks; the lint suite Test Files 244 passed (244), Tests 9856 passed (9856); specsrc/migrations5 files, 206 tests passed;check:docs-transcript-driftexit 0 against the built registry (4 declared values, 87).pnpm --filter @objectstack/lint typecheckexit 0 (check:test-typecheckincluded).scripts/ablation-replace.mjswith a trap restore andgit diff HEADempty after: theinjectedColumnsForexistence check off (2 red,idamong them); the CLI dependency hedge off (2 red); the whole-collection reading off in the rule (1 red); the registry'swholeCollectionpass set false (1 red); the empty-universe skip off (2 red).check:docs-transcript-driftexit 0 (87; feat(lint): warn when a select option colour renders neutral on the option badge #37986 still open),check-adr-0087-registrationexit 0,check:nul-bytesexit 0,overlap-checkVERDICT clean.Derived gates (dispatch-gates --commands, then --ran)
check:docs-transcript-driftwas red (four CLI transcripts printed 85 author-time rules, and this rule makes 86); the four counts were fixed in 3ea6b3c, and the gate now exits 0 (4 declared values equal the derived count).check:exported-anyreturned exit 3 while the dogfood build was rebuildingpackages/spec/dist; re-run after that build, it exits 0.check:dual-build-cjs-loadsreturned exit 3 because thestudio,client-reactandscenariosdist are not built here: NOT MEASURED, CI.check:type-check-debtreturned exit 3 on a lock queue-timeout (another seat's hold): NOT MEASURED, CI.check:skill-examplesreturned exit 3 because theclient-reactdist is not built: NOT MEASURED, CI.check:api-surfaceandcheck:docsexit 0 after the spec rebuild.overlap-checkVERDICT clean before every push; fix(lint,core)!: refuse a lookup dependsOn filter key naming a formula of its target; an import lookup no scoped read answered is never out of scope #37910 and fix(spec)!: a book audience names one gate, and a gated book claims its pages by name #37870 merge cleanly. fix(spec)!: a book audience names one gate, and a gated book claims its pages by name #37870 bumps the same four transcript counts, so whichever lands second needs 87.Acceptance notes
apiMethods: ['get', 'list']grantssearch(listgrants it unlessenable.searchableis false). The save-door refusal text inservice-knowledge(admitAuthoredSource,object-api-not-served) reads "itsenable.apiMethodslist does not includesearch". Forsearchable: falsewithlistgranted, that wording names the wrong cause. Wording only; the PM files it as a card with the S2 wording.sys_user) is not judged, because its declaration is not in hand. The publish door judges it against the live definition.Verification
Read first, by risk:
packages/lint/src/authoring-rules.ts, thevalidateKnowledgeSourceentry (tier: 'gating'on the publish door is the narrowing).packages/lint/src/validate-knowledge-source.ts, the object ladder and the two gates..changeset/37307-knowledge-source-references.md.Two-minute check: in
examples/app-showcase/src/ai/task-notes.knowledge-source.ts, changecontent: ['title', 'notes']to['title', 'notez']and runpnpm exec objectstack validateinexamples/app-showcase. Expected: exit 1 andrule: knowledge-source-field-unknown at knowledgeSources[0].source.content[1]. Unchanged, the showcase validates with zeroknowledge-source-*findings.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP