Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
38cb24e
fix(platforms): build exec failure details through execFailureDetails
claude Nov 10, 2026
17d24e1
test: skip chmod-forced failure tests when running as root
claude Nov 10, 2026
cf55cb4
test(coverage): bind Android contract evidence to repository test files
claude Nov 10, 2026
7b47102
test(interaction-contract): fail when a coverage claim names no regis…
claude Nov 10, 2026
1da7a8e
test(daemon-client): route loopback skips through skipWhenLoopbackUna…
claude Nov 10, 2026
b7ac725
docs(providers): make the BrowserStack and AWS Device Farm snippets t…
claude Nov 10, 2026
7580cf9
fix(check-affected): derive public-surface sources from build entries
claude Nov 10, 2026
dbdfa7e
fix(ci): keep both sides of a rename in device-lane selection
claude Nov 10, 2026
a72e3e8
fix(mutation): fail selection when git diff against the base fails
claude Nov 10, 2026
97f2618
build: drop tsdown chunk groups for removed source paths
claude Nov 10, 2026
971e1b1
ci: run provider integration once and sweep fresh torture seeds
claude Nov 10, 2026
30c89f2
chore(gates): make guards fail on the violations they exist for
claude Nov 10, 2026
9c3d482
test: inject the write and read failures instead of skipping as root
claude Nov 10, 2026
1542b0c
fix(platform-android): keep the adb classification over xcrun details
claude Nov 10, 2026
9ab9c9d
ci(torture): validate dispatch inputs and use a fixed seed stride
claude Nov 10, 2026
b79d5e5
chore(gates): tighten review follow-ups on the new guards
claude Nov 10, 2026
7c699e3
fix(platform-android): keep the missing-tool hint when no adb pattern…
claude Nov 10, 2026
6d8952a
test(test-kit): make skipWhenLoopbackUnavailable the only loopback check
claude Nov 10, 2026
a2959b3
chore(gates): check interaction-contract claims in a project setup hook
claude Nov 10, 2026
f42d8ba
chore(gates): register the contract setup files with Fallow
claude Nov 10, 2026
f07fb59
Merge origin/main into claude/audit-findings-remediation-62d6ky-gates
claude Nov 10, 2026
18e63a8
test(interaction-contract): require a contract test beside every cove…
claude Nov 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ jobs:
id: run-coverage
env:
OUTPUT_ECONOMY_BASE: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
# A loopback-dependent test fails here instead of skipping when bind is denied.
AGENT_DEVICE_REQUIRE_LOOPBACK_TESTS: '1'
uses: ./.github/actions/run-gate
with: { gate: unit-ci }

Expand Down Expand Up @@ -388,10 +390,6 @@ jobs:
uses: ./.github/actions/run-gate
with: { gate: concurrency-torture }

- name: Run provider-backed integration tests
uses: ./.github/actions/run-gate
with: { gate: provider-integration }

- name: Check Provider-backed integration architecture progress
uses: ./.github/actions/run-gate
with: { gate: integration-progress }
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/concurrency-torture-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
required: false
default: '5000'
seed-start:
description: 'First seed in the sweep'
description: 'First seed in the sweep (default: run number x runs, a fresh range each run)'
required: false
default: '0'
default: ''

permissions:
contents: read
Expand All @@ -40,7 +40,8 @@
timeout-minutes: 20
env:
TORTURE_RUNS: ${{ github.event.inputs.runs || '5000' }}
TORTURE_SEED_START: ${{ github.event.inputs.seed-start || '0' }}
# Job-level env would override a value written to GITHUB_ENV, so the step below sets the start.
SEED_START_INPUT: ${{ github.event.inputs.seed-start }}
# Standard scheduled-lane artifact envelope (#1430) built via the shared
# scripts/lib/lane-envelope.ts (commit, tool/configHash, seed range, result);
# the seed sweep rides in the typed data payload. Emitted by the test and
Expand All @@ -53,6 +54,11 @@
- name: Setup toolchain
uses: ./.github/actions/setup-node-pnpm

# A seed fully determines execution order, so a fixed range only re-proves old seeds.
# Without an explicit start, each run sweeps the next unvisited range.
- name: Choose the seed range
run: echo "TORTURE_SEED_START=${SEED_START_INPUT:-$((GITHUB_RUN_NUMBER * TORTURE_RUNS))}" >> "$GITHUB_ENV"
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved

Check warning on line 61 in .github/workflows/concurrency-torture-nightly.yml

View check run for this annotation

apex-sentinel-staging / Apex Sentinel

minor: Nightly torture seeds overlap when the runs input changes between runs

A dispatch with `runs=1000` sweeps `[runNumber*1000, +1000)`, which lands inside a range an earlier run already proved; a later dispatch back at 5000 repeats old seeds too. The default start is computed as `GITHUB_RUN_NUMBER * TORTURE_RUNS`, so the unvisited-range invariant only holds while `TORTURE_RUNS` stays 5000, and nothing derives the range from a persisted high-water mark. ### Also raised here Also raised at this location by persona `javascript`: Nightly torture seed range silently collides when runs count changes — The seed start defaults to `GITHUB_RUN_NUMBER * TORTURE_RUNS`, so the sweep range only tiles without gaps or repeats while TORTURE\_RUNS stays at 5000; a manual dispatch with `runs: 10000` after a 5000-run sweep re-proves seeds the previous run already swept while skipping the range in between. Nothing records or asserts the range actually swept, so the collision is invisible in the envelope the freshness watcher reads. Also raised at this location by persona `maintainability`: Nightly torture seed stride ignores the runs input, opening a permanent gap — Dispatch the nightly lane once with runs=1000 and again with runs=5000 and seeds 5000–14999 are never swept: the start is `GITHUB_RUN_NUMBER * TORTURE_RUNS` while the width is `TORTURE_RUNS`, so a smaller runs value in any earlier run moves every later run's range by a different amount and the skipped seeds are only visited again by chance. The stride should be a fixed constant, not the per-run batch size. Derive the start from a constant sweep width (e.g. `GITHUB_RUN_NUMBER * SWEEP_WIDTH`) and clamp TORTURE\_RUNS to that width.
Comment thread
thymikee marked this conversation as resolved.
Resolved
- name: Run concurrency torture sweep
uses: ./.github/actions/run-gate
with: { gate: concurrency-torture }
Expand Down
3 changes: 3 additions & 0 deletions examples/sdk/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"agent-device/remote-config": ["../../src/sdk/remote-config.ts"],
"agent-device/install-source": ["../../src/sdk/install-source.ts"],
"agent-device/android-adb": ["../../src/sdk/android-adb.ts"],
"agent-device/limrun": ["../../src/sdk/limrun.ts"],
"agent-device/plugins": ["../../src/sdk/plugins.ts"],
"agent-device/plugins/webdriver": ["../../src/sdk/plugin-webdriver.ts"],
"agent-device/contracts": ["../../src/sdk/contracts.ts"],
"agent-device/finders": ["../../src/sdk/finders.ts"],
"agent-device/selectors": ["../../src/sdk/selectors.ts"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,31 +169,36 @@ test('a confirmed failed-adoption cleanup lifts an earlier block on the device',
expect(() => context.admissionLedger.assertStartAllowed(context.device)).not.toThrow();
});

test('an unconfirmed failed-adoption cleanup blocks a replacement start in this process', async () => {
const context = makeDurableCaptureContext();
const start = makeDurableCaptureStartResult(context, {
cleanup: { status: 'cleanup-pending', reason: 'cleanup-unconfirmed' },
});
const primary = new AppError('CANCELED', 'request canceled');
const resourceDir = path.dirname(context.resourcePath);

try {
await expect(
testCaptureResource.adoptStarted({
...context,
...start,
throwIfCanceled: () => {
fs.chmodSync(resourceDir, 0o500);
throw primary;
},
}),
).rejects.toBe(primary);
} finally {
fs.chmodSync(resourceDir, 0o700);
}

expect(() => context.admissionLedger.assertStartAllowed(context.device)).toThrow(/process-local/);
});
test.skipIf(process.getuid?.() === 0)(
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved
'an unconfirmed failed-adoption cleanup blocks a replacement start in this process',
async () => {
const context = makeDurableCaptureContext();
const start = makeDurableCaptureStartResult(context, {
cleanup: { status: 'cleanup-pending', reason: 'cleanup-unconfirmed' },
});
const primary = new AppError('CANCELED', 'request canceled');
const resourceDir = path.dirname(context.resourcePath);

try {
await expect(
testCaptureResource.adoptStarted({
...context,
...start,
throwIfCanceled: () => {
fs.chmodSync(resourceDir, 0o500);
throw primary;
},
}),
).rejects.toBe(primary);
} finally {
fs.chmodSync(resourceDir, 0o700);
}

expect(() => context.admissionLedger.assertStartAllowed(context.device)).toThrow(
/process-local/,
);
},
);

function testScope() {
return {
Expand Down
61 changes: 32 additions & 29 deletions packages/capture-kit/src/durable-capture/adoption.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,38 +82,41 @@ test('canceled adoption terminalizes its manifest when the session retires durin
expect(context.reportUndurableCleanup).toHaveBeenCalledWith(context.device, { confirmed: true });
});

test('a failed terminal transition preserves the primary error and reports it unconfirmed', async () => {
const context = makeDurableCaptureContext();
const start = makeDurableCaptureStartResult(context, {
cleanup: { status: 'cleanup-pending', reason: 'cleanup-unconfirmed' },
});
const primary = new AppError('CANCELED', 'request canceled');
const resourceDir = path.dirname(context.resourcePath);
test.skipIf(process.getuid?.() === 0)(
Comment thread
thymikee marked this conversation as resolved.
Resolved
'a failed terminal transition preserves the primary error and reports it unconfirmed',
async () => {
const context = makeDurableCaptureContext();
const start = makeDurableCaptureStartResult(context, {
cleanup: { status: 'cleanup-pending', reason: 'cleanup-unconfirmed' },
});
const primary = new AppError('CANCELED', 'request canceled');
const resourceDir = path.dirname(context.resourcePath);

try {
await expect(
adoptStartedDurableCapture(
testCaptureDefinition,
{
...context,
...start,
throwIfCanceled: () => {
fs.chmodSync(resourceDir, 0o500);
throw primary;
try {
await expect(
adoptStartedDurableCapture(
testCaptureDefinition,
{
...context,
...start,
throwIfCanceled: () => {
fs.chmodSync(resourceDir, 0o500);
throw primary;
},
},
},
context.resourcePath,
),
).rejects.toBe(primary);
} finally {
fs.chmodSync(resourceDir, 0o700);
}
context.resourcePath,
),
).rejects.toBe(primary);
} finally {
fs.chmodSync(resourceDir, 0o700);
}

expect(context.reportUndurableCleanup).toHaveBeenCalledWith(context.device, {
confirmed: false,
reason: expect.stringMatching(/./),
});
});
expect(context.reportUndurableCleanup).toHaveBeenCalledWith(context.device, {
confirmed: false,
reason: expect.stringMatching(/./),
});
},
);

test('adoption refuses a retired lifetime even when its address has a vacant successor', async () => {
const context = makeDurableCaptureContext();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'node:assert/strict';
import { afterEach, test, vi } from 'vitest';
import { closeLoopbackServer, supportsLoopbackBind } from '@agent-device/test-kit';
import { closeLoopbackServer, skipWhenLoopbackUnavailable } from '@agent-device/test-kit';
import { AppError } from '@agent-device/kernel/errors';
import {
isProcessAlive,
Expand Down Expand Up @@ -141,9 +141,7 @@ async function waitForExit(pid: number): Promise<void> {
}

async function withLoopback(t: { skip: (note: string) => void }): Promise<boolean> {
if (await supportsLoopbackBind()) return true;
t.skip('loopback listeners are not permitted in this environment');
return false;
return !(await skipWhenLoopbackUnavailable(t));
}

test('a drain that outlasts the old kill window is waited out, not signaled', async (t) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import { afterEach, test, vi } from 'vitest';
import { closeLoopbackServer, supportsLoopbackBind } from '@agent-device/test-kit';
import { closeLoopbackServer, skipWhenLoopbackUnavailable } from '@agent-device/test-kit';
import { AppError } from '@agent-device/kernel/errors';
import { DAEMON_QUIESCE_COMMAND } from '@agent-device/daemon-contracts/daemon-resolution';
import { DAEMON_STARTUP_EXIT_CODES } from '@agent-device/daemon-contracts/daemon-registration-owner';
Expand Down Expand Up @@ -95,9 +95,7 @@ async function failureOf(run: Promise<unknown>): Promise<AppError> {
}

async function withLoopback(t: { skip: (note: string) => void }): Promise<boolean> {
if (await supportsLoopbackBind()) return true;
t.skip('loopback listeners are not permitted in this environment');
return false;
return !(await skipWhenLoopbackUnavailable(t));
}

test('attach reports a missing daemon without starting one', async (t) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import assert from 'node:assert/strict';
import { test } from 'vitest';
import { closeLoopbackServer, supportsLoopbackBind } from '@agent-device/test-kit';
import { closeLoopbackServer, skipWhenLoopbackUnavailable } from '@agent-device/test-kit';
import { okResult, startScriptedDaemon } from './explicit-lifecycle-fixture.ts';

// The stand-in daemon is a loopback server on an ephemeral port, so anything else on the host that
// probes listening ports can reach it. Only the client under test speaks `POST /rpc`.

test('a stray request that is not a daemon request is refused and never recorded', async (t) => {
if (!(await supportsLoopbackBind())) return t.skip('loopback listeners are not permitted');
if (await skipWhenLoopbackUnavailable(t)) return;
const daemon = await startScriptedDaemon(okResult({}));
const base = `http://127.0.0.1:${daemon.port}`;
try {
Expand Down
20 changes: 10 additions & 10 deletions packages/daemon-client/src/__tests__/daemon-client-ensuring.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { afterEach, test, vi } from 'vitest';
import {
closeLoopbackServer,
createTestHostEnvironment,
supportsLoopbackBind,
skipWhenLoopbackUnavailable,
} from '@agent-device/test-kit';
import { AppError } from '@agent-device/kernel/errors';
import { isProcessAlive } from '@agent-device/host-kit/process';
Expand Down Expand Up @@ -58,7 +58,7 @@ function request(command: string, flags: Record<string, unknown>) {
}

test('the first request ensures a missing daemon once and every request attaches to it', async (t) => {
if (!(await supportsLoopbackBind())) return t.skip('loopback listeners are not permitted');
if (await skipWhenLoopbackUnavailable(t)) return;
const { stateDir, paths } = stateDirAndPaths();
const fresh = await startScriptedDaemon(okResult({}));
launchesFreshDaemonAt(spawn, paths, fresh.port);
Expand All @@ -82,7 +82,7 @@ test('the first request ensures a missing daemon once and every request attaches
});

test('an idle incompatible daemon is replaced, and the replacement is reported', async (t) => {
if (!(await supportsLoopbackBind())) return t.skip('loopback listeners are not permitted');
if (await skipWhenLoopbackUnavailable(t)) return;
const { stateDir, paths } = stateDirAndPaths();
const leaver = createDaemonLeaver();
const stale = await startScriptedDaemon(draining, { afterRpc: leaver.leave });
Expand Down Expand Up @@ -116,7 +116,7 @@ test('an idle incompatible daemon is replaced, and the replacement is reported',
});

test('a busy incompatible daemon fails the request before it is sent and keeps running', async (t) => {
if (!(await supportsLoopbackBind())) return t.skip('loopback listeners are not permitted');
if (await skipWhenLoopbackUnavailable(t)) return;
const { stateDir, paths } = stateDirAndPaths();
const stale = await startScriptedDaemon(
busy({ inFlightRequests: 0, sessions: 1, repairSessions: 0, leases: 0 }),
Expand Down Expand Up @@ -162,7 +162,7 @@ test('a remote connection passes through without ensuring or choosing a lifecycl
});

test('a one-shot replay on its own private daemon passes through, an explicit state dir does not', async (t) => {
if (!(await supportsLoopbackBind())) return t.skip('loopback listeners are not permitted');
if (await skipWhenLoopbackUnavailable(t)) return;
const { stateDir, paths } = stateDirAndPaths();
const fresh = await startScriptedDaemon(okResult({}));
launchesFreshDaemonAt(spawn, paths, fresh.port);
Expand All @@ -183,7 +183,7 @@ test('a one-shot replay on its own private daemon passes through, an explicit st
});

test('a daemon that disappears between requests is ensured again before the next one is sent', async (t) => {
if (!(await supportsLoopbackBind())) return t.skip('loopback listeners are not permitted');
if (await skipWhenLoopbackUnavailable(t)) return;
const { stateDir, paths } = stateDirAndPaths();
const fresh = await startScriptedDaemon(okResult({}));
launchesFreshDaemonAt(spawn, paths, fresh.port);
Expand Down Expand Up @@ -217,7 +217,7 @@ test('a daemon that disappears between requests is ensured again before the next
});

test('a registered daemon that answers nothing is replaced and reported as unreachable', async (t) => {
if (!(await supportsLoopbackBind())) return t.skip('loopback listeners are not permitted');
if (await skipWhenLoopbackUnavailable(t)) return;
const { stateDir, paths } = stateDirAndPaths();
// Both are bound before the dead one is closed, so the fresh daemon cannot be handed its port.
const closed = await startScriptedDaemon(okResult({}));
Expand All @@ -241,7 +241,7 @@ test('a registered daemon that answers nothing is replaced and reported as unrea
});

test('a failed ensure is retried by the next request instead of being remembered', async (t) => {
if (!(await supportsLoopbackBind())) return t.skip('loopback listeners are not permitted');
if (await skipWhenLoopbackUnavailable(t)) return;
const { stateDir, paths } = stateDirAndPaths();
const stale = await startScriptedDaemon(
busy({ inFlightRequests: 1, sessions: 0, repairSessions: 0, leases: 0 }),
Expand Down Expand Up @@ -277,7 +277,7 @@ test('a failed ensure is retried by the next request instead of being remembered
});

test('concurrent first requests share one ensure through the CLI and MCP transport', async (t) => {
if (!(await supportsLoopbackBind())) return t.skip('loopback listeners are not permitted');
if (await skipWhenLoopbackUnavailable(t)) return;
const { stateDir, paths } = stateDirAndPaths();
const fresh = await startScriptedDaemon(okResult({ via: 'fresh' }));
launchesFreshDaemonAt(spawn, paths, fresh.port);
Expand Down Expand Up @@ -313,7 +313,7 @@ test('concurrent first requests share one ensure through the CLI and MCP transpo
});

test('a request canceled before it starts does not start a daemon', async (t) => {
if (!(await supportsLoopbackBind())) return t.skip('loopback listeners are not permitted');
if (await skipWhenLoopbackUnavailable(t)) return;
const { stateDir, paths } = stateDirAndPaths();
const fresh = await startScriptedDaemon(okResult({}));
launchesFreshDaemonAt(spawn, paths, fresh.port);
Expand Down
Loading
Loading