-
Notifications
You must be signed in to change notification settings - Fork 11
Cards: give the plain update name to a merge-safe composite #489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9e5e561
058e60b
05aa764
c21e6a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -234,6 +234,32 @@ async function executeOperation( | |
| await client.todos.update(Number(params.todoId), mapTodoWireFields(body)); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: Field-mapping logic for Prompt for AI agents |
||
| break; | ||
|
|
||
| case "UpdateCard": | ||
| // Merge-safe composite: GET then PUT, resending the fetched due_on. | ||
| await client.cards.update(Number(params.cardId), { | ||
| ...(body.title !== undefined ? { title: String(body.title) } : {}), | ||
| ...(body.content !== undefined ? { content: String(body.content) } : {}), | ||
| ...(body.due_on !== undefined | ||
| ? { dueOn: body.due_on === "" ? null : String(body.due_on) } | ||
| : {}), | ||
| ...(body.assignee_ids !== undefined | ||
| ? { assigneeIds: body.assignee_ids as number[] } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Unsafe Prompt for AI agents |
||
| : {}), | ||
| }); | ||
| break; | ||
|
|
||
| case "UpdateCardVerbatim": | ||
| // Raw single PUT, no read-before-write. | ||
| await client.cards.updateVerbatim(Number(params.cardId), { | ||
| ...(body.title !== undefined ? { title: String(body.title) } : {}), | ||
| ...(body.content !== undefined ? { content: String(body.content) } : {}), | ||
| ...(body.due_on !== undefined ? { dueOn: String(body.due_on) } : {}), | ||
| ...(body.assignee_ids !== undefined | ||
| ? { assigneeIds: body.assignee_ids as number[] } | ||
| : {}), | ||
| }); | ||
| break; | ||
|
|
||
| case "EditTodo": | ||
| // Synthetic scenario key: read-modify-write via the edit callback, | ||
| // assigning each fixture-present key onto the mapped TodoFields member. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: Incomplete description of TypeScript null stripping:
JSON.stringifydropsundefinedkeys but preservesnullvalues — it does not by itself strip null from output. Since the TypeScript composite typedueOn?: string | nullacceptsnullas a clear signal, the implementation must pre-process null to undefined (or use a replacer) before callingJSON.stringify. The spec lists the serialization step alone, which is insufficient to produce the required wire omission for null inputs.Prompt for AI agents