Skip to content

Commit 8611dcf

Browse files
committed
fix: model tvOS audio as host-dependent contract
1 parent 44e92a4 commit 8611dcf

2 files changed

Lines changed: 58 additions & 25 deletions

File tree

‎test/integration/smoke-tvos-platform-coverage.test.ts‎

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ test('tvOS coverage exhaustively classifies the public catalog', () => {
4343

4444
test('tvOS coverage report has the expected classification counts', () => {
4545
assert.deepEqual(TVOS_PLATFORM_COVERAGE_CLASSIFICATION_SUMMARY, {
46-
capabilityDenial: 4,
47-
contract: 12,
46+
capabilityDenial: 3,
47+
contract: 13,
4848
gap: 38,
4949
live: 0,
5050
total: 54,
@@ -80,25 +80,27 @@ test('tvOS provider contract claims only commands executed by the existing scena
8080

8181
test('tvOS capability denials match the mechanical capability matrix', () => {
8282
const deniedByCapabilities = publicCommands
83-
.filter(
84-
(command) =>
85-
command !== PUBLIC_COMMANDS.audio && !isCommandSupportedOnDevice(command, TVOS_SIMULATOR),
86-
)
83+
.filter((command) => !isCommandSupportedOnDevice(command, TVOS_SIMULATOR))
8784
.sort();
88-
const deniedByManifest = Object.entries(TVOS_PLATFORM_COVERAGE)
89-
.filter(
90-
([command, entry]) =>
91-
command !== PUBLIC_COMMANDS.audio && entry.level === 'capability-denial',
92-
)
93-
.map(([command]) => command)
85+
const manifestCapabilityProjection = Object.entries(TVOS_PLATFORM_COVERAGE)
86+
.flatMap(([command, entry]) => {
87+
if (entry.level === 'capability-denial') return [command];
88+
if (
89+
entry.level === 'command-contract' &&
90+
'admission' in entry &&
91+
entry.admission === 'host-dependent' &&
92+
!isCommandSupportedOnDevice(command, TVOS_SIMULATOR)
93+
) {
94+
return [command];
95+
}
96+
return [];
97+
})
9498
.sort();
9599

96-
assert.deepEqual(deniedByManifest, deniedByCapabilities);
97-
assert.equal(
98-
isCommandSupportedOnDevice(PUBLIC_COMMANDS.audio, TVOS_SIMULATOR),
99-
process.platform === 'darwin',
100-
'tvOS simulator audio admission follows host ScreenCaptureKit availability',
101-
);
100+
assert.deepEqual(manifestCapabilityProjection, deniedByCapabilities);
101+
const audio = TVOS_PLATFORM_COVERAGE[PUBLIC_COMMANDS.audio];
102+
assert.equal(audio.level, 'command-contract');
103+
assert.equal('admission' in audio ? audio.admission : undefined, 'host-dependent');
102104
});
103105

104106
test('tvOS gesture contract preserves the typed multi-touch denial', () => {

‎test/integration/tvos-e2e/coverage-manifest.ts‎

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,26 @@ type RepositoryEvidence = {
77
test: string;
88
};
99

10+
type TvOsCommandContractEntry =
11+
| {
12+
assertion: string;
13+
level: 'command-contract';
14+
owner: RepositoryEvidence;
15+
}
16+
| {
17+
assertion: string;
18+
level: 'command-contract';
19+
owner: RepositoryEvidence;
20+
admission: 'host-dependent';
21+
};
22+
1023
export type TvOsPlatformCoverageEntry =
1124
| {
1225
assertion: string;
13-
level: 'live' | 'command-contract';
26+
level: 'live';
1427
owner: RepositoryEvidence;
1528
}
29+
| TvOsCommandContractEntry
1630
| {
1731
assertion: string;
1832
level: 'capability-denial';
@@ -38,6 +52,10 @@ export const TVOS_REMOTE_EVIDENCE: RepositoryEvidence = {
3852
path: 'test/integration/provider-scenarios/tvos-remote.test.ts',
3953
test: TVOS_REMOTE_TEST_NAME,
4054
};
55+
const TVOS_AUDIO_EVIDENCE: RepositoryEvidence = {
56+
path: 'src/core/__tests__/capability-plugin-routing-parity.test.ts',
57+
test: '(b.1) isCommandSupportedOnDevice is unchanged across the command x device matrix',
58+
};
4159
export const TVOS_REMOTE_SCENARIO_COMMANDS: readonly PublicCommand[] = [
4260
PUBLIC_COMMANDS.open,
4361
PUBLIC_COMMANDS.scroll,
@@ -47,10 +65,16 @@ export const TVOS_REMOTE_SCENARIO_COMMANDS: readonly PublicCommand[] = [
4765
];
4866

4967
const C = PUBLIC_COMMANDS;
50-
const contract = (path: string, test: string, assertion: string): TvOsPlatformCoverageEntry => ({
68+
const contract = (
69+
path: string,
70+
test: string,
71+
assertion: string,
72+
admission?: 'host-dependent',
73+
): TvOsPlatformCoverageEntry => ({
5174
assertion,
5275
level: 'command-contract',
5376
owner: { path, test },
77+
...(admission ? { admission } : {}),
5478
});
5579
const denial = (assertion: string): TvOsPlatformCoverageEntry => ({
5680
assertion,
@@ -67,10 +91,12 @@ const gap = (assertion: string): TvOsPlatformCoverageEntry => ({
6791
*
6892
* There is no tvOS CI or live-device lane at HEAD, so the existing provider
6993
* scenario is contract evidence rather than a live claim. The remaining
70-
* contract rows cite Apple deployment/inventory tests or the typed Apple
71-
* interaction policy. Capability denials are limited to whole-command
72-
* denials; tvOS's narrower multi-touch refusal stays with the gesture contract
73-
* instead of denying the supported one-contact gesture path.
94+
* contract rows cite Apple deployment/inventory tests, the typed Apple
95+
* interaction policy, or the executable capability oracle. Capability denials
96+
* are limited to whole-command denials; tvOS's narrower multi-touch refusal
97+
* stays with the gesture contract instead of denying the supported one-contact
98+
* gesture path. Host-dependent contracts retain their oracle admission state
99+
* without claiming a stable tvOS capability.
74100
*/
75101
export const TVOS_PLATFORM_COVERAGE = {
76102
[C.artifacts]: gap('No tvOS-specific artifact inventory command evidence exists yet'),
@@ -89,7 +115,12 @@ export const TVOS_PLATFORM_COVERAGE = {
89115
[C.logs]: gap('No tvOS-specific app-log command evidence exists yet'),
90116
[C.events]: gap('No tvOS-specific session-event command evidence exists yet'),
91117
[C.network]: gap('No tvOS-specific network command evidence exists yet'),
92-
[C.audio]: denial('tvOS audio admission is host-dependent and denied on hosted CI'),
118+
[C.audio]: contract(
119+
TVOS_AUDIO_EVIDENCE.path,
120+
TVOS_AUDIO_EVIDENCE.test,
121+
'tvOS audio admission follows the host-dependent ScreenCaptureKit capability oracle',
122+
'host-dependent',
123+
),
93124
[C.replay]: gap('No tvOS-specific replay command evidence exists yet'),
94125
[C.test]: gap('No tvOS-specific test-suite command evidence exists yet'),
95126
[C.clipboard]: gap('No tvOS-specific clipboard command evidence exists yet'),

0 commit comments

Comments
 (0)