fix: seed verify_feedback during fix-step claim#331
Open
rightclaw wants to merge 11 commits intosnarktank:mainfrom
Open
fix: seed verify_feedback during fix-step claim#331rightclaw wants to merge 11 commits intosnarktank:mainfrom
rightclaw wants to merge 11 commits intosnarktank:mainfrom
Conversation
added 8 commits
March 8, 2026 21:40
|
Someone is attempting to deploy a commit to the Untangle Team on Vercel. A member of the Team first needs to authorize it. |
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.
Bug Description
This workflow/runtime validation checked a prior handoff failure where the bug-fix pipeline crashed on the first pass into the fix step because the template referenced {{verify_feedback}} before any verifier retry had populated it. Current runtime behavior shows the patch is in place: verify_feedback is seeded to an empty string during claim resolution, the fix step can now be claimed successfully, and the workflow advances past triage/investigate/setup instead of failing on a missing template key.
Severity: medium
Root Cause
The original handoff failure came from a mismatch between the bug-fix workflow template and Antfarm's claim-time template validation. In
workflows/bug-fix/workflow.yml, thefixstep input always includes aVERIFY FEEDBACK (if retrying): {{verify_feedback}}section, even on the first pass into the fixer. Before the runtime patch,claimStep()insrc/installer/step-ops.tsvalidated every{{...}}placeholder withfindMissingTemplateKeys()before resolving the input, but first-pass run context had noverify_feedbackyet because that field is only created later by verifier retry handling (handleSingleStepRetry()storescontext["verify_feedback"] = ...after a verifier returnsSTATUS: retry). That meant the very first claim of thefixstep could fail immediately with "missing required template key(s) verify_feedback" before any implementation work started. The current code shows the runtime fix is now in place in both source and built output: for story-loop claims and ordinary single-step claims,claimStep()now seedscontext["verify_feedback"] = ""before running missing-key validation, so the template resolves successfully on first pass and renders an empty VERIFY FEEDBACK section instead of crashing the run. The passingtests/single-step-retry.test.tsconfirms the complementary retry path still stores real verifier feedback back into run context once a retry actually happens. In short: the bug was a runtime assumption error — the engine treated a retry-only placeholder as if it were guaranteed to exist on initial step claim.Fix
Kept the runtime-side fix in src/installer/step-ops.ts that seeds verify_feedback to an empty string before claim-time missing-key validation, which allows a first-pass bug-fix fix step to resolve its template instead of failing before work starts. Added regression coverage in tests/single-step-retry.test.ts for the fresh bug-fix handoff path and revalidated the existing retry-path feedback persistence check. Built the project with npm run build and ran node --test tests/single-step-retry.test.ts to confirm the workflow advances past the previous failure point while the run stays in running state.
Regression Test
Added a test in tests/single-step-retry.test.ts that creates a fresh bug-fix run with triage/investigate/setup already done, leaves verify_feedback absent from run context, claims the pending fix step, and asserts the step is successfully claimed/running with an empty VERIFY FEEDBACK section instead of failing on a missing template key.
Verification
Diff is non-trivial and matches the claimed runtime fix plus targeted regression coverage; .gitignore exists; only in-repo files changed (src/installer/step-ops.ts and tests/single-step-retry.test.ts); no sensitive files or hardcoded credential patterns were introduced; the fix in claimStep is minimal and targeted to the root cause by seeding verify_feedback to an empty string before missing-key validation, so first-pass bug-fix fix-step claims no longer fail on a retry-only placeholder; the new regression test specifically constructs the original failure scenario with triage/investigate/setup completed and verify_feedback absent, then proves the fix step is claimed, remains running, and renders an empty VERIFY FEEDBACK section; that test would fail if the fix were reverted because claimStep would hit missing template key validation and not return a claimed running fix step with resolved input; the existing retry-path test still passes and confirms real verifier feedback is persisted back into run context on actual retry; npm run build passed; node --test tests/single-step-retry.test.ts passed; findings indicate the runtime patch fixed the prior handoff failure and the workflow now advances beyond the previous failure point instead of crashing at fix-step claim time.