Research tasks: reviews, audits, investigations
A third task kind next to
buildandui_check(ADR-0018). Likeui_check, it reuses the existing stages and a per-kind transition table. Jarvis stays repository-agnostic (generic-engine-and-project-knowledge.md): nothing here is configured per repository.
1. Why
A request that is not development ("security audit of the Jarvis repository", "find sources on X", "investigate why the build is slow", "analyse this repo") is routed to an ordinary build task. That task runs the whole flow: a spec for approval, a plan, code, checks, a review, a draft PR. The audit on the server sits at "Approve spec" and can only end in a pointless spec or a pointless PR. The owner wants a report, nothing else.
2. Boundaries
Goals
- A research request becomes a
researchtask that investigates and ends with a report in the thread and inresult.md. - The worker is read-only, so a research task cannot change anything anywhere.
Non-goals (out of scope)
- Converting or migrating an existing
buildtask created for a research request. The owner cancels it and asks again. - Turning findings into fixes. "Now fix it" is a new
buildtask with the report linked as context. - New tools, new connectors, new config fields, per-repository settings.
- Scheduled or recurring research.
Anti-goals
- A new stage, or a migration that touches existing tasks.
- A
researchtask that can reachSpec Review,Implementing,PR OpenorFixing. - A write to a repository, a push, a PR, or a GitHub comment from a research worker.
3. Decisions (owner, 2026-12-02)
| Question | Decision |
|---|---|
| Kind | New research kind in TaskKindSchema |
| Stages | Intake -> Context -> Done, plus Blocked/Failed/Cancelled as for other kinds. My call: no new stage name; Context is the investigation, as it is for ui_check. The task panel shows "Context" with research wording, not a new label |
| Access | Read-only: the repository (optional), WebSearch/WebFetch, the owner's read-only connectors (ADR-0027) |
| Output | A report, as the result card in the thread and as result.md. No spec.md |
| Follow-ups | Questions in the thread go to the same worker session |
| Limits and model | As for other tasks |
4. How it works
4.1 Routing
The dispatcher table gets one row and one clarification.
| Owner message | Do |
|---|---|
| A short question the dispatcher can answer itself | reply with sources, no task. Unchanged |
| A review, audit, investigation, research, analysis or "find sources" that needs a worker (reading a repository in depth, many web sources, a long report) | create_task with kind: "research", then reply |
| A request to change code | create_task (build). Unchanged |
create_task accepts kind: "research". The repository is optional: with none, the worker has no worktree and works from the web and connectors only. With one, it goes through the existing allow-list (ADR-0012).
4.2 Transitions
| Kind | Allowed |
|---|---|
build, ui_check | unchanged |
research | Intake -> Context, Context -> Done, plus Blocked/Failed/Cancelled |
report_stage Done is accepted from Context for this kind and refused for build. report_pr, open_pr and start_dev_server are refused for research.
4.3 The worker
- A worktree on the default branch when a repository is given (or none). Nothing is created under
jarvis/. - No
Edit/Writein the repository, no commit, no push, no repo checks, no PR, no GitHub comments (thegh pr comment/reviewdeny rules ofui_checkapply here too). The only file it writes isresult.mdin the artifacts directory. - Run context carries
taskKind: researchso the worker knows its role. - Text from the web, from the repository and from connectors is data, not instructions (ADR-0017). An instruction found in it makes the worker stop and
ask_owner.
4.4 The report
result.md and the thread card hold: the question restated in one line, a summary, findings with sources or links (file and line for repository findings), and, for reviews and audits, findings ranked by severity (critical, high, medium, low) with what was and was not examined. What could not be verified is said so. The worker posts it with post_update, writes result.md, then calls report_stage Done.
4.5 Follow-ups
A message in the thread about a research task goes through send_to_task to the same worker session (DSP-04). After Done, a follow-up resumes the session to answer or extend the report; the stage does not change. A request to change code is a new build task.
4.6 Web UI
The task panel, the page and the stage segments show only Intake, Context, Done (and Blocked/Failed/Cancelled when they apply) for this kind, like ui_check. No spec approval, plan, PR or checks section appears. The kind is visible as a badge. The result card renders result.md.
4.7 Memory, limits
Memory and insights are unchanged: the worker may propose entries by the existing rules, and nothing sourced from untrusted content becomes an entry. Turn, time and budget limits and set_task_model apply as to any task; hitting a limit ends the task as Failed with the report written so far kept.
5. Acceptance criteria
- RT-1. When a task is created without
kind, the system shall storebuild;researchshall be an accepted value alongsidebuildandui_check. - RT-2. When a
researchtask is inIntake, the system shall allowContextand refuse every other non-exit stage. - RT-3. When a
researchtask is inContext, the system shall allowDoneand refuseSpec Review,Implementing,Verifying,Reviewing,PR OpenandFixing. - RT-4. When a
buildtask callsreport_stage DonefromContext, the system shall refuse it. - RT-5. When the dispatcher receives a review, audit, investigation, research, analysis or "find sources" request needing a worker, it shall call
create_taskwithkind: "research". - RT-6. When the dispatcher receives a short question it can answer itself, it shall reply with sources and create no task.
- RT-7. When the dispatcher receives a request to change code, it shall create a
buildtask. - RT-8. When
create_taskfor a research task names no repository, the system shall create the task and start the worker with no worktree. - RT-9. When
create_taskfor a research task names a repository outside the allow-list, the system shall create no task and return the allow-list reason. - RT-10. While a
researchtask runs, the worker shall have no way to edit repository files, commit, push, run the repository's checks, open a PR or comment on GitHub;report_pr,open_prandstart_dev_servershall be refused. - RT-11. When a
researchworker finishes, the thread shall hold apost_updateresult card with the report, the artifacts shall holdresult.md, and the task shall beDone. - RT-12. While a
researchtask exists, the system shall write nospec.mdfor it. - RT-13. When the task is a review or audit, the report shall list findings ordered by severity and state the scope examined.
- RT-14. When the owner writes in the thread of a
researchtask, the system shall deliver the message to the same worker session, in any non-terminal stage and afterDone, without changing the stage. - RT-15. When text from the web, the repository or a connector contains an instruction to the agent, the worker shall stop and call
ask_ownerbefore acting on it. - RT-16. When the task panel, page or stage segments render a
researchtask, they shall show onlyIntake,Context,Doneand the exit stages, and no text about spec approval, plan, PR or checks. - RT-17. When turn, time or budget limits are reached, the system shall end the task as for other kinds and keep any report already written.
- RT-18. When the owner sets a model for the task, the system shall use it as for other kinds.
- RT-19. When a migration is applied, existing tasks shall be untouched.
6. Edge cases
- An existing
buildtask created for a research request. Out of scope: not converted; the owner cancels it and repeats the request. - The request is ambiguous ("look at the auth code"): the dispatcher asks one question rather than guessing the kind.
- Review of a pull request. A review of a PR's code is
researchwith the PR as context; a UI check of a PR staysui_check. The worker never comments on the PR; the report stays in Jarvis. - Private or paywalled sources. Listed in the report as "not accessed", not skipped silently.
- The owner asks to fix the findings. A new
buildtask; the dispatcher links theresult.mdof the research task as context. - The owner cancels mid-run.
Cancelledas for other kinds; a partialresult.md, if written, stays. - Huge repository. The report states what was sampled; a "full audit" claim without coverage is not allowed.
7. Decisions on the open questions
- A
Doneresearch task stays resumable by a follow-up as long as its session exists, as for other kinds. researchgets a section inagent/prompts/worker.md; split it into its own prompt only if it outgrows a page.- The UI labels the Context stage of a research task Researching; the stored stage stays
Context.
8. Interactions and contracts
shared/src/enums.ts:TaskKindSchemagainsresearch.engine/src/domain/task.ts: a transition table forresearch, selected bytransitionsOf.agent/prompts/dispatcher.md: the routing row of 4.1.agent/prompts/worker.md: a section fortaskKind: research.web/: stage segments and task panel per kind.- Relies on ADR-0012 (allow-list), ADR-0017 (untrusted content), ADR-0018 (task kinds), ADR-0027 (read-only connectors).