Skip to content

fix: seed verify_feedback during fix-step claim#331

Open
rightclaw wants to merge 11 commits intosnarktank:mainfrom
rightclaw:bugfix/verify-feedback-self-test
Open

fix: seed verify_feedback during fix-step claim#331
rightclaw wants to merge 11 commits intosnarktank:mainfrom
rightclaw:bugfix/verify-feedback-self-test

Conversation

@rightclaw
Copy link
Copy Markdown

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, the fix step input always includes a VERIFY FEEDBACK (if retrying): {{verify_feedback}} section, even on the first pass into the fixer. Before the runtime patch, claimStep() in src/installer/step-ops.ts validated every {{...}} placeholder with findMissingTemplateKeys() before resolving the input, but first-pass run context had no verify_feedback yet because that field is only created later by verifier retry handling (handleSingleStepRetry() stores context["verify_feedback"] = ... after a verifier returns STATUS: retry). That meant the very first claim of the fix step 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 seeds context["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 passing tests/single-step-retry.test.ts confirms 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.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 31, 2026

Someone is attempting to deploy a commit to the Untangle Team on Vercel.

A member of the Team first needs to authorize it.

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