Files
Michał Pierzchała 4a3ccf67b4 test: close web platform command-coverage gaps from #1426 (#2011)
* test: close web platform command-coverage gaps from #1426

Closes #1900. The web coverage manifest carried 15 "known-gap" rows for
commands with no web-specific evidence — some had never been checked
against the web runtime, some just lacked a named test.

Added dedicated tests and reclassified each row to command-contract:

- boot, shutdown, install, reinstall, install-from-source, push, logs:
  new tests in packages/platform-web/src/runtime.test.ts prove the web
  runtime deliberately and permanently denies these operations
  (unsupported-platform-leaf), the same pattern already used for
  longPress/back/home/orientation/tvRemote/keyboard.
- diff, press: new tests prove these commands share their exact
  runtime-execution plan with the already-live snapshot/click commands
  (snapshotRuntimePlanUses, pressRuntimeUses === clickRuntimeUses), so
  the admitted operation backing snapshot/click also backs them.
- artifacts, events, batch, trace, replay: these commands have zero
  platform branching in their handlers; new tests dispatch each through
  its real production handler against a web-typed session/device to
  prove the existing generic code path works unchanged for web.
- test: readReplayScriptMetadata deliberately drops `context
  platform=web` as a declarable value, so a scripted suite can never
  filter by --platform web. With no filter, discoverReplayTestEntries
  runs every discovered script unconditionally, so a new test proves an
  unfiltered `test` run executes correctly against a session already
  bound to a web device.

Updates the manifest's classification-count gate to
{capabilityDenial: 7, contract: 35, gap: 0, live: 12, total: 54} and
replaces the now-vacuous "known gaps share one tracking issue" test
with a planted-red proof that zero known-gap rows remain. Removes the
now-dead WEB_COVERAGE_GAP_ISSUE constant and gap() helper.

Live web-smoke scope is unchanged — no new commands were added to
test/integration/smoke-web-platform.test.ts.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SK6kvnNth6H7VxbbANi2xC

* test: harden web coverage evidence from adversarial review

An independent adversarial review of the previous commit found the
`test` row's evidence was causally inert: the new test bound a web
device to the session, but test-suite discovery (session-test-suite-command.ts)
only ever reads flags.platform, never the session's device, so the test
passed identically for any platform. Replace it with a test that proves
the real, deterministic, web-specific behavior instead: `test --platform
web` always reports zero matching scripts, because
`readReplayScriptMetadata` drops `context platform=web` as an
unsupported declared value and `ReplayTestPlatform` structurally
excludes 'web' — so no `.ad` script, typed or untyped, can ever match
that filter. Update the manifest row's assertion to state that
limitation honestly instead of implying the command runs on web.

Also: add a test pinning `press`'s runtime-execution plan to `click`'s
(pressRuntimeUses === clickRuntimeUses, both descriptors reuse
clickRuntimeUses) — the manifest's `press` row rested on that equality
with nothing in the test suite that would catch it silently drifting.
Fix a doc comment claiming appLogRuntimePlanUses spans all five app-log
facts (it requires three; the other two are asserted as a reasonable
superset, not because the plan needs them). Rework the manifest's
top-of-file doc comment, which still described every contract row as
"web-specific unit/provider evidence" after the previous commit added
rows that instead prove a platform-agnostic code path or a structural
limitation — state the three evidence shapes explicitly instead of
retaining a sentence the new rows contradict.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SK6kvnNth6H7VxbbANi2xC

* test: keep test's web row a known-gap per review

@thymikee is right: the test row's evidence proves the opposite of
what command-contract is supposed to certify. ReplayTestPlatform
excludes web from the declared-platform filter entirely, so
`test --platform web` can never select a script — that's real, tested,
command-specific behavior, but it documents a limitation, not
executable evidence that the command works on web. Reclassifying it as
command-contract on the strength of that test would misrepresent what
was actually shown.

Reverts the test row to known-gap, restores WEB_COVERAGE_GAP_ISSUE and
gap(), and updates the classification counts to
{contract: 34, gap: 1} (14 of 15 gaps closed). #1900 stays open for
this one row until a separate decision adds web replay-test support or
an explicit denial. The regression test proving the exclusion
(session-command-replay.test.ts) stays in place; it's just no longer
cited as coverage evidence.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SK6kvnNth6H7VxbbANi2xC

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-24 20:15:36 +02:00
..