Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
Select round and push tests by declared read edges (U-round) (#5985)
Nick Gomezc7e2f4ced84f
diff --git a/knip.config.ts b/knip.config.tsindex e59ddff92..0004a763a 100644--- a/knip.config.ts+++ b/knip.config.ts@@ -72,6 +72,7 @@ export default {'.{agents,codex}/skills/**': ['files'],'lint-plugins/no-comments/__fixtures__/**': ['files'],'lint-plugins/ok-rules/__fixtures__/**': ['files'],+ '**/*.reads.{ts,mjs}': ['files', 'exports'],'scripts/compute-next-beta.mjs': ['files'],'scripts/build-slack-release-payload.mjs': ['files'],'scripts/assert-smoke-not-vacuous.mjs': ['files'],@@ -148,11 +149,15 @@ export default {'packages/server': {entry: ['src/**/*.test.ts', 'src/parse-worker.ts'],project: 'src/**',- ignoreDependencies: ['@types/shell-quote'],+ ignoreDependencies: [+ '@types/shell-quote',+ ],},'packages/cli': {entry: ['src/**/*.test.ts', 'scripts/*.ts', 'tests/**/*.ts', 'src/parse-worker.ts'],- ignoreDependencies: ['yjs'],+ ignoreDependencies: [+ 'yjs',+ ],},'packages/desktop': {entry: [diff --git a/lint-plugins/no-comments/portability.test.mjs b/lint-plugins/no-comments/portability.test.mjsindex d07f16704..77b5d0d3b 100644--- a/lint-plugins/no-comments/portability.test.mjs+++ b/lint-plugins/no-comments/portability.test.mjs@@ -9,7 +9,7 @@ import { isInScope, scopeForRoot, subjectScope } from './scope.mjs';const MODULE_DIR = dirname(fileURLToPath(import.meta.url));const predicateModules = readdirSync(MODULE_DIR)- .filter((name) => name.endsWith('.mjs') && !name.includes('.test.'))+ .filter((name) => name.endsWith('.mjs') && !name.includes('.test.') && !name.includes('.reads.')).sort();const config = subjectScope().config;diff --git a/lint-plugins/ok-rules/tests/ok-rules-scope-partition.reads.mjs b/lint-plugins/ok-rules/tests/ok-rules-scope-partition.reads.mjsnew file mode 100644index 000000000..836943f20--- /dev/null+++ b/lint-plugins/ok-rules/tests/ok-rules-scope-partition.reads.mjs@@ -0,0 +1,9 @@+const OK_RULES_DIR = 'lint-plugins/ok-rules';+export const OK_RULES_TESTS_DIR = `${OK_RULES_DIR}/tests`;+export const OK_RULES_FIXTURES_DIR = `${OK_RULES_DIR}/__fixtures__`;++export const ROUND_READS = {+ test: './ok-rules-scope-partition.uncached.test.mjs',+ reads: 'the ok-rules registry, scope table, rules, fixtures and tests it partitions, and the oxlint config that loads the plugin',+ include: [`${OK_RULES_DIR}/**`, 'oxlint.config.ts'],+};diff --git a/lint-plugins/ok-rules/tests/ok-rules-scope-partition.uncached.test.mjs b/lint-plugins/ok-rules/tests/ok-rules-scope-partition.uncached.test.mjsindex 77f2c4995..b86908a74 100644--- a/lint-plugins/ok-rules/tests/ok-rules-scope-partition.uncached.test.mjs+++ b/lint-plugins/ok-rules/tests/ok-rules-scope-partition.uncached.test.mjs@@ -10,13 +10,12 @@ import {import plugin, { rules } from '../index.mjs';import { noAppCoreBarrelImport } from '../rules/no-app-core-barrel-import.mjs';import { isInScope, RULE_SCOPES, scoped, UNSCOPED_RULES } from '../scope.mjs';+import { OK_RULES_FIXTURES_DIR, OK_RULES_TESTS_DIR } from './ok-rules-scope-partition.reads.mjs';const REPO_ROOT = fileURLToPath(new URL('../../..', import.meta.url));-const TESTS_DIR = fileURLToPath(new URL('.', import.meta.url));-const FIXTURES_DIR = fileURLToPath(new URL('../__fixtures__/', import.meta.url));-const FIXTURE_CONFIG = fileURLToPath(- new URL('../__fixtures__/oxlint.fixtures.json', import.meta.url),-);+const TESTS_DIR = join(REPO_ROOT, OK_RULES_TESTS_DIR);+const FIXTURES_DIR = join(REPO_ROOT, OK_RULES_FIXTURES_DIR);+const FIXTURE_CONFIG = join(FIXTURES_DIR, 'oxlint.fixtures.json');const TIER_TEST = /\.uncached\.test\.mjs$/;const CODE_FILE = /\.[cm]?[jt]sx?$/;const META_TESTS = ['ok-rules-scope-partition', 'ok-rules-vocabulary'];@@ -85,7 +84,7 @@ describe('ok-rules scope table', () => {let checked = 0;const outOfScope = [];for (const name of fixtures) {- const fixture = `lint-plugins/ok-rules/__fixtures__/${name}`;+ const fixture = `${OK_RULES_FIXTURES_DIR}/${name}`;for (const fire of lintOkRulesFixture(fixture)) {const rule = /^ok\((.+)\)$/.exec(fire.code)?.[1];if (rule === undefined) continue;@@ -154,9 +153,13 @@ describe('scoped() through a symlinked repository path', () => {});describe('ok-rules fixture tests', () => {- test('every file in the tests directory runs in the uncached tier or is a helper', () => {+ test('every file in the tests directory runs in the uncached tier, or is a helper or a read declaration', () => {const misplaced = readdirSync(TESTS_DIR).filter(- (name) => CODE_FILE.test(name) && !TIER_TEST.test(name) && !name.endsWith('.test-helper.mjs'),+ (name) =>+ CODE_FILE.test(name) &&+ !TIER_TEST.test(name) &&+ !name.endsWith('.test-helper.mjs') &&+ !name.endsWith('.reads.mjs'),);expect(misplaced,diff --git a/packages/app/tests/integration/bug3-source-mode-writeback.test.ts b/packages/app/tests/integration/bug3-source-mode-writeback.test.tsindex a50b00123..4549c74b3 100644--- a/packages/app/tests/integration/bug3-source-mode-writeback.test.ts+++ b/packages/app/tests/integration/bug3-source-mode-writeback.test.ts@@ -1,3 +1,4 @@+import { readFileSync } from 'node:fs';import { join } from 'node:path';import { setTimeout as wait } from 'node:timers/promises';diff --git a/packages/app/tests/integration/e2e-stop-rules.reads.ts b/packages/app/tests/integration/e2e-stop-rules.reads.tsnew file mode 100644index 000000000..b16e07538--- /dev/null+++ b/packages/app/tests/integration/e2e-stop-rules.reads.ts@@ -0,0 +1,23 @@+import { TEST_ONLY_SOURCE_SUFFIXES } from '../../../../test-support/test-only-source-file.mjs';++export const E2E_SCAN_ROOTS = [+ 'packages/app/tests/stress',+ 'packages/app/tests/visual',+ 'packages/app/tests/a11y',+];+export const APP_SOURCE_ROOT = 'packages/app/src';+export const APP_SOURCE_EXTENSIONS = ['.ts', '.tsx'];+export const APP_SOURCE_EXCLUDED_SUFFIXES = [...TEST_ONLY_SOURCE_SUFFIXES, '.spec.ts', '.spec.tsx'];+export const APP_STYLESHEET = `${APP_SOURCE_ROOT}/globals.css`;++export const ROUND_READS = {+ test: './e2e-stop-rules.test.ts',+ reads: 'the e2e directories and the app source it scans, and the app package.json',+ include: [+ ...E2E_SCAN_ROOTS.map((root) => `${root}/**/*.ts`),+ ...APP_SOURCE_EXTENSIONS.map((extension) => `${APP_SOURCE_ROOT}/**/*${extension}`),+ APP_STYLESHEET,+ 'packages/app/package.json',+ ],+ exclude: APP_SOURCE_EXCLUDED_SUFFIXES.map((suffix) => `${APP_SOURCE_ROOT}/**/*${suffix}`),+};diff --git a/packages/app/tests/integration/e2e-stop-rules.test.ts b/packages/app/tests/integration/e2e-stop-rules.test.tsindex 609640d6f..290a7275d 100644--- a/packages/app/tests/integration/e2e-stop-rules.test.ts+++ b/packages/app/tests/integration/e2e-stop-rules.test.ts@@ -17,15 +17,18 @@ import {} from 'ts-morph';import { describe, expect, test } from 'vitest';import { DEV_GATED_WINDOW_WRITERS } from './dev-gate-allowlist';+import {+ APP_SOURCE_EXCLUDED_SUFFIXES,+ APP_SOURCE_EXTENSIONS,+ APP_SOURCE_ROOT,+ APP_STYLESHEET,+ E2E_SCAN_ROOTS,+} from './e2e-stop-rules.reads';const __dirname = dirname(fileURLToPath(import.meta.url));const REPO_ROOT = join(__dirname, '..', '..', '..', '..');-const E2E_DIRS = [- join(__dirname, '..', 'stress'),- join(__dirname, '..', 'visual'),- join(__dirname, '..', 'a11y'),-];-const APP_SRC_DIR = join(__dirname, '..', '..', 'src');+const E2E_DIRS = E2E_SCAN_ROOTS.map((root) => join(REPO_ROOT, root));+const APP_SRC_DIR = join(REPO_ROOT, APP_SOURCE_ROOT);interface FileLines {path: string;@@ -78,9 +81,8 @@ function listAppSrcTsFiles(): FileLines[] {continue;}if (!name.isFile()) continue;- if (!name.name.endsWith('.ts') && !name.name.endsWith('.tsx')) continue;- if (isTestOnlySourceFile(name.name)) continue;- if (name.name.endsWith('.spec.ts') || name.name.endsWith('.spec.tsx')) continue;+ if (!APP_SOURCE_EXTENSIONS.some((extension) => name.name.endsWith(extension))) continue;+ if (APP_SOURCE_EXCLUDED_SUFFIXES.some((suffix) => name.name.endsWith(suffix))) continue;const source = readFileSync(abs, 'utf-8');out.push({path: relative(REPO_ROOT, abs),@@ -461,7 +463,7 @@ function requirePinnedSpawnFile(files: FileLines[], path: string): FileLines {const file = files.find((candidate) => candidate.path === path);if (file === undefined) {throw new Error(- `${path} is pinned in DEV_SERVER_SPAWN_SITES but is not under the scanned e2e directories — it moved or was renamed, so its dev-server spawn stopped being checked. Point the path literal in DEV_SERVER_SPAWN_SITES at where the file lives now, and add its new parent to E2E_DIRS if the move left the scanned tree.`,+ `${path} is pinned in DEV_SERVER_SPAWN_SITES but is not under the scanned e2e directories — it moved or was renamed, so its dev-server spawn stopped being checked. Point the path literal in DEV_SERVER_SPAWN_SITES at where the file lives now, and add its new parent to E2E_SCAN_ROOTS in e2e-stop-rules.reads.ts if the move left the scanned tree.`,);}return file;@@ -721,7 +723,7 @@ describe('E2E STOP rule — zero allowlist', () => {test('the spawn-isolation rule resolves a dev-server spawn in exactly the pinned sites', () => {expect(mirroredFilesWithDevServerSpawns(e2eTsFiles),- 'the files in which the guard resolves a dev-server spawn are no longer exactly the pinned dev-server spawn sites. Four causes, four different edits. (1) A pinned file moved or was renamed: update its path literal in DEV_SERVER_SPAWN_SITES, and add its new parent to E2E_DIRS if the move left the scanned tree — editing the call-shape recogniser will not bring it back. (2) The recogniser rotted against a call the corpus really has: it selects a `spawn`/`spawnSync` CallExpression whose command or argv array carries the literal argv token, so re-anchor SPAWN_CALLEE_NAMES and DEV_SERVER_ARGV_TOKEN on that shape. (3) A file listed in NON_DEV_SERVER_SPAWN_SITES now boots a dev server: move it to DEV_SERVER_SPAWN_SITES and give its spawn both isolation env keys. (4) A pinned file stopped parsing under the ts-morph program this guard runs, which is separate from the repo compiler: a file it cannot parse resolves no spawn call at all, and the isolation rule above reports that syntax error for the same file on the same run, so fix the syntax rather than either list. A site that drops out of this set carries no enforced isolation contract however its spawn env changes',+ 'the files in which the guard resolves a dev-server spawn are no longer exactly the pinned dev-server spawn sites. Four causes, four different edits. (1) A pinned file moved or was renamed: update its path literal in DEV_SERVER_SPAWN_SITES, and add its new parent to E2E_SCAN_ROOTS in e2e-stop-rules.reads.ts if the move left the scanned tree — editing the call-shape recogniser will not bring it back. (2) The recogniser rotted against a call the corpus really has: it selects a `spawn`/`spawnSync` CallExpression whose command or argv array carries the literal argv token, so re-anchor SPAWN_CALLEE_NAMES and DEV_SERVER_ARGV_TOKEN on that shape. (3) A file listed in NON_DEV_SERVER_SPAWN_SITES now boots a dev server: move it to DEV_SERVER_SPAWN_SITES and give its spawn both isolation env keys. (4) A pinned file stopped parsing under the ts-morph program this guard runs, which is separate from the repo compiler: a file it cannot parse resolves no spawn call at all, and the isolation rule above reports that syntax error for the same file on the same run, so fix the syntax rather than either list. A site that drops out of this set carries no enforced isolation contract however its spawn env changes',).toEqual([...DEV_SERVER_SPAWN_SITES].sort());});@@ -1192,7 +1194,7 @@ describe('E2E STOP rule — zero allowlist', () => {});test('selection-halo CSS rules use plugin-state propagation, not `:has()` (Precedent #34)', () => {- const cssPath = join(APP_SRC_DIR, 'globals.css');+ const cssPath = join(REPO_ROOT, APP_STYLESHEET);const css = readFileSync(cssPath, 'utf-8');const lines = css.split('\n');@@ -1210,7 +1212,7 @@ describe('E2E STOP rule — zero allowlist', () => {const selectorContext = lines.slice(windowStart, windowEnd).join('\n');if (selectionMarker.test(selectorContext)) {- violations.push(` packages/app/src/globals.css:${i + 1} ${line.trim()}`);+ violations.push(` ${APP_STYLESHEET}:${i + 1} ${line.trim()}`);}}@@ -1221,7 +1223,7 @@ describe('E2E STOP rule — zero allowlist', () => {});test('selection-halo transition uses `var(--ease-out-strong)`, not bare `ease-out` (round-2 review fix)', () => {- const cssPath = join(APP_SRC_DIR, 'globals.css');+ const cssPath = join(REPO_ROOT, APP_STYLESHEET);const css = readFileSync(cssPath, 'utf-8');const lines = css.split('\n');@@ -1246,7 +1248,7 @@ describe('E2E STOP rule — zero allowlist', () => {if (!line.includes('transition')) continue;const stripped = line.replace(/var\([^)]*\)/g, '');if (/\bease-out\b/.test(stripped)) {- violations.push(` packages/app/src/globals.css:${i + 1} ${line.trim()}`);+ violations.push(` ${APP_STYLESHEET}:${i + 1} ${line.trim()}`);}}diff --git a/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts b/packages/app/tests/integration/indented-jsx-byte-sacred.test.tsindex 6fcdc23f2..4fc2c11f9 100644--- a/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts+++ b/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts@@ -1,3 +1,4 @@+import { setTimeout as wait } from 'node:timers/promises';import { normalizeBridge } from '@inkeep/open-knowledge-core';import { updateYFragment } from '@tiptap/y-tiptap';diff --git a/packages/app/tests/integration/interior-edit-freshness.test.ts b/packages/app/tests/integration/interior-edit-freshness.test.tsindex 40b5cdfd6..9f2f6feb6 100644--- a/packages/app/tests/integration/interior-edit-freshness.test.ts+++ b/packages/app/tests/integration/interior-edit-freshness.test.ts@@ -1,3 +1,4 @@+import { setTimeout as wait } from 'node:timers/promises';import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';import { afterAll, beforeAll, describe, expect, test } from 'vitest';diff --git a/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts b/packages/app/tests/integration/keystroke-cadence-danger-space.test.tsindex 93666af70..2a085742b 100644--- a/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts+++ b/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts@@ -1,3 +1,4 @@+import { setTimeout as wait } from 'node:timers/promises';import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';import { afterAll, beforeAll, describe, expect, test } from 'vitest';diff --git a/packages/app/tests/integration/loopback-bind-discipline.reads.ts b/packages/app/tests/integration/loopback-bind-discipline.reads.tsnew file mode 100644index 000000000..97aee7198--- /dev/null+++ b/packages/app/tests/integration/loopback-bind-discipline.reads.ts@@ -0,0 +1,7 @@+export const LOOPBACK_SCAN_ROOTS = ['packages/app/tests/integration', 'packages/app/tests/stress'];++export const ROUND_READS = {+ test: './loopback-bind-discipline.test.ts',+ reads: 'the app integration and stress test sources it scans for listen() binds',+ include: LOOPBACK_SCAN_ROOTS.map((root) => `${root}/**/*.ts`),+};diff --git a/packages/app/tests/integration/loopback-bind-discipline.test.ts b/packages/app/tests/integration/loopback-bind-discipline.test.tsindex e16cb9f1d..6f83dfc81 100644--- a/packages/app/tests/integration/loopback-bind-discipline.test.ts+++ b/packages/app/tests/integration/loopback-bind-discipline.test.ts@@ -3,10 +3,12 @@ import { basename, dirname, join, relative } from 'node:path';import { fileURLToPath } from 'node:url';import { describe, expect, test } from 'vitest';import { isTestOnlySourceFile } from '../../../../test-support/test-only-source-file.mjs';+import { LOOPBACK_SCAN_ROOTS } from './loopback-bind-discipline.reads';const __dirname = dirname(fileURLToPath(import.meta.url));const PACKAGE_ROOT = join(__dirname, '..', '..');-const SCAN_ROOTS = [__dirname, join(PACKAGE_ROOT, 'tests', 'stress')];+const OK_ROOT = join(PACKAGE_ROOT, '..', '..');+const SCAN_ROOTS = LOOPBACK_SCAN_ROOTS.map((root) => join(OK_ROOT, root));const SELF_BASENAME = basename(fileURLToPath(import.meta.url));diff --git a/packages/app/tests/integration/producer-guard-wiring.test.ts b/packages/app/tests/integration/producer-guard-wiring.test.tsindex 867598d34..878d5196b 100644--- a/packages/app/tests/integration/producer-guard-wiring.test.ts+++ b/packages/app/tests/integration/producer-guard-wiring.test.ts@@ -1,3 +1,4 @@+import { setTimeout as wait } from 'node:timers/promises';import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';import { afterAll, beforeAll, describe, expect, test } from 'vitest';diff --git a/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts b/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.tsindex 0970ac12f..4ada3cf26 100644--- a/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts+++ b/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts@@ -1,3 +1,4 @@+import { randomUUID } from 'node:crypto';import { afterEach, describe, expect, test } from 'vitest';import { agentWriteMd, createTestServer, type TestServer } from './test-harness';diff --git a/packages/app/tests/integration/qa-045-restore-after-gc.test.ts b/packages/app/tests/integration/qa-045-restore-after-gc.test.tsindex b632185e1..cbe2b705f 100644--- a/packages/app/tests/integration/qa-045-restore-after-gc.test.ts+++ b/packages/app/tests/integration/qa-045-restore-after-gc.test.ts@@ -1,3 +1,4 @@+import { execFileSync } from 'node:child_process';import { randomUUID } from 'node:crypto';import { join } from 'node:path';diff --git a/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts b/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.tsindex c530ce4ba..89bc9b4d9 100644--- a/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts+++ b/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts@@ -1,3 +1,4 @@+import { randomUUID } from 'node:crypto';import { afterAll, afterEach, beforeAll, describe, expect, test } from 'vitest';import type * as Y from 'yjs';diff --git a/packages/app/tests/integration/undo-after-rollback.test.ts b/packages/app/tests/integration/undo-after-rollback.test.tsindex d3767adc9..a78aeb0e4 100644--- a/packages/app/tests/integration/undo-after-rollback.test.ts+++ b/packages/app/tests/integration/undo-after-rollback.test.ts@@ -1,3 +1,4 @@+import { ROLLBACK_ORIGIN } from '@inkeep/open-knowledge-server';import { afterAll, beforeAll, describe, expect, test } from 'vitest';import * as Y from 'yjs';diff --git a/packages/app/tests/integration/undo-recycle-reset.test.ts b/packages/app/tests/integration/undo-recycle-reset.test.tsindex b076f955c..e7cc69c3f 100644--- a/packages/app/tests/integration/undo-recycle-reset.test.ts+++ b/packages/app/tests/integration/undo-recycle-reset.test.ts@@ -1,3 +1,4 @@+import { writeFileSync } from 'node:fs';import { join } from 'node:path';import { setTimeout as wait } from 'node:timers/promises';diff --git a/packages/app/tests/integration/undo-rederive-survival.test.ts b/packages/app/tests/integration/undo-rederive-survival.test.tsindex 7935e35f8..9ddcd0730 100644--- a/packages/app/tests/integration/undo-rederive-survival.test.ts+++ b/packages/app/tests/integration/undo-rederive-survival.test.ts@@ -1,3 +1,4 @@+import { prependFrontmatter } from '@inkeep/open-knowledge-core';import { Plugin, PluginKey } from '@tiptap/pm/state';import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';diff --git a/packages/core/src/bridge/compose.ts b/packages/core/src/bridge/compose.tsindex f4cc8a286..2a597ec3d 100644--- a/packages/core/src/bridge/compose.ts+++ b/packages/core/src/bridge/compose.ts@@ -1,3 +1,4 @@+import { prependFrontmatter, stripFrontmatter } from '../extensions/frontmatter.ts';export type ComposeAdjustment = 'none' | 'body' | 'frontmatter' | 'unresolved';diff --git a/packages/core/src/bridge/doc-boundary-space.ts b/packages/core/src/bridge/doc-boundary-space.tsindex e7e63f43d..ffd8fce06 100644--- a/packages/core/src/bridge/doc-boundary-space.ts+++ b/packages/core/src/bridge/doc-boundary-space.ts@@ -1,3 +1,4 @@+import { FRONTMATTER_RE, stripFrontmatter } from '../extensions/frontmatter.ts';import { carriedEdgeEmpties, type DocEdgeEmpties } from '../markdown/doc-edge-blank-runs.ts';diff --git a/packages/core/src/markdown/comment-promoter.ts b/packages/core/src/markdown/comment-promoter.tsindex fc267cbea..fb0ba5a7c 100644--- a/packages/core/src/markdown/comment-promoter.ts+++ b/packages/core/src/markdown/comment-promoter.ts@@ -1,3 +1,4 @@+import type { Nodes, Paragraph, PhrasingContent, Root, RootContent, Text } from 'mdast';import { SKIP, visit } from 'unist-util-visit';import type { VFile } from 'vfile';diff --git a/packages/core/src/markdown/merged-walker.ts b/packages/core/src/markdown/merged-walker.tsindex bfd7e3109..fa3cfcd86 100644--- a/packages/core/src/markdown/merged-walker.ts+++ b/packages/core/src/markdown/merged-walker.ts@@ -1,3 +1,4 @@+import type { Nodes, Parent, Root } from 'mdast';import { SKIP, visit } from 'unist-util-visit';import type { VFile } from 'vfile';diff --git a/packages/core/src/markdown/safe-url.ts b/packages/core/src/markdown/safe-url.tsindex 4d3250d3a..8be632ba4 100644--- a/packages/core/src/markdown/safe-url.ts+++ b/packages/core/src/markdown/safe-url.ts@@ -1,3 +1,4 @@+export const SAFE_URL_SCHEMES = ['https', 'http', 'mailto', 'tel', 'ftp', 'sms'] as const;const SCHEME_ALT = SAFE_URL_SCHEMES.map((s) => `${s}:`).join('|');diff --git a/packages/server/src/test-helper-caller-typecheck-coverage.reads.ts b/packages/server/src/test-helper-caller-typecheck-coverage.reads.tsnew file mode 100644index 000000000..cbca5f469--- /dev/null+++ b/packages/server/src/test-helper-caller-typecheck-coverage.reads.ts@@ -0,0 +1,17 @@+export const CALLER_SUFFIX = '.test.ts';+export const HELPER_SUFFIX = '.test-helper.ts';+export const CALLERS_TSCONFIG = 'tsconfig.test-helper-callers.json';++export const SERVER_DIR = 'packages/server';++export const ROUND_READS = {+ test: './test-helper-caller-typecheck-coverage.test.ts',+ reads:+ 'every server test and shared test helper it scans, the callers tsconfig, and the server package.json',+ include: [+ `${SERVER_DIR}/**/*${CALLER_SUFFIX}`,+ `${SERVER_DIR}/**/*${HELPER_SUFFIX}`,+ `${SERVER_DIR}/${CALLERS_TSCONFIG}`,+ `${SERVER_DIR}/package.json`,+ ],+};diff --git a/packages/server/src/test-helper-caller-typecheck-coverage.test.ts b/packages/server/src/test-helper-caller-typecheck-coverage.test.tsindex 379b9c82e..ef43bf05a 100644--- a/packages/server/src/test-helper-caller-typecheck-coverage.test.ts+++ b/packages/server/src/test-helper-caller-typecheck-coverage.test.ts@@ -4,9 +4,15 @@ import { basename, dirname, join, relative, resolve } from 'node:path';import { fileURLToPath } from 'node:url';import { type ParseError, parse as parseJsonc, printParseErrorCode } from 'jsonc-parser';import { describe, expect, onTestFinished, test } from 'vitest';--const PACKAGE_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');-const TSCONFIG = 'tsconfig.test-helper-callers.json';+import {+ CALLER_SUFFIX,+ HELPER_SUFFIX,+ SERVER_DIR,+ CALLERS_TSCONFIG as TSCONFIG,+} from './test-helper-caller-typecheck-coverage.reads.ts';++const OK_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..', '..', '..');+const PACKAGE_ROOT = resolve(OK_ROOT, SERVER_DIR);const TYPECHECK_SCRIPT = 'typecheck:test-helper-callers';const HELPERS = [@@ -46,14 +52,14 @@ function filesUnder(dir: string, suffix: string): string[] {}function callersOnDisk(): string[] {- return filesUnder(PACKAGE_ROOT, '.test.ts')+ return filesUnder(PACKAGE_ROOT, CALLER_SUFFIX).filter((path) => importsAHelper(readFileSync(path, 'utf8'))).map((path) => relative(PACKAGE_ROOT, path).replaceAll('\\', '/')).sort();}function helpersOnDisk(root: string = PACKAGE_ROOT): string[] {- return filesUnder(root, '.test-helper.ts').map((path) => basename(path));+ return filesUnder(root, HELPER_SUFFIX).map((path) => basename(path));}function isStringArray(value: unknown): value is string[] {@@ -167,7 +173,7 @@ describe('every caller of a shared test-only helper sits inside a typecheck progplant('.ok-skill-publish-kept-a1b2c3/staged.test.ts');expect(- filesUnder(root, '.test.ts').map((path) => relative(root, path).replaceAll('\\', '/')),+ filesUnder(root, CALLER_SUFFIX).map((path) => relative(root, path).replaceAll('\\', '/')),'a staging root is gitignored and written by the server build, so it sits outside the ' +"cache key of the test task this walk runs in, and entering it reads the build's output",).toEqual(['src/source.test.ts']);