From 1f510ad5c76af7b44ef3bed66581d0b38f42c67f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Thu, 15 Oct 2026 16:21:20 +0200 Subject: [PATCH 1/2] refactor(test): move the interaction-guarantee and command-doc guards to test/repo-guards (pure git mv) Path fixes follow in the next commit. Co-Authored-By: Claude Opus 5.5 --- {src/__tests__ => test/repo-guards}/command-doc-coverage.test.ts | 0 .../contracts => test/repo-guards}/interaction-guarantees.test.ts | 0 .../contracts => test/repo-guards}/runner-source-assertions.ts | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {src/__tests__ => test/repo-guards}/command-doc-coverage.test.ts (100%) rename {src/__tests__/contracts => test/repo-guards}/interaction-guarantees.test.ts (100%) rename {src/__tests__/contracts => test/repo-guards}/runner-source-assertions.ts (100%) diff --git a/src/__tests__/command-doc-coverage.test.ts b/test/repo-guards/command-doc-coverage.test.ts similarity index 100% rename from src/__tests__/command-doc-coverage.test.ts rename to test/repo-guards/command-doc-coverage.test.ts diff --git a/src/__tests__/contracts/interaction-guarantees.test.ts b/test/repo-guards/interaction-guarantees.test.ts similarity index 100% rename from src/__tests__/contracts/interaction-guarantees.test.ts rename to test/repo-guards/interaction-guarantees.test.ts diff --git a/src/__tests__/contracts/runner-source-assertions.ts b/test/repo-guards/runner-source-assertions.ts similarity index 100% rename from src/__tests__/contracts/runner-source-assertions.ts rename to test/repo-guards/runner-source-assertions.ts From fa2f289870ea755160e2283eb84d726676a29435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Thu, 15 Oct 2026 16:21:52 +0200 Subject: [PATCH 2/2] refactor(test): resolve the repo root and gate references from test/repo-guards Root-relative paths, the check:command-docs script path, and path samples in gate tests and a workflow comment. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/pr-preview.yml | 2 +- package.json | 2 +- scripts/check-affected/device-lanes.test.ts | 2 +- scripts/gate/model.test.ts | 4 ++-- test/repo-guards/command-doc-coverage.test.ts | 4 ++-- test/repo-guards/runner-source-assertions.ts | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.yml index 0e26ed7303..e294a64a05 100644 --- a/.github/workflows/pr-preview.yml +++ b/.github/workflows/pr-preview.yml @@ -21,7 +21,7 @@ jobs: command-docs-gate: # ci.yml ignores website/**, so a docs-only PR never triggers the unit lane # that carries the command-reference coverage gate - # (src/__tests__/command-doc-coverage.test.ts). Run it here — where + # (test/repo-guards/command-doc-coverage.test.ts). Run it here — where # commands.md changes DO trigger a workflow — so documenting a retired # command (or dropping a public command's docs) fails on docs-only PRs too. # Unlike deploy-preview this has no fork guard: the gate is read-only and diff --git a/package.json b/package.json index cfd17ac384..c877b66e59 100644 --- a/package.json +++ b/package.json @@ -160,7 +160,7 @@ "check:production-exports": "fallow dead-code --config fallow-production-exports.json --production --unused-exports --fail-on-issues", "check:bundle-owner-files": "node --experimental-strip-types scripts/check-bundle-owner-files.ts", "check:package": "node --experimental-strip-types scripts/check-package.ts", - "check:command-docs": "vitest run --project unit-core src/__tests__/command-doc-coverage.test.ts", + "check:command-docs": "vitest run --project unit-core test/repo-guards/command-doc-coverage.test.ts", "check:doc-links": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/__tests__/check-doc-links.test.ts && pnpm --dir website build && node --experimental-strip-types scripts/check-doc-links.ts", "check:doc-prose": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/__tests__/check-doc-prose.test.ts && node --experimental-strip-types scripts/check-doc-prose.ts", "check:agent-guidance": "node --experimental-strip-types scripts/node-test-tmpdir.ts --experimental-strip-types --test scripts/__tests__/agent-guidance-contract.test.ts", diff --git a/scripts/check-affected/device-lanes.test.ts b/scripts/check-affected/device-lanes.test.ts index b8924627d3..f120c84c9c 100644 --- a/scripts/check-affected/device-lanes.test.ts +++ b/scripts/check-affected/device-lanes.test.ts @@ -129,7 +129,7 @@ test('the fixture app owns the mobile lanes whichever subtree changes', () => { test('unit tests under src/ and packages/*/src own no lane', () => { for (const file of [ 'packages/daemon/src/sessions/handlers/snapshot-runtime-route.test.ts', - 'src/__tests__/contracts/interaction-guarantees.test.ts', + 'src/__tests__/agent-device-client.test.ts', 'packages/platform-apple/src/core/__tests__/apps.test.ts', 'packages/platform-apple/src/runtime.test.ts', ]) { diff --git a/scripts/gate/model.test.ts b/scripts/gate/model.test.ts index a2ff41692c..0f6391e848 100644 --- a/scripts/gate/model.test.ts +++ b/scripts/gate/model.test.ts @@ -42,10 +42,10 @@ test('a filtered Vitest run does not credit the whole project', () => { const units = scriptUnits( 'docs', scriptModel({ - docs: 'vitest run --project unit-core src/__tests__/command-doc-coverage.test.ts', + docs: 'vitest run --project unit-core test/repo-guards/command-doc-coverage.test.ts', }), ); - assert.deepEqual(units, ['vitest:unit-core@src/__tests__/command-doc-coverage.test.ts']); + assert.deepEqual(units, ['vitest:unit-core@test/repo-guards/command-doc-coverage.test.ts']); assert.equal( unitCovers('vitest:unit-core', units[0] as string), true, diff --git a/test/repo-guards/command-doc-coverage.test.ts b/test/repo-guards/command-doc-coverage.test.ts index 6e6f30156d..e6fb43cd4b 100644 --- a/test/repo-guards/command-doc-coverage.test.ts +++ b/test/repo-guards/command-doc-coverage.test.ts @@ -3,8 +3,8 @@ import assert from 'node:assert/strict'; import { describe, test } from 'vitest'; import { PUBLIC_COMMANDS, isKnownCliCommandName } from '@agent-device/command-registry/catalog'; import { cliCommandAlias } from '@agent-device/command-registry/cli-command-aliases'; -import { getCliCommandSchema } from '../commands/schema/command-schema.ts'; -import { buildCommandUsage } from '../commands/schema/usage.ts'; +import { getCliCommandSchema } from '../../src/commands/schema/command-schema.ts'; +import { buildCommandUsage } from '../../src/commands/schema/usage.ts'; // Enumerates the public command surface (`PUBLIC_COMMANDS`, derived from the // command descriptor registry) against the human-facing command reference at diff --git a/test/repo-guards/runner-source-assertions.ts b/test/repo-guards/runner-source-assertions.ts index e7de0567cf..b703242778 100644 --- a/test/repo-guards/runner-source-assertions.ts +++ b/test/repo-guards/runner-source-assertions.ts @@ -2,7 +2,7 @@ import assert from 'node:assert/strict'; import fs from 'node:fs'; import path from 'node:path'; -export const PROJECT_ROOT = path.resolve(import.meta.dirname, '../../..'); +export const PROJECT_ROOT = path.resolve(import.meta.dirname, '../..'); const RUNNER_SOURCES_DIR = path.join( PROJECT_ROOT,