Repository navigation
docs(skills): teach the script node's package rule in the automation skill - #32377
Conversation
…skill A script node's config.function now resolves from the calling flow's package (ADR-0150 D3). Silently-wrong item 3 teaches the rule, the platform's owner-less function, the .custom override read, the two-package example, the guard refusal shape and the two fixes. Paid by one same-file restatement; the token-ratchet row rises by the measured remainder only. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAn6xt9EBJqcc9U7Ks4
|
domain:skills#3 · huangyiirene · session_01J8VVAmAzSRKZHAn7T8sArV Contract reviewServed-tier: Inputs: card #32264 (body and all four comments, through claim amendment 6782965220), the PR body, its three files, the net diff against ① Derived judgments
② Semver level
Clause-②: no — correct. The narrowing (an outside-closure or ambiguous function name now refused) shipped in #32257. This PR describes it and takes nothing away. ③ Boundary flags
④ Design judgment
"No The cut is a true restatement. The rest of the file does not contradict the paragraph. The Findings:
Follow-up, outside this diff and not reviewed here: Finding 1 earns a delta review of its fix. No must-fix. Implemented-by: VERDICT: PASS |
The step fails as a guard on every run; only a flow door (trigger, resume, /actions, a declared flow endpoint) answers 400 FLOW_FAILED with error.details.innerRefusal. The paragraph now says so and names the flow's package as the subject of "holds none". The ratchet row moves to the new measurement. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAn6xt9EBJqcc9U7Ks4
|
domain:skills#3 · huangyiirene · session_01J8VVAmAzSRKZHAn7T8sArV Contract reviewServed-tier: Delta round. The prior record is comment 6783849220 on head ① Derived judgments
② Semver levelUnchanged: Clause-②: no — still correct. The delta is wording only. ③ Boundary flags
④ Design judgment
The should-fix is resolved. The status now belongs to a flow door, so the sentence no longer promises a 400 on a The rest of the file is untouched by the delta, and nothing in it contradicts the new wording. Findings:
The ratchet comment and the changeset are the lane seat's ACCEPT at No must-fix and no should-fix. The round ends here. Implemented-by: VERDICT: PASS |
|
domain:skills#3 · huangyiirene · session_01J8VVAmAzSRKZHAn7T8sArV 维护者速读(席位定稿)· head
|
… not only a write's (objectstack-ai#33390) <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XN3CiY5nMB8z5cLWxV2JQ7s)_ Fixes objectstack-ai#32379 domain:skills#1 · os-project-manager · session_01FEkQ5nPZFfbs98ogV2mAFM Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:`objectstack-api` 技能里流程入口 `400 FLOW_FAILED` 一段,原文把 `details.innerRefusal` 说成「节点的写入被拒」并只列三个错误码;现改为「节点遇到的拒绝」(数据节点的读或写、`script` 节点的函数名),错误码改为举例并补上 `RESOURCE_CONFLICT`。另在「`apis:` 还是代码处理器」表格的 `script` 行加一个链接,指向 automation 技能里讲「到底运行哪个函数」的条目,不复述。 - 为什么改:自 PR objectstack-ai#32257 起,`script` 节点的函数名在本包范围内有歧义或只在依赖闭包外,流程入口答 `400 FLOW_FAILED`,`innerRefusal.code` 为 `RESOURCE_CONFLICT`;按旧文按错误码分支的客户端会漏掉它。 - 风险与回滚:纯技能文字,`skills/objectstack-api/SKILL.md` 改 5 行、净增 1 行,外加一个 changeset;不动 schema、不动运行时;回滚即还原本 PR。 - 先看:`skills/objectstack-api/SKILL.md` 第 360–363 行(innerRefusal 句),再看第 133 行(表格链接)。 - 两分钟验证:`git diff origin/main -- skills/`,预期只见上述两处:innerRefusal 句改为「a node met」并举 `RESOURCE_CONFLICT`,表格 `script` 行多一个指向 objectstack-automation「Valid-but-silently-wrong」第 3 条的链接。 - 需要你做的:受管面 Tier H(`skills/**`):请批准或合并。 ## What changes - **`skills/objectstack-api/SKILL.md` lines 360–363**, the flow-door paragraph. `innerRefusal?` was "the `{ code, message }` a node's write was refused with, `code` in its wire spelling (`UNIQUE_VIOLATION`, `VALIDATION_FAILED`, `PERMISSION_DENIED`)". It now reads "the `{ code, message }` refusal a node met (a data node's read or write, a `script` node's function name), `code` an `ErrorCode` member in wire spelling (e.g. `UNIQUE_VIOLATION`, `PERMISSION_DENIED`, `RESOURCE_CONFLICT`)". The codes are examples now, not a set. - **`skills/objectstack-api/SKILL.md` line 133**, the "Choosing between `apis:` and a code handler" table. The `script` node row gains one link, "which one runs: [objectstack-automation](../objectstack-automation/SKILL.md#valid-but-silently-wrong-passes-build-fails-at-runtime) item 3", and restates nothing. - **`.changeset/32379-api-flow-inner-refusal-any-node.md`**: `'@objectstack/skills': patch`, carrying both declaration lines. This resumes the released commit `ab838308` (branch `claude/project-thread-xb2225`, Release comment 6807417751) and merges `origin/main` `6538ba48`. Every claim the commit makes was re-read on that `main` (below); none moved, so the text is unchanged. ## Why Each claim, read on `origin/main` `6538ba48`: - **A `script` node's function-name refusal fills `innerRefusal` with `RESOURCE_CONFLICT`.** `packages/services/service-automation/src/builtin/screen-nodes.ts:651-660`: when `engine.resolveFunction` throws a package-scoped refusal, the node returns `code: 'RESOURCE_CONFLICT'` plus `refusalCarriedBy(err)`. Pinned at the flow door by `packages/qa/dogfood/test/bare-name-one-holder-request-family.dogfood.test.ts:280-298` (`[400, 'FLOW_FAILED']`, `details.innerRefusal.code === 'RESOURCE_CONFLICT'`) and in-engine by `packages/services/service-automation/src/flow-function-package-scope.test.ts:134` (both from PR objectstack-ai#32257). - **A data node's read fills it too, not only a write.** `refusalCarriedBy` is called by all four data-node catch arms in `packages/services/service-automation/src/builtin/crud-nodes.ts` (`get_record` :669, and :831, :947, :1026 for the three writes). It carries any declared 4xx throw (`inner-refusal.ts:86-102`). - **`code` is an `ErrorCode` member.** `FlowInnerRefusalSchema.code` is `ErrorCode` (`packages/spec/src/api/automation-api.zod.ts:361-366`). - **The link target exists.** `skills/objectstack-automation/SKILL.md:230` is the heading `## Valid-but-silently-wrong (passes build, fails at runtime)`, and item 3 (`:262-275`) states the package rule for which function a `script` node runs (landed in PR objectstack-ai#32377). The anchor follows the form `skills/objectstack-data/SKILL.md:221` already uses for another heading in that skill. ## Acceptance notes - `skills/` sweep (`git grep` for `innerRefusal` and `FLOW_FAILED`): this paragraph is the only skill text that teaches `innerRefusal`. No `evals/*.json` mentions it, so no eval was made false. - Not in scope, noted only: the spec's own `.describe` on `FlowFailureDetailsSchema.innerRefusal` (`packages/spec/src/api/automation-api.zod.ts:640-642`, mirrored in `content/docs/references/api/automation-api.mdx:389` and `:1140`) still says "the refusal a node's write met". It is spec prose, outside this card's surface (carrier: none). ## Verification Head `9adabd41`, base `origin/main` `6538ba48`. <details><summary>Line and token budget (skills/**)</summary> - `skills/objectstack-api/SKILL.md`: 431 to 432 lines, 20628 to 20841 bytes; token ratchet 5152 to 5206 (ceiling 6314, headroom 1108). No ceiling moved. - Whole package, all `skills/*/SKILL.md` (11 files): 4602 to 4603 lines. Bundle total (whole shipped tree): 244310 to 244364 tokens. - `node scripts/pm/check-skill-line-ratchet.mjs`: exit 0. `node scripts/check-skills-token-ratchet.mjs`: exit 0. </details> <details><summary>Derived gates</summary> `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 46 families for the two paths. Each was run on head `9adabd41`, exit code captured before any pipe (record: project file `pm-orders/skills/32379-gates-ran.txt`): - 44 exit 0, among them `check-adr-0087-registration` (scan and `--self-test`), `check-changeset-no-major`, `check-empty-changeset` (scan and `--self-test`), `check-skills-token-ratchet` (scan and `--self-test`), `@objectstack/spec check:skill-docs`, `check:changeset-gate-self-tests`, `check:doc-authoring`, `check:nul-bytes`, `check:pm-governed-merges`, `check:published-files`, `check:skill-compatibility`, `check:skill-frame-sync`, `check:skill-identifier-liveness`, `check:skill-links`. - `@objectstack/lint check:doc-formula-expressions` exit 0, after building the `@objectstack/lint...` closure under the verify lock (VERDICT command-exit 0, 67s). `check:dts-closure` and `check:sourcemap-no-sources-content` exit 0 over the 5 packages that build left in `dist/` only; CI builds every package and runs them in full. - NOT MEASURED, exit 3 PREREQUISITE NOT MET (each reads every package's `dist/`): `check:dual-build-cjs-loads`, `check:lean-entry-closure`. No package source is touched, so no full build was paid locally. - `--ran` reconciliation: "46 derived famil(ies) accounted for — 44 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)". - CI families are read from this PR's check-runs, not re-run here. </details> <details><summary>Tier and governed readings</summary> - `dispatch-gates --tier`: MANDATORY contract-review tier (`skills/**`, clause ①, the published catalog); no one-line exit for this surface. - `node scripts/pm/check-governed-merges.mjs --branch claude/project-thread-co1yph`: exit 3, GOVERNED, landing tier H (人合). 1 of 2 paths on the register (`skills/**`); the changeset is not on it. Size +15 / -4, under the 3000 threshold. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5nPZFfbs98ogV2mAFM <!-- signed: domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb --> Co-authored-by: Claude <noreply@anthropic.com>
Requested by Irene · project thread
Fixes #32264
维护者速读
objectstack-automation技能「Valid-but-silently-wrong」第 3 条新增一段:script节点的config.function按调用它的 flow 所属包解析(与subflow的flowName同一规则),平台函数(无包注册)对所有 flow 可达,.custom覆盖按无包 flow 读取;附normalize_phone双包示例、失败形态(步骤以 guard 失败、$error.code: 'RESOURCE_CONFLICT';经 flow 入口调用时400 FLOW_FAILED带error.details.innerRefusal)和两种修法(声明依赖或改名)。skills/objectstack-automation/SKILL.md第 3 条新增段落(下方 diff),以及「Card vs main」一节。node scripts/check-skills-token-ratchet.mjs(预期全部在天花板内),对照下表逐条看源码行。skills/**),当前 head 还欠契约审查(contract review),之后需一位授权审批人 Approve,再由 skills 席位落地。What changes
Silently-wrong item 3 of
skills/objectstack-automation/SKILL.mdgains one paragraph on how ascriptnode'sconfig.functionresolves since PR #32257, beside the item that already owns script-node behaviour. Thescriptrow of the node table (L97) already points at item 3 and is unchanged, so the rule has one home. The D3 steps themselves are not restated: the paragraph points at thesubflowrow (L76), which already teaches them, and adds only what differs for functions.3. **`script` nodes call a registered function — nothing else.** `config.function` (**required**: an empty node refuses at execute, an unregistered name fails - loudly) names one registered via `defineStack({ functions: { my_fn: (ctx) => … } })`. + loudly) names one registered in `defineStack({ functions })` (below). + + **The name resolves from the flow's package, as `subflow`'s `flowName` + does**, the platform's function (registered under no package) in every + flow's reach; a `.custom` override reads as a package-less flow. `acme.crm` + and `acme.sales` both shipping `normalize_phone` each run their own (the boot + warns `Bare-name conflict at boot`). If the flow's package holds none, two + holders in reach (the platform's counts) or one only outside its + `dependencies` closure fail the step as a guard (no `fault` edge; + `$error.code: 'RESOURCE_CONFLICT'` in a `try_catch`); a flow door answers + `400 FLOW_FAILED`, `error.details.innerRefusal` naming each holder. Fix: + declare the dependency, or rename.Taught claims and their source on
main(c7dd505de)packages/services/service-automation/src/builtin/screen-nodes.tsL653 (engine.resolveFunction(target, context));packages/services/service-automation/src/engine.tsL4520–L4527 (passesflowCallerPackage(context))subflow'sflowName: own, else the one holder in thedependenciesclosure plussys; package-less flow reads environment-widepackages/core/src/package-scoped-resolution.tsL623–L666 (resolvePackageScopedHolders, steps 1–3 at L644, L647, L660; environment-wideresolveEnvironmentWideL591); function adapterpackages/objectql/src/package-scoped-resolver.tsL189–L199; bridgepackages/services/service-automation/src/function-package-scope.tsL63–L75.subflowreads the same caller (engine.tsL7135)packages/objectql/src/engine-hooks-and-functions.tsL262 (owner-less registration held undernull), L303–L315 (platformItem,environmentItem: () => undefined);package-scoped-resolution.tsL602–L606 (package-less caller), L651–L654 (package caller holding none)flow-function-package-scope.test.tsL228–L245 (refused, both callers), L334 (CONTROL, platform alone served)package-scoped-resolution.tsL644–L645; tests L138–L170 (both registration orders, own over closure).customoverride (and an environment-authored flow) reads as a package-less flowengine.tsL5706–L5712 (flowCallerPackage), L5732–L5736 (armedFlowPackageanswers only forsource: 'package'), L5717–L5721 (doc: undefined for the shipping package's declared.customoverride and for a runtime body), L2602–L2606 ('override'= the paired<package>.custom); tests L354–L382ambiguous-in-closure/ambiguous-in-environment); a holder only outside the closure refuses (outside-closure)package-scoped-resolution.tsL602–L610, L651–L658, L660–L665; tests L172–L245faultedge routes itscreen-nodes.tsL640–L661 (refuseNode); test L289–L301/actions, a declaredtype: 'flow'endpoint) answers400 FLOW_FAILEDwitherror.details.innerRefusalnaming each holder; arecord_changeor scheduled run has no such callerscreen-nodes.tsL657–L659 (code,refusalCarriedBy);packages/runtime/src/flow-dispatch-status.tsL264–L269 (flowFailureDetails, the four doors); refusal text names every candidatepackage-scoped-resolution.tsL497–L520; dogfoodpackages/qa/dogfood/test/bare-name-one-holder-request-family.dogfood.test.tsL289–L300 (no-package flow400 FLOW_FAILEDcarryingRESOURCE_CONFLICT)$error.codeisRESOURCE_CONFLICTin atry_catchscreen-nodes.tsL658; test L247–L287package-scoped-resolution.tsL508–L510 (outside-closure text: "Declare a dependency on the package that holds it");packages/objectql/src/registry.tsL2913–L2920 (boot warning: "Rename the item in one package")screen-nodes.tsL662–L669; test L344Round 2 (contract review 6783849220, PASS at
8f2225441)400 FLOW_FAILEDis now scoped to a flow door, anddetailsreadserror.details, asskills/objectstack-api/SKILL.mdL365–L367 spells it. The step's guard failure and$error.codehold on every run; arecord_changeflow's failure is logged while the write answers normally (packages/triggers/trigger-record-change/src/record-change-trigger.ts), and a scheduled run has no HTTP caller.Card vs main
main, not on the card). The card says two packages shipping one function each run their own. That holds, but a function name is still one per deployment under the phase-1 rule:functionis not inNAMESPACE_SCOPED_BARE_NAME_TYPES(packages/core/src/package-scoped-resolution.tsL143–L147), andBARE_NAME_COLD_BOOT_MODEis'warn'(packages/objectql/src/bare-name-one-holder.tsL379). Two packages that both shipnormalize_phoneboot with oneBare-name conflict at bootwarning naming both and a rename (registry.tsL2913–L2920; dogfood test L212–L226), and a further package binding the name after the boot is refused (registry-bare-name-one-holder-request-family.test.tsL555–L567). So the skill says "the boot warns".main: the shipping package's declared.customoverride and an environment-authored body (engine.tsL5717–L5721).The cut and its surviving home
The file had 2 bytes of headroom. Paid first, one true same-file restatement: item 3's
defineStack({ functions: { my_fn: (ctx) => … } })registration shape (−18 B net). Its surviving home is the same item'sdefineStack({ functions: { 'helpdesk.aiTriageStub': (ctx) => …, 'billing.sync': { handler, effect: 'writes' } } })block, ~30 lines below, which the new "(below)" points at. No test or script quotes the cut text (git grep "my_fn: (ctx)"overpackages/andscripts/: no hit). No other same-file restatement survived a home check (the hookrunAscallout, the CEL callout, the prerequisite table and § Verify your work each have no other home).Ratchet reading
node scripts/check-skills-token-ratchet.mjs,skills/objectstack-automation/SKILL.md(priced =wc -c− 20, the stamp line):origin/mainc7dd505deThe remainder, +174 tokens, is raised under the standing ruling 「A:先削重复,余额按实测提高」 (ruling record 6513306068), on the seat's surface widening (claim amendment 6782965220), with a dated comment on the row naming the cut, its home and the
wc -carithmetic. Only that row moves.Sweep
skills/objectstack-automation/**(SKILL.md,references/*.md,evals/*.json) for sentences the rule makes false or incomplete:scriptrow): "Call a registered function named byconfig.function(see … Implement ObjectStack protocol specification with Zod schemas and TypeScript interfaces #3)". Still true; it points at the home. Unchanged.faultedge". Listed, not edited.references/*.md: no script-node function mention (state-machines-and-approvals.mdL45 is ascriptvalidation rule, another thing).objectstack-api/SKILL.mdL133 and its evalendpoints-auth-routes.jsonL27 ("ascriptnode names a stack function", the endpoint's own package);objectstack-data/references/_index.mdL23 (schema pointer);objectstack-data/references/data-hooks.mdL873–L879 (a hook's string handler, which the hook binder resolves among its own package's functions only, a different rule).Eval reading:
evals/flows-triggers-approvals.jsoncase 5 is the only script-node case. It covers the config shape and purity (function:,outputVariable, a followingupdate_record) for the author's own function, not resolution across packages. The new rule does not fit its shape, so no case is extended.Verification
Head
1debed236, basec7dd505de. Fullpnpm buildexit 0 first; gate list run underNODE_OPTIONS=--max-old-space-size=8192.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 64 commands, each run with its exit captured before any pipe: 64 exit 0.--ranreconciliation: 64 derived, 64 run, 0 NOT-MEASURED, 0 UNRUN. Record:/mnt/project-files/card-32264/gates-1debed23.txt(round 1 at8f2225441: the same 64, all exit 0,gates-8f222544.txt).origin/mainmoved to91d88ec13during the run (scripts/regen-artifacts.mjschanged). The list re-derived on a local merge of this head into it is identical (64 commands), and main's commits since the base touch none of this PR's three files.scripts/or.changeset/:check-published-list-mirrors,check:changeset-fixed,check:engine-double-contract,check:i18n-stale-fill,check:published-readme-exports,check:skill-top-level-keys: all exit 0.node scripts/check-commit-card-trailers.mjs --range origin/main..HEAD: exit 0.Contract review:
dispatch-gates --tiermandatesCONTRACT_REVIEW_TIERforskills/**(clause ①). The maintainer's standing order (2026-11-03) waives that tier for card threads; the seat runs the contract review of record at that tier.Changeset:
.changeset/32264-automation-script-node-package-rule.md,'@objectstack/skills': patch.Clause-②: no
Metadata-protocol: none