Skip to content

Commit addda18

Browse files
committed
chore(gates): rename the alert golden table's readOnly column to query
The runner no longer classifies commands by read-only-ness, so a shared column named after it implied a concept the runner no longer has. `query` names the fact both sides agree on — the request changes nothing — which each maps to its own consumer: replay eligibility in the runner, `readOnly` in the daemon. Also names the `.presentedSurface` dispatch proof in the iOS PR lane, so what the declared policy does to a stopped app is checked on every pull request rather than only in the nightly.
1 parent d3553c1 commit addda18

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

‎apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/UnitTests/RunnerTests+LifecycleTests.swift‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ import Foundation
22
import XCTest
33

44
#if AGENT_DEVICE_RUNNER_UNIT_TESTS
5+
/// One row of the cross-language golden table. Its `query` column names the shared fact — this alert
6+
/// request changes nothing — which each side maps to its own consumer: replay eligibility here, and
7+
/// the TypeScript `readOnly` trait there.
58
private struct AlertCommandTraitsFixture: Decodable {
69
let name: String
710
let command: Command
8-
let readOnly: Bool
11+
let query: Bool
912
}
1013

1114
extension RunnerTests {
@@ -26,7 +29,7 @@ extension RunnerTests {
2629
for fixture in cases {
2730
XCTAssertEqual(
2831
fixture.command.traits.retryOnSessionLoss,
29-
fixture.readOnly,
32+
fixture.query,
3033
fixture.name
3134
)
3235
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[
2-
{ "name": "default query", "command": { "command": "alert" }, "readOnly": true },
2+
{ "name": "default query", "command": { "command": "alert" }, "query": true },
33
{
44
"name": "explicit query",
55
"command": { "command": "alert", "action": "get" },
6-
"readOnly": true
6+
"query": true
77
},
88
{
99
"name": "accept mutates",
1010
"command": { "command": "alert", "action": "accept" },
11-
"readOnly": false
11+
"query": false
1212
},
1313
{
1414
"name": "dismiss mutates",
1515
"command": { "command": "alert", "action": "dismiss" },
16-
"readOnly": false
16+
"query": false
1717
}
1818
]

‎packages/platform-apple/src/runner/__tests__/runner-command-traits.test.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,22 @@ test('runner command trait helpers read from the shared trait table', () => {
8585
});
8686

8787
test('alert actions match the native read-only golden table', () => {
88+
// The fixture's `query` column names the shared fact — the alert request changes nothing — which
89+
// each side consumes under its own name: `readOnly` for this daemon trait, retry eligibility for
90+
// the Apple runner, which no longer classifies commands by read-only-ness at all.
8891
const cases = JSON.parse(
8992
fs.readFileSync(
9093
new URL('../../../../../contracts/fixtures/alert-command-traits.json', import.meta.url),
9194
'utf8',
9295
),
93-
) as Array<{ name: string; command: RunnerCommand; readOnly: boolean }>;
96+
) as Array<{ name: string; command: RunnerCommand; query: boolean }>;
9497
assert.deepEqual(
9598
cases.map(({ command }) => command.action),
9699
[undefined, 'get', 'accept', 'dismiss'],
97100
);
98-
for (const { name, command, readOnly } of cases) {
99-
assert.deepEqual(readRunnerCommandTraits(command), { ...defaults(), readOnly }, name);
100-
assert.equal(isReadOnlyRunnerCommand(command), readOnly, name);
101+
for (const { name, command, query } of cases) {
102+
assert.deepEqual(readRunnerCommandTraits(command), { ...defaults(), readOnly: query }, name);
103+
assert.equal(isReadOnlyRunnerCommand(command), query, name);
101104
}
102105
});
103106

0 commit comments

Comments
 (0)