Skip to content

fix(platform): preserve approval decisions and scope card recovery - #3881

Merged
yannickmonney merged 7 commits into
mainfrom
fix/approval-decision-recovery
Oct 4, 2026
Merged

yannickmonney merged 7 commits into
mainfrom
fix/approval-decision-recovery

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Preserve committed approval decisions and make failed reads and writes recoverable without leaking state between approvals, runs or tasks.

A failed post-commit wake used to turn an already-recorded decision into an HTTP 500. The wake is now best effort, leaving the decision transaction and its refusal behavior intact; the existing poll/liveness paths still resume the parked run. Keeping the wake after commit also preserves approval/run lock ordering.

Approval cards keep a loading frame, show a readable failed-read state with Try again, refresh the decision after a write, and scope pending/error state to the approval identity. The run page and task feedback panel similarly isolate state when switching runs or tasks. Retrying a failed read now restores stranded keyboard focus through the existing generic recovery hook, moved to @tale/ui and reused by both skill viewers. Deliberate focus moves and late answers from a previous approval remain isolated. UI strings and approval guidance cover EN/DE/FR; manual coverage and current suite counts are updated.

Current integration: 7892fdcaad2f0890b44aeed6ead3ab64533468eb, incorporating main 6524150fe108180696b9364a46adfbd621349f00. Original author commits are preserved, and the prerequisite source is on main.

Validation:

  • Fresh real Chromium: 20/20 approval-card tests, including repeated retry focus, deliberate focus movement, approval switches and fully settled late mutations. The focus regression was observed failing before the repair.
  • Fresh component/API tests: 90/90 across five UI files, 24/24 across three API/service/route files, and 6/6 shared recovery-hook tests.
  • Fresh real PostgreSQL: 56/56 checks across decision/resume, approval surface and project-visibility lanes. The selected run uses a synthetic isolated database and no provider calls; the owned container stopped and data remains available for inspection.
  • Fresh platform and shared-UI typecheck/type-aware lint: all five tasks pass with zero cache hits. Scoped formatting passes. Scoped SAST reports zero findings; its oversized integration-check.ts scan is partial because the analyzer reaches its token-set limit, so this is not a complete scan of that file.
  • Conflict, manual and link checks pass. Pinned Bun 1.4.2 frozen dependency installs completed. Existing mixed Vitest/browser-package and Storybook import warnings remain; no dependency upgrade is included.
  • Independent review accepted this integrated source. Fresh full hosted CI is complete; its actual checkout and source limits are recorded below. No deployment is included.

Closes #3706
Closes #3707
Closes #3721

Final recovery validation (2026-10-04)

Checks, Build, E2E, SAST and Commitlint all completed successfully on their first workflow attempt for 7892fdcaad2f0890b44aeed6ead3ab64533468eb. Actual hosted checkout was merge 23d986fd169fde6e8d3fbb6f72b5f453db1c8c4e over base 6524150fe108180696b9364a46adfbd621349f00.

  • Native integration: 1,526/1,526 checks, 225/225 lanes. Platform unit 81,685 passed / 2 skipped; UI 5,263 passed; platform browser 327 and shared UI browser 212 passed, all actually executed. Daemon and sandbox Unit tasks replayed cache.
  • All 16 platform E2E shards passed (66 tests, 1 skipped), plus docs 55 and web 90, with explicit first-attempt diagnostics and no retries.
  • Image validation 40/40, runtime validation 83/83 and smoke 29/29 passed. Platform image scan passed. Aggregate Trivy comparison remains neutral because 10 other baseline scan configurations are absent; Opengrep reported 0 findings with 36 partial analyses.
  • Supplemental isolated composition with main 272f60a7cdc053621d5d87a9fdfbe22644718e26 and in-place retry recovery passed the newly relevant runnerd 9 and session-view 3 tests plus real PostgreSQL 23/23 checks. Earlier 306 focused / 142 native checks remain tied to main 9b. Recovery logic, replay consumers and migrations did not change in the intervening main delta.
  • Final composition review against main 2aa291e9dbd1f1656ee3b4aa3ff5755242e09ec3 is clean (tree 473d6654076493b1ea70e51ec482dc348e27d0f9). The two subsequent Home draft/product locale changes do not alter recovery code or its dependencies. No branch rewrite or hosted rerun was used.

@yannickmonney
yannickmonney force-pushed the fix/approval-decision-recovery branch from 03dbcf1 to 325831e Compare September 29, 2026 12:36
Deciding a connector operation commits the approval, its audit row and
its hint, and only then pokes the run parked behind it. When that poke
failed (its step job's send, or the run row's update), the door
answered 500 for a decision already on record: a retry met
ALREADY_RESOLVED and the gate still admitted the operation, so the
reviewer was told the approval failed while it went ahead.

The poke only saves time. The run's own approval poll (30 s) and the
liveness sweep resume it anyway, as they did in 0.4, which had no poke.
decideApproval now logs a failed wake with the approval and run ids and
answers the decision it committed. A refused decision still throws from
inside its transaction, and each decision still wakes its run once.

The checkApprovalDecisionResume lane proves it on real Postgres through
the app door and the real gate. A trigger on the pg-boss job table
refuses the one step insert (the send seam) and holds every other job
of the lane, so the harness worker never runs one. Beside it, approve
and reject wake their run once each, a duplicate and a racing decision
are refused without a second job, and a cancelled run's approval takes
no late decision.
The run's approval card rendered nothing while its read loaded and
nothing once the read failed, so a run waiting on a decision showed no
decision, no failure and no way back. The caller had already chosen the
card over its waiting banner. The card now keeps saying the run waits,
masks its controls in place while the read loads, and after a failed
read says "Couldn't load this approval." with Try again. Only a settled
answer that no such approval exists falls back to the waiting banner.

Everything the card shows belongs to one approval. A new approval id
(the run's next gate, or another task's run in the same sheet) mounts a
fresh card, so the refusal of the previous approval, or its late
answer, never shows under the next one, and a press in flight no longer
holds the next approval's buttons. The subject panel and the run page
are scoped the same way. The board sheet keeps the panel mounted when
it opens another task, and a Request changes draft carried over; the
run routes keep the page mounted across runs, and a refused stop did.

A decision reports once, from its own promise. Success shows the
outcome at once and refreshes the approval's own read. A failure says
"Couldn't record your decision." with the refusal's own words, never a
payload, and reads the approval back, so a decision someone else made
first shows as the decision on record. In English, German and French,
with the manual boxes APV-B4, APV-B5 and TASK-B28.
The guide to a waiting run now says what the card shows when its
approval cannot be loaded, when a decision is not recorded, and when
someone else decided first, in English, German and French.
@yannickmonney
yannickmonney force-pushed the fix/approval-decision-recovery branch 2 times, most recently from 325831e to 1285a1b Compare September 29, 2026 13:17

@yannickmonney yannickmonney left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One actionable keyboard-recovery issue found; inline reproduction attached. The scoped decision/state checks passed. Please resolve the retry-focus behavior before acceptance; no merge approval.

yannickmonney added a commit that referenced this pull request Sep 29, 2026
…ed-search-recovery

The manual readme counts main's boxes plus this branch's six (989). Three of this branch's new boxes collided with IDs other open PRs add — TASK-F51 (#3813), TASK-B28 (#3881), TASK-B29 (#3908) — so they move to TASK-F52, TASK-B32 and TASK-B33, in the suite, pins.md and the automation register.
yannickmonney added a commit that referenced this pull request Sep 29, 2026
The Try again recovery put focus on the new control after every retry the
member started that failed again, even when they had moved focus to a
control that stayed on screen while it ran (a bundle tree row, the
dialog's close button), or had opened another file whose own first read
then failed. It now restores focus only when removing the control
stranded it, on the page or on a container around it where the dialog's
focus trap parks it, and opening another skill or file disarms it. The
approvals card in #3881 is asked to follow the same rule.

The new cases hold a retry on the network while the member acts: a move
to a tree row, a move to the close button, another file opened, and the
stranded control that must still recover. SKILL-A5 covers the same in a
browser.

Refs #3752
@yannickmonney

yannickmonney commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Pickup handoff, updated 3 October 2026: TALE-89 is now P1 / To do, assigned to Claude #6. The native assignment was read back. TALE-357 owns dispatch. The 23:00 Zurich manager occurrence received a native blocked refusal because an existing predecessor remains unresolved; no repair run was admitted. Preserve that dependency and its acceptance requirements. Continue fix/approval-decision-recovery on this PR; do not create duplicate implementations for the three source issues.

Admission is held by the current storage-maintenance lease. After its explicit release, verify current task prerequisites, branch ownership, agent availability and disk capacity, then record the bounded repair's admitted run ID. Preserve the current implementation and evidence.

Resolve the still-open retry-focus P2. With the real approval card, focus Try again, press Enter, delay the retry and fail it again: the current control unmounts and strands focus on BODY. Keep the recovery control stable or restore focus when it was lost, while preserving a user's deliberate focus move elsewhere during the wait. Reuse the shared recovery behavior where applicable and add regression coverage for both cases; preserve the delayed approval-A-to-B isolation control.

Integrate current main and resolve the branch conflicts without losing the decision-commit/read-recovery fixes. Verify the focused component/API regressions and the keyboard behavior in a real local browser, then obtain fresh exact-head required CI. Hand off the full head SHA and finding-to-test evidence to a distinct reviewer through TALE-359. The prior 44 successful checks and earlier scoped test results do not resolve this finding or certify the rebased head.

@yannickmonney
yannickmonney merged commit 8a580fc into main Oct 4, 2026
@yannickmonney
yannickmonney deleted the fix/approval-decision-recovery branch October 4, 2026 03:43
yannickmonney added a commit that referenced this pull request Oct 4, 2026
Add the v0.5.72 highlights and upgrade guidance through #3881. Explain the required sandbox service and connected-device updates for workspace deletion confirmation.

Validate the note with the release-notes and link gates, independent fact review, and all applicable hosted checks. Later changes remain in the generated PR list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant