trantor 0.18.129 → 0.18.131

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,81 @@
1
+ import { monitorEventLoopDelay } from "node:perf_hooks";
2
+
3
+ // Long-lived by design (long-poll, SSE): never "slow", and never the cause of a stall.
4
+ const LONG_LIVED = new Set(["/poll", "/stream"]);
5
+
6
+ const clean = value => String(value || "unknown").replace(/[\r\n]/g, " ").slice(0, 160);
7
+
8
+ export function createHubDiagnostics({
9
+ lagThresholdMs = 500,
10
+ slowRequestThresholdMs = 1000,
11
+ sampleIntervalMs = 100,
12
+ logIntervalMs = 1000,
13
+ now = Date.now,
14
+ log = line => process.stdout.write(`${line}\n`),
15
+ histogram = null,
16
+ } = {}) {
17
+ const delay = histogram || monitorEventLoopDelay({ resolution: 20 });
18
+ const inFlight = new Map();
19
+ let lastStep = null;
20
+ let lastLagLog = -Infinity;
21
+ let lastSlowLog = -Infinity;
22
+ let timer = null;
23
+
24
+ const recordStep = (name, bytes) => {
25
+ lastStep = { name: clean(name), bytes: Math.max(0, Number(bytes) || 0), at: now() };
26
+ };
27
+
28
+ const checkLag = () => {
29
+ const durationMs = delay.max / 1e6;
30
+ delay.reset();
31
+ const at = now();
32
+ const requests = [...inFlight.values()];
33
+ for (const [req, detail] of inFlight) if (detail.endedAt) inFlight.delete(req);
34
+ if (durationMs <= lagThresholdMs || at - lastLagLog < logIntervalMs) return;
35
+ lastLagLog = at;
36
+ const routes = requests
37
+ .map(req => `${req.method} ${req.path} (${Math.max(0, Math.round((req.endedAt || at) - req.startedAt))}ms)`)
38
+ .slice(0, 3)
39
+ .join(", ");
40
+ const step = lastStep
41
+ ? `${lastStep.name} bytes=${lastStep.bytes} age=${Math.max(0, at - lastStep.at)}ms`
42
+ : "none";
43
+ log(`[trantor] event-loop stall ${Math.round(durationMs)}ms (>${lagThresholdMs}ms); inFlight=${routes || "none"}; lastStep=${step}`);
44
+ };
45
+
46
+ return {
47
+ recordStep,
48
+ checkLag,
49
+ beginRequest(req) {
50
+ let path = "unknown";
51
+ try { path = new URL(req.url, "http://x").pathname; } catch {}
52
+ if (LONG_LIVED.has(path)) return;
53
+ const key = String(req.headers?.["x-trantor-pubkey"] || "").slice(0, 8);
54
+ const who = clean(`${req.socket?.remoteAddress || "unknown"}${key ? ` key:${key}` : ""}`);
55
+ inFlight.set(req, { method: clean(req.method), path: clean(path), who, startedAt: now() });
56
+ },
57
+ endRequest(req, res) {
58
+ const detail = inFlight.get(req);
59
+ if (!detail) return;
60
+ const endedAt = now();
61
+ detail.endedAt = endedAt;
62
+ const durationMs = endedAt - detail.startedAt;
63
+ if (durationMs > slowRequestThresholdMs && endedAt - lastSlowLog >= logIntervalMs) {
64
+ lastSlowLog = endedAt;
65
+ const bodyBytes = Math.max(0, Number(req._bodyBytes ?? req.headers?.["content-length"]) || 0);
66
+ log(`[trantor] slow request ${detail.method} ${detail.path} ${Math.round(durationMs)}ms (>${slowRequestThresholdMs}ms) body=${bodyBytes}B status=${res?.statusCode || 0} from=${detail.who}`);
67
+ }
68
+ },
69
+ start() {
70
+ if (timer) return;
71
+ delay.enable();
72
+ timer = setInterval(checkLag, sampleIntervalMs);
73
+ timer.unref?.();
74
+ },
75
+ stop() {
76
+ if (timer) clearInterval(timer);
77
+ timer = null;
78
+ delay.disable();
79
+ },
80
+ };
81
+ }
@@ -0,0 +1,27 @@
1
+ // #13920: machine health heartbeat payload — one source for the shape the runner posts and the
2
+ // hub validates. Pure functions over an os-like module so tests feed a fake os (no /proc reads,
3
+ // no shell-outs); the runner passes Node's own os functions.
4
+ import { cpus, freemem, loadavg, totalmem } from "node:os";
5
+
6
+ export const HEALTH_BEAT_MS = 30_000; // heartbeat cadence; three beats fit the stale window
7
+ export const HEALTH_STALE_MS = Number(process.env.RELAY_HEALTH_STALE_MS || 90_000);
8
+
9
+ // cpuPct is the 1-min loadavg over the core count, as a percent — it CAN exceed 100 (a machine
10
+ // oversubscribed past its cores must not read as a capped, calm 100). Memory is used/total bytes;
11
+ // "used" is total minus free, the same arithmetic every system monitor shows.
12
+ export function healthPayload(osLike, machine, now = Date.now()) {
13
+ const cores = Math.max(1, (Array.isArray(osLike.cpus()) ? osLike.cpus() : []).length);
14
+ const load = Number(osLike.loadavg()?.[0]);
15
+ const total = Number(osLike.totalmem());
16
+ const free = Number(osLike.freemem());
17
+ const cpuPct = Number.isFinite(load) && load >= 0 ? Math.round((load / cores) * 100) : null;
18
+ return {
19
+ machine: String(machine || ""),
20
+ cpuPct,
21
+ memUsed: Number.isFinite(total) && Number.isFinite(free) ? Math.max(0, total - free) : null,
22
+ memTotal: Number.isFinite(total) ? total : null,
23
+ ts: now(),
24
+ };
25
+ }
26
+
27
+ export const defaultOs = { cpus, freemem, loadavg, totalmem };
@@ -0,0 +1,16 @@
1
+ import { homedir } from "node:os";
2
+ import { join } from "node:path";
3
+
4
+ export function sharedCacheDir(project, home = homedir()) {
5
+ const safeProject = String(project).replace(/\.{2,}/g, "_").replace(/[^A-Za-z0-9_.-]/g, "_");
6
+ return join(home, ".agent-bus", "cache", safeProject);
7
+ }
8
+
9
+ export function seatBuildCacheEnv(env, project, home = homedir()) {
10
+ const cache = sharedCacheDir(project, home);
11
+ return {
12
+ ...env,
13
+ CARGO_TARGET_DIR: env.CARGO_TARGET_DIR || join(cache, "cargo-target"),
14
+ TRANTOR_SHARED_CACHE: cache,
15
+ };
16
+ }
@@ -26,7 +26,7 @@ function gitOut(args, cwd) {
26
26
  }
27
27
 
28
28
  // Start a new contract from its pinned base unless that base is already in the seat's history.
29
- // A move over unharvested work is refused, keeping the branch tip reachable for harvesting.
29
+ // Unharvested commits are parked on harvest/<card-or-sha> before moving the seat branch.
30
30
  export function alignSeatWorktree({ dir, project, agent, base, receiptsRoot, log = console.log }) {
31
31
  const branch = gitOut(["rev-parse", "--abbrev-ref", "HEAD"], dir);
32
32
  const expected = `seat/${agent}`;
@@ -42,13 +42,25 @@ export function alignSeatWorktree({ dir, project, agent, base, receiptsRoot, log
42
42
 
43
43
  const receipts = readReceipts(project, receiptsRoot);
44
44
  const audit = auditSeat(dir, { branch, targetRef: base, receipts });
45
- if (audit.unharvested.length) {
46
- const commits = audit.unharvested.map(c => `${c.sha.slice(0, 7)} (${c.subject})`).join(", ");
47
- return { ok: false, reason: `refusing to move ${branch}: ${audit.unharvested.length} unharvested commit(s) would be lost: ${commits}` };
45
+ const parked = [];
46
+ for (const commit of audit.unharvested) {
47
+ const refs = gitOut(["for-each-ref", "--format=%(refname)", "refs/heads/harvest"], dir).split("\n").filter(Boolean);
48
+ const saved = refs.some(ref => spawnSync("git", ["merge-base", "--is-ancestor", commit.sha, ref], { cwd: dir, stdio: "ignore", timeout: 8000 }).status === 0);
49
+ if (saved) continue;
50
+ const subjectCard = commit.subject.match(/#(\d+)/)?.[1];
51
+ const key = subjectCard || commit.sha.slice(0, 7);
52
+ let name = `harvest/${key}`;
53
+ const existing = gitOut(["rev-parse", "--verify", "--quiet", `refs/heads/${name}`], dir);
54
+ if (existing && existing !== commit.sha) name = `harvest/${key}-${commit.sha.slice(0, 7)}`;
55
+ const save = spawnSync("git", ["update-ref", `refs/heads/${name}`, commit.sha], { cwd: dir, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], timeout: 8000 });
56
+ if (save.status !== 0) return { ok: false, reason: `could not park ${commit.sha.slice(0, 7)} at ${name}: ${String(save.stderr || "git update-ref failed").trim()}` };
57
+ parked.push(name);
48
58
  }
49
59
  const reset = spawnSync("git", ["reset", "--hard", base], { cwd: dir, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], timeout: 15000 });
50
60
  if (reset.status !== 0) return { ok: false, reason: `could not align to ${base}: ${String(reset.stderr || reset.stdout || "git reset failed").trim()}` };
51
- return { ok: true, to: gitOut(["rev-parse", "HEAD"], dir), parked: "" };
61
+ const uniqueParked = [...new Set(parked)];
62
+ if (uniqueParked.length) log(`saved unharvested commits at ${uniqueParked.join(", ")}`);
63
+ return { ok: true, to: gitOut(["rev-parse", "HEAD"], dir), parked: uniqueParked.join(", ") };
52
64
  }
53
65
 
54
66
  // Returns { dir, created }: dir is the seat worktree, or sourceDir when no worktree applies
@@ -0,0 +1,10 @@
1
+ export const AXE_VERSION = "2.1.1";
2
+
3
+ export function axeDoctorStatus(platform, present, version = "") {
4
+ if (platform !== "darwin") return { kind: "note", message: "AXe version check applies on macOS hosts with iOS Simulator." };
5
+ if (!present) return { kind: "warn", message: "AXe missing; install pinned v2.1.1 with the Trantor installer." };
6
+ const found = String(version).trim().replace(/^v/, "");
7
+ if (!found) return { kind: "warn", message: `AXe is present, but its version could not be read; Trantor pins v${AXE_VERSION}.` };
8
+ if (found === AXE_VERSION) return { kind: "ok", message: `AXe v${found} installed (Trantor pin).` };
9
+ return { kind: "warn", message: `AXe v${found} installed; Trantor pins v${AXE_VERSION}.` };
10
+ }
@@ -0,0 +1,59 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { parse } from "yaml";
4
+
5
+ function majorMinor(version, source) {
6
+ const match = /^(\d+)\.(\d+)(?:\.|$)/.exec(version);
7
+ if (!match) throw new Error(`${source}: cannot read resolved version ${JSON.stringify(version)}`);
8
+ return `${match[1]}.${match[2]}`;
9
+ }
10
+
11
+ function cargoLockVersions(lockfile) {
12
+ const versions = new Map();
13
+ for (const block of lockfile.split("[[package]]").slice(1)) {
14
+ const name = /^name = "([^"]+)"$/m.exec(block)?.[1];
15
+ const version = /^version = "([^"]+)"$/m.exec(block)?.[1];
16
+ if (!name || !version) continue;
17
+ if (!versions.has(name)) versions.set(name, new Set());
18
+ versions.get(name).add(version);
19
+ }
20
+ return versions;
21
+ }
22
+
23
+ function npmLockVersion(lockfile, packageName) {
24
+ const importer = lockfile.importers?.["."];
25
+ for (const section of ["dependencies", "devDependencies"]) {
26
+ const version = importer?.[section]?.[packageName]?.version;
27
+ if (version) return version.split("(")[0];
28
+ }
29
+ throw new Error(`desktop/pnpm-lock.yaml: no resolved version for ${packageName}`);
30
+ }
31
+
32
+ export function checkTauriVersionParity(desktopDir) {
33
+ const manifest = readFileSync(join(desktopDir, "src-tauri", "Cargo.toml"), "utf8");
34
+ const packageJson = JSON.parse(readFileSync(join(desktopDir, "package.json"), "utf8"));
35
+ const cargoLock = cargoLockVersions(readFileSync(join(desktopDir, "src-tauri", "Cargo.lock"), "utf8"));
36
+ const pnpmLock = parse(readFileSync(join(desktopDir, "pnpm-lock.yaml"), "utf8"));
37
+ const npmPackages = { ...packageJson.devDependencies, ...packageJson.dependencies };
38
+ const crateNames = [...manifest.matchAll(/^(tauri|tauri-plugin-[a-z0-9-]+)\s*=/gm)].map(match => match[1]);
39
+ const pairs = [];
40
+
41
+ for (const crateName of new Set(crateNames)) {
42
+ const npmPackage = crateName === "tauri" ? "@tauri-apps/api" : `@tauri-apps/${crateName.slice("tauri-".length)}`;
43
+ if (!npmPackages[npmPackage]) continue;
44
+ const resolvedCargo = [...(cargoLock.get(crateName) || [])];
45
+ if (resolvedCargo.length !== 1) {
46
+ throw new Error(`desktop/src-tauri/Cargo.lock: expected one resolved ${crateName}, found ${resolvedCargo.length}`);
47
+ }
48
+ const cargoVersion = resolvedCargo[0];
49
+ const npmVersion = npmLockVersion(pnpmLock, npmPackage);
50
+ pairs.push({
51
+ crateName,
52
+ npmPackage,
53
+ cargoVersion,
54
+ npmVersion,
55
+ matches: majorMinor(cargoVersion, "desktop/src-tauri/Cargo.lock") === majorMinor(npmVersion, "desktop/pnpm-lock.yaml"),
56
+ });
57
+ }
58
+ return pairs;
59
+ }
@@ -46,6 +46,33 @@ export function isMessageCardTitle(title) {
46
46
  return MESSAGE_CARD_PREFIXES.some((p) => t.startsWith(p));
47
47
  }
48
48
 
49
+ /// #13923: may THIS seat instance work a card its name owns? A seat NAME is reused across
50
+ /// instances but the board's assignee only knows the name, so without a fence a fresh instance
51
+ /// inherits the name's old cards at kickoff (#12138). This instance's work: a card newer than its
52
+ /// start, or contracted after it. bootTs 0 fails OPEN; old assignments stay on the board, untouched.
53
+ export function ownCardForInstance(card, { bootTs = 0, contractedIds = null } = {}) {
54
+ if (!(Number(bootTs) > 0)) return true;
55
+ if ((Number(card?.ts) || 0) >= bootTs) return true;
56
+ return !!contractedIds && contractedIds.has(Number(card?.id));
57
+ }
58
+
59
+ /// #13923: the card ids a direct post-start message contracted to this session — the ids its text
60
+ /// cites plus a hub-stamped `card` field. Direct only (a broadcast @mention contracts nothing),
61
+ /// from someone else, and meant to wake: `wake: false` is context by the sender's own word and
62
+ /// kind "status" is chatter — the same demotions the runner's shouldWake applies.
63
+ export function contractedCardIds(messages, { session = "", bootTs = 0 } = {}) {
64
+ const ids = new Set();
65
+ for (const m of Array.isArray(messages) ? messages : []) {
66
+ if (!m || m.to !== session || m.from === session) continue;
67
+ if (m.wake === false || m.kind === "status") continue;
68
+ if (Number(bootTs) > 0 && !(Number(m.ts) >= bootTs)) continue;
69
+ const stamped = Number(m.card);
70
+ if (Number.isFinite(stamped) && stamped > 0) ids.add(stamped);
71
+ for (const id of cardRefs(m.text)) ids.add(id);
72
+ }
73
+ return ids;
74
+ }
75
+
49
76
  /// The card this text ASSIGNS, or 0 when it only mentions cards. Leftmost assignment wins: an
50
77
  /// order says what it wants first and explains itself after.
51
78
  export function assignedCardRef(text) {
package/mcp.mjs CHANGED
@@ -15,7 +15,7 @@ import { signedPost, signedGet } from "./hooks/lib/api.mjs";
15
15
  import { anchorCursor } from "./hooks/lib/inbox-ledger.mjs";
16
16
  import { formatInboxPage, fmtMessage } from "./hooks/lib/inbox-page.mjs";
17
17
  import { assertNoSecrets } from "./lib/scrub.mjs";
18
- import { isMessageCardTitle, OPEN_CARD_STATUSES } from "./lib/turn-policy.mjs";
18
+ import { isMessageCardTitle, OPEN_CARD_STATUSES, ownCardForInstance, contractedCardIds } from "./lib/turn-policy.mjs";
19
19
  import { markDoing, hollowVerdict, blastRadius, blastLine } from "./hooks/lib/hollow-move.mjs";
20
20
 
21
21
  import { dep } from "./lib/dep.mjs";
@@ -44,6 +44,11 @@ let cursor = 0;
44
44
  // BOOT, never to the first call — a "now" seed swallowed #7282. PEEK only: the hooks own the
45
45
  // delivery ledger; a non-peek seed here marked unseen messages delivered.
46
46
  const BOOT_TS = Date.now();
47
+ // #13923: when the SEAT INSTANCE (the runner) started, stamped into the turn shell's env. A seat
48
+ // name is reused across instances, so "cards assigned to my name" must not cross this line: an
49
+ // assignment made before it belongs to a predecessor that happened to wear the same name. 0 = no
50
+ // runner over us (a solo session, or an old runner) — the fence fails open.
51
+ const SEAT_BOOT_TS = Number(process.env.TRANTOR_SEAT_BOOT_TS) || 0;
47
52
  let cursorSeeded = false;
48
53
  async function seedCursor() {
49
54
  if (cursorSeeded) return;
@@ -393,11 +398,28 @@ server.tool("relay_board", "Show a project's Kanban board (cards, status, assign
393
398
  const own = (slim.tasks || [])
394
399
  .filter(t => t.assignee === SESSION && OPEN_CARD_STATUSES.includes(t.status) && !isMessageCardTitle(t.title))
395
400
  .sort((a, b) => (b.updated || b.ts || 0) - (a.updated || a.ts || 0));
396
- if (!own.length) return { content: [{ type: "text", text: `${proj}: no cards assigned to ${SESSION} in doing/testing/todo` }] };
401
+ // #13923: the instance fence. Cards whose assignment predates this seat instance's start are
402
+ // passed over (they stay on the board, untouched) unless a direct post-start message contracted
403
+ // them. This is the kickoff's first call, so it is exactly where a reused name used to inherit
404
+ // its predecessor's cards (#12138). Only spend the inbox peek when there is something to fence.
405
+ let list = own, ignored = 0;
406
+ if (SEAT_BOOT_TS > 0 && own.some(t => (Number(t.ts) || 0) < SEAT_BOOT_TS)) {
407
+ let contracted = new Set();
408
+ try {
409
+ const r = await api("GET", `/inbox?session=${encodeURIComponent(SESSION)}&since=0&peek=1`);
410
+ contracted = contractedCardIds(r?.messages, { session: SESSION, bootTs: SEAT_BOOT_TS });
411
+ } catch { /* inbox unreadable: the fence holds — an explicit contract still wakes the seat */ }
412
+ list = own.filter(t => ownCardForInstance(t, { bootTs: SEAT_BOOT_TS, contractedIds: contracted }));
413
+ ignored = own.length - list.length;
414
+ }
415
+ // Say what was passed over in BOTH shapes: the seat that sees nothing must know there is
416
+ // nothing to fetch, and the seat holding a fresh card must not sweep the board for the rest.
417
+ const ignoredNote = ignored ? ` (${ignored} assignment(s) made before this seat instance started — old assignments stay on the board until a contract cites them)` : "";
418
+ if (!list.length) return { content: [{ type: "text", text: `${proj}: no cards assigned to ${SESSION} in doing/testing/todo${ignoredNote}` }] };
397
419
  // Re-attach the full card for each id in ONE request (hub honors a comma-separated card= list;
398
420
  // an older hub returns everything slim, which cardView still renders — notes just stay folded).
399
- const { tasks } = await api("GET", `/tasks?project=${encodeURIComponent(proj)}&fields=slim&card=${encodeURIComponent(own.map(t => t.id).join(","))}`);
400
- return { content: [{ type: "text", text: own.map(t => cardView(tasks || [], t.id, proj)).join("\n\n") }] };
421
+ const { tasks } = await api("GET", `/tasks?project=${encodeURIComponent(proj)}&fields=slim&card=${encodeURIComponent(list.map(t => t.id).join(","))}`);
422
+ return { content: [{ type: "text", text: list.map(t => cardView(tasks || [], t.id, proj)).join("\n\n") + ignoredNote }] };
401
423
  }
402
424
  const { tasks } = await api("GET", `/tasks?project=${encodeURIComponent(proj)}&fields=slim${card ? `&card=${encodeURIComponent(card)}` : ""}`);
403
425
  if (!tasks.length) return { content: [{ type: "text", text: `${proj}: no cards yet` }] };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.18.129",
3
+ "version": "0.18.131",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "trantor": "bin/cli.mjs"
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: trantor-sim
3
+ description: Drive the iOS Simulator on a Mac through Trantor's guarded AXe wrapper for companion app drills and screenshot evidence.
4
+ ---
5
+
6
+ # Trantor iOS Simulator
7
+
8
+ Use this skill when an iOS task needs a live simulator. The stable interface is `trantor sim`; do not call raw `xcrun simctl` or `axe` for interactive actions. The wrapper tracks the simulator owned by this session, refuses a conflicting booted simulator, and prints JSON results.
9
+
10
+ This requires a Mac with Xcode and an available iOS Simulator runtime. It cannot drive an iOS Simulator from Linux. If AXe is missing, install the pinned release from the Trantor repository root:
11
+
12
+ ```bash
13
+ bash bin/install-axe.sh
14
+ ```
15
+
16
+ The installer downloads AXe v2.1.1 from its official GitHub release and checks the published SHA-256 before extracting it. Ensure `$HOME/.local/bin` is on `PATH`; `trantor doctor` reports whether the pinned version is present.
17
+
18
+ ## Run a drill
19
+
20
+ 1. Build the iOS app using the task's requested drill and retain the built `.app` path.
21
+ 2. Boot one simulator by its exact name or UDID. If another simulator is already booted, stop and coordinate; do not shut down a simulator you did not start.
22
+ 3. Install and launch the app, then inspect the screen and accessibility elements.
23
+ 4. Interact using an element label/identifier when available. Use point coordinates from the `screen` output only when no stable element selector exists. `screen` writes a PNG under `.agent-bus-out/sim/` and returns its path plus screen-scaled accessibility elements.
24
+ 5. Open/read the returned PNG as visual evidence. Capture a new screen after each meaningful action and record screenshots and the observed result in the drill report.
25
+ 6. Always call `trantor sim shutdown` in a `finally`/cleanup step, including after a failed build or interaction. Verify the JSON result says `shutdown: true` or the session owns no simulator.
26
+
27
+ Example:
28
+
29
+ ```bash
30
+ trantor sim boot "iPhone 17 Pro"
31
+ trantor sim install .agent-bus-out/ios/Trantor.app
32
+ trantor sim launch ai.trantor.companion
33
+ trantor sim screen
34
+ trantor sim tap --label "Continue"
35
+ trantor sim screen
36
+ trantor sim shutdown
37
+ ```
38
+
39
+ Commands:
40
+
41
+ ```text
42
+ trantor sim boot <device-name-or-udid>
43
+ trantor sim install <app-path>
44
+ trantor sim launch <bundle-id>
45
+ trantor sim screen [--out <png-path>]
46
+ trantor sim tap --label <text> | --id <identifier> | --xy x,y
47
+ trantor sim swipe --from x,y --to x,y
48
+ trantor sim type <text>
49
+ trantor sim shutdown
50
+ ```
51
+
52
+ Coordinates are logical points, matching the screenshot dimensions and AXe frames. `shutdown` is safe and idempotent: it shuts down only the simulator registered to the current session. Do not replace it with `xcrun simctl shutdown all`.
53
+
54
+ The wrapper owns local simulator exploration; existing `ios/` build and XCTest drills remain the required deterministic test gate. Turn confirmed exploratory findings into a focused regression test when practical.