feat(selectors): assert checked state with is checked and checked=
Summary
Snapshot nodes already publish checked on Android (ui-hierarchy.ts) and iOS (ios-node-interpretation.ts, which can also produce 'mixed'), and snapshot/get attrs show it, but the selector language could not assert it. This adds checked as a selector boolean key and an is checked predicate, so flows can assert the state of switches, checkboxes, and radios:
agent-device is checked 'role=switch label="Wi-Fi"'
agent-device wait 'id="tos" checked=true' 5000
checked= is three-valued: checked=true matches only node.checked === true and checked=false only node.checked === false; iOS 'mixed' and an absent fact (a non-checkable Android node) match neither, because checked is published only on checkable controls and absent means "not checkable", not "unchecked". is checked passes only on an explicitly checked node and includes checked in its details JSON. 14 files changed: contracts IS_PREDICATES, selectors parse/match/predicates, command-surface metadata, CLI help (via IS_PREDICATES/SELECTOR_KEY_NAMES), fuzz/property arbitries, parity tests, focused unit tests (true/false/mixed/undefined), and website docs. The docs also note that Android id= matches the full pkg:id/name resource-id, React Native testIDs arrive bare, and a Jetpack Compose Modifier.testTag reaches agent-device only with semantics { testTagsAsResourceId = true }.
Validation
- Head:
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.- Focused unit tests:
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. - CI obligations: device/emulator and coverage lanes remain GitHub-authoritative; no device-facing behavior changed (selector matching only).
๐ค Generated with Claude Code
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith ยท Need help on this PR? Tag @codesmith-bot with what you need.