Skip to content

fix(service-automation)!: a connector_action node refuses an input key its action does not declare - #33614

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/area-A5-33553
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/area-A5-33553

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

Fixes #33553

Clause-②: no (narrowing) — a connector_action step whose connectorConfig.input holds a key the chosen action's inputSchema does not declare used to run and send that key to the provider; it now fails before dispatch with VALIDATION_ERROR. Nothing published widens: connector-input-schema.ts is not re-exported from the package's "." entry, so ConnectorInputJudgeOptions, UNDECLARED_KEY_HINT and undeclaredKey are internal (the same spelling #27995 declared for this door). First-party flows affected: 0.
Metadata-protocol: narrowed
Skills-docs: follow-up owed — skills/objectstack-automation/SKILL.md (the connector_action row lists the judged subset without the undeclared-key refusal), skills/objectstack-automation/references/integration-recipes.md (says a skipped $ref makes the derived schema silently lose the parameter; it now reads as open input). Governed surface, so not in this PR.

维护者速读

  • 改了什么:connector_action 节点在调用连接器前,若 connectorConfig.input 里有该 action 的 inputSchema 未声明的键(任一对象层级,含数组元素),整步拒绝并报 VALIDATION_ERROR,点名节点、键和该层已声明的键,不再发给外部服务;同时 OpenAPI 连接器生成器把它读不懂的部分(未解析的 $ref 参数、$ref 或无 schema 的请求体)声明为开放,而不是漏掉。
  • 为什么改:设计器切换连接器或 action 后残留的旧键会原样发到外部服务;而生成器若继续漏掉 $ref 参数,未规范化的 OpenAPI 文档上原本能用的调用会被新规则误拒。
  • 风险与回滚:已存的流若带未声明键,运行时这一步会失败(fault 边可接);Slack chat.postMessage / chat.update 只列了 4 个参数,其它 Slack 参数需改用 call action(changeset 已写迁移)。回滚 = revert 本 PR。
  • 先看:packages/connectors/connector-openapi/src/openapi-connector.ts 的 buildInputSchema(开放分节与 body: {}),再看 packages/services/service-automation/src/connector-input-schema.ts 的 declaredKeysOf,最后 .changeset/33553-connector-action-undeclared-input-key.md 的迁移段。
  • 两分钟验证:pnpm --filter @objectstack/connector-openapi exec vitest run src/input-schema-dispatch.test.ts,预期 6 个用例全绿,其中 automation: a connector_action node sends input keys its action does not declare to the provider (open input schemas, no refusal) #33553 的 2 个证明带 $ref 参数/请求体的文档仍能调用。
  • 需要你做的:无,席位落地。

What changes

  • connector-input-schema.ts: judgeConnectorInput takes an opt-in refuseUndeclaredKeys. With it on, at every object level the walk reaches (array items included), a key the schema does not declare is a violation naming its dotted path and the keys declared there (at most 8 listed, then a count). The verdict gains undeclaredKey, and the module exports UNDECLARED_KEY_HINT for the door's refusal.
  • Which schemas declare their keys: a schema that lists properties, or says additionalProperties: false; the declared keys are the names in properties plus those in required. A schema that admits more keys declares OPEN input and every key dispatches: additionalProperties set to true or to a schema, unevaluatedProperties other than false, patternProperties, $ref, $dynamicRef, $recursiveRef (added in this round, review#2 N2), allOf / anyOf / oneOf, if / then / else, dependentSchemas, dependencies. A schema with no properties is open too, as is an action with no inputSchema.
  • An undeclared key whose value is undefined is absent (never sent); every other value, null included, is refused.
  • builtin/connector-nodes.ts: the connector_action node asks for the judgment on the EVALUATED input, against the schema of the instance the call dispatches to, and appends the hint. Same VALIDATION_ERROR runtime failure as a missing required parameter, so a fault edge receives it. No new error code.
  • connector-openapi buildInputSchema (review#2 M1, option a). What the generator skips now reads as open, never as absent, because the handler still sends it. An unresolved $ref parameter has no readable in without de-referencing the document, so it opens every location the handler sends: path, query and header are each emitted with additionalProperties: true, also when they declare no parameter of their own (then not required). Parameters declared beside the $ref are still type-checked. An unresolved $ref request body, or one whose content carries no schema, is declared as body: {} (any value). A document run through normalize-openapi is unaffected and keeps full per-parameter checks.
  • The connector pull door (connector-pull.ts, connectorSource.input) does not opt in and is unchanged in behaviour; it is now pinned through pullConnectorSource itself (review#2 N4).
  • Changeset: lists @objectstack/service-automation, @objectstack/connector-openapi and @objectstack/spec (review#2 N3; spec carries the semantic entry); names the Slack chat.postMessage / chat.update partial schemas with the FROM → TO migration to the call action (S2); says "every object level, array items included" (N1). The semantic entry's surface and replacement say the same.

Why run time and not publish time

Measured on origin/main 4bba8b8f02 with a throwaway probe (not committed): the connector list read at the boot flow pull's registerFlow call was [], and ["host_conn"] once bootstrap() resolved. In plugin.ts the flow pull runs in start() before materializeDeclaredConnectors(ctx, { fatal: true }), and stored connector entries wait for kernel:bootstrapped, so a registration-time verdict would be one the same boot can contradict (AGENTS.md "Startup registry reads"). A publish-time warning would need a sealed connector vocabulary, which does not exist; not built here.

Tests

  • service-automation src/builtin/connector-input-schema.test.ts, describe 6: a top-level undeclared key (node, key and declared keys named; fault edge gets VALIDATION_ERROR; handler never called), a null undeclared value, a key outside an additionalProperties: false schema, a key inside an OpenAPI query section, an envelope evaluating to an undeclared key, five open-input schemas that still dispatch, a declared-only call, the helper's opt-in, and (this round) $recursiveRef / $dynamicRef read as open.
  • service-automation src/connector-pull.test.ts (this round): the pull door, through pullConnectorSource, still sends an undeclared top-level key and an undeclared query key.
  • connector-openapi src/input-schema-dispatch.test.ts, new top-level describe (this round), through a real boot (LiteKernel + AutomationServicePlugin + ConnectorOpenApiPlugin, recording fetchImpl): (1) a PUT with $ref path and query parameters and a $ref body: the schema has open path / query / header and body: {}, the call dispatches to /pets/7?tag=dog... with the body sent, and the declared limit is still refused as a string; (2) a body whose content has no schema is body: {}, required, and dispatches.

Acceptance notes

  • Out of scope, not touched: Studio ui/packages/app-shell/src/views/metadata-admin/inspectors/connector-input-fields.ts treats a schema as closed only when it says additionalProperties: false, so it still offers an extras repeater for keys the run now refuses (loudly). Follow-up card for the ui lane.
  • Out of scope, not touched: the connector pull door judges connectorSource.input with the same function and does not ask for the undeclared-key judgment, so an undeclared key in a mapping's connectorSource.input still reaches the provider. Same family; needs its own card.
  • ADR-0087: Metadata-protocol: narrowed → the changeset declares registered connector-action-undeclared-input-key-refused; the semantic entry is packages/spec/src/migrations/entries/semantic/18.connector-action-undeclared-input-key-refused.ts.
  • File surface widened this round to packages/connectors/connector-openapi (review#2 M1). No open PR touched that package when this was pushed (99 open PRs' file lists read).
  • First-party producers checked against their action schemas: the shipped DocuSign and Stripe OpenAPI documents carry no $ref parameter or request body; showcase Slack chat.postMessage sends channel, text; showcase REST request and MCP echo_upper send declared keys only. GitHub MCP schemas come from the remote tools/list and were not measured.

Verification

Tree: objectstack-ai/objectstack, head 188a8286 (merge of origin/main into 753c427e; the source under test is identical from 753c427e, the merge brings only main's files). CI on 188a8286: 67 check runs, 56 success, 11 skipped, 0 failed.

Builds and generated artifacts
  • After the merge: pnpm install --frozen-lockfile and a build of the closures of the eleven packages below, under the verify lock: VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec check:generated: All 14 generated artifacts are up to date, VERDICT command-exit 0.
Package and dependent tests + typecheck (head 188a828)

turbo run test typecheck --concurrency=2 over service-automation, connector-openapi and their direct dependents: Tasks: 86 successful, 86 total, VERDICT command-exit 0.

  • service-automation 3969 passed (3969); connector-openapi 111 passed (111); connector-mcp 119 passed (119); connector-rest 57 passed (57); connector-slack 10 passed (10); connector-app-docusign 28 passed (28); connector-app-stripe 20 passed (20); connector-app-github 18 passed (18); trigger-record-change 122 passed (122); trigger-schedule 256 passed (256); plugin-approvals 1652 passed (1652).
  • eslint --no-inline-config on the seven changed .ts files: exit 0. node scripts/check-nul-bytes.mjs: exit 0.
Ablation, connector-openapi (scripts/ablation-replace.mjs, fix committed first)
  • openapi-connector.ts: unresolvedParameter = true; to false; anchor 1 to 0, blob 58d47fe33cec to d0dbad2b549a. src/input-schema-dispatch.test.ts: Tests 1 failed | 5 passed (6) (the $ref-parameter case). Restored: blob == HEAD 58d47fe33cec, git diff HEAD empty.
  • Earlier rounds (service-automation, legs on connector-nodes.ts and connector-input-schema.ts): Tests 5 failed | 17 passed (22) and Tests 1 failed | 21 passed (22), both restored to HEAD.
Derived gates (dispatch-gates --commands at 188a828, 90 families)

Local run of the derived list: every family read so far exited 0 except two prerequisite refusals, NOT MEASURED locally: check-plugin-teardown-shape --self-test exit 3 (shallow clone cannot reach its pinned fixture) and check:dual-build-cjs-loads exit 3 (PREREQUISITE NOT MET, no dist/ for unbuilt packages). Every family CI runs is green on this head's check runs (Lint & Repo Gates, TypeScript Type Check, Check Changeset, Test Core, Build Core).

Dogfood battery: CI's queue leg runs it on the final head.

Session: https://claude.ai/code/session_016WV4cwhJBt274G7zk78A5a

🤖 Generated with Claude Code

…y its action does not declare

The connector_action node judges the evaluated input against the action's
inputSchema with the undeclared-key judgment on: a key outside an object
schema's properties/required is refused with VALIDATION_ERROR, naming the
node, the key and the declared keys, and nothing is sent to the provider.
A schema that admits more keys (additionalProperties true or a schema,
patternProperties, a composition keyword) or lists no properties declares
open input and still dispatches. The pull door does not opt in.

Claude-Session: https://claude.ai/code/session_016WV4cxHwXNcGcAHNerZsom
Co-authored-by: Claude <noreply@anthropic.com>
…onnector_action input key

Claude-Session: https://claude.ai/code/session_016WV4cxHwXNcGcAHNerZsom
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 15, 2026
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/connector-openapi, @objectstack/service-automation, @objectstack/spec, touching 21 documentable anchor(s).

2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/automation/connectors.mdx (via /api/v1/automation/connectors (route, a path literal in replacement))
  • content/docs/kernel/cluster.mdx (via /api/v1/automation/connectors (route, a path literal in replacement))

⛔ 2 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v15.mdx (via /api/v1/automation/connectors (route, a path literal in replacement))
  • content/docs/releases/v18/18-3.mdx (via /api/v1/automation/connectors (route, a path literal in replacement))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 3 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 172 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 020ce3d9e8c7ac9a97863cf31e151290d4938a70 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 2e0dbfd9177f80b43ec703655ef967f9972c220d — the merge of head 188a8286353413c982a115f6f5831e08322bb9ff into base 020ce3d9e8c7ac9a97863cf31e151290d4938a70, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 2e0dbfd9177f80b43ec703655ef967f9972c220d && git checkout 2e0dbfd9177f80b43ec703655ef967f9972c220d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 020ce3d9e8c7ac9a97863cf31e151290d4938a70 188a8286353413c982a115f6f5831e08322bb9ff && git checkout -B drift-repro 020ce3d9e8c7ac9a97863cf31e151290d4938a70 && git merge --no-ff 188a8286353413c982a115f6f5831e08322bb9ff

node scripts/docs-audit/affected-docs.mjs --json 020ce3d9e8c7ac9a97863cf31e151290d4938a70

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 020ce3d9e8c7ac9a97863cf31e151290d4938a70 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…ed input key refusal

Claude-Session: https://claude.ai/code/session_016WV4cxHwXNcGcAHNerZsom
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4cxHwXNcGcAHNerZsom

Request: review · area A5 · head 10a4106 · contract

Fixes #33553. A connector_action node refuses, before dispatch, any input key the chosen action's input schema does not declare (top level and inside sections, on the evaluated input). The step fails with VALIDATION_ERROR naming the node, the key's dotted path and the declared keys; nothing is sent; a fault edge can catch it. A schema that admits more keys (additionalProperties true/schema, patternProperties, composition, $ref, no properties) stays open. The check is opt-in on the shared judgeConnectorInput, so the connector pull door is unchanged (pinned). Publish-time refusal is not built: measured that at boot the flow pull registers flows before connectors materialize, so a registration verdict would be a startup-order defect; reason in the PR body. Clause-② yes (narrowing), Metadata-protocol narrowed, ADR-0087 semantic entry connector-action-undeclared-input-key-refused added (one spec file, surface widened by A5). +~270 lines, service-automation minor. First-party producers (DocuSign, Stripe, showcase Slack/REST/MCP) send only declared keys. Out-of-scope: connector pull connectorSource.input has the same gap (Acceptance notes).

Posted 2026-11-15T03:24Z.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract-review-claim: session_016WV4cxDxAYxdtDhtR1kQQe · head 10a4106 · 2026-11-15T03:26:43Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 10a4106a1825444edb72e84a9c9c299ebf60082b
Local-runs: probe — ran this head's connector-input-schema.ts alone (node strip-types, no build) against the schema shape connector-openapi emits when it skips a $ref parameter or request body, to confirm the M1 refusal
Scope: packages/spec/src/migrations/entries/semantic/18.connector-action-undeclared-input-key-refused.ts + .changeset/33553-connector-action-undeclared-input-key.md, packages/services/service-automation/src/connector-input-schema.ts, packages/services/service-automation/src/builtin/connector-nodes.ts, packages/services/service-automation/src/builtin/connector-input-schema.test.ts; read only: packages/connectors/connector-openapi/src/openapi-connector.ts, packages/connectors/connector-openapi/src/openapi-provider.ts, packages/connectors/connector-openapi/scripts/normalize-openapi.mts, packages/connectors/connector-slack/src/slack-connector.ts, packages/connectors/connector-rest/src/rest-connector.ts, packages/services/service-automation/src/plugin.ts, content/docs/automation/connectors.mdx, packages/services/service-automation/CHANGELOG.md (the #27995 / #28040 entries)

review#2 (server area pilot) · area A5 · Fixes #33553 (p2) · narrowing face plus one spec path. Read-only: the diff, the head tree, the cited producers, the issue, and the head's check runs, including the Check Changeset job log. One local probe, named above.

① Derived judgments

  • Where the refusal happens. The refusal sits in the connector_action executor (connector-nodes.ts ~149-180). It runs after resolveValueSlotMap, so it judges the EVALUATED input, and before handler(input, ...), so nothing is sent. It returns success: false, code: 'VALIDATION_ERROR', the same runtime failure automation: a connector_action call is dispatched without checking its input against the action's declared inputSchema, so a missing required parameter reaches the remote API #27995 uses, so a fault edge receives it (test 6.1 asserts this). The message names the node, each 'dotted.path' and the keys declared at that level. UNDECLARED_KEY_HINT is appended only when undeclaredKey is set.
  • How the walk finds keys. The undeclared-key loop runs inside the kind === 'object' branch of collectInputSchemaViolations, after the walk has descended into properties. So a section is judged against its own sub-schema (query.stale, test 6.4), and so is an object inside an array's items (see N1). A type mismatch returns early, so a value of the wrong type is not also reported key by key. An undefined value is skipped and null is refused (test 6.2), which matches what reaches the wire.
  • Which schemas are open. declaredKeysOf returns undefined (open) for any key-admitting keyword in KEY_ADMITTING_KEYWORDS, for additionalProperties or unevaluatedProperties set to anything but false, and for a schema with no properties that is not additionalProperties: false. Otherwise it returns properties ∪ required. Five open shapes are pinned as still dispatching (test 6.6). Ablation leg 2 in the PR body reds that case; I read this as the author's report and did not re-run it.
  • The pull door is unchanged. connector-pull.ts is not in the diff. The option defaults to off (options.refuseUndeclaredKeys === true). The pin (test 6.8) is at the judge level (see N4).
  • Boot order, verified on this head. In plugin.ts start(), the flow pull calls registerFlow (~2567-2590) before materializeDeclaredConnectors(ctx, { fatal: true }) (~2676). Stored connector entries wait for kernel:bootstrapped (~2689). So at registration the action schemas of declarative connectors are not yet known, as the PR body measured.
  • The producer gap (M1). connector-openapi's buildInputSchema (openapi-connector.ts ~512-552) continues past a $ref parameter. extractRequestBodySchema returns undefined for a $ref request body and for content with no schema. The emitted schema then lists only the remaining sections. The declarative openapi provider does not dereference: a URL or file spec is JSON.parsed and checked to be 3.x (openapi-provider.ts ~150-225). normalize-openapi.mts is an offline, optional step. connectors.mdx refuses only Swagger 2.0 and describes the normalizer as the step "the repository carries", not as required for 3.x. The handler still sends what the schema dropped: interpolatePath, serializeQuery and serializeHeaders fall back to defaultParameterEncoding for a name with no encoding, and body is passed through. So, on main, a flow over a 3.x document with $ref path or query parameters dispatched those parameters and the call worked. The probe on this head's judge, using the shape the generator emits (properties: { query: {...} }, path params all $ref), returns 'path' is not an input the action declares (declared: 'query') with the option on, and undefined without it. A $ref body gives 'body' is not an input the action declares (declared: 'path').
  • The Slack connector's schemas are partial (S2). chat.postMessage and chat.update (slack-connector.ts ~101-131) list four parameters each and send the whole input to Slack (callSlack('chat.postMessage', input)). Any other Slack Web API parameter an author passes is now refused. The call action (method + params, where params is type: 'object' with no properties, so it is open) still carries one.
  • First-party claim. Neither shipped OpenAPI document (packages/apps/connector-docusign/openapi/…, packages/apps/connector-stripe/openapi/…) has a $ref parameter or request body (counted on this tree). connector-rest request declares headers/query as objects with no properties (open) and body with no type. That is consistent with "First-party flows affected: 0". I did not re-read the first-party flows' inputs one by one.
  • CI on this head, read just before posting: 70 check runs: 53 success, 13 skipped, none failed, and 4 still in progress (Test Core 1/8, 7/8 and 8/8, and Test UI). The successes include TypeScript Type Check, every Type Check · and Lint · job, Build Core, Check Changeset (both runs) and Spec property liveness. The PR is a draft.

② Semver level

③ Boundary flags

④ Design judgment

  • (1) A run-time-only refusal is acceptable. automation: a connector_action node sends input keys its action does not declare to the provider (open input schemas, no refusal) #33553's acceptance allows "refused loudly (at publish, or at run)". A registration-time verdict would be read before declarative connectors materialize (verified in ①). That is the defect AGENTS.md "Startup registry reads — never record a verdict the boot can still contradict" names. Reading the schema of the instance the call dispatches to is the only verdict the boot cannot contradict.
  • (2) The rule "declared = properties ∪ required, open if it admits more" is sound as a reading of a schema. Its open set is complete for the keywords that can carry keys (save N2). Reading properties as the contract is what closes automation: a connector_action node sends input keys its action does not declare to the provider (open input schemas, no refusal) #33553. But the rule assumes every producer lists every input the action takes, and two producers do not. connector-openapi drops $ref parameters and $ref or schemaless bodies (M1). Slack's two message actions list a subset of what they forward (S2).
  • M1 (must-fix): the migration does not cover the non-normalized OpenAPI class. For a declarative openapi connector over a 3.x document with $ref parameters or a $ref/schemaless request body, a call that dispatches and works on main is now refused. The prescribed fix, "drop the key, or pick the action that declares it", cannot be followed: the parameter is needed, and no action declares it. AGENTS.md requires a breaking changeset to carry its migration, and the semantic entry's replacement ships in spec as the prescription. Either change closes M1:
    • (a) Preferred: buildInputSchema marks what it skipped as open. A location with a skipped $ref parameter gets additionalProperties: true on that section, and the section is emitted even when every parameter in it was a $ref. A $ref or schemaless body gets body: {}. Add a pin that a $ref-parameter document still dispatches. This needs connector-openapi in the lane's file surface.
    • (b) The changeset's BREAKING/migration text and the semantic entry's replacement name this class and its fix: normalize the document with normalize-openapi so the action declares the parameter.
  • S2 (should-fix). The BREAKING text should name the partial pass-through case: Slack chat.postMessage/chat.update now refuse a Slack parameter the schema does not list, and the fix is the call action with params.
  • S1 (should-fix). Change Clause-②: yes (narrowing) to Clause-②: no (narrowing) in the PR body and the changeset.
  • Otherwise the design holds. The judgment is opt-in on the shared helper. The refusal is the same routable VALIDATION_ERROR, judged on the evaluated input, and it names the declared keys at the failing level. undefined counts as absent and null is refused. These match the automation: a connector_action call is dispatched without checking its input against the action's declared inputSchema, so a missing required parameter reaches the remote API #27995 contract this extends, and the tests pin each one.

Implemented-by: claude/area-A5-33553
Reviewed-by: session_016WV4cxDxAYxdtDhtR1kQQe

VERDICT: FAIL
M1 must change: either the OpenAPI generator declares what it skips as open (preferred), or the changeset and the semantic entry prescribe normalizing the document. S1 and S2 should be fixed in the same pass. N1 to N4 are nits.

…n input, not as absent

The connector_action executor now refuses a key an object schema does not
declare. buildInputSchema skipped an unresolved $ref parameter and an
unresolved $ref or schemaless request body, so a flow over a document
nobody de-referenced lost inputs it dispatched before. An unresolved $ref
parameter now opens path, query and header (additionalProperties: true);
such a body is declared as body: {}.

Claude-Session: https://claude.ai/code/session_016WV4cwhJBt274G7zk78A5a
Co-authored-by: Claude <noreply@anthropic.com>
… $recursiveRef in the changeset, pull-door pin at the door

- changeset: Clause-② no (narrowing); name Slack chat.postMessage /
  chat.update and the call action; every object level, array items
  included; connector-openapi and spec lines.
- semantic entry: surface and replacement name array items and the
  pass-through action.
- $recursiveRef reads a key set as open, beside $dynamicRef.
- the pull door's opt-out is pinned through pullConnectorSource.

Claude-Session: https://claude.ai/code/session_016WV4cwhJBt274G7zk78A5a
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract-review-claim: session_016WV4cztXwcRKcZdDqJmbSn · head 188a828 · 2026-11-15T04:17:28Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 188a8286353413c982a115f6f5831e08322bb9ff
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/18.connector-action-undeclared-input-key-refused.ts + .changeset/33553-connector-action-undeclared-input-key.md, packages/connectors/connector-openapi/src/openapi-connector.ts, packages/connectors/connector-openapi/src/input-schema-dispatch.test.ts, packages/services/service-automation/src/connector-input-schema.ts, packages/services/service-automation/src/builtin/connector-nodes.ts, packages/services/service-automation/src/builtin/connector-input-schema.test.ts, packages/services/service-automation/src/connector-pull.test.ts; read only: packages/connectors/connector-openapi/src/openapi-provider.ts, packages/connectors/connector-slack/src/slack-connector.ts, packages/services/service-automation/src/connector-pull.ts, packages/apps/connector-stripe/openapi/stripe.openapi.json, packages/apps/connector-docusign/openapi/docusign-esignature.openapi.json, ui/packages/app-shell/src/views/metadata-admin/inspectors/connector-input-fields.ts, skills/objectstack-automation/SKILL.md, skills/objectstack-automation/references/integration-recipes.md

review#2 (server area pilot) · area A5 · Fixes #33553 (p2) · delta review after the FAIL record 6888662219 at 10a4106a18. Read only: git diff 10a4106a..188a8286 on a fetched ref, the current PR body, the changeset, the cited producers at this head, and this head's check runs, including the Check Changeset job log. Nothing built or run locally.

① Derived judgments

  • What moved since 10a4106a18. Three commits. d4822373 changes the connector-openapi generator and adds a pin. 753c427e edits the changeset, the semantic entry, KEY_ADMITTING_KEYWORDS, one test title, and adds a pull-door pin. 188a8286 merges origin/main. That merge changes none of the PR's 8 files, and nothing under packages/connectors/, connector-nodes.ts, connector-input-schema.ts or connector-pull.ts (git diff --stat 753c427e 188a8286 on those paths is empty).
  • M1 is resolved by option (a). In buildInputSchema (openapi-connector.ts ~524-575), a $ref parameter sets unresolvedParameter. Then path, query and header are each emitted with additionalProperties: true, including a location that declares no parameter of its own. declaredKeysOf reads that as open. path is required only when it declares a parameter. Any object requestBody is now declared as extractRequestBodySchema(...) ?? {}. So a $ref body, or content with no schema, becomes body: {}, which is open and has no type. required gains body only for an inline required body. The declarative openapi provider builds through the same createOpenApiConnector (openapi-provider.ts ~275), so it emits the same schema. The parameters declared next to a $ref are still judged.
  • The M1 pin runs end to end. The new describe in input-schema-dispatch.test.ts boots a LiteKernel with the engine and ConnectorOpenApiPlugin over a 3.0.3 document. That document has a $ref path parameter, a $ref query parameter, a declared limit, a $ref request body, and an application/octet-stream body with no schema. Each case dispatches through a connector_action flow with fetch recorded. Case 1 asserts the emitted section shapes and required undefined. It then sends { path: { petId: 7 }, query: { tag, limit }, body } and checks the URL is /pets/7?…tag=dog, with the JSON body sent. It also checks that limit: 'two' is still refused and nothing more is sent. Case 2 asserts body: {}, required: ['path', 'body'] and a closed path, and checks the raw body dispatches. I checked each assertion against the code above. The run itself is CI's (see the last bullet).
  • Nothing else is newly refused in generated actions. Compared with 10a4106a18, each change opens something: it adds additionalProperties: true, drops path from required when it declares nothing, or adds body: {}. One shape is judged that was not judged before. An operation whose only inputs were $ref parameters, or a $ref/schemaless body, used to get no inputSchema (buildInputSchema returned undefined). It now gets one, so a top-level key outside the emitted sections is refused. The document declares no such input, so this is the declared narrowing applied the same way it already applies to an operation with a typed body. It is not the M1 shape. The other generator skips are unchanged at this head: cookie, the OAS-ignored Accept/Content-Type/Authorization, the auth's own header or query parameter, and scheme-filled parameters (see N6).
  • S2 is resolved. The changeset adds a paragraph naming the partial pass-through case: chat.postMessage/chat.update list four keys each and forward the whole input. It names the refused examples and gives a FROM → TO to call with method + params. At this head params is { type: 'object' } with no properties (slack-connector.ts ~133-142), so it is open. The semantic entry's replacement names the same fix.
  • S1 is resolved in the changeset only. The changeset now reads Clause-②: no (narrowing). The PR body line 6 still reads Clause-②: yes (narrowing). That is the line the gate reads. This head's Check Changeset log prints ✓ LEVEL AXIS: this PR declares clause-② `yes (narrowing)` … and · declaration line: `Clause-②: yes (narrowing) — …` . The PR body has not been refreshed for this head either. It cites head f1f1ace963, does not mention the connector-openapi change, the Slack paragraph or $recursiveRef, and has no Skills-docs: line.
  • The nits are taken. N1: the changeset, the semantic entry surface and the test doc all say "at every object level, array items included". N2: $recursiveRef is in KEY_ADMITTING_KEYWORDS, with a pin for both it and $dynamicRef. N3: the changeset names '@objectstack/spec': minor. N4: connector-pull.test.ts now runs pullConnectorSource with an undeclared top-level key and an undeclared query key, and asserts the handler received both unchanged. The old judge-level case is renamed to what it pins.
  • CI on this head, read just before posting: 67 check runs: 56 success, 11 skipped, none failed or pending. The successes include every required context that ran (Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard, Type Check UI, Test UI, Build & E2E UI, Live E2E UI, Dogfood Regression Gate; Lint UI was skipped), plus Check Changeset and Spec property liveness. The Test Core shard logs show src/input-schema-dispatch.test.ts (6 tests) passing, with connector-openapi at Tests 111 passed (111) (the PR body's earlier count was 109). They also show src/builtin/connector-input-schema.test.ts (23 tests) and src/connector-pull.test.ts (53 tests) passing. The PR is a draft.

② Semver level

  • Metadata-protocol: narrowed still stands, so each moved package is minor. The level is unchanged from the first record. The connector-openapi change only widens what the refusal admits, so the kind does not change. The changeset now moves three packages: @objectstack/service-automation, @objectstack/connector-openapi and @objectstack/spec, each minor. That matches "a kind takes at least minor on a package the diff moves". Check Changeset is green and reads the level axis as satisfied.
  • The ADR-0087 registered disposition still holds. The log reads [BREAKING+bang+clause-②-narrowing+metadata-protocol-narrowed] registered connector-action-undeclared-input-key-refused. The entry keeps its SemanticMigration fields. Only the surface and replacement prose changed, and neither carries a tracker number.
  • The Clause-② value is still yes where the gate reads it (S1, open). The changeset is right. The PR body is not. As before, the gate does not grade the level from this value, so CI stays green either way. The declaration is still wrong on the surface the gate reads.

③ Boundary flags

  • Draft. The PR is a draft, authored by objectstack-fleet[bot].
  • The pull-door sibling and the missing publish-time check are unchanged. Both are named in the PR and still owe their own cards.
  • Studio still offers keys the run now refuses (new, follow-up card, ui lane). connector-input-fields.ts treats a schema as closed only when it has additionalProperties === false. It keeps the extras repeater on every first-party schema. Its header says the executor accepts undeclared keys. After this PR the run refuses them. The refusal is loud, so this is not a defect of this PR, but the designer now invites input that fails at run.
  • Skills text (governed surface, so a follow-up and not this PR). skills/objectstack-automation/SKILL.md's connector_action row lists the judgment as required, type, properties, items, with no undeclared-key refusal. references/integration-recipes.md ~62 says a skipped $ref makes the derived schema "silently lose" the parameter. It now reads as open input. The PR body owes a Skills-docs: line (follow-up owed — FILES or #N), which is the seat's ACCEPT item.
  • N5 (nit): the comment above the section loop in buildInputSchema still says "Path params are always required when present". The code now requires path only when it declares a parameter.
  • N6 (nit): the changeset's general sentence ("An action whose schema lists only some of the parameters its handler forwards refuses the others now") covers OpenAPI too, but names only Slack's fix. For an OpenAPI action, the fix for a parameter the vendor document leaves out is to declare it in the packaged document. A per-call header such as Idempotency-Key is one example: the shipped Stripe and DocuSign documents declare 0 header parameters, so header is refused on every action of theirs. Accept/Content-Type cannot be declared at all, because the generator ignores them under OAS 3.0.3 §4.7.12.1. A sentence in the changeset would close this. First-party flows send no header (the PR body's count).

④ Design judgment

  • M1 fix: holds. Reading what the generator could not read as open is the preferred cure from the first record. It is narrow. Only an unresolved $ref opens the sections. A document that de-references gets the closed, typed schema, and the JSDoc and changeset say normalize-openapi still gives each parameter its own declaration and type check. Opening all three locations when the $ref's in is unknown is the only reading that needs no de-referencing. It also gives back exactly what main sent. The declared parameters next to it keep their type check, and the pin covers that.
  • S2 fix: holds. The BREAKING text names the class and a fix an author can follow today.
  • S1 (should-fix, still open). Change the PR body's line-initial Clause-②: yes (narrowing) to Clause-②: no (narrowing), as the changeset now reads. While editing the body, refresh it for this head: the connector-openapi change and its file-surface widening, the Slack paragraph, $recursiveRef, the tree and head it was measured on, and the Skills-docs: line. This is a body edit and does not move the head.
  • Otherwise the delta holds. No new must-fix or should-fix is in the delta. N5 and N6 are nits.

Implemented-by: claude/area-A5-33553
Reviewed-by: session_016WV4cztXwcRKcZdDqJmbSn

VERDICT: FAIL
M1 and S2 are resolved, and N1 to N4 are taken. S1 is fixed in the changeset, but the PR body, which is the line Check Changeset reads, still declares Clause-②: yes (narrowing). Correcting that line (and refreshing the body for this head) closes the round. The edit does not move the head, so the next delta check covers only the body. N5 and N6 are nits.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 188a8286353413c982a115f6f5831e08322bb9ff
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/18.connector-action-undeclared-input-key-refused.ts + .changeset/33553-connector-action-undeclared-input-key.md, packages/connectors/connector-openapi/src/openapi-connector.ts, packages/connectors/connector-openapi/src/input-schema-dispatch.test.ts, packages/services/service-automation/src/connector-input-schema.ts, packages/services/service-automation/src/builtin/connector-nodes.ts, packages/services/service-automation/src/builtin/connector-input-schema.test.ts, packages/services/service-automation/src/connector-pull.test.ts; read only: packages/connectors/connector-openapi/src/openapi-provider.ts, packages/connectors/connector-slack/src/slack-connector.ts, packages/services/service-automation/src/connector-pull.ts, packages/apps/connector-stripe/openapi/stripe.openapi.json, packages/apps/connector-docusign/openapi/docusign-esignature.openapi.json, ui/packages/app-shell/src/views/metadata-admin/inspectors/connector-input-fields.ts, skills/objectstack-automation/SKILL.md, skills/objectstack-automation/references/integration-recipes.md

review#2 (server area pilot) · area A5 · Fixes #33553 (p2) · delta review after the FAIL record 6888662219 at 10a4106a18. Read only: git diff 10a4106a..188a8286 on a fetched ref, the current PR body, the changeset, the cited producers at this head, and this head's check runs, including the Check Changeset job log. Nothing built or run locally.

① Derived judgments

  • What moved since 10a4106a18. Three commits. d4822373 changes the connector-openapi generator and adds a pin. 753c427e edits the changeset, the semantic entry, KEY_ADMITTING_KEYWORDS, one test title, and adds a pull-door pin. 188a8286 merges origin/main. That merge changes none of the PR's 8 files, and nothing under packages/connectors/, connector-nodes.ts, connector-input-schema.ts or connector-pull.ts (git diff --stat 753c427e 188a8286 on those paths is empty).
  • M1 is resolved by option (a). In buildInputSchema (openapi-connector.ts ~524-575), a $ref parameter sets unresolvedParameter. Then path, query and header are each emitted with additionalProperties: true, including a location that declares no parameter of its own. declaredKeysOf reads that as open. path is required only when it declares a parameter. Any object requestBody is now declared as extractRequestBodySchema(...) ?? {}. So a $ref body, or content with no schema, becomes body: {}, which is open and has no type. required gains body only for an inline required body. The declarative openapi provider builds through the same createOpenApiConnector (openapi-provider.ts ~275), so it emits the same schema. The parameters declared next to a $ref are still judged.
  • The M1 pin runs end to end. The new describe in input-schema-dispatch.test.ts boots a LiteKernel with the engine and ConnectorOpenApiPlugin over a 3.0.3 document. That document has a $ref path parameter, a $ref query parameter, a declared limit, a $ref request body, and an application/octet-stream body with no schema. Each case dispatches through a connector_action flow with fetch recorded. Case 1 asserts the emitted section shapes and required undefined. It then sends { path: { petId: 7 }, query: { tag, limit }, body } and checks the URL is /pets/7?…tag=dog, with the JSON body sent. It also checks that limit: 'two' is still refused and nothing more is sent. Case 2 asserts body: {}, required: ['path', 'body'] and a closed path, and checks the raw body dispatches. I checked each assertion against the code above. The run itself is CI's (see the last bullet).
  • Nothing else is newly refused in generated actions. Compared with 10a4106a18, each change opens something: it adds additionalProperties: true, drops path from required when it declares nothing, or adds body: {}. One shape is judged that was not judged before. An operation whose only inputs were $ref parameters, or a $ref/schemaless body, used to get no inputSchema (buildInputSchema returned undefined). It now gets one, so a top-level key outside the emitted sections is refused. The document declares no such input, so this is the declared narrowing applied the same way it already applies to an operation with a typed body. It is not the M1 shape. The other generator skips are unchanged at this head: cookie, the OAS-ignored Accept/Content-Type/Authorization, the auth's own header or query parameter, and scheme-filled parameters (see N6).
  • S2 is resolved. The changeset adds a paragraph naming the partial pass-through case: chat.postMessage/chat.update list four keys each and forward the whole input. It names the refused examples and gives a FROM → TO to call with method + params. At this head params is { type: 'object' } with no properties (slack-connector.ts ~133-142), so it is open. The semantic entry's replacement names the same fix.
  • S1 is resolved. The changeset reads Clause-②: no (narrowing), and since A5's body edit (fleet-write run 43677375186, head unchanged) the PR body line 6 reads the same. The body is refreshed for this head: it cites 188a8286, describes the connector-openapi change and its 2-case dispatch pin, and carries Metadata-protocol: narrowed and Skills-docs: follow-up owed — skills/objectstack-automation/SKILL.md, references/integration-recipes.md. Re-read live at this head before posting.
  • The nits are taken. N1: the changeset, the semantic entry surface and the test doc all say "at every object level, array items included". N2: $recursiveRef is in KEY_ADMITTING_KEYWORDS, with a pin for both it and $dynamicRef. N3: the changeset names '@objectstack/spec': minor. N4: connector-pull.test.ts now runs pullConnectorSource with an undeclared top-level key and an undeclared query key, and asserts the handler received both unchanged. The old judge-level case is renamed to what it pins.
  • CI on this head, read just before posting: 67 check runs: 56 success, 11 skipped, none failed or pending. The successes include every required context that ran (Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard, Type Check UI, Test UI, Build & E2E UI, Live E2E UI, Dogfood Regression Gate; Lint UI was skipped), plus Check Changeset and Spec property liveness. The Test Core shard logs show src/input-schema-dispatch.test.ts (6 tests) passing, with connector-openapi at Tests 111 passed (111) (the PR body's earlier count was 109). They also show src/builtin/connector-input-schema.test.ts (23 tests) and src/connector-pull.test.ts (53 tests) passing. The PR is a draft.

② Semver level

  • Metadata-protocol: narrowed still stands, so each moved package is minor. The level is unchanged from the first record. The connector-openapi change only widens what the refusal admits, so the kind does not change. The changeset now moves three packages: @objectstack/service-automation, @objectstack/connector-openapi and @objectstack/spec, each minor. That matches "a kind takes at least minor on a package the diff moves". Check Changeset is green and reads the level axis as satisfied.
  • The ADR-0087 registered disposition still holds. The log reads [BREAKING+bang+clause-②-narrowing+metadata-protocol-narrowed] registered connector-action-undeclared-input-key-refused. The entry keeps its SemanticMigration fields. Only the surface and replacement prose changed, and neither carries a tracker number.
  • The Clause-② value now reads no (narrowing) on both surfaces (PR body and changeset). The gate does not grade the level from this value, so the level above is unaffected.

③ Boundary flags

  • Draft. The PR is a draft, authored by objectstack-fleet[bot].
  • The pull-door sibling and the missing publish-time check are unchanged. Both are named in the PR and still owe their own cards.
  • Studio still offers keys the run now refuses (new, follow-up card, ui lane). connector-input-fields.ts treats a schema as closed only when it has additionalProperties === false. It keeps the extras repeater on every first-party schema. Its header says the executor accepts undeclared keys. After this PR the run refuses them. The refusal is loud, so this is not a defect of this PR, but the designer now invites input that fails at run.
  • Skills text (governed surface, so a follow-up and not this PR). skills/objectstack-automation/SKILL.md's connector_action row lists the judgment as required, type, properties, items, with no undeclared-key refusal. references/integration-recipes.md ~62 says a skipped $ref makes the derived schema "silently lose" the parameter. It now reads as open input. The PR body now declares Skills-docs: follow-up owed naming both files.
  • N5 (nit): the comment above the section loop in buildInputSchema still says "Path params are always required when present". The code now requires path only when it declares a parameter.
  • N6 (nit): the changeset's general sentence ("An action whose schema lists only some of the parameters its handler forwards refuses the others now") covers OpenAPI too, but names only Slack's fix. For an OpenAPI action, the fix for a parameter the vendor document leaves out is to declare it in the packaged document. A per-call header such as Idempotency-Key is one example: the shipped Stripe and DocuSign documents declare 0 header parameters, so header is refused on every action of theirs. Accept/Content-Type cannot be declared at all, because the generator ignores them under OAS 3.0.3 §4.7.12.1. A sentence in the changeset would close this. First-party flows send no header (the PR body's count).

④ Design judgment

  • M1 fix: holds. Reading what the generator could not read as open is the preferred cure from the first record. It is narrow. Only an unresolved $ref opens the sections. A document that de-references gets the closed, typed schema, and the JSDoc and changeset say normalize-openapi still gives each parameter its own declaration and type check. Opening all three locations when the $ref's in is unknown is the only reading that needs no de-referencing. It also gives back exactly what main sent. The declared parameters next to it keep their type check, and the pin covers that.
  • S2 fix: holds. The BREAKING text names the class and a fix an author can follow today.
  • S1: closed by the body edit, which did not move the head.
  • Otherwise the delta holds. No new must-fix or should-fix is in the delta. N5 and N6 are nits.

Implemented-by: claude/area-A5-33553
Reviewed-by: session_016WV4cztXwcRKcZdDqJmbSn

VERDICT: PASS
M1 and S2 are resolved, N1 to N4 are taken, and S1 is closed: the PR body and the changeset both declare Clause-②: no (narrowing), with Metadata-protocol: narrowed and each moved package at minor. Same head as record 6889215004; only the PR body changed. N5 and N6 are nits for the area's loose-ends card. Follow-ups owed: Studio connector-input-fields.ts, the objectstack-automation skills text (governed), the pull-door sibling and the publish-time check.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4cwhJBt274G7zk78A5a

ACCEPT · area A5 · head 188a828 · 2026-11-15T04:38Z

  • Cards: Fixes automation: a connector_action node sends input keys its action does not declare to the provider (open input schemas, no refusal) #33553.
  • Review: review#2 FAIL 6888662219 → delta FAIL (body only) 6889215004 → PASS at this head 6889245825 (CONTRACT_REVIEW_TIER). Clause-②: no (narrowing), Metadata-protocol: narrowed, minor on @objectstack/spec, @objectstack/connector-openapi, @objectstack/service-automation. Non-blocking N5 (stale "path params always required" comment) and N6 (changeset hint: declare the parameter in the packaged OpenAPI doc) go to one loose-ends card after merge, with the Studio connector-input-fields.ts and skills/objectstack-automation (governed) follow-ups.
  • Governed: check-governed-merges.mjs --pr 33614 → NOT governed, +444/-27.
  • Checks: all green on this head (56 success, 11 skipped, 0 failed). Direct dependents run locally: 86/86 tasks green.
  • Landing: ready + auto-merge under the maintainer's standing rule (Elon 03:57Z: PRs that pass review may be marked ready + auto-merge).

scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
… declared-keys rule (objectstack-ai#34137)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9Sj8HDD6VgNcGGzfkHLnCCh)_

Fixes objectstack-ai#33838

Clause-②: yes (widening) — `@object-ui/i18n` gains the studio pack key
`engine.inspector.flowNode.kv.undeclaredKey` (en, zh); nothing removed
or narrowed.
Metadata-protocol: none

## 维护者速读

- **改了什么**:Studio 里连接器动作(connector_action)的
Input「键/值」附加项编辑器,现在按运行时同一条规则判断动作输入是开放还是封闭;封闭时只给声明了但没有专用输入框的键(如 OpenAPI 的
`$ref`/无 schema 的 `body`、Slack 的 `blocks`)留编辑位,其余未声明键逐行标红「运行时会拒绝」。
- **为什么改**:objectstack-ai#33614 之后,运行时会拒绝动作未声明的输入键;Studio 却仍按 JSON Schema
默认「开放」处理,照常让作者加这些键,保存后流程一跑就失败。
- **风险与回滚**:只动 Studio 前端与 i18n 文案,不改任何服务端包;旧流程里已存的未声明键不会被自动删除,只是被标出。回滚即
revert 本 PR。
- **先看**:`connector-input-fields.ts`(`connectorInputContractKeys` 与
`applyConnectorInputForm`
的保留条件)、`FlowNodeConfigField.tsx`(`acceptedKeyProps`)、`FlowKeyValueField.tsx`(`keyRefusal`
行)。
- **两分钟验证**:`cd ui && pnpm exec vitest run
packages/app-shell/src/views/metadata-admin/inspectors/connector-input-fields.test.ts
packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.connectorInput.test.tsx`,预期全绿。
- **需要你做的**:无,席位落地。

## What changes


`ui/packages/app-shell/src/views/metadata-admin/inspectors/connector-input-fields.ts`
decided open/closed with JSON Schema's default (`additionalProperties
!== false` = open). No shipped connector writes `additionalProperties`,
so Studio read every action as open and kept offering the extras
repeater for keys the run now refuses.

**The rule, read from the run (origin/main `385ea1cc`):**

-
`packages/services/service-automation/src/connector-input-schema.ts:138`
— `KEY_ADMITTING_KEYWORDS` (copied verbatim into the ui module).
-
`packages/services/service-automation/src/connector-input-schema.ts:160`
— `declaredKeysOf`: declared = `properties` names plus `required` names;
open when `additionalProperties` / `unevaluatedProperties` is anything
but `false`, when a key-admitting keyword (`$ref`,
`allOf`/`anyOf`/`oneOf`, `patternProperties`, …) is present, or when no
`properties` is listed and the schema is not `additionalProperties:
false`.
-
`packages/services/service-automation/src/connector-input-schema.ts:275`–`285`
— the walk refuses every key `declaredKeysOf` does not list.
-
`packages/services/service-automation/src/builtin/connector-nodes.ts:165`
— the `connector_action` door passes `{ refuseUndeclaredKeys: true }`.
- `packages/connectors/connector-openapi/src/openapi-connector.ts:569` —
an unresolved `$ref` or schemaless request body is declared `body: {}`
(any value); `:558` — an unresolved `$ref` parameter opens the
`path`/`query`/`header` sections with `additionalProperties: true`.

**Studio now:**

- `connectorInputContractKeys(schema)` mirrors `declaredKeysOf` for the
top level of `connectorConfig.input` (`null` = open).
`ConnectorInputForm` gains `contractKeys`; `open` is `contractKeys ===
null`.
- `applyConnectorInputForm` keeps the repeater when the schema is open,
when it declares a key no typed field owns (an openapi `body: {}`,
slack's item-less `blocks`), or when the stored map holds a key no typed
field owns. On a closed schema the repeater carries a new
`FlowConfigField.acceptedKeys` (the declared keys).
- `FlowNodeConfigField` turns `acceptedKeys` into two
`FlowKeyValueField` props: `keyOptions` (the declared keys no sibling
field types, as key-cell suggestions) and the new `keyRefusal`, which
draws one `role="alert"` line under any row whose key the schema does
not declare.
- `connectorInputFields` now resolves a CLOSED schema even when no
property gets a typed field (a body-only openapi operation), so its
repeater is judged too; an open schema with no typed field still returns
`null` (the generic repeater, unchanged).

**Stored keys the run would now refuse: marked, never dropped.** A
stored undeclared key on a closed schema keeps the repeater alive and
stays in its row, with the line "The action does not declare this input,
so the run refuses it. Remove it, or pick an action that declares it."
under it. Rendering writes nothing back (pinned: `onPatch` is not
called); the author removes the row. A key typed into the repeater that
the action does not declare gets the same line as soon as it is typed.

## Tests

New pins (all ablated red, below):

- `connector-input-fields.test.ts` — new
`describe('connectorInputContractKeys — the run's declared-keys rule')`
(closed on `properties`; `required` names declared;
`additionalProperties: false` with no properties declares none;
`additionalProperties`/`unevaluatedProperties` true or a schema is open;
each key-admitting keyword is open; no `properties` is open). In
`applyConnectorInputForm`: closed with every key typed → no repeater;
open (`allOf`) → repeater, no `acceptedKeys`; closed slack → repeater
kept for `blocks` with `acceptedKeys`; openapi `$ref`/schemaless `body:
{}` → repeater offers `body`; body-only operation still resolves; stored
undeclared key on a closed schema → repeater kept and judged.
- `FlowNodeInspector.connectorInput.test.tsx` (the existing harness, new
top-level `describe`): a stored undeclared key on a closed schema
renders one `flow-kv-key-refusal` alert and writes nothing; an open
(`allOf`) schema marks no key; a declared-but-untyped `body` shows in
the repeater unmarked.

Forced test edits (the old rule they pinned is the defect):

- `connector-input-fields.test.ts` — `describe('connectorInputFields —
measured additionalProperties semantics')` removed: its first case
pinned "an ABSENT additionalProperties is OPEN", the rule this card
retires; its other two cases are re-pinned in the new
`connectorInputContractKeys` block.
- `connector-input-fields.test.ts` — "an OPEN schema keeps the
repeater…" now uses an `allOf` schema (slack's verbatim schema is closed
under the run's rule); "a CLOSED schema drops the repeater entirely" now
uses slack without `blocks`, since a closed schema with an untyped
declared key keeps the repeater; the in-place splice case's comment says
why the repeater is still there.
- `FlowNodeInspector.connectorInput.test.tsx` — "an undeclared stored
key stays editable in the extras repeater (schema is OPEN)" renamed to
"(never hidden or dropped)", body unchanged; "a CLOSED schema
(additionalProperties:false) drops the repeater" now uses slack without
`blocks`, for the same reason.

## Acceptance notes

- **Nested open sections stay as before.** The run judges nested objects
too. An openapi `query` section opened by an unresolved `$ref` parameter
(`additionalProperties: true` beside declared `properties`) is flattened
into typed sub-fields by the resolver, so a key outside them was not
editable in the form before this PR and still is not; a section with no
declared parameters is a `keyValue` field, unjudged (open, as the run
reads it). Stored undeclared keys inside a closed nested section are
likewise not shown. Neither is a key Studio offers, so neither is in
this card's repeater; recorded here, not filed.
- **Action switch (objectstack#33346) keeps typed keys only.** On a
connector or action switch the inspector keeps the held keys the new
action's typed fields own (`declaredKeys`), so a declared-but-untyped
key such as `body` is dropped on the switch. Unchanged by this PR; it
could keep `contractKeys` instead. Recorded, not filed.
- The marked key does not hold Studio's autosave or appear in the flow
problems list; the line is inline only. The run's own refusal is
unchanged.

## Verification

<details><summary>Targeted suites (merged head)</summary>

Head `3b90535e`, under `os-verify-lock.sh` (VERDICT command-exit 0
each):

- `pnpm --filter @object-ui/app-shell run type-check` and `pnpm --filter
@object-ui/i18n run type-check` — exit 0.
- `cd ui && pnpm exec vitest run --maxWorkers=2` over
`connector-input-fields.test.ts`,
`FlowNodeInspector.connectorInput.test.tsx`,
`FlowNodeInspector.connectorActionSwitch-33346.test.tsx`,
`FlowNodeInspector.connectorInputEnvelope-28164.test.tsx`,
`FlowNodeInspector.connectorOutputRefs-11028.test.tsx`, the three
`FlowKeyValueField.*.test.*` files, `FlowNodeConfigField.test.tsx`,
`FlowNodeConfigField.entryCondition.test.tsx` and `packages/i18n/` —
`Test Files 112 passed (112)`, `Tests 2025 passed | 13 skipped (2038)`.
- Narrowed on purpose: the full app-shell suite is left to CI `Test UI`.

</details>

<details><summary>Ablations (each restored; `git diff HEAD` empty
after)</summary>

Each leg through `node scripts/ablation-replace.mjs` (anchor hit 1 → 0,
blob moved), running `connector-input-fields.test.ts` +
`FlowNodeInspector.connectorInput.test.tsx`; ui vitest resolves
`@object-ui/*` to `src/`, so no build sits between mutation and run.

1. `connectorInputContractKeys`: `if (!properties && additional !==
false) return null;` → `if (additional !== false) return null;` (the
retired JSON-Schema default) — **9 failed | 42 passed**, including every
closed-schema pin in both files.
2. `FlowNodeConfigField`: the `acceptedKeyProps(...)` spread forced off
— **1 failed | 50 passed**: "a stored key a CLOSED schema does not
declare is shown and marked as refused by the run".
3. `applyConnectorInputForm`: `untyped.length > 0` dropped from
`keepRepeater` — **4 failed | 47 passed** (slack `blocks`, openapi
`body: {}`, body-only operation, in-place splice). The render pin for
`body` stays green here because the stored `body` keeps the repeater on
its own; the unit pins carry this leg.

</details>

<details><summary>Derived gates (`dispatch-gates --commands`, merged
head)</summary>

Head `3b90535e`; `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 37 commands; all 37 ran, each `::
exit 0`. `--ran` reconciliation: `37 derived famil(ies) accounted for —
37 run, 0 NOT-MEASURED`.

The first round (head `d9362095`) had `pnpm check:test-source-alias`
red: the edited harness reaches a lazy `import('@objectstack/lint')`.
Fixed in `3b90535e` by the module-top `import '@objectstack/lint';` the
gate prescribes (precedent:
`FlowNodeInspector.connectorActionSwitch-33346.test.tsx`). Every other
command was green in both rounds.

</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmNs7VguNqTeS9xDmJQ)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

automation: a connector_action node sends input keys its action does not declare to the provider (open input schemas, no refusal)

2 participants