Skip to content

Commit d16dc4b

Browse files
committed
docs(skills): objectstack-ai teaches knowledge sources over business objects
Long free text only, one source per corpus with sourceIds, attachment text through a text field. One eval case; the token ratchet row follows the measurement. Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP Co-authored-by: Claude <noreply@anthropic.com>
1 parent f19350b commit d16dc4b

4 files changed

Lines changed: 64 additions & 4 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): `objectstack-ai` teaches knowledge sources over business objects, not only a document library
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`skills/objectstack-ai` § Knowledge Sources (RAG) gains three rules, one example each:
11+
12+
- **Long free text only.** `content` lists prose fields (an article body, a ticket's `description`, a note). Numbers, dates, statuses and short names stay out, and counts and filters go to the record tools.
13+
- **One source per corpus.** A skill's `instructions` say which source to pass in `sourceIds`, the argument of `search_knowledge`; omitted, every exposed source is scanned.
14+
- **Attachment text goes through a field.** No source reads a file, and a `file` field in `content` adds no file text: write the extracted text to a `textarea` field and list that field.
15+
16+
No behaviour changes.

‎scripts/check-skills-token-ratchet.mjs‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,24 @@ export const CEILINGS = new Map([
513513
// ceil(27623 / 4) = 6906; the row moves +13, the measured remainder only.
514514
// Pinned AT the measurement.
515515
// ceil(($(wc -c < skills/objectstack-ai/SKILL.md) - 27) / 4) == ceil(27623 / 4)
516-
['skills/objectstack-ai/SKILL.md', 6906], // -18 (was 6824), then -5 A2′ (was 6806)
516+
// 6906 -> 7109 (2026-11-28, knowledge sources over business objects): the
517+
// section taught a source for a document library only. It now says three
518+
// things, one example each: `content` lists long free text only, and counts
519+
// and filters go to the record tools; one source per corpus, a skill's
520+
// `instructions` naming which to pass in `sourceIds`, the argument of
521+
// `search_knowledge`; attachment text reaches an index through a text field,
522+
// since no source reads a file. Raise path the standing ruling
523+
// 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B). PAID DOWN
524+
// FIRST: the `content` row's "Meaningful text only, never ids or system
525+
// fields" (the first rule says it), and the `agent.knowledge` pitfall row's
526+
// "describe intended grounding in `instructions`" (the second rule says it);
527+
// the retired-kinds line's "no form in 19" became a pointer to the third
528+
// rule. Arithmetic in priced bytes (stamp line excluded), against `main`'s
529+
// 27621 (the row's 6906, headroom 0): the file is 27648 -> 28461 bytes, so
530+
// the LANDED priced text is 28434 -> ceil(28434 / 4) = 7109; the row moves
531+
// +203, the measured remainder only. Pinned AT the measurement.
532+
// ceil(($(wc -c < skills/objectstack-ai/SKILL.md) - 27) / 4) == ceil(28434 / 4)
533+
['skills/objectstack-ai/SKILL.md', 7109], // -18 (was 6824), then -5 A2′ (was 6806)
517534
// -12 (was 6331): the `http.server` decision-table row dropped a trailing
518535
// clause that taught `contributes.routes` as a key that "parses but serves
519536
// nothing". The key is retired — an authored entry is now REFUSED, carrying

‎skills/objectstack-ai/SKILL.md‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ object or field, when you may not search that object or query a field it reads.
258258
| `adapter` | Optional store id (`pgvector`, `turso`, `memory`). Omitted: the deployment's store (`pgvector` on PostgreSQL, `turso` otherwise), else the only one registered; several and none the deployment's is refused, naming them |
259259
| `source.kind` | `'object'`, the one kind |
260260
| `source.object` | The object whose records are indexed |
261-
| `source.content` | Non-empty list of the fields whose text is indexed, in order. `'*'` is refused: it would also send fields added later. Meaningful text only, never ids or system fields |
261+
| `source.content` | Non-empty list of the fields whose text is indexed, in order. `'*'` is refused: it would also send fields added later |
262262
| `source.metadataFields` | Fields kept for search-time filtering (`status`, `owner_id`, `tags`) |
263263
| `source.where` | ObjectQL `where`: keeps drafts and archived rows out |
264264
| `source.split` | How documents are cut into passages (below) |
@@ -270,7 +270,7 @@ Retired in 19, each refused with its fix: `id` (use `name`), `contentFields`
270270
deployment configures one embedder), `vectorStore` (the store is `adapter`),
271271
`adapterConfig` (an adapter takes plugin options), `refresh.cron` (call
272272
`reindexSource` from a flow or job), and `source.kind: 'file'` / `'http'` with
273-
`prefix`, `mimeTypes`, `urls`, `userAgent` (no form in 19). `os migrate meta
273+
`prefix`, `mimeTypes`, `urls`, `userAgent` (attachment text: below). `os migrate meta
274274
--from 18` lists a stack's edits; edit a registration in code by hand.
275275

276276
`os validate` and publish check each source; an error refuses the publish:
@@ -306,6 +306,22 @@ export const supportKb: KnowledgeSource = KnowledgeSourceSchema.parse({
306306
});
307307
```
308308

309+
**Sources over business objects**, not only a document library:
310+
311+
- **Long free text only.** `content` lists prose: an article body, a ticket's
312+
`description`, a note. Numbers, dates, statuses and short names stay out;
313+
counts and filters go to the record tools. "Which customers reported login
314+
loops?" is `search_knowledge`; "how many tickets are open per priority?" is
315+
`aggregate_records`.
316+
- **One source per corpus**, and a skill's `instructions` say which to pass in
317+
`sourceIds`: `search_knowledge({ query, sourceIds: ['ticket_bodies'] })`
318+
searches the tickets and not `support_kb`. Omitted, every exposed source is
319+
scanned.
320+
- **Attachment text goes through a field.** No source reads a file, and a
321+
`file` field in `content` adds no file text. Have the flow, hook or import
322+
that extracts the text write it to a `textarea` field
323+
(`contract.attachment_text`), and list that field.
324+
309325
**Splitting (`split`).** The knowledge service cuts each document into passages
310326
for a store declaring `capabilities.chunks`; any other store receives whole
311327
documents. `split: { strategy, maxChars?, minChars? }` — `strategy` is required
@@ -461,7 +477,7 @@ https://objectstack.ai/docs/protocol-upgrade:
461477
| Retired key | Removed in 17, tombstone gone in 18 — why, and what replaces it |
462478
|:--|:--|
463479
| `agent.tools` | The inline slot resolved names against the *full* registry with no surface check. Not a rename: the strict schema refuses the key as unknown; re-declare each tool in a `defineSkill` under the stack's `skills` (ADR-0064) |
464-
| `agent.knowledge` | Declaring sources/indexes on an agent never scoped retrieval — `search_knowledge` takes `sourceIds` from the model's tool-call arguments. Restrict on the knowledge source (`aiExposed`, `source.where`); describe intended grounding in `instructions` |
480+
| `agent.knowledge` | Declaring sources/indexes on an agent never scoped retrieval — `search_knowledge` takes `sourceIds` from the model's tool-call arguments. Restrict on the knowledge source (`aiExposed`, `source.where`) |
465481

466482
---
467483

‎skills/objectstack-ai/evals/skills-tools-knowledge.json‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,17 @@
153153
"must_contain_any": [["requires: ['knowledge']", "requires: [\"knowledge\"]"]],
154154
"must_not_contain": ["contentFields:"]
155155
}
156+
},
157+
{
158+
"id": 15,
159+
"prompt": "Our support app has `kb_article` (`title`, `body`) and `support_ticket` (`subject`, `description` as a textarea, `priority`, `status`, `amount`, and a `contract_pdf` file field holding a signed PDF). The assistant should answer from article bodies, from ticket descriptions and from what the PDFs say, and also tell us how many open tickets there are per priority. Design the knowledge sources and say how a skill should search them. None of the project's files are in this directory: write the files in your answer.",
160+
"expected_output": "Writes two `knowledge_source` items, one per corpus (articles, tickets), each `source: { kind: 'object', … }` with an explicit `content` list of long free-text fields only: `title` / `body` for articles, `subject` / `description` for tickets. `priority`, `status` and `amount` are not in `content` (at most `metadataFields`), and the count of open tickets per priority is answered by a record tool (`aggregate_records` / `query_records`), not by `search_knowledge`. The PDF is not indexed from the `contract_pdf` file field and no `kind: 'file'` or `'http'` source is written (both retired): the extracted text is first written to a text field on the record (a `textarea`, filled by a flow, hook or import) and that field is listed in `content`. The skill's `instructions` tell the model which source to search by passing `sourceIds` to `search_knowledge`, so a question does not scan every source; no second argument shape and no `knowledge` key on the skill is invented.",
161+
"files": [],
162+
"assertions": {
163+
"must_contain": ["sourceIds", "content:", "textarea"],
164+
"must_contain_any": [["aggregate_records", "query_records", "aggregate_data"]],
165+
"must_not_contain": ["kind: 'file'", "kind: \"file\"", "kind: 'http'", "contentFields:", "'contract_pdf']", "'amount']", "'priority']"]
166+
}
156167
}
157168
]
158169
}

0 commit comments

Comments
 (0)