refactor(contracts): additive capability facts on the keyboard family - #2459
Merged
Conversation
The keyboard family's facts builder took 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 `unsupported`, and every operation cell is optional: an owner names what it serves and omission reports that denial verbatim, with the reason and hint the owner would otherwise have repeated per cell. Omission stays a classified refusal, never an unclassified cell and never an implied success: `unsupported` is required, so a call that leaves the family blank does not compile. An owner that names every operation still states the family refusal, and it must refuse the family rather than one operation of it — whatever the owner leaves unnamed reports that cell verbatim. The shared unavailable-facts input collapses `keyboardStatus`/`keyboardDismiss`/ `keyboardEnter` into one required `keyboard` cell, so the owners that answered the family with raw keys (webdriver, vega, linux, limrun's no-session binding) now answer it through the builder, which is the family's one entry point. Facts are unchanged for every owner, so the per-platform admission assertions hold untouched. Two owner tests now assert the keyboard reason as well as the availability, because one family cell reports one reason for all three operations: the WebDriver inactive session and the stale Limrun identity. Refs #2443
Size Report
Startup median (7 runs, lower is better):
|
Member
Author
|
No code findings at 880c9f4. The builder preserves each existing keyboard fact and denial while making new operations optional for unsupported owners; the exhaustive tests cover explicit, partial and unsupported-only declarations. Completed checks are green, with iOS still running. |
thymikee
added this pull request to stack #2466
September 10, 2026 14:33
|
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.
Summary
keyboardRuntimeOperationFactsrequired one cell per operation, so an operation only one ownerserves still cost a hand-written denial in every other owner. The builder now takes the family's
denial once, as a required
unsupportedcell;status/dismiss/enterare optional and anomitted cell reports that denial verbatim.
The shared unavailable-facts record collapses
keyboardStatus/keyboardDismiss/keyboardEnterinto one required
keyboardcell, so the owners that wrote raw keys — webdriver, vega, linux,limrun's no-session binding — answer the family through the builder, its one entry point. Facts are
unchanged for every owner: no test asserting a non-supporting platform's unavailable reason was
edited. Keyboard is the first family of #2443, on the shape #2420 merged.
Replay (#2443 item 3)
Replayed addition:
keyboardCommitIme, one operation named by exactly one owner. Files that mustchange until
pnpm typecheckis green again:origin/main)The 8: 6 in
packages/contracts(the family, the interactor method, the operation-name list, thebinding catalog, the conformance row, the family's own exhaustive test) + 2 in
packages/platform-apple(the implementing cell, plusrunner-demand.ts, a facts-free totaloperation→host map). Those operation-surface files are forced on both shapes. The old shape
additionally forced 9 owner/builder fact cells (apple navigation, harmonyos, linux, vega, web,
limrun ×2, webdriver, the shared record) and 8 cell-enumerating test doubles.
Stop rule: 17 avoided ≥ 2 → keyboard merges. Measurement also posted on #2443.
Validation
880c9f4367:pnpm check:affected --rungreen — format, lint, typecheck, layering, fallow, build,and 350 related test files / 2339 tests. Provider integration and coverage stay
GitHub-authoritative. Parity is proven by the untouched admission tests
(
packages/platform-*/src/runtime.test.ts, provider runtime tests); two owner tests now alsoassert the keyboard reason (WebDriver inactive session, stale Limrun identity), because one family
cell answers three operations.
Refs #2443