refactor(contracts): additive capability facts pilot on touch family
What changed
Pilots additive capability facts on the touch operation family (per #2412, child of #2409).
touchRuntimeOperationFacts used to take one required cell per operation, so an operation only
one owner implements still cost a hand-written denial in every other owner. The builder now takes
the family's denial once, as a required unsupported cell, and every per-owner operation
(tapRef, hover, hoverRef, fillRef, tapElementSelector) is optional — an owner names what
it implements and omission reports unsupported verbatim, with the reason and hint the owner
would otherwise have repeated by hand. tap, longPress and fill stay required: every owner
implements them, so dropping them would be a silent regression, not a legitimate omission.
A follow-up commit restored that guard after the first pass made all cells optional and a real
regression slipped through: platform-web's touch facts had silently lost their explicit
longPress: readinessUnavailable cell, reporting the family default instead of the platform's own
readiness reason. Fixed, along with the other now-required call sites (the fully-unavailable owner
fixtures and the screenshot-runtime-fixture test double).
Proof
- Facts are unchanged for every owner: the per-platform admission tests that assert the
unavailable reason for each non-supporting platform pass with no edits
(packages/contracts/src/touch-runtime.test.ts, platform runtime tests). pnpm check:affected --run: 407 test files / 2898 tests passed.pnpm check:layering: green (R2, R6, R7, R9, R10, R11, R13 etc. all hold).
Replay: historical single-platform addition (#2412 acceptance)
Measured at 0eca306610 against base e7d97f7dfe; the later commits only re-required
tap/longPress/fill and ported the hover evidence, neither touches the replayed addition.
Full record in the PR comment of 14:37.
Replayed addition: one Apple/iOS-only touch operation (longPressElementSelector, shaped like
tapElementSelector, the way #1987 introduced the family). Files the compiler forces:
| shape | files | packages | unsupported-owner fact files |
|---|---|---|---|
| old (main) | 16 | 8 | 7 |
| new (this branch) | 5 | 2 | 0 |
The seven unsupported-owner edits that disappear:
packages/platform-android/src/runtime.ts(denial cell)packages/platform-harmonyos/src/runtime.ts(denial cell)packages/platform-linux/src/runtime.ts(denial cell)packages/platform-web/src/runtime.ts(denial cell)packages/provider-webdriver/src/platform-runtime.ts(denial cell)packages/provider-limrun/src/interaction-operations.ts(denial cell)packages/contracts/src/platform-runtime-unavailable.ts(shared unavailable builder, whichplatform-vegaand Linux non-desktop spread)
Also gone: four test fixtures that enumerated every touch key
(src/__tests__/test-utils/runtime-operation-facts.ts, src/daemon/__tests__/screenshot-runtime-fixture.ts,
src/daemon/handlers/__tests__/install-source.test.ts, test/integration/provider-scenarios/provider-device-runtime.fixtures.ts).
The family builder's own exhaustive test (packages/contracts/src/touch-runtime.test.ts) still changes on both shapes.
Stop rule: fewer than two unsupported-owner edits avoided → stop. Seven avoided; the pilot continues.