Skip to content

docs(skills): objectstack-ai teaches the context pack (ai_context); the record-context docs name both mounts - #37409

Queued
objectstack-fleet[bot] wants to merge 3 commits into
mainfrom
claude/project-thread-gx2ord
Queued

objectstack-fleet[bot] wants to merge 3 commits into
mainfrom
claude/project-thread-gx2ord

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

Fixes #37177

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:替客户写应用的 AI 助手,现在能从随产品发布的技能文档里学会怎样写「资料包」,也就是挑出一条记录的哪些字段、关联列表和正文交给 AI;产品本身的行为没有变化。
  • 为什么做:属于「在一条记录上问 AI」专题;资料包这个新的元数据类型此前在技能文档里只有一个名字,作者无从下笔。
  • 出错会怎样:最坏是技能文档某句话教错,AI 写出的资料包被校验拒收或读到的内容比预期少;已有应用不受影响,撤回即可恢复。
  • 要你做什么:批准这次技能文件改动(受管文件,需要你批准后才能合入)。

What changes

New reference skills/objectstack-ai/references/context-packs.md (111 lines, 1454 tokens). It teaches authoring an ai_context pack from what main at 9ffe37153 enforces:

Pointers in the two SKILL.md files, paid by deleting restatement in the same file. Neither SKILL.md ceiling row moves.

  • skills/objectstack-ai/SKILL.md: a five-line "Context packs" section, a get_record_context row in the MCP tools table, and the frontmatter description and tags name the context pack.
  • skills/objectstack-platform/SKILL.md: the requires token row says what record-context serves and links the reference; the ADR-0150 list of names "identified by package and name" gains context packs.

N1 and N2 of scope note 7166997849 (prose only).

  • N1: the aiContexts .describe() and its TSDoc in packages/spec/src/stack.zod.ts no longer read the token as the only serving condition. They name both mounts: the CLI mounts the service where requires includes record-context, and a host that composes its own kernel lists RecordContextServicePlugin in plugins. Regenerated mirror: content/docs/references/api/package-api-assembled.mdx.
  • N2: packages/services/service-record-context/README.md and the RecordContextServicePlugin docblock teach the token beside the plugins[] mount.
  • Patch changeset for @objectstack/spec and @objectstack/service-record-context.

Eval case 11 in skills/objectstack-ai/evals/skills-tools-knowledge.json: the card's prompt ("give the AI a customer's open opportunities and notes").

One new ratchet row in scripts/check-skills-token-ratchet.mjs for the new reference, pinned at the measurement (5813 bytes, ceil(5813 / 4) = 1454, zero headroom). It is the seat's claim amendment 2 on the card, comment 7179788843: "one new row in check-skills-token-ratchet.mjs for the new references/context-packs.md, pinned at the measured size".

Container & model: M, mode:thread, model: CONTRACT_REVIEW_TIER (MANDATORY for skills/**, served at tier; claim amendment 7179771295), effort: high

Skills readings (base 9ffe37153, head e9b2056f)

File Lines Tokens (ceil(bytes / 4), the ratchet's count)
skills/objectstack-ai/SKILL.md 485 to 487 6787 to 6798 (ceiling 6801, unchanged)
skills/objectstack-platform/SKILL.md 422 to 422 6149 to 6149 (ceiling 6149, unchanged)
skills/objectstack-ai/references/context-packs.md 0 to 111 0 to 1454 (new row 1454)
skills/objectstack-ai/evals/skills-tools-knowledge.json 105 to 115 2668 to 2997 (eval fixture, not ratcheted)
All SKILL.md files together 4959 to 4961
Whole skills/ tree 23130 to 23253 ratcheted authored 198131 to 199596; bundle total 297515 to 299309

What was deleted to pay for the pointers, and where each fact still lives

The discipline is the standing ruling of record 6513306068, quoted verbatim: 「A:先削重复,余额按实测提高」. Only its first half is used here: restatement is cut, and no SKILL.md row is raised.

skills/objectstack-ai/SKILL.md (+11 tokens net, inside the 14 of headroom it had):

  1. The Agent → Skill → Tool diagram. Still taught: a skill's tools row ("Tool names this skill grants"), "An agent's tool set is the union of its surface-compatible skills' tools" (Platform agents), and the three captions by the Skill Configuration table, the Actions dispatch table and the Platform agents section.
  2. "You usually don't author tool definitions by hand for action invocation." Still taught by that section's own heading ("the default path"), ladder rung 3, and "Default: declare no tool records" (Tool metadata).
  3. The Verify block's # or: os build comment line. Still taught in skills/objectstack-platform/references/operations.md ("os build # the same three gates, plus emits dist/objectstack.json"), which the section points to. This home is in another file.
  4. The Knowledge example's // or 'memory' for dev/test comment. Still taught by the Wiring paragraph above it.

skills/objectstack-platform/SKILL.md (net 0):

  1. "Embed any domain prefix directly in the name (e.g. name: 'crm_account')". Still taught by the next two paragraphs (manifest.namespace: every object.name must start with crm_; "Which names carry the namespace").
  2. "(one task.object.ts per object)". Still taught by the Naming Conventions row ({name}.{type}.ts, task.object.ts).
  3. "handed to the stack key of its name" on the barrel sentence. Still taught by The Template's barrel bullet.

Tests

Example validity (card What 3)
  • The reference's os:check block parsed with the built AiContextSchema: parse success: true. Seven controls on the same pack were each refused: limit: 21, a description key, a $contains operator, 4 related lists, 31 fields, 11 related columns, direction in orderBy.
  • os validate on a scratch stack (objects account and opportunity, the block's pack, requires: ['record-context']): Validation passed, exit 0, no ai-context-* warning. Control on the same stack with a where field the child lacks and a body.field that is not long text: ai-context-field-unknown at aiContexts[0].related[0].where and ai-context-body-not-long-text at aiContexts[0].body.field. The scratch stack was deleted.
  • pnpm --filter @objectstack/spec run check:skill-examples: 352 prose examples type-check across 3 surface(s), exit 0.
Eval case 11, graded with `gradeAnswer` (packages/qa/scenarios/src/skill-evals/grade.ts)
  • A reference answer (an aiContexts entry with the related opportunity list filtered by stage, body: { field: 'notes' }, requires: ['record-context']): {"pass":true,"missing":[],"forbidden":[]}.
  • Control, the wrong shape (an object-level aiReadable, a top-level filter:, direction:): {"pass":false,"missing":["opportunity","related","where","body","notes","record-context"],"forbidden":["filter:","direction:","aiReadable"]}.
Eval case 11, run against a model (seat L1 item S1, record 7181297604)

One round of the repository's runner on head e9b2056f: pnpm --filter @objectstack/scenarios skill-evals --skills objectstack-ai --concurrency 4 (the runner selects by bundle, not by case, so all 11 cases ran; 22 of 22 turns, each case once with the bundle installed and once without; subscription login, no API key; the served model is in the round's run records and is not written here, repository rule).

  • Case 11, with the skill: pass, missing: [], forbidden: []. The turn launched objectstack-ai and read objectstack-ai/references/context-packs.md.
  • Case 11, without the skill: fail, missing: ["related","where","body"], forbidden: ["filter:"]. The no-skill answer reached for a top-level filter:, which is the mistake the case forbids.
  • The pack in the with-skill answer, as the model wrote it:
export const AccountBrief: AiContext = {
  name: 'account_brief',
  label: 'Customer brief: open opportunities and notes',
  object: 'account',
  fields: ['name'],
  related: [
    {
      object: 'opportunity',
      field: 'account',
      fields: ['name', 'stage'],
      where: { stage: { $nin: ['closed_won', 'closed_lost'] } },
      limit: 20,
    },
  ],
  body: { field: 'notes' },
};
  • The same answer adds requires: ['record-context'] on the stack and says that without it nothing serves get_record_context.
  • That literal through AiContextSchema.safeParse on this head: model answer pack parse success: true. Not measured: os validate on it (the answer names no object definitions to validate against).
  • The other ten cases, same round: with the skill 9 of 11 pass, without it 0 of 11. Cases 5 and 6 fail with the skill (missing aiExposed; missing signed-in session). The same round on the base text (skills/objectstack-ai as of 9ffe37153, 10 cases, 20 of 20 turns): 8 of 10 with the skill, and the same two cases fail (5 missing skills, aiExposed; 6 missing signed-in session, refused). Both cases are red before this diff, on sentences this diff does not touch; they are not fixed here.
  • One repeat per arm, so each figure is one draw, not a rate.
Packages and gates (local, head `e9b2056f` unless a line says otherwise)
  • pnpm --filter @objectstack/spec test: Test Files 896 passed (896), Tests 28442 passed | 1 todo; the lock's line VERDICT command-exit 0.
  • pnpm --filter @objectstack/service-record-context typecheck, its test (Test Files 2 passed, Tests 99 passed) and pnpm --filter @objectstack/spec typecheck: one locked run, VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec check:generated: 2 of 14 stale (skill docs, content/docs/references/**); --fix regenerated those two and both then checked clean.
  • node scripts/check-skills-token-ratchet.mjs: exit 0, 61 authored bundle file(s) within their ceilings; its --self-test: 104 cases pass.
  • Derived families (node scripts/pm/dispatch-gates.mjs --commands): 138. Reconciliation at e9b2056f: 138 derived, 137 run, and the 138th, pnpm check:pm-dispatch-gates, was run on its own afterwards: exit 0.
    • 133 commands exited 0 on f3cbf52a. The last commit changed only skills/objectstack-platform/SKILL.md, and the eleven gates that read the skills were re-run on e9b2056f: all exit 0.
    • pnpm check:skill-top-level-keys exited 1 on f3cbf52a: its self-test pins the sentence "the top level refuses it and the stack fails to load" in the platform skill, which I had cut as restatement. e9b2056f restores the sentence and pays with a different cut. Exit 0 on e9b2056f.
    • pnpm --filter @objectstack/spec run check:skill-examples exited 3 first (PREREQUISITE NOT MET, packages/client-react/dist not built), and 0 after that package was built.
    • NOT MEASURED: node scripts/check-plugin-teardown-shape.mjs --self-test, reason: exit 3, the shallow clone cannot reach the commit its fixture is pinned to. NOT MEASURED: pnpm check:dual-build-cjs-loads, reason: exit 3, some packages have no dist/ here (only the CLI and client closures were built). CI runs both.
  • test:repo and the repo-wide lint were not run locally; they are CI's (Test Core, Lint & Repo Gates).

No ablation: the diff changes documentation, one ratchet row and one eval fixture, and no behaviour a test pins.

Acceptance notes

  • Size. The reference is 1454 tokens. My estimate to the seat before writing was 600 to 800. The file holds a whole metadata kind (two key tables, the body, serving, pack identity, the validate rules), and I did not find a smaller form that keeps every item the card and its three scope notes ask for.
  • N1 and the hosted kernel. Scope note N1 says the hosted kernel does not serve the tool yet. That lives in another repository, which I cannot read from here, so no sentence states it. The new text says what main does: a host without the service serves no such tool.
  • A related object the caller cannot read. The reference teaches what main does today: the whole call is refused 403 PERMISSION_DENIED (record-context-tools.ts, step 4a). ADR-0160 D3 as amended says such a child is left out and stated. The PR that lands the amendment owes this reference one sentence.
  • Not taught, because main does not have it: a skill's context key (ADR-0160 D8; SkillSchema has no such key, though the pack name description in ai-context.zod.ts already mentions it), and the total bound on long-text cells of a related list (ADR-0160 D3, amended 2026-11-25; the service bounds only the body).
  • Possible defect, not fixed here. os validate reported ai-context-field-unknown for owner_id in a pack's fields on an object that does not declare owner_id itself (the platform adds it). Measured: the warning, on the scratch stack above. Not measured: whether get_record_context carries the field at run time. The example avoids the field. Reported to the seat in the dev report.
  • content/docs/ai/skills-reference.mdx is regenerated from the changed frontmatter (gen:skill-docs), not hand-edited.
  • The model identifier is not written in this body (repository rule); the tier is named by its word.

Verification

Two-minute check: node scripts/check-skills-token-ratchet.mjs. Expect 61 authored bundle file(s) within their ceilings, with context-packs.md 1454 / 1454, objectstack-ai/SKILL.md 6798 / 6801 and objectstack-platform/SKILL.md 6149 / 6149.

Read first: (1) skills/objectstack-ai/references/context-packs.md against packages/spec/src/ai/ai-context.zod.ts and packages/services/service-record-context/src/record-context-tools.ts; the risky part is the section "What the caller is not shown". (2) The deletions listed above, in the two SKILL.md diffs. (3) packages/spec/src/stack.zod.ts, the aiContexts description.


Generated by Claude Code

…nd both doors that mount the record-context service

The published skills taught only the aiContexts key name and the
record-context token row. A new reference, objectstack-ai
references/context-packs.md, teaches authoring a pack: its keys and
bounds, a related list's where / orderBy / limit, the body and its
anchors, how a pack is named (package and name, the face), what the
caller is not shown, and what os validate reports. Both SKILL.md files
carry a pointer paid for by deleting restatement in the same file.

The aiContexts description, the service-record-context README and the
RecordContextServicePlugin docblock now name both mounts: the
record-context token and a plugins[] mount.

Claude-Session: https://claude.ai/code/session_01Utp6CaWzgwG1QYaiBidBCK
Co-authored-by: Claude <noreply@anthropic.com>
… page; the pack example names declared fields only

Claude-Session: https://claude.ai/code/session_01Utp6CaWzgwG1QYaiBidBCK
Co-authored-by: Claude <noreply@anthropic.com>
…pay for the pointer with the prefix restatement instead

Claude-Session: https://claude.ai/code/session_01Utp6CaWzgwG1QYaiBidBCK
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 Nov 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/service-record-context, @objectstack/spec, touching 2 documentable anchor(s). ⚠️ 2 changed file(s) yielded no anchor (packages/services/service-record-context/README.md, packages/services/service-record-context/src/plugin.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/ai/skills-reference.mdx (via aiContexts (symbol, a field of const object STACK_DEFINITION_COLLECTIONS_SHAPE))
What this run could not see
  • 2 changed file(s) yielded no anchor (packages/services/service-record-context/README.md, packages/services/service-record-context/src/plugin.ts) — pages documenting those are invisible to this run
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 176 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json ff6f9768d2969c4f2f42819f461424965238e30f → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 1f023e762f1b84f7bfa3368284989bd045a21ec7 — the merge of head e9b2056f9dab8ebf46b5f1de19ab1a0ffe729a0c into base ff6f9768d2969c4f2f42819f461424965238e30f, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 1f023e762f1b84f7bfa3368284989bd045a21ec7 && git checkout 1f023e762f1b84f7bfa3368284989bd045a21ec7
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ff6f9768d2969c4f2f42819f461424965238e30f e9b2056f9dab8ebf46b5f1de19ab1a0ffe729a0c && git checkout -B drift-repro ff6f9768d2969c4f2f42819f461424965238e30f && git merge --no-ff e9b2056f9dab8ebf46b5f1de19ab1a0ffe729a0c

node scripts/docs-audit/affected-docs.mjs --json ff6f9768d2969c4f2f42819f461424965238e30f

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs ff6f9768d2969c4f2f42819f461424965238e30f → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head e9b2056 · 2026-11-26T02:53Z

The seat runs the at-tier contract review of this head through an isolated sub-agent; L1 is the seat's own.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: e9b2056f9dab8ebf46b5f1de19ab1a0ffe729a0c
Local-runs: none
Scope: packages/spec/src/stack.zod.ts, skills/objectstack-ai/SKILL.md, skills/objectstack-ai/evals/skills-tools-knowledge.json, skills/objectstack-ai/references/context-packs.md, skills/objectstack-platform/SKILL.md + scripts/check-skills-token-ratchet.mjs, packages/services/service-record-context/README.md, packages/services/service-record-context/src/plugin.ts, content/docs/references/api/package-api-assembled.mdx, content/docs/ai/skills-reference.mdx, .changeset/record-context-two-mounts-prose.md
Security-touching: yes

PR #37409 (card #37177), 11 files, +200/−32, merge base 9ffe37153. Read: the card body and all ten comments (claim 7179749218, amendments 7179771295 and 7179788843, scope notes 7165182075 / 7166997849 / 7168812660, os-dev report 7181165779), the PR body, the net diff, and the check-runs on the head. Code on main was read to judge the teaching, never reviewed. Nothing was built or run.

① Derived judgments

  • Accept-set: unchanged — right. The only hunk under packages/spec/src is the aiContexts TSDoc and its .describe() string in stack.zod.ts; the schema expression z.array(AiContextSchema).optional() is untouched. plugin.ts changes a docblock only. No key, bound, operator or refusal moves. Metadata-protocol: none is right.
  • Public surface: prose only — right. The describe text is published (the stack's JSON-schema description, mirrored in content/docs/references/api/package-api-assembled.mdx, both rows regenerated identically). content/docs/ai/skills-reference.mdx follows the changed frontmatter (description and the context-pack tag). Spec property liveness, Lint · docs & code guards, Build Docs and Check Documentation Links are green on the head.
  • Ratchet: one new row at the measurement — right. context-packs.md is 5813 bytes at the head, ceil(5813 / 4) = 1454, the row is 1454: zero headroom, as claim amendment 7179788843 states. The diff to scripts/check-skills-token-ratchet.mjs is that row and its comment; the rows skills/objectstack-ai/SKILL.md 6801 and skills/objectstack-platform/SKILL.md 6149 are not in the diff. Byte deltas agree with the PR table: ai SKILL.md +44 bytes (+11 tokens, inside the 14 it had), platform SKILL.md −1 byte (net 0). The script holds the same shape for earlier new files (an initial measurement pinned at it). Lint · repo & tooling gates is green.
  • Gates: all green on the head. 60 success, 10 skipped by design, none failed or pending. The one name that appears twice, Dogfood Regression Gate, is a skipped matrix placeholder (02:18:00Z) and a success (02:18:02Z); the newer governs.

② Semver level

Clause-②: no is right: nothing an existing author wrote parses, loads or reads differently. The changeset is patch for @objectstack/spec (a published description string) and @objectstack/service-record-context (README and docblock), which matches what the diff publishes; it carries the same Clause-②: no / Metadata-protocol: none pair as the PR body. Check Changeset is green. The skill text and the eval fixture publish through the skills bundle and need no package bump.

③ Boundary flags

  • Dev flag, size (1454 against an estimate of 600 to 800): answered. The card's What 2 names the route (detail into a reference where a ceiling binds) and amendment 2 claims the row. It is still 1465 new authored tokens in the bundle; that is the maintainer's to weigh at the Tier H approval, not a defect of the diff.
  • Dev flag, the unreadable related child: answered, confirmed on main. record-context-tools.ts step 4a on origin/main refuses the whole call with PERMISSION_DENIED / 403 when a related child's read guard refuses, when servedObjectDefinitionOf answers null for this caller, or when API exposure refuses. ADR-0160 D3 as amended on main says a child this caller is not served is left out and stated; the code has not caught up (open card 37203 跟进:get_record_context 无权的关联子对象改为省略、真实通道交出可查询字段,并补筛选排序的双通道比对 #37361). The reference teaches what the code does today, which is the rule for a skill. The one sentence it will owe is carried by open card 37177 跟进:技能文档 context-packs.md 改写「看不到的关联对象」一句,对齐 #37361 的省略行为 #37414, blocked on 37203 跟进:get_record_context 无权的关联子对象改为省略、真实通道交出可查询字段,并补筛选排序的双通道比对 #37361 and on this PR.
  • Dev flag, N1 and the hosted kernel: answered. The new describe says a host serves the tool only when it mounts the service, and names both doors. It states nothing about a repository the dev could not read.
  • Dev flag, not taught (a skill's context key, the bound on long-text cells of a related list): right to leave out. SkillSchema has no such key on main and the service bounds only the body.
  • Out-of-scope finding, ai-context-field-unknown on owner_id: escalated to the seat, not judged here. validate-ai-context.ts reads the authored field map only. The reference's example avoids the field. It needs its own card if the seat confirms it.
  • open_questions: empty.
  • SQL push-down: n/a. No query, id materialisation or join is added.
  • S1 (should-fix) — the card's acceptance line "an eval prompt produces a valid pack" is measured only as far as the grader on a hand-written reference answer; no model was run on case 11, and the PR body says so. Fixes #37177 will close the card on merge. Either run case 11 once through the skill-eval runner before the card closes, or have the seat's ACCEPT name where that run is owed. This is not a defect in the diff.

④ Design judgment

skills/objectstack-ai/references/context-packs.md, every teaching sentence against main:

  • Keys and bounds hold against ai-context.zod.ts: strict schema, name / label / object required, 30 fields with no name twice, 3 related lists one level deep, 10 columns, limit 1 to 20 with 20 the default and the cap, the four body field types, no description key (the schema's own guidance says to use label), the ten where operators with $and / $or, a bare value as $eq, literal comparands only, order asc by default. The example block is in the admitted subset.
  • The body holds against body-outline.ts: whole up to 8,000 characters, else an outline with anchors, Markdown headings for textarea / markdown and heading elements for html / richtext, a long body with no headings cut and marked truncated.
  • Serving holds: CAPABILITY_PROVIDERS['record-context'] in @objectstack/core maps the token to RecordContextServicePlugin, and its comment says a host that mounts the plugin keeps its own instance. The MCP registration sits inside the data:read block of mcp-http-tools.ts. The file patterns *.ai-context.ts and *.ai-context.yml are the registered ones.
  • Calling and selection hold against record-context-tools.zod.ts, read-set.ts and sentences.ts: the four arguments, the three-part answer, no pack refused 404 with the pointer to get_record, several refused 400 listing each face with its label, a bare name two packages hold refused 409 RESOURCE_CONFLICT naming each face, the face NAMESPACE-NAME from deriveAiFaceName. The install refusal (422 NAMESPACE_CONFLICT), os validate and the ?package= meta read match the migration entry and PACKAGE_SCOPED_READ_TYPES on main.
  • "What the caller is not shown" holds: a hidden or withheld field carries no value and a note says so; a list is left out with the not_visible note when its link is hidden or a where / orderBy field is not queryable; an unreadable child refuses the call 403 (see ③).
  • The five os validate rules, their names, the warning severity and each consequence match validate-ai-context.ts.
  • N1 (nit) — the 403 is taught for a related object only. Step 4c on main also refuses the whole call when the target of a listed lookup fails the read guard (a system object that does not attest AI reads). It refuses every caller, so it shows on the first test call. One clause would cover it, paid for in the same file.
  • N2 (nit) — "master-detail" in the related.object row is the prose spelling; the field type is master_detail. The spec's own describe uses the same prose, so nothing is wrong, only less greppable.

skills/objectstack-ai/SKILL.md: the five-line section, the tool row and the frontmatter are true and point at the reference. The four cuts are restatement and each fact survives at the head: the tools row ("Tool names this skill grants"), "the union of its surface-compatible skills' tools", "Default: declare no tool records", the 'memory' adapter in the wiring paragraph and the table, and os build in objectstack-platform/references/operations.md, which the Verify section still points to.

skills/objectstack-platform/SKILL.md: the record-context cell and "context packs" in the ADR-0150 list are true (the ADR-0150 addendum of 2026-11-25 on main). The three cuts are restatement: the crm_ prefix rule in the manifest.namespace paragraph, task.object.ts in the naming table and the barrel example, and "handed to the stack key of its name" in The Template bullet. The sentence the check:skill-top-level-keys self-test pins is present at the head. A cross-skill relative link has precedent in this file.

skills/objectstack-ai/evals/skills-tools-knowledge.json: case 11 is well-formed (ids 1 to 11, the same four keys as its siblings). gradeAnswer is two case-sensitive String.includes filters. An answer that follows expected_output (the reference's example plus requires: ['record-context']) holds all seven must_contain tokens and none of the three forbidden ones, so it passes. The expected_output prose itself is not graded.

  • N3 (nit) — must_not_contain: "aiReadable" is a bare word. A correct answer that says in prose that no aiReadable is needed would fail. The sibling cases forbid code spellings with a colon or a paren.

packages/spec/src/stack.zod.ts: the new describe is true against capability-providers.ts and plugin.ts, and corrects the old sentence that read the token as the only serving condition (scope note N1). The README and the docblock now teach both doors (N2), and the README example is still a valid stack.

No must-fix. The teaching matches the code on main. S1 concerns the card's close, not the diff.

Implemented-by: claude/project-thread-gx2ord
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: e9b2056f9d
REWORK — L1, seat repo:objectstack#5: the one should-fix finding of contract record 7181290305 is closed before handoff. The rest of L1 reads clean.

  1. Shape: open draft against main, 11 files (+200/−32), Fixes #37177, Tier H (skills/**). l1-face CLEAN.
  2. Premise: per the record, every teaching sentence of context-packs.md and both SKILL.md edits holds against main. The 403 for an unreadable related child is main's behaviour today (step 4a); ADR D3's "left out" lands with 37203 跟进:get_record_context 无权的关联子对象改为省略、真实通道交出可查询字段,并补筛选排序的双通道比对 #37361, and 37177 跟进:技能文档 context-packs.md 改写「看不到的关联对象」一句,对齐 #37361 的省略行为 #37414 carries the sentence change. Ratchet row 1454 = ceil(5813/4), and both SKILL.md ceilings are unmoved. All seven cuts are restatement.
  3. Owed in this PR: S1. The card's acceptance line "an eval prompt produces a valid pack" is measured only on the hand-written reference answer. Run case 11 once against a model, grade it with gradeAnswer, and quote the answer's pack and the grade in the PR body. If the run fails, fix the teaching rather than the case. The same reviewer reads the delta.
  4. Accepted deviations: the reference is 1454 tokens against the 600–800 estimate (amendment 7179788843; the card names the route; left to the approver). Contract nits N1–N3: the lookup-target 403 is untaught; "master-detail" is prose; the bare aiReadable must_not_contain.
  5. Out of scope and where it went: the 403 sentence goes to 37177 跟进:技能文档 context-packs.md 改写「看不到的关联对象」一句,对齐 #37361 的省略行为 #37414, and the owner_id lint false positive goes to 37177 跟进:资料包校验对平台注入字段(owner_id)误报 ai-context-field-unknown #37415.
  6. Landing terms: Tier H. Once a same-head at-tier PASS with S1 closed and an ACCEPT are in, the seat hands it to os-zhuang. Security-touching: yes, so the security label goes on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: e9b2056f9dab8ebf46b5f1de19ab1a0ffe729a0c
Local-runs: none
Scope: packages/spec/src/stack.zod.ts, skills/objectstack-ai/SKILL.md, skills/objectstack-ai/evals/skills-tools-knowledge.json, skills/objectstack-ai/references/context-packs.md, skills/objectstack-platform/SKILL.md + scripts/check-skills-token-ratchet.mjs, packages/services/service-record-context/README.md, packages/services/service-record-context/src/plugin.ts, content/docs/references/api/package-api-assembled.mdx, content/docs/ai/skills-reference.mdx, .changeset/record-context-two-mounts-prose.md
Security-touching: yes

PR #37409 (card #37177), 11 files, +200/−32, merge base 9ffe37153. Read: the card body and all ten comments (claim 7179749218, amendments 7179771295 and 7179788843, scope notes 7165182075 / 7166997849 / 7168812660, os-dev report 7181165779), the PR body, the net diff, and the check-runs on the head. Code on main was read to judge the teaching, never reviewed. Nothing was built or run.

Second read, same head: only the PR body changed. It gained the block "Eval case 11, run against a model" under Tests. This record replaces the earlier one on this head.

① Derived judgments

  • Accept-set: unchanged — right. The only hunk under packages/spec/src is the aiContexts TSDoc and its .describe() string in stack.zod.ts; the schema expression z.array(AiContextSchema).optional() is untouched. plugin.ts changes a docblock only. No key, bound, operator or refusal moves. Metadata-protocol: none is right.
  • Public surface: prose only — right. The describe text is published (the stack's JSON-schema description, mirrored in content/docs/references/api/package-api-assembled.mdx, both rows regenerated identically). content/docs/ai/skills-reference.mdx follows the changed frontmatter (description and the context-pack tag). Spec property liveness, Lint · docs & code guards, Build Docs and Check Documentation Links are green on the head.
  • Ratchet: one new row at the measurement — right. context-packs.md is 5813 bytes at the head, ceil(5813 / 4) = 1454, the row is 1454: zero headroom, as claim amendment 7179788843 states. The diff to scripts/check-skills-token-ratchet.mjs is that row and its comment; the rows skills/objectstack-ai/SKILL.md 6801 and skills/objectstack-platform/SKILL.md 6149 are not in the diff. Byte deltas agree with the PR table: ai SKILL.md +44 bytes (+11 tokens, inside the 14 it had), platform SKILL.md −1 byte (net 0). The script holds the same shape for earlier new files (an initial measurement pinned at it). Lint · repo & tooling gates is green.
  • Gates: all green on the head. 60 success, 10 skipped by design, none failed or pending. The one name that appears twice, Dogfood Regression Gate, is a skipped matrix placeholder (02:18:00Z) and a success (02:18:02Z); the newer governs.

② Semver level

Clause-②: no is right: nothing an existing author wrote parses, loads or reads differently. The changeset is patch for @objectstack/spec (a published description string) and @objectstack/service-record-context (README and docblock), which matches what the diff publishes; it carries the same Clause-②: no / Metadata-protocol: none pair as the PR body. Check Changeset is green. The skill text and the eval fixture publish through the skills bundle and need no package bump.

③ Boundary flags

  • Dev flag, size (1454 against an estimate of 600 to 800): answered. The card's What 2 names the route (detail into a reference where a ceiling binds) and amendment 2 claims the row. It is still 1465 new authored tokens in the bundle; that is the maintainer's to weigh at the Tier H approval, not a defect of the diff.
  • Dev flag, the unreadable related child: answered, confirmed on main. record-context-tools.ts step 4a on origin/main refuses the whole call with PERMISSION_DENIED / 403 when a related child's read guard refuses, when servedObjectDefinitionOf answers null for this caller, or when API exposure refuses. ADR-0160 D3 as amended on main says a child this caller is not served is left out and stated; the code has not caught up (open card 37203 跟进:get_record_context 无权的关联子对象改为省略、真实通道交出可查询字段,并补筛选排序的双通道比对 #37361). The reference teaches what the code does today, which is the rule for a skill. The one sentence it will owe is carried by open card 37177 跟进:技能文档 context-packs.md 改写「看不到的关联对象」一句,对齐 #37361 的省略行为 #37414, blocked on 37203 跟进:get_record_context 无权的关联子对象改为省略、真实通道交出可查询字段,并补筛选排序的双通道比对 #37361 and on this PR.
  • Dev flag, N1 and the hosted kernel: answered. The new describe says a host serves the tool only when it mounts the service, and names both doors. It states nothing about a repository the dev could not read.
  • Dev flag, not taught (a skill's context key, the bound on long-text cells of a related list): right to leave out. SkillSchema has no such key on main and the service bounds only the body.
  • Out-of-scope finding, ai-context-field-unknown on owner_id: escalated to the seat, not judged here. validate-ai-context.ts reads the authored field map only. The reference's example avoids the field. It needs its own card if the seat confirms it.
  • open_questions: empty.
  • SQL push-down: n/a. No query, id materialisation or join is added.
  • S1: closed. The PR body now reports one round of the repository's skill-evals runner on this head for the objectstack-ai bundle (all 11 cases, each once with the bundle and once without). Case 11 with the skill passed with missing: [] and forbidden: []; without the skill it failed (missing related, where, body; forbidden filter:), so the case discriminates. The card's acceptance line is now measured by a model run. It is one draw per arm, as the body says, not a rate.
    • The quoted pack is a valid pack, read against AiContextSchema on main: name, label, object, fields (1 name), one related entry with object, field, fields (2 names), a where of one admitted operator ($nin) with literal comparands on the child's own stage, limit: 20 (the cap, admitted), and body: { field }. No unknown key, no bound passed. The body's safeParse result agrees.
    • Against case 11's assertions: the pack holds opportunity, related, where, stage, body and notes, and none of filter:, direction:, aiReadable. The seventh token, record-context, comes from the answer's requires: ['record-context'] line, which the body reports and does not quote. The full answer is not quoted either, so the absence of the forbidden tokens outside the pack rests on the runner's forbidden: [].
    • Not measured, and said so in the body: os validate on the model's pack (the answer names no object definitions).
  • Cases 5 and 6 fail with the skill: not caused by this diff. Case 5 asserts defineSkill, skills, surface, aiExposed (the agent tombstones and the knowledge source's aiExposed key); case 6 asserts signed-in session and refused (the pending-action decide door). The sentences that carry those tokens are byte-identical at the base and the head and sit outside every hunk of the SKILL.md diff: the aiExposed row (line 277 to 280), the loadAgent() sentence, the agent.tools / agent.knowledge tombstone rows, and the signed-in session paragraph (line 171 to 164) only shift. The nearest hunks are the cut // or 'memory' comment in the Knowledge example and the cut lead-in of the Actions section; neither carries a token either case asserts. The cut Agent → Skill → Tool diagram named no asserted token. No file under references/ carries aiExposed or signed-in session. The area's report that both cases also fail on the base text at 9ffe37153 is its own measurement and was not re-run here; it agrees with what the diff shows.
  • N4 (nit) — cases 5 and 6 are red on the base skill text and stay red here. They merit a follow-up card of their own (does the skill under-teach aiExposed and the decide door's signed-in session / refused, or do the assertions ask for wording a correct answer need not use). One draw per arm is not yet a rate, so the card should start with repeats.

④ Design judgment

skills/objectstack-ai/references/context-packs.md, every teaching sentence against main:

  • Keys and bounds hold against ai-context.zod.ts: strict schema, name / label / object required, 30 fields with no name twice, 3 related lists one level deep, 10 columns, limit 1 to 20 with 20 the default and the cap, the four body field types, no description key (the schema's own guidance says to use label), the ten where operators with $and / $or, a bare value as $eq, literal comparands only, order asc by default. The example block is in the admitted subset.
  • The body holds against body-outline.ts: whole up to 8,000 characters, else an outline with anchors, Markdown headings for textarea / markdown and heading elements for html / richtext, a long body with no headings cut and marked truncated.
  • Serving holds: CAPABILITY_PROVIDERS['record-context'] in @objectstack/core maps the token to RecordContextServicePlugin, and its comment says a host that mounts the plugin keeps its own instance. The MCP registration sits inside the data:read block of mcp-http-tools.ts. The file patterns *.ai-context.ts and *.ai-context.yml are the registered ones.
  • Calling and selection hold against record-context-tools.zod.ts, read-set.ts and sentences.ts: the four arguments, the three-part answer, no pack refused 404 with the pointer to get_record, several refused 400 listing each face with its label, a bare name two packages hold refused 409 RESOURCE_CONFLICT naming each face, the face NAMESPACE-NAME from deriveAiFaceName. The install refusal (422 NAMESPACE_CONFLICT), os validate and the ?package= meta read match the migration entry and PACKAGE_SCOPED_READ_TYPES on main.
  • "What the caller is not shown" holds: a hidden or withheld field carries no value and a note says so; a list is left out with the not_visible note when its link is hidden or a where / orderBy field is not queryable; an unreadable child refuses the call 403 (see ③).
  • The five os validate rules, their names, the warning severity and each consequence match validate-ai-context.ts.
  • N1 (nit) — the 403 is taught for a related object only. Step 4c on main also refuses the whole call when the target of a listed lookup fails the read guard (a system object that does not attest AI reads). It refuses every caller, so it shows on the first test call. One clause would cover it, paid for in the same file.
  • N2 (nit) — "master-detail" in the related.object row is the prose spelling; the field type is master_detail. The spec's own describe uses the same prose, so nothing is wrong, only less greppable.

skills/objectstack-ai/SKILL.md: the five-line section, the tool row and the frontmatter are true and point at the reference. The four cuts are restatement and each fact survives at the head: the tools row ("Tool names this skill grants"), "the union of its surface-compatible skills' tools", "Default: declare no tool records", the 'memory' adapter in the wiring paragraph and the table, and os build in objectstack-platform/references/operations.md, which the Verify section still points to.

skills/objectstack-platform/SKILL.md: the record-context cell and "context packs" in the ADR-0150 list are true (the ADR-0150 addendum of 2026-11-25 on main). The three cuts are restatement: the crm_ prefix rule in the manifest.namespace paragraph, task.object.ts in the naming table and the barrel example, and "handed to the stack key of its name" in The Template bullet. The sentence the check:skill-top-level-keys self-test pins is present at the head. A cross-skill relative link has precedent in this file.

skills/objectstack-ai/evals/skills-tools-knowledge.json: case 11 is well-formed (ids 1 to 11, the same four keys as its siblings). gradeAnswer is two case-sensitive String.includes filters. An answer that follows expected_output (the reference's example plus requires: ['record-context']) holds all seven must_contain tokens and none of the three forbidden ones, so it passes. The expected_output prose itself is not graded.

  • N3 (nit) — must_not_contain: "aiReadable" is a bare word. A correct answer that says in prose that no aiReadable is needed would fail. The sibling cases forbid code spellings with a colon or a paren.

packages/spec/src/stack.zod.ts: the new describe is true against capability-providers.ts and plugin.ts, and corrects the old sentence that read the token as the only serving condition (scope note N1). The README and the docblock now teach both doors (N2), and the README example is still a valid stack.

No must-fix and no open should-fix. The teaching matches the code on main. Open: nits N1 to N4.

Implemented-by: claude/project-thread-gx2ord
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

维护者速读

  • 改了什么:AI 技能新增一篇参考「情境包(ai_context)」,教 AI 怎样给对象声明记录情境包:字段、关联列表的筛选/排序/条数、正文、权限。另有两份技能文件各补一行,记录情境服务的文档也写明了两种挂载方式。
  • 为什么:记录范围 AI 问答专题的技能文档部分。情境包已经上线,AI 之前不会写。
  • 风险:只改文档和评测样例,不改行为。新参考约 1454 token,比预估的 600–800 大,独立计数上限卡在实测值;两份 SKILL.md 的上限没有动。实测一次模型评测:用例 11 带技能通过、不带技能不通过。
  • 要你做什么:批准合并。契约复核 PASS 在评论 7181463291,Head-sha e9b2056f9dab8ebf46b5f1de19ab1a0ffe729a0c。

席位意见:ACCEPT。教学逐句对得上 main 的代码,删减的都是重复表述;唯一的 should-fix(评测未实跑)已补跑并通过。

席位核对

Head-sha: e9b2056f9dab8ebf46b5f1de19ab1a0ffe729a0c
ACCEPT — L1, seat repo:objectstack#5

  1. Shape: open draft against main, 11 files (+200/−32), Fixes #37177, Tier H (skills/**). l1-face CLEAN.
  2. Premise: every teaching sentence holds against main: spec, service, lint, capability registry, MCP registration. The 403 for an unreadable related child is main's step 4a today. The ratchet row is 1454 = ceil(5813/4), and the SKILL.md ceilings (6801, 6149) are unmoved. All seven cuts are restatement. The model run of case 11 passes with the skill and fails without it. The quoted pack parses under AiContextSchema.
  3. Gates: check-runs at e9b2056f9d: 60 success, 10 expected skip, 0 failed, 0 pending. Mergeable clean.
  4. Accepted deviations:
    • (a) The reference is 1454 tokens against the 600–800 estimate (amendment 7179788843). It is left to the approver.
    • (b) Contract nits N1–N3: the lookup-target 403 is not taught, "master-detail" appears as prose, and aiReadable sits bare in must_not_contain.
  5. Out of scope and where it went:
  6. Landing terms: Tier H, whole PR. L2 at CONTRACT_REVIEW_TIER: PASS, comment 7181463291, same head, no open must-fix or should-fix. Security-touching: yes; the security label goes on. It waits for the approver, and the seat lands it after approval (ready, auto-merge, queue).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Approval requested (Tier H, skills/**; Security-touching: yes). Seat ACCEPT: comment 7181475255. Contract review PASS at CONTRACT_REVIEW_TIER: comment 7181463291, Head-sha e9b2056f9dab8ebf46b5f1de19ab1a0ffe729a0c. After approval the seat lands it.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 26, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 26, 2026 03:17
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 26, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
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 security size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

37140 跟进:技能文档教作者写资料包(ai_context)

2 participants