Repository navigation
[WIP] Create a new release version - #9
Closed
huangyiirene with Copilot wants to merge 1 commit into
Closed
huangyiirene with Copilot wants to merge 1 commit into
huangyiirene with Copilot wants to merge 1 commit into
Conversation
Copilot stopped work on behalf of
huangyiirene due to an error
January 18, 2026 14:59
This was referenced May 25, 2026
Closed
os-zhuang
added a commit
that referenced
this pull request
Jun 15, 2026
…ure-function pattern, #1870) (#1926) Long-term design for flow functions (per the templates evaluation): a flow `function` is a PURE compute step — inputs → return value — and ALL data I/O stays declarative on the flow graph. This keeps the data layer visible, governed (RLS/tenancy/transactions via the engine's data path), and build-checkable (create/update_record nodes the build already validates) — rather than giving functions a raw data API that hides writes and bypasses governance. (Data- lifecycle side effects remain L2 hooks, which legitimately get ctx.api.) Two enablers: - `config.outputVariable` exposes the function's return value as a flow variable → a later update_record persists it (`fields: { ai_category: '{ai.ai_category}' }`). - `config.inputs` are now interpolated against live flow variables, so a function can consume a prior node's output (`inputs: { ticketId: '{record.id}' }`). Skill: automation pitfall #9 now teaches the pure-function pattern (function returns → outputVariable → update_record; hooks for data side effects). +1 end-to-end test (compute → outputVariable → downstream node interpolates it); service-automation 202; check:skill-docs passes. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
xuyushun441-sys
added a commit
that referenced
this pull request
Jun 23, 2026
…mation) (#2240) - spec: FieldSchema.requiredPermissions: string[] (passes through Field.* builders). - plugin-security: a field whose requiredPermissions aren't all held by the caller's systemPermissions is masked on read and denied on write (AND-gate, strictest-wins over permission-set field grants). getObjectSecurityMeta now reads per-field requiredPermissions; foldFieldRequiredPermissions folds unmet ones into the FieldMasker map as {readable:false,editable:false}, reusing maskResults + detectForbiddenWrites — no masker signature change. - liveness: classify field.requiredPermissions (live). api-surface unchanged. - Tests: spec field (+3) + middleware read-mask/write-deny (+4). D5 (package-seeded admin-maintainable per-object secure defaults) needs no new code: stack.permissions already seeds sys_permission_set (incl. per-object + per-field grants), admin-editable in Setup — it composes with D2 (private) + D1 (capability seeding). cloud sys_license is the worked example. Delegated admin (#9) remains future per the ADR. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
os-zhuang
added a commit
that referenced
this pull request
Jun 30, 2026
Prime Directive #9 only mandated the `OS_` prefix; the *shape* was undocumented, so new vars drifted (e.g. a bare `OS_PINYIN_SEARCH` for a boolean flag). Codify the structure observed across the existing vars: - `OS_{DOMAIN}_{FEATURE}[_QUALIFIER]` — domain-grouped (AUTH/CORS/SSO/…) - boolean flags → `_ENABLED` suffix (OS_SSO_ENABLED, OS_SEARCH_PINYIN_ENABLED) - config values → `OS_{DOMAIN}_{NAME}` (OS_CLOUD_URL, OS_LOG_LEVEL) - escape hatches → `OS_ALLOW_{X}`; opt-outs → `OS_SKIP_/OS_DISABLE_` - test-only → `OS_TEST_*`/`OS_EXPECT_*` Pre-existing non-conforming vars (OS_METADATA_WRITABLE, OS_EAGER_SCHEMAS, OS_SERVER_TIMING) flagged as debt, not precedent. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
15 of 18 tasks
This was referenced Jul 19, 2026
This was referenced Jul 27, 2026
os-zhuang
added a commit
that referenced
this pull request
Jul 30, 2026
…fuse to load under NODE_ENV=production (#4093) (#4126) #4058 step 1 classified plugin-dev's fakes honestly and step 2 made the dispatcher gate on that classification. Neither is enough for three of them, for the same reason honest labelling was not enough for the analytics shim (#3891): the label was accurate while the behaviour still inverted the decision it stood in for. security.permissions → checkObjectPermission() { return true; } // allow-all security.rls → compileFilter() { return null; } // no predicate security.fieldMasker → maskResults(r) { return r; } // unmasked ADR-0076 D12's own line, learned from #3891, is that a fallback may degrade features but NEVER security semantics — and the shim it retired merely dropped the caller's RLS scoping, where these answered "allowed" outright. `spec/src/contracts/security-service.ts` states it from the other side: these three are plugin-security's implementation internals, and access-narrowing answers must fail CLOSED. A fake registered under those names by a different package is precisely the opposite. Triggering it required nothing exotic: plugin-dev loads SecurityPlugin through the same optional dynamic import as everything else, so `@objectstack/ plugin-security` merely not being installed swapped real RBAC/RLS/masking for allow-all behind one `warn` line. The slots now stay empty — what production has without SecurityPlugin, and what the consumers already handle: enforcement lives inside the plugin's own registered hooks, and the only reader of a slot (plugin-hono-server's `/auth/me/permissions` and `/me/apps`) resolves it defensively and fails open on presentation only, over data the read path already enforced. The boot log now states plainly that RBAC, RLS and field masking are unenforced. Second half, from the same finding: plugin-dev now REFUSES to initialize under `NODE_ENV=production`. It is a published package that registers fakes for every unclaimed core slot, including ones that report success for work they never did, and it had no environment check of its own. Failing the boot is the right response: such a process is misconfigured in a way no runtime behaviour can make safe. `OS_ALLOW_DEV_PLUGIN=1` (the `OS_ALLOW_{X}` escape-hatch shape, Prime Directive #9) overrides it for the deliberate cases. Also: `/auth/me/permissions` resolves `security.permissions` and `metadata` through the same guarded lookup its three sibling lookups already used — an unregistered slot previously landed in the outer catch and was logged as "/auth/me/permissions failed" on every console navigation instead of taking the deliberate `!evaluator` branch. Out of scope, filed as #4113 and blocking the `auth` half of #4093's A tier: the dispatcher's `/auth` domain carries its OWN mock fallback which answers any email + any password with 200 and a fabricated 24h session token, lives in packages/runtime rather than an opt-in dev plugin, and gates on nothing but "no auth service registered". Verified: plugin-dev 12, plugin-hono-server 132, plugin-security 677, runtime 923, objectql 1183 pass; build 71/71; eslint clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
os-zhuang
added a commit
that referenced
this pull request
Jul 30, 2026
… the most rounds (#4152) Both written from one branch's lifetime, so every row is something actually hit rather than something that might happen. #9 — refresh a long-lived worktree's build state after merging main. Four stale artefacts each fail AS IF your change broke something, naming other people's exports, other packages' files, or config you never touched: packages/spec/dist check:api-surface reports OTHER people's exports as "N breaking"; check:i18n-coverage rejects an example config for a value the spec allows node_modules a package cannot resolve a dependency it declares runtime/.objectstack/ fixture rows accumulating across runs .cache/objectui-* dozens of lint errors in files never opened None is CI-visible — CI checks out fresh and installs clean — so the whole cost lands on whoever is debugging, which is exactly why it is worth recognising in one step instead of re-diagnosing per gate. Also records that OS_SKIP_DTS=1 leaves no .d.ts, so gen:api-surface cannot run under it at all. #10 — a clean merge is not a working merge. Git conflicts on overlapping lines and says nothing when two changes are individually fine and jointly wrong. Both examples are recent: a test pinning a response body's exact shape landed while that shape was being changed elsewhere (merged clean, failed CI), and a domain file was deleted while another agent's guard still declared it (caught only because the guard existed). Hence pull main and re-run before opening a PR, and again before merging. Claude-Session: https://claude.ai/code/session_01CYbS3kS8xzsHNXFTzp4e2z Co-authored-by: Claude <noreply@anthropic.com>
This was referenced Oct 24, 2026
os-support-ai
pushed a commit
that referenced
this pull request
Nov 3, 2026
…tion A bare `budget` in a record-triggered flow's condition is judged by `os validate` (where the flow's bound names are provable); the runtime publish gate judges the written flow alone and resolves no bare name. The skill callout, the flows page item and eval #9 now say `os validate` where they said "the gate" or "refused the same way", measured against the lint source at both doors. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfSZ55f7xwAfpfkPgY
This was referenced Nov 3, 2026
This was referenced Nov 15, 2026
This was referenced Nov 23, 2026
This was referenced Dec 1, 2026
Nenzyz
pushed a commit
to Nenzyz/objectstack
that referenced
this pull request
Dec 1, 2026
… case (objectstack-ai#36766) <!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8E7nn7vpAyMKtKMup2XHy9u)_ Part of objectstack-ai#36753 — card item 4, the last code-side item. The card stays open after this merges: its macOS acceptance items 1–2 need a person on a Mac, and the seat moves the card to a maintainer check. Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用户无感;界面代码的编写规则里多了一条:组件文件和它的辅助文件不能只靠首字母大小写区分。 - 为什么做:属于「运行界面的设计模式」专题,是 Mac 上控制台打包失败那张卡的最后一项;改名和自动检查已在上一个合并里落地,这一条让写代码的人和 AI 事先知道规则。 - 出错会怎样:只加一行规则文字,不改任何代码;撤回这一个合并即恢复原样。 - 要你做什么:这是受管文件,需要 os-zhuang 批准后才能合并;合并后卡片不自动关闭,留给有 Mac 的人验收打包和三个页面。 ## What changes One line in `ui/AGENTS.md` § 5 Coding Standards, after objectstack-ai#13 — card item 4: > **objectstack-ai#14 — A component file and its helper never differ only by letter case.** `Foo.tsx` beside `foo.ts` is ONE module on a case-insensitive file system (macOS, Windows): `./Foo.js` resolves to the helper, so the type build and the console bundle break there while Linux CI stays green. Give the helper a suffix (`fooModel.ts`). At the repository root, `pnpm check:gitlink-declared` runs `scripts/check-case-colliding-paths.mjs`, which refuses any two entries in one directory whose names, with the last extension dropped, differ only by case. Per that file's objectstack-ai#9, the rule points at the instrument that re-derives it (the gate landed in the previous PR for this card) and writes down no count. It cites no tracker number. Governed surface: `ui/AGENTS.md` is Tier H. This PR stays a draft for the seat's contract review and the maintainer's approval. ## Tests <details><summary>Derived gates for this diff, all exit 0 at head fd1db47</summary> `node scripts/pm/dispatch-gates.mjs --commands` derived 16 commands for this diff; each ran locally, exit 0 (the full set on the first head's tree, which differs from `fd1db479` by four words in this one line): `check-closing-keyword-parity.mjs` (+ `--self-test`), `check-comment-mask-corpus.mjs`, `pnpm check:adr-anchors`, `check:agent-test-spelling`, `check:driver-memory-census`, `check:gitlink-declared`, `check:nul-bytes`, `check:pm-governed-merges`, `check:published-files`, `check:refd-timer-probe`, `check:registry-log-declared`, `check:rest-log-spy-declared`, `check:tier-file-adoption`, `check:undeclared-dep-imports`, `check:watch-hint-literal`. At `fd1db479` (the contract review's round-1 fix: the line now says the command and the script are at the repository root, since `ui/AGENTS.md` reads paths relative to `ui/`), the gates that read the file's text re-ran, exit 0: `check:agent-test-spelling`, `check-closing-keyword-parity.mjs`, `check:nul-bytes`, `check-comment-mask-corpus.mjs`. </details> ## Acceptance notes - Card acceptance 1–2 (a clean console build on macOS, and the record page, 「编辑应用」 into design mode and 「配置页签」 opening in that build) need a human on a Mac; NOT MEASURED in this Linux container. The renames that fix it merged in the previous PR for this card; its CI (Type Check UI, Build & E2E UI, Test UI) was green on Linux. - Card acceptance 3 (a planted `Foo.tsx` + `foo.ts` reds on Linux) and 4 (the PR lists the renames, the scan and where the check runs) were measured and recorded on the previous PR. - `skip-changeset`: `ui/AGENTS.md` is in no published package's `files[]` (the `ui/` workspace root is private). ## Verification Read the one added line in `ui/AGENTS.md` § 5 and run `pnpm check:gitlink-declared`: it prints `check-case-colliding-paths: OK (… 0 case-colliding group(s))`. --- _Generated by [Claude Code](https://claude.ai/code/session_01JQwxbXnuzDBbW3qeZ7Kfkc)_ <!-- signed: repo:objectstack#1 · os-warren · session_01JQwxbXnuzDBbW3qeZ7Kfkc --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz
pushed a commit
to Nenzyz/objectstack
that referenced
this pull request
Dec 1, 2026
…bjectstack-ai#37841) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuNTptyd1j97p7dHXZLEeH2g)_ Fixes objectstack-ai#37796 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:照我们技能包写应用的 AI 助手,以后在代理的模型配置里只写模型名,不再写“提供方”这一项;想用哪家提供方,到部署的 AI 设置里打开。 - 为什么做:“提供方”这一项今天已经退役,写了会被平台拒收,而对外发布的技能页还在教它;这是那次退役欠下的技能页跟进。 - 出错会怎样:只改教学文字和一道评测题,运行时不变;最坏是 AI 助手照旧文字给出过时写法,把文字改回即可撤回。 - 要你做什么:这是对外发布的技能包,需要你批准后才能合并。 ## What changes - **`skills/objectstack-ai/SKILL.md`, Model Configuration.** The `provider` row leaves the agent model table. The paragraph above the table now says the `model` block names a model and never a provider: the deployment's AI settings choose the provider and match the model name among the providers turned on, and a written `provider` is a parse error whose fix is to delete the key (retired in protocol 19). The `model`, `temperature` and `maxTokens` / `topP` rows are untouched. - **The schema citation in the same paragraph** moves from `packages/spec/src/ai/agent.zod.ts:37-45` to `:87-95`. PR objectstack-ai#37783 added 50 lines above the key list, so the old range pointed into a comment block. `:87` is the `provider` tombstone and `:95` is `topP`. - **`skills/objectstack-ai/evals/skills-tools-knowledge.json`, case 2.** The prompt is unchanged: a copilot that should use Anthropic at temperature 0.3 with a 2000-token cap. The expected answer now writes no provider key, puts sampling under `model`, names the model in the free-string `model` or leaves it to the host's default, and sends the choice of Anthropic to the deployment's AI settings. `must_contain` goes from `provider`, `anthropic`, `temperature`, `maxTokens` to `temperature`, `maxTokens`, `deployment`. `must_not_contain` goes from empty to the written line `provider: 'anthropic',`. - **`.changeset/37796-skills-agent-model-provider-retired.md`**: one `@objectstack/skills` patch. - **`.changeset/37711-skills-agent-model-optional.md`**: a DELIBERATE CORRECTION, declared below. ## Why PR objectstack-ai#37783 (merge `f07d63a5`) retired an agent's `model.provider`. The published skill still listed the key with its enum, and eval case 2 graded an answer as correct only when it wrote `provider`. An AI that follows the skill would write a key the platform now refuses. The Model Registry's own provider list (`ModelProviderSchema`) is a live key and this PR does not describe it. Its only mention in the bundle was inside the removed row. ## DELIBERATE CORRECTION `Check Changeset` is red on purpose: this PR edits a pending release note it did not add, `.changeset/37711-skills-agent-model-optional.md` (from PR objectstack-ai#37765). That note ships in the same release as this change, and two of its sentences would be false on release day. Title, before: > docs(skills): an agent's model name and provider are optional Title, after: > docs(skills): an agent's model name is optional Body, before: > `skills/objectstack-ai/SKILL.md` (Model Configuration) now teaches that `model.model` is optional, and that an agent without one runs on the host's default model for the environment, and that `model.provider` is optional with no default (the deployment's choice) instead of defaulting to `openai`. The inline enum list is unchanged, and the schema citation now points at `packages/spec/src/ai/agent.zod.ts:37-45`. The `objectstack-ai` eval case on sampling settings accepts an omitted `model` and states the provider has no default. Published prose only: it teaches the optional `model` / `provider` already on main since objectstack-ai#37697. Body, after: > `skills/objectstack-ai/SKILL.md` (Model Configuration) now teaches that `model.model` is optional, and that an agent without one runs on the host's default model for the environment. It no longer says `model.provider` defaults to `openai`; the key itself leaves the page in the same release (see the changeset on the skill no longer teaching `model.provider`). The `objectstack-ai` eval case on sampling settings accepts an omitted `model`. Published prose only: it teaches the optional `model` already on main since objectstack-ai#37697. The note's last sentence (the token budget) is unchanged. The precedent is PR objectstack-ai#37783 itself, which corrected `.changeset/37686-agent-model-name-optional.md` the same way. ## Tests ### Skill eval run (recorded) `pnpm --filter @objectstack/scenarios skill-evals --skills objectstack-ai --repeats 3 --concurrency 4`, on head `fb8b3f20`. 12 cases, 2 arms, 3 repeats: 72 of 72 turns ran in 8 min, none out of the denominator. Subscription login, no API key, CLI 2.1.332, the login's default model and effort. | case | with-skill | no-skill | |:--|--:|--:| | **case 2 (this PR)** | **3/3** | **0/3** | | bundle, all 12 cases | 30/36 (83%) | 1/36 (3%) | Case 2, read answer by answer: all three with-skill answers put `temperature` and `maxTokens` under `model`, write no provider key, and send Anthropic to the deployment's AI settings. All three no-skill answers write `provider: 'anthropic',` inside the `model` block, which is the refused spelling. <details> <summary>Per-case table, round 2 (head fb8b3f2)</summary> | case | with-skill | no-skill | with-skill missed | with-skill carried forbidden | |:--|--:|--:|:--|:--| | objectstack-ai#1 | 3/3 | 1/3 | | | | objectstack-ai#2 | 3/3 | 0/3 | | | | objectstack-ai#3 | 3/3 | 0/3 | | | | objectstack-ai#4 | 3/3 | 0/3 | | | | objectstack-ai#5 | 2/3 | 0/3 | `aiExposed` | | | objectstack-ai#6 | 1/3 | 0/3 | `signed-in session` `refused` | | | objectstack-ai#7 | 0/3 | 0/3 | `do not retry` | | | objectstack-ai#8 | 3/3 | 0/3 | | | | objectstack-ai#9 | 3/3 | 0/3 | | | | objectstack-ai#10 | 3/3 | 0/3 | | | | objectstack-ai#11 | 3/3 | 0/3 | | | | objectstack-ai#12 | 3/3 | 0/3 | | | </details> <details> <summary>Round 1 (head 789e0c7) and why the forbidden token changed</summary> The first commit graded case 2 with `must_not_contain: ["provider:"]`. Round 1 scored it 1/3 with-skill. The two failing answers were correct: each wrote no provider key and named the retired spelling only to warn against it ("writing `provider: 'anthropic'` now fails to parse"). A bare `provider:` graded that warning as a failure. The second commit narrows the token to the object-literal line `provider: 'anthropic',` (with its trailing comma), which a warning in prose does not carry and every no-skill answer in round 2 does. The three round 1 with-skill answers pass under the final tokens when read by hand. Round 1's no-skill arm is not a clean baseline for case 2. The turns inherited this container's project-memory variables, and all three no-skill answers quoted the team's notes on the retirement. Round 2 was started with `CLAUDE_COWORK_MEMORY_PATH_OVERRIDE` and `CLAUDE_MEMORY_STORES` unset, and no case 2 answer mentions memory. </details> Cases 5, 6 and 7 are not touched by this PR. Their with-skill misses are literal-phrase misses in both rounds and are listed under Acceptance notes. ### Local gates, on head `fb8b3f20` `node scripts/pm/dispatch-gates.mjs --commands` derived 49 families for this diff. `--ran` reconciliation: 49 derived, 48 run, 1 NOT-MEASURED, 0 unrun. - 47 exit 0, among them `check-skills-token-ratchet` (and its self-test), `check:skill-identifier-liveness`, `check:skill-links`, `check:skill-compatibility`, `check:skill-frame-sync`, `check:pm-skill-id-lint`, `check:doc-authoring`, `check:nul-bytes`, `check:published-files` and `@objectstack/spec` `check:skill-docs`. - `node scripts/check-empty-changeset.mjs --base origin/main` exit 1: the DELIBERATE CORRECTION above. It names `.changeset/37711-skills-agent-model-optional.md` and nothing else. - `pnpm check:dual-build-cjs-loads` exit 3, NOT MEASURED: it needs a full `pnpm build`, and this container built only the scenario runner's closure. CI runs it. - Outside the derived set, also exit 0: `@objectstack/spec` `check:skill-refs` and `check:skill-served-sections`. ### Size readings (`skills/**`) | reading | before | after | |:--|--:|--:| | `skills/objectstack-ai/SKILL.md`, lines | 485 | 487 | | `skills/objectstack-ai/SKILL.md`, tokens | 6801 | 6801 (ceiling 6801, no row moved) | | all `skills/*/SKILL.md`, lines | 4960 | 4962 | | `evals/skills-tools-knowledge.json`, tokens (measured, not ratcheted) | 3359 | 3411 | | bundle total, tokens | 301302 | 301354 | The new sentences in `SKILL.md` are paid for by the deleted row. The bundle total grows by the eval fixture alone. ## Acceptance notes - The branch is the harness-assigned `claude/project-thread-2rm2nh`, not `claude/issue-37796-…`. - The skill's `description` still lists "configuring an LLM provider" among its triggers. Left as is: a user who asks that is now told where the provider is chosen. Changing it would move when the skill loads, which this card does not ask for. - `SKILL.md:457` cites `packages/spec/src/ai/agent.zod.ts:234, :251` for the `agent.tools` / `agent.knowledge` tombstones. Those lines did not hold the tombstones before PR objectstack-ai#37783 either, so this PR leaves the citation alone. Noted, not filed. - Eval cases 6 and 7 miss literal phrases (`signed-in session`, `refused`, `do not retry`) on the with-skill arm in both rounds, case 7 in all six turns. That reads as a grading-token question on those cases, not as something this diff moved. Noted for the seat. - The eval runner passes its whole environment to each turn, so a round started inside a project container carries that project's memory into both arms. Noted for the seat with the round 1 records as evidence. ## Verification Read first, by risk: 1. `skills/objectstack-ai/SKILL.md`, the hunk under `## Model Configuration`: three new sentences that ship to every customer install. 2. `skills/objectstack-ai/evals/skills-tools-knowledge.json`, case 2: the token lists. 3. `.changeset/37711-skills-agent-model-optional.md`: the corrected note. Two-minute check: `sed -n '84,96p' packages/spec/src/ai/agent.zod.ts` shows `provider: retiredKey(...)` at `:87` and `topP` at `:95`, the range the skill now cites, and `node scripts/check-skills-token-ratchet.mjs` prints `skills/objectstack-ai/SKILL.md is 6801 tokens (ceiling 6801; headroom 0)`. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (No schema change.) - [x] 2. Every name I added uses the casing for its kind. (No name added.) - [ ] 3. No formatter ran. `pnpm lint` is read from CI on this prose-only diff. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` is not touched. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [ ] The *Before Submitting* list in CONTRIBUTING.md: lint and the test jobs are read from CI; the rest is done. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUjtV7ahUH66wxpMk7)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUjtV7ahUH66wxpMk7 --------- Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz
pushed a commit
to Nenzyz/objectstack
that referenced
this pull request
Dec 1, 2026
…ipped vs run-time mount, package-scoped identity) (objectstack-ai#38053) repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP Part of objectstack-ai#37310 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用 AI(技能文档或 MCP 搭建)写知识源的作者,现在看到的是新写法:知识源是一份元数据,用 `name`、逐个列出要索引的字段、可以不写存储;MCP 新建知识源暂不提供起始模板(模板里的占位对象和字段会被当成真实值存进去),等设置页表单从作者输入构建 `source` 后再加。 - 为什么做:知识库检索专题(按调用者权限过滤的知识检索)第三阶段的教学一行,替照着技能写知识源的 AI 解决"照文档写出来却被拒绝"的问题。 - 出错会怎样:最坏是技能里某句教法不准,AI 写出的知识源在保存时被明确拒绝并给出修法;不会悄悄索引错的字段;改动可直接撤回。 - 要你做什么:合并(技能文档是受治理面,由你亲手落地);本 PR 只完成卡片的一部分:发布校验的五条规则名要等对应的校验改动(objectstack-ai#37971)合并后再补,新建模板要等设置页表单,所以卡片保持打开。 ## What changes **`skills/objectstack-ai/SKILL.md`, § Knowledge Sources (RAG)** (ADR-0161 K4, K5, K6 item 6; rows 3a and 3b as merged): - A source is a `knowledge_source` item: shipped in a package (`knowledgeSources`, `*.knowledge-source.ts` / `.yml`) or authored in Studio or over MCP. `KnowledgeServicePlugin({ sources })` and `registerSource` are a second door for the same schema, and a code registration and an environment item of one name are one slot, the second refused. A source's identity is its package and `name`: `search_knowledge` lists a package's source as `NAMESPACE-NAME` (bare for a source no package holds). A shipped item (a `knowledgeSources` entry) mounts the knowledge service and its store with no `requires: ['knowledge']` (objectstack-ai#37306, PR objectstack-ai#38026); an app that ships no source and authors its sources at run time needs `requires: ['knowledge']`, or its items are never indexed (as main's `knowledge-rag.mdx` § Turning it on says). - The key table is the v1 keys of K4: `name`, `label` / `description`, `adapter` (optional; omitted ⇒ the deployment's store, else the only one registered, refused naming them when several and none is the deployment's), `source.kind`, `source.object`, `source.content` (an explicit non-empty list; why `'*'` is refused: embedding is egress, K5), `source.metadataFields`, `source.where`, `source.split`, `refresh.onRecordChange`, `aiExposed`. The old Hygiene column's advice (meaningful text only, never ids or system fields; `where` keeps drafts out) now lives in the `content` and `where` rows, and says `content`. - Egress and cost (K4): the first build sends every listed field of every matching record to the embedding provider; a run-time save needs `manage_knowledge_sources` beside `manage_metadata` and passes save-time admission. - The retired keys by name, each with its fix, as the tombstones read: `id` → `name`, `contentFields` → `content`, `embedding`, `vectorStore`, `adapterConfig`, `refresh.cron`, and the `file` / `http` arms with their four keys; `os migrate meta --from 18` for a stack, by hand for a registration in code. - The checked example drops `adapter: 'pgvector'` (the deployment's store) and its comments; it is otherwise row 3a's block. - `split`: `strategy` is required once `split` is written (`recursive` only when `split` is omitted); the adapter-list aside is gone. - The closing note: `topK` is a `search_knowledge` argument; rerank and hybrid weighting are no source key, and no shipped store has a setting for either (`knowledge-pgvector` and `knowledge-turso` fuse their legs by RRF with a fixed `RRF_K = 60`, `pgvector-adapter.ts:124`, `turso-adapter.ts:95`; no store plugin's options interface has a rerank, weight or fusion key). - The routing line in `skills/objectstack-mcp-build/SKILL.md` ("An agent skill, tool or knowledge source | objectstack-ai") stays true: the section name is unchanged, so it is not edited. **Not in this PR, on purpose (amendments 7221575164 and 7224082428):** the five `os validate` / publish rule ids of PR objectstack-ai#37971 (`knowledge-source-object-unknown`, `knowledge-source-field-unknown`, `knowledge-source-object-not-searchable`, `knowledge-source-system-object-not-ai-readable`, `knowledge-source-field-never-indexed`). objectstack-ai#37971 is still open, so this PR is `Part of objectstack-ai#37310`: that part follows on this branch after objectstack-ai#37971 lands (the keyword then returns to `Fixes`), or on a later PR if this one lands first. The create seed is also left open: it waits for the Studio form (objectstack-ai#37309, row 5). **`skills/objectstack-ai/evals/skills-tools-knowledge.json`.** Case 3 (kb_article on PostgreSQL) and case 9 (policy_doc, `markdown` split) now expect `name` and `content`, and forbid a written `contentFields:` key; case 3 also forbids a written wildcard (`['*'],`, `['*'] }`), `embedding:` and `vectorStore:`, and its `topK` token becomes `topK:` (the key written) because the skill now names `topK` as a search argument. Case 9 also requires `name:` and forbids an `id:` spelling; case 13 forbids the double-quoted wildcard forms. New case 14 asks for an app that ships no source and authors one at run time, and requires the `requires: ['knowledge']` line (either quote style), with no `contentFields:`. New case 13 asks for a source that indexes "every text field" and expects an explicit list, the wildcard declined because embedding is egress, and no written `contentFields:` or wildcard. **`packages/spec/src/kernel/metadata-create-seeds.ts`: unchanged (byte-identical to `main`).** A `knowledge_source` create seed was tried and withdrawn at `4c965f4a5e` (comment 7229668414). Its object binding and content list sit inside `source`, and the Studio create flow (`buildCreateModeBody` / `seedPlaceholderKeys` in app-shell's `createBody.ts`) clears placeholder identity at the top level only, so it would have saved `example_object` / `example_field` into a new source: the objectui#12810 defect. No schema-valid seed avoids this, because `source.object` and a non-empty `content` (K5) are required and nested. `knowledge_source` stays on `KNOWN_UNSEEDED`, whose comment now gives the reason: a seed waits until the Studio form (objectstack-ai#37309, row 5) builds `source` from the author's input. The card allows this ("or the type stays on `KNOWN_UNSEEDED` with the reason"). **`packages/runtime/src/domains/mcp-authoring.test.ts`.** One case beside the flow contract case, over the real protocol and the boot type registry: `list_metadata_items` with `contract: true` for `knowledge_source` serves no `createSeed`; `contractPath` `/properties/source/properties/content` serves the content rule (`minItems: 1`, `minLength: 1`, a pattern that refuses `*` and admits `body`); the served schema carries no `id` or `contentFields` tombstone; a hand-written source with one object and one field saves as a draft; the same item with `content: ['*']`, with an `id`, or with `contentFields` is refused `422 INVALID_METADATA`, the last two naming their tombstone's prescription ("use `name`", "use `content`"); nothing else is written. **Platform catalog (review round, `6f2e756f58`).** The generator's Boot cell (`packages/spec/scripts/lib/platform-catalog.ts`) reads ``on `requires`, or a shipped `knowledgeSources` item`` for a provider that declares `mountedBy`; `packages/spec/scripts/platform-catalog.test.ts` pins that cell, with `record-context` as the control that still reads ``on `requires` ``. `skills/objectstack-project/references/platform-catalog.md` is regenerated. **Token ratchet.** The standing ruling, verbatim and untranslated: 「A:先削重复,余额按实测提高」 (ruling record 6513306068, letter B). Paid down first, in the same file: the wiring paragraph's package list, the old `source.kind` Hygiene column (folded into two rows), the example's four comments restating table rows and its `refresh: { onRecordChange: true }` line restating the default, and the split passage's adapter aside. The row moves 6609 → 6639, the measured remainder, pinned at the measurement. Review round (`6f2e756f58`): after paying down the intro's restating clause, its separate `search_knowledge` sentence, the "one name is one source" clause and the longer closing note, the row moves 6639 → 6695 (+56, the measured remainder) under the same ruling. Reproduction: `ceil(($(wc -c < skills/objectstack-ai/SKILL.md) - 27) / 4)` = ceil(26779 / 4) = 6695. ## Tests **Review round at `6f2e756f58`** (merges `main` at `58be6770ab`; note 7230668192): unlocked, 35 commands, each exit 0, including `check-skills-token-ratchet` (row 6695), `check:nul-bytes`, `check-empty-changeset`, `check-adr-0087-registration`, `check-changeset-no-major`, `check:issue-citations`, `check:doc-authoring`, `check:skill-links`, `check:skill-identifier-liveness`, `check:skill-frame-sync`, `check:published-files`; `gen:skill-refs` exit 0. NOT MEASURED locally (verify lock never acquired in six tries): `check:skill-docs`, `check:skill-refs`, `check:yaml-examples`, the platform-catalog test, `metadata-create-seeds.test.ts`, the MCP contract case, eval case 14. CI on this head is the reading for them. overlap-check: `VERDICT overlap exit 1`, the same objectstack-ai#36158-against-main conflict in the ratchet file; `origin/main`, objectstack-ai#38032 and objectstack-ai#38013 merge cleanly. The lock was saturated: about 70 minutes of queueing, two dogfood runs ahead. One locked round ran at `3407f7fe6e`; the second round was not reached. What was not measured locally is marked below, and CI runs it. <details><summary>Locked round at 3407f7f (VERDICT command-exit 0, held 365s)</summary> - `pnpm turbo run build --filter='@objectstack/runtime^...' --concurrency=2`: exit 0, `Tasks: 41 successful, 41 total`. - `metadata-create-seeds.test.ts` (spec): the seed pin run here (`Tests 20 passed (20)`) belonged to the withdrawn seed; the file is back to `main`'s, so CI `Test Core` is the reading. **Patch round at `4c965f4a5e`:** the app-shell `createBody.seedPlaceholders-12810.test.ts` (red at `19f3e118f2`, 2 failures, unedited), the spec create-seeds test and the rewritten MCP case are NOT MEASURED locally (verify lock saturated); their inputs equal `main`'s, so CI `Test UI` and `Test Core` on this head are the evidence. Unlocked gates at `4c965f4a5e`, exit 0 each: `check-skills-token-ratchet` (6639/6639), `check-empty-changeset`, `check-adr-0087-registration`, `check-changeset-no-major`, `check:nul-bytes`, `check:issue-citations`, `check:doc-authoring`. The changeset no longer lists `@objectstack/spec`. - `pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/mcp-authoring.test.ts`: exit 1, `Tests 1 failed | 73 passed (74)`. The failing assertion is the new case's tombstone half: it expected the served schema to carry `/properties/id`, and the served schema drops tombstones (see Acceptance notes). Its content-rule and seed assertions, which run before it, passed. The tombstone half is rewritten in `01cf7515c2` to assert absence plus the save refusal. **NOT MEASURED locally after that rewrite** (the second locked round never acquired); CI `Test Core` runs it. - `pnpm --filter @objectstack/spec run check:yaml-examples`: exit 0, `19 tagged YAML example(s) across 1 file(s) validate`. - `pnpm --filter @objectstack/spec run check:skill-docs`: exit 0, `Skill docs in sync`. - `pnpm --filter @objectstack/spec run check:skill-refs`: exit 0, `10 generated files in sync with packages/spec`. The generated skill references needed no regeneration: the section rewrite changes no reference input. - `pnpm --filter @objectstack/spec typecheck`: exit 0. - `pnpm --filter @objectstack/runtime typecheck`: exit 1. `tsc --noEmit` is clean. `check:test-typecheck` names 3 files this diff does not touch (`boolean-written-spelling-row-scope.test.ts`, `meta-object-publish-column-changes.test.ts`, `organization-ownership-boot-guard.turso-remote.kernel.test.ts`). `mcp-authoring.test.ts` is not among them. They are read here as the closure build's gaps (only `runtime^...` was built) and not as this diff's; CI `TypeScript Type Check` decides. - `pnpm --filter @objectstack/spec run check:skill-examples`: exit 3, PREREQUISITE NOT MET (the `@objectstack/client-react` dist is outside the built closure). **NOT MEASURED**; CI runs it. </details> <details><summary>Unlocked gates (35 derived families, each exit 0, at 3407f7f; the ratchet and nul-bytes re-run at 19f3e11)</summary> - `node scripts/check-skills-token-ratchet.mjs`: exit 0, `skills/objectstack-ai/SKILL.md is 6639 tokens (ceiling 6639; headroom 0)`; with `--self-test` exit 0. - Exit 0 each: `check-adr-0087-registration` (both forms), `check-changeset-no-major`, `check-closing-keyword-parity` (both), `check-declaration-mirrors` (both), `check-empty-changeset` (both), `check-issue-citations`, `check-self-test-wired` (both), `docs-audit/check-affected-docs`, `docs-audit/check-drift-comment`, and `pnpm check:` `agent-test-spelling`, `changeset-gate-self-tests`, `closed-ceremony-text`, `corpus-claim-drift`, `cross-package-test-inputs`, `doc-authoring`, `issue-citations`, `keyed-text-bounds`, `nul-bytes`, `pm-skill-id-lint`, `published-files`, `ratchet-remedy-authority`, `role-word`, `skill-compatibility`, `skill-frame-sync`, `skill-identifier-liveness`, `skill-links`, `test-source-alias`, `tier-file-adoption`. - `dispatch-gates --ran`: `116 derived, 38 run, 0 NOT-MEASURED, 78 UNRUN`. That is a declared narrowing: the lock was saturated, and CI runs the 78. - Local-only: `check-skill-frame-freshness` exit 0. `check-dev-prereqs` exit 1 ("69 of 110 workspace packages … not on disk"), which is the closure-only build and not a finding. </details> <details><summary>Eval runner and the ablation (`skill-evals`, claude-code-cli 2.1.332, oauth login, served claude-opus-5-5)</summary> Cases 3, 9 and 13 of `objectstack-ai/skills-tools-knowledge`, both arms, one repeat each: | skill text | objectstack-ai#3 with-skill | objectstack-ai#9 with-skill | objectstack-ai#13 with-skill | no-skill (all three) | |:--|:--|:--|:--|:--| | this PR | pass | pass | pass | fail | | `main`'s `SKILL.md` (`8d34c4404f`, hash `88a20cb583`), new cases (ablation) | fail: `contentFields:` written; `name:`, `content:` missing | fail: `contentFields:` written; `content:` missing | fail: `contentFields:`, `['*'],` and `id: 'faq` written; no egress reason | fail | The ablation restored `main`'s `SKILL.md` into the working tree only (`git restore --source=8d34c4404f`, `git hash-object` = `88a20cb583`). The run ran, and then `HEAD`'s file came back (`fc845724ac` both on disk and at `HEAD`). An earlier run of case 13 on this text failed with-skill only on the token `['*']`, which a correct answer quoted while explaining the refusal. The forbidden token is now the written wildcard (`['*'],` / `['*'] }`), and the table above is after that change. </details> ## Acceptance notes - The acceptance grep (`git grep -n -E "contentFields|'\*'|adapter: 'ragflow'" skills/objectstack-ai`) returns eight lines. In `SKILL.md`, three: the `content` row ("`'*'` is refused") and two lines of the retired-keys paragraph. In the eval file, five: the reference answers of cases 3 and 13, which name both as retired, and the `must_not_contain` lists of cases 3, 9 and 13, which forbid a written `contentFields:` and a written wildcard (`['*'],`, `['*'] }`). The card itself asks the eval to fail on `contentFields` or `'*'`, which puts the forbidden token on the assertion line. The reviewer decides whether those lines count as "naming a retired key as retired". - `adapter: 'ragflow'` has no hit: objectstack-ai#37004 already removed it. - The new MCP pin is an `it` inside the existing real-protocol `describe` of `mcp-authoring.test.ts`, beside the flow contract case, because that describe holds the real-protocol harness (`realProtocol`, `STUDIO_BASE`). It is in the shared harness file, not a new file. - **Premise correction (card item 3).** The card asks the served contract to carry "the tombstones' prescriptions as the describes read". It does not, by design: the served JSON Schema drops every `retiredKey()` tombstone (`{ not: {} }`; see the note in `packages/metadata-protocol/src/protocol-meta-type-schema.ts`: the served schema publishes what an author MAY write). The prescription reaches an MCP author through the save refusal instead. The pin asserts both halves: the tombstone is absent from the served schema, and a save that writes the retired key is refused naming its replacement. - The save half of the MCP pin covers row 3a's parse. Row 4's checks (objectstack-ai#37971) are not on main, so a hand-written draft is not yet judged by them here. Today the save passes with no knowledge service mounted ("no knowledge service judges nothing"). - overlap-check before the PR: `VERDICT overlap exit 1`. `origin/main`, objectstack-ai#38032 and objectstack-ai#38013 merge cleanly. objectstack-ai#36158 (a draft last updated 2026-11-25) conflicts in `scripts/check-skills-token-ratchet.mjs`. That conflict is objectstack-ai#36158's own against `origin/main`: `git merge-tree origin/main` with objectstack-ai#36158's head conflicts in the same file, and every conflict hunk is at line 798 or later, away from this branch's hunk near line 453. Reported here, not resolved. ## Verification Files to read first, by risk: 1. `skills/objectstack-ai/SKILL.md` § Knowledge Sources (RAG): the `adapter` and `content` rows and the retired-keys paragraph. 2. `packages/spec/src/kernel/metadata-create-seeds.test.ts`: the `KNOWN_UNSEEDED` reason for `knowledge_source` (no seed; `metadata-create-seeds.ts` is byte-identical to `main`). 3. `packages/runtime/src/domains/mcp-authoring.test.ts`: the new contract case. Two-minute check: `node scripts/check-skills-token-ratchet.mjs`. Expect `skills/objectstack-ai/SKILL.md is 6695 tokens (ceiling 6695; headroom 0)`. Readings: `skills/objectstack-ai/SKILL.md` 464 → 469 lines, 26462 → 26806 bytes (6609 → 6695 priced tokens, in two moves). Every published `SKILL.md` summed: 4936 → 4941 lines, 261366 → 261485 bytes (65342 → 65372 tokens). The eval file is 125 → 137 lines and 13611 → 15185 bytes; eval fixtures are measured, not ratcheted. --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.