Skip to content

docs(knowledge): the docs and the AI skill state the document unit (documentBy) and the held knowledge service - #38855

Merged
os-zhuang merged 3 commits into
mainfrom
claude/issue-38538-documentby-docs-skill
Dec 1, 2026
Merged

os-zhuang merged 3 commits into
mainfrom
claude/issue-38538-documentby-docs-skill

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

Fixes #38538
Fixes #38475
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:用户无感。写给开发者和 AI 的知识库说明补了两段:一是应用自己把长文档拆成一条条子记录时该怎么配,搜索结果按上级文档去重和计数;二是知识库装上了但还没配好向量模型时,知识源只是挂着、搜不了,配好并重启后才生效。
  • 为什么做:这两段都是已上线功能欠下的说明文字,分属知识库专题里的「按上级文档计数」和「装上不等于启用」两项;你已裁定它们不算新任务、现在补齐。
  • 出错会怎样:只改说明文字,产品行为不变。最坏情况是 AI 照新说明把某个配置写错,保存时会被拒绝并告诉它怎么改;这次改动可以直接撤回。
  • 要你做什么:技能说明的文字需要你审批后才能合并。

What changes

Two cards, one commit each. Text only: no schema, no runtime code, no generated page.

Card 38538, the document unit (de04044835). The two knowledge pages and the AI skill did not name source.documentBy. They now state the rule in one voice: an app that cuts its own passages writes each one as a child record and indexes the child object with split: { strategy: 'whole' }; the index stays one record = one document; documentBy is the unit a record-level search counts in topK and groups by when no groupBy is sent.

  • content/docs/ai/knowledge-rag.mdx: a paragraph under "Retrieving knowledge"; the topK and granularity rows of the search_knowledge argument table; a new subsection, "An app that cuts its own passages", with the four rules (child records with whole, the index unchanged, the counted and grouped unit, the single parent link and where it is refused). The same-record recipe above it now points at the subsection for an app that already keeps one row per unit.
  • content/docs/protocol/knowledge.mdx: the key in section 3.1 (what it is, what it leaves unchanged, what it must be and where it is refused); the default grouping in "Records, not passages" (one hit per parent, a record with no parent is its own hit, the group is keyed with the source, groupValue on a tool hit, an explicit groupBy takes its place); one pointer in section 3.5.
  • skills/objectstack-ai/SKILL.md: the key's row in the source table, and one rule beside the corpus rules.

Card 38475, mounted is not enabled (ac64b997eb). The skill said "A shipped item mounts the knowledge service and its store", which read as "shipped, so searchable". The sentence now reads "A shipped item mounts the knowledge service, which does not enable it" ("and its store" dropped after review, ff79a0e739) and says the service is held until an embedder provider is saved, the deployment's store is mounted and the server restarts; that held sources are listed and never built or searched; that search_knowledge is not offered; that a search or a run-time save answers 503 SERVICE_UNAVAILABLE naming the missing half, with nothing written; that os knowledge status prints the state and why, and os knowledge rebuild exits 1 with it. The remedy for an app that ships no source gains the embedder save and its restart. No example is added.

The wording was read from the code on main at 13a0d3fedf, not from the cards: heldSourcesText and heldSourceSaveText (knowledge-service-top-level.ts), heldIndexReading (knowledge-build.ts), the rebuild and index_status actions (knowledge-build-actions.ts), describeEnablement and the two CLI commands (packages/cli/src/commands/knowledge/), and noKnowledgeServiceRefusal (knowledge-source-save-admission.ts).

Two files of the card's list do not change. The search_knowledge description (knowledge-tools.ts) and the TSDoc of KnowledgeSearchOptions.granularity / topK (knowledge-service.ts in the spec contracts) already say one hit per parent for a documentBy source on main: that text landed with the key itself. The Studio form row and its test are on main too.

Skills budget

Standing ruling, quoted: 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B). Restating text of the same file is deleted first, and the token row moves by the measured remainder, pinned at the measurement.

Reading Before (13a0d3fedf) After (ff79a0e739) Delta
skills/objectstack-ai/SKILL.md, lines 507 518 +11
skills/objectstack-ai/SKILL.md, bytes 29014 30020 +1006
skills/objectstack-ai/SKILL.md, tokens (stamp line excluded) 7247 7499 +252
Every SKILL.md of the catalog, lines (14 files) 2769 2780 +11
Authored bundle, tokens 189821 190073 +252
Whole shipped tree, tokens 295693 295945 +252

Deleted first, all in the same file: the maxChars sentence's "the longest passage" (the setting it overrides is named Longest passage in the same sentence); the "(KnowledgeSourceSchema in @objectstack/spec/ai)" aside (the section's example imports that schema from that path); the second "SERVICE_UNAVAILABLE, nothing written" (the held refusal beside it says both); "to the stack" and "the server" of the remedy. The row in scripts/check-skills-token-ratchet.mjs moves 7247 to 7401 in the first commit 7401 to 7489 in the second, and 7489 to 7499 in the review fix (ff79a0e739: the documentBy row now ends "Setting it rebuilds nothing; newly listing the field rebuilds the source in place", and "and its store" is the deletion shown), each with its arithmetic in the row's history.

The dispatch's budget for the two cards together is at most +12 lines; the file moves +11.

Tests

No behaviour changes, so no test is added or changed and no ablation applies. No test or script pins the edited sentences (searched: the skill path, the two page paths and the removed phrases, across *.test.ts and scripts/).

Acceptance notes

  • File surface, one path outside the claim's list. scripts/check-skills-token-ratchet.mjs is edited: one row and its two history notes. The gate reds a row that sits above or below its measurement, so any change to the skill's bytes moves that row in the same PR; the standing ruling the dispatch names is the path that moves it. It is declared here so the seat can add the path to the claim.
  • "Counted" is stated as far as this repository delivers it. The pages and the skill say topK counts parents for a documentBy source. Whether a hosted plan's document quota counts parents is the cloud repository's half of the topic; it could not be read from this session, so nothing here states it.
  • One snippet in the guide, none in the skill. The new guide subsection shows a six-line source block, in the style of the split and ordering sections beside it. The "no new example" rule of card 38475 is about the skill, and the skill gains none.
  • The skill does not list the rule id knowledge-source-document-by-not-parent-link. The row says any other field is refused, and the refusal names the fix; the two lines the bullet would cost are outside the line budget. The guide and the protocol page name the rule.
  • Noted, not changed (outside the file surface). The TSDoc of documentBy in packages/spec/src/ai/knowledge-source.zod.ts still says a source registered in code or installed with a package "meets no save, so that rule does not judge it yet"; since the lint rule above landed, os validate and the publish gate judge it. Prose drift only: the .describe string, and with it the generated reference page, is accurate.
  • Noted, not changed. The skill's Knowledge Sources section does not mention source.affinity (the order for the asker). It is outside both cards.
  • The other open PR on the protocol page (the embed-once change, section 3.4) shares content/docs/protocol/knowledge.mdx. overlap-check.mjs before each push: merges cleanly, exit 0.

Verification

Read first, by risk:

  1. skills/objectstack-ai/SKILL.md, the first paragraph of "Knowledge Sources (RAG)": the held-state wording, the Tier H text.
  2. scripts/check-skills-token-ratchet.mjs, the skills/objectstack-ai/SKILL.md row: 7247 to 7499, and the three history notes above it.
  3. content/docs/ai/knowledge-rag.mdx, "An app that cuts its own passages": the new subsection.

Two-minute check: node scripts/check-skills-token-ratchet.mjs prints, on its first line, skills/objectstack-ai/SKILL.md is 7499 tokens (ceiling 7499; headroom 0) (at ff79a0e739).

Local gates at ac64b997eb (the review fix ff79a0e739 re-ran the skills gates: os-dev delta 7303030228 on #38538)

The list is node scripts/pm/dispatch-gates.mjs --commands on the final head: 93 commands. Each exit code was recorded before any pipe, and the record was reconciled with --ran:

✓ dispatch-gates --ran: 93 derived famil(ies) accounted for — 92 run, 1 NOT-MEASURED (0 DERIVED from a recorded exit 3, 1 claimed).

  • 92 commands exit 0. Among them: check-skills-token-ratchet.mjs and its --self-test, check:skill-docs, check:skill-examples, check:skill-identifier-liveness, check:skill-links, check:skill-frame-sync, check:skill-compatibility, check:docs, check:doc-anchors, check:doc-authoring, check:docs-single-h1, check:docs-spec-enumerations, check:docs-transcript-drift, check:doc-formula-expressions, check:doc-security-posture, check:nul-bytes, check:pm-skill-id-lint, check:pm-dispatch-gates, check-empty-changeset.mjs, check-changeset-no-major.mjs, check-adr-0087-registration.mjs.
  • NOT MEASURED: pnpm check:dual-build-cjs-loads, exit 3, PREREQUISITE NOT MET. It reads built output of every package and asks for a full pnpm build; the whole-tree build is CI's, and this diff changes no package source.
  • Five of the 92 first answered exit 3 for a missing build (check:doc-formula-expressions, check:doc-security-posture, check:skill-examples, check:docs-transcript-drift, check:lean-entry-closure) and were run again after turbo run build of @objectstack/formula, @objectstack/lint, @objectstack/client-react and @objectstack/client: exit 0 each.
  • Outside the derived list: pnpm --filter @objectstack/spec run check:generated exit 0 ("All 14 generated artifacts are up to date", check:skill-docs and check:skill-refs among them, so no generated file is regenerated); check:skill-served-sections exit 0.
  • node scripts/pm/overlap-check.mjs: VERDICT clean exit 0 against origin/main 13a0d3fedf and the two open PRs that share a file.

No package source changes, so no package build closure, test or typecheck is owed by this diff; the full farm is CI's.


Generated by Claude Code

…the document unit, `source.documentBy`

The two knowledge pages and the objectstack-ai skill did not name
`source.documentBy`. They now state the rule: an app that cuts its own
passages writes each one as a child record and indexes the child object with
`split: { strategy: 'whole' }`; the index stays one record = one document;
`documentBy` is the unit a record-level search counts in `topK` and groups by
when no `groupBy` is sent.

- content/docs/ai/knowledge-rag.mdx: a paragraph under "Retrieving
  knowledge", the `topK` and `granularity` rows of the `search_knowledge`
  table, and a new subsection "An app that cuts its own passages".
- content/docs/protocol/knowledge.mdx: the key in section 3.1, the default
  grouping in "Records, not passages", and a pointer in section 3.5.
- skills/objectstack-ai/SKILL.md: the key's row and one rule; the token
  ratchet row moves 7247 -> 7401 under the standing ruling (one restating
  clause deleted first, the measured remainder raised).

The `search_knowledge` description and the TSDoc of
`KnowledgeSearchOptions.granularity` / `topK` already say one hit per parent
for a `documentBy` source on main, so neither file changes.

Claude-Session: https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ
Co-authored-by: Claude <noreply@anthropic.com>
…ce is held until it is enabled

The Knowledge Sources section said "a shipped item mounts the knowledge
service and its store", which read as "shipped, so searchable". Under
ADR-0161 K8's dated note on item 12 a service the runtime mounts is held
until an embedder provider is saved, the deployment's store is mounted and
the server restarts.

The sentence now says so, in the words the code answers with
(`heldSourcesText`, `heldSourceSaveText`, `os knowledge status`,
`os knowledge rebuild`): held sources are listed and never built or
searched, `search_knowledge` is not offered, a search or a run-time save
answers `503 SERVICE_UNAVAILABLE` naming the missing half, `os knowledge
status` prints the state and why, and `os knowledge rebuild` exits 1 with
it. The remedy where an app ships no source gains the embedder save and its
restart (`noKnowledgeServiceRefusal`).

No example is added. The token ratchet row moves 7401 -> 7489 under the
standing ruling: the restating clauses of the same paragraph are deleted
first, and the row moves by the measured remainder.

Claude-Session: https://claude.ai/code/session_01WGufzeatqKfTRUzTJVa9jQ
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m 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 Dec 1, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzeatqKfTRUzTJVa9jQ

Final green head · 2026-12-01T06:22Z · zone osa-ai
Head-sha: ac64b99

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

Contract-review-claim: session_01WGufzhGA3zoCFquQgku4pm · head ac64b99 · 2026-12-01T06:24Z

osa-L1-a takes the L1 and the contract review at CONTRACT_REVIEW_TIER on this head, announced in 7302820244.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

Contract review

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

PR #38855, cards #38538 and #38475 (folded). Read: both cards with every comment (rulings 7301309674 and 7301316285, claims 7301395331 and 7301407111, amendment 7302593245, the os-dev-report 7302512997), the PR body and file list, the net diff against main at 13a0d3fedf, and the 50 check-runs on the head. Standing ruling 6513306068 on #27847 was read because both the card and the claim name it as the raise path. The cited code was read on origin/main, never from the working tree. The two content/docs pages and the changeset are the lane seat's remainder at TIER_DEFAULT; they were read only for agreement with the skill.

① Derived judgments

② Semver level

@objectstack/skills: patch, one changeset, describing exactly the two text changes and the row move. A skill wording change that publishes no key, no option and no behaviour is a patch. Clause-②: no and Metadata-protocol: none on the PR body and in the changeset agree with the tree: nothing a consumer could write is refused or reinterpreted by this diff.

Clause-②: no — correct.

③ Boundary flags

  • File surface, scripts/check-skills-token-ratchet.mjs outside the original claim: answered by amendment 7302593245, which adds the path (the one row and its notes). The edit is the row and comments only; no rule of the gate changes.
  • knowledge-tools.ts and the spec contract TSDoc unchanged: answered in ①, the text is already true on main.
  • Guide snippet versus "No new example": the Expected line is about the skill (skills(objectstack-ai): a shipped knowledge source mounts the service, but without an embedder or the deployment store it is held, not enabled (after #38369) #38475), and the skill gains none. The snippet is in content/docs/ai/knowledge-rag.mdx, the lane seat's remainder.
  • Cloud document quota not stated: answered in ①. The dev's carrier: cloud note is the right carrier; no line of this PR claims it.
  • Rule id knowledge-source-document-by-not-parent-link not in the skill: accepted. The row says any other field is refused and the refusal names the fix; both pages name the rule.
  • Out-of-scope notes: the documentBy TSDoc in packages/spec/src/ai/knowledge-source.zod.ts still says a packaged or code-registered source "meets no save, so that rule does not judge it yet", which the lint rule has since made untrue; and the skill names no source.affinity. Both are outside this diff and are "noted, not filed" in the report. The seat files each as a follow-up card or records why not; they do not bear on this head.
  • open_questions: empty. security_findings: none; confirmed, no changed hunk teaches permission, sharing, credential, token or authentication behaviour (the held state is availability, the documentBy row is a field-type rule).
  • SQL push-down: no code in the diff, so no id materialisation or in-app join is introduced.

④ Design judgment

skills/objectstack-ai/SKILL.md, against the code on main at 13a0d3fedf.

Held state (first paragraph of Knowledge Sources), sentence by sentence:

  • "A shipped item mounts the knowledge service and its store": stackItemCapabilities (packages/core/src/capability-composition.ts), the knowledge row's mountedBy. Holds.
  • "held until an embedder provider is saved, the deployment's store is mounted, and the server restarts": KnowledgeServicePlugin.settleEnablement reads both halves once per boot for a runtime-composed service and holds on either; heldSourcesText ends "then restart". Holds.
  • "Held sources are listed, never built or searched": index_status lists each source with heldIndexReading; the boot build, record sync, reconcile and reload all return on this.held; searchWithRefusals throws. Holds.
  • "search_knowledge is not offered": KnowledgeService.knowledgeTools() hands out no definition while held or unsettled, and the stdio host registers the tool only once the service is read as enabled (packages/mcp/src/plugin.ts). Holds.
  • "a search or a run-time save answers 503 SERVICE_UNAVAILABLE naming the missing half (nothing written)": heldSourcesError (503, each missing half and its remedy) and admitAuthoredSource with heldSourceSaveText, which ends "Nothing was written." Holds.
  • "os knowledge status prints the state and why": status.ts prints describeEnablement and then enablement.reason. Holds.
  • "os knowledge rebuild exits 1 with it": the rebuild action answers ok: false with the held sentence, and rebuild.ts exits 1 on it. Holds.
  • "Where an app ships none ... add requires: ['knowledge'], restart, save an embedder provider and restart again": the ordered remedy of noKnowledgeServiceRefusal for the save door. Holds.

Document unit (the table row and the new rule):

  • "single-valued lookup / master_detail field, listed in metadataFields": documentUnitOf over parentLinkRule (never multiple: true), and the parse refinement refuseDocumentByOutsideMetadataFields. Holds.
  • "Any other field is refused": by the parse when unlisted, by admitAuthoredSource at a save, by validate-knowledge-source.ts at os validate and the publish gate. Holds.
  • "the index stays one record = one document; documentBy is the unit granularity: 'record' counts in topK and groups by unless groupBy is sent": groupKeyOf and documentKeyOf; the contract TSDoc says the same. Holds.
  • "the parent is the hit's groupValue; a record with no parent is its own hit": knowledge-tools.ts sets groupValue from documentUnitValueOf under record with no groupBy; documentKeyOf falls back to recordKeyOf. Holds.

S1 (should-fix) — the source.documentBy row ends "Setting it rebuilds nothing", eight words after it requires the field to be "listed in metadataFields". The key itself is in neither hash, but metadataFields is in the recipe hash (computeRecipeHash, knowledge-index-fingerprint.ts), and a source whose stored recipe hash differs is refused to every non-system search until a complete build finishes under the new recipe (knowledge-service-search.ts: "the index was last completed under another recipe (the source's where, metadataFields, title rule or withheld fields)"). So on an existing source whose parent link is not already listed, which is the ordinary case for the reader this sentence addresses, following the row does rebuild the source in place and takes it out of search meanwhile. An agent that holds only the skill will tell its user the opposite. The guide in this same PR states it whole: "Setting or changing documentBy rebuilds nothing; listing the parent field in metadataFields for the first time rebuilds the source in place". Fix in the skill: either say both halves in the row (for example "Setting it rebuilds nothing; newly listing the field rebuilds in place") or drop the clause, and re-pin the ratchet row at the new measurement. One line; the +12 line budget is not touched.

Nits, no effect on correctness or the contract:

  • The held sentence says the shipped item "mounts the knowledge service and its store" and, in the same sentence, that the service is held until "the deployment's store is mounted". Both are true (the store is composed beside the service and can fail to mount, for the reason the boot log names), but the pair reads as a contradiction on first pass. "the store it mounts is up" or dropping "and its store" would remove it. Accepted as a deviation if left.
  • The held state applies to a service the runtime composed; a host that mounts KnowledgeServicePlugin itself, the "second door" the same paragraph names, is not held. The sentence's subject (a shipped item's mount) scopes it correctly; no change asked.

Does the text earn its tokens for a customer agent that loads the whole package? +242 tokens on a 7247-token file. The held paragraph answers the one question the old sentence left an author stuck on (a source that is listed and never answers, and why a save is refused), and the documentBy row and rule are the only place the skill names a key the schema already accepts. Both cards asked for exactly this, and nothing in the added text restates another line of the file. It earns them, S1 aside.

scripts/check-skills-token-ratchet.mjs, against ruling 6513306068 (letter B, part 2).

  • Deletion of restatement in the SAME file, shown in the diff: met. Five cuts, all in skills/objectstack-ai/SKILL.md: "the longest passage" beside the setting named Longest passage in the same sentence; the "(KnowledgeSourceSchema in @objectstack/spec/ai)" aside, which the section's own example restates at its import line; the second "SERVICE_UNAVAILABLE, nothing written", now "that 503"; "to the stack" and "the server" in the remedy. Each removed phrase is said elsewhere in the file and no meaning is lost. The cuts are small beside the addition (roughly 35 tokens against a net +242), which the ruling allows: it asks that deletion be shown and the remainder be measured, not that the two balance.
  • The quote: the PR body carries 「A:先削重复,余额按实测提高」 and the ruling id. Met.
  • Pinned at the measurement: met, see ①. The row is 7489 for 29953 priced bytes; neither history note leaves headroom.
  • The edit is one row and its two dated notes in the form every earlier raise of this row uses. No ceiling of another file, no rule and no self-test row changes.
  • A fix of S1 changes the skill's bytes, so this row moves again in the same commit and the delta review re-reads it.

No must-fix. One should-fix, S1, open on this head: it earns a delta review of its fix.

Implemented-by: claude/issue-38538-documentby-docs-skill
Reviewed-by: session_01WGufzhGA3zoCFquQgku4pm

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

席位核对 — L1 · head ac64b997eb7f5353b7dc3f856940f629b434b9f5 · 2026-12-01T06:29Z · one should-fix (skill row), not ready to hand off

osa-L1-a reviewed the final head the zone announced in 7302820244. I read it against GitHub and the tree, not the reports. I adopted contract review 7302929201 at CONTRACT_REVIEW_TIER (rules face, skills/objectstack-ai/SKILL.md). An isolated sub-agent this thread started wrote it, verify-review-tier.mjs passes its transcript, and its brief is below. Its Scope: is hits plus the ratchet script, and the independence pair is filled.

Mechanical face (l1-face.mjs --pr 38855 at ac64b99): one flag, keywords-other-cards (Fixes #38475). It is expected for a fold: execution-duties.md L84 writes one Fixes line per member. Both members have their own claim (7301395331, 7301407111), the commits are per card (de04044 for #38538, ac64b99 for #38475), and amendment 7302593245 names the fold. The other 12 items are ok. Lint & Repo Gates and TypeScript Type Check are success. All check-runs: 33 success · 17 expected skip · 0 failed · 0 pending. mergeable_state clean.

Items read by hand

Findings

  • S1 (should-fix), adopted from the contract review and confirmed on the tree: the skill's source.documentBy row says the field must be "listed in metadataFields", then "Setting it rebuilds nothing". metadataFields is in computeRecipeHash (knowledge-index-fingerprint.ts L118). So an author who lists the parent field for the first time to satisfy the row rebuilds the source in place, and its searches are refused until the build finishes. The guide in this same PR states both halves; the skill states only the one that misleads. Fix: state both halves in the row (e.g. "setting it rebuilds nothing; first listing the field in metadataFields rebuilds the source"), or drop the clause. Then re-pin the ratchet row at the new measurement in the same commit.
  • Nits (record): "mounts … its store" beside "until the deployment's store is mounted" reads as a contradiction; the held state's runtime-only scope needs no change. Fold them into the same push or leave them.
  • For the zone, outside this diff: the dev's two "noted, not filed" items each need a follow-up card under filing-gate.md or a recorded reason. They are the stale documentBy TSDoc in packages/spec/src/ai/knowledge-source.zod.ts, and the skill not naming source.affinity.

Not ACCEPT on this head. Under the merge standard, S1 is fixed and re-reviewed before hand-off. On the new head the zone announces, this thread owes an L1 delta and a contract-review delta from the same reviewer naming S1: closed.

Contract review brief (as handed to the sub-agent)

Contract review brief — PR #38855 @ ac64b997eb7f5353b7dc3f856940f629b434b9f5 (card #38538 (folded with #38475))

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --paths skills/objectstack-ai/SKILL.md — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #38538 (folded with #38475): its body and EVERY comment (rulings and earlier records included)
· PR #38855: its body, its file list, and the net diff against main at ac64b997eb7f5353b7dc3f856940f629b434b9f5
· the check-runs on ac64b997eb7f5353b7dc3f856940f629b434b9f5: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths reviewFace returns as hits on this PR's file list: skills/objectstack-ai/SKILL.md;
plus every file IN THIS DIFF that directly implements or enforces them — the gate that enforces a rule, the code
a jsdoc or schema line describes, the validator a skill teaches — reviewed for agreement with the contract.
Widen it freely, ⛔ never below hits; the record's Scope: line names the implementing files apart from hits.
The rest of the diff (tests, unrelated modules, lockfiles, generated output, changesets) is the lane seat's
ACCEPT at TIER_DEFAULT, exactly as a standalone PR of those files.
④ judges the hits files and those implementing files ONLY:
lockfiles, generated output, changesets and prose elsewhere in the PR are not reviewed;
code outside the diff is READ to judge them, never reviewed.

Security — a hits path sits on the low-risk skills arm: when the change teaches security, auth or permission
behaviour the path name doesn't show, the record says so and the seat adopting the record adds the security label.
The record says so on its Security-touching: line, and the arm lands on no alone: write no ONLY when no changed
hunk teaches permission, sharing, credential, token, authentication or other security behaviour, else yes.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-claude/7cf60be4-62b5-5ace-a183-89f0a6dd4f41/scratchpad/pr-38855/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
④ Design judgment — for EVERY hits file: does the change hold against the code it cites and the
scenario it is accepted against? A skill file against the card's eval prompt and the spec it teaches
on main; a schema file against the ruling or ADR it implements and its first consumer; an ADR
against its first consumer and its execution plan. For EVERY implementing file in the diff: does the
code agree with the contract, sentence by sentence? Read the cited code in the live tree, and try to
break the design.
Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
Spell a must-fix or should-fix with its id and grade, S1 (should-fix) — …, and a clean round as
No must-fix, no should-fix.: the queue guard reads a graded finding as OPEN on this head and
refuses the record; the delta record names those it closes by id alone, S1: closed.
A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
anywhere else moves the head, and this record no longer covers it.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

Deviations from the brief as handed: the record was written to a file and posted by this session. Reviewed-by: names this adopting session. Both folded cards, the claim, amendment 7302593245 and the dev report were inputs. Pointers given beside them: the held-service and documentBy code to check, the ratchet ruling 6513306068, the dev's two claims (already-true texts, cloud half), and the check-runs endpoint.

…tence names the store once

Review round on the two knowledge additions to the objectstack-ai skill.

- The `source.documentBy` row ended "Setting it rebuilds nothing" right
  after requiring the field in `metadataFields`. The key is in neither hash,
  but `metadataFields` is in the recipe hash, so listing the parent field
  there for the first time rebuilds the source in place. The row now says
  both halves, as the guide page does.
- The held sentence said a shipped item "mounts the knowledge service and
  its store" and then that the service waits for the deployment's store to
  be mounted. "and its store" is dropped, so the pair no longer reads as a
  contradiction.

The token ratchet row moves 7489 -> 7499, pinned at the measurement, under
the standing ruling. The changeset says the same two things and the new
ceiling. The file's line count does not move.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzeatqKfTRUzTJVa9jQ

Final green head · 2026-12-01T06:50Z · zone osa-ai · revision 1
Head-sha: ff79a0e

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

Contract-review-claim: session_01WGufzhGA3zoCFquQgku4pm · head ff79a0e · 2026-12-01T06:52Z

osa-L1-a takes the L1 delta and the contract-review delta (same reviewer) on this head, announced in 7303364359.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

Contract review

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

Delta review of PR #38855 (cards #38538 and #38475, folded) on its new head. The record on ac64b997eb is comment 7302929201; it stands for every hunk this head leaves unchanged and is carried forward here. The delta is one commit, ff79a0e739, over three files: skills/objectstack-ai/SKILL.md (+2 −2), scripts/check-skills-token-ratchet.mjs (+14 −1) and the changeset (+3 −3). The two content/docs pages are untouched since ac64b997eb. Read for this round: the delta, the net diff against main at 13a0d3fedf, the PR body as it now reads, and the 54 check-runs on this head. The cited code was read on origin/main.

① Derived judgments

  • Check-runs on this head: 54, of which 35 success and 19 skipped; none failed, none pending. Among the successes: Lint & Repo Gates, Lint · repo & tooling gates, Lint · docs & code guards, Check Changeset, Check Documentation Links, Build Docs, Build Core, Test Core, TypeScript Type Check, PR-body guards, Governed Surface Queue Guard, Spec property liveness. The skipped ones are the opt-in and UI families this diff does not reach.
  • Public surface: unchanged in kind. Text only; no schema, no runtime code, no generated page. The delta rewords two sentences of the skill.
  • Accept-set: none widens or narrows.
  • Ratchet row: 7489 to 7499, headroom 0. Measured from the committed blob: the skill is 30020 bytes at this head (29980 at ac64b997eb); minus the 27-byte stamp line, 29993; ceil(29993 / 4) is 7499. The row sits at the measurement. Right.
  • Line budget of the claim (at most +12 lines for the fold): the file is still 518 lines, +11 against main. Right.
  • Carried forward unchanged from 7302929201: the "two files unchanged" claim holds on main; Fixes #38538 and Fixes #38475 are both right, and the PR body still opens with both lines.

② Semver level

@objectstack/skills: patch, one changeset. The delta changes its wording only, and the level still matches what the diff publishes: a skill text change with no key, option or behaviour. Clause-②: no and Metadata-protocol: none stand on the PR body and in the changeset.

The changeset's sentences agree with the skill at this head: it says setting the key rebuilds nothing and that listing the parent field in metadataFields for the first time rebuilds the source in place; it says "A shipped item mounts the knowledge service" with no "and its store"; and it gives the ceiling as 7247 to 7499.

Clause-②: no — correct.

③ Boundary flags

  • Carried forward unchanged from 7302929201: the ratchet script on the file surface (amendment 7302593245), the two unchanged files, the guide snippet, the cloud document-quota note, the rule id left out of the skill, and the two "noted, not filed" items the seat still owes a carrier for (the stale documentBy TSDoc in packages/spec/src/ai/knowledge-source.zod.ts, and source.affinity absent from the skill).
  • The delta raises no new flag. The PR body's budget table, its "Deleted first" list and its two-minute check were updated to this head (30020 bytes, 7499, three history notes) and agree with the tree.
  • Security: no changed hunk in the delta or in the net diff teaches permission, sharing, credential, token or authentication behaviour.
  • SQL push-down: no code in the diff.

④ Design judgment

skills/objectstack-ai/SKILL.md, the two changed sentences, against the code on main at 13a0d3fedf.

S1: closed

  • The source.documentBy row now ends "Setting it rebuilds nothing; newly listing the field rebuilds the source in place". Both halves hold. documentBy enters neither computeIndexFingerprint nor computeRecipeHash (packages/services/service-knowledge/src/knowledge-index-fingerprint.ts), so setting or changing the key alone moves no hash. metadataFields is a member of the recipe hash, and that file's header rules a recipe change "repaired by a complete rebuild inside the same generation, not by a new one": that is "in place". The row now agrees with the guide's sentence in this same PR and with the spec TSDoc. The row does not add that searches of the source are refused while that build runs; the skill says so for a split change, and the guide carries it for this case. Not required of a one-line table cell.
  • The held sentence now reads "A shipped item mounts the knowledge service, which does not enable it: the service is held until an embedder provider is saved, the deployment's store is mounted, and the server restarts." It still holds: stackItemCapabilities adds the knowledge token for a stack that ships a knowledge_source, and KnowledgeServicePlugin.settleEnablement holds the service on either missing half. The store is now named once, as one of the halves the service waits for, which is how heldSourcesText names it; the first-pass contradiction of the earlier wording is gone. The nit is closed by the fix.
  • Every other sentence of the section is byte-identical to ac64b997eb, and the reading in 7302929201 stands for it.

The second nit of 7302929201 (the held state applies to a runtime-composed service, not a host-mounted one) asked for no change and none was made.

scripts/check-skills-token-ratchet.mjs, the third dated note and the row, against ruling 6513306068 (letter B, part 2).

  • Deletion in the SAME file, shown in the diff: "and its store" leaves the held sentence, and the note names it. It is a true restatement: the same sentence names the deployment's store as one of the two halves.
  • The quote: the note and the PR body both carry 「A:先削重复,余额按实测提高」 with the ruling id.
  • Pinned at the measurement: 29993 priced bytes, ceil(29993 / 4) = 7499, headroom 0. The note's arithmetic (29980 to 30020 bytes, the row +10) matches the blobs.
  • Is a raise legitimate for a correction? Yes. The +10 is the measured remainder of the clause that makes the row true, after the one cut the same commit shows. The alternative that costs no tokens, deleting "Setting it rebuilds nothing", was offered in S1 as an equal fix; the dev chose the one that tells the reader what does rebuild, which is the more useful sentence for an agent holding only the skill. The ruling's two conditions are met on the face of the diff, and the 10402 principle is not strained by ten tokens that replace a misleading half-statement.
  • The note's account of why is accurate sentence by sentence against computeRecipeHash. No other row, rule or self-test changes.

No must-fix, no should-fix.

Implemented-by: claude/issue-38538-documentby-docs-skill
Reviewed-by: session_01WGufzhGA3zoCFquQgku4pm

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

席位核对 — L1 delta ACCEPT · head ff79a0e73924c1a80e5e08b3598e1d78a97afab0 · 2026-12-01T06:55Z

osa-L1-a, reviewing the fix head the zone announced in 7303364359. I read the delta ac64b997..ff79a0e7: one commit touching the skill, the ratchet and the changeset. Everything else carries over from 7302946285. I adopted contract-review delta 7303425331. It came from the same isolated reviewer that wrote 7302929201, resumed for this head, and verify-review-tier.mjs passes its transcript. Scope: is unchanged.

No must-fix, no should-fix. L1 delta ACCEPT on ff79a0e7. With the contract-review PASS on this head, this is ready for the seat's Tier H hand-off.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhPdWmTd47Fi2bKYZS

席位核对

ACCEPT — PR #38855 @ ff79a0e73924c1a80e5e08b3598e1d78a97afab0. It folds cards #38538 and #38475 (zone osa-ai, claim of 2026-12-01T05:04Z plus amendment 7302593245), and the maintainer ruled at 2026-12-01T04:54Z that the knowledge pause does not hold them. Checked 2026-12-01T06:57Z against GitHub, not against the reports.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhPdWmTd47Fi2bKYZS

维护者速读

席位意见:同意落地。ACCEPT → PR #38855 comment 7303476395。

@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 06:58
@os-zhuang
os-zhuang marked this pull request as ready for review December 1, 2026 08:28
@os-zhuang
os-zhuang added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit 1330750 Dec 1, 2026
62 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-38538-documentby-docs-skill branch December 1, 2026 08:50
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…jectstack-ai#38868)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi99QsuPTPkC1uKm2mViUT3Rf)_

Part of objectstack-ai#34770

Clause-②: no
Metadata-protocol: none

`Part of`, not the closing form: the catalog-size line of the card's
Done-when is not met by this PR. This is PR 7 of the per-skill split,
under claim 7280537583 and its amendments 7280758590, 7288186602,
7296541080 and 7298747104.

## 维护者速读

- 用户能看到什么变化:用户无感。发给 AI
的「项目流程」技能说明(一个应用项目怎么立需求、怎么测、怎么给客户写变更说明、怎么升级平台),入口文件从约 12 KB 缩到 9
KB。七个小节和标题都没变:开工前三问、各阶段写什么、四项检查与平台已经替你查了什么、平台缺陷怎么处理、给客户的变更说明、升级平台与客户已有数据、各类改动去哪份技能查;每一节变短了。
-
为什么做:这是「技能目录瘦身」的第十份(界面、数据、自动化、平台、跨大版本升级、多语言翻译、表达式与公式、接口设计、查询九份已完成)。入口文件每次都整份装进
AI 的上下文,越长越贵,也越容易漏读。
- 出错会怎样:只动教 AI 的文字,没有产品行为变化;风险是 AI
少读一段后答错。评测已在定稿上整轮跑完(十道题,每题三遍,改动前后同一时段各一轮):改动后三十次对二十七次,改动前也是三十次对二十七次,没有哪道题在改动后三遍全错。过程中评测四次显示删多了,四次都把那段内容补回入口,并在入口内另删等量文字抵账。发现问题可以直接撤回这次合并,不涉及任何数据。
- 要你做什么:无。席位核对与合约审查都通过后,才会按治理规则请审批人批准。

## Rulings this executes

- **Card Scope** (decision record on the card, S3 = A): the entry file
holds first checks, at most about 8 traps and a routing list; 6–9 KB,
hard cap 500 lines; restated option lists and tables go behind a
pointer; no trap is removed until a publish-time check covers it or it
stays inline.
- **7128031203** fork 4 = A: ratchet rows are pinned at the measurement
with zero headroom, and the sum of ceilings does not rise. Here one row
falls, no row rises and none is added.
- **7168461386** = A: text an eval shows the entry lost goes back into
the entry, paid inside the entry. **Used four times**, once after each
of the first four after-rounds (see Eval parity).
- **Ruling record 7249189592**, the parity rule: a case whose result
flips between runs on both trees is unstable on both and does not block;
a case that fails on every run of the head while `main` passes is a
regression. Read below on full rounds of both trees in one window: no
case fails on every run of the head.
- **Seat rulings on this PR's two questions** (the seat's resume order
in this card thread, 2026-12-01, after the local round's report): the
budget question is **A**, the entry stands at 9,000 B as delivered, with
each cut named beside what answers it and "cut, with no other home" said
plainly where that is the case; the case 8 question is **A**, the entry
is left as is and the conditional mentions are recorded as measured
(Eval parity).
- **Seat order for this PR** (claim amendment 7298747104, PR 7 =
`objectstack-project`): the PR 4 and PR 5 shape. This skill has no
hand-written rules or reference file (its one reference, the platform
catalog, is generated), so text is cut behind a pointer, not moved; no
new file under `skills/` (a new file needs a new ratchet row, which
stays with a human).

## Review round

The contract review of `06f27f0f` (record 7304362531, verdict PASS) left
one should-fix open and two nits; commit `d4b240c0` takes the should-fix
and one nit.

- **S1, fixed.** The entry named `stack.rows` as the call that tests who
sees which records and no longer said the read is made as a user.
Verified in the code first: `rows` in `packages/verify/src/handle.ts`
takes its caller from `as` and otherwise uses the system context, so a
visibility test written without it reads every row past sharing and
row-level security, and passes or fails for the wrong reason. That is
accepted input answering wrong, the class this entry keeps inline. The
paragraph now reads "`stack.rows` with `as`: without it the read is the
system's". Paid inside the entry with wording that carries no fact
("what the bump may have settled" in the sweep step, "too", "are in",
and "Relief for customers" became "Customer relief"); the file is 9,000
bytes before and after, so the ratchet row and its comment do not move.
The changeset sentence that left "`rows` reads as a user" to the README
is corrected: the entry keeps it inline.
- **N2, taken in the lists.** `main`'s stage table said a product's
design note "always answers" installed data and upgrade steps. The table
below and the changeset now list that line among the cuts (the two are
starred items of the design list, and the breaking-change and backfill
rules require both).
- **N1, not taken.** The pointer for the full check lists stays the bare
page URL: a fragment costs bytes that would have to come out of kept
text, and the api, formula and query entries point at their pages the
same way. The lists sit under the page's "Build & Validate" and
"Quality" headings.

## What changes

**The entry file becomes a router.**
`skills/objectstack-project/SKILL.md`: 11,987 → 9,000 bytes, 214 → 184
lines, 2,990 → 2,244 tokens. Frontmatter (description, tags,
`compatibility`) is byte-identical. The title and all seven section
headings are byte-identical too, so no anchor leaves the file and "§0,
question 3" still names the same place. It holds:

- One line under the title: where the installed `@objectstack/cli`
differs from the `compatibility` line, the installed command is right.
This is the one new sentence; the frontmatter says the check lists are
that version's, and the lists are now mostly behind a pointer.
- `## 0`, the three questions asked before any work: app or platform
(three answers, as a list instead of a table), own use or product
(recorded as one line in the project's `AGENTS.md`; an own-use app is
not asked for a requirement record, a design note or a changeset), and
whether the platform already ships it (the generated catalog; the
`PLATFORM-CANDIDATE` marker).
- `## 1`, four stages as a list: requirement, design, build, acceptance.
- `## 2`, the four checks in one command line; that only errors fail
`validate` and `lint`, with the two warnings that pass; what `os
validate`, `os lint` and `os verify` each check, in three bullets, with
the published CLI page for the full lists; the rule against hand-writing
a platform check and the `PLATFORM-GAP` / `RETIRED` markers; what the
app tests with `bootStack`, with the handle call for each kind of fact
and one type-shaped example.
- `## 3`, the five platform-gap rules.
- `## 4`, the customer changeset, the breaking-change statement and the
release steps.
- `## 5`, the four bump steps, and the rules for data already installed
(the schema-change pointer, and the backfill script's five rules).
- `## 6`, nine routing rows, as a list.

**No text moved.** What left the entry was cut, each behind what now
answers it; the changeset lists the cuts.

| Old entry section | Now |
|:--|:--|
| Opening sentence (the domain skills teach metadata; this one teaches
how a change moves) | Cut: the frontmatter description says both. The
version line takes its place. |
| §0 question 1, a three-row table | Three list items with the same
three answers. Cut: two examples ("how a case is routed", "labels are
translated") and the qualifier "and the app pays for it". |
| §0 questions 2 and 3; the MCP line | Kept. Question 3's last sentence
is shorter: a defect is different, never worked around (§3). |
| §1 stage table, nine rows | Four list items. The rows that only named
a later section (Test, Release, Upgrade) are cut; "one issue, one PR"
and the user-docs row are folded into Build and Acceptance. Cut, with no
other home: the product column's line that the design note "always
answers" installed data and upgrade steps (the two are starred items of
the design list; §4 and §5 require both on a breaking change). |
| §1 design checklist | The same seven items, inline in the Design item.
|
| §1 requirement-file template | Cut, with no other home: a five-line
file template. The entry keeps that a customer-visible feature also gets
a file in `docs/requirements/`. |
| §2 opening paragraph | "Run all four before calling a change done, and
in CI", the warning sentence with both examples, and the set-up sentence
(vitest, a `test` script, `@objectstack/verify`). Cut: "an older
scaffold may lack the `pnpm test` step". |
| §2 table "What the platform checks" | Three bullets and the published
page `https://objectstack.ai/docs/deployment/cli` for the full lists.
`os validate` keeps its rule families in one sentence; cut to the page:
the kinds of reference, dataset members, package docs, the
capability-provider check. `os lint` keeps the shared author-time rules
and its style families; cut to the page: `--i18n-strict`. `os verify`
keeps the round-trip and `--rls`; cut to the page: the six other opt-in
proofs. The `pnpm typecheck` row said only what the name says. The
table's heading dated the lists "at 18.x" while the frontmatter says
19.x; the heading is gone. |
| §2 `os verify` is not one of the four | Kept, as the end of the `os
verify` bullet. Cut: "or as a CI step", and the note that `npx os
explain` lists only the rules that carry an explanation. |
| §2 what the app tests, the example, the handle sentence | Kept. The
paragraph now names the call for each kind of fact (`stack.hooks.run`,
`stack.flows.run`, `stack.actions.run`, `stack.rows`), and keeps inline
that `stack.rows` reads as a user only with `as`. Cut to the README that
`@objectstack/verify` ships, which the entry names: the `automation`
boot option (a flow run without the service is refused loudly). Cut: the
pointer to the scaffold's starter test (see Acceptance notes) and the
`LiteKernel` sentence (the routing list sends a plugin's tests to
objectstack-platform). |
| §2 the hand-written-check rule and the gap markers | Kept, one
paragraph. |
| §3 Platform gaps | All five rules kept. Cut: "a workaround outlives
the fix" and the stale-bot note. |
| §4 Describing a change for customers | Kept. Cut: the changesets
set-up command, "no issue numbers, no internal names" (the same bullet
says the note is in the administrator's words), the examples of a
breaking change, "the notes customers read", and the
objectstack-platform pointer after `os package publish` (the routing
list has it). |
| §5 Bump | All four steps kept. The sweep step names the three things
to sweep and the section that says what to do with each. |
| §5 Data already installed | The schema bullet keeps `renamedFrom`, `os
migrate plan` then `os migrate apply`, and `--allow-destructive` for a
drop, and points to objectstack-data `rules/field-types.md` § Changing a
field that has data for which change takes which. The backfill rules are
kept, all five. Cut: "so it works on any installed metadata", and the
line that the release note names the script (§4's breaking-change bullet
orders the steps, a backfill first). |
| §6 routing table, twelve rows | Nine list rows. Cut:
objectstack-upgrade (the frontmatter description and bump step 2 name
it), and objectstack-ask and objectui (answering from the app's records
and rendering in React are not changes to the metadata project; each
skill is still found by its own description). |

**Sizes** (bytes · lines · ratchet tokens):

| | before (`main` at `5bd786e4`, the branch point) | after (head
`d4b240c0`) |
|:--|--:|--:|
| `SKILL.md` (entry) | 11,987 · 214 · 2,990 | 9,000 · 184 · 2,244 |
| `skills/objectstack-project/**` (4 files) | 38,199 | 35,212 |
| all 14 `SKILL.md` together | 143,430 · 2,494 | 140,443 · 2,464 |
| whole `skills/` tree (115 files) | 1,184,461 | 1,181,474 |
| ratchet: authored tokens = sum of all ceilings | 187,449 | 186,703 |
| ratchet: bundle total, tokens | 293,321 | 292,575 |

The `main` column is measured from `main`'s files and its own ratchet
table (61 rows), except the bundle total, which is the head's reading
plus the 746 tokens this entry lost. The head column is measured from
the head's tree; the review round changed no size (the entry is 9,000
bytes on both `06f27f0f` and `d4b240c0`).

**Budget reading:** the entry is 9,000 B, on the card's 6–9 KB line, and
184 lines against the 500-line cap. The whole catalog is 2,987 bytes
smaller, all of it cut. The cut is smaller than the other entries'
because nearly all of this file is process teaching that no contract,
rules file or check holds (see the budget note in Acceptance notes).

**Ratchet row** (`scripts/check-skills-token-ratchet.mjs`), pinned AT
its measurement, zero headroom. One row moves, down:

- `skills/objectstack-project/SKILL.md` 2990 → 2244 (−746): `ceil((9000
− 27) / 4) = ceil(8973 / 4) = 2244`. Why: the entry became a router.

The sum of all ceilings goes 187,449 → 186,703 (−746). No row rises and
none is added.

## Tests

### Eval parity

Command, every full round: `pnpm --filter @objectstack/scenarios
skill-evals --skills objectstack-project --repeats 3 --concurrency 4
--max-utilization 0.99`, with the model and effort flags PR 3's rounds
used; CLI 2.1.333, subscription login. 10 behaviour cases in
`evals/project-process.json` on both arms and 14 trigger cases in
`evals/triggers.json`, both files untouched: 102 turns a round.

**The reading the rule is judged on**: one full round on each tree, the
same day (2026-12-01): `main`'s entry at 04:34Z, the pushed head at
08:18Z.

| case | subject | `main`'s entry, at `7d6742ae` (with-skill · no-skill)
| head `d4b240c0` (with-skill · no-skill) |
|:--|:--|--:|--:|
| 1 | a platform defect behind a wrong dashboard total, due Friday | 3/3
· 0/3 | 3/3 · 0/3 |
| 2 | asked to hand-write a reference-integrity test | 3/3 · 0/3 | 3/3 ·
0/3 |
| 3 | a test for a discount ceiling with manager approval | 1/3 · 0/3 |
1/3 · 0/3 |
| 4 | removing a field from a product customers installed | 2/3 · 0/3 |
3/3 · 0/3 |
| 5 | a platform bump within a major | 3/3 · 0/3 | 3/3 · 0/3 |
| 6 | a one-person app renaming a label | 3/3 · 0/3 | 3/3 · 0/3 |
| 7 | an attachments table the platform ships | 3/3 · 0/3 | 3/3 · 0/3 |
| 8 | a business-hours calendar the platform ships | 3/3 · 0/3 | 2/3 ·
0/3 |
| 9 | an audit trail the platform ships | 3/3 · 0/3 | 3/3 · 0/3 |
| 10 | a to-do list the platform ships | 3/3 · 0/3 | 3/3 · 0/3 |
| **all** | | **27/30 · 0/30** | **27/30 · 0/30** |
| triggers | loaded when it should · left alone when it should not |
24/24 · 0/18 | 24/24 · 1/18 |

Both rounds ran 102 of 102 turns (4.8 and 5.0 minutes). The head's round
ran on the pushed head after the review fix. `main`'s entry is
byte-identical at `7d6742ae`, at the branch point `5bd786e4` and on
`main` today, so its round was not repeated.

**Reading under the parity rule: no regression.** No case fails on every
run of the head. The cases below 3 of 3:

- **Case 3, 1 of 3 on both trees.** Unstable on both trees. The project
directory of the case is empty, so most answers decline to write the
test and describe it; the case passes only when the description happens
to name both `@objectstack/verify` and `hooks.run`. A separate six-run
reading of this case alone on `main`'s text passed 0 of 6 (each run
missed `hooks.run`), so `main` is 1 of 9 over all runs.
- **Case 4, `main` 2 of 3**, head 3 of 3. `main`'s failing answer missed
`os migrate`.
- **Case 8, head 2 of 3, `main` 3 of 3.** The failing answer uses the
platform's calendar objects and working-hours functions, as the case
asks, and then offers, if something were missing from the platform
calendar, to build that part marked `PLATFORM-CANDIDATE`; the case
forbids that literal. The rule the answer quotes is byte-identical on
both trees. Across all six after-rounds this happened on 5 of 18 runs,
on `main` on 0 of 3. No fact is lost, so nothing goes back into the
entry (the seat's ruling A on this question); the literal is the eval
seat's (Acceptance notes).
- **Triggers.** Triggers 7, 8, 9, 12, 13 and 14 (which should not load
this skill) load it on every run of both trees, with this bundle the
only one installed in the turn; the one exception is one run of trigger
13 on the head, which left it alone. The frontmatter that decides
loading is byte-identical on both trees.

**Earlier rounds**, kept as the record of how the text got here. Every
round ran 102 of 102 turns; the no-skill arm was 0 of 30 in every round.

| reading | tree | with-skill | with-skill cases below 3 of 3 |
|:--|:--|--:|:--|
| before round | `main` at `7d6742ae` | 27/30 | case 3, 1 of 3 (missed
`hooks.run`); case 4, 2 of 3 (missed `os migrate`) |
| after round 1 | local `c48f0b10` (`dab69a78` on this branch), the
first router commit | 25/30 | case 2, 2 of 3 (missed `lint`); **case 3,
0 of 3**; case 8, 2 of 3 |
| after round 2 | local `3410efb1` (`f40780d5`) | 24/30 | case 2, 1 of 3
(missed `lint`); case 3, 1 of 3; case 8, 1 of 3 |
| after round 3 | local `acf9240f` (`6ebcaaff`) | 25/30 | **case 3, 0 of
3**; case 4, 2 of 3 (missed `REST`); case 6, 2 of 3 (missed `validate`)
|
| after round 4 | local `4c448d41` (`9474093d`) | 25/30 | case 3, 2 of
3; **case 4, 0 of 3** (missed `os migrate`); case 5, 2 of 3 |
| after round 5 | local `12819c3d` (`06f27f0f`, the head before the
review round) | 27/30 | case 3, 2 of 3; case 4, 2 of 3 (one answer
spelled the graded literal "Changeset"); case 8, 2 of 3 |
| after round 6, the review round | `d4b240c0`, the head | 27/30 | case
3, 1 of 3; case 8, 2 of 3 |

Three six-run readings of case 3 alone were taken between rounds 3 and
4, 12 turns each: the working text before the handle calls were placed
beside the facts, 0 of 6; the text that became `9474093d`, 1 of 6;
`main`'s text, 0 of 6.

**The restorations (ruling 7168461386).** Each put text of `main`'s
entry back and paid for it inside the entry.

1. After round 1, case 3 failed all three runs and case 2 lost `lint`
once. Back: `os lint` as its own bullet, and a sentence naming
`stack.hooks.run` and `stack.flows.run`. Paid: the design list is
shorter, "or as a CI step" and the objectui routing row are cut.
2. After round 2, case 2 passed 1 of 3. `main`'s answers reach `validate
--strict` and `lint --strict` through the sentence that names label case
and an unresolved navigation target as warnings that pass; the first cut
had dropped the two examples as examples. An unresolved page, report or
dashboard target is a warning (rule `nav-target-unresolved`), so this is
a fact that passes the check and fails later. Back: the two examples,
and "author-time" on the `os lint` line. Paid: the sweep step's last
parenthetical and the objectstack-platform pointer after `os package
publish`. Case 2 has read 3 of 3 in every round since.
3. After round 3, case 3 failed all three runs again. The answers named
`@objectstack/verify` on 5 of 9 runs where `main`'s text names it on
every run: `main`'s set-up sentence (add vitest, a `test` script and
`@objectstack/verify` where missing) had been cut as a convention. Back:
that sentence; and the handle calls moved from a sentence after the
example to the facts each one tests. Paid: "no issue numbers, no
internal names", and `--allow-destructive` (moved behind the
objectstack-data pointer).
4. After round 4, case 4 failed all three runs: with
`--allow-destructive` for a drop behind the pointer, no answer named `os
migrate` for the column. Back: the flag, beside the drop. Paid: a
`--help` parenthetical on the version line (new text of this PR, never
on `main`).

**Quota readings** (the login's seven-day window, status
`allowed_warning`, reset 2026-12-06 14:00 UTC; guard `--max-utilization
0.99` by the maintainer's choice recorded in claim amendments 7296541080
and 7298747104, never raised). Before round 0.59; after round 1 0.60;
round 2 0.61; round 3 0.61 → 0.62; the three case-3 readings 0.62; round
4 0.62 → 0.63; round 5 0.63; round 6 0.72 (another PR of this split ran
its rounds in between). No round was stopped by the guard.

One check that calls no model, beside the rounds: of the 27
`must_contain` literals of the 10 cases, `main`'s entry carries 18 and
the head's entry the same 18 (unchanged by the review round); the other
9 are in the generated platform catalog, which this PR does not touch.
Of the 24 `must_not_contain` literals, `main`'s entry carries six and
the head's five (`REQ-` left with the requirement-file template).

### Other tests

On the head `d4b240c0`, under the verify lock (`VERDICT command-exit
0`):

- `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2
scripts/platform-catalog.test.ts scripts/skill-map-guards.test.ts` (the
suite that names the ratchet script and this skill, and the skill-map
guards): `Test Files 2 passed (2)`, `Tests 57 passed (57)`.
- `pnpm --filter create-objectstack exec vitest run --maxWorkers=2
src/created-summary.test.ts` (the scaffold summary that sends a new
project to this skill): `Test Files 1 passed (1)`, `Tests 12 passed
(12)`.

No ablation: the diff changes prose and one ledger row, no tested
behaviour.

## Acceptance notes

Held by another file, recorded here as it stands:

- **The seven numbered headings are kept byte-identical, and `## 6`
stays last.** The scaffold's `AGENTS.md` template tells a new project
that this skill's "last section names the skill for each kind of
metadata"; eval expected outputs cite "§0" by number.
- **The link to `references/platform-catalog.md` is kept.** The catalog
is generated; this PR does not touch it.

Decided here (small, no shipped behaviour), each open to reversal in
review:

- **"No trap is removed unless a publish-time check covers it or it
stays inline" was read as: a fact that passes every check and goes wrong
later stays inline.** Inline: every ⛔ of `main`'s entry, the two
warnings that pass, `--rls` proves consistency and not intent, a Studio
change never ships, the unblock rule, `manifest.version` by hand, the
`--copy` re-sync, and the backfill-before-removal rules. The changeset
lists them.
- **The budget against this file's content: ruled A by the seat.**
Nearly all of this entry is process teaching with no other home: there
is no contract, rules file or check that holds "what to write at each
stage" or "what a backfill script must do". With every unique rule and
convention kept, the smallest text measured 9.9 KB. Reaching the 9 KB
line took cutting small conventions and examples (the requirement-file
template, the stale-bot note, "no issue numbers, no internal names", two
routing rows and others); the table above and the changeset name each,
and say "with no other home" where nothing else holds it. The two ways
not taken: keeping them at about 9.6 to 9.9 KB, over the line (the
platform entry stands at 9,025 B and the automation entry at 10,703 B),
or a new hand-written reference file, which needs a new ratchet row and
so a human.
- **The routing list lost two rows that route outside the metadata
project** (objectstack-ask, objectui). They paid for restored text. If
review wants them back, they cost 63 and 44 bytes.
- **The `os validate` bullet summarises** flow trigger readiness,
undeclared flow cycles, sharing and row-level-security enforceability
and seed rows against state machines as "flows, sharing rules and seed
rows that cannot work as declared". The published page holds each by
name.
- **The handle calls are named beside the facts they test.** `main`'s
entry listed them in one sentence after the example. The mapping (a
rule's numbers through `hooks.run`, a flow or an action through
`flows.run` or `actions.run`, who sees which records through `rows`) is
the one the package's README shows.
- **Word-level tightenings that drop no fact are not itemised in the
changeset** (for example "the notes customers read" after
`CHANGELOG.md`, "one-line" before the `RETIRED` marker, "what the bump
may have settled" in the sweep step).
- **Four lines in the summary above, not six**: the standing order for
this card thread asks for six, and the agent file that binds the dev
fixes four named lines and wins on conflict.
- **Footer form**: this body ends with the single block AGENTS.md
prescribes for a PR body.

Noted, not changed:

- `main`'s entry names the scaffold's starter test `note.test.ts`; the
template's file is `starter.test.ts`
(`packages/create-objectstack/src/templates/blank/`). The cut removes
the stale name with the pointer. Carrier: none.
- `main`'s entry dates its check table "at 18.x" under a frontmatter
that says 19.x. The heading left with the table. Carrier: none.
- Three eval cases grade a literal that a correct answer can miss or
carry: cases 2, 3 and 4 run in an empty project directory, where most
answers decline to write code and describe the work, and pass only when
the description names every graded literal in its exact casing; case 8
forbids `PLATFORM-CANDIDATE` and so fails an answer that uses the
platform's objects and mentions the marker as a conditional offer. The
parity rule treats the cases as fixed, so this PR does not touch them.
Carrier: none; noted for whoever owns the case file.
- Six trigger cases that should not load this skill load it on every run
of both trees. Carrier: none; the eval seat's reading.
- The branch was restarted from `main` at `5bd786e4` after PR 6 of this
split merged, and the five commits of the local round were cherry-picked
onto it by the seat, cleanly. The workspace was reinstalled and rebuilt
and every gate below ran on the result. `main` is three commits further
on (`6d163f41`); the gate derivation reports no STALE TREE for them, and
none touches a file of this PR, so they are not merged in.
- Two open PRs share a file with this one and merge cleanly with it
(`overlap-check`, exit 0): objectstack-ai#38857, the release PR that restamps every
entry's `version` line (the stamp line is the same length and is not
priced by the ratchet), and objectstack-ai#38855, a wording change to the AI skill
that moves a different ratchet row.

## Verification

Read first, by risk:

1. `skills/objectstack-project/SKILL.md`, the whole file: is anything a
model needs to run a project missing, and is every kept sentence true on
its own? The risk hunks are `## 2` (three bullets replace the check
table; the paragraph before the example now carries the handle calls)
and `## 1` (four list items replace a nine-row table).
2. `.changeset/34770-project-skill-router.md`: the "what left, and what
answers it now" list is the record of the cuts.
3. `scripts/check-skills-token-ratchet.mjs`: the `objectstack-project`
row and its comment.

Two-minute check: `node scripts/check-skills-token-ratchet.mjs` prints
`ratcheted (authored) 186703 / 186703 (+0)` and
`skills/objectstack-project/SKILL.md 2244 / 2244 (+0)`; `wc -c
skills/objectstack-project/SKILL.md` prints 9000.

Gates, local, each exit code captured before any pipe. The whole derived
list ran again on the pushed head `d4b240c0` (tree `d499e661`); the
workspace build is the one made on `06f27f0f`, and the review commit
changes no package.

<details><summary>Derived families on head `d4b240c0`: 69 derived, 69
run green, 0 NOT MEASURED</summary>

- Reconciliation: `✓ dispatch-gates --ran: 69 derived famil(ies)
accounted for — 69 run, 0 NOT-MEASURED (a DERIVED zero — all 69 recorded
an exit code and none of them is 3).` No STALE TREE warning on this
head.
- `node scripts/check-skills-token-ratchet.mjs`: `✓
check-skills-token-ratchet: 61 authored bundle file(s) within their
ceilings; 11 generator-owned file(s) and 42 eval fixture(s) measured,
not ratcheted.` (`ratcheted (authored) 186703 / 186703 (+0)`, `bundle
total 292575`); its `--self-test`: `111 cases pass`.
- `pnpm check:dual-build-cjs-loads`: `127 published require entry
point(s) across 75 package(s) load; 2594 emitted CommonJS file(s)
parse`. It reads every package's built `dist/`; `pnpm build
--concurrency=2` ran on the branch under the verify lock before the
first push (`VERDICT command-exit 0`, `124 successful, 124 total`).
- `pnpm check:dts-closure`: `124 built package(s) swept - 326/326
declared declaration file(s) present`.
- `pnpm check:skill-links`: `286 relative link(s) in 76 published skill
file(s) resolve; 161 fragment(s) name a real heading under GitHub's slug
rule.`
- `pnpm check:skill-identifier-liveness`: `Leg 1: 494 citation(s) over
76 published file(s) ...; Leg 2: 11 registered exhaustive section(s), 0
ledgered gap(s).`
- `pnpm --filter @objectstack/spec run check:skill-docs`, `pnpm --filter
@objectstack/lint run check:doc-formula-expressions`, `pnpm
check:skill-compatibility`, `check:skill-frame-sync`, `check:role-word`,
`check:corpus-claim-drift`, `check:doc-authoring`,
`check:published-files`, `check:nul-bytes`,
`check:cross-package-test-inputs`, `check:ratchet-remedy-authority`:
exit 0.
- The changeset gates (`check-changeset-no-major`,
`check-empty-changeset`, `check-adr-0087-registration`,
`check:changeset-gate-self-tests`): exit 0. `pnpm
check:pm-dispatch-gates`: exit 0 (574 s on a shared box).
- The remaining derived commands, each exit 0: the other `--self-test`
runs and the whole-tree families the list names on every card.

</details>

<details><summary>Outside the derived list, run because they read these
paths: all exit 0</summary>

- `pnpm --filter @objectstack/spec run check:skill-refs`,
`check:skill-served-sections`, `check:skill-examples` (`341 prose
examples type-check across 3 surface(s)`), `check:generated` (the last
two under the verify lock).
- `pnpm check:doc-anchors` (`1190 internal #fragment link(s) across 368
source file(s) all resolve`), `check:skill-top-level-keys`,
`check:changeset-fixed`, `check:engine-double-contract`,
`check:i18n-stale-fill`, `check:published-readme-exports`, `node
scripts/check-published-list-mirrors.mjs`, `node
scripts/check-dts-references.mjs --self-test`.
- `node scripts/check-platform-checklist.mjs --changed-from
origin/main`: `0 anchored files in the change set — nothing judged`.
- Local-only families: `pnpm check:dev-prereqs`, `pnpm
check:skill-frame-freshness`: exit 0.
- A control-byte scan of the three changed files: no hit.
- `node scripts/pm/overlap-check.mjs` before the push: `VERDICT clean
exit 0` against `origin/main` and the two open PRs that share a file.

</details>

Not run locally, CI's: `test:repo`, the type-check lanes, the build
job's own steps and the dogfood jobs, as the derivation lists them.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmSM46qymk97AyqPzoS)_

<!-- signed: repo:objectstack@os-steve · os-steve ·
session_01ADHkmSAjFEZHRpRq3WCj6z -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…tack-ai#38911)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi99QsuPTPkC1uKm2mViUT3Rf)_

Part of objectstack-ai#34770

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:用户无感;发给 AI 的「AI 技能、知识库、助手接入」技能说明,入口文件从约 30 KB 缩到 9
KB,只留开工前四项检查、两段可照抄的写法、十一个「写得通过、跑起来却不生效或做错」的坑和一份指路清单。
- 为什么做:这是「技能目录瘦身」的最后一份;入口文件每次都整份装进 AI 的上下文,越长越贵,也越容易漏读。
- 出错会怎样:只动教 AI 的文字,没有产品行为变化,可以直接撤回;风险是 AI
少读一段后答错,评测十五道题、每题三遍,定稿上又跑了一整轮:改动后四十五次对四十次,改动前对四十二次,没有哪道题在改动后每遍都错而改动前能对。
- 要你做什么:无。

## Rulings this executes

- **Card Scope** (decision record on the card, S3 = A): the entry file
holds first checks, at most about 8 traps and a routing list; 6–9 KB,
hard cap 500 lines; restated option lists and tables go behind a
pointer; no trap is removed until a publish-time check covers it or it
stays inline.
- **7128031203** fork 4 = A: ratchet rows are pinned at the measurement
with zero headroom, and the sum of ceilings does not rise; text may move
into `references/context-packs.md` only when it is about context packs.
Here one row falls, no row rises, none is added, and nothing moved: that
reference file already held every context-pack fact the entry had.
- **7168461386** = A: text an eval shows the entry lost goes back into
the entry, paid inside the entry. **Used once, on a softer signal than
the rule requires**: after the merge of `main`, two of three answers to
the passage-overlap case declined the overlap while saying they could
not tell whether a key for it exists. The split rule now says no key
adds one (the split schema is strict over `strategy`, `maxChars`,
`minChars`), paid by two cuts in the same section.
- **Ruling record 7249189592**, the parity rule: a case that fails on
every run of the head while `main` passes is a regression; a case whose
result flips between runs does not block. Read below on a full round of
each text: no case fails on every run of the head while `main` passes
it.
- **Seat order for this PR** (PR 8, `objectstack-ai`, the last of the
split): the same shape as the earlier entry files; no new file under
`skills/`.

**Seat rulings on this PR's three open questions** (given on the local
report, before this PR was opened):

1. **Trap count: A.** About ten traps is accepted (eleven since the
review round added the `confirmText` trap the review asked for),
provided each is of the accepted-then-wrong class; the contract review
checks each one. The list is under Budget reading below.
2. **Eval case 7: A.** The PR lands under ruling record 7249189592. The
forbidden-literal issue of case 7 is recorded here and in the report
only; no card.
3. **The two ☁️ claims: A.** They stay as on `main`, and are **not
verified against the cloud source**: the five trigger context fields and
`enableActionApproval: true`. The facts are `main`'s own and the wording
is `main`'s shortened (the same five field names; the same option, on
the same skip rule), so they are not new claims of this PR. See
Acceptance notes.

## Review round

**First round** (contract review 7311924709 on `100417af`: passed, with
one should-fix and nits), commit `ef824b4a`, pushed head `3342d3d1`
after one plain merge of `main` at `8338d070`.

- **S1, fixed.** The router listed the two destructive signals and
dropped `main`'s sentence that `confirmText` is not one, while "Where to
go" named the published `actions-as-tools` page for approval; that page
still lists `confirmText` as a signal and still gives the retired
pending answer. Checked against the code first: `actionLooksDestructive`
(`packages/runtime/src/action-execution.ts`) returns the declared
`ai.requiresConfirmation` when it is set, and otherwise `mode ===
'delete' || variant === 'danger'`; nothing reads `confirmText`, and no
`os validate` rule reads the pair, so `confirmText` on an exposed action
parses and the AI call runs unasked. Three changes inside the entry:
- a new trap under Actions: "**`confirmText` is dialog copy**: it gates
no AI call; `ai.requiresConfirmation: true` does."
- the pending answer is now stated for every door (`## MCP`, second
bullet): "at every AI door, `status: 'pending_confirmation'` with a
`pendingId` is a success, so relay its message and do not retry."
- "Where to go" names that page for dispatch only: "`actions-as-tools`
(dispatch)". The confirmation contract stays the first item of the list.

Paid inside the entry by wording cuts that carry no fact ("the flow,
hook or import that extracts it" became "whatever extracts it"; "and its
siblings in" the tool-name pointer; the routing list's parentheticals
after `connect-mcp` and `knowledge-rag`; "connected" in "the connected
agent"; a shorter `instructions` string in the skill example). The file
is 8,997 to 8,995 bytes, 186 to 184 lines; the row is re-pinned at the
measurement, 2243 to 2242. The page itself is untouched (outside the
surface; reported as an out-of-scope finding).
- **N2, fixed.** The changeset no longer says no rule's teaching
changes. It now reads: "One sentence of the old entry is corrected (the
pending answer, below); no other rule's teaching changes." It also names
the page for dispatch only and records that the `confirmText` rule stays
in the entry.
- **N1, not taken.** Pitfall 1 (a `provider` key) stays as the seat's
accepted deviation.
- **L1-b, the `satisfies` note: not taken.** The knowledge example keeps
`KnowledgeSourceSchema.parse({...})`: it is `main`'s form and the one
the fixed eval case 9 names as the expected answer, so changing the
idiom is a teaching change this round did not need. The note is right
that the type-checker does not judge the literal's keys under `.parse`
(its argument is untyped); the run-time parse does. This body no longer
calls that example "type-checked": it is compiled by
`check:skill-examples`, and its keys are judged at run time.
- **L1-b, the `split` note: not taken.** The split rule does not say the
key sits under `source`. The strict source schema refuses a `split`
anywhere else with the key's place, and the sentence would cost a kept
fact at this size.

## What changes

`skills/objectstack-ai/SKILL.md` becomes a router. The frontmatter and
the title are byte-identical, so what loads the skill does not change.
The file's sections are now: First checks, Skills, Actions as AI Tools,
MCP, Context packs, Knowledge Sources (RAG), Common Pitfalls, Where to
go.

| Old entry section | Now |
|:--|:--|
| The note on what ☁️ marks | Kept, shorter. |
| Skill Configuration (two key tables, the in-app `ask` paragraph) | One
type-checked example and three rules under `## Skills`. The key tables
are the contract's (`ai/skill.zod.ts`, whose docblocks say which edition
reads each key). The in-app `ask` paragraph (a package skill loads for
the app the user is in; a tool it names outside the allow-set is dropped
with a diagnostic): **cut, with no other home in this repository.** |
| Naming the tools: the resolution ladder | One rule: every `tools` name
resolves to a platform tool, an exposed action or a `stack.tools`
record, or `os validate` warns (`ai-skill-tool-unresolved`). The four
rungs are that warning's own text; the name lists are exported from
`@objectstack/spec/system`. |
| Skill Example | The example under `## Skills`, shorter. |
| Trigger Conditions | One rule: conditions route on the five context
fields the client reports and are never access control. The operator
table is the contract's. |
| Actions as AI Tools — the default path | Heading kept (another bundle
file names it). The opt-in and four traps stay: a tool record runs
nothing, an opted-in action can still be no tool, `confirmText` gates no
AI call, no page declares an AI button. The dispatch table is the
published page's (`docs/ai/actions-as-tools`, named for dispatch only);
the approval paragraph is the confirmation contract's
(`@objectstack/spec/contracts`); the request-body keys of an `api`
action are the contract's (`ui/action.zod.ts`). The cloud host's plugin
options (`apiActionBaseUrl`, `apiActionHeaders`, `apiClient`) and its
two predicates (`actionSkipReason`, `actionRequiresApproval`): **cut,
with no other home in this repository.** |
| MCP — the open-edition AI path | Heading kept (another bundle file
names it for the elicitation outcomes). The confirmation rule stays, as
five bullets, for every AI door. The plugin snippet, the switches and
the tool table are the published page's (`docs/ai/connect-mcp`) and each
tool's own description in `tools/list`. |
| Context packs — one record's material | Kept, as a pointer to
`references/context-packs.md` (untouched). |
| Knowledge Sources (RAG) | Heading kept. One compiled example (its keys
are judged by `.parse` at run time) and four rules: shipping and
"mounted is not enabled", what `content` is, one source per corpus,
`split` and the document unit. The key table, the retired keys, the
splitting detail and the five `knowledge-source-*` rules are the
contract's (`ai/knowledge-source.zod.ts`), the published page's
(`docs/ai/knowledge-rag`) and `os validate`'s. |
| Tool metadata (`defineTool`) — not the default path | One trap under
Actions ("Write no tool record"). The rest is the contract's
(`ai/tool.zod.ts`) and the published page's (`docs/ai/tools`). |
| Model Configuration | Pitfall 1 ("Naming a provider"). The table is
`AIModelConfigSchema` in `ai/agent.zod.ts`. |
| Common Pitfalls | Heading kept (another bundle file and the eval
runner's prompt name it). "Gating the action, not the state" stays
whole, under the same title. The `guardrails` pitfall is cut: a stack
does not author an agent, and the keys with their prescriptions are in
`ai/agent.zod.ts`. Two of its clauses, that `approval: 'always'` on an
MCP tool binding is an enforced gate and that AI metadata edits land as
drafts a person publishes: **cut, with no other home in the published
skills.** |
| Platform agents — reference only | The published page
(`docs/ai/agents`). The table of the built-in skills: **cut, with no
other home in this repository**; they are the cloud runtime's. |
| Verify your work, References | First checks 4 and 3. |

### A correction of a wrong sentence on `main`

This is the one place where the entry's teaching differs from `main`'s,
and it is its own review item.

- **What `main` says** (Actions as AI Tools, the Human-in-the-loop
paragraph): a queued call answers `{ status: 'pending_approval',
pendingActionId }` from an `ai_pending_actions` row.
- **What the source says**: that answer is retired from 19.0.0.
`packages/spec/src/contracts/ai-service.ts` carries the note ("A stored
`pending_approval` answer … That answer is retired"),
`ActionConfirmationPending` is `status: 'pending_confirmation'` with a
`pendingId`, and
`packages/spec/src/migrations/entries/semantic/19.ai-pending-action-queue-merged-into-confirmation-service.ts`
is the migration that merges the in-app queue into the confirmation
service every door uses.
- **What the entry says now**, once, for every AI door (`## MCP`, second
bullet): "at every AI door, `status: 'pending_confirmation'` with a
`pendingId` is a success, so relay its message and do not retry."
- **Not corrected here**: the published page
`content/docs/ai/actions-as-tools.mdx` still carries the retired answer
and lists `confirmText` as a destructive signal. It is outside this PR's
surface and is reported as an out-of-scope finding; since the review
round the entry names that page for dispatch only.

**The two additions `main` gained the same day** (objectstack-ai#38855, the document
unit and the held knowledge service) were folded in after its merge, by
the router's standard (true, and an author needs it before opening the
contract):

| What objectstack-ai#38855 added to the old entry | In the router |
|:--|:--|
| A shipped item mounts the knowledge service, which does not enable it:
the service is held until an embedder provider is saved, the store is
mounted and the server restarts | **Kept**, one clause in the Shipping
rule: "Mounted is not enabled: with no embedder at boot, sources are
held". Scoped to the half that is always true; the store half is the
published page's. |
| Held sources are listed, never built or searched; `search_knowledge`
is not offered; a search or a run-time save answers 503 naming the
missing half | **Kept**, same clause: "listed, never searched, no
`search_knowledge`. Unmounted or held, a run-time save is refused
(`503`)". A skill that binds `search_knowledge` is the author-side
consequence. |
| `os knowledge status` prints the state and why; `os knowledge rebuild`
exits 1 with it | `os knowledge status` **kept** (three words); the
`rebuild` exit is the published page's. |
| The remedy where an app ships none: add `requires: ['knowledge']`,
restart, save an embedder provider, restart again | The `requires` half
**kept**; the two restarts are the refusal's own text and the published
page's. |
| The `source.documentBy` table row | **Pointer**: the key table left
the entry; the `documentBy` docblock in the contract and the published
page say which field it may name and what rebuilds. |
| An app that cuts its own passages writes each as a child record
indexed with `split: { strategy: 'whole' }` and `documentBy`;
`granularity: 'record'` then counts and groups by parent | **Kept**, one
sentence in the split rule. |
| "`maxChars`, in characters" (a wording cut) | Not applicable: the
sentence left the entry. |

**Sizes** (bytes; tokens are the ratchet's, the release-stamp line
unpriced):

| | `main` at `8338d070` | head `3342d3d1` |
|:--|--:|--:|
| `skills/objectstack-ai/SKILL.md` | 30,020 B · 518 lines · 7,499 tokens
| 8,995 B · 184 lines · 2,242 tokens |
| `skills/objectstack-ai/**` (4 files) | 59,051 B | 38,026 B |
| the same without `evals/` (3 files) | 40,120 B | 19,095 B |
| all 14 `SKILL.md` | 141,450 B · 2,475 lines | 120,425 B · 2,141 lines
|
| `skills/` (115 files) | 1,182,544 B | 1,161,519 B |
| `skills/` without `evals/` (73 files) | 818,440 B | 797,415 B |
| ratchet, authored sum (61 rows) | 186,955 tokens | 181,698 tokens |
| ratchet, bundle total | 292,844 tokens | 287,587 tokens |

**Ratchet rows.** `skills/objectstack-ai/SKILL.md`: 7499 to 2242, pinned
at the measurement (`ceil((8995 - 27) / 4)`), headroom 0 (2243 on the
first head, 2242 after the review round).
`skills/objectstack-ai/references/context-packs.md`: 1453, untouched.
The sum of all ceilings falls by 5,257; no row rises and none is added.
`main`'s three dated notes on this row (the document unit, mounted is
not enabled, their review round) stay above the new one.

**Budget reading.** 8,995 bytes is on the 9 KB line, as PR 7's 9,000
was. The trap count is eleven since the review round, not about eight
(seat ruling 1 above accepts it; the review checks each is accepted and
then wrong):

1. A tool record (`defineTool`) parses and runs nothing.
2. An opted-in action can still be no tool (a UI-only type; a
destructive one skipped in-app).
3. `confirmText` on an exposed action: parses, and the AI call runs
unasked (added in the review round).
4. An action written as an "Ask AI" button: no page declares one.
5. A stack-authored agent parses and is never served; skills are the one
extension.
6. A `tools` name that resolves to nothing only warns; over MCP the
prompt is then not offered.
7. `triggerConditions` used as access control: they only route.
8. `confirm` sent to `run_action`, a pending answer retried, a script
deciding a pending item (the confirmation rule).
9. A knowledge source whose `content` holds a `file` field or short
values: accepted, and nothing useful is indexed.
10. A shipped source on a deployment with no embedder: mounted, held,
never searched.
11. A gate on the action with no lock on the state (pitfall 2).

Pitfall 1 (a `provider` key) is a twelfth item of the loud kind (a
retired key, refused with its fix); it is kept for the sampling keys
named beside it.

## Tests

### Eval parity

Command, every full round: `pnpm --filter @objectstack/scenarios
skill-evals --skills objectstack-ai --repeats 3 --concurrency 4
--max-utilization 0.99`, with the model and effort flags the ruling
names; CLI 2.1.333, subscription login. 15 behaviour cases in
`evals/skills-tools-knowledge.json` on both arms; the bundle has no
trigger cases. The file is untouched. 90 turns a round.

**The reading the rule is judged on**: one full round on each text, 90
of 90 turns each. `main`'s round is the one of the first head's judged
pair (09:19Z; `main`'s entry has not changed since). The head's round is
new, on the pushed head `3342d3d1` after the review round (13:50Z to
13:57Z); the seat's order for this round was one after round and no new
before round.

| case | subject | `main`'s entry, 30,020 B (with-skill · no-skill) |
head `3342d3d1`, 8,995 B (with-skill · no-skill) |
|:--|:--|--:|--:|
| 1 | a triage skill with tools and trigger conditions | 3/3 · 0/3 | 3/3
· 0/3 |
| 2 | provider, temperature and token cap | 3/3 · 0/3 | 3/3 · 0/3 |
| 3 | a knowledge source over published articles | 3/3 · 0/3 | 3/3 · 0/3
|
| 4 | a tool record for an existing action | 3/3 · 0/3 | 3/3 · 0/3 |
| 5 | a stack-authored agent with tools and knowledge | 0/3 · 0/3 | 0/3
· 0/3 |
| 6 | a script that approves pending actions | 3/3 · 0/3 | 3/3 · 0/3 |
| 7 | an agent that retries with `confirm: true` | 3/3 · 0/3 | 1/3 · 0/3
|
| 8 | elicitation outcomes on a stdio server | 3/3 · 0/3 | 3/3 · 0/3 |
| 9 | Markdown splitting with a requested overlap | 3/3 · 0/3 | 3/3 ·
0/3 |
| 10 | an Ask AI button on a record page | 3/3 · 0/3 | 3/3 · 0/3 |
| 11 | a context pack with a related list | 3/3 · 0/3 | 3/3 · 0/3 |
| 12 | a skill that names its context pack | 3/3 · 0/3 | 3/3 · 0/3 |
| 13 | "index every text field" | 3/3 · 0/3 | 3/3 · 0/3 |
| 14 | sources created at run time | 3/3 · 0/3 | 3/3 · 0/3 |
| 15 | two corpora, numbers and a file field | 3/3 · 0/3 | 3/3 · 0/3 |
| **all** | | **42/45 · 0/45** | **40/45 · 0/45** |

The `main` round ran with `main`'s entry text in the working tree of the
head checkout (the runner reads `skills/` from disk), and the tree was
restored and confirmed clean afterwards. The head round ran on the
pushed commit itself; its record names `3342d3d1` with no uncommitted
change.

**Reading under the parity rule: no regression.** No case fails on every
run of the head while `main` passes it. The head's total is two lower,
in one case:

- **Case 7: head 1 of 3; `main` 3 of 3.** Both failing answers are
correct: they refuse the retry and name `pending_confirmation`,
`pendingId` and `no_confirmation_service`. One quotes the user's own
step ("ask in chat and then retry with `confirm: true`"), which is the
case's forbidden literal `then retry with`; the other writes that the
agent "should not retry", where the case wants `do not retry`. Across
every round: head 7 of 15, `main` 8 of 9 (its one failure is the same
quotation). Not a regression under the rule, and the fact the case tests
is in every answer; the count is lower on the head and is reported as
such. Seat ruling 2: recorded here and in the report only.
- **Case 9: 3 of 3 on both** in this round (2 of 3 on the first head's
round, 1 of 3 before the "no key adds one" clause).
- **Case 5: 0 of 3 on both.** Every answer refuses the agent and
declares a skill; they miss the literals `surface` and `aiExposed`,
which the entry carries on both trees. Head 1 of 15 across rounds,
`main` 0 of 9.

**Quota, read from each turn's record.** Guard `--max-utilization 0.99`
on every round; window `seven_day`, status `allowed_warning` throughout.
This round: 0.90 at its first turn and 0.90 at its last. The first
head's judged pair: 0.74 to 0.75. Earlier rounds: 0.67 (06:57Z) rising
to 0.71 (07:42Z), 0.74 (09:12Z).

**Earlier rounds**, kept as the record of how the text got here:

| reading | text | with-skill | no-skill | with-skill cases below 3 of 3
|
|:--|:--|--:|--:|:--|
| before, two halves, 48 + 42 turns, 06:57Z | `main` at `5bd786e4`,
29,014 B | 42/45 | 0/45 | case 5, 0 of 3 |
| after 1, 90 turns, 07:17Z | local `3535c42b`, 8,999 B | 40/45 | 1/45 |
case 5, 0 of 3; case 7, 1 of 3 |
| after 2, 90 turns, 07:31Z | local `2ba55dab`, 8,998 B | 41/45 | 0/45 |
case 5, 0 of 3; case 11, 2 of 3 (a `filter:` in prose) |
| before 2, 90 turns, 07:36Z | `main`'s 29,014 B text | 41/45 | 0/45 |
case 5, 0 of 3; case 7, 2 of 3 |
| after 3, 90 turns, 09:12Z | local `9d96b284`, 8,993 B, the first text
with objectstack-ai#38855 folded in | 39/45 | 0/45 | case 5, 1 of 3; case 7, 1 of 3;
case 9, 1 of 3 |
| after 4, 90 turns, 09:26Z (the first head's judged round, one window
with `main`'s) | `66c16628`, 8,997 B, the text of head `100417af` |
39/45 | 0/45 | case 5, 0 of 3; case 7, 1 of 3; case 9, 2 of 3 |

### Other tests

All on the pushed head `3342d3d1`, under the verify lock, `VERDICT
command-exit 0` each:

- `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2
scripts/platform-catalog.test.ts scripts/skill-map-guards.test.ts`: 2
files, 57 tests passed.
- `pnpm --filter create-objectstack exec vitest run --maxWorkers=2
src/created-summary.test.ts src/scaffold-skills-single-copy.test.ts`: 2
files, 34 tests passed. `created-summary.test.ts` is the one test file
that names this skill.
- `pnpm --filter @objectstack/spec run check:skill-examples`: `341 prose
examples type-check across 3 surface(s)`. The entry's two blocks are
among them (the skill example is typed by `defineSkill`; the knowledge
example's literal is an untyped argument of `.parse`).

No behaviour a test pins changed, so no ablation is owed.

## Acceptance notes

- **Anchors.** Gone from the entry: `#skill-configuration`,
`#naming-the-tools-the-resolution-ladder`, `#skill-example`,
`#trigger-conditions`,
`#tool-metadata-definetool--not-the-default-path`,
`#model-configuration`, `#verify-your-work`, `#references` and the
anchor of "Platform agents — reference only". New: `#first-checks`,
`#skills`, `#where-to-go`. No file in this repository linked an anchor
of the old entry; five places name a heading or a pitfall in prose
(`objectstack-automation` twice, `objectstack-platform`,
`objectstack-ui`, the eval runner's prompt), and each still resolves.
- **Cut, with no other home** (also marked in the table above): the
in-app `ask` allow-set paragraph; the cloud host's plugin options and
two predicates; the built-in skills table; `approval: 'always'` on an
MCP tool binding as an enforced gate; AI metadata edits landing as
drafts. Each describes the cloud runtime or a host option, none is
authorable metadata of a stack.
- **Two ☁️ claims: not verified against the cloud source; the facts are
identical to `main`'s** (seat ruling 3). This session cannot read the
cloud repository. They are the five trigger context fields (`appName`,
`objectName`, `recordId`, `selectionKind`, `userRole`; `main`: "The
client sends all five") and `enableActionApproval: true` (`main`: a
destructive action is skipped "unless the plugin runs with
`enableActionApproval: true`"). The wording is shortened, the facts are
not changed. Every open-edition claim in the entry was checked against
`main`'s contract, runtime or lint source.
- **A published page teaches two retired facts** (outside this PR's
surface; untouched, reported as an out-of-scope finding, and since the
review round named by the entry for dispatch only):
`content/docs/ai/actions-as-tools.mdx` lists `confirmText` among the
destructive signals and says a queued call answers `{ status:
'pending_approval', … }`. The runtime's destructive test reads
`ai.requiresConfirmation`, `mode: 'delete'` and `variant: 'danger'`
only, and the contract retired `pending_approval` in 19. The entry
states both rules itself.
- **Eval literals that a correct answer can trip** (cases untouched;
recorded here and in the report only, no card, seat ruling 2): case 7
forbids `then retry with`, which an answer quoting the user's own step
contains; case 9 forbids `overlap: 100`, which a refusal can quote; case
5 requires `aiExposed` in an answer about agents.
- **objectstack-ai#38857** (the release bot's version PR) shares this file through the
frontmatter stamp line only; `overlap-check` merges it cleanly.
- **Not done here**: the published AI pages are not edited; `evals/**`
is untouched; no file is added under `skills/`.

## Verification

Read first, by risk:

1. `skills/objectstack-ai/SKILL.md`, the whole file: is anything a model
needs before opening the contract missing? The risk hunks are `##
Actions as AI Tools` (the `confirmText` trap added in the review round),
`## MCP` (five bullets replace the old section and correct the pending
answer) and `## Knowledge Sources (RAG)` (four rules replace about 130
lines, and carry the two facts folded in from objectstack-ai#38855).
2. `.changeset/34770-ai-skill-router.md`: the "what left, and what
answers it now" list is the record of every cut.
3. `scripts/check-skills-token-ratchet.mjs`: the `objectstack-ai` row.

Two-minute check: `node scripts/check-skills-token-ratchet.mjs` prints
`ratcheted (authored) 181698 / 181698 (+0)` and
`skills/objectstack-ai/SKILL.md 2242 / 2242 (+0)`; `wc -c
skills/objectstack-ai/SKILL.md` prints 8995.

Gates, local, each exit code captured before any pipe. The whole derived
list ran on the pushed head `3342d3d1` (tree `e6dacb82`), after one
plain merge of `main` at `8338d070` (the list was STALE before it) and a
rebuild of the merged workspace.

<details><summary>Derived families on head `3342d3d1`: 69 derived, 69
run green, 0 NOT MEASURED</summary>

- Reconciliation: `✓ dispatch-gates --ran: 69 derived famil(ies)
accounted for — 69 run, 0 NOT-MEASURED (a DERIVED zero — all 69 recorded
an exit code and none of them is 3).` No STALE TREE warning: the head's
merge base is `main`'s tip at the reconciliation.
- `node scripts/check-skills-token-ratchet.mjs`: `✓
check-skills-token-ratchet: 61 authored bundle file(s) within their
ceilings; 11 generator-owned file(s) and 42 eval fixture(s) measured,
not ratcheted.` (`ratcheted (authored) 181698 / 181698 (+0)`, `bundle
total 287587`); its `--self-test`: `111 cases pass`.
- `pnpm check:dual-build-cjs-loads`: `127 published require entry
point(s) across 75 package(s) load; 2594 emitted CommonJS file(s)
parse`. It reads every package's built `dist/`; `pnpm build
--concurrency=2` ran first on the merged tree under the verify lock
(`VERDICT command-exit 0`, `124 successful, 124 total`).
- `pnpm check:dts-closure`: `124 built package(s) swept - 326/326
declared declaration file(s) present`.
- `pnpm check:skill-links`: `286 relative link(s) in 76 published skill
file(s) resolve; 161 fragment(s) name a real heading under GitHub's slug
rule.`
- `pnpm check:skill-identifier-liveness`: `Leg 1: 456 citation(s) over
76 published file(s) ...; Leg 2: 11 registered exhaustive section(s), 0
ledgered gap(s).`
- `pnpm --filter @objectstack/spec run check:skill-docs`, `pnpm --filter
@objectstack/lint run check:doc-formula-expressions`, `pnpm
check:skill-compatibility`, `check:skill-frame-sync`, `check:role-word`,
`check:corpus-claim-drift`, `check:doc-authoring`,
`check:published-files`, `check:nul-bytes`: exit 0.
- The changeset gates (`check-changeset-no-major`,
`check-empty-changeset`, `check-adr-0087-registration`,
`check:changeset-gate-self-tests`): exit 0. `pnpm
check:pm-dispatch-gates`: exit 0.

</details>

<details><summary>Beside the derived list, on head `3342d3d1`, all exit
0</summary>

- `pnpm --filter @objectstack/spec run check:skill-refs`: `10 generated
files in sync with packages/spec`.
- `pnpm --filter @objectstack/spec run check:skill-served-sections`: `24
served section(s), each heading exactly once in its file`.
- `pnpm check:doc-anchors`: `1197 internal #fragment link(s) across 368
source file(s) all resolve to a real heading`.
- `pnpm check:published-readme-links`: `567 outbound link(s) across 169
published markdown file(s)`. It does not read `skills/`.
- `pnpm check:skill-top-level-keys`, `pnpm check:skill-frame-freshness`,
`pnpm check:dev-prereqs`, `pnpm check:changeset-fixed`, `node
scripts/check-published-list-mirrors.mjs`, `pnpm
check:published-readme-exports`, `pnpm check:engine-double-contract`,
`pnpm check:i18n-stale-fill`: exit 0.
- `pnpm --filter @objectstack/spec run check:generated`, after the merge
and the rebuild: `All 14 generated artifacts are up to date`.
- `node scripts/check-platform-checklist.mjs --changed-from
origin/main`: `0 anchored files in the change set — nothing judged.`
- A control-byte scan of the three changed files finds none.

</details>

`node scripts/pm/overlap-check.mjs` before the push of `3342d3d1`:
`VERDICT clean exit 0` (`origin/main` at `8338d070` merges cleanly;
objectstack-ai#38915 shares the ratchet script and merges cleanly; objectstack-ai#38857, the release
bot's version PR, shares the entry's stamp line and merges cleanly). Not
run locally: `test:repo` (CI's).

---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmSM46qymk97AyqPzoS)_

<!-- signed: repo:objectstack@os-steve · os-steve ·
session_01ADHkmSAjFEZHRpRq3WCj6z -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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 pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

3 participants