Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
Upgrade Open Knowledge's Turbo to 2.11.5 (#5288)
Nick Gomezc8176d7948a0
diff --git a/.github/scripts/release-cascade-shape.test.mjs b/.github/scripts/release-cascade-shape.test.mjsindex adbcb39a8..0b9e1f6e4 100644--- a/.github/scripts/release-cascade-shape.test.mjs+++ b/.github/scripts/release-cascade-shape.test.mjs@@ -664,7 +664,7 @@ describe('the bug lane verifies the synthetic tree at the same bar as main', ()expect(retry).not.toContain('--force');});- test('both attempts run every package, so server#test and the uncached tier it brings run on the verified tree', () => {+ test('both attempts run every package, so a filter cannot drop server#test or the uncached tier from the verified tree', () => {const commands = verify.replace(/\\\n\s*/g, ' ').split('\n')diff --git a/.github/workflows/bug-lane-verify.yml b/.github/workflows/bug-lane-verify.ymlindex caaaa72f8..9ba2c64ab 100644--- a/.github/workflows/bug-lane-verify.yml+++ b/.github/workflows/bug-lane-verify.yml@@ -342,7 +342,7 @@ jobs:TIER_BUDGET_SECONDS=1500FIRST_STATUS=0timeout --foreground --kill-after=10s "${TIER_BUDGET_SECONDS}s" \- pnpm exec turbo run typecheck test --concurrency=2 --continue --output-logs=errors-only \+ pnpm exec turbo run typecheck test test:uncached --concurrency=2 --continue --output-logs=errors-only \|| FIRST_STATUS=$?RETRY_STATUS=0if [[ "$FIRST_STATUS" -ne 0 ]]; then@@ -359,7 +359,7 @@ jobs:;;*)if timeout --foreground --kill-after=10s "${TIER_BUDGET_SECONDS}s" \- pnpm exec turbo run typecheck test --concurrency=2 --output-logs=errors-only 2>&1 | tee "$RETRY_LOG"; then+ pnpm exec turbo run typecheck test test:uncached --concurrency=2 --output-logs=errors-only 2>&1 | tee "$RETRY_LOG"; thenRETRY_STATUS=0else# Read BEFORE any other command: the next one clobbers it.diff --git a/lint-plugins/ok-rules/README.md b/lint-plugins/ok-rules/README.mdindex 19b493cce..d77febd77 100644--- a/lint-plugins/ok-rules/README.md+++ b/lint-plugins/ok-rules/README.md@@ -767,7 +767,7 @@ Drop `<rule-name>.fixture.tsx` in `__fixtures__/`, pairing positive cases (must### 5. Author the fixture-file test-Put it at `lint-plugins/ok-rules/tests/<rule-name>.uncached.test.mjs`, not in a package. The `.uncached.test` suffix runs it in the uncached cross-package tier (`vitest.uncached.config.ts`): every agent round, CI's `lint` job, and beside every `turbo run test` that runs `server#test`. A package's cached test tier would replay a stale pass when only the rule or `oxlint.config.ts` changed, unless that package's Turbo key hashed both. The tests in that directory check that every rule the `ok` plugin registers has one. Write it as plain JavaScript.+Put it at `lint-plugins/ok-rules/tests/<rule-name>.uncached.test.mjs`, not in a package. The `.uncached.test` suffix runs it in the uncached cross-package tier (`vitest.uncached.config.ts`): every agent round, CI's `lint` job, and every whole-suite `turbo run`, which names `test:uncached` beside `test`. A package's cached test tier would replay a stale pass when only the rule or `oxlint.config.ts` changed, unless that package's Turbo key hashed both. The tests in that directory check that every rule the `ok` plugin registers has one. Write it as plain JavaScript.The tier's global setup, `test-support/ok-rules-fixture-lint.ts`, runs oxlint once over every fixture with the fixture config and hands the report to the tests; a watch-mode rerun lints again. Every rule test fails when that run could not start, exited other than 1, gave no JSON report, linted a different number of files than the directory's `*.fixture.tsx` files, or reported a diagnostic on no fixture. `lintOkRulesFixture` in `test-support/read-ok-rules-config.test-helper.ts` returns one fixture's diagnostics from the report, each with its rule code, `line:column` position and message, in a fixed order. A diagnostic that names no rule (a rule that threw while linting that fixture, or a fixture oxlint could not parse) fails that fixture's test with oxlint's message, as it does the scope meta-test, which reads every fixture. oxlint also drops every other JS-plugin diagnostic on a file where a rule threw, so a rule whose scope reaches other fixtures fails their tests too. Run outside the tier, it fails and prints the command that runs the test. Assert the exact list of your rule's fire positions, filtered by its own code:diff --git a/package.json b/package.jsonindex 991f1d79b..0c989c6db 100644--- a/package.json+++ b/package.json@@ -22,7 +22,7 @@"check:drift": "pnpm run check:drift:guards && vitest run --config vitest.scripts.config.ts","check:drift:guards": "bash scripts/check-husky-prepare-guard.sh && bash scripts/check-knip-clean.sh && bash scripts/check-notices-clean.sh && bash scripts/check-schema-snapshot-clean.sh && bash scripts/check-i18n-drift.sh && node scripts/check-i18n-new-string-translations.mjs && node scripts/check-i18n-picker-completeness.mjs && bash scripts/check-no-major-changeset.sh && node scripts/check-override-floors.mjs && node scripts/check-typescript-resolution.mjs","typecheck": "turbo run typecheck",- "test": "turbo run test",+ "test": "turbo run test test:uncached","test:uncached": "vitest run --config vitest.uncached.config.ts","known-reds": "node scripts/known-reds.mjs","test:vitest-selftest": "vitest run",@@ -31,8 +31,8 @@"lint:biome": "biome check packages docs *.json *.jsonc *.ts --error-on-warnings","lint:oxlint": "oxlint --max-warnings 0 .","format": "pnpm run lint:biome --write --unsafe",- "check": "pnpm run lint && pnpm exec turbo run build typecheck test",- "check:full:parallel": "pnpm run check:drift:guards && pnpm run check:server-test-inputs && pnpm run lint && pnpm run check:doc-links && vitest run --config vitest.scripts.config.ts && turbo run build typecheck check:dts test test:dom test:integration:shard1 test:integration:shard2 test:integration:shard3 test:conversion test:perf:regression:unit test:health:unit test:health test:e2e test:perf test:a11y --concurrency=100% --output-logs=errors-only",+ "check": "pnpm run lint && pnpm exec turbo run build typecheck test test:uncached",+ "check:full:parallel": "pnpm run check:drift:guards && pnpm run check:server-test-inputs && pnpm run lint && pnpm run check:doc-links && vitest run --config vitest.scripts.config.ts && turbo run build typecheck check:dts test test:uncached test:dom test:integration:shard1 test:integration:shard2 test:integration:shard3 test:conversion test:perf:regression:unit test:health:unit test:health test:e2e test:perf test:a11y --concurrency=100% --output-logs=errors-only","tier1": "pnpm run check","tier2": "pnpm run tier1 && turbo run test:perf:regression:unit test:health:unit test:health test:e2e","tier3": "STRESS_FIDELITY=1 pnpm run tier2",@@ -81,7 +81,7 @@"smol-toml": "^1.6.1","ts-morph": "^28.0.0","tsx": "^4.20.0",- "turbo": "^2.7.0",+ "turbo": "^2.11.5","typescript": "~6.0.3","undici": "~7.29.0","vitest": "^4.1.0",diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 1618ba19c..8e5dfc78c 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -225,8 +225,8 @@ importers:specifier: ^4.20.0version: 4.23.0turbo:- specifier: ^2.7.0- version: 2.10.4+ specifier: ^2.11.5+ version: 2.11.5typescript:specifier: ~6.0.3version: 6.0.3@@ -5823,33 +5823,33 @@ packages:'@ts-morph/[email protected]':resolution: {integrity: sha512-35oUmphHbJvQ/+UTwFNme/t2p3FoKiGJ5auTjjpNTop2dyREspirjMy82PLSC1pnDJ8ah1GU98hwpVt64YXQsg==}- '@turbo/[email protected]':- resolution: {integrity: sha512-m1MUEI4MJ69r5CwfMYxmHi0H0rrgiYCBOp0tgBZ9x/YVvOb5uu/lRIDyDwdtH054R2yWeQaIigUGu6aCX9f8cA==}+ '@turbo/[email protected]':+ resolution: {integrity: sha512-KdY4y7BBjIisl+jAkb3FFaRjClGqHyaeHCcVcCT8LBzFFwUu6thgfxyRZAx0uL4KoxLmH+iOan8UhVf/aDDcaA==}cpu: [x64]os: [darwin]- '@turbo/[email protected]':- resolution: {integrity: sha512-VQ1Yxs5zkPT+2z7t1P4mvn6JmcKLkOCAsPuK9XbOvuVj0DlTlETfIXNisX0771v/vTWHOQqiwoGi+TtAUq8efw==}+ '@turbo/[email protected]':+ resolution: {integrity: sha512-ToZDGi2u410+TfRtC/O1/LpujGgvNJoRBZnwVXob7oO0+3OSlwIO3zofXKUvwQvlba7a8ZXPyCZwufjAXd7f0w==}cpu: [arm64]os: [darwin]- '@turbo/[email protected]':- resolution: {integrity: sha512-IzV1QovmwX7mfGnVinmE++2IB8tbeo38weltiuH5zNqwCTBjLs/DytyRKx+bmnhHdXIq9SheR8p0Nip/LBUPHg==}+ '@turbo/[email protected]':+ resolution: {integrity: sha512-Ub2d/nAbdWLaSytcEaPp1wm/YuIvHEIqNrCRMI/UgOGyFdOhgxm8VyWPAJilQWRYxYVrqEUoy2K5S5K8SG50rA==}cpu: [x64]- os: [linux]+ os: [android, linux]- '@turbo/[email protected]':- resolution: {integrity: sha512-rfujSQkP5aYiRn0PgTM7F00WkJCP/bKDVZbOx3WmrZwa/vHA0bplhCl328kpX7VI9HH2vI90ISGwuSVgJgoqTw==}+ '@turbo/[email protected]':+ resolution: {integrity: sha512-JQjmGxp724Wuft9FAxPMtmBur1CEdUyxJ+FVoIvKkgj63rXHl9PYCWrsU2tMjVi609XTQ3M8vZD9Yc9qVAVYrw==}cpu: [arm64]- os: [linux]+ os: [android, linux]- '@turbo/[email protected]':- resolution: {integrity: sha512-NnspP7Wd5fa3Wwnqv9bKfhegqZzuHBgbPxdZU/idTLQcazx/vgKu95JlCx2YHY0hdvKCnPcARrDwM+KEUmaO7A==}+ '@turbo/[email protected]':+ resolution: {integrity: sha512-AFkbPmXNd8XgCi/66YEHR2bVl3gtusXyDihTIVEPAuSB+7ulLmJePvz1unWPVKLHdbCTTIdKq2mpJ1B1e3lJXw==}cpu: [x64]os: [win32]- '@turbo/[email protected]':- resolution: {integrity: sha512-Iv02YgOpaEShc2OkG7mgCJ2pEw1RUKiKbs0h8W5wAf4jZ5vpmraTEjuGTgHRuOORQnC1GN3KHo5WB+hu1abRMA==}+ '@turbo/[email protected]':+ resolution: {integrity: sha512-52ziXYP3snGOxjv19xA3WL1WDKv9Q6uDAa/7EKIR5j4hocMlYURkrOHbJ2ZZI+VfPU5MwKpcGeRfHxHJu7Y/Pw==}cpu: [arm64]os: [win32]@@ -11380,8 +11380,8 @@ packages:resolution: {integrity: sha512-lR5VHmkPhzdhrM092lI2nACsLO4QubF0/yoOhzX7c+wIpbN1GjHNzCc91QlpxBi+cnx8vVJ+Ur6vL5cEoQPFpQ==}- resolution: {integrity: sha512-GQpduILaKjoaGljw097ScsSyKTtZSY7cZ3bJktzfTkPMyCf3ShKLuXK2IaOEN2Plziml+ArR7WJ1m+V4VbnaKQ==}+ resolution: {integrity: sha512-qLXheqz3TUvJpHIV6MUBwkNkvwKxMVG/QsimyiKT9DfNWPHJ294G/i5nDaH+fbHJt3UH7orubNNxAqYkbUNGAQ==}hasBin: true@@ -16415,22 +16415,22 @@ snapshots:path-browserify: 1.0.1tinyglobby: 0.2.17- '@turbo/[email protected]':+ '@turbo/[email protected]':optional: true- '@turbo/[email protected]':+ '@turbo/[email protected]':optional: true- '@turbo/[email protected]':+ '@turbo/[email protected]':optional: true- '@turbo/[email protected]':+ '@turbo/[email protected]':optional: true- '@turbo/[email protected]':+ '@turbo/[email protected]':optional: true- '@turbo/[email protected]':+ '@turbo/[email protected]':optional: true'@tweenjs/[email protected]': {}@@ -23083,14 +23083,14 @@ snapshots:- immer- reactoptionalDependencies:- '@turbo/darwin-64': 2.10.4- '@turbo/darwin-arm64': 2.10.4- '@turbo/linux-64': 2.10.4- '@turbo/linux-arm64': 2.10.4- '@turbo/windows-64': 2.10.4- '@turbo/windows-arm64': 2.10.4+ '@turbo/darwin-64': 2.11.5+ '@turbo/darwin-arm64': 2.11.5+ '@turbo/linux-64': 2.11.5+ '@turbo/linux-arm64': 2.11.5+ '@turbo/windows-64': 2.11.5+ '@turbo/windows-arm64': 2.11.5dependencies:diff --git a/scripts/check-server-test-inputs.mjs b/scripts/check-server-test-inputs.mjsindex 38984ff26..4f8ca49fe 100644--- a/scripts/check-server-test-inputs.mjs+++ b/scripts/check-server-test-inputs.mjs@@ -189,7 +189,8 @@ function main() {`${detail}\n\n` +`Fix: a test that reads files outside its package's key takes the \`.uncached.test\`\n` +`suffix. Rename each reader to <name>.uncached.test.ts, and the uncached tier runs it\n` +- `every round, in CI's lint job and beside every \`turbo run test\` of this package.\n` ++ `every round, in CI's lint job, and in every whole-suite \`turbo run\` that names\n` ++ `\`test:uncached\` beside \`test\`, such as \`pnpm test\`; a --filter'ed run does not.\n` +`Add a matching glob to \`${TASK}\`.inputs in public/open-knowledge/turbo.json\n` +`instead only if the whole server tier should re-run whenever that path changes.\n`,);diff --git a/scripts/check-server-test-inputs.test.mjs b/scripts/check-server-test-inputs.test.mjsindex 1869acd91..7c199f86b 100644--- a/scripts/check-server-test-inputs.test.mjs+++ b/scripts/check-server-test-inputs.test.mjs@@ -1,7 +1,7 @@import { spawnSync } from 'node:child_process';import { mkdirSync, mkdtempSync, readFileSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';-import { dirname, join } from 'node:path';+import { dirname, join, relative } from 'node:path';import { fileURLToPath } from 'node:url';import { describe, expect, test } from 'vitest';import {@@ -13,6 +13,8 @@ import {packageRelativeGlobCovers,uncoveredReads,} from './check-server-test-inputs.mjs';+import { memberDirs } from './check-typescript-resolution.mjs';+import { readJsoncOrError } from './read-jsonc.mjs';const OK_ROOT = fileURLToPath(new URL('..', import.meta.url));const TASK = '@inkeep/open-knowledge-server#test';@@ -161,10 +163,39 @@ describe('check-server-test-inputs', () => {});});-describe('the uncached tier runs wherever server#test runs', () => {- test('server#test brings the uncached tier as its with sibling, and that tier is never cached', () => {+describe('the uncached tier is a root task of its own', () => {+ test('the tier is never cached, and no finite task carries a with sibling', () => {const turbo = JSON.parse(readFileSync(join(OK_ROOT, 'turbo.json'), 'utf-8'));- expect(turbo.tasks[TASK].with ?? []).toContain('//#test:uncached');+ const refused = [];+ const members = memberDirs(+ OK_ROOT,+ readFileSync(join(OK_ROOT, 'pnpm-workspace.yaml'), 'utf-8'),+ (entry) => refused.push(`unreadable: ${entry}`),+ (pattern) => refused.push(`no member: ${pattern}`),+ );+ expect(+ refused,+ 'pnpm-workspace.yaml has entries this derivation cannot read or that name no member, so their turbo configs would leave the scan',+ ).toEqual([]);+ expect(members.map((dir) => relative(OK_ROOT, dir))).toEqual(expect.arrayContaining(['packages/server', 'docs']));+ const configs = [['turbo.json', turbo]];+ for (const dir of members) {+ for (const name of ['turbo.json', 'turbo.jsonc']) {+ const read = readJsoncOrError(join(dir, name));+ if (read.code === 'ENOENT') continue;+ expect(read.ok, read.reason).toBe(true);+ configs.push([relative(OK_ROOT, join(dir, name)), read.value]);+ }+ }+ const finiteWith = configs.flatMap(([path, config]) =>+ Object.entries(config.tasks ?? {})+ .filter(([name, task]) => task.with !== undefined && (task.persistent ?? turbo.tasks[name]?.persistent) !== true)+ .map(([name]) => `${path}: ${name}`),+ );+ expect(+ finiteWith,+ 'turbo 2.11.3 and later stop a `with` task once its parent exits, so a finite parent cuts its sibling short and the run still passes; name the sibling in the turbo run instead, as every whole-suite run names test:uncached',+ ).toEqual([]);expect(turbo.tasks['//#test:uncached']).toMatchObject({ cache: false });const pkg = JSON.parse(readFileSync(join(OK_ROOT, 'package.json'), 'utf-8'));expect(pkg.scripts['test:uncached']).toBe('vitest run --config vitest.uncached.config.ts');diff --git a/scripts/create-turbo-cache-key.test.mjs b/scripts/create-turbo-cache-key.test.mjsindex 00928508a..f17112660 100644--- a/scripts/create-turbo-cache-key.test.mjs+++ b/scripts/create-turbo-cache-key.test.mjs@@ -5,6 +5,7 @@ import { dirname, join } from 'node:path';import { fileURLToPath } from 'node:url';import { afterAll, beforeAll, describe, expect, test } from 'vitest';import { CACHE_KEY_FILE, cacheKey, writeCacheKey } from './create-turbo-cache-key.mjs';+import { withoutTurboAgentDetection } from '../test-support/turbo-agent-env.test-helper.mjs';import { gitCleanEnv } from './git-clean-env.mjs';const OK_ROOT = fileURLToPath(new URL('..', import.meta.url));@@ -80,7 +81,7 @@ function write(root, path, body) {}function isolatedEnv(extra = {}) {- const ambient = Object.entries(gitCleanEnv()).filter(+ const ambient = Object.entries(withoutTurboAgentDetection(gitCleanEnv())).filter(([key]) => !key.startsWith('TURBO_') && !key.startsWith('GIT_CONFIG'),);return {@@ -133,6 +134,7 @@ function fixture(globalDependencies) {'turbo.json',`${JSON.stringify({+ agentGuidance: false,globalDependencies,tasks: {build: { dependsOn: ['^build'], outputs: ['dist/**'] },diff --git a/test-support/turbo-agent-env.test-helper.mjs b/test-support/turbo-agent-env.test-helper.mjsnew file mode 100644index 000000000..b5ebfc854--- /dev/null+++ b/test-support/turbo-agent-env.test-helper.mjs@@ -0,0 +1,20 @@+// UPSTREAM([email protected]): any of these makes turbo detect a coding agent and maintain its AGENTS.md block; detect() also checks /opt/.devin.+const TURBO_AGENT_DETECTION_VARS = [+ 'AI_AGENT',+ 'CURSOR_TRACE_ID',+ 'CURSOR_AGENT',+ 'GEMINI_CLI',+ 'CODEX_SANDBOX',+ 'AUGMENT_AGENT',+ 'OPENCODE_CLIENT',+ 'OPENCODE',+ 'CLAUDECODE',+ 'CLAUDE_CODE',+ 'REPL_ID',+];++export function withoutTurboAgentDetection(env) {+ return Object.fromEntries(+ Object.entries(env).filter(([key]) => !TURBO_AGENT_DETECTION_VARS.includes(key)),+ );+}diff --git a/turbo.json b/turbo.jsonindex b95c9abb7..e45485fc2 100644--- a/turbo.json+++ b/turbo.json@@ -1,6 +1,7 @@{"$schema": "https://turbo.build/schema.json","cacheDir": ".turbo/cache",+ "agentGuidance": false,"remoteCache": {"signature": true},@@ -102,7 +103,6 @@"@inkeep/open-knowledge-server#test": {"dependsOn": ["^build"],"cache": true,- "with": ["//#test:uncached"],"inputs": ["$TURBO_DEFAULT$","!CHANGELOG.md",