Repository navigation
task.reassign refuses a destination inbox the caller may not post to - #240
Merged
Merged
Conversation
zlareb1
force-pushed
the
fix/task-reassign-poster-check
branch
from
November 4, 2026 02:24
02ec642 to
c4d88e5
Compare
task.reassign filed a child task into any registered inbox without the posters check task.create applies, so a writer could post into an inbox it may not post to, and a registered unreadable inbox answered differently from an unregistered one. The destination now passes the same gate: 404 when the caller may neither post nor read its namespace, 403 when it may read but not post. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…_may_post Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
zlareb1
force-pushed
the
fix/task-reassign-poster-check
branch
from
November 4, 2026 03:38
c4d88e5 to
f6cb541
Compare
8 of 9 tasks
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.
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
task.reassignnow applies the destination inbox's posters check, astask.createdoes: a caller who may not post there gets 403, or 404 when it cannot read the inbox's namespace either.Why
Failing case: writer W owns inbox
aand is neither listed on inboxxnor granted anything onx's owner namespace, sotask.create(inbox="x")refuses it. W creates a task inaand callstask.reassign(task_id, to_inbox="x").handle_task_reassignloaded the destination and ran its policy decision but never called_poster_may_post, so the child task landed inx(triage, or todo under a*auto policy). The 404 that hides unreadable inbox names was skipped too, so a registered unreadable inbox answered differently from an unregistered one.Pattern: a second write path into a table that skips a gate the first one applies.
Fix: before the destination decision,
handle_task_reassignruns the same gate ashandle_task_createon the caller. Both handlers now call one helper,trust._require_poster, so the two paths cannot drift apart again. The gate is on the caller because the caller is the one posting; the destination's trust policy still applies to the original poster, as before.Scope and risk
server/tasks/app/transitions.py(handle_task_create,handle_task_reassign),server/tasks/app/trust.py(_require_poster) and theto_inboxfield comment.task.create's answers are unchanged.inbox.listwithmine_everywhere(the dashboard's reassign picker) now lists the inboxes the caller may post to, by the same rule: it no longer lists an inbox whose owner namespace the caller can only read, which the picker would otherwise offer and the reassign refuse with 403. A reassign the gate refuses leaves the task where it is: the check runs before the task is cancelled.Compatibility, rollout and rollback
inbox.list mine_everywhereleaves out inboxes the caller may only read (it still lists the caller's own namespace's inboxes, andinbox.listwithoutmine_everywhereis unchanged).postersor hold write on its owner namespace.Tests
tests/unit/test_task_inbox.py::test_a_reassign_into_an_inbox_the_caller_may_not_post_to_is_refused: failed before the fix (no exception raised); now answers 404 with no read on the destination's namespace and 403 with read but no write, and leaves the task in place with no child row. The 404 detail equals the one for an unregistered inbox name.tests/integration/test_task_inbox.py::test_a_reassign_into_an_inbox_the_caller_may_not_post_to_is_refused: with real tokens, a reassign into another team's inbox answers 404 like an unregistered name and the task stays in its inbox.tests/unit/test_inbox_trust_by_subject.py::test_inbox_list_everywhere_leaves_out_an_inbox_the_caller_may_only_read: read alone does not list an inbox; a poster entry or write does.tests/unit/test_task_inbox.py,test_inbox_trust_by_subject.py,test_inbox_gate_friction.py,test_docs_reference.pypass;make format lint typecheckclean.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. Checked the create gate it mirrors and the order of the reassign's checks by reading the code.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code