Repository navigation
fix(platform): close tasks/collab authz, orphan, and notification gaps - #3180
Merged
Merged
Conversation
Squash of the wt-3 batch for rebase onto main; the PR body carries the per-finding record.
larryro
force-pushed
the
fix/tasks-collab-integrity
branch
from
September 4, 2026 03:29
a5fac7e to
051bda2
Compare
larryro
marked this pull request as ready for review
September 4, 2026 03:29
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.
Seven verified medium findings in the task board's authorization, delete, review-gate and notification seams, from the backend deep-review campaign (
/tmp/tale-review/triage/mediums.md, modulestasks+collab). Base899fcc08a(has #3130 / #3157 / #3158 / #3164); every finding was re-verified live on that base before the fix. One commit per seam.Per-finding outcome
tasks/routes.tscancel by:runId)b97e14b74AGENT_RUN_NOT_FOUNDwhen it is not this task's;cancelAgentRunInTxbindstask_idinside the UPDATE predicate (no unbound cancel door left).deleteTaskTODO)954214d2ecancelRunInTx; the tasks' unboundfile_metadatarows are trashed for refs no surviving task lists and the durableknowledge.release_refsjob (#3140 seam) deletes the bytes after commit.0cb174b4eassigneeChangesrule forassignTaskandbulkUpdateTasks; the single door refusesTASK_HAS_LIVE_RUN(409), bulk keeps skipping; every picker names the refusal (en/de/fr). The comment-mention dispatcher only reachesassignTaskwith no live run (steer lane returns first), so it is unaffected.in_reviewwithout minting the review gateea58c2fa3requestTaskReviewnow runs from the bulk bar, the non-workflow external close, andagentUpdateTaskStatusTrusted(the agent'stask_update_statustool + the workflow native, which also parked without a gate). Lanes without a run key mint on the task's live run so the settle replay finds the same row; idempotent.67501dd96notifyTaskReviewerAssignedincollab/service.ts(bell only, pref gate skipped like the request, never for yourself) on thenotificationhint entity from #3164;updateTasksubscribes the designee (reasonreviewer) and refuses a non-member (TASK_REVIEWER_INVALID).6bfb0f7a2MentionDirectoryError; the task-comment door answers 503MENTION_DIRECTORY_UNAVAILABLEinstead of posting a comment that notified nobody.edd19cb38requestedFor+ project scope filtered in SQL before the cap,ORDER BY seq DESC, exact total via window count; unread counts from aGROUP BYaggregate instead of a capped page (badge now exact rather than capped at 100).No migration needed (0070/0071 untouched): the pending-review filter rides
approvals_org_status, and pending reviews are rare org-wide.Tests (red on base, green on branch)
Colocated vitest, each observed failing before its fix:
tasks/agent-runs.test.ts— the cancel bindstask_idin the guard; a refused cancel writes no ledger entry (2, red: nocancelAgentRunInTx).tasks/service.test.ts—assigneeChangestransfer rule + the 409 refusal (4).tasks/service.blobs.test.ts—collectTaskBlobRefsacross a subtree, de-dup, malformed rows (3, red: no export).collab/service.test.ts—notifyTaskReviewerAssignedwrites the row + bell hint with no pref gate, skips self (2, red); attention summary filtersrequestedForin SQL, exact counts (2, red on the JS filter).collab/mention-directory.test.ts— a failed member/automation listing rejects (2, red: "promise resolved instead of rejecting"), healthy directory still resolves.Integration (
backend/integration-check.ts, newcheckTasksCollabIntegrity, 8 probes): foreign-door cancel refused 404 + own door cancels once with one ledger row; bulk → In review mints the gate the leave-to-done resolves (completed/approve); external close parks WITH the gate; agent-tool park run-keyed + settle replay finds it (1 row), workflow park mints an automation row; hard delete → children gone, agent run ledgeredcancelled, automation runcancelled, deliverable blob gone from MinIO via the release job, file row reaped; reviewer designation → bell + subscription +notificationhint, self silent, non-member 400; mention directory leg down →MENTION_DIRECTORY_UNAVAILABLE/503/agents; the caller's review found behind 120 other pending reviews with the exact count, org-wide and project-scoped.Verification (observed)
bunx tsc --noEmit(platform): clean after every seam.bun run --filter @tale/platform lint: exit 0.bunx vitest --run --project server --project pii: 72,736 tests pass; 3app/routes/*.test.tsxfiles fail to LOAD withDenied ID …@fontsource/inter…woff2?url— the known worktree + symlinkednode_modulessymptom, also on base, unrelated.backend:integrationon fresh throwaway tale-db + MinIO (SANDBOX_LLM_GATEWAY_ADMIN_PASSWORDset), branch: 387/387 checks passed, all 8 new probes PASS.Cross-class discoveries (not fixed here)
core/collab/notify_task_reviews.tsand most ofcore/tasks/review_shared.tsare dead Convex-shim code still compiled by the platform tsconfig; onlyREVIEW_POLICY_REFUSAL_CODESis live. Cleanup candidate./api/app/collab/attentionsummary has no caller underapp/that I could find; its unread counts are now exact instead of capped at 100 — worth confirming the badge consumer (if any) renders large counts.TaskErrornow admits status 409 (previously 400|403|404).