Skip to content

fix(workflow): preserve failed evidence and harden run transitions - #291

Merged
simota merged 1 commit into
mainfrom
fix/workflow-review-hardening
Nov 28, 2026
Merged

simota merged 1 commit into
mainfrom
fix/workflow-review-hardening

Conversation

@simota

@simota simota commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Purpose

Saved Workflow runs could not be opened, repeated timeout reconciliation could spin without making progress, and detailed failure evidence was lost before reaching a repair attempt. Stale UI answers could also target a newer input request.

This PR fixes these issues across the engine, persistence, Git and IPC adapters, and UI. The three areas were reviewed separately and then cross-reviewed by different reviewers.

What changed

Area Result
Saved runs Open the frozen graph, history, reports, and evidence through --run or Tasks result links in a read-only view. Editing, execution, approval, and answering are disabled.
Timeouts Automatically reconcile an expired attempt once. Persist that decision across restarts so a “still running” response cannot immediately trigger another timeout reconciliation.
Cancellation and limits Recheck queued execution effects against the latest run and attempt state before dispatch, preventing new work after cancellation, pause, or invalidation.
Multiple Plan nodes Wait for every Plan node to finish before starting Implement, preventing late Plan results from repeatedly failing target validation after implementation changes the target.
Failed evidence Preserve validated failed reports and logs in node state and history, and pass hash-checked copies to repair attempts. Failed evidence does not satisfy approval requirements.
Evidence copies Hash the actual bytes that are copied, eliminating a verify-then-reread race.
Answers Bind answers to the displayed run, node, attempt, request ID, and input sequence. Clear drafts when the question changes, and validate identity in both the runner and a fresh pane snapshot before sending.
Git snapshots Generate machine-readable patches independently of color, path-prefix, diff-marker, and submodule display settings. Preserve repository paths with trailing whitespace.
Editing and refresh Keep the inspector usable when resizing narrow windows, allow Undo and conflict Reload with invalid form input, and refresh saved agent presets without discarding active edits.
Previous attempts Open historical reports and evidence with the attempt number and actual target revision clearly identified.

New persisted fields are optional and omitted when unset, preserving checksums of existing saved data. This also updates --demo=saved, the Workflow guide, and the changelog. A large execution enum payload is boxed and equivalent conditionals are simplified to pass the standalone Workflow Clippy check.

Verification

  • Rust 1.92.0 with the existing lockfiles.
  • cargo test --manifest-path widgets/workflow/Cargo.toml --locked: 126 passed — 78 library tests and 48 native/UI tests; no failures or ignored tests. 27 regression tests added.
  • cargo clippy --manifest-path widgets/workflow/Cargo.toml --locked --all-targets -- -D warnings: passed.
  • scripts/verify.sh --full: locally passed except for one existing Scaffold test affected by the execution environment. Workspace tests: 4,267 passed, 0 failed, 25 pre-existing ignored tests. Workflow and the other widget checks, builds, registration, formatting, workspace Clippy, and desktop-file checks passed. The full verification, including Scaffold, passed in Linux CI; both macOS CI jobs also passed.
  • GitHub CI: all 3 jobs passed on the first attempt for f19dded937df99e11d2752c0dd235c5f2de1b30d — Linux full verification, macOS core, and macOS widgets.
  • Codex PR review: completed with no findings for the same commit. 0 unresolved review threads.
  • git diff --check: passed.
  • Initial reviews and cross-reviews across three areas completed. Findings from the cross-review were addressed, with no further blocking findings in the subsequent review.

The first local full run encountered a transient lock conflict in the unchanged timeline test ac4_root_rebind_keeps_runs_another_instance_registered. Its isolated rerun and the final full run passed. The final full run used RUST_TEST_THREADS=1.

The remaining local failure is Scaffold's gitread::tests::the_root_is_the_nearest_ancestor_with_git (83 passed, 1 failed). All writable temporary directories in this environment are under a repository, violating the test's assumption that one temporary directory has no repository ancestor. The implementation searches the filesystem directly, so GIT_CEILING_DIRECTORIES does not change the result. No tests, verification gates, or dependencies were changed to bypass this failure.

Rendering checks

Rendered --demo=saved with the existing native software renderer at 1280×860 and the minimum 720×600 window size, then inspected both images. The images are at 2× resolution and were losslessly compressed without changing their pixels. They show demo data, not an execution by a live agent.

Saved run at the normal window size

Minimum window size

Saved run at the minimum window size

Not verified

  • Manual macOS window interaction, IME input, VoiceOver, and visual parity during navigation. Automated macOS tests passed in PR CI.
  • A complete workflow with live agents, including publication to GitHub by the Workflow widget itself. Adapter regression tests use local Git repositories and mock IPC.

Risks

Definitions with multiple Plan nodes now wait for the last Plan to finish before implementation begins. Failed evidence must still match its saved hash; missing or modified files stop recovery or repair and surface an explanation.

Input-sequence validation checks the pane snapshot fetched immediately before sending. The existing IPC send operation does not accept a server-side expected sequence, so this change does not make the check and send atomic.

Risk class

medium: changes to Workflow execution state, failed evidence, and UI actions. The shared appearance change only simplifies an equivalent conditional.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T14:43:59.457544Z f19dded PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@simota simota changed the title fix(workflow): 実行状態・失敗証跡・保存済み表示を改善 fix(workflow): preserve failed evidence and harden run transitions Nov 28, 2026
@simota
simota merged commit 04062e1 into main Nov 28, 2026
3 checks passed
@simota
simota deleted the fix/workflow-review-hardening branch November 28, 2026 14:53
@simota simota mentioned this pull request Nov 28, 2026
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