Skip to content

Research tasks: reviews, audits, investigations ​

A third task kind next to build and ui_check (ADR-0018). Like ui_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 research task that investigates and ends with a report in the thread and in result.md.
  • The worker is read-only, so a research task cannot change anything anywhere.

Non-goals (out of scope)

  • Converting or migrating an existing build task created for a research request. The owner cancels it and asks again.
  • Turning findings into fixes. "Now fix it" is a new build task 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 research task that can reach Spec Review, Implementing, PR Open or Fixing.
  • A write to a repository, a push, a PR, or a GitHub comment from a research worker.

3. Decisions (owner, 2026-12-02) ​

QuestionDecision
KindNew research kind in TaskKindSchema
StagesIntake -> 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
AccessRead-only: the repository (optional), WebSearch/WebFetch, the owner's read-only connectors (ADR-0027)
OutputA report, as the result card in the thread and as result.md. No spec.md
Follow-upsQuestions in the thread go to the same worker session
Limits and modelAs for other tasks

4. How it works ​

4.1 Routing ​

The dispatcher table gets one row and one clarification.

Owner messageDo
A short question the dispatcher can answer itselfreply 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 codecreate_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 ​

KindAllowed
build, ui_checkunchanged
researchIntake -> 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/Write in the repository, no commit, no push, no repo checks, no PR, no GitHub comments (the gh pr comment/review deny rules of ui_check apply here too). The only file it writes is result.md in the artifacts directory.
  • Run context carries taskKind: research so 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 store build; research shall be an accepted value alongside build and ui_check.
  • RT-2. When a research task is in Intake, the system shall allow Context and refuse every other non-exit stage.
  • RT-3. When a research task is in Context, the system shall allow Done and refuse Spec Review, Implementing, Verifying, Reviewing, PR Open and Fixing.
  • RT-4. When a build task calls report_stage Done from Context, 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_task with kind: "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 build task.
  • RT-8. When create_task for a research task names no repository, the system shall create the task and start the worker with no worktree.
  • RT-9. When create_task for 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 research task 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_pr and start_dev_server shall be refused.
  • RT-11. When a research worker finishes, the thread shall hold a post_update result card with the report, the artifacts shall hold result.md, and the task shall be Done.
  • RT-12. While a research task exists, the system shall write no spec.md for 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 research task, the system shall deliver the message to the same worker session, in any non-terminal stage and after Done, 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_owner before acting on it.
  • RT-16. When the task panel, page or stage segments render a research task, they shall show only Intake, Context, Done and 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 build task 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 research with the PR as context; a UI check of a PR stays ui_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 build task; the dispatcher links the result.md of the research task as context.
  • The owner cancels mid-run. Cancelled as for other kinds; a partial result.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 ​

  1. A Done research task stays resumable by a follow-up as long as its session exists, as for other kinds.
  2. research gets a section in agent/prompts/worker.md; split it into its own prompt only if it outgrows a page.
  3. The UI labels the Context stage of a research task Researching; the stored stage stays Context.

8. Interactions and contracts ​

  • shared/src/enums.ts: TaskKindSchema gains research.
  • engine/src/domain/task.ts: a transition table for research, selected by transitionsOf.
  • agent/prompts/dispatcher.md: the routing row of 4.1. agent/prompts/worker.md: a section for taskKind: 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).