Repository navigation
feat(platform): let members create tasks and work their own - #3810
Merged
Merged
Conversation
Customers asked to hand document work to project agents, and a Member could not even create the task: every task write sat behind the Editor role (assertTaskWritable over EDITOR_ROLES). One rule now decides it, in backend/core/tasks/access.ts, a pure module the app imports as well: every member who can read an active project creates tasks in it; editors work every task; any other reader works the tasks they created (created_by, created_by_type 'user') or are the person assignee of. The service enforces it through assertTaskCreatable and assertTaskWorkable at every task door: create (a subtask also needs its parent to be workable), edit, status and the review decision, board move, assign, archive and restore, the manual agent start, the live-run cancel, the workflow start and cancel, repeat stop, dependencies (judged on the blocked task, whose record the edge is), and comment edit and delete. The @mention dispatchers use the non-throwing mayWorkTask, so a member's mention on their own task puts the agent to work while one on someone else's task stays a plain mention, and the composer preview says so with a new not_permitted reason. Everything around the tasks stays with editors: the label catalog (assertTaskLabelsEditable), project settings, agents and files. Deleting stays with owners and admins: a delete retires the whole subtree with other people's comments and files, and editors cannot delete either, so the task's own member archives it instead. The external-issue intake was read-gated only: it created tasks in an archived project, reconciled any task its reference named (across projects under the organization-wide dedupe), and minted labels for every member. It now checks the create gate first, the work gate for the task a repeat reconciles, and mints labels for editors only. Board and task reads answer canCreate beside canEdit, so the app decides each task with the same function. Agent runs a member starts are booked to that member, as the run-starter rule already did.
The /api/v1 task doors followed the same Editor-only rule the app did: a Member's key answered 403 on the intake, the archive toggle, the workflow start and the review relay. They now apply the task rule too. The intake creates a task for every key holder who can read an active project; a repeat reconciles the task its reference names, so it takes that task's work gate. The archive toggle, the start and the review relay (for the key holder and for the member it acts for) take the work gate: an editor of the project, or the member who created the task or is its person assignee; anyone else still gets 403 RBAC_FORBIDDEN, ACTOR_FORBIDDEN for the actor. The intake of a key holder who is not the project's editor creates no label: a name the catalog lacks answers 400 TASK_LABEL_UNKNOWN, which moves from the app-only list into the REST registry. The contract moves to 3.6.0 with its notes, the OpenAPI descriptions say who may do what, and the real-Postgres scope proof now expects a member's intake to succeed while a start on someone else's task stays refused. The repo contract's delete-over-REST ledger entry names the new gate.
The board, the list, the task dialog and the task page decided every control on the project's canEdit, so a Member saw no Create task and could not change even a task they created. One client mirror now decides it: useTaskAccess feeds the server's own canWorkTask (backend/core/tasks/access.ts) the board or task read's canEdit and canCreate flags and the signed-in person. The Tasks page offers Create task to every reader of an active project; cards and list rows take a canWorkTask decision for drag and the inline pickers; the dialog and the page make a task editable, with Start agent, steer, stop, the assignee and reviewer pickers, status and Archive, when the viewer may work it, and read-only otherwise. Comment edit and delete follow the same gate the server holds them to, dependencies offer only the tasks the viewer may mark as blocked, and the mention chips say when an agent won't respond because the task is someone else's (new tasks.mentionPreview.notPermitted in en, de and fr). The label catalog and project files stay with editors: the label picker seeds defaults and offers Create only to them, Manage labels is theirs, the bound folder's input files stay read-only for others, and subject templates whose create writes project files (a folder input or required settings) are offered to editors only.
Members may now create tasks in any project they can open and work the tasks they created or are assigned to, including putting project agents on them; the guides still said every task change needed the Editor role. The tasks guide gains a "Who can create and change tasks" section (what a Member can do on their own tasks, what stays with editors, why a member archives rather than deletes, and that handing on a task assigned to you hands on the right to change it). The role table, the Member overview (with a short hand-off-to-an-agent walkthrough), the project agent and task automation guides, the skills and chat pages, the member quick start, the script guide and the REST reference (contract 3.6.0, TASK_LABEL_UNKNOWN) say the same thing, in English, German and French.
A member creates a task in a project they can read (TASK-F48), puts a project agent on it and closes it, with the run's spend counted on their own usage (TASK-F49), cannot change someone else's task, where the mention chip says the agent won't respond (TASK-B25), and cannot create in a team project they cannot see (TASK-B26). The tasks suite's cost moves to 90 boxes; the automation register names the unit, route and component suites that own the rule; PROJ-B9 no longer calls the Member role read-only.
The unit, route and component suites own the rule's server and app halves; the running app, a real agent run and the bell stay with the member boxes, so the register row reads partially automated and says so.
The parametrized case read "edits a task they is assigned to".
A project agent's tools, secrets and GitHub token answered to its session binding alone, so a run a member started could change other people's tasks, mint labels, sync issues, write project documents and read the agent's secrets, and it shared the agent's workspace with the runs editors start. What a run may do now follows the person who started it (domains/tasks/run-authority.ts). A run whose starter may not edit the project is confined: - The tool door reads the live run from the exec every task turn's token now names. The task tools act only on the run's own task and the subtasks under it, create subtasks only there and with existing labels, refuse external-ref syncs and document_create, and answer a member_run blocker that says what an editor would have to do. - The turn host resolves no agent secrets and no brokered GitHub token for it, at launch and at a steer restart, and tells the agent which credentials were held back and why. - It works in a workspace of its own per agent and member, chosen at kick, so nothing it leaves behind reaches a later editor's run and it never shares a container (or its processes' environment) with one. A run in a member's workspace stays confined whoever steers it later; everything else is judged against the starter's rights at the moment of asking. - A steer that restarts a turn books the run to the person who steered it. The session lookup finds a project agent's row by session id, and the one-live-session cap counts per workspace; the release guard stays the agent's, so a live turn holds every workspace the agent owns.
TASK_LABEL_UNKNOWN reaches the members who may create tasks but not grow the project's label catalog, and the message told them to type the name in the picker to create the label, which they cannot. It now asks for a label the project already has and says who adds new ones, in English, German and French.
Review findings on the member task rule, fixed at the server doors: - Automations: a member could start almost any deployed automation on their task (app and REST start, a review's request for changes, both intakes), and it runs as itself — the organization's credentials, no approvals, in any project when unbound. A member now names only an automation built for tasks (its deployed version declares a task contract) or the one that owns the task; the same rule holds when a member assigns a task to an automation, which would otherwise make it the owner. The task natives a member's run reaches (task.upsert, upsert_issues, list_external_issues) apply the starter's own task rights instead of refusing everyone but editors halfway through a run. - The live run's starter may stop and steer it, even once the task is no longer theirs (an @mention hands an assigned task to the agent). - Stop repeating reaches only the task named and the later copies the caller may work; the copies before it keep what they say. - Work rights run down the subtask tree, so subtasks an agent or an editor adds under a member's task never keep it from closing. - A comment's author edits and deletes it with the read access posting it took; an admin still moderates anyone's. - The app's workflow start judges the task in the transaction that starts the run and refuses an archived task, as REST does. - Picking a subject someone else created opens that task instead of answering 403. - The review gate's comment separates who is sent a review (editors) from who may decide it (whoever may work the task, under the review policy). The REST contract stays at 3.6.0; its notes and the OpenAPI descriptions name the automation rule.
The app mirrors the server's task rule, so its controls follow the review fixes: - Work rights run down the subtask tree: the board looks a subtask's parents up among its loaded cards, and the task sheet gets the owners up the tree with the task read (`ancestors`). - The run card offers Stop to the person who started the live run, even on a task no longer theirs; the card read now names the run's starter. - A comment's author edits and deletes it wherever they can comment; an admin's delete of someone else's still needs the task's work gate. - The Blocks group follows the task it marks: on someone else's task a member may record that it blocks one of their own.
Knip flagged four helpers exported for no caller outside their module: the automation-for-tasks checks, the starter's edit check and the subtask-tree read. Only their callers' seams stay exported.
The org-data find tools (contact, product, website and knowledge-entry finds) ask the same session door as the task tools but did not pass the run the turn's token names. A run in a member's workspace then read as a run that had ended and lost the reads it keeps: the door answers for a live run only, so every tool that asks it names the run.
…he task A steer that reaches a run which settled meanwhile becomes a fresh mention run. The live run's starter may steer it on a task that is no longer theirs, but a new run is a change to the task, so the fallback now kicks only for an author who may work it; the comment stays in the discussion otherwise.
Members' runs keep to their task, run without the agent's secrets or GitHub token in a workspace of their own, and can be stopped and steered by the member who started them; the task, automation and agent pages say so in English, German and French.
The member tutorial walked a Member through creating a project, uploading its files and saving its instructions, all of which need the Editor role. It now says so and sends a Member to the chat step.
…asks # Conflicts: # docs/de/platform/chat/basics.md # docs/en/platform/chat/basics.md # docs/fr/platform/chat/basics.md # services/platform/backend/core/node_only/sandbox/workspace_tools_bridge.ts # services/platform/backend/core/tasks/agent_run_host.ts # services/platform/backend/domains/sandbox/dispatch-routes.ts # services/platform/backend/domains/sandbox/sessions.ts # services/platform/tests/manual/reference/automation.md # services/platform/tests/manual/suites/tasks.md
yannickmonney
added a commit
that referenced
this pull request
Sep 29, 2026
…d-values Main's #3810 took TASK-F50 for its member box, so this branch's history box becomes TASK-F51 (suite box and automation register row); the suite's Cost is 93.
This was referenced Sep 29, 2026
This was referenced Sep 29, 2026
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.
Summary
Customer feedback: teams want to hand document work to project agents, and Members could not, because every task write needed the Editor role. This PR implements the decision that Members may create tasks and work their own.
One rule decides it, in
services/platform/backend/core/tasks/access.ts, a pure module the server enforces at every task door and the app imports as its client-side mirror:created_by= them,created_by_type=user) or they are its person assignee. On their own tasks a Member edits the fields and attachments, assigns (to themselves, another project member, an agent or an automation), starts, steers and stops the agent (including by @mention), moves the status and decides the review (moving to Done), sets or stops repeating, adds subtasks, marks the task as blocked, and archives or restores it.Doors that now use the rule (
assertTaskCreatable,assertTaskWorkable, the non-throwingmayWorkTask):backend/domains/tasks/service.ts,routes.ts): create (a subtask also needs its parent to be workable), edit, status, board move, assign, archive, restore, delete (then still owner/admin), dependencies (judged on the blocked task), manual agent start, live-run cancel, workflow start and cancel, and the external-issue intake (create gate, work gate on the task a repeat reconciles, labels minted for editors only). The label catalog verbs useassertTaskLabelsEditable(editors only).comments.ts: comment edit and delete; the owning-automation @mention trigger.service.ts: the agent @mention dispatcher (comment and description) and the composer's mention preview, which answers a newnot_permittedreason.repeat.ts: stop repeating.backend/rest/v1-tasks.ts): intake (create for every reader of an active project; a repeat takes the work gate; labels minted for editors only, otherwise 400TASK_LABEL_UNKNOWN), the archive toggle, the start, and the review relay (for the key holder and for the actor). Contract 3.6.0 with a contract-notes entry, OpenAPI descriptions updated, fingerprint andpublic/openapi.jsonregenerated.connectors/task-store.ts(the issue-sync natives create and update many tasks by external reference, including other people's, so it is project-level sync) andautomations/dispatch-store.ts(it gates automation runs in a project, not a task door).Spend: agent runs a Member starts are booked under that Member through the existing
project_agent_runs.started_byrule (verified, unchanged); budgets and thetask_automationswitch still apply.UI (
services/platform/app):useTaskAccessfeeds the sharedcanWorkTaskwith the read'scanEdit/canCreateflags (new on board and task reads) and the signed-in person. Create task shows for every reader of an active project; cards and rows get a per-task decision for drag and inline pickers; the task dialog and the task page are editable (Start agent, steer, stop, assignee, reviewer, status, Archive) only when the viewer may work the task. Comment edit/delete, dependencies and the mention chips follow the same rule; the label catalog, bound input files and project-file-writing subject templates stay editor-only.Docs (EN/DE/FR): a new "Who can create and change tasks" section in the tasks guide, plus the role table, the Member overview (with a hand-off-to-an-agent walkthrough), project agents, task automation, skills, chat basics, the member quick start, the script guide and the REST reference. Manual boxes TASK-F48, TASK-F49, TASK-B25, TASK-B26 (tasks suite cost 90) and a row in the automation register.
Deviations from the brief, and why
deleteTaskis owner/admin only because it retires the whole subtree with other people's comments, subtasks and files. Letting Members delete would give them more than Editors. Members (like Editors) archive and restore instead; the docs say so.TASK_LABEL_UNKNOWN, which moved from the app-only list into the REST registry).POST /api/app/tasks/from-external-issue) was read-gated only. It created tasks in archived projects, reconciled any task its reference named (across projects under the organization-wide dedupe) and minted labels for every member. It now uses the create gate and the work gate like every other door.Findings outside this change (not fixed here)
docs/*/tutorials/member/use-projects.mdsays the Member role can create a project; the server requires Editor or higher (assertCanCreateProjects).task_update_status,task_create, …) acts with that equipment whoever starts it, so a Member who starts such an agent directs tools an Editor granted. That is the existing "equipment is the grant" model; worth a product look.Checklist
bun run checkpasses (format, lint, typecheck, all tests). Not green on this machine, for reasons outside this PR: I ran it on the branch; the format check, every workspace's lint (0 warnings) and typecheck passed, and turbo stopped at@tale/sandbox-runtime-daemon#test, whosefile-ops > stageFiles gives up on a stalled URL within its deadlineandrunnerd HTTP service > a partial exec request body already protects the runtime from release and reclaimfail the same way when that suite runs alone, although this PR touches nothing in that workspace. Two platform UI files (providers-settings,enterprise-sso-form) timed out under the parallel load and pass when rerun. The platform server and UI projects, which the gate cut short, were run whole on their own (see the test plan).bun run lint:sastpasses (Opengrep) — run on every changed TypeScript file (0 findings); the pre-commit hook ran it on each commit.messages/{en,de,fr}.ymlcatalogs — one new key,tasks.mentionPreview.notPermitted, in en, de and fr; node-CHoverride needed (no ß).docs/{en,de,fr}/for any user-visible change.README.md/README.de.md/README.fr.mdupdated — N/A: the READMEs do not describe roles or task permissions.Test plan
What was run (all green):
backend/domains/tasks/service.member-work.test.ts(a Member creates a task, including straight at In progress for an agent with the run booked to them; is refused in an archived project and in a team project they cannot see; adds subtasks only under their own tasks; edits, moves to Done with the review approved in their name, starts the agent, assigns it, puts it to work with an @mention, archives; is refused on someone else's task and their mention stays plain; cannot delete; the mention preview answersnot_permitted; editors unchanged),backend/domains/tasks/routes.intake-access.test.ts(the app intake's create gate, reconcile gate and label minting),backend/rest/v1-tasks.test.tsandv1-tasks.review.test.ts(member intake 201, repeat on someone else's task 403, own start and archive 200, review relay for a member on their own task, ACTOR_FORBIDDEN otherwise).backend/domains/tasks/service.test.tsnow pins the new rule instead of "a read-only member can read but never write";backend/core/tasks/access.test.tspins the pure rule. Checked against main by checking out main's versions of the touched sources and running the new suites: 23 new server cases (13 service, 3 intake, 7 REST) and 6 new UI cases fail there.bunx vitest --run --project server backend lib scripts): 880 files, 11,780 tests.bun run --filter @tale/platform test:ui): 515 files, 4,415 tests, including the newtasks-workspace.test.tsx(Create task and per-card decisions for a Member, an editor and an archived project) andtask-modal.access.test.tsx(own task editable, someone else's read-only, label catalog controls editor-only). Browser tests for the touched components (tasks-list,task-modal,page-skeletons): 46 tests.bunx tsc --noEmit -p .(platform), type-aware oxlint on every touched file,bunx knip --no-progress,oxfmt --check, the OpenAPI and error-code guards, the platform i18n suite, the docs suite (services/docs: 200 tests),bun run lint:manual, andcheck-guide.tson the tasks and projects suites.Not verified:
backend/integration-check.ts(labels updated) andbackend/rest/project-scope-check.ts(now expects a member's intake to succeed and a start on someone else's task to stay refused) needbun run --filter @tale/platform backend:integration.startedByis the member), not on a ledger row.Reviewer spot checks: sign in as a Member, create a task on an org-wide project's board, assign a project agent, Start agent, then move the task to Done; open a task an Editor created and confirm it is read-only while commenting still works; try
POST /api/v1/projects/{id}/taskswith a Member's key.