Allow retyping a plan via the API - #186
Merged
Merged
Conversation
PATCH /api/v1/plans/:id now accepts plan_type (a type name, resolved case-insensitively like create; unknown or blank names 422 with the valid list). A retype logs the already-defined-but-never-emitted plan_type_changed event, adopts the new type's default_tags (union — existing tags are never removed) with tag_added events, and the instructions document the Scratchpad-graduation use: retype when a plan outgrows its type, then restructure against the new template. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
HamptonMakes
commented
Aug 19, 2026
| else | ||
| "plan_type cannot be blank — every plan has a type." | ||
| end | ||
| message += " Available types: #{available.map { |n| "\"#{n}\"" }.join(", ")}." if available.any? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plans could be typed at creation (#182) but never retyped — not via the API, and the web UI doesn't do it either (
plan_type_changedexisted in the PlanEvent vocabulary with no emitter). That blocks the intended lifecycle where a Scratchpad graduates into a real document type.Changes
PATCH /api/v1/plans/:idacceptsplan_type(type name, case-insensitive — resolution extracted intoresolve_plan_type_param, shared with create). Unknown or blank names return a 422 listing the valid types.plan_type_changed(before/after names, full agent attribution) and adopts the new type'sdefault_tagsas a union — existing tags are never removed — withtag_addedevents for anything gained.plan_typeadded to Update Plan's allowed fields, plus a Plan Types guideline telling agents to retype plans that outgrow their type and restructure against the new template in the same session.🤖 Generated with Claude Code