Repository navigation
feat(spec,lint): the AI action tool name lives in spec; lint resolves the qualified spelling - #39266
Conversation
…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>
…l name Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check16 anchor(s) derived from 2 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 183 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # 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 |
…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>
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 Contract-review-claim: session_01QSeKYnrQ7UMtHofKQVjcH2 · head e203231 · 2026-12-03T06:55Z |
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 Contract reviewServed-tier: 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 ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
S1 (should-fix) — the unexposed-action verdict breaks the 200-character budget this diff declares, for ordinary qualified names.
Implemented-by: VERDICT: PASS |
Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 Co-authored-by: Claude <noreply@anthropic.com>
…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>
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 Contract reviewServed-tier: Delta review of S1: closed. No must-fix, no should-fix. ① Derived judgments
② Semver levelUnchanged and still correct: ③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 L1 ACCEPT · PR #39266 (#31531) · head 席位核对ACCEPT · repo:objectstack@os-justin · head
|
Fixes #31531
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
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'spackages/service-ai/src/tools/action-tool-name.tsat cloudcaa857a, character for character, as quoted on the card (comment 7085807305). Only TSDoc was added. No name clashes with an existing spec export (face-name.tskeeps its own module-privatefnv1a32Hex, 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.legacyActionToolName({ name }, prefix?): returnsaction_ACTIONwhatever 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.packages/lint/src/validate-ai-tool-references.ts): each materialised action now adds two names:actionToolName({ name, objectName })andlegacyActionToolName({ name }). The object comes from the action's ownobjectName; 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 noobjectNamestill adds onlyaction_ACTION. Why this does not reuseactionObjectBinding(validate-action-body-writes.ts) is in the jsdoc: that reader is module-private and reads the legacyobjectalias, whichActionSchemarenames at parse, so the two differ only on an unparsed stack.action_OBJECT__ACTIONandaction_ACTIONfor a real but unexposed action both get the "names action …, which does not become an AI tool" verdict. The old code stripped theaction_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.packages/lint/src/rule-explanations/ai-surface-references.ts, file surface widened by claim amendment 7368534683): paragraph 1 namesaction_OBJECT__ACTIONfor an object-bound action (shortened past 64 characters asactionToolNamespells it) andaction_NAMEfor a top-level one, and says the oldaction_NAMEspelling of an object-bound action still resolves. Paragraph 2 says the unexposed-action verdict covers both spellings.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.export *line at the end of theaiexport 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 throughscripts/pm/os-regen-merge.sh, and the twomerge=os-regenartifacts were regenerated on the merged tree at 6b8574e.packages/spec/api-surface/ai.jsonandpackages/spec/export-origins/ai.json, viacheck:generated --fix.packages/service-ai/src/tools/action-tool-name.tscan importactionToolNamefrom@objectstack/spec/aiinstead 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 at9f06355b48follow 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_d455a5f0and…__recomp_7d992e8eand the 64-character name that stays whole. The legacy spelling is pinned to equalactionToolNamefor a top-level action.At
9f06355b48:pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/ai/→ 27 files, 606 passed;check:generatedall 14 up to date after the spec build.Lint: the work item 3 pins (`describe('[#31531] the qualified action tool name …')`)
objectName, and as a shortened 64-character claim.action_ACTIONclaim on an object-bound action resolves.action_crm_account__convert_lead) is reported, and not by the unexposed arm.action_send_invoice, and a qualified spelling of it (action_global__send_invoice) is still reported.action_crm_knowledge_article_publish_timestamps__recomp_d455a5f1against the real…__recomp_d455a5f0, stays at or under 200 characters and names both.action_crm_knowledge_article__publish_to_portal_and_notify_owner(64 characters),action_crm_knowledge_article__publish_to_portaland the shortened vector stays at or under 200 characters and names the claim and the action.At
9f06355b48: this file plusrule-explanations.test.ts65 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.actionToolNameswas changed to return onlylegacyActionToolName({ name }). The anchor hit 1 → 0, and the blob went fromed8cfe7bccd9to70146f586543.The lint suite went red, 5 failed and 48 passed:
objectNamefix: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 HEADis 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 --ranreconciles 88 derived, 86 run, 2 NOT-MEASURED, 0 UNRUN, with every line carrying its exit code.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-majorandcheck:cross-package-test-inputs.check:doc-formula-expressionsfirst exited 3 (PREREQUISITE NOT MET: lint was not built). It exited 0 afterpnpm --filter @objectstack/lint build.check:dual-build-cjs-loadsandcheck: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.9f06355b48: 90 derived (check:cli-command-idsandcheck:optional-error-sinkjoin through the rule-explanations path), 88 run with exit 0, 2 NOT-MEASURED (the same two), 0 UNRUN. One firstcheck:docsrun 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
skills/objectstack-ai/SKILL.mdstill teachesaction_ACTIONNAME. That spelling still resolves, so it is not wrong; teaching the qualified name is a skills-lane choice.content/docs/ai/(tools.mdx,agents.mdx,actions-as-tools.mdx,connect-mcp.mdx) still say oneaction_NAMEtool per exposed action. They were stale since cloud#3846 and sit outside this diff; the seat files a docs follow-up.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.mainis merged and the generatedai.jsonfiles were regenerated on the merged tree.Verification
Read first, by risk:
packages/lint/src/validate-ai-tool-references.ts:eachDeclaredAction(which object an action is bound to),actionToolNames,unresolvedVerdictandunexposedVerdict.packages/spec/src/ai/action-tool-name.ts: compare the function to the cloud text in card comment 7085807305.packages/lint/src/validate-ai-tool-references.test.ts: the[#31531]describe.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