Skip to content

Commit 997decb

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-c57y86
2 parents 677b6cb + 06cccd3 commit 997decb

10 files changed

Lines changed: 159 additions & 25 deletions
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/service-messaging': patch
3+
'@objectstack/mcp': patch
4+
---
5+
6+
fix: the inbox's own notification list no longer shows the raw topic, and an MCP argument refusal ends at the fix
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
- **`@objectstack/service-messaging`.** The `mine` list view of `sys_inbox_message` (a person's own notifications) showed a Topic column reading the producer's machine id, such as `notify` for a flow's notify node or `collab.mention` for a mention. Nothing labels those ids, so the column is gone from that view: it now shows the title, the severity and the time. The `topic` field itself is unchanged and still searchable, so a filter or another view can use it.
12+
- **`@objectstack/mcp`.** When a tool call carries an argument the tool does not declare, the refusal names the argument and the spelling to send, and now stops there. It no longer ends with the sentence "This argument used to be dropped silently and the call still succeeded, …", which explained the history of the check to internal developers and gave the caller nothing to act on. Every tool still refuses an undeclared argument exactly as before; only the closing sentence is gone.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/platform-objects': patch
3+
---
4+
5+
fix(platform-objects): Edit organization's Parent Organization and Sort Order help says they matter only where the deployment runs several organizations
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
On a deployment with one organization, Edit organization still shows 上级组织 / Parent Organization and 排序 / Sort Order, and nothing told the administrator they do nothing there. Their help text, in the object declaration and in the `en` / `zh-CN` packs, now ends with "Meaningful only where the deployment runs several organizations." (「仅在部署运行多个组织时有意义。」). No field, permission or behaviour changes; the fields stay visible.

‎packages/mcp/src/mcp-http-tools.ts‎

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -696,23 +696,25 @@ const FLOW_TRIGGER_INPUTS: [FlowTriggerOrNone, ...FlowTriggerOrNone[]] = ['none'
696696
// ── Tool arguments: an undeclared key is REFUSED, not stripped (#16913) ──────
697697

698698
/**
699-
* The one sentence every tool's refusal ends with — why the key the caller
700-
* just sent used to disappear without a word.
699+
* [#30126 row 15] The refusal says which key is wrong and what to send
700+
* instead, and stops there: no sentence on why the key used to be dropped.
701701
*
702-
* Kept identical across the eleven tools on purpose. Triage's reading of this
703-
* card was that one tool holding two postures is evidence there was never a
704-
* rule; the answer to that is one posture, stated in one sentence, on every
705-
* door — not eleven bespoke ones.
702+
* `strictUnknownKeyError` (`@objectstack/spec/shared`) closes every message
703+
* with its surface's `history` sentence. On an authorable metadata schema that
704+
* sentence tells an author why a file that used to load is now refused; here
705+
* the reader is an agent mid-call, and the history of #16913 (a mis-guessed
706+
* name used to be stripped by the SDK, so the call succeeded with a different
707+
* answer) tells it nothing it can act on. So the factory is handed an empty
708+
* history and the separator it leaves is trimmed: the message ends at its last
709+
* fix channel. The prose that explains the posture stays in this file, beside
710+
* {@link strictToolInput}, where the readers who need it look.
706711
*/
707-
// ⛔ No tracker id in this string. It is RUNTIME prose — it reaches an MCP
708-
// client, an agent transcript and any log that captures a tool error, and none
709-
// of those readers can resolve `#NNNN` (`pnpm check:doc-authoring`). The anchor
710-
// belongs in a comment, where the reader who can resolve it is already looking:
711-
// the card is #16913, and the campaign it extends is #4001.
712-
const UNKNOWN_ARG_HISTORY =
713-
'This argument used to be dropped silently and the call still succeeded, so a mis-guessed '
714-
+ 'parameter name answered a differently filtered or differently ordered set with no way for '
715-
+ 'the caller to tell.';
712+
function withoutHistorySentence(map: z.core.$ZodErrorMap): z.core.$ZodErrorMap {
713+
return (issue) => {
714+
const answer = map(issue);
715+
return typeof answer === 'string' ? answer.trimEnd() : answer;
716+
};
717+
}
716718

717719
/**
718720
* Close an MCP tool's argument shape against keys it does not declare.
@@ -786,12 +788,12 @@ function strictToolInput<T extends z.ZodRawShape>(
786788
) {
787789
return z
788790
.object(shape, {
789-
error: strictUnknownKeyError({
791+
error: withoutHistorySentence(strictUnknownKeyError({
790792
surface: options.surface,
791793
knownKeys: Object.keys(shape),
792794
aliases: options.aliases,
793-
history: UNKNOWN_ARG_HISTORY,
794-
}),
795+
history: '',
796+
})),
795797
})
796798
.strict();
797799
}

‎packages/mcp/src/mcp-http-tools.unknown-argument-keys.test.ts‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,39 @@ describe('MCP tool arguments — undeclared keys are refused (#16913)', () => {
275275
expect(open).toEqual([]);
276276
});
277277
});
278+
279+
// [#30126 row 15] The refusal tells the caller the fix and stops: the sentence
280+
// on why such a key used to be dropped is for this file's readers, not for an
281+
// agent mid-call.
282+
describe('MCP tool arguments — the refusal ends at the fix, with no history sentence', () => {
283+
let runtime: MCPServerRuntime;
284+
let bridge: StubBridge;
285+
286+
beforeEach(() => {
287+
runtime = new MCPServerRuntime({ name: 't', version: '1.0.0' });
288+
bridge = makeBridge();
289+
});
290+
291+
it('names the key and the spelling to send, and says nothing about the old behaviour', async () => {
292+
const { refused, text } = await callTool(runtime, bridge, 'query_records', {
293+
objectName: 'crm_opportunity',
294+
sort: '-amount',
295+
});
296+
expect(refused).toBe(true);
297+
expect(text).toContain('`sort` → `orderBy`');
298+
expect(text).not.toMatch(/used to be dropped/i);
299+
expect(text).not.toMatch(/silently/i);
300+
});
301+
302+
it('holds on every advertised tool, and no refusal ends in a dangling separator', async () => {
303+
const json = await rpc(runtime, bridge, 'tools/list');
304+
const names: string[] = (json.result?.tools ?? []).map((t: any) => t.name);
305+
expect(names.length).toBeGreaterThan(0);
306+
const offending: string[] = [];
307+
for (const name of names) {
308+
const { text } = await callTool(runtime, bridge, name, { ...VALID_ARGS[name], zzUndeclaredProbeKey: 'x' });
309+
if (/used to be dropped|silently/i.test(text) || /\s$/.test(text)) offending.push(`${name}: ${JSON.stringify(text)}`);
310+
}
311+
expect(offending).toEqual([]);
312+
});
313+
});

‎packages/platform-objects/src/apps/translations/en.objects.generated.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,11 +565,11 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
565565
},
566566
parent_organization_id: {
567567
label: "Parent Organization",
568-
help: "Reporting/grouping parent. Grants NOTHING — visibility across organizations comes from membership, never from this reference."
568+
help: "Reporting/grouping parent. Grants NOTHING — visibility across organizations comes from membership, never from this reference. Meaningful only where the deployment runs several organizations."
569569
},
570570
sort_order: {
571571
label: "Sort Order",
572-
help: "Display order among sibling organizations. Presentation only."
572+
help: "Display order among sibling organizations. Presentation only. Meaningful only where the deployment runs several organizations."
573573
},
574574
id: {
575575
label: "Organization ID"

‎packages/platform-objects/src/apps/translations/zh-CN.objects.generated.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,11 +565,11 @@ export const zhCNObjects: NonNullable<TranslationData['objects']> = {
565565
},
566566
parent_organization_id: {
567567
label: "上级组织",
568-
help: "用于汇报 / 分组的上级。不授予任何权限——跨组织的可见性来自成员关系,绝不来自此引用。"
568+
help: "用于汇报 / 分组的上级。不授予任何权限——跨组织的可见性来自成员关系,绝不来自此引用。仅在部署运行多个组织时有意义。"
569569
},
570570
sort_order: {
571571
label: "排序",
572-
help: "在同级组织中的显示顺序。仅用于展示。"
572+
help: "在同级组织中的显示顺序。仅用于展示。仅在部署运行多个组织时有意义。"
573573
},
574574
id: {
575575
label: "组织 ID"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
//
3+
// sys_organization's `parent_organization_id` and `sort_order` only order and
4+
// group organizations against each other, so on a deployment with one
5+
// organization they do nothing. Edit organization still draws them there, and
6+
// an administrator could not tell (#30210, row 4 C). Their help now says so in
7+
// every bundle that carries it: the declaration (served as the `en` source)
8+
// and the `en` / `zh-CN` packs.
9+
import { describe, expect, it } from 'vitest';
10+
import { SysOrganization } from './sys-organization.object.js';
11+
import { enObjects } from '../apps/translations/en.objects.generated.js';
12+
import { zhCNObjects } from '../apps/translations/zh-CN.objects.generated.js';
13+
14+
const FIELDS = ['parent_organization_id', 'sort_order'] as const;
15+
16+
const declared = (name: string) =>
17+
(SysOrganization.fields as Record<string, { description?: string }>)[name]?.description ?? '';
18+
19+
type Bundle = { sys_organization?: { fields?: Record<string, { help?: string }> } };
20+
const packHelp = (bundle: unknown, name: string) =>
21+
(bundle as Bundle).sys_organization?.fields?.[name]?.help ?? '';
22+
23+
describe('sys_organization: parent and sort order say they matter only with several organizations (#30210)', () => {
24+
it.each(FIELDS)('%s: the declaration says so', (name) => {
25+
expect(declared(name)).toMatch(/Meaningful only where the deployment runs several organizations\.$/);
26+
});
27+
28+
it.each(FIELDS)('%s: the en pack is the declaration, byte for byte', (name) => {
29+
expect(packHelp(enObjects, name)).toBe(declared(name));
30+
});
31+
32+
it.each(FIELDS)('%s: the zh-CN pack says so', (name) => {
33+
expect(packHelp(zhCNObjects, name)).toMatch(/仅在部署运行多个组织时有意义。$/);
34+
});
35+
});

‎packages/platform-objects/src/identity/sys-organization.object.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,14 +486,15 @@ export const SysOrganization = ObjectSchema.create({
486486
required: false,
487487
group: 'Group Structure',
488488
description:
489-
'Reporting/grouping parent. Grants NOTHING — visibility across organizations comes from membership, never from this reference.',
489+
'Reporting/grouping parent. Grants NOTHING — visibility across organizations comes from membership, never from this reference. Meaningful only where the deployment runs several organizations.',
490490
}),
491491

492492
sort_order: Field.number({
493493
label: 'Sort Order',
494494
required: false,
495495
group: 'Group Structure',
496-
description: 'Display order among sibling organizations. Presentation only.',
496+
description:
497+
'Display order among sibling organizations. Presentation only. Meaningful only where the deployment runs several organizations.',
497498
}),
498499

499500
// ── System ───────────────────────────────────────────────────
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
/**
4+
* [#30126 row 8] The recipient's own notification list (`sys_inbox_message`'s
5+
* `mine` view) does not show the raw topic.
6+
*
7+
* `topic` is the producer's machine id — `notify` for a flow's notify node,
8+
* `collab.mention` for a mention — and no catalog gives it a label, so the
9+
* column read `notify` beside every title. The view now projects what a
10+
* recipient reads (title, severity, when); `topic` stays a field of the
11+
* object, still searchable, so a filter or another view can use it.
12+
*/
13+
14+
import { describe, expect, it } from 'vitest';
15+
import { InboxMessage } from './index.js';
16+
17+
interface ViewLike {
18+
columns?: unknown;
19+
}
20+
21+
const def = InboxMessage as unknown as {
22+
listViews?: Record<string, ViewLike>;
23+
fields: Record<string, { searchable?: boolean }>;
24+
};
25+
26+
describe('sys_inbox_message `mine` view', () => {
27+
it('projects the title, severity and time, and not the machine topic', () => {
28+
expect(def.listViews?.mine?.columns).toEqual(['title', 'severity', 'created_at']);
29+
});
30+
31+
it('keeps `topic` on the object as a searchable field', () => {
32+
expect(def.fields.topic?.searchable).toBe(true);
33+
});
34+
});

‎packages/services/service-messaging/src/objects/inbox-message.object.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ export const InboxMessage = ObjectSchema.create({
3838
name: 'mine',
3939
label: 'Notifications',
4040
data: { provider: 'object', object: 'sys_inbox_message' },
41-
columns: ['title', 'topic', 'severity', 'created_at'],
41+
// [#30126 row 8] No `topic`: it is the producer's machine id
42+
// (`notify`, `collab.mention`), not a word a recipient reads, and
43+
// there is no catalog that labels it. The column stays on the
44+
// object (searchable, filterable); only this view stops showing it.
45+
columns: ['title', 'severity', 'created_at'],
4246
filter: [{ field: 'user_id', operator: 'equals', value: '{current_user_id}' }],
4347
sort: [{ field: 'created_at', order: 'desc' }],
4448
pagination: { pageSize: 50 },

0 commit comments

Comments
 (0)