Skip to content

feat: re-home a task group's project via update_task_group (by Wren) - #443

Open
conoremclaughlin wants to merge 1 commit into
mainfrom
wren/feat/task-group-project-rehome
Open

feat: re-home a task group's project via update_task_group (by Wren)#443
conoremclaughlin wants to merge 1 commit into
mainfrom
wren/feat/task-group-project-rehome

Conversation

@conoremclaughlin

Copy link
Copy Markdown
Owner

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 projectId on update_task_group:

  • a UUID re-homes the group under that project,
  • null detaches it,
  • omitted leaves it unchanged.

The repository's UpdateTaskGroupInput/update() already handled project_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):

  • owned-project re-home → validates + passes project_id
  • cross-user project → Project does not belong to this user, no write
  • missing project → Project not found, no write
  • null → detaches, no ownership lookup
  • omitted → project_id: undefined (unchanged), no lookup

Type-check clean (only the pre-existing gateway/mcp baseline).

🤖 Generated with Claude Code

…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 conoremclaughlin left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/443
  • npx 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant