Tester: idempotent checkbox handling + read form requirements before filling#52
Merged
Conversation
5403173 to
961cab4
Compare
Re-clicking an already-selected checkbox toggled it back off, dropping a "Select N tests" selection to zero and saving an empty result. Teach the shared action rules that toggle controls (checkboxes, switches, selectable rows) are not idempotent: after a click, read the resulting ariaDiff and stop re-clicking once the control already shows the desired state. Document idempotent I.checkOption / I.uncheckOption and route them through the form() tool (the click tool only accepts I.click). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
961cab4 to
fe6bf38
Compare
Add formRequirementsRule and inject it into the Tester system message so the Tester reads each control's requirements (required, type/format, length, placeholder/aria hints) before filling create/update forms; view-only search/filter/sort forms are exempt. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
It only asserted the rule text appears in the system message — a tautological wiring check coupled to exact prompt wording, no behavior. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Two related Tester prompt fixes.
1. Prevent checkbox double-toggle
Diagnosed from session
HighBiologicalHarlequin622(Langfuse tracea7676e6635d6e5c2d0ad6084012f7fc8). The Tester selected a suite checkbox successfully, then re-clicked the same control and toggled it back off — the ariaDiff is the smoking gun:click @ 03:42:52→checkbox [checked]+button "Select 32 tests"— selection succeeded.click @ 03:43:00(same control) →checkboxunchecked +button "Select 0 tests"— reversed.Select 0 tests, saving an empty plan.Root cause: the shared
actionRuleprompt (src/ai/rules.ts) had no notion that some controls toggle, nor that an idempotentI.checkOptionexists.src/ai/rules.ts—I.clicksection: one-line steer to preferI.checkOption/I.uncheckOptionfor checkboxes; newI.checkOption/I.uncheckOptioncommand subsection (documented becauseactionRuleis a closed command set).src/ai/tools.ts—formtool description lists the checkbox commands so they route throughform()(theclicktool rejects non-I.click).2. Read form field requirements before filling data-changing forms
src/ai/rules.ts— newformRequirementsRule, injected into the Tester system message (src/ai/tester.ts). Before filling a create/update form, the Tester reads each control's requirements (required, type/format, length, placeholder/aria hints) and enters satisfying values. View-only search/filter/sort forms are exempt.tests/unit/tester-form-requirements.test.ts— asserts the rule is present in the system message.Verification
bun test tests/unit/→ 651 pass, 0 failbun test tests/integration/→ 62 pass, 0 fail🤖 Generated with Claude Code