Skip to content

Show refused improvement starts and deletion refusals in the user's words (APT-1232, APT-1234) - #41

Open
reoring wants to merge 4 commits into
mainfrom
fix/apt-1232-1234-console-refusals
Open

reoring wants to merge 4 commits into
mainfrom
fix/apt-1232-1234-console-refusals

Conversation

@reoring

@reoring reoring commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

What

Two bugs observed on appthrust.ink with Console 0.5.12 (2026-11-17).

  • APT-1232: on the improve page, after the proposal was submitted (awaiting owner review), pressing 「この内容で直す」 sent POST …/implementation-runs, Platform answered 409 source_change_proposal_run_blocked, and nothing appeared on screen; after the owner declined, the button did nothing at all. Cause: use-implementation.ts treated every 409 on start as "another tab started first", and the page kept offering the start while the proposal was waiting or closed.
  • APT-1234: deleting an app whose AI work areas were still there showed Platform's raw English message "application branch still has active delivery consumers" (412) in the dialog.

Change

APT-1232

  • Start admission matches Platform (admitImprovementImplementation): runs only in Drafting and ChangesRequested (proposals/model.ts). Waiting, closed and ApplyFailed proposals show an explanation on the change card instead of the button; ApplyFailed keeps polling.
  • A typed refusal on start (any code other than conflict, idempotency_in_progress or none; details.reason first) is shown once without retry; source_change_proposal_run_blocked reuses the 「提案の確認を待っています」 copy.
  • A plain 409 conflict is decided by a fresh draft read started after the 409 (in-flight reads are cancelled): a new run means another tab started it (nothing shown); no new run shows a refusal; a failed read shows "could not confirm", and confirming repeats the same decision (no resend).
  • The refusal baseline is the proposal as read when the button was pressed (before the POST); the refusal clears when a later read shows a different proposal that admits a run.

APT-1234

  • The delete dialog maps typed Platform refusals to the user's words (ja/en), never Platform's message: 412 branch_has_active_delivery → 「このアプリの作業場所が N か所残っています。」 and who can clear them; dependents_deleting or any retryable: true refusal → still being cleared, press 完全に削除する again shortly; other refusals → could not delete.
  • Deletion itself is unchanged from main (one attempt per click). Automatic waiting during deletion is out of scope (APT-1204 / Platform); an earlier loop was removed in review.

Mock: refuses improvement runs outside Drafting/ChangesRequested with Platform's code.

Verification (local, committed tree 74088671a7)

  • bun run typecheck, typecheck:e2e, bun test src, check:response-boundaries, check:console-schema, full test:e2e:mock: 2128 pass / 0 fail, 0 boundary violations, schema pass, 81 mock stories passed (13.6 min).
  • New stories: improve-start-refused, the 412 case in app-delete. Unit tests for refusal classification, the plain-409 read-back (in-flight GET reuse, failed read-back, confirm after failure), the start-time baseline, ApplyFailed, copy. RED on the base for each.
  • Independent review (probe-astra; implementer Claude Opus designer): rounds 1-3 changes required (round 2 findings 1/2/5 came from the deletion wait loop, which was removed), round 4 on 74088671a7: merge OK, no findings, no judgment points. Record: po/lead-2026-11-14/reviews/builder-console-apt1232-1234-review-bugfixer.md.
  • Not run: appthrust.ink.

Known follow-ups (not in this PR)

  • The mock refuses conversation messages while a proposal awaits review or is closed; Platform accepts them.
  • A deletion refused repeatedly needs the user to press again; resuming a partly finished deletion is as on main (APT-1204 / Platform).

Refs: APT-1232, APT-1234, APT-1204.

…'s words (APT-1232, APT-1234)

APT-1232: a start Platform refuses with a typed code (for example
source_change_proposal_run_blocked while the proposal awaits review) is a
visible refusal without retry instead of being taken for another tab's start;
the genuine concurrent-start 409 still re-reads the draft. While a proposal
waits for review or is closed, the change card explains instead of offering
the start, and the proposal is read again after a refusal.

APT-1234: deleting an app no longer shows Platform's English message. A 412
branch_has_active_delivery names the app's AI work areas still running and
what to do; dependents_deleting and other retryable refusals are waited on
(retryAfterSeconds, up to 120 s) and then explained.
…with Platform (APT-1232, APT-1234)

Review follow-up (probe-astra round 1):
- App deletion (stack DELETE, waits, source binding DELETE, console record)
  runs under one AbortSignal; deleting again aborts the earlier run, leaving
  the page aborts it, and the dialog can be closed while deleting.
- One Idempotency-Key per deletion, sent on every retry of the stack DELETE.
- The 120 s deadline is checked before every send and each DELETE is aborted
  when time runs out.
- Improvement starts are admitted only in Drafting and ChangesRequested, as
  Platform does; ApplyFailed explains that the proposal could not be applied
  and keeps polling.
- A plain 409 conflict on start re-reads the draft and shows a refusal unless
  another tab's run appeared; a refusal clears only when a fresh read after it
  shows a different proposal that admits a run.
- Deletion copy says the app still has work areas left (no 'running').
…st (APT-1232, APT-1234)

Review round 2 follow-up, re-scoped:
- The automatic deletion wait/retry loop, its abort controller, progress
  ref, deadline and closable-while-pending dialog are removed; deletion is
  main's one attempt per click again. Typed Platform refusals stay in the
  user's words; waiting automatically is left to APT-1204 / Platform.
- The refusal baseline is the proposal as read when 「この内容で直す」 is
  pressed, before the POST.
- After a plain 409 on start, the read-back cancels any in-flight draft read
  and fetches the draft again; a failed read-back is shown as unconfirmed,
  not as a refusal.
…PT-1232)

Review round 3: when the read-back after a plain 409 failed, the page showed
'could not confirm', and a successful confirm read could not clear it. The
409 read-back failure now keeps its context; decideConflict is shared by the
409 path and confirm: a new run clears the failure (another tab started it),
no new run shows StartRefused, a failed read stays unconfirmed. Confirm never
resends the start.
@reoring reoring added the needs-human-review Waits for a person's review before merge label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-human-review Waits for a person's review before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant