Repository navigation
docs(skills): objectstack-ai teaches knowledge_source as metadata; knowledge_source gets a create seed - #38053
Draft
objectstack-fleet[bot] wants to merge 6 commits into
Draft
objectstack-fleet[bot] wants to merge 6 commits into
objectstack-fleet[bot] wants to merge 6 commits into
Conversation
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
… changeset Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
…h the save, not the served schema Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
… a mention of it Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
…ds its source Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP
Fixes #37310
Clause-②: no
Metadata-protocol: none
维护者速读
name、逐个列出要索引的字段、可以不写存储;MCP 新建知识源时直接拿到一份能通过校验的起始模板。What changes
skills/objectstack-ai/SKILL.md, § Knowledge Sources (RAG) (ADR-0161 K4, K5, K6 item 6; rows 3a and 3b as merged):knowledge_sourceitem: shipped in a package (knowledgeSources,*.knowledge-source.ts/.yml) or authored in Studio or over MCP.KnowledgeServicePlugin({ sources })andregisterSourceare a second door for the same schema, and one name is one source (K4 point 3). An item mounts the knowledge service and its store with norequires: ['knowledge'](knowledge_source: adapter becomes optional (the deployment's store), and a knowledge_source item mounts the knowledge service #37306, PR feat(knowledge): a knowledge source needs no adapter and no requires entry; it binds to the deployment's store #38026).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;wherekeeps drafts out) now lives in thecontentandwhererows, and sayscontent.manage_knowledge_sourcesbesidemanage_metadataand passes save-time admission.id→name,contentFields→content,embedding,vectorStore,adapterConfig,refresh.cron, and thefile/httparms with their four keys;os migrate meta --from 18for a stack, by hand for a registration in code.adapter: 'pgvector'(the deployment's store) and its comments; it is otherwise row 3a's block.split:strategyis required oncesplitis written (recursiveonly whensplitis omitted); the adapter-list aside is gone.topKis asearch_knowledgeargument; rerank and hybrid weights are options of the store's plugin.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 #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). #37971 is still open, so that part follows on this branch after it lands; the PR stays draft until then.skills/objectstack-ai/evals/skills-tools-knowledge.json. Case 3 (kb_article on PostgreSQL) and case 9 (policy_doc,markdownsplit) now expectnameandcontent, and forbid a writtencontentFields:key; case 3 also forbids a written wildcard (['*'],,['*'] }),embedding:andvectorStore:, and itstopKtoken becomestopK:(the key written) because the skill now namestopKas a search argument. 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 writtencontentFields:or wildcard.packages/spec/src/kernel/metadata-create-seeds.ts. Aknowledge_sourcecreate seed:{ name: 'new_knowledge_source', label: 'New Knowledge Source', source: { kind: 'object', object: 'example_object', content: ['example_field'] } }, noadapter. K5 makescontentnon-empty, so the seed carries a placeholder field name, like the placeholder object every seed here carries.knowledge_sourceleavesKNOWN_UNSEEDED; a new pin asserts the seed's list is explicit, names no adapter, and that the same seed with['*']is refused.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_itemswithcontract: trueforknowledge_sourceanswers the seedgetMetadataCreateSeedgives;contractPath/properties/source/properties/contentserves the content rule (minItems: 1,minLength: 1, a pattern that refuses*and admitsbody); the served schema carries noidorcontentFieldstombstone; the seed with one object and one field filled saves as a draft; the same item withcontent: ['*'], with anid, or withcontentFieldsis refused422 INVALID_METADATA, the last two naming their tombstone's prescription ("usename", "usecontent"); nothing else is written.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.kindHygiene column (folded into two rows), the example's four comments restating table rows and itsrefresh: { 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.Tests
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.Locked round at 3407f7f (VERDICT command-exit 0, held 365s)
pnpm turbo run build --filter='@objectstack/runtime^...' --concurrency=2: exit 0,Tasks: 41 successful, 41 total.pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/kernel/metadata-create-seeds.test.ts: exit 0,Tests 20 passed (20). Theknowledge_sourceseed is spec-valid, and the new pin passes.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 in01cf7515c2to assert absence plus the save refusal. NOT MEASURED locally after that rewrite (the second locked round never acquired); CITest Coreruns 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 --noEmitis clean.check:test-typechecknames 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.tsis not among them. They are read here as the closure build's gaps (onlyruntime^...was built) and not as this diff's; CITypeScript Type Checkdecides.pnpm --filter @objectstack/spec run check:skill-examples: exit 3, PREREQUISITE NOT MET (the@objectstack/client-reactdist is outside the built closure). NOT MEASURED; CI runs it.Unlocked gates (35 derived families, each exit 0, at 3407f7f; the ratchet and nul-bytes re-run at 19f3e11)
node scripts/check-skills-token-ratchet.mjs: exit 0,skills/objectstack-ai/SKILL.md is 6639 tokens (ceiling 6639; headroom 0); with--self-testexit 0.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, andpnpm 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.check-skill-frame-freshnessexit 0.check-dev-prereqsexit 1 ("69 of 110 workspace packages … not on disk"), which is the closure-only build and not a finding.Eval runner and the ablation (`skill-evals`, claude-code-cli 2.1.332, oauth login, served claude-opus-5-5)
Cases 3, 9 and 13 of
objectstack-ai/skills-tools-knowledge, both arms, one repeat each:main'sSKILL.md(8d34c4404f, hash88a20cb583), new cases (ablation)contentFields:written;name:,content:missingcontentFields:written;content:missingcontentFields:,['*'],andid: 'faqwritten; no egress reasonThe ablation restored
main'sSKILL.mdinto the working tree only (git restore --source=8d34c4404f,git hash-object=88a20cb583). The run ran, and thenHEAD's file came back (fc845724acboth on disk and atHEAD). 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.Acceptance notes
git grep -n -E "contentFields|'\*'|adapter: 'ragflow'" skills/objectstack-ai) returns eight lines. InSKILL.md, three: thecontentrow ("'*'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 themust_not_containlists of cases 3, 9 and 13, which forbid a writtencontentFields:and a written wildcard (['*'],,['*'] }). The card itself asks the eval to fail oncontentFieldsor'*', 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: Retire @objectstack/knowledge-ragflow: package, settings option, docs and skill mentions #37004 already removed it.itinside the existing real-protocoldescribeofmcp-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.retiredKey()tombstone ({ not: {} }; see the note inpackages/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.VERDICT overlap exit 1.origin/main, chore: version packages (next) #38032 and feat(metadata-core)!: a knowledge source is saved only on a deployment that mounts the knowledge service #38013 merge cleanly. docs(skills): objectstack-data and objectstack-automation SKILL.md become routers #36158 (a draft last updated 2026-11-25) conflicts inscripts/check-skills-token-ratchet.mjs. That conflict is docs(skills): objectstack-data and objectstack-automation SKILL.md become routers #36158's own againstorigin/main:git merge-tree origin/mainwith docs(skills): objectstack-data and objectstack-automation SKILL.md become routers #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:
skills/objectstack-ai/SKILL.md§ Knowledge Sources (RAG): theadapterandcontentrows and the retired-keys paragraph.packages/spec/src/kernel/metadata-create-seeds.ts: theknowledge_sourceseed.packages/runtime/src/domains/mcp-authoring.test.ts: the new contract case.Two-minute check:
node scripts/check-skills-token-ratchet.mjs. Expectskills/objectstack-ai/SKILL.md is 6639 tokens (ceiling 6639; headroom 0).Readings:
skills/objectstack-ai/SKILL.md464 → 469 lines, 26462 → 26581 bytes (6609 → 6639 priced tokens). Every publishedSKILL.mdsummed: 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