diff --git a/.changeset/33569-skills-function-name-clash-bind.md b/.changeset/33569-skills-function-name-clash-bind.md new file mode 100644 index 00000000000..5fc62539eb0 --- /dev/null +++ b/.changeset/33569-skills-function-name-clash-bind.md @@ -0,0 +1,10 @@ +--- +'@objectstack/skills': patch +--- + +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 + +Clause-②: no +Metadata-protocol: none + +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. diff --git a/skills/objectstack-automation/SKILL.md b/skills/objectstack-automation/SKILL.md index 22a10a566aa..381c4b03cf3 100644 --- a/skills/objectstack-automation/SKILL.md +++ b/skills/objectstack-automation/SKILL.md @@ -260,23 +260,23 @@ Most are caught by `objectstack build`: 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 in `defineStack({ functions })` (below). + loudly) names one registered in `defineStack({ functions })`. **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. 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`). If the - flow's package holds none, two holders in reach 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. + does**, the platform's ownerless function in every flow's reach; a + `.custom` override reads as a package-less flow. 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. If the flow's package + holds none, two holders in reach 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's `innerRefusal` names + each holder. Fix: declare the dependency, or rename. **A flow `function` is a PURE compute step — it does NOT read/write the - database.** It receives `ctx.input` and **returns** a value; `config.outputVariable` - exposes that value as a flow variable, and a later **declarative** node persists - it: + database.** It receives `ctx.input` and **returns** a value; a later + **declarative** node persists its `outputVariable`: ```ts { id: 'ai', type: 'script', config: {