chore(plans): make kind=plan retirement consistent across MCP, REST, UI, skills
Audit of the plugin + MCP surface after milestone-as-plan (T3): every path that could still create a kind=plan task or describe the old plan-task model is now aligned with the hard-retire decision. - create_task (MCP + REST POST /api/tasks): reject kind=plan with a message pointing to start_planning. The 'plan' enum value stays valid so legacy plan-tasks remain readable; update paths never touch kind, so they round-trip. - create_task / get_task docstrings: 'plan' dropped from creatable kinds; get_task's rules-augmentation noted as legacy-only (get_milestone for new plans). - skills/writing-plans: rewritten for milestone-as-plan (body = design, steps = child tasks, get_milestone to read back). - skills/using-scribe: "plans live in milestones via start_planning", not kind=plan. - TaskEditorView Kind selector: offers Work/Issue; "Plan (legacy)" shown only when the loaded task is already kind=plan (display round-trip). - test: create_task rejects kind=plan. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -63,9 +63,10 @@ async def get_task(task_id: int) -> dict:
|
||||
"""Fetch a single Scribe task by ID.
|
||||
|
||||
Returns id, title, body, status, priority, tags, project_id, milestone_id,
|
||||
parent_id, parent_title, due_date, created_at, updated_at. For kind=plan
|
||||
tasks, the response also includes applicable_rules + subscribed_rulebooks
|
||||
from the task's project's rulebook subscriptions.
|
||||
parent_id, parent_title, due_date, created_at, updated_at. For legacy
|
||||
kind=plan tasks, the response also includes applicable_rules +
|
||||
subscribed_rulebooks from the task's project's rulebook subscriptions (new
|
||||
plans are milestones — use get_milestone for those).
|
||||
"""
|
||||
uid = current_user_id()
|
||||
note = await notes_svc.get_note(uid, task_id)
|
||||
@@ -79,6 +80,8 @@ async def get_task(task_id: int) -> dict:
|
||||
parent_title = parent.title
|
||||
data["parent_title"] = parent_title
|
||||
|
||||
# Legacy kind=plan tasks predate milestone-as-plan; still surface their
|
||||
# project's rules on read so the historical plans stay useful.
|
||||
if data.get("task_kind") == "plan" and note.project_id:
|
||||
applicable = await rulebooks_svc.get_applicable_rules(
|
||||
project_id=note.project_id, user_id=uid,
|
||||
@@ -116,15 +119,23 @@ async def create_task(
|
||||
milestone_id: Place within a project milestone (0 = no milestone).
|
||||
parent_id: Make this a sub-task of another task (0 = top-level).
|
||||
tags: List of plain-string tags without # prefix.
|
||||
kind: 'work' (default), 'plan', or 'issue'. An issue is corrective work —
|
||||
a problem you fixed or are fixing; record symptom → root cause → fix
|
||||
in the body. Prefer start_planning to create plans.
|
||||
kind: 'work' (default) or 'issue'. An issue is corrective work — a
|
||||
problem you fixed or are fixing; record symptom → root cause → fix
|
||||
in the body. (Plans are milestones now — call start_planning to begin
|
||||
a plan; 'plan' is not a valid kind here.)
|
||||
system_ids: Ids of the project's Systems (reusable subsystem/area
|
||||
objects; see list_systems / create_system) to associate this task with.
|
||||
arose_from_id: For an issue, the id of the task/feature it arose from
|
||||
(provenance). 0 = none.
|
||||
"""
|
||||
uid = current_user_id()
|
||||
if kind == "plan":
|
||||
raise ValueError(
|
||||
"kind=plan is retired — a plan is now a milestone. Call "
|
||||
"start_planning(project_id, title) to begin a plan (it creates the "
|
||||
"milestone + seeds the design), then create each step as its own "
|
||||
"task with create_task(milestone_id=<that milestone>)."
|
||||
)
|
||||
note = await notes_svc.create_note(
|
||||
uid,
|
||||
title=title,
|
||||
|
||||
@@ -99,6 +99,15 @@ async def create_task_route():
|
||||
description = data.get("description")
|
||||
tags = data.get("tags", [])
|
||||
|
||||
# kind=plan is retired — plans are milestones now (see start_planning).
|
||||
# The 'plan' enum value stays valid for legacy tasks, but new ones can't
|
||||
# be created with it through any path.
|
||||
if data.get("kind") == "plan":
|
||||
return jsonify({
|
||||
"error": "kind=plan is retired — plans are milestones. "
|
||||
"Use POST /api/tasks/planning to start a plan."
|
||||
}), 400
|
||||
|
||||
due_date = parse_iso_date(data.get("due_date"), "due_date")
|
||||
if isinstance(due_date, tuple):
|
||||
return due_date
|
||||
|
||||
Reference in New Issue
Block a user