test(contracts): one typed conformance helper for the runtime-family suites - #2301
Conversation
Size Report
Startup median (7 runs, lower is better):
|
9265102 to
d0b11ba
Compare
…eletion blind spot Review on PR #2301 (P2): the two-direction completeness check in interactor-operation-conformance.test.ts can't catch a catalog row and its conformance rows being deleted together in one change — both sets shrink in lockstep and neither assertion trips. No behavior change; documents the limitation for a future maintainer who wants to close it with an independent count.
…suites Extracts the shared binding-rule mechanics that ten *-runtime.test.ts files repeated by copy into interactor-operation-conformance.fixtures.ts. Each module keeps its own expected table and calls the helper with it; the helper owns no expectations.
…tion conformance Asserts both directions against the production registry: every catalog operation has exactly one conformance table naming it, and every named operation is registered in the catalog.
…eletion blind spot Review on PR #2301 (P2): the two-direction completeness check in interactor-operation-conformance.test.ts can't catch a catalog row and its conformance rows being deleted together in one change — both sets shrink in lockstep and neither assertion trips. No behavior change; documents the limitation for a future maintainer who wants to close it with an independent count.
c781e4a to
a87c698
Compare
|
Sentinel review at P2: completeness reads raw test source and regex-matches operation literals ( |
…log itself The completeness gate read raw test sources and regex-matched operation literals, so a commented-out row still counted as conformed while nothing executed it. The three binding rules now live in one test file that walks INTERACTOR_OPERATIONS and binds through each catalog row's own bind and label, with the per-operation expectations (interactor method, minimal input) in a table typed over every catalog operation. A missing, duplicated or unregistered row fails typecheck and the table-vs-catalog test; every row is executed by construction. The conformance fixture and the per-facet conformInteractorOperations blocks are gone; each facet test keeps only its dedicated tests.
|
Addressed in 453d28e. The source-scanning completeness gate is gone. The three binding rules now live in one test that walks |
* origin/main: perf: bundle runtime dependencies and report full install size (#2310) ci: avoid unrelated Apple runner cache invalidation (#2303) fix(web): preserve the backend ref so snapshot refs match actionable refs (#2283) test(daemon): session-open-url-prewarm through the request seam (#2304) test(daemon): session-devices-batch-runtime through the request seam (#2305) chore(gates): layering baselines ratchet against merge-base (#2299) test(daemon): one typed conformance helper for the daemon runtime suites (#2298) chore(layering): derive the contracts export inventory from package.json (#2297) perf: bundle tar-stream to reduce install footprint (#2286) docs: simplify agent context and resolve conflicting guidance (#2287) refactor(cli): let help resolve command aliases itself and retire R12 (#2293)
|
Sentinel review at 453d28e: Independent delta review is source-clean. Source-text completeness scanning is gone: a catalog-keyed typed expectation table is executed through each production bind/label, so a commented-out row cannot count as conformance. Missing/excess rows have planted-red proof. Remaining blocker is exact-head CI: Size encountered the cross-version base-report js.rawBytes failure and rerun checks are pending. No additional device acceptance required for this test-only refactor. |
|
Summary
Ten
packages/contracts/src/*-runtime.test.tsfiles (alert, app-event,app-switcher, back, clipboard, home, keyboard, orientation, settings,
tv-remote) repeated the same three binding-rule tests by copy for every
interactor-catalog operation. Those three rules now live once, in
interactor-operation-conformance.test.ts, driven by the catalog itself: eachrule walks the exported
INTERACTOR_OPERATIONSand binds through the catalogrow's own
bindandlabel, exactly as production does. The per-operationexpectations (interactor method, minimal input) sit in one table typed over
every catalog operation, so a missing, duplicated or unregistered row fails
typecheck and a table-vs-catalog test, and every row is executed by
construction — completeness is structural, not observed from source text.
Each facet's
*-runtime.test.tskeeps only its dedicated tests.app-inventory-runtime.ts/app-state-runtime.ts/platform-runtime-operations.ts(#2295) andplatform-runtime-unavailable.test.ts(#2291) are untouched.Validation
Head
453d28e0e5.npx vitest run packages/contracts/src— 60 files / 304 testspassed.
oxlint,oxfmt --check,tsc -b packages/contracts,check:layeringand
check:fallow --base origin/mainclean.the
keyboardEnterrow of the expectation table →tsc -b packages/contractsfails (
Property 'keyboardEnter' is missing) and all four conformance testsfail. Reverted.
backfromINTERACTOR_OPERATIONS→ typecheck fails on the now-excessbackrow and thetable-vs-catalog test fails. Reverted.
a87c6984d6and before) carried the source-scanning gatethat the review found; CI on those was green except a pre-existing iOS smoke
flake on
d0b11ba2that cleared on rerun.