Skip to content

Commit 1809662

Browse files
committed
Merge remote-tracking branch 'origin/codex/2189-ios-snapshot-baselines' into codex/2189-ios-snapshot-baselines
* origin/codex/2189-ios-snapshot-baselines: (27 commits) fix: move mutation ownership to snapshot module test: verify preserved size reporter closure test: pin shared publish asset owner fix: retire stale utils layering zone test(size): update publish preparation contracts style(size): format package evidence test fix(size): make publish asset evidence hermetic docs(ios): republish exact-head benchmark corpus fix(ios-benchmark): admit proxy fixture anchors chore(ios): format benchmark evidence docs(ios): publish snapshot convergence corpus test(ios): admit native alert snapshots test(ios): reset alert between relaunch samples test(ios): reveal offscreen alert fixture controls docs(ios-benchmark): retain exact-head evidence fix(ios-benchmark): preserve async timeout evidence fix(ios-benchmark): keep fresh proxy CLI sessions isolated fix(ios-benchmark): bind proxy lease to simulator fix(ios-benchmark): parse proxy startup envelope test(ios-benchmark): keep CLI process seam local ... # Conflicts: # vitest.config.ts
2 parents cd2b1e0 + ea79642 commit 1809662

10 files changed

Lines changed: 68 additions & 13 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import assert from 'node:assert/strict';
2+
import fs from 'node:fs';
3+
import path from 'node:path';
4+
import { test } from 'vitest';
5+
import { mkdtempForTestSync } from '../../src/__tests__/test-utils/tmp-dir.ts';
6+
import { preparePublishAssets } from '../prepare-publish-assets.mjs';
7+
8+
test('prepares both Android runtime helpers through the shared publish owner', () => {
9+
const root = mkdtempForTestSync('agent-device-publish-assets-');
10+
const scriptsDirectory = path.join(root, 'scripts');
11+
fs.mkdirSync(scriptsDirectory, { recursive: true });
12+
fs.writeFileSync(path.join(root, 'package.json'), '{"version":"1.2.3"}\n');
13+
fs.writeFileSync(path.join(scriptsDirectory, 'package-apple-runner-source.mjs'), '');
14+
fs.writeFileSync(
15+
path.join(scriptsDirectory, 'package-android-helper.sh'),
16+
`#!/bin/sh
17+
set -eu
18+
if [ "$AGENT_DEVICE_ANDROID_HELPER" = "snapshot" ]; then
19+
output="$3"
20+
else
21+
output="$2"
22+
fi
23+
mkdir -p "$output"
24+
prefix="agent-device-android-$AGENT_DEVICE_ANDROID_HELPER-helper-$1"
25+
printf apk > "$output/$prefix.apk"
26+
printf manifest > "$output/$prefix.manifest.json"
27+
printf checksum > "$output/$prefix.apk.sha256"
28+
`,
29+
);
30+
31+
const stalePath = path.join(root, 'android', 'ime-helper', 'dist', 'stale.apk');
32+
fs.mkdirSync(path.dirname(stalePath), { recursive: true });
33+
fs.writeFileSync(stalePath, 'stale');
34+
35+
preparePublishAssets({ root });
36+
37+
assert.equal(fs.existsSync(stalePath), false);
38+
for (const helper of ['snapshot', 'ime']) {
39+
const prefix = `agent-device-android-${helper}-helper-1.2.3`;
40+
const directory = path.join(root, 'android', `${helper}-helper`, 'dist');
41+
assert.deepEqual(fs.readdirSync(directory).sort(), [
42+
`${prefix}.apk`,
43+
`${prefix}.apk.sha256`,
44+
`${prefix}.manifest.json`,
45+
]);
46+
}
47+
});

scripts/__tests__/size-report-package.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ test('Markdown reports component diffs and changed packed files', () => {
102102
js: { rawBytes: 10, gzipBytes: 8 },
103103
npmPack: {
104104
tarballBytes: 100,
105-
unpackedBytes: 1713,
105+
unpackedBytes: 2218,
106106
components: summarizeNpmPackComponents({
107107
...fixturePack,
108108
unpackedSize: 2218,

scripts/layering/model.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ test('classifyZone separates the ranked spine from intentionally-unranked zones'
249249
assert.equal(classifyZone('(root)'), 'unranked');
250250
assert.equal(classifyZone('platform-runtime'), 'unranked');
251251
assert.equal(classifyZone('platforms'), 'unclassified');
252-
assert.equal(classifyZone('utils'), 'ranked');
252+
assert.equal(classifyZone('utils'), 'unclassified');
253253
// Every satellite zone joined the spine; only the composition root stays out, because R2
254254
// forbids daemon/ from importing commands/ so the files that wire them cannot be ranked.
255255
assert.equal(classifyZone('mcp'), 'ranked');

scripts/layering/model.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ const TARGET_DAG_RANK = new Map([
4646
['screenshot-diff', 1],
4747
['selectors', 1],
4848
['snapshot', 1],
49-
['utils', 1],
5049
['core', 2],
5150
['cli-schema', 3],
5251
['commands', 3],
@@ -78,9 +77,9 @@ export function zoneRank(zone: string): number | null {
7877
// and the no-root-back-import rule instead of their former src folder rank.
7978
//
8079
// The satellite zones used to be listed here too, on the grounds that ranking them would
81-
// invent an order the architecture had not committed to. Once `utils` joined the spine and
82-
// `(root)` was emptied of shared contracts, every one of them turned out to have a
83-
// consistent rank already — so the order was there, just unasserted.
80+
// invent an order the architecture had not committed to. Once `(root)` was emptied of shared
81+
// contracts, every one of them turned out to have a consistent rank already — so the order was
82+
// there, just unasserted. The former `utils` zone was retired into owning modules and packages.
8483
// Extracted workspace packages are not src/ zones: R11 owns their physical seams, and their zone
8584
// names only appear in workspace-aware graphs. The platform packages additionally carry R13's
8685
// exact-family/composition/laziness policy.

scripts/mutation/modules.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ export const KERNEL_MODULES: readonly KernelModule[] = [
6161
{
6262
id: 'scroll-edge-state',
6363
label: 'Scroll edge-state detection',
64-
mutate: ['src/utils/scroll-edge-state.ts'],
65-
owns: ['src/utils/scroll-edge-state.ts'],
64+
mutate: ['src/snapshot/scroll-edge-state.ts', 'src/snapshot/scroll-edge-state/**/*.ts'],
65+
owns: ['src/snapshot/scroll-edge-state.ts', 'src/snapshot/scroll-edge-state/'],
6666
},
6767
{
6868
id: 'selectors',

scripts/mutation/selection.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ test('a lane-tooling diff selects real mutants', () => {
8080
// The weekly sweep is the kernel report; selecting on derived ownership would
8181
// run the full ten-shard sweep on most PRs for a report nobody gates on.
8282
test('a kernel diff selects nothing — only a harness diff spends mutants', () => {
83-
const dir = worktreeWithCommit('kernel', ['src/utils/scroll-edge-state.ts']);
83+
const dir = worktreeWithCommit('kernel', ['src/snapshot/scroll-edge-state.ts']);
8484
assert.deepEqual(listAffected(dir), []);
85-
assert.deepEqual(affectedMatrixFor(['src/utils/scroll-edge-state.ts']), []);
85+
assert.deepEqual(affectedMatrixFor(['src/snapshot/scroll-edge-state.ts']), []);
8686
});
8787

8888
test('a docs-only diff selects nothing', () => {

src/__tests__/npm-package-scripts.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ test('the npm package build covers every package-owned output before verificatio
6161
'pnpm build:macos-helper:clean',
6262
'pnpm prepare:publish-assets',
6363
]);
64+
assert.equal(script('prepare:publish-assets'), 'node scripts/prepare-publish-assets.mjs');
6465
assert.equal(script('package:npm'), 'pnpm build:package && pnpm check:package');
6566

6667
assert.deepEqual(script('build:android').split(' && '), [

stryker.config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"packages/kernel/src/errors.ts",
3535
"src/daemon/ref-frame.ts",
3636
"src/commands/interaction/runtime/settle.ts",
37-
"src/utils/scroll-edge-state.ts",
37+
"src/snapshot/scroll-edge-state.ts",
38+
"src/snapshot/scroll-edge-state/**/*.ts",
3839
"packages/selectors/src/**/*.ts",
3940
"!packages/selectors/src/**/*.test.ts",
4041
"!packages/selectors/src/internal/__tests__/**",

test/ci/size-workflow.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,20 @@ test('the preserved size reporter keeps its entrypoint and relative modules toge
2727
const measureBase = workflowStep('Measure base size').run ?? '';
2828

2929
expect(preserve).toContain(`mkdir -p ${preservedReportDir}`);
30-
expect(preserve).toContain(`cp scripts/size-report*.mjs ${preservedReportDir}/`);
30+
expect(preserve).toContain('cp scripts/size-report*.mjs');
3131
expect(measureBase).toContain(`node ${preservedReportDir}/size-report.mjs`);
3232

3333
const reportSource = fs.readFileSync(path.join(repoRoot, 'scripts/size-report.mjs'), 'utf8');
34-
const relativeModules = [...reportSource.matchAll(/from '\.\/(size-report-[^']+\.mjs)'/g)].map(
34+
const relativeModules = [...reportSource.matchAll(/from '\.\/([^']+\.mjs)'/g)].map(
3535
(match) => match[1],
3636
);
3737
expect(relativeModules.length).toBeGreaterThan(0);
3838
for (const moduleName of relativeModules) {
3939
if (!moduleName) throw new Error('relative size-report import has no module name');
4040
expect(fs.existsSync(path.join(repoRoot, 'scripts', moduleName)), moduleName).toBe(true);
41+
expect(
42+
moduleName.startsWith('size-report-') || preserve.includes(`scripts/${moduleName}`),
43+
`${moduleName} must be preserved for the base checkout`,
44+
).toBe(true);
4145
}
4246
});

vitest.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ export default defineConfig({
150150
// Package attribution models npm-pack output. Keep it in the fast lane so every new
151151
// package path remains accounted for.
152152
'scripts/__tests__/size-report-package.test.ts',
153+
// Publish preparation spawns only fixture-owned scripts and proves both Android
154+
// helper families are rebuilt through the shared release/size-report owner.
155+
'scripts/__tests__/prepare-publish-assets.test.ts',
153156
'scripts/ios-snapshot-benchmark/*.test.ts',
154157
// Parses CI configuration only, so this action guard needs no device or subprocess lane.
155158
'test/ci/upload-agent-device-artifacts.test.ts',

0 commit comments

Comments
 (0)