Skip to content

feat(spec,lint): the AI action tool name lives in spec; lint resolves the qualified spelling - #39266

Merged
objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/issue-31531-action-tool-name
Dec 3, 2026
Merged

objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/issue-31531-action-tool-name

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #31531

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 技能作者在技能里写 AI 动作工具的新名字(带对象名的那种)时,本地检查不再误报「工具不存在」;旧名字照常通过,用户在运行时无感。
  • 属于「AI 工具记录绑定」专题:云端早已改用带对象名的工具名,框架这边的检查一直只认旧拼法,这次让两边共用一份拼法规则。
  • 出错的后果只是技能检查多一条或少一条警告,不影响任何运行中的应用;改动可以直接撤回。
  • 要你做什么:无。席位验收后入合并队列。

What changes

  • Spec helper (packages/spec/src/ai/action-tool-name.ts, exported from @objectstack/spec/ai): actionToolName({ name, objectName? }, prefix?) and its three constants (ACTION_TOOL_PREFIX, ACTION_TOOL_OBJECT_SEPARATOR, AI_TOOL_NAME_MAX_LENGTH) plus the private FNV-1a 32 hash. The constants and the function body are the cloud AI runtime's packages/service-ai/src/tools/action-tool-name.ts at cloud caa857a, character for character, as quoted on the card (comment 7085807305). Only TSDoc was added. No name clashes with an existing spec export (face-name.ts keeps its own module-private fnv1a32Hex, which hashes UTF-8 bytes; this one hashes UTF-16 code units, as cloud does). The module header says that the lint reads the spelling from here and that cloud keeps its own copy until its follow-up.
  • Legacy spelling legacyActionToolName({ name }, prefix?): returns action_ACTION whatever object the action is bound to. Cloud still resolves this spelling to every action of that name. Cloud's quoted text has no such function. This is the smallest export that names the old spelling for readers that judge a claim.
  • Lint universe (packages/lint/src/validate-ai-tool-references.ts): each materialised action now adds two names: actionToolName({ name, objectName }) and legacyActionToolName({ name }). The object comes from the action's own objectName; for an action written on an object, it falls back to that object's name. That is the registration key the runtime binds the action under (collectBundleActions). A top-level action with no objectName still adds only action_ACTION. Why this does not reuse actionObjectBinding (validate-action-body-writes.ts) is in the jsdoc: that reader is module-private and reads the legacy object alias, which ActionSchema renames at parse, so the two differ only on an unparsed stack.
  • Unexposed-action hint: it is now keyed by tool name in both spellings, so action_OBJECT__ACTION and action_ACTION for a real but unexposed action both get the "names action …, which does not become an AI tool" verdict. The old code stripped the action_ prefix, which only works for the legacy spelling. A tool-name map covers shortened 64-character names too, which cannot be parsed back into their parts.
  • os explain text (packages/lint/src/rule-explanations/ai-surface-references.ts, file surface widened by claim amendment 7368534683): paragraph 1 names action_OBJECT__ACTION for an object-bound action (shortened past 64 characters as actionToolName spells it) and action_NAME for a top-level one, and says the old action_NAME spelling of an object-bound action still resolves. Paragraph 2 says the unexposed-action verdict covers both spellings.
  • One-line budget under the qualified spelling (VERDICT_LINE_BUDGET = 200, the budget the rule's test holds its lines to): a 64-character name is now a normal claim. (a) The back-it fix line no longer repeats the claim, which the verdict already names; it is a constant 127 characters. (b) The unresolved verdict with a near-miss suggestion and (c) the unexposed-action verdict each keep their full sentence when it fits, and use shorter fixed wording when it does not. No name is abbreviated: 64 + 64 with a suggestion comes to 198, and the unexposed verdict at a 64-character claim comes to 171. Every line that already fit is byte-identical.
  • Barrel: one export * line at the end of the ai export list. main (with feat: an app's ask skill text is capped at 8,000 characters at build, at save and in Studio #39246 landed) is merged at ffe78cd through scripts/pm/os-regen-merge.sh, and the two merge=os-regen artifacts were regenerated on the merged tree at 6b8574e.
  • Regenerated: packages/spec/api-surface/ai.json and packages/spec/export-origins/ai.json, via check:generated --fix.
  • Cloud follow-up (not filed): once this spec version ships, cloud's packages/service-ai/src/tools/action-tool-name.ts can import actionToolName from @objectstack/spec/ai instead of keeping its own copy. The shared vectors are pinned on both sides until then.

Tests

Run against head 2574a4801e (first round); the patch rounds' readings at 9f06355b48 follow each block.

Spec: the shared vectors, test named for #31531 (`src/ai/action-tool-name.test.ts`)

All five of cloud's vectors are pinned exactly, including the two shortened 64-character names …__recomp_d455a5f0 and …__recomp_7d992e8e and the 64-character name that stays whole. The legacy spelling is pinned to equal actionToolName for a top-level action.

pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/ai/action-tool-name.test.ts src/ai/face-name.test.ts
 Test Files  2 passed (2)
      Tests  14 passed (14)
pnpm --filter @objectstack/spec test
 Test Files  929 passed (929)
      Tests  29288 passed | 3 todo (29291)

At 9f06355b48: pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/ai/ → 27 files, 606 passed; check:generated all 14 up to date after the spec build.

Lint: the work item 3 pins (`describe('[#31531] the qualified action tool name …')`)
  • A qualified claim resolves: on an action written on its object, on a top-level action bound by objectName, and as a shortened 64-character claim.
  • A legacy action_ACTION claim on an object-bound action resolves.
  • A qualified claim that puts the action on the wrong object (action_crm_account__convert_lead) is reported, and not by the unexposed arm.
  • CONTROL: a top-level action resolves as action_send_invoice, and a qualified spelling of it (action_global__send_invoice) is still reported.
  • The unexposed-action verdict names the action for a claim in either spelling.
  • The fix line for an unresolved 64-character qualified claim stays at or under 200 characters.
  • The verdict for the measured pair, claim action_crm_knowledge_article_publish_timestamps__recomp_d455a5f1 against the real …__recomp_d455a5f0, stays at or under 200 characters and names both.
  • The unexposed-action verdict for action_crm_knowledge_article__publish_to_portal_and_notify_owner (64 characters), action_crm_knowledge_article__publish_to_portal and the shortened vector stays at or under 200 characters and names the claim and the action.
pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-ai-tool-references.test.ts
 Test Files  1 passed (1)
      Tests  53 passed (53)
pnpm --filter @objectstack/lint test
 Test Files  261 passed (261)
      Tests  10352 passed (10352)
pnpm --filter @objectstack/lint typecheck   -> exit 0
pnpm --filter @objectstack/spec typecheck   -> exit 0 (includes check:test-typecheck, which compiles the excluded *.test.ts)

At 9f06355b48: this file plus rule-explanations.test.ts 65 passed (this file 56); full lint 261 files, 10355 passed; lint typecheck exit 0.

Ablation: the qualified universe entry removed

Done with node scripts/ablation-replace.mjs. actionToolNames was changed to return only legacyActionToolName({ name }). The anchor hit 1 → 0, and the blob went from ed8cfe7bccd9 to 70146f586543.

The lint suite went red, 5 failed and 48 passed:

  • resolves a qualified claim on an action written on its object
  • resolves a qualified claim on a top-level action bound by objectName
  • resolves a shortened qualified claim past 64 characters
  • names the unexposed action for a claim in either spelling
  • the file's "every fix: line is at most 200 characters" check: the unresolved 64-character claim's hint runs past 200 characters (see Acceptance notes)

The wrong-object pin and the CONTROL stayed green, as they should: neither depends on the qualified entry. The restore was verified: the blob equals HEAD and git diff HEAD is empty.

Patch rounds, each followed by a verified restore (blob equals HEAD): with the old claim-echoing Back hint, 2 failed and 52 passed (the 64-character fix-line pin and every-fix-line); with the suggestion-verdict budget forced off, 2 failed and 53 passed (the measured-pair pin and every-verdict); with the unexposed-verdict budget forced off, 2 failed and 54 passed (the unexposed 64-character pin and every-verdict).

Gates: `dispatch-gates --commands` (88 derived), all run at `2574a4801e`

dispatch-gates --ran reconciles 88 derived, 86 run, 2 NOT-MEASURED, 0 UNRUN, with every line carrying its exit code.

  • 86 passed with exit 0, among them check:api-surface, check:export-origins, check:generated, check:docs, check:dual-source-exports, check:exported-any, check:entry-nameability, check:nul-bytes, check:doc-authoring, check:issue-citations, check:adr-0087-registration --base origin/main, check:changeset-no-major and check:cross-package-test-inputs.
  • check:doc-formula-expressions first exited 3 (PREREQUISITE NOT MET: lint was not built). It exited 0 after pnpm --filter @objectstack/lint build.
  • NOT MEASURED: check:dual-build-cjs-loads and check:lean-entry-closure. Both exited 3 (PREREQUISITE NOT MET) because they need a whole-workspace build; Build Core and Lint & Repo Gates run them in CI.
  • At 9f06355b48: 90 derived (check:cli-command-ids and check:optional-error-sink join through the rule-explanations path), 88 run with exit 0, 2 NOT-MEASURED (the same two), 0 UNRUN. One first check:docs run exited 1 in two seconds right after an interrupted batch; three reruns at the same head exited 0 ("251 generated files in sync").

Acceptance notes

  • The published skills/objectstack-ai/SKILL.md still teaches action_ACTIONNAME. That spelling still resolves, so it is not wrong; teaching the qualified name is a skills-lane choice.
  • The pages under content/docs/ai/ (tools.mdx, agents.mdx, actions-as-tools.mdx, connect-mcp.mdx) still say one action_NAME tool per exposed action. They were stale since cloud#3846 and sit outside this diff; the seat files a docs follow-up.
  • The unexposed fix-hint line (Opt "ACTION" in …, 149 fixed characters) stays within 200 for action names up to 51 characters; it reaches 203 only for a 54-character action on a 1-character object, and is left as is.
  • feat: an app's ask skill text is capped at 8,000 characters at build, at save and in Studio #39246 has landed; main is merged and the generated ai.json files were regenerated on the merged tree.

Verification

Read first, by risk:

  1. packages/lint/src/validate-ai-tool-references.ts: eachDeclaredAction (which object an action is bound to), actionToolNames, unresolvedVerdict and unexposedVerdict.
  2. packages/spec/src/ai/action-tool-name.ts: compare the function to the cloud text in card comment 7085807305.
  3. packages/lint/src/validate-ai-tool-references.test.ts: the [#31531] describe.
  4. packages/lint/src/rule-explanations/ai-surface-references.ts: the explain text.

Two-minute check: pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-ai-tool-references.test.ts. Expect 56 passed, 10 of them under [#31531] the qualified action tool name.


Generated by Claude Code

…action tool name

Spec gains the cloud AI runtime's action tool spelling (actionToolName,
legacyActionToolName and their constants), pinned to the shared vectors.
The ai-skill-tool-unresolved universe now holds action_<object>__<action>
for an object-bound action beside the legacy action_<action>, and the
unexposed-action hint reads both spellings.

Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2
Co-authored-by: Claude <noreply@anthropic.com>
…arrel

Keeps the line clear of a parallel barrel edit beside face-name.

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

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

16 anchor(s) derived from 2 changed package(s); no hand-written page names any of them. ⚠️ 3 changed file(s) yielded no anchor (packages/spec/api-surface/ai.json, packages/spec/export-origins/ai.json, packages/spec/src/ai/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 3 changed file(s) yielded no anchor (packages/spec/api-surface/ai.json, packages/spec/export-origins/ai.json, packages/spec/src/ai/index.ts) — pages documenting those are invisible to this run
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 71 of 256 client-bound route-ledger rows — the other 185 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 185: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 60 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 125 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 — 183 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 ee2be20078ad7a4e6984cf916fa31028476095c5 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 0f693faeea807c308ae5846f43dc925a3f697cb3 — the merge of head 9f06355b483ae0b7f94d9dea7c9dd0e4d27b8d8b into base ee2be20078ad7a4e6984cf916fa31028476095c5, 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 0f693faeea807c308ae5846f43dc925a3f697cb3 && git checkout 0f693faeea807c308ae5846f43dc925a3f697cb3
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ee2be20078ad7a4e6984cf916fa31028476095c5 9f06355b483ae0b7f94d9dea7c9dd0e4d27b8d8b && git checkout -B drift-repro ee2be20078ad7a4e6984cf916fa31028476095c5 && git merge --no-ff 9f06355b483ae0b7f94d9dea7c9dd0e4d27b8d8b

node scripts/docs-audit/affected-docs.mjs --json ee2be20078ad7a4e6984cf916fa31028476095c5

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

…k-it fix line within 200 characters

The ai-skill-tool-unresolved explanation names action_<object>__<action>
for an object-bound action and says the old action_<name> still resolves.
The back-it fix line no longer repeats the claim, so a 64-character
qualified claim keeps it within the rule's 200-character budget; pinned.

Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2
Co-authored-by: Claude <noreply@anthropic.com>
…cters when it suggests a name

With a near-miss suggestion the verdict carries two names of up to 64
characters each under the qualified action spelling; its fixed wording
shrinks so the line stays within the rule's 200-character budget, and both
names stay whole. Pinned with the measured 64-character pair.

Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2
Co-authored-by: Claude <noreply@anthropic.com>
… sentence passes 200

A short claim keeps the full sentence and its resolution ladder; the
shorter wording applies only past the budget.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

Contract-review-claim: session_01QSeKYnrQ7UMtHofKQVjcH2 · head e203231 · 2026-12-03T06:55Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: e203231c3a1cbb575dd81c702385ea0ee7e09894
Local-runs: none
Scope: packages/spec/src/ai/action-tool-name.ts, packages/spec/src/ai/index.ts + packages/lint/src/validate-ai-tool-references.ts, packages/lint/src/rule-explanations/ai-surface-references.ts
Security-touching: no
Rule-change-verified: none

Inputs read: card #31531 (body and all 11 comments, including cloud's verbatim text 7085807305, claim 7367268428, amendment 7368534683 and the three dev reports), PR #39266 (body, 9-file list, net diff against main from merge-base 2ef873556b), and the check-runs on this head. Every check-run that ran concluded success (Test Core 12/12, Type Check, Lint & Repo Gates, Spec property liveness, Check Changeset, Governed Surface Queue Guard, PR-body guards); the rest are skipped opt-in or queue jobs. Read on main, never reviewed: packages/runtime/src/app-plugin.ts (collectBundleActions), packages/runtime/src/app-artifact-handlers.ts (actionBindingGroups), packages/lint/src/validate-action-body-writes.ts (actionObjectBinding), packages/spec/src/ui/action.zod.ts, packages/lint/src/object-graph.ts (suggestName).

① Derived judgments

  • New exports on @objectstack/spec/ai — ACTION_TOOL_PREFIX, ACTION_TOOL_OBJECT_SEPARATOR, AI_TOOL_NAME_MAX_LENGTH (const), actionToolName, legacyActionToolName (function). RIGHT. Names and shapes are cloud's own for the first four; the generated api-surface/ai.json and export-origins/ai.json list exactly these five and nothing else. SHORTENED_HASH_LENGTH and fnv1a32Hex stay module-private, as in cloud. No clash with AI_FACE_NAME_* or the private UTF-8 fnv1a32Hex in face-name.ts. Purely additive: nothing is removed or renamed.
  • legacyActionToolName({ name }, prefix?) — RIGHT, with a cost named. The card's work item 1 asks for the helper "plus the legacy reader", so one export for the old spelling is asked-for surface, not invention. An emitter is the only shape that works: a parser from tool name back to object and action cannot exist, because a shortened 64-character name does not round-trip. The lint's tool-name map is the correct consequence. nit N1 — the function returns exactly what actionToolName({ name }) returns, so the export carries intent only; removing it when cloud stops resolving the old spelling will be a narrowing of a published export. Acceptable because the card names it.
  • Lint accept set — RIGHT. The universe is a strict superset of main's: every materialised action still adds action_NAME, and an object-bound one adds the qualified name too. No claim that resolved on main is reported now. The unexposed map keeps every key main's prefix-strip matched (the legacy key is always set), so no unexposed verdict is lost. A top-level action with no objectName adds one name, unchanged (the CONTROL pin).
  • Fix-line wording — the back-it hint changes for every generic unresolved finding (Back "CLAIM" with … tool action_NAME … becomes the constant Back it with …). This is a wording change to lint output, not an accept-set change; no other file in the tree quotes the old line, and the coverage control was updated with it. RIGHT.

② Semver level

patch on @objectstack/spec and @objectstack/lint is correct under AGENTS.md's changeset rule: the level follows the Metadata-protocol kind alone, and none takes patch. Metadata-protocol: none is true: no authorable key, value or metadata type changes; a skill's tools entry is a free string before and after. Clause-②: yes (widening) is true and the arm is right: five added exports, and a lint that accepts more and refuses nothing it accepted. Both declarations are line-initial in the changeset body and the PR body. Against what is published (19.0.0-next.3 on both packages) there is no narrowing, so no BREAKING banner and no ADR-0087 disposition is owed. Check Changeset concluded success on this head.

③ Boundary flags

  • open_questions is empty in all three dev reports. Nothing to answer.
  • Dev flag (report 1, class b): the os explain sentence. Answered by amendment 7368534683 and done in the tree; judged in ④.
  • Dev flag (report 1): 64-character claim's fix line over 200. Fixed in the tree and pinned.
  • Dev flag (report 2, class a): the 266-character verdict with a near-miss suggestion. Fixed in the tree for the generic arm and pinned. The unexposed arm of the same budget is NOT covered: see S1.
  • Dev note: skills/objectstack-ai/SKILL.md teaches the old spelling. Agreed: still true, a skills-lane choice. Reviewer adds that content/docs/ai/tools.mdx, agents.mdx, actions-as-tools.mdx and connect-mcp.mdx also say "one action_NAME tool per exposed Action". Those files are outside the diff and were stale since cloud#3846, not since this PR. Escalated to the seat as a docs follow-up to file, not a finding on this head.
  • Card work item 4 (cloud imports the helper): recorded on the PR as a cloud follow-up, not filed. That is what the card asks.
  • Seat's own items, not judged here: the PR body still describes head 2574a4801e (three pr_body_edits lists are unapplied); and the PR reads mergeable: false / dirty because feat: an app's ask skill text is capped at 8,000 characters at build, at save and in Studio #39246 landed on main in the same barrel and the two generated ai.json files. Merging main produces a new head, which this record does not name.
  • SQL push-down: not applicable. No query, id materialisation or in-app join in the diff.

④ Design judgment

packages/spec/src/ai/action-tool-name.ts — holds. With comments and blank lines stripped, the first 24 lines equal cloud's quoted block (7085807305) line for line; the only remainder is legacyActionToolName. Checked point by point: prefix action_, separator __, max 64, hash length 8, FNV-1a32 offset 0x811c9dc5 and prime 0x01000193 over charCodeAt (UTF-16 units), lowercase hex zero-padded to 8, head length 64 - prefix.length - 1 - 8 (48), hash input OBJECT:ACTION, full.length at exactly 64 kept whole, no character mapping, no lower-casing. The test pins all five cloud vectors by exact string (action_convert_lead, action_crm_lead__convert_lead, …__recomp_d455a5f0, …__recomp_7d992e8e, and the 54-o name kept whole at 64); Test Core is green on this head, so the function produces them.

  • nit N2 — the module header says the lint "and the runtime read the one spelling from here". Today cloud keeps its own copy; that sentence becomes true only after the cloud follow-up.
  • nit N3 — the spelling is not injective, and object and action names both admit __: object a with action b__c and object a__b with action c spell one tool name, as does a top-level action named crm_lead__convert_lead against crm_lead.convert_lead. That is cloud's ruled contract and byte identity forbids changing it here; it is recorded so the lint's limits are known (a wrong-object claim passes in that corner).

packages/spec/src/ai/index.ts — holds. One export * line; the surface it adds is exactly the five names above.

packages/lint/src/validate-ai-tool-references.ts — the object key and the accept set hold; one budget gap.

  • Object key: collectBundleActions on main infers a.object, else a.objectName, else the parent object's name, and actionBindingGroups files an object-less action under the global key. The lint's strName(action.objectName) ?? holder agrees for every stack the schema admits: ActionSchema is a strict object and lists object only as an alias that renames to objectName, so object is not authorable. A top-level action with objectName and its defineStack-merged copy give the same key on both walks.
  • nit N4 — the jsdoc cites collectBundleActions as the rule, but that reader takes object first and the sibling lint reader actionObjectBinding mirrors it. The two lint readers now differ on a key only an unparsed stack can carry. Reuse the sibling or say why not.
  • Wrong-object claim: action_crm_account__convert_lead is in neither the universe nor the unexposed map (both are keyed by full tool name), so it falls to the generic unresolved verdict. It really fails, and the pin asserts it is not the unexposed arm. The dev's ablation leaving this pin green is correct: it never depended on the qualified entry.
  • Budget-conditional wording: full is built from the same two literals and the same suggest(ref, universe) call as main's expression, and is returned whenever it is at most 200 characters. Every verdict that already fit is byte-identical; the pre-existing exact-string pins in the [#22161] describe are untouched and green. The short form for 64 + 64 is 198 characters (counted).
  • Break attempts that held: exposed on one object and unexposed on another under one name (legacy resolves, qualified claim on the unexposed one gets the unexposed verdict); wildcard action_crm_lead__*; an action written on object A carrying objectName B (lint and runtime both pick B).

S1 (should-fix) — the unexposed-action verdict breaks the 200-character budget this diff declares, for ordinary qualified names. VERDICT_LINE_BUDGET is documented as "the longest verdict line this rule prints" and amendment 7368534683 sets the standard that the budget must hold for a 64-character name, but only the generic arm goes through unresolvedVerdict. The unexposed arm is 137 fixed characters plus the claim plus the action name. This PR makes that arm reachable in the qualified spelling, where the claim already contains the action name: it overflows whenever object length + 2 × action length exceeds 54 (object crm_knowledge_article, action publish_to_portal gives 201). The card's own shortened vector as an unexposed action gives 240 (counted). On main the same arm needed an action name over 28 characters. No pin fires it: the either-spelling pin uses convert_lead (178). Give the arm the same budget treatment, or narrow the constant's jsdoc to the arm it governs and pin the unexposed arm at a 64-character claim.

packages/lint/src/rule-explanations/ai-surface-references.ts — holds. The sentence now names action_OBJECT__ACTION for an object-bound action, the 64-character shortening with its source (actionToolName in @objectstack/spec/ai), action_NAME for a top-level one, and that the old spelling of an object-bound action still resolves. Each statement matches the lint code above. The facts the [#22161] explain pin checks (stack.actions or any object's actions, trailing-wildcard) survive the rewrite.

  • nit N6 — paragraph 2 still says "Naming action_NAME for an action that exists but never materialises is its own verdict"; the verdict now fires for the qualified spelling too.

Implemented-by: claude/issue-31531-action-tool-name
Reviewed-by: session_01QSeKYnrQ7UMtHofKQVjcH2

VERDICT: PASS

…get; review nits

The unexposed-action verdict keeps its full sentence when it fits and
shrinks its fixed wording past 200 characters, naming the claim and the
action whole; pinned at a 64-character qualified claim. The object-key
reader says why it does not reuse actionObjectBinding, the os explain
text covers the qualified spelling of an unexposed action, and the spec
module header says cloud keeps its own copy until its follow-up.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 9f06355b483ae0b7f94d9dea7c9dd0e4d27b8d8b
Local-runs: none
Scope: packages/spec/src/ai/action-tool-name.ts, packages/spec/src/ai/index.ts + packages/lint/src/validate-ai-tool-references.ts, packages/lint/src/rule-explanations/ai-surface-references.ts
Security-touching: no
Rule-change-verified: none

Delta review of e203231c3a..9f06355b48, following the PASS record on e203231c3a. Read: the delta diff, the three first-parent commits (ffe78cd3e7 merge of main at dabe860d41, 6b8574e5b9 regeneration, 9f06355b48 fix), the net diff against main, and the check-runs on this head: 60 success, 13 skipped (opt-in and queue jobs), none failed or pending.

S1: closed.

No must-fix, no should-fix.

① Derived judgments

  • Public surface: unchanged from the reviewed head. The net diff against main is the same 9 files. api-surface/ai.json and export-origins/ai.json each add the same five names (ACTION_TOOL_OBJECT_SEPARATOR, ACTION_TOOL_PREFIX, AI_TOOL_NAME_MAX_LENGTH, actionToolName, legacyActionToolName), +5 lines each.
  • Merge. ffe78cd3e7 brought in main with feat: an app's ask skill text is capped at 8,000 characters at build, at save and in Studio #39246. Against main, the seven non-generated files carry exactly the line counts they had at e203231c3a; 6b8574e5b9 touches only the two ai.json files (+9 each, feat: an app's ask skill text is capped at 8,000 characters at build, at save and in Studio #39246's names restored by regeneration). The merge added nothing of this PR's own beyond the regenerated artifacts. The barrel's extra lines in the delta (package-skill-text) are main's, and this PR's net change to index.ts is still one line.
  • Lint accept set: unchanged. The fix commit changes verdict wording only; the universe and the unexposed map are untouched.

② Semver level

Unchanged and still correct: patch on spec and lint, Clause-②: yes (widening), Metadata-protocol: none. The changeset file is byte-identical to the reviewed head. Check Changeset is success on this head.

③ Boundary flags

  • Dev residual, the unexposed fix-hint line (Opt "ACTION" in …): nit N7 — counted, the line is 151 fixed characters plus the action name, so it passes 200 from a 50-character action name, whatever the object. The line holds only the action name, never the claim, so the qualified spelling does not lengthen it: it is byte-identical on main and overflows there for the same action. Not introduced or widened by this PR; no change owed here.
  • Standing from the prior record, no change owed on this PR: N1 (legacyActionToolName carries intent only), N3 (the ruled spelling is not injective), N5 (suggestions can only offer the old spelling for a raw action name; a follow-up for the 专题:AI 工具改为「工具记录 + 绑定」(问询助手能调用连接器、流程和动作;一处看到全部工具) #38951 M2 work), and the content/docs/ai/*.mdx docs follow-up for the seat to file.
  • The PR body's account of heads and counts remains the seat's to bring up to date.
  • SQL push-down: not applicable.

④ Design judgment

packages/lint/src/validate-ai-tool-references.ts — S1 holds as fixed. The unexposed arm now calls unexposedVerdict(ref, action). Its full string is built from the same two literals the arm used at e203231c3a and is returned whenever it is at most VERDICT_LINE_BUDGET, so every unexposed verdict that already fit is byte-identical (the exact-string [#22161] pin for action_send_invoice is untouched and green). Past the budget the wording becomes Tool "CLAIM" names action "ACTION", which is not an AI tool, so the runtime drops it: 73 fixed characters, both names whole. Counted against the three pinned cases: the unshortened 64-character claim gives 171, the ordinary 201-character case gives 137, the card's shortened vector gives 176. The short form stays within 200 for any 64-character claim with an action name up to 63 characters, which covers every name the spelling can produce from a claim that length. The constant's jsdoc ("the longest verdict line this rule prints") is now true of both arms that echo a claim. The new pin asserts the claim and the action name are both quoted in full and the length bound, for all three cases; the dev's ablation is the dev's account and was not re-run.

  • N4, answered: the jsdoc on eachDeclaredAction now says why actionObjectBinding is not reused. The reasoning stands. nit N8 — it says ActionSchema "renames object to objectName at parse"; on main the strict object refuses the unknown key object and its alias table names objectName as the fix. The conclusion is the same (a parsed stack never carries object), the mechanism is misdescribed.

packages/lint/src/rule-explanations/ai-surface-references.ts — N6 closed. Paragraph 2 now reads "Naming an action's tool, action_OBJECT__ACTION or action_NAME, for an action that exists but never materialises is its own verdict", which matches the unexposed map keyed by both spellings.

packages/spec/src/ai/action-tool-name.ts — N2 closed, function untouched. The delta is 7 changed lines, all inside the header comment: the lint reads the spelling from here, and the cloud runtime keeps its own copy until its follow-up, with the shared vectors holding the two equal. No line below the header changed, so the byte identity with cloud's text (7085807305) and the five pinned vectors stand as reviewed. action-tool-name.test.ts is unchanged.

packages/spec/src/ai/index.ts — holds. Still one export line of this PR's, now beside main's package-skill-text line with no conflict left.

Implemented-by: claude/issue-31531-action-tool-name
Reviewed-by: session_01QSeKYnrQ7UMtHofKQVjcH2

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2

L1 ACCEPT · PR #39266 (#31531) · head 9f06355b483ae0b7f94d9dea7c9dd0e4d27b8d8b · read 2026-12-03T08:11Z

席位核对

ACCEPT · repo:objectstack@os-justin · head 9f06355b483ae0b7f94d9dea7c9dd0e4d27b8d8b

  1. Shape. Fixes #31531 is right. Merging delivers the whole card: the spelling of an AI action tool name lives in @objectstack/spec/ai, and ai-skill-tool-unresolved resolves the qualified spelling of an AI-exposed, object-bound action. Cloud's own copy of the function is retired on cloud's side, which is the cloud follow-up named in the module header, not this card. The body has no other closing keyword.

  2. Contract review. The first record at CONTRACT_REVIEW_TIER (comment 7370523967) was PASS with S1: the unexposed-action verdict could pass the one-line budget for a 64-character claim. The fix round added unexposedVerdict with a short fallback wording, plus pins, which the dev ablated red. The delta record at this head reads S1: closed. and PASS. N2, N4 and N6 are closed. N1 (legacyActionToolName carries intent only) and N3 (the ruled spelling is not injective) are accepted deviations. N7 (the unexposed fix-hint line passes 200 characters for a 50-character action name) is byte-identical on main, so nothing is owed here. N8 (the jsdoc misdescribes why a parsed stack never carries object; the conclusion holds) is accepted as a nit.

  3. Declarations. Clause-②: yes (widening): @objectstack/spec/ai gains five exports, and lint accepts a spelling it refused before. Nothing that was accepted before is refused now. Metadata-protocol: none. Spec and lint each get a patch, and l1-face reads a changeset for each.

  4. Changeset, read sentence by sentence against the diff.

    • The spelling sentence (action_<object>__<action>, 48 characters, then _ and 8 hex characters of FNV-1a 32 over <object>:<action>) matches action-tool-name.ts and its five pinned vectors.
    • The five exports listed are the five names in api-surface/ai.json.
    • actionToolName is cloud's function unchanged; the review checked byte identity against 7085807305.
    • The qualified spelling now resolves, the legacy spelling still resolves, and a wrong-object qualified name is still reported; each has a pin in validate-ai-tool-references.test.ts.
    • The unexposed verdict fires for either spelling, from the unexposed map keyed by both.
    • "No migration": the lint accept set only widens.

    All six sentences hold.

  5. Scope. The 9 files are within claim 7367268428 and amendment 7368534683, which adds rule-explanations/ai-surface-references.ts. Two files are generated: api-surface/ai.json and export-origins/ai.json. No content/docs/releases/ path.

  6. Tests.

    • At this head the spec ai suite runs 27 files with 606 passed.
    • The rule file has 56 tests passing, 10 of them under [#31531]. The full lint suite has 10355 passing.
    • Each patch round's ablation turned only its own pins red, and each restore was blob-equal.
    • The dev ran 88 of the 90 derived gates locally with exit 0. The other two need a whole-workspace build, and CI runs them green.
  7. Gates.

    • Lint & Repo Gates and TypeScript Type Check: success at this head.
    • l1-face: 62 success, 15 expected skips, 0 failed, 0 pending.
    • check-governed-merges: NOT governed, 480 lines.
    • mergeable_state: clean.
    • Dogfood battery: not owed (no !, no narrowing).
  8. After merge, by the seat.

Clause-②: yes (widening) · Metadata-protocol: none

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 protocol:ai 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.

lint: ai-skill-tool-unresolved knows only action_<action>; action tools are action_<object>__<action> since #31515

2 participants