refactor(wire,features,database,service,host,desktop): free the name "task": a coding agent's prompt, an ask's revision, and the inbox's to-do (LUKE-369 1/7)

Merged
CH
5d ago
+362-199

Summary

LUKE-369, PR 1 of 6: rename the product concept "plan" to "task". This PR frees the word first. "Task" is about to name the unit of work that a plan is today, so the three other things the code called a task get their own names. The wire and stored values don't change.

  • A coding agent's prompt. An agent started on the developer's own words is handed a prompt:
    • CodingAgent.task, CodingAgentBriefText, StartPlace, the draft (AgentDraft.prompt, startPrompt), the act payload, and the automation run's words (automationPrompt) are all renamed.
    • The coding_agent.task column keeps its SQL name (prompt: text("task")) until PR 6 renames the columns.
    • CODING_AGENT_BRIEF.TASK becomes PROMPT. Its value stays "task", because released desktops decode it.
    • The Start request's key stays task on the wire. The new wireKeys maps it to prompt at the edge (below).
    • start_coding_agent's model input keeps its task key. The model-facing wording is PR 2's.
  • An ask's revision. asks.taskRevision becomes askRevision in TypeScript. The column follows in PR 6.
  • The inbox's to-do. INBOX_RESPONSE.TASK becomes TODO. Its value stays "task" because stored items, the model's enum, and released desktops all use that spelling. The orchestrator agreed to this. PR 2 rewords the prose around it.
  • wireKeys (@luke/wire/effect): a struct key that reads in code under one name and travels under the wire's name. Effect's own encodeKeys encodes each field through toEncoded, which drops every bound from the emitted JSON Schema, so the wire golden would have changed. wireKeys keeps the real fields on the wire side and decodes to toType(self), so the golden stays byte-identical. PRs 4 and 5 will use it for planId → taskId.

What did not change, and why

  • eve's task_wait / task_cancel, its taskId, and its subagent tasks. The plan asked for ask_wait / ask_cancel, but eve 0.74.0 hardcodes these names (eve/dist/src/protocol/task-tools.js) and dispatches on them. Its receipts ("Started task ") and <task_result> messages use the same word. Renaming them on our side would break delegation. The orchestrator agreed to leave them, with a note at each constant (EVE_TOOL, EVE_DELEGATION_TOOL, CODER_TASK_TOOL, CHILD_TASK, the scripted model) that they are eve's subagent tasks, not a Luke task. So the planned test for a stored task_wait still rendering has nothing new to prove. The existing tool-call-model.test.ts case still covers it.
  • Model-facing prose is left for PR 2, and user-facing copy and docs for PR 3.

Evidence

  • pnpm check:affected: exit 0.
  • New test coding-agent-client.test.ts: "a Start's prompt travels under the key a released service reads, task, trimmed as it is bounded". It fails without the mapping, because the body would carry prompt.
  • New test packages/wire/src/effect/json-schema.test.ts: wireKeys reads and writes the wire's key, refuses the code's key, keeps the bounds, and emits the wire's keys with every field's bounds.
  • coding-agents-app.test.ts still posts task over HTTP and reads the agent's mentioned servers off it, which shows the service reads the released key.

Invariants

  • ./scripts/check.sh green. (CI)
  • JSON Schema goldens. Every hosted wire golden is unchanged, coding-agent-wire-codingAgentStartRequestSchema.json included. One golden was re-recorded with LUKE_UPDATE_FIXTURES=1: coding-agent-view-codingAgentStartParamsSchema.json, where "task" becomes "prompt". That is the renderer-to-host act payload and the in-process gateway's parameters, which are one build on both sides, so no released desktop reads it.
  • Every behavior change has its test in this PR: the wire mapping and wireKeys. The rest is renaming.
  • Gateway envelope goldens unchanged.
  • No as beyond two SAFETY-commented single assertions in wireKeys. as unknown as is refused by anti-slop, and this uses none.
  • No Effect.run* outside the edges.
  • No new raw async primitives.
  • No discarded Effect.
  • Test count: +3 (one client test, two wireKeys tests).
  • No hand-rolled file replaced.
  • No CLAUDE.md/AGENTS.md sentence names a renamed part. Docs are PR 3's.
  • PRIVACY.md unchanged.
  • Deps unchanged.
  • Barrel/door rule unaffected.

Notes

  • Stack: 1/6 (free "task") → 2/6 model prose → 3/6 copy and docs → 4/6 package identifiers → 5/6 app identifiers → 6/6 database.

🤖 Generated with Claude Code


Summary by cubic

Reserves the name "task" for what a plan is about to become (LUKE-369, first step): the developer's own words a coding agent is started on are now a prompt, a spoken ask's taskRevision is askRevision, and the inbox's INBOX_RESPONSE.TASK is TODO. Nothing changes on the wire or in storage, so released desktops and stored rows are unaffected.

Wire compatibility

  • The Start request's task key, the coding agent brief's "task" value, the inbox's stored "task" value, and the task_revision column keep their old names; the columns are renamed later in the series.
  • Reads the wire's task into prompt via a new wireKeys struct mapping in @luke/wire/effect, which preserves each field's bounds in the emitted JSON Schema, so the hosted golden is unchanged; a mapping that would put two fields under one wire key is refused at declaration.
  • eve's own task_wait/task_cancel tools and subagent taskIds keep their names and are now documented as eve's subagent tasks, not a Luke task.