Repository navigation
docs(skills): guard nullable validation operands, teach hook body, list mailbox / package-registry, drop os generate agent - #31127
Conversation
…list `mailbox` / `package-registry`, drop `os generate agent` - objectstack-data rules/validation.md: every ordering / arithmetic operand in the examples is guarded with `!= null` (refused at publish otherwise); the external-validation hook is a sandboxed `body` reading another object, and an external-API check goes through a Connector recipe. - objectstack-data examples-objects.md and SKILL.md: hooks are taught as `body`; the inline `handler` is named only as deprecated. - objectstack-platform SKILL.md: `mailbox` and `package-registry` rows in the `requires:` table. - objectstack-platform references/operations.md: `os generate <kind>` no longer lists the retired `agent`. - Eval cases for each site; '@objectstack/skills' patch changeset. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAkfHzwVhtRa85nYA4e
|
domain:skills#3 · huangyiirene · session_01J8VVAj7CvjkGXvgXzd6RZ7 Contract reviewServed-tier: ① Derived judgmentsInputs: card #31113 (body; triage 6706604677; claim 6707226386), the PR body, the commit, the net diff, and the seat's mid-flight rulings (site 4 option A;
② Semver level
③ Boundary flags
④ Design judgment
The readings match the PR body.
Must-fix: none. Should-fix: S1, S2, S3. Nit: N1, N2. Implemented-by: VERDICT: PASS |
|
domain:skills#3 · huangyiirene · session_01J8VVAj7CvjkGXvgXzd6RZ7 维护者速读
席位核对 — ACCEPT · domain:skills#3 · head
|
Requested by Irene · project thread
Fixes #31113
Clause-②: no
Metadata-protocol: none
dispatch-gates --tierreads a MANDATORY model tier forskills/**(clause ① of the model-tiering ruling); it is waived by the standing order of the maintainer in this project (2026-11-03), and this card ran on the project's default model. The dispatching seat runs the contract review.维护者速读
objectstack-data的rules/validation.md六处比较/算术谓词全部加!= null守卫,并写明未守卫的可空字段在发布时被拒;两个钩子示例(validation.md、examples-objects.md)改写为沙箱body,SKILL.md索引只把handler称为已弃用;objectstack-platform的requires:表补mailbox、package-registry;operations.md的os generate行去掉已退役的agent。os generate agentstill listed, deprecatedhandlertaught first #31113):裸可空比较被validate-null-guards拒绝;handler已弃用;两个 token 在PLATFORM_CAPABILITY_TOKENS里却不在表里;agent在RETIRED_GENERATORS里。@objectstack/skillspatch;回滚即 revert。skills/objectstack-data/rules/validation.md的 External / Custom Validation 一节(席位裁定 A:body无外呼 HTTP,外部 API 校验走 Connector recipe)。node scripts/check-skills-token-ratchet.mjs,预期退出 0,57 authored bundle file(s) within their ceilings。skills/**属 Tier H(人合),需要os-zhuang或hotlong的一次 approval,之后席位落地。What changes
1. Nullable operands in
rules/validation.mdare guardedCode site:
packages/lint/src/validate-null-guards.ts(L29–L43: an ordering or arithmetic operator on a declared field with norequired: true/defaultValueis rejected unless a!= null/== null/isBlank()test dominates it), wired intovalidateStackExpressionsforvalidations[].condition/.when/.then/.otherwise(packages/lint/src/validate-expressions.tsL44), whichos build,os validate,os lintand the runtime publish gate run.skills/objectstack-formula/SKILL.mdL112–L122 teaches the same rule.The card named three sites; the file held six. The new sentence under § Expression Syntax states the rule, so the other three would have contradicted it on the same page; all six are guarded:
record.due_date < today()record.due_date != null && record.due_date < today()record.amount < 0record.amount != null && record.amount < 0record.end_date < record.start_daterecord.start_date != null && record.end_date != null && record.end_date < record.start_daterecord.end_date <= record.start_date<=record.discount_amount > record.subtotal * 0.5record.discount_amount != null && record.subtotal != null && …whenrecord.order_total > 10000record.order_total != null && record.order_total > 10000Measured, not assumed:
findUnguardedNullableOperands(the gate's decision procedure, run throughtsxwith each field nullable) returns 1 or 2 findings for every "before" predicate and 0 for every "after" predicate.§ Expression Syntax gains two lines (the line before them is byte-identical): "An ordering or arithmetic operator on a field with no
required: true/defaultValueis refused at publish unless a!= nulltest guards it."<!-- os:check -->: that gate (packages/spec/scripts/check-skill-examples.ts) is atsctype-check, not the null-guard lint. A trial run marked all four candidate blocks: the § Script Validation block (L52) and the rewritten hook block (L250) type-check and keep their markers; the § Common Script Patterns block (condition: …lines) and the § Cross-Field block (validations: [with no import) fail withTS2304: Cannot find name 'P', because they are fragments, so they stay unmarked.2.
requires:table namesmailboxandpackage-registryCode sites:
PLATFORM_CAPABILITY_TOKENS(packages/spec/src/kernel/platform-capabilities.tsL58package-registry, L64mailbox; provider rows L216, L218) andCAPABILITY_PROVIDERS(packages/core/src/capability-providers.tsL174package-registry→@objectstack/service-package/PackageServicePlugin, L186mailbox→@objectstack/service-mailbox/MailboxServicePlugin).package-registryshares themarketplacerow because both keys resolve to the same package and plugin today (the comment atcapability-providers.tsL164–L173). No count in prose (#27522).3.
os generate <kind>drops the retiredagentCode site:
RETIRED_GENERATORSinpackages/cli/src/commands/generate.ts(L974,agentat L980: "agents are platform-internal (ADR-0063 §2)"; its refusal points atos g skill).4. Hooks are taught as
bodyCode sites:
HookSchema.handler(packages/spec/src/data/hook.zod.tsL485: "DEPRECATED, preferbody") andHookSchema.body(L487–L498: preferred; when both are present the runtime usesbody). The body's capabilities areHookBodyCapability(packages/spec/src/data/hook-body.zod.tsL48–L54); there is nohttp.fetch(L38: "outbound calls go through Connector recipes"). Thectx.api.object(name).findOne({ where })shape is the one the body runner exposes (packages/runtime/src/sandbox/body-runner.tsL1119, gated as a READ byapi.readinquickjs-runner.tsL705).references/examples-objects.md§ Lifecycle Hooks: the example is abody(language: 'js',source= the function body). The prose after it saysbodyis the metadata-native form and names the inlinehandleronly as deprecated.rules/validation.md§ External / Custom Validation: the seat ruled option A. The example is abodythat readsblocked_tax_idthroughctx.apiwithcapabilities: ['api.read']and throws. The lead now says "hitting another object or running arbitrary code", and adds that abodyhas no outbound HTTP, so an external-API check goes through a Connector recipe (home:references/data-hooks.md§ Capabilities, L447).SKILL.mdL46 index: "the sandboxedbody(ctx + capability contract; the inlinehandleris deprecated)".Token readings (
node scripts/check-skills-token-ratchet.mjs, exit 0)mainskills/objectstack-platform/SKILL.mdskills/objectstack-data/SKILL.mdskills/objectstack-data/references/examples-objects.mdskills/objectstack-data/rules/validation.mdskills/objectstack-platform/references/operations.mdNo ceiling is raised, so the ruling path was not used. No line was re-wrapped. Every deletion, with the facts it held and where each survives:
objectstack-platform/SKILL.md§ The Template: "The memory driver and the Hono server are NOT in the file — the CLI auto-registers both at boot". Facts: no driver and no server in the scaffolded config; the CLI registers both. Homes, same file: § Wiring a driver — you usually do not ("Underos dev/os serve/os startthe CLI resolves the driver itself … Do not put a driver in your config'splugins:array") and § Runtime Boot Sequence step 4 (DriverPlugin,HonoServerPluginauto-registered). The line before it loses its trailing "The".objectstack-data/references/examples-objects.md: thectx.input.created_at = new Date().toISOString();line. It wrote a column the platform stamps on insert itself (objectql's audit hook,packages/objectql/src/plugin.tsL1975), so it taught a redundant write. The old prose's facts (inline in-processhandler; preferredbodyoflanguage/source/capabilities; isolated VM; the shape AI/Studio hooks and build artifacts carry) all remain in the new prose or the example.objectstack-data/rules/validation.md:No async / custom typebullet's tail ("external checks and arbitrary validation code belong in abeforeInsert/beforeUpdatelifecycle hook (see data-hooks.md)"). It now links § External / Custom Validation, which holds the hook rule and thedata-hooks.mdlink. The "external checks" part also contradicted ruling A.// Conditional required field(record.type == 'enterprise' && isBlank(record.account_manager)). Homes: the same block's "Require field when another field has value" pattern, and § Conditional Validation'senterprise_requires_manager, the same predicate.true" (§ Expression Syntax) and// ❌ Fails when this is TRUEin § Script Validation; the correct amount check is the "Prevent negative values" pattern. The pair also held two unguardedamountcomparisons. The "Validation Fires Too Often" pair stays, so § Incorrect vs Correct and its contents link remain.Eval cases
objectstack-data/evals/objects-fields-relationships.jsoncase 3 (corrected):must_containgains!= null; itsexpected_outputalready asked for explicit guards. (Site 1.)objectstack-data/evals/hooks-security-seeds-datasources.jsoncase 10 (new): block anaccountwhosetax_idis inblocked_tax_id, and ask whether the hook can call a tax-authority API. Must containbeforeInsert,beforeUpdate,language: 'js','api.read',ctx.api.object(; must not containhandler:,HookContext,'http.fetch'. (Site 4.)objectstack-platform/evals/config-plugins-ops.jsoncase 18 (new): inbound mail into mailboxes. Must containrequires,'mailbox',@objectstack/service-mailbox; must not containMailboxServicePlugin(. (Site 2.)objectstack-platform/evals/config-plugins-ops.jsoncase 19 (new): scaffold an object, a flow and an AI agent with the CLI. Must containos generate object,os generate flow,os generate skill; must not containdefineAgent(. (Site 3.)Deviations (all three accepted by the seat before writing)
object fields view list action flow dashboard app skill picklist) is wrong:fieldsandlistare keys inside templates.GENERATORSingenerate.tskeysobject view action flow dashboard app skill picklist permission dataset. The fix is unchanged (dropagent);skilltakes its place, since that is what the refusal points at.os:check. Only the two blocks the gate accepts are marked, as § 1 says. The card's acceptance asked for all three validation examples.validation.mdfollows the seat's ruling A (abodycannot call an external API), not a literal port of thehandlerexample.Other sites found (not changed: outside this card's file surface)
skills/objectstack-data/references/data-hooks.mdL219: hookcondition: P`record.annual_revenue > 1000000`is an unguarded nullable operand. A hookconditionis a covered surface (validate-null-guards.tswiring table).skills/objectstack-data/references/data-hooks.md: teaches the inlinehandlerform first: 3 sites above § Sandboxed Hook Bodies (L309: L97, L161, L170) and 4 below (L739, L817, L845, L890), plus the comparison table at L319, so the reference itself still teaches the deprecated door first.skills/objectstack-formula/SKILL.mdL268:P`record.amount > 10000 && …`is an unguarded comparison in anos:checkblock. It has no object, so it is not refused by itself, but it is the shape that gets copied.Verification
Local gates on 12dd0d0: 47 derived, 47 exit 0, 0 NOT MEASURED
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 47 commands for the 9 changed paths; each was run with its exit code captured before any pipe.pnpm check:dual-build-cjs-loadsexited 3 (NOT MEASURED: nodist/) on the first run. Afterpnpm build(exit 0) it exited 0. The other 46 exited 0 on the first run, includingcheck:skill-identifier-liveness,check:skill-top-level-keys,check:skill-compatibility,check:skill-frame-sync,check:skill-docs,check:skill-refs,check:doc-authoring,check:corpus-claim-driftand the token ratchet.pnpm check:skill-identifier-liveness,pnpm check:skill-top-level-keys,pnpm check:skill-compatibility,pnpm --filter @objectstack/spec check:skill-refs,node scripts/check-skills-token-ratchet.mjs: exit 0 each.pnpm --filter @objectstack/spec check:skill-examples(after building@objectstack/spec,@objectstack/clientand@objectstack/client-react): exit 0,285 prose examples type-check.node scripts/check-commit-card-trailers.mjs --range origin/main..HEAD: exit 0 before the push.Human Minimum
packages/specholds no runtime logic. (No schema touched.)main, one pull request.'@objectstack/skills': patch), and both declaration lines are filled in here and in the changeset.packages/specnot touched; nothing to regenerate.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01J8VVAkfHzwVhtRa85nYA4e