--- brief: 2 convoy: second-brain-os-v01 role: role-implementer title: Worker non-code — optional worktree + per-harness allowlist + doc_review→published status: ready priority: P0 slice_dependencies: [] recommended_model: qwen-coder model_tier: local --- # Brief 2 — Worker non-code (1d) ## Goal `book/course/research/SOPs` docs don't need git worktree or `pnpm`. Worker must handle doc tasks writing straight to `docs/`/`plans/` no branch, with allowlist per harness. ## Files - `apps/worker/src/git/worktree.ts:1` — add `needsWorktree: boolean` param; when false skip `ensureWorktree`, use `monorepoRoot` directly. Keep existing path for code briefs `job.briefId` present. - `apps/worker/src/tools/allowlist.ts:1` — make `allowlist` configurable per harness `harness.config.allowedCommands` (or `minimal: [read,write,grep]` only). Pass `allowedCommands` into `runCommandTool`. - `packages/shared/src/convoy-lifecycle/state-machine.ts:1` — add `doc_review → published` transition (mirror `pr_review → merged`), allow `human-gate-2` analogue `doc-approver`. - `apps/worker/src/handle-job.ts:40` — thread `harness.needsWorktree` + `harness.allowlist` through; log `harnessAlias` to `convoy_events`. - `docs/worker.md:1` document optional worktree. ## Acceptance - `Task-write-manifesto.md` (doc task) with `harness: doc-writer` creates `docs/manifesto.md` via `write_file` tool without worktree directory under `/tmp/echodo-worker-worktrees`. - Code task `Task-fix-lint` still creates worktree per prior behavior. - `transition_convoy_status` `doc_review → published` succeeds; existing `pr_review → merged` still works. - `pnpm lint && pnpm type-check && pnpm --filter @tasks/worker test` pass. ## Prompt You are `role-implementer` brief 2. Read `docs/convoy-lifecycle.md`, `packages/shared/src/convoy-lifecycle/state-machine.ts`, `apps/worker/src/handle-job.ts`, `docs/decisions/2026-08-25-second-brain-os-pivot.md`. Implement small, gated. ## Depends None — can run in parallel with brief 1.