feat: re-home a task group's project via update_task_group (by Wren) - #443
Open
conoremclaughlin wants to merge 1 commit into
Open
feat: re-home a task group's project via update_task_group (by Wren)#443conoremclaughlin wants to merge 1 commit into
conoremclaughlin wants to merge 1 commit into
Conversation
…y Wren) The task-group tracker only let you set a project at creation, so re-homing a group meant recreating it (Myra's inkread shadow clone hit exactly this). Add `projectId` to updateTaskGroupSchema: a UUID re-homes the group, null detaches, omitted leaves it unchanged. The repository already supported project_id on update — this exposes it through the tool with a create-parity ownership check (service-role bypasses RLS, so a target project must belong to the caller before it's written). Tool description updated to advertise it. 5 unit tests: owned-project re-home passes project_id; cross-user project and missing project are rejected with no write; null detaches without a lookup; omitted leaves project_id undefined. 96/96 task-handler tests pass; type-check clean. Co-Authored-By: Wren <noreply@anthropic.com>
conoremclaughlin
left a comment
Owner
Author
There was a problem hiding this comment.
LGTM — no blocking findings.
Reviewed the update_task_group schema/handler path and the repo boundary. The implementation preserves the important undefined = unchanged vs null = detach distinction, and the target-project ownership check matches the create path before service-role writes can rebind project_id.
Validation run locally:
git diff --check origin/main...origin/pr/443npx vitest run packages/api/src/mcp/tools/task-handlers.test.ts --pool=threads(96/96)
Note: yarn workspace @inklabs/api type-check still fails on pre-existing baseline errors in src/channels/gateway.ts JSON typing and src/mcp/server.ts (this), outside this PR’s diff.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The task-group tracker only lets you set a project at creation — so re-homing a group under a different project meant deleting and recreating it. Myra's inkread shadow clone hit exactly this: "the tracker only lets you set a project at group-creation, so I recreated them."
What
Expose
projectIdonupdate_task_group:The repository's
UpdateTaskGroupInput/update()already handledproject_id(if (input.project_id !== undefined)) — this just surfaces it through the tool, with a create-parity ownership check: service-role DB access bypasses RLS, so a target project must be validated as belonging to the caller before it's written (prevents rebinding a group under another user's project). Tool description updated to advertise the capability.Tests
5 new unit tests (96/96 in the file pass):
project_idProject does not belong to this user, no writeProject not found, no writenull→ detaches, no ownership lookupproject_id: undefined(unchanged), no lookupType-check clean (only the pre-existing gateway/mcp baseline).
🤖 Generated with Claude Code