From dc8b3418992a12fb8dd8648a075aeac0a3636e94 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 11:25:36 +0000 Subject: [PATCH 1/3] feat(spec): list list_flow_runs among the service-ai-studio platform tools The cloud build agent registers a read-only list_flow_runs tool that reads one flow's recent runs as the caller. The registry now lists it, so a skill naming it resolves under ADR-0109 reference integrity instead of being reported as a fictional tool. Pins: the registry carries the name, and the tool-reference lint still reports a fictional neighbour. Claude-Session: https://claude.ai/code/session_01L6bhgXM39VND2qb8HbebbK Co-authored-by: Claude --- .changeset/34372-list-flow-runs-registry.md | 10 ++++++++++ .../src/validate-ai-tool-references.test.ts | 17 +++++++++++++++++ .../constants/platform-tool-names.test.ts | 9 +++++++++ .../src/system/constants/platform-tool-names.ts | 8 ++++++-- 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 .changeset/34372-list-flow-runs-registry.md diff --git a/.changeset/34372-list-flow-runs-registry.md b/.changeset/34372-list-flow-runs-registry.md new file mode 100644 index 00000000000..a6a99cfbd7a --- /dev/null +++ b/.changeset/34372-list-flow-runs-registry.md @@ -0,0 +1,10 @@ +--- +'@objectstack/spec': minor +--- + +feat(spec): `PLATFORM_TOOLS_BY_PACKAGE['service-ai-studio']` lists `list_flow_runs` + +Clause-②: yes (widening) +Metadata-protocol: added + +The cloud build agent gains a read-only `list_flow_runs` tool: it reads one flow's recent runs as the caller, so the agent can answer "did my automation work?" from a run's own outcome. The registry lists the name in its alphabetical place, so `PLATFORM_PROVIDED_TOOL_NAMES` carries it and `isPlatformProvidedToolName('list_flow_runs')` answers `true`. A skill whose `tools[]` names `list_flow_runs` now resolves under ADR-0109 reference integrity instead of being reported as a fictional tool (`ai-skill-tool-unresolved`). The chat panel's step label for the tool is in every built-in locale pack. No schema shape changes and no export is added or removed. diff --git a/packages/lint/src/validate-ai-tool-references.test.ts b/packages/lint/src/validate-ai-tool-references.test.ts index 7d5ca048bc7..974bebdb1ca 100644 --- a/packages/lint/src/validate-ai-tool-references.test.ts +++ b/packages/lint/src/validate-ai-tool-references.test.ts @@ -451,6 +451,23 @@ describe('validate-ai-tool-references', () => { expect(control[0].message).toContain('delete_packages'); }); + /** + * The build agent's read-only flow-run reader: a skill naming + * `list_flow_runs` resolves; a near name nobody registers does not. + */ + it('resolves the service-ai-studio flow-run reader', () => { + expect(validateAiToolReferences({ skills: [{ name: 's', tools: ['list_flow_runs'] }] })).toEqual([]); + + // The control: a fictional neighbour registered by nobody is still + // reported, so this pin fails on a universe widened too far. + const control = validateAiToolReferences({ + skills: [{ name: 's', tools: ['list_flow_runs', 'retry_flow_run'] }], + }); + expect(control).toHaveLength(1); + expect(control[0].path).toBe('skills[0].tools[1]'); + expect(control[0].message).toContain('retry_flow_run'); + }); + it('reports stable paths and tolerates junk shapes', () => { const stack = { skills: [{ name: 's', tools: ['query_records', 'nope_tool'] }], diff --git a/packages/spec/src/system/constants/platform-tool-names.test.ts b/packages/spec/src/system/constants/platform-tool-names.test.ts index d82fd2197cd..58cb0049506 100644 --- a/packages/spec/src/system/constants/platform-tool-names.test.ts +++ b/packages/spec/src/system/constants/platform-tool-names.test.ts @@ -78,6 +78,15 @@ describe('PLATFORM_PROVIDED_TOOL_NAMES — internal invariants', () => { expect(PLATFORM_TOOLS_BY_PACKAGE['service-ai-studio']).not.toContain(GET_RECORD_CONTEXT_TOOL_NAME); }); + it('lists the build agent\'s read-only flow-run reader', () => { + // Cloud `service-ai-studio` registers it; while the registry lacked it, a + // skill naming it read as a fictional tool. + expect(PLATFORM_TOOLS_BY_PACKAGE['service-ai-studio']).toContain('list_flow_runs'); + expect(isPlatformProvidedToolName('list_flow_runs')).toBe(true); + // The control: the singular nobody registers still misses. + expect(isPlatformProvidedToolName('list_flow_run')).toBe(false); + }); + it('each group is sorted, so diffs stay reviewable', () => { for (const [pkg, names] of Object.entries(PLATFORM_TOOLS_BY_PACKAGE)) { expect([...names].sort(), pkg).toEqual([...names]); diff --git a/packages/spec/src/system/constants/platform-tool-names.ts b/packages/spec/src/system/constants/platform-tool-names.ts index 3858e1b8ad7..dfa10b8a876 100644 --- a/packages/spec/src/system/constants/platform-tool-names.ts +++ b/packages/spec/src/system/constants/platform-tool-names.ts @@ -88,9 +88,12 @@ export const PLATFORM_TOOLS_BY_PACKAGE: Readonly Date: Mon, 16 Nov 2026 11:54:02 +0000 Subject: [PATCH 2/3] test(plugin-chatbot): list_flow_runs graduates from AHEAD_OF_PIN The spec registry now lists list_flow_runs, so the label-parity suite's hand-held list loses it and GRADUATED pins it in the registry instead. Claude-Session: https://claude.ai/code/session_01L6bhgXM39VND2qb8HbebbK Co-authored-by: Claude --- .../toolLabels-locale-parity-7481.test.ts | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/ui/packages/plugin-chatbot/src/__tests__/toolLabels-locale-parity-7481.test.ts b/ui/packages/plugin-chatbot/src/__tests__/toolLabels-locale-parity-7481.test.ts index ce73b8261bb..24c86eb1e0c 100644 --- a/ui/packages/plugin-chatbot/src/__tests__/toolLabels-locale-parity-7481.test.ts +++ b/ui/packages/plugin-chatbot/src/__tests__/toolLabels-locale-parity-7481.test.ts @@ -25,7 +25,8 @@ * was written around — `get_authoring_rules` (cloud#1837), `load_tools`, * `open_record`, `test_flow`, `toggle_flow` — are all in * `PLATFORM_TOOLS_BY_PACKAGE` as of `@objectstack/spec` 17.4.0, so they left - * {@link AHEAD_OF_PIN} (objectui#8772 took the pin there). ⛔ The list is kept, + * {@link AHEAD_OF_PIN} (objectui#8772 took the pin there); `list_flow_runs` + * followed when objectstack#34372 listed it. ⛔ The list is kept, * not deleted: the next tool the cloud registers ahead of a snapshot needs the * same hatch, and rebuilding it under pressure is how a permanent second * registry starts. {@link GRADUATED} keeps this file's guards honest whenever @@ -56,11 +57,9 @@ const REGISTRY = ( * list yet — sourced from cloud `service-ai-studio`'s `plugin.ts` tool * definitions. Shrink this list on a pin bump — never grow it as a habit. * - * `list_flow_runs` (the build agent's read-only reader of a flow's recent - * runs) waits on the registry entry that objectstack#34372 adds; that change - * moves it from here to {@link GRADUATED}. + * EMPTY at this pin: every name it carried has graduated (see {@link GRADUATED}). */ -const AHEAD_OF_PIN: readonly string[] = ['list_flow_runs']; +const AHEAD_OF_PIN: readonly string[] = []; /** * The names that HAVE graduated from {@link AHEAD_OF_PIN} into the registry. @@ -70,10 +69,17 @@ const AHEAD_OF_PIN: readonly string[] = ['list_flow_runs']; * being non-empty, so with it emptied they would read green against a * `PLATFORM_TOOLS_BY_PACKAGE` that had vanished, gone empty, or lost these very * names: `[].filter(…)` is `[]` and `arrayContaining([])` passes on anything. - * Asserting these five ARE in the registry is the reading that cannot be + * Asserting these names ARE in the registry is the reading that cannot be * satisfied by an absent export, and it is the same fact the emptying rests on. */ -const GRADUATED = ['get_authoring_rules', 'load_tools', 'open_record', 'test_flow', 'toggle_flow'] as const; +const GRADUATED = [ + 'get_authoring_rules', + 'list_flow_runs', + 'load_tools', + 'open_record', + 'test_flow', + 'toggle_flow', +] as const; /** Every tool name that must carry a step label in every pack. */ const COVERED: string[] = [ From 2c464d444b8b4d97ead6992e19071d78bcc8cee2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 06:38:03 +0000 Subject: [PATCH 3/3] fix(spec): the list_flow_runs changeset is a patch, and the 7481 zh case iterates GRADUATED Contract review M1: SkillSchema.tools is a free string array, so what an author can write parses the same; only an advisory lint warning goes away. Metadata-protocol none, @objectstack/spec patch. N2: the zh label case looped over AHEAD_OF_PIN, which this change empties; it now loops over GRADUATED so it asserts again. Claude-Session: https://claude.ai/code/session_01L6bhgXM39VND2qb8HbebbK Co-authored-by: Claude --- .changeset/34372-list-flow-runs-registry.md | 4 ++-- .../src/__tests__/toolLabels-locale-parity-7481.test.ts | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.changeset/34372-list-flow-runs-registry.md b/.changeset/34372-list-flow-runs-registry.md index a6a99cfbd7a..ef48a4d7422 100644 --- a/.changeset/34372-list-flow-runs-registry.md +++ b/.changeset/34372-list-flow-runs-registry.md @@ -1,10 +1,10 @@ --- -'@objectstack/spec': minor +'@objectstack/spec': patch --- feat(spec): `PLATFORM_TOOLS_BY_PACKAGE['service-ai-studio']` lists `list_flow_runs` Clause-②: yes (widening) -Metadata-protocol: added +Metadata-protocol: none The cloud build agent gains a read-only `list_flow_runs` tool: it reads one flow's recent runs as the caller, so the agent can answer "did my automation work?" from a run's own outcome. The registry lists the name in its alphabetical place, so `PLATFORM_PROVIDED_TOOL_NAMES` carries it and `isPlatformProvidedToolName('list_flow_runs')` answers `true`. A skill whose `tools[]` names `list_flow_runs` now resolves under ADR-0109 reference integrity instead of being reported as a fictional tool (`ai-skill-tool-unresolved`). The chat panel's step label for the tool is in every built-in locale pack. No schema shape changes and no export is added or removed. diff --git a/ui/packages/plugin-chatbot/src/__tests__/toolLabels-locale-parity-7481.test.ts b/ui/packages/plugin-chatbot/src/__tests__/toolLabels-locale-parity-7481.test.ts index 24c86eb1e0c..80c18bd286c 100644 --- a/ui/packages/plugin-chatbot/src/__tests__/toolLabels-locale-parity-7481.test.ts +++ b/ui/packages/plugin-chatbot/src/__tests__/toolLabels-locale-parity-7481.test.ts @@ -147,9 +147,12 @@ describe('humanizeToolName resolves the newer tools through the pack (objectui#7 expect(humanizeToolName('get_authoring_rules', ttFrom('zh-Hans'))).not.toBe('Get authoring rules'); }); - it('zh: the other four newly-mapped tools resolve too', () => { + it('zh: every graduated tool resolves to its pack label too', () => { + // Iterates GRADUATED, not AHEAD_OF_PIN: the hand-held list is empty at + // this pin, and a loop over it would assert nothing. const tt = ttFrom('zh-Hans'); - for (const name of AHEAD_OF_PIN) { + expect(GRADUATED.length).toBeGreaterThan(0); + for (const name of GRADUATED) { expect(humanizeToolName(name, tt), name).toBe(toolsOf('zh-Hans')![name]); } });