Stop spending Worker attempts on formatting and environment failures - #19
Merged
Merged
Conversation
Since validation went offline by default, a suggested check such as `pnpm run smoke:install` ran without network and failed whatever the Worker changed, spending Worker attempts on a failure it could not fix. Repository inspection now marks a package script network-enabled when it is a smoke script, is named for an install, or its body runs a package install, pnpm dlx or npx. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018My7bXp2HaVceJHPmVxCpZ
When validation fails on a Worker snapshot with changes, run the setup commands plus the failed checks once against the unchanged pinned base (cached on the run by base + command digest). Failed checks are marked failsOnBase. If every failure also fails on base, stop the controller with an operator-facing reason instead of spending a Worker attempt; otherwise the follow-up note only lists Worker-caused failures and names the base-failing ones. Promotion and digests are unchanged. UI shows a "Fails on base" badge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018My7bXp2HaVceJHPmVxCpZ
A check can depend on any earlier configured step, such as a build, not only on installs. Running just the setup commands and the failed checks on the base could report a check as failing there when only its prerequisite was missing, and stop the run. The baseline now runs every configured command up to the last failed check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018My7bXp2HaVceJHPmVxCpZ
Antigravity and Claude Code Workers only have file tools, so they cannot run the repository formatter and formatter-style checks (prettier --check) fail on their output, wasting retries. Add an optional, configured format step (src/format-step.ts). After the Worker snapshot is verified and before validation, Foreman materializes it in the validation bubblewrap sandbox, runs the install commands from the validation list and then the format command, reads back only the files the Worker added, modified or renamed (Worker file mode kept, symlinks skipped, everything else the formatter touched ignored), and re-verifies the result against the pinned base and allowed scope. The formatted snapshot is the evidence validation, the Reviewer, approval and promotion use. Any formatter failure keeps the Worker snapshot and records formatting status "failed"; validation reports the real problem. Live bridge snapshots only, so recorded replays keep their digests. Plumbing: WorkerEvidence.formatting and worker.evidence_verified event, per-run formatCommand snapshot, workspace setup and FOREMAN_FORMAT_COMMAND config, Worker prompt note, repository inspector suggestedFormatCommand, open-repository toggle and evidence line, README, tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018My7bXp2HaVceJHPmVxCpZ
christopherjnelson
marked this pull request as ready for review
September 29, 2026 15:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: an Antigravity or Claude Code Worker could not run the formatter, so
prettier --checkfailed on its output, and the retry only got a list of file names to guess from.pnpm run smoke:installran with no network and failed whatever the Worker wrote. Both failures used up the Worker attempt budget (default 2) without any chance of passing.After: Foreman can format the Worker's changed files itself before validation, smoke and install-running scripts are suggested with network access, and a check that also fails on the unchanged base commit stops the run with a clear reason instead of sending the Worker back.
How:
src/format-step.ts). This is optional and configured per workspace. The open-repository dialog suggestsrun format,format:writeorprettier:writewith an on/off toggle, andFOREMAN_FORMAT_COMMANDsets it from config.formatting, and the UI shows "Foreman formatted N files".src/repository-inspector.ts). A suggested package script getsnetwork: truewhen it is a smoke script, is named...:install, or its body runs a package install,pnpm dlxornpx.src/baseline-validation.ts).failsOnBaseand get a "Fails on base" badge.Trade-off to note: a network-enabled smoke script is repository code the Worker may have edited, so it gets the host network. This relaxes the offline default from #15 for those checks. The toggle stays visible per check in the dialog.
Checked locally:
pnpm typecheck,pnpm test(623 passing),pnpm buildandpnpm test:bridge.🤖 Generated with Claude Code
https://claude.ai/code/session_018My7bXp2HaVceJHPmVxCpZ
Generated by Claude Code