Skip to content

docs(skills): objectstack-ai names the os validate rules for a knowledge_source, each with its fix - #38091

Merged
os-zhuang merged 1 commit into
mainfrom
claude/area-o1C-37310-b
Nov 28, 2026
Merged

os-zhuang merged 1 commit into
mainfrom
claude/area-o1C-37310-b

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP
Part of #37310
Clause-②: no
Metadata-protocol: none

维护者速读

  • 读 AI 技能包的开发者和 AI 助手,在“知识源”一节里新看到一张清单:校验和发布时会拒收知识源的五条规则,每条都配了改法;之前这一节没有这张清单。
  • 属于“AI 知识检索(RAG)元数据化”这一组工作:上一轮的规则检查已经合并,这次补上教学文字,让作者在校验报错前就知道怎么写对。
  • 出错只影响文档:写错的话,作者会照着错误的改法去改,但平台照样拒收,不会有坏数据进去;改动只有文字和预算行,可以直接撤回。
  • 无。

What changes

skills/objectstack-ai/SKILL.md § Knowledge Sources (RAG) now lists what os validate and publish report for a knowledge_source, by rule id, with the fix for each. I took the wording from the rules' own messages and hints in packages/lint/src/validate-knowledge-source.ts on main, not from the card:

  • knowledge-source-object-unknown: source.object is no object of the stack or its packages. On the CLI it is a warning while the manifest declares a dependency that packages[] does not carry. Fix: name a defined object, or declare and install its package.
  • knowledge-source-field-unknown: a content / metadataFields member is no field of the object; id and the injected system columns resolve. Fix: correct the spelling, or remove the member.
  • knowledge-source-object-not-searchable: the API does not serve the object for search. Fix: leave enable.apiEnabled on; an enable.apiMethods list must grant list, with enable.searchable not false.
  • knowledge-source-system-object-not-ai-readable: a sys_ object without enable.aiReadable: true. Fix: index a business object.
  • knowledge-source-field-never-indexed (warning): a credential-class or internal: true member, which the index never carries. Fix: remove it.

The section says that an error refuses the publish.

Token ratchet. Raise path: the standing maintainer ruling 2026-10-27 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B).

Paid down first: four restatements in the same section.

  • The source.content row's "credential-class and internal fields are never indexed". The -field-never-indexed line now says it.
  • Its "embedding is egress". The egress paragraph says it.
  • The name row's "with the package, its identity". The intro says it.
  • The example's // no adapter: the deployment's store comment. The adapter row says it.

Then the row moves 6695 -> 6893 (+198), by the measured remainder only:

  • SKILL.md is 26806 -> 27596 bytes, and the priced text is 27569 bytes (the 27-byte stamp line is excluded).
  • ceil(27569 / 4) = 6893.

Changeset: .changeset/37310-skill-knowledge-source-validate-rules.md, '@objectstack/skills': patch.

Skill size readings (skills/**).

  • Changed file skills/objectstack-ai/SKILL.md: 471 -> 487 lines, 26806 -> 27596 bytes, 6695 -> 6893 tokens.
  • Whole bundle, the sum of all 14 SKILL.md files: 4936 -> 4952 lines, 261710 -> 262500 bytes.

Tests

All readings are at 36261634ad.

  • os validate on the section's example: exit 0, "valid": true, zero knowledge-source findings.
    • The fixture is a throwaway stack of namespace kb, with object kb_article (title, body, category, published, sharingModel: 'private') and the example's source verbatim.
    • It ran from an isolated directory under examples/app-todo, then the directory was deleted.
  • Positive control: the same stack with enable: { apiEnabled: false }, content ['title', 'bodyy', 'secret'] and a Field.secret member. Exit 1, with:
    • knowledge-source-object-not-searchable (error, source.object);
    • knowledge-source-field-unknown (error, content[1]);
    • knowledge-source-field-never-indexed (warning, content[2]).
  • Eval case 14 (objectstack-ai/skills-tools-knowledge#14, an app that ships no source and authors one at run time), 1 rep per arm:
    • with-skill pass: the answer leads with requires: ['knowledge'];
    • no-skill fail: the model said it had nothing to go on.

Acceptance notes

Verification

Skill gates under the verify lock (VERDICT command-exit 0)
  • pnpm turbo run build --filter='@objectstack/cli...' --concurrency=2: exit 0
  • check:skill-docs: exit 0, "Skill docs in sync"
  • check:skill-refs: exit 0, "10 generated files in sync with packages/spec"
  • check:yaml-examples: exit 0, "19 tagged YAML example(s) across 1 file(s) validate"
  • node scripts/check-skills-token-ratchet.mjs: exit 0, "61 authored bundle file(s) within their ceilings"
Local subset of the derived gate families (28, each exit 0)

dispatch-gates --commands --repo objectstack-ai/objectstack derives 67 families at 36261634ad. I ran 28 of them locally, each exit 0: the ratchet with its self-test, check:nul-bytes, check-empty-changeset, check-adr-0087-registration, check-changeset-no-major, check:doc-authoring, check:skill-links, check:skill-identifier-liveness, check:skill-compatibility, check:skill-frame-sync, check:published-files and the rest of that set. CI runs the full set.

Read first.

  1. skills/objectstack-ai/SKILL.md, the new rule list just above the example. Risk: a fix that departs from the rule's hint.
  2. scripts/check-skills-token-ratchet.mjs, the 6695 -> 6893 comment. Check its arithmetic.

Two-minute check. Run node scripts/check-skills-token-ratchet.mjs | grep objectstack-ai/SKILL. Expect 6893 / 6893.


Generated by Claude Code

… with its fix

The knowledge source section lists the five rules os validate and publish
report for a source: an unknown object, an unknown field, an object the API
does not serve for search, a system object without enable.aiReadable, and
the warning for a credential-class or internal member the index never
carries. Each comes with its fix, as the rule's own message and hint give it.

Restatements are paid down first: the content row's never-indexed clause
and egress reason, the name row's identity clause, and the example's
adapter comment. The token ratchet row moves 6695 -> 6893 by the measured
remainder.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3

Contract-review-claim: session_016WV4czzx9dtSEm3jWWL9c3 · 3626163 · 2026-11-28T02:09Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 36261634ade4ed2cb6c68c3bc534588204068cc2
Local-runs: none
Scope: skills/objectstack-ai/SKILL.md + scripts/check-skills-token-ratchet.mjs
Security-touching: yes

Read: card #37310 (body and its seven comments, the amendments 7221575164 and 7224082428 and the dev report 7232154829 among them), PR #38091 (body, its three-file list, its one comment), the net diff against merge base f72f335393 (which is main and carries #37971 and #38053), and the 45 check-runs on the head. Security-touching is yes: the new lines teach which objects the API serves for search, the AI-read opt-in of system objects (enable.aiReadable), and that credential-class and internal fields never reach the index. No security weakness was found.

① Derived judgments

  • Gate verdicts: green, read complete. 45 check-runs: 29 success, 16 skipped, none failed, cancelled or pending. A first read two minutes after the push showed 14 still in progress; this is the read after every run completed. Test Core, Test UI, Lint · docs & code guards, Lint · repo & tooling gates, Lint · PM dispatch-gates, Check Changeset, Governed Surface Queue Guard and PR-body guards are success.
  • Accept-set: unchanged. Right. No file under packages/ is in the diff.
  • Published surface: @objectstack/skills only. Right.
  • Token ratchet 6695 to 6893: the arithmetic reproduces, and letter B covers it. The file is 26806 bytes at the merge base and 27596 at the head; less the 27-byte stamp line that is 27569 priced bytes, and 27569 / 4 = 6892.25, so the ceiling is 6893 and the row sits at the measurement. The row on main is 6695, so the move is +198. The gate's recognised raise path asks three things, and all three hold: deletion of restatement in the same file is in the diff (four clauses, listed under ④), the PR body quotes the standing ruling verbatim with record 6513306068 and letter B, and the row moves by the measured remainder, pinned at the measurement. The path sets no upper bound on the remainder. For the reader who lands this: the deletions pay about 180 bytes against about 970 added, so nearly all of the +198 is new text. That text was ordered onto this card by the seat's amendment 7221575164 (five rule ids, each with its fix), and it is five list items of two or three lines each; I found no restatement left in the section that could have paid more.

② Semver level

'@objectstack/skills': patch matches what the diff publishes: skill text only. The changeset carries both declaration lines and they equal the PR body's.

Clause-②: no. Right: the rules themselves landed with #37971; this diff narrows nothing.
Metadata-protocol: none. Right.

③ Boundary flags

  • open_questions: empty in the dev report. Nothing to answer.
  • Landing keyword: right. The PR body reads Part of #37310 and names what is left: the create seed, which waits for knowledge_source: a Studio form to create and edit a knowledge source (object, content fields, metadata fields, where, split) #37309. knowledge_source is still on KNOWN_UNSEEDED on main. The keyword must stay Part of while the seed is open.
  • Amendment acceptance (7221575164, with 7224082428): met on this head. Line one, the section names the five ids: each of the five appears once in SKILL.md, spelled as the validator's exported constants. Line two, the example passes os validate with zero knowledge-source findings: the dev report records exit 0 on a throwaway stack holding the example verbatim, with a positive control that raised three of the rules. That is the dev's reading and was not re-run here; it agrees with the code, since title, body and category are declared in the fixture, owner_id resolves as an injected system column under the default ownership (injectedColumnsFor), and where is not judged by this rule. Amendment 2's three points are all taught: the CLI warning for object-unknown, list with searchable not false for object-not-searchable, and id with the injected columns for field-unknown. With this PR the card's teaching half is complete; the card stays open for the seed only.
  • Dev deviation, overlap-check exit 1 from draft docs(skills): objectstack-data and objectstack-automation SKILL.md become routers #36158: the same standing conflict of that draft against main in the ratchet file; not this branch's.
  • SQL push-down: not applicable; no query is added.

④ Design judgment

skills/objectstack-ai/SKILL.md, each new sentence against packages/lint/src/validate-knowledge-source.ts and its registration in packages/lint/src/authoring-rules.ts on main.

  • "os validate and publish check each source; an error refuses the publish." True: the rule is registered tier: 'gating', commands: ALL, surfaces: CLI_AND_RUNTIME, runtimeTypes: ['knowledge_source']; its registration note says an error refuses the publish (422) and warnings ride the advisories.
  • knowledge-source-object-unknown. The id matches KNOWLEDGE_SOURCE_OBJECT_UNKNOWN. "No object of the stack or its packages" is the lookup (the stack's objects as served, then each packages[] body). "On the CLI a warning while the manifest declares a dependency packages[] lacks" is the unseen.length arm, which is computed only off the door. "Name one, or declare and install its package" is the error arm's hint. Severity as taught: error, with the stated CLI warning.
  • knowledge-source-field-unknown. Id matches. Judged on content and metadataFields, as taught. "id and the injected system columns resolve" is the addressable.has(member) return. "Fix the spelling, or remove it" is the hint. Severity error, as taught.
  • knowledge-source-object-not-searchable. Id matches. "The API does not serve the object for search" is canServeApiOperation(enable, 'search'). The fix (leave enable.apiEnabled on; an enable.apiMethods list must grant list, with enable.searchable not false) is the hint and the header's reading; it does not say searchable: false alone refuses, which would be false. Severity error.
  • knowledge-source-system-object-not-ai-readable. Id matches. "A sys_ object without enable.aiReadable: true" is isSystemObjectName with isAiReadExposed. "Index a business object" is the first half of the hint. Severity error.
  • knowledge-source-field-never-indexed (warning). Id matches, severity warning as taught. "A credential-class or internal: true member, which the index never carries" is the condition and the message. "Remove it" is the hint.
  • No rule id is missing, renamed or taught at another severity: the validator exports exactly these five.

The four deletions leave nothing untaught:

  • the content row's "credential-class and internal fields are never indexed" is carried by the field-never-indexed line ("which the index never carries");
  • its "embedding is egress" is carried by the paragraph headed "A source is an egress and cost decision", and the row keeps the consequence ("it would also send fields added later");
  • the name row's "with the package, its identity" is carried by the intro ("A source is identified by its package and name");
  • the example's "no adapter: the deployment's store" comment is carried by the adapter row.

The checked example is otherwise unchanged and Lint · docs & code guards is green on it.

scripts/check-skills-token-ratchet.mjs (implementing file). The new comment block agrees with the gate's contract sentence by sentence: what was added, the four deletions with the home each keeps, the ruling and record, the byte arithmetic, and a reproduction line that gives 6893.

Nits, none of which moves correctness or the contract:

  • N1 — object-unknown has a third outcome the skill does not name: a platform-prefixed name that no known package registers is a warning, on the CLI and at a publish with no package scope. An author who meets it reads the validator's own hint, so nothing is taught wrongly.
  • N2 — the system-object-not-ai-readable fix gives one of the hint's two remedies; the other (a system object whose definition declares enable.aiReadable: true) is implied by the condition.
  • N3 — eval cases 3, 9 and 13 were not re-run on this text (case 14 was). The deleted "embedding is egress" clause is the reason case 13's reference answer gives; the egress paragraph still teaches it and the rubric's any-of group also accepts "refused". One run of case 13 before landing would confirm.
  • N4 — the trailing comment on the ratchet row still describes two older moves (carried from the earlier records).

No must-fix, no should-fix.

Not reviewed (lane seat's ACCEPT at TIER_DEFAULT): .changeset/37310-skill-knowledge-source-validate-rules.md.

Implemented-by: claude/area-o1C-37310-b
Reviewed-by: session_016WV4czzx9dtSEm3jWWL9c3

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3

L1 verdict (L1-a): ACCEPT at head 36261634ade4ed2cb6c68c3bc534588204068cc2 (Part of #37310). Full read.

Review summary

Contract review. I adopt record 7232385536 at this head. It is PASS at the contract tier, and verify-review-tier is PASS. It found no must-fix and no should-fix, and four nits.

  • Rule ids. The skill teaches five knowledge_source rule ids. Each matches an exported constant in packages/lint/src/validate-knowledge-source.ts on main, and none is missing.
    • Severities match: four errors and one warning, with the CLI-warning case of object-unknown taught.
    • Each fix is the rule's own hint.
    • "An error refuses the publish" is true, because the rule is gating.
  • Deletions. The four deleted restatements lose no fact; each fact keeps a home in the section.
  • Ratchet. The arithmetic reproduces 6893 under record 6513306068 B.
  • Amendment. The acceptance lines of amendment 7221575164 are met.

Landing keyword. Part of #37310 is right while the seed, which waits on #37309, stays open. The card keeps pm:dispatched until someone removes it by hand.

Gates. All 45 check-runs on the head are done: 29 success, 16 skipped, 0 failed. mergeable_state is clean.

A conflict to plan for. #38013 now owes an edit to this same section, and the same ratchet row, after main brought in #38053 (REWORK 7232242349). Whichever of the two lands second must merge main and re-measure the ratchet row. If that changes skill text, it needs a delta read.

Nits, optional:

  • N1: the third outcome of object-unknown is not taught.
  • N2: one of the two remedies of system-object-not-ai-readable is left out.
  • N3: evals 3, 9 and 13 were not re-run on this text.
  • N4: the trailing comment on the ratchet row is stale.

Next: this touches skills/**, so it is Tier H and goes to the seat for approval. The PR is still a draft.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs

Seat record · 2026-11-28T02:29Z · PR #38091 (Part of #37310) · head 36261634ade4ed2cb6c68c3bc534588204068cc2 · governed skills/** — Tier H

维护者速读

Seat opinion: land.

席位核对 — ACCEPT · repo:objectstack#1 · head 36261634ad

  1. Shape. Draft, base main, 3 files (+47/−4): skills/objectstack-ai/SKILL.md § Knowledge Sources (the five knowledge_source validate rule ids, each with its fix), scripts/check-skills-token-ratchet.mjs (row 6695 → 6893), .changeset/37310-skill-knowledge-source-validate-rules.md (@objectstack/skills patch). Body: Part of #37310, Clause-②: no, Metadata-protocol: none. skills/** ⇒ Tier H.
  2. Premise measured. Per the records: the five ids and their fixes match the validator's rules and hints. The ratchet move reproduces under ruling 6513306068 B. Card part 2 acceptance met; the create seed waits on knowledge_source: a Studio form to create and edit a knowledge source (object, content fields, metadata fields, where, split) #37309.
  3. Gates (check-runs at this head). 29 success, 16 skipped, 0 failed. mergeable clean.
  4. Accepted deviations. N3: eval cases 3, 9 and 13 were not re-run on this text (case 14 was: with-skill 1/1, no-skill 0/1). The seat asks for one run of case 13 before landing, since the removed clause was that case's reference reason. N1, N2 and N4 are optional and not owed.
  5. Out of scope → where it went. The create seed waits on knowledge_source: a Studio form to create and edit a knowledge source (object, content fields, metadata fields, where, split) #37309; skills/objectstack-ai and the MCP authoring contract teach knowledge_source as metadata: name, an explicit content list, no wildcard, the retired keys, and a create seed #37310 stays pm:dispatched. feat(metadata-core)!: a knowledge source is saved only on a deployment that mounts the knowledge service #38013's rework edits the same section and ratchet row and lands after this one, merging main and re-measuring. Security-touching: no: skill text and a token ratchet only.
  6. Landing terms. L1-a ACCEPT 7232393663 + contract review PASS 7232385536 (CONTRACT_REVIEW_TIER, same head) ⇒ ②③ in one --handoff stroke. After an authorised APPROVED and the case 13 run, seat 1 lands it (maintainer's seat-thread line 2026-11-26T13:33Z 「审批人批准后的 Tier H PR 你可以自主落地」). A head move other than a clean main merge withdraws the hand-off.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4cwoXEE1amuRAGHdPBs

Approval request · governed skills/** (Tier H) · PR #38091 (Part of #37310) · head 36261634ade4ed2cb6c68c3bc534588204068cc2

@os-zhuang: skills/objectstack-ai § Knowledge Sources now names the five knowledge_source validate rule ids, each with its fix. The token ratchet row moves 6695 → 6893 under ruling 6513306068 B. @objectstack/skills patch, no runtime change. Records on this head:

  • L1-a ACCEPT 7232393663
  • contract review PASS 7232385536 (CONTRACT_REVIEW_TIER)
  • seat record ACCEPT above

Every check is green or expected-skip. An APPROVED review on this head lets seat repo:objectstack#1 ready and land it; nothing else is asked.

@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 Nov 28, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 28, 2026 02:31
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit 9726bd8 Nov 28, 2026
51 checks passed
@os-zhuang
os-zhuang deleted the claude/area-o1C-37310-b branch November 28, 2026 02:51
@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 Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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