Skip to content

Commit b4698f7

Browse files
docs(skills): a clashing flow function name leaves the later package's functions and hooks unbound, not refused at install (#33668)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XVyJcsmnrrm8h24VEcqmdWB)_ Fixes #33569 Clause-②: no Metadata-protocol: none Signed: domain:skills#1 · os-project-manager · session_01FEkQ5mpzgKr4dbZVjCqjSv ## 维护者速读 - 改了什么:`objectstack-automation` 技能「Valid-but-silently-wrong」第 3 条里,把「同一命名空间(或无命名空间)的第二个包声明同名流程函数会在安装时被拒」改成实际行为:启动时两包都已持有则告警 `Bare-name conflict at boot`;启动后再装的包照样装上,但它的绑定整体失败(`error` 日志 `Failed to bind declarative hooks`),它的所有函数和钩子都不生效,不冲突的那些也一样。补救办法不变:改名,或换一个命名空间。 - 为什么改:旧说法让作者以为会被响亮拒绝;实际是装上了却静默不工作,流程的 `script` 步骤要么因找不到函数而失败,要么(依赖了先持有的包时)悄悄跑了别人的函数。 - 风险与回滚:只改技能文字与一个 patch changeset,不碰 schema、运行时与 eval;回滚即还原本 PR。文件 token 仍在上限内(6861 / 6861),靠在同文件里缩短两处重复说明付账,未抬上限。 - 先看:`skills/objectstack-automation/SKILL.md` 第 263–279 行。 - 两分钟验证:`git diff origin/main -- skills/objectstack-automation/SKILL.md`,应只见第 3 条这一段与其后 `outputVariable` 一句的改动。 - 需要你做的:受管面 Tier H(`skills/**`),席位的达档契约复审 PASS 记录在案后,请合并。 ## What changes Item 3 of "Valid-but-silently-wrong" in `skills/objectstack-automation/SKILL.md`. Old text: "Packages of two `namespace`s each run their own `normalize_phone` (one namespace, or none: refused at install; a boot warns `Bare-name conflict at boot`)." New text: > Packages of two `namespace`s each run their own `normalize_phone`. One namespace (or none): both held at boot warn `Bare-name conflict at boot`; a later one installs but binds NONE of its functions or hooks (error `Failed to bind declarative hooks`): rename, or another namespace. This is should-fix F1 of the at-tier retro review of merged PR #33396 (record 6886826237), with nit F3 folded in: the old parenthesis merged two moments, a pair both held at the boot and a new holder bound after it. The new sentence gives each its own clause. ### Each claim, read on `main` @ 7f0e38a | Claim | Code | |:--|:--| | Two namespaces each run their own (unchanged) | `packages/objectql/src/registry.ts:5520-5523` (`bareNameHoldersOtherThan` with `incomingNamespace`: a holder of another namespace is no conflict); `packages/core/src/package-scoped-resolution.ts:753` (step 1, the caller package's own item) | | Both held at boot: the boot warns `Bare-name conflict at boot` | Before the seal `claimBareNameFunctions` only records (`registry.ts:5517`, the throw is inside `if (this.bareNameHoldersSealed)`); the AppPlugin binds in `start()` (`packages/runtime/src/app-plugin.ts:1413`, call at `:1865`) and the seal runs later at `kernel:bootstrapped` (`packages/objectql/src/plugin.ts:1372-1383`), where `sealBareNameHoldersAtColdBoot` logs `bareNameColdBootWarning` (`registry.ts:3044`, text opens "Bare-name conflict at boot" at `:2957`) | | A later one installs | The bind after the seal throws `BareNameConflictError` (`registry.ts:5530`) from `bindHooksToEngine` (`packages/objectql/src/hook-binder.ts:221`); `bindAppArtifactHandlers` catches it per owner group and logs it (`packages/runtime/src/app-artifact-handlers.ts:415-443`, "Never throws" at `:89`), so neither caller sees a throw: AppPlugin `start()` (`app-plugin.ts:1865`) and the install-local plugin, which binds an installed package on install (`packages/cloud-connection/src/marketplace-install-local-plugin.ts:6611-6615`) | | ...but binds NONE of its functions or hooks | The claim runs ahead of every `registerFunction` (`hook-binder.ts:221` before `:236`) and ahead of the hook half (`:249` onward), so the throw leaves both empty for that owner group, the non-clashing names included. Pinned by `packages/objectql/src/registry-bare-name-one-holder-request-family.test.ts:586-602` (`beta_only_fn` stays unregistered) | | (error `Failed to bind declarative hooks`) | `app-artifact-handlers.ts:442`, `logger.error` | | What the author then sees (not written into the sentence; it follows from it and the next sentence) | Its flows read the clashing name as a package holding none: one holder only outside the `dependencies` closure refuses `outside-closure` as a guard (`package-scoped-resolution.ts:769-774`), a holder inside the closure runs that package's function (step 2, `:756-767`). A non-clashing name has no holder at all and fails as unregistered (`packages/services/service-automation/src/builtin/screen-nodes.ts:663-668`) | | Remedy: rename, or another namespace | Rename: the boot warning's own remedy (`registry.ts:2960-2961`) and the card. Another namespace: two holders of different declared namespaces never meet, so the bind is not refused (`registry.ts:5520-5523`) | ### Token budget, paid in place The file sat at 6859 of 6861 (priced bytes 27435). The rewrite costs +129 bytes, paid in the same file: - The flow door clause "a flow door answers `400 FLOW_FAILED`, `error.details.innerRefusal` naming each holder" becomes "a flow door's `innerRefusal` names each holder". Home: `skills/objectstack-api/SKILL.md:356-365` teaches the flow door's `400 FLOW_FAILED` and `error.details.innerRefusal`, naming a `script` node's function-name refusal. - "(registered under no package)" becomes "ownerless", the word the file already uses for the same idea (§ Assignment rules). - "(below)" after `defineStack({ functions })` is cut; the example sits right under it. - The pure-compute paragraph's "`config.outputVariable` exposes that value as a flow variable, and a later declarative node persists it" becomes "a later declarative node persists its `outputVariable`"; the example under it shows `outputVariable: 'ai'` read as `ai.ai_category`. The eval that expects `outputVariable` (flows-triggers-approvals) is still served by that example. Result: 27444 priced bytes, 6861 of 6861, headroom 0. Ceiling not moved. Lines: 463 before, 463 after. Package total of all SKILL.md files: unchanged in lines; tokens +2 (the file's headroom). ## Tests Skill wording only: no package is touched, so no package test or typecheck is owed and no ablation applies. The claims are read against the code and the pinning test named above. ## Acceptance notes - Code-side texts that use the same loose wording belong to the objectql owner and are NOT edited here (order ruling): `packages/objectql/src/hook-binder.ts:214-216` still says the function bind refusal "stays until the trailing backstop child (ADR-0150 D9) narrows it", which has narrowed (`bareNameHoldersOtherThan` with the namespace); `bareNameColdBootWarning` (`packages/objectql/src/registry.ts:2959-2960`) says "a further package declaring the name is refused at install", which for a function is the bind failure above. The seat files a card. - `.changeset/32522-skills-automation-function-name-per-namespace.md`, still unreleased, carries the old "refused at install" sentence. It is not edited here (outside this card's surface); this PR's changeset states the correction, so both entries ship in the same release notes. ## Verification - `dispatch-gates --tier`: MANDATORY claude-fable-5-2 (`skills/**`, clause ①, no one-line exit). This thread ran on an opus-tier model; the at-tier review is the seat's. - `check-governed-merges.mjs --branch claude/project-thread-vmehq6`: exit 3, GOVERNED, landing tier H, `skills/**` ×1; +23 / -13 over 2 files, under the human-merge threshold. - Ratchets on head 08401f6: `check-skills-token-ratchet` exit 0 (6861 / 6861); `check-skill-line-ratchet` exit 0. - Derived gates (`dispatch-gates --commands`), run on head 08401f6 after `turbo run build --filter=@objectstack/formula --filter=@objectstack/lint` under the verify lock (VERDICT command-exit 0): **46 derived, 44 exit 0, 2 exit 3 NOT MEASURED** (`check:dual-build-cjs-loads`, `check:lean-entry-closure`: they read every package's `dist`; no package is touched, CI runs them). `dispatch-gates --ran`: 46 accounted for, 44 run, 2 NOT-MEASURED, 0 UNRUN. <details><summary>46 gates, each with its exit code</summary> ```text node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0 node scripts/check-adr-0087-registration.mjs --self-test :: exit 0 node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0 node scripts/check-closing-keyword-parity.mjs :: exit 0 node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0 node scripts/check-comment-mask-corpus.mjs :: exit 0 node scripts/check-doc-route-spelling.mjs --advisory :: exit 0 node scripts/check-doc-route-spelling.mjs --self-test :: exit 0 node scripts/check-dts-emitted.mjs --self-test :: exit 0 node scripts/check-empty-changeset.mjs --base origin/main :: exit 0 node scripts/check-empty-changeset.mjs --self-test :: exit 0 node scripts/check-skills-token-ratchet.mjs :: exit 0 node scripts/check-skills-token-ratchet.mjs --self-test :: exit 0 node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0 node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0 node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0 node scripts/ci/snapshot-next.mjs --self-test :: exit 0 node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0 node scripts/release-pending-publish.mjs --self-test :: exit 0 pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0 pnpm --filter @objectstack/spec run check:skill-docs :: exit 0 pnpm check:agent-test-spelling :: exit 0 pnpm check:changeset-gate-self-tests :: exit 0 pnpm check:ci-filter-parity :: exit 0 pnpm check:closed-ceremony-text :: exit 0 pnpm check:corpus-claim-drift :: exit 0 pnpm check:cross-package-test-inputs :: exit 0 pnpm check:doc-authoring :: exit 0 pnpm check:driver-memory-census :: exit 0 pnpm check:dts-closure :: exit 0 pnpm check:dual-build-cjs-loads :: exit 3 pnpm check:gitlink-declared :: exit 0 pnpm check:lean-entry-closure :: exit 3 pnpm check:merge-driver :: exit 0 pnpm check:nul-bytes :: exit 0 pnpm check:pm-governed-merges :: exit 0 pnpm check:pm-skill-id-lint :: exit 0 pnpm check:published-files :: exit 0 pnpm check:refd-timer-probe :: exit 0 pnpm check:role-word :: exit 0 pnpm check:skill-compatibility :: exit 0 pnpm check:skill-frame-sync :: exit 0 pnpm check:skill-identifier-liveness :: exit 0 pnpm check:skill-links :: exit 0 pnpm check:sourcemap-no-sources-content :: exit 0 pnpm check:watch-hint-literal :: exit 0 ``` </details> - Every family CI runs beyond the derived list: read off this PR's check-runs. --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5mpzgKr4dbZVjCqjSv)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent d4e3dcc commit b4698f7

2 files changed

Lines changed: 23 additions & 13 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the automation skill says what a clashing flow function name really does: the later package installs, and none of its functions or hooks bind
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Item 3 of "Valid-but-silently-wrong" in `objectstack-automation` said a second package holding a function name of the same namespace (or of none) is "refused at install". No install door judges a function. The hook binder's bind refuses it (`claimBareNameFunctions`), the runtime binder logs `Failed to bind declarative hooks` at `error`, and the package installs anyway with every function and hook of that owner unbound, the names that do not clash included. The skill now says that, keeps the remedy (rename, or another namespace), and splits the two moments it used to merge: a pair both held at boot warns `Bare-name conflict at boot`; a holder bound after the boot is the one left unbound. This corrects the "refused at install" sentence of the `32522-skills-automation-function-name-per-namespace` entry. To stay within the file's token budget, two restatements are shortened: the flow door's `400 FLOW_FAILED` answer (taught in `objectstack-api`) and the `outputVariable` explanation (shown by the example under it). No schema, accept set or behaviour changes.

‎skills/objectstack-automation/SKILL.md‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -260,23 +260,23 @@ Most are caught by `objectstack build`:
260260

261261
3. **`script` nodes call a registered function — nothing else.** `config.function`
262262
(**required**: an empty node refuses at execute, an unregistered name fails
263-
loudly) names one registered in `defineStack({ functions })` (below).
263+
loudly) names one registered in `defineStack({ functions })`.
264264

265265
**The name resolves from the flow's package, as `subflow`'s `flowName`
266-
does**, the platform's function (registered under no package) in every
267-
flow's reach; a `.custom` override reads as a package-less flow. Packages of
268-
two `namespace`s each run their own `normalize_phone` (one namespace, or
269-
none: refused at install; a boot warns `Bare-name conflict at boot`). If the
270-
flow's package holds none, two holders in reach or one only outside its
271-
`dependencies` closure fail the step as a guard (no `fault` edge;
272-
`$error.code: 'RESOURCE_CONFLICT'` in a `try_catch`); a flow door answers
273-
`400 FLOW_FAILED`, `error.details.innerRefusal` naming each holder. Fix:
274-
declare the dependency, or rename.
266+
does**, the platform's ownerless function in every flow's reach; a
267+
`.custom` override reads as a package-less flow. Packages of two
268+
`namespace`s each run their own `normalize_phone`. One namespace (or
269+
none): both held at boot warn `Bare-name conflict at boot`; a later one
270+
installs but binds NONE of its functions or hooks (error `Failed to bind
271+
declarative hooks`): rename, or another namespace. If the flow's package
272+
holds none, two holders in reach or one only outside its `dependencies`
273+
closure fail the step as a guard (no `fault` edge; `$error.code:
274+
'RESOURCE_CONFLICT'` in a `try_catch`); a flow door's `innerRefusal` names
275+
each holder. Fix: declare the dependency, or rename.
275276

276277
**A flow `function` is a PURE compute step — it does NOT read/write the
277-
database.** It receives `ctx.input` and **returns** a value; `config.outputVariable`
278-
exposes that value as a flow variable, and a later **declarative** node persists
279-
it:
278+
database.** It receives `ctx.input` and **returns** a value; a later
279+
**declarative** node persists its `outputVariable`:
280280

281281
```ts
282282
{ id: 'ai', type: 'script', config: {

0 commit comments

Comments
 (0)