Skip to content

Show a rejected plan as a plan to fix, not a platform fault (APT-1094) - #35

Merged
reoring merged 5 commits into
mainfrom
fix/apt-1094-plan-validation-rejection
Nov 15, 2026
Merged

reoring merged 5 commits into
mainfrom
fix/apt-1094-plan-validation-rejection

Conversation

@reoring

@reoring reoring commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

朝の 5 行(森さん向け)

  1. 何が変わるか: 作成の計画が Platform に断られたとき、意味の分かっている断り(作成先、欄の不備、テンプレートの直接の指定、名前の重複)だけを「計画を直す」失敗として見せる。理由の分からない断りは、これまでどおり「基盤の問題 + 問い合わせ番号」のまま、操作を 2 つ出す:「もう一度確かめる」(同じ計画を 1 回だけ検証し直す。通っても、作成には進まない。承認できる状態に戻るだけで、「この内容で作る」を押すまで何も作らない)と「計画を作り直す」。
  2. 届いたときに見える変化・止まるもの: 作成先が未設定・変わった・使えない、などの断りが、理由と次の操作つきで出る。断られた計画を、同じ中身のまま、自動で検証・実行し直さない。新しい方式(console-v1)の作成の失敗の知らせには、どの失敗でも、問い合わせ番号と、畳んだ「詳しい人向け」の文面が出るようになる。止まるものは無い。
  3. 決めてほしい点と推奨: マージするか → 推奨: マージ(Console 0.5.9)。
  4. 独立レビュー: 1 回目(8461c09)「マージしてよい。後続つき」→ 案 A で直した(546b269)→ 2 回目「変更が要る」(確かめ直しの依頼が失敗すると、断られた記録が消える)→ 直した(682e87c。あわせて、確かめ直しは作成に進まない / 古くなった計画には出さない)。3 回目(682e87c)「マージしてよい。後続つき」、止める指摘 0 件 → 利用者に見える小さな 3 点(名前の選び直しが出ない / 実行できないときに押すと知らせが消える / 通っても何も言わない)を直した(cd87ecc)。最後の差分の確認(cd87ecc)も「マージしてよい。後続つき」、止める指摘 0 件。残り(P3、後続の課題 APT-1108): 読み直すと名前の選び直しがまた出なくなる(もう一度確かめれば出る)/ 作成先が画面に無いときに押すと知らせが消える / 新しい方式で「受け付けられました」の知らせが、計画が古くなっても残る。 直していないもの: 新しい方式(console-v1)は、生成の上限を見分けられない(サーバーが理由を渡していない)ので、「計画を作り直す」が出たままになる。 確かめていないこと: 実環境の画面、ブラウザ。
  5. 戻し方: revert(Web だけ。サーバーと DB は変えない)。

What (APT-1094, part of APT-1096)

Validation answer Class Reference Remembered as rejected Actions
Unknown reason platform (Platform's sentences folded under details) yes yes, re-check allowed Check again / Make a new plan
Only "destination unusable" sentences on a bound plan plan/destination no yes, re-check allowed Check again / Make a new plan
Destination changed/mismatch on a bound plan, field error, github-template, fingerprint plan/destination or plan/incomplete no yes Make a new plan
Destination not set destination/blocked no no Retry (re-reads the destination; proceeds without a new plan once set)
Plan bound to an old destination revision destination/changed no no Create with this content
Name or URL taken name-taken no no choose a name
  • "Check again" checks the unchanged plan once per click: one validation and no generation. If the destination moved, it first sends the one PATCH that binds the plan to the current revision, then stops for the user's approval.
  • The rejection stands until a validation answers valid. A valid answer makes the plan approvable again, and nothing is created until the user presses 「この内容で作る」. A failed request leaves the plan rejected with nothing requested, so a reload sends nothing.
  • Legacy only: re-check is not offered while the conversation has outgrown the plan.
  • Renaming changes the plan, so it clears the rejection and approves the renamed plan, which is validated before anything begins. A re-check answered 'name taken' keeps its name choice (until a reload; a second re-check brings it back). Choosing a name there behaves like the name choice everywhere else: the renamed plan is validated and, if valid, creation begins without a further click - unlike the re-check itself, which never creates.
  • On a re-checkable plan, prepare() (for example the Retry of a destination stop met during a check) runs the check again, never an approval.
  • In console-v1, while a plan is rejected, every creation failure notice except an unreadable answer, a name choice or a destination stop carries the rejection's actions instead of a retry.
  • A re-check answered valid adds one information notice saying the plan was accepted and can be built with 「この内容で作る」. In the legacy engine, 「もう一度確かめる」 is disabled while it can't run.
  • A rejected plan cannot be validated or executed unchanged through an older retry notice (the prepare effect and retry('prepare') are guarded; older prepare notices show no action).
  • Legacy only: when Platform refuses a new plan for its 20-generation limit, the limit notice has no action. It says the rejected plan cannot be used, and the proposal stops offering 「計画を作り直す」; "Check again" remains for causes fixable outside the plan.
  • Console-v1 does not handle the limit. Its refused plan turn reaches the page only as a failed_precondition without Platform's reason, so 「計画を作り直す」 stays offered there (needs a server change).
  • A creationPlan mention reclassifies only a validation answer or a generation job's stored error, not an HTTP failure (5xx, 4xx) in the plan context.
  • A validation request answered 502/503/504 is a platform fault with reference; 503 on other preparation requests stays unavailable.
  • Follow-up on the Platform side (APT-1106): machine-readable reason codes in the validation answer, so the Console stops matching sentences.

For whoever merges second with #33

PlanValidationError means only the Platform's valid:false answer and is the only thing that marks a plan rejected. #33's stop for a blocking gate that is not ready must be thrown as a different error (its own class or a plain Error): it must not be remembered as a rejection, must not withdraw the create action, and must not go through planRejectionFailure (any line that function does not recognise becomes the platform failure with re-check). #33 also predates #30 and needs a rebase.

Checks (on the committed tree, head cd87ecc)

bun run typecheck, bun run typecheck:e2e, bun test src (1976 pass, 0 fail), bun run check:response-boundaries (0 violations), bun run check:console-schema. Not run: mock stories locally (CI runs them), browser, live environment.

A creation-plan validation that answers valid:false is an answer, not an
outage. It gets its own class: no not-your-fault wording, no support
reference, the reasons in the user's words (Platform's sentences verbatim
when unknown), and the offered action leads to re-planning or to the
destination re-binding; the rejected plan is never validated or executed
again unchanged. Genuine request failures keep today's classes.
@reoring reoring added the needs-human-review Waits for a person's review before merge label Nov 15, 2026
…he user's plan problem (APT-1094)

Only rejections whose meaning is known stay plan failures. An unknown
valid:false answer keeps the platform class and its support reference, with two
actions: check the same plan again (one validation per click) and make a new
plan. A rejected plan is not validated or executed unchanged through an older
retry notice; a limit refusal leaves no dead-end retry; a creationPlan mention
in an HTTP failure no longer reclassifies it.
…creates (APT-1094)

Review follow-ups. "Check again" runs its one validation from the click and
no longer lifts the guard: a failed request leaves the plan rejected with
nothing requested, so a reload sends nothing. A valid answer only makes the
plan approvable again; nothing is created until the user approves. The legacy
engine does not offer a re-check for a plan the conversation has outgrown, and
its limit notice no longer points at the rejected proposal.
…t run, say when the plan is accepted (APT-1094)
@reoring

reoring commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Merging on the PO lead's decision (2026-11-15): four independent review rounds, the last two merge OK with noted follow-ups (682e87c, delta cd87ecc); all six checks pass on cd87ecc; follow-ups are APT-1108 (Console) and APT-1106 (Platform reason codes). Merge to main only - 0.5.9 is not published with this merge.

@reoring reoring removed the needs-human-review Waits for a person's review before merge label Nov 15, 2026
@reoring
reoring merged commit c7109fb into main Nov 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant