🤖 refactor: add simplify workflow#3563
Conversation
Move the simplify workflow into the tracked project workflow directory so child workspaces can inspect it.
Refactor the workflow to keep agent structured-output schemas as constants before the workflow entrypoint, and simplify the orchestration code around lane prompts, synthesis, fixing, and argument parsing.
---
_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `3422439{MUX_COSTS_USD:-unknown}`_
<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=11.77 -->
Implement the self-review findings for the tracked simplify workflow:
- cap raw diff text before fanning out review agents
- pass compact diff metadata, not raw diffs, to synthesis/fix phases
- render malformed workflow arguments as validation/usage output instead of assertion crashes
No custom workflow actions are introduced.
---
_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `3484700{MUX_COSTS_USD:-unknown}`_
<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=15.49 -->
Apply the latest simplify workflow dogfood findings:
- reuse the base resolved by changedFiles for diffStat/diff calls
- avoid an adapter allocation when summarizing workflow diff compactions
Validation:
- workflow_read simplify
- workflow_run simplify --help
- workflow_run simplify --base
- bunx prettier --check .mux/workflows/simplify.js
- make static-check
---
_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `72154{MUX_COSTS_USD:-unknown}`_
<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=15.49 -->
Apply the final dogfood findings for the simplify workflow:
- return early when there are no reviewable changes
- bound compact git metadata in prompts and outputs
- compose finding schemas from shared core fields
- use object spread for git context variants
Validation:
- workflow_read simplify
- workflow_run simplify --help
- workflow_run simplify --base
- bunx prettier --check .mux/workflows/simplify.js
- make static-check
---
_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `149245{MUX_COSTS_USD:-unknown}`_
<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=15.49 -->
Address simplify workflow review cleanup:
- turn the read-only prompt and no-op synthesis into constants
- inline one-off context/diff helper wrappers
- reuse optional chaining and existing tiny predicates where it shortens code
- hoist the value-flag table out of parseValueFlag
Validation:
- workflow_read simplify
- workflow_run simplify --help
- workflow_run simplify --base
- bunx prettier --check .mux/workflows/simplify.js
- make static-check
---
_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `423759{MUX_COSTS_USD:-unknown}`_
<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=27.02 -->
Signed-off-by: Thomas Kosiewski <tk@coder.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24b106a618
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Please take another look after the dirty-worktree patch application fix. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d47ab0f38d
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Please take another look after the staged-index auto-fix guard. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb89614f11
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Please take another look after the fresh pre-apply Git status and expectedHeadSha guard. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec1b61c2d2
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Please take another look after the non-current --head auto-fix guard. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c4ec02d18
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Please take another look after the symbolic --head guard. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fbce6b11f4
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Please take another look after the unresolved --head guard. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 99f12ee063
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Please take another look after the dirty-worktree auto-fix guard and force removal. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b04963da7
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Please take another look after the untracked-file review guard. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e358c93d89
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Please take another look after scoping the untracked-file guard to untracked-only reviews. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e8e9b69d4
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Please take another look after allowing explicit-target reviews with unrelated untracked files. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e48a26b656
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Please take another look after keeping explicit untracked targets on the skip path. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b0bd836c1
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Please take another look after guarding mixed untracked explicit targets. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4a1bb4620
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Please take another look after treating root targets as containing untracked files. |
Summary
Adds a tracked
simplifyworkflow that reviews current changes for code reuse, quality, and efficiency, synthesizes actionable findings, and applies minimal fixes through a committed child-workspace patch when the reviewed content is available in child workspaces.Background
This ports the ad-hoc global simplify skill into a durable Mux workflow so the review lanes run in parallel with structured outputs, bounded prompt context, resumable workflow steps, and native patch application.
Implementation
changedFilesproves there are no diffable hunks.--headranges into review-only/no-apply behavior so patches are never applied to the wrong checkout; resolved raw commit SHAs are allowed by SHA equality.cache: falseimmediately before patch application, rejects dirty/changed checkouts, and passes the reviewedexpectedHeadShato avoid stale patch application.Validation
make static-checknode --check .mux/workflows/simplify.jsbunx prettier --check .mux/workflows/simplify.jsgit diff --check--headskips fixer/applyPatch even at the same SHA, unresolved hex-looking--headskips fixer/applyPatch, clean branch changes refresh status withcache: falseand callapplyPatchwith reviewedexpectedHeadSha, dirty drift skips patch application, and changed HEAD skips patch application./simplifydogfood run; workflow patch application succeeded before the final dirty-worktree auto-fix guard was added./workflow simplify --review-only --base HEAD --head HEADno-op dogfood; returnedNo reviewable changes foundand exercised the diff-skip path.Risks
Low to medium. This is a new workflow file and does not alter existing app runtime paths, but it exercises workflow orchestration, agent handoffs, and patch-application behavior. Review/fix now intentionally applies only when the relevant content is present in child workspaces and the parent checkout is clean/matches the reviewed head; dirty worktrees still receive explicit guidance to add/commit/stash before rerunning.
Generated with
mux• Model:openai:gpt-5.5• Thinking:xhigh• Cost:3032979{MUX_COSTS_USD:-unknown}