Repository navigation
feat(selectors): assert checked state with is checked and checked= - #4736
Conversation
Adds “checked” to the selector boolean keys and the is predicate vocabulary so flows can assert the checked state of switches, checkboxes, and radios that snapshot nodes already publish. checked= is three-valued: checked=true matches only node.checked === true, checked=false only node.checked === false; iOS “mixed” and an absent fact (a non-checkable Android node) match neither. is checked passes only on an explicitly checked node and reports checked in its details JSON. Usage hint, positional rotation, command metadata, CLI help (via IS_PREDICATES / SELECTOR_KEY_NAMES), fuzz and property arbitraries, and the website selector docs are updated, including a note that Android id= matches the full pkg:id/name resource-id, React Native testIDs arrive bare, and Compose testTags need testTagsAsResourceId = true. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Size Report
Startup median (7 runs, lower is better):
|
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
This is ready to merge at e6eb985. The change is correct and well owned: the route from the CLI through checkIsPredicate, selector-is and evaluateIsPredicate/matchesTerm has no problem. The 19 checks are green and none fail. There are no conflicts. The snapshot producers already publish Not blocking, and you can take or leave these: (1) the mixed fixtures in match.test.ts:244 and predicates.test.ts:370, and the comments in match.ts:44-47 and predicates.ts:78, model an iOS node with |
Summary
Snapshot nodes already publish
checkedon Android (ui-hierarchy.ts) and iOS (ios-node-interpretation.ts, which can also produce'mixed'), andsnapshot/get attrsshow it, but the selector language could not assert it. This addscheckedas a selector boolean key and anis checkedpredicate, so flows can assert the state of switches, checkboxes, and radios:checked=is three-valued:checked=truematches onlynode.checked === trueandchecked=falseonlynode.checked === false; iOS'mixed'and an absent fact (a non-checkable Android node) match neither, becausecheckedis published only on checkable controls and absent means "not checkable", not "unchecked".is checkedpasses only on an explicitly checked node and includescheckedin itsdetailsJSON. 14 files changed: contractsIS_PREDICATES, selectors parse/match/predicates, command-surface metadata, CLI help (viaIS_PREDICATES/SELECTOR_KEY_NAMES), fuzz/property arbitries, parity tests, focused unit tests (true/false/mixed/undefined), and website docs. The docs also note that Androidid=matches the fullpkg:id/nameresource-id, React Native testIDs arrive bare, and a Jetpack ComposeModifier.testTagreaches agent-device only withsemantics { testTagsAsResourceId = true }.Validation
e6eb985d1d(brancht3/assert-checked-state, rebased onorigin/main).pnpm install --frozen-lockfile && pnpm build— pass.pnpm formatthen local gate set mirroringpnpm check:affected --run(fail-open plan):format:check,lint,typecheck,layering,di-seams,fallow,native-dupes,mcp-metadata,production-exports,bundle-owner-files,gate-manifest(+test),check:affected:test,depgraph:test,tmpdir-leaks(+test), coverage/wire-compat/mutation model tests,replay-compat,daemon-wire-compat,check:package,test:integration:node,test:integration:macos-coverage,test:integration:provider(306 pass),test:integration:progress:check,test:fixture-cache,test:fixture-fallback,maestro:conformance,check:xctest-selection,check:packaged-runner-swift, docs checks (command-docs,doc-links,doc-prose,agent-guidance,adr-citations,capabilities-matrix) — all pass.packages/selectorsmatch/parse/predicates (incl.mixedand undefined-checkednegatives),packages/contracts, daemonis-predicates/selector-runtime-is, command-runtimeselector-is,src/__tests__/is-argument-surface-parity.test.ts,cli-grammar.test.ts— all pass;vitest relatedover the 14 changed files: 410 pass;apple-runner+fuzz-workerprojects: 993 pass; smoke: pass. A fullunit-coresweep showed 12 failures in 6 unrelated files (release-publish, fuzz harness, auth-session lane, repo-guards) that pass both with and without this diff in isolation — load flakiness of this sandbox, not this change.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.