Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
fix(ok): page the releases channel when Linear stamping fails (#4029)
Andrew Mikofalvy788ad959d945
diff --git a/.github/scripts/linear-release-shape.test.mjs b/.github/scripts/linear-release-shape.test.mjsnew file mode 100644index 000000000..a766dae10--- /dev/null+++ b/.github/scripts/linear-release-shape.test.mjs@@ -0,0 +1,89 @@+import { readFileSync } from 'node:fs';+import { dirname, join } from 'node:path';+import { fileURLToPath } from 'node:url';+import { describe, expect, test } from 'vitest';++const WORKFLOWS = join(dirname(fileURLToPath(import.meta.url)), '..', 'workflows');+const workflow = readFileSync(join(WORKFLOWS, 'linear-release.yml'), 'utf8');++const ALERT_STEP = 'Alert on failed stamping';++const ANY_STEP_START = /^ {6}- (.+)$/gm;++function stepLabels(source) {+ const labels = [...source.matchAll(ANY_STEP_START)].map((m) =>+ m[1].trim().replace(/^name: /, ''),+ );+ if (labels.length === 0) throw new Error('no steps parsed from the workflow');+ return labels;+}++function alertBlock(source) {+ const start = source.indexOf(` - name: ${ALERT_STEP}`);+ if (start === -1) throw new Error(`no step named "${ALERT_STEP}"`);+ return source.slice(start);+}++function assertAlertIsFinalStep(source) {+ const last = stepLabels(source).at(-1);+ if (last !== ALERT_STEP) {+ throw new Error(`expected "${ALERT_STEP}" to be the final step, found "${last}"`);+ }+}++const pageText = (alert) => {+ const line = alert.split('\n').find((l) => l.includes('TEXT="'));+ if (!line) throw new Error('no TEXT= assignment in the alert step');+ return line;+};++const OUTCOME_BRANCH =+ /if \[\[ "\$\{JOB_STATUS:-\}" == "cancelled" \]\]; then\n\s+OUTCOME="was cancelled or timed out"\n\s+else\n\s+OUTCOME="failed"\n\s+fi/;++const UNDELIVERABLE_POST_ONLY_WARNS =+ /if ! curl[\s\S]*?; then\n\s+echo "::warning::Linear stamping failure alert failed to POST\."\n\s+fi/;++describe('linear release stamping workflow', () => {+ test('a failed stamp pages the releases channel', () => {+ const alert = alertBlock(workflow);+ expect(alert).toMatch(/^ {8}if: failure\(\) \|\| cancelled\(\)$/m);+ expect(alert).toContain('"${SLACK_RELEASES_WEBHOOK_URL:-${SLACK_WEBHOOK_URL:-}}"');+ });++ test('the page names the tag, the outcome and the run', () => {+ const alert = alertBlock(workflow);+ const text = pageText(alert);+ expect(text).toContain('${TAG}');+ expect(text).toContain('${RUN_URL}');+ expect(text).toContain('${OUTCOME}');++ expect(alert).toMatch(OUTCOME_BRANCH);+ expect(alert).toContain('JOB_STATUS: ${{ job.status }}');+ expect(alert).toContain('CHANNEL: ${{ steps.derive.outputs.channel }}');+ expect(text).toContain('${CHANNEL:+ (${CHANNEL})}');+ expect(alert).toContain('payload=$(jq -nc --arg text "$TEXT" \'{text: $text}\')');+ });++ test('the alert covers every working step', () => {+ assertAlertIsFinalStep(workflow);++ const withNamedStepBelow = `${workflow}\n - name: Some later step\n run: exit 1\n`;+ expect(() => assertAlertIsFinalStep(withNamedStepBelow)).toThrow(+ 'expected "Alert on failed stamping" to be the final step, found "Some later step"',+ );++ const withNamelessStepBelow = `${workflow}\n - uses: actions/github-script@v7\n with:\n script: core.setFailed('x')\n`;+ expect(() => assertAlertIsFinalStep(withNamelessStepBelow)).toThrow(+ 'found "uses: actions/github-script@v7"',+ );+ });++ test('losing the notification cannot add a failure of its own', () => {+ const alert = alertBlock(workflow);+ expect(alert).toContain('set -uo pipefail');+ expect(alert).not.toContain('set -euo pipefail');+ expect(alert).toContain('if [[ -z "$WEBHOOK_URL" ]]; then');+ expect(alert).toMatch(/No Slack webhook secret is configured[\s\S]*?exit 0/);+ expect(alert).toMatch(UNDELIVERABLE_POST_ONLY_WARNS);+ });+});diff --git a/.github/scripts/release-cascade-shape.test.mjs b/.github/scripts/release-cascade-shape.test.mjsindex 34903e120..eb46869e1 100644--- a/.github/scripts/release-cascade-shape.test.mjs+++ b/.github/scripts/release-cascade-shape.test.mjs@@ -26,6 +26,7 @@ const workflowStep = (source, workflowName, name) => {};const bugLaneVerifyStep = (name) => workflowStep(bugLaneVerify, 'bug-lane-verify.yml', name);const selectBeta = read('select-beta-to-promote.yml');+const linearRelease = read('linear-release.yml');function stepNames(source) {const names = [...source.matchAll(/^ {6}- name: (.+)$/gm)].map((m) => m[1].trim());@@ -774,13 +775,17 @@ describe('every release-pipeline post prefers the releases webhook', () => {label: 'the fast-tier refusal',step: () => stepAfter(selectBeta, 'Record a fast-tier refusal'),},+ {+ label: "the Linear stamp's failure page",+ step: () => stepAfter(linearRelease, 'Alert on failed stamping'),+ },]) {test(`${label} resolves the releases webhook first`, () => {const s = step();expect(s).toContain('SLACK_RELEASES_WEBHOOK_URL: ${{ secrets.SLACK_RELEASES_WEBHOOK_URL }}');expect(s).toContain(RESOLVED);- expect(s).toContain('"$WEBHOOK_URL"');- expect(s).not.toContain('--data "$payload" "$SLACK_WEBHOOK_URL"');+ expect(s).toMatch(/--data "\$payload"[\s\\]*"\$WEBHOOK_URL"/);+ expect(s).not.toMatch(/--data "\$payload"[\s\\]*"\$SLACK_WEBHOOK_URL"/);expect(s).not.toContain('if [[ -z "${SLACK_WEBHOOK_URL:-}" ]]; then');});}diff --git a/.github/workflows/linear-release.yml b/.github/workflows/linear-release.ymlindex 8db702ecc..0217ea20c 100644--- a/.github/workflows/linear-release.yml+++ b/.github/workflows/linear-release.yml@@ -94,6 +94,20 @@ name: Linear Release# SAFETY# Fully decoupled from the release/publish path — a failure here can never# break a release. The job no-ops cleanly when LINEAR_ACCESS_KEY is absent.+# That decoupling cuts both ways, so the final step pages the releases channel+# on failure: nothing downstream notices when stamping stops, and without the+# page a broken run looks exactly like a healthy one from outside.+#+# What that page does NOT cover, so it is not mistaken for full coverage:+# a dispatch that never fires produces no run to attach a guard to, and any+# check for that would have to live with the producers (release.yml for beta,+# promote-stable.yml for stable). Nor does it cover the containment pass+# exiting 0 having reconciled nothing: with LINEAR_API_KEY unset it logs a+# notice and returns, and a ticket whose PR attachments all point outside the+# private monorepo is filtered out before any API call is made. Credential+# faults that DO reach the API throw rather than reading as an answer, so+# those go red and this page fires. stamp-by-containment.mjs is the authority+# on which paths exit 0; do not restate its branches here.on:repository_dispatch:@@ -216,7 +230,7 @@ jobs:echo "configured=true" >> "$GITHUB_OUTPUT"elseecho "configured=false" >> "$GITHUB_OUTPUT"- echo "::warning::OK_RELEASE_BRIDGE_APP_ID not set — fix commits cannot be resolved, so every ticket will be skipped rather than mis-stamped."+ echo "::warning::OK_RELEASE_BRIDGE_APP_ID not set — private-monorepo fix commits cannot be resolved, so the containment pass fails rather than mis-stamping."fi- name: Mint cross-repo read token (bridge App)@@ -241,3 +255,61 @@ jobs:# rewriting tickets. Set to `live` on the repo to arm real writes.STAMP_MODE: ${{ vars.STAMP_MODE }}run: node .github/scripts/stamp-by-containment.mjs++ # Being decoupled from the release path is what makes a failure here easy+ # to miss: the cut it belongs to goes green, ships, and announces itself,+ # so nothing about the release looks wrong and only this workflow's own+ # run is red. Five consecutive stable cuts failed that way over a day+ # before anyone noticed. The guard covers the whole job rather than one+ # step, since the useful signal is that stamping did not happen, not which+ # line of it stopped first — and the no-key path skips every step above+ # without failing, so an unconfigured repo stays silent.+ #+ # `failure() || cancelled()`, not bare `failure()`: the job carries+ # `timeout-minutes`, and a timeout kill CANCELS the job rather than+ # failing it, so a run that hangs on the Linear API or on the full-history+ # checkout would otherwise be the one path that pages nobody. That also+ # picks up an operator-initiated cancel, which is the right call here —+ # stamping did not happen either way, and `cancel-in-progress: false`+ # means no run is ever preempted by a newer one.+ - name: Alert on failed stamping+ if: failure() || cancelled()+ env:+ SLACK_RELEASES_WEBHOOK_URL: ${{ secrets.SLACK_RELEASES_WEBHOOK_URL }}+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}+ CHANNEL: ${{ steps.derive.outputs.channel }}+ JOB_STATUS: ${{ job.status }}+ run: |+ set -uo pipefail+ RUN_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"+ TAG="${RELEASE_TAG:-an unidentified tag}"+ # A timeout and an operator cancel are indistinguishable to an+ # expression — `job.status` exposes no separate timed-out state — so+ # the page names both rather than guessing which one happened.+ if [[ "${JOB_STATUS:-}" == "cancelled" ]]; then+ OUTCOME="was cancelled or timed out"+ else+ OUTCOME="failed"+ fi+ TEXT="Linear release stamping ${OUTCOME} for ${TAG}${CHANNEL:+ (${CHANNEL})}. The release itself is unaffected; Linear is now out of sync with what shipped. Re-running is safe, though on a stable tag it re-verifies every stable release's stamps rather than just this one. ${RUN_URL}"+ {+ echo "## Linear stamping ${OUTCOME}"+ echo "Tag: \`${TAG}\`"+ echo "Run: ${RUN_URL}"+ } >> "$GITHUB_STEP_SUMMARY"++ # A lost notification must never be the thing that fails a release+ # job, so both the missing-secret and dead-webhook paths warn and+ # return success — the red run is still the underlying alert.+ WEBHOOK_URL="${SLACK_RELEASES_WEBHOOK_URL:-${SLACK_WEBHOOK_URL:-}}"+ if [[ -z "$WEBHOOK_URL" ]]; then+ echo "::warning::No Slack webhook secret is configured; the workflow failure remains the alert."+ exit 0+ fi+ payload=$(jq -nc --arg text "$TEXT" '{text: $text}')+ if ! curl -sS --fail --connect-timeout 10 --max-time 30 -X POST \+ -H 'Content-type: application/json' \+ --data "$payload" \+ "$WEBHOOK_URL"; then+ echo "::warning::Linear stamping failure alert failed to POST."+ fidiff --git a/knip.config.ts b/knip.config.tsindex cb7d232fe..ee740611a 100644--- a/knip.config.ts+++ b/knip.config.ts@@ -126,9 +126,7 @@ 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'],diff --git a/packages/app/src/editor/extensions/source-dirty-fold-atomicity.dom.test.tsx b/packages/app/src/editor/extensions/source-dirty-fold-atomicity.dom.test.tsxindex 3a15d1233..9e043d02b 100644--- a/packages/app/src/editor/extensions/source-dirty-fold-atomicity.dom.test.tsx+++ b/packages/app/src/editor/extensions/source-dirty-fold-atomicity.dom.test.tsx@@ -1,4 +1,3 @@-import { sharedExtensions as coreExtensions, MarkdownManager } from '@inkeep/open-knowledge-core';import { type ObserverDispatchKind, setupServerObservers } from '@inkeep/open-knowledge-server';import { cleanup } from '@testing-library/react';diff --git a/packages/app/tests/dom/input-rule-atom-ranges.dom.test.tsx b/packages/app/tests/dom/input-rule-atom-ranges.dom.test.tsxindex 65162a22f..f81d64a77 100644--- a/packages/app/tests/dom/input-rule-atom-ranges.dom.test.tsx+++ b/packages/app/tests/dom/input-rule-atom-ranges.dom.test.tsx@@ -1,4 +1,3 @@-import { cleanup } from '@testing-library/react';import { Editor, getSchema } from '@tiptap/core';import type { MarkType, Node as PMNode } from '@tiptap/pm/model';diff --git a/packages/app/tests/dom/jsx-interior-input-rule-suppression.dom.test.tsx b/packages/app/tests/dom/jsx-interior-input-rule-suppression.dom.test.tsxindex c5b8ad023..c4c510031 100644--- a/packages/app/tests/dom/jsx-interior-input-rule-suppression.dom.test.tsx+++ b/packages/app/tests/dom/jsx-interior-input-rule-suppression.dom.test.tsx@@ -1,4 +1,3 @@-import { cleanup } from '@testing-library/react';import { Editor, type JSONContent } from '@tiptap/core';import type { Node as PMNode } from '@tiptap/pm/model';diff --git a/packages/app/tests/dom/plain-text-clipboard.dom.test.tsx b/packages/app/tests/dom/plain-text-clipboard.dom.test.tsxindex 65b32f4b3..931aaa880 100644--- a/packages/app/tests/dom/plain-text-clipboard.dom.test.tsx+++ b/packages/app/tests/dom/plain-text-clipboard.dom.test.tsx@@ -1,4 +1,3 @@-import { cleanup } from '@testing-library/react';import { Editor } from '@tiptap/core';import type { Node as PMNode } from '@tiptap/pm/model';diff --git a/packages/app/tests/dom/serializer-seam-rederive.dom.test.tsx b/packages/app/tests/dom/serializer-seam-rederive.dom.test.tsxindex 2ab40357a..c9744993d 100644--- a/packages/app/tests/dom/serializer-seam-rederive.dom.test.tsx+++ b/packages/app/tests/dom/serializer-seam-rederive.dom.test.tsx@@ -1,4 +1,3 @@-import { MarkdownManager, stripFrontmatter } from '@inkeep/open-knowledge-core';import { cleanup } from '@testing-library/react';import { Editor, type JSONContent } from '@tiptap/core';diff --git a/packages/app/tests/dom/task-list-input-rule.dom.test.tsx b/packages/app/tests/dom/task-list-input-rule.dom.test.tsxindex 1db8b25a9..e01856aac 100644--- a/packages/app/tests/dom/task-list-input-rule.dom.test.tsx+++ b/packages/app/tests/dom/task-list-input-rule.dom.test.tsx@@ -1,4 +1,3 @@-import { cleanup } from '@testing-library/react';import type { Editor } from '@tiptap/core';import type { Node as PMNode } from '@tiptap/pm/model';diff --git a/packages/app/tests/dom/underline-round-trip.dom.test.tsx b/packages/app/tests/dom/underline-round-trip.dom.test.tsxindex 652d75f43..f0bea3f33 100644--- a/packages/app/tests/dom/underline-round-trip.dom.test.tsx+++ b/packages/app/tests/dom/underline-round-trip.dom.test.tsx@@ -1,4 +1,3 @@-import { MarkdownManager, sharedExtensions, stripFrontmatter } from '@inkeep/open-knowledge-core';import { cleanup } from '@testing-library/react';import { Editor, getSchema, type JSONContent } from '@tiptap/core';diff --git a/packages/app/tests/integration/api-error-envelope/create-folder.test.ts b/packages/app/tests/integration/api-error-envelope/create-folder.test.tsindex 079b42e9a..49257d365 100644--- a/packages/app/tests/integration/api-error-envelope/create-folder.test.ts+++ b/packages/app/tests/integration/api-error-envelope/create-folder.test.ts@@ -1,4 +1,3 @@-import { CreateFolderSuccessSchema, ProblemDetailsSchema } from '@inkeep/open-knowledge-core';import { afterAll, beforeAll, describe, expect, test } from 'vitest';import { HARNESS_BOOT_TIMEOUT_MS } from '../harness-boot-timeout';diff --git a/packages/app/tests/integration/bug3-source-mode-writeback.test.ts b/packages/app/tests/integration/bug3-source-mode-writeback.test.tsindex a28cc2b18..8a60e5826 100644--- a/packages/app/tests/integration/bug3-source-mode-writeback.test.ts+++ b/packages/app/tests/integration/bug3-source-mode-writeback.test.ts@@ -1,4 +1,3 @@-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/indented-jsx-byte-sacred.test.ts b/packages/app/tests/integration/indented-jsx-byte-sacred.test.tsindex 4fc2c11f9..6fcdc23f2 100644--- a/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts+++ b/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts@@ -1,4 +1,3 @@-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 9f2f6feb6..40b5cdfd6 100644--- a/packages/app/tests/integration/interior-edit-freshness.test.ts+++ b/packages/app/tests/integration/interior-edit-freshness.test.ts@@ -1,4 +1,3 @@-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 2a085742b..93666af70 100644--- a/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts+++ b/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts@@ -1,4 +1,3 @@-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/producer-guard-wiring.test.ts b/packages/app/tests/integration/producer-guard-wiring.test.tsindex 878d5196b..867598d34 100644--- a/packages/app/tests/integration/producer-guard-wiring.test.ts+++ b/packages/app/tests/integration/producer-guard-wiring.test.ts@@ -1,4 +1,3 @@-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 4ada3cf26..0970ac12f 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,4 +1,3 @@-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 cbe2b705f..b632185e1 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,4 +1,3 @@-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 89bc9b4d9..c530ce4ba 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,4 +1,3 @@-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 a78aeb0e4..d3767adc9 100644--- a/packages/app/tests/integration/undo-after-rollback.test.ts+++ b/packages/app/tests/integration/undo-after-rollback.test.ts@@ -1,4 +1,3 @@-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 39e64a221..be1a29fbc 100644--- a/packages/app/tests/integration/undo-recycle-reset.test.ts+++ b/packages/app/tests/integration/undo-recycle-reset.test.ts@@ -1,4 +1,3 @@-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 9ddcd0730..7935e35f8 100644--- a/packages/app/tests/integration/undo-rederive-survival.test.ts+++ b/packages/app/tests/integration/undo-rederive-survival.test.ts@@ -1,4 +1,3 @@-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 2a597ec3d..f4cc8a286 100644--- a/packages/core/src/bridge/compose.ts+++ b/packages/core/src/bridge/compose.ts@@ -1,4 +1,3 @@-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 01ef76a9f..8fb428b90 100644--- a/packages/core/src/bridge/doc-boundary-space.ts+++ b/packages/core/src/bridge/doc-boundary-space.ts@@ -1,4 +1,3 @@-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 20a68d2a1..bfbd5a2e8 100644--- a/packages/core/src/markdown/comment-promoter.ts+++ b/packages/core/src/markdown/comment-promoter.ts@@ -1,4 +1,3 @@-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/fixtures/index.ts b/packages/core/src/markdown/fixtures/index.tsindex 6931623c7..00f5771ee 100644--- a/packages/core/src/markdown/fixtures/index.ts+++ b/packages/core/src/markdown/fixtures/index.ts@@ -1,4 +1,3 @@-import { readFileSync } from 'node:fs';import { dirname, resolve } from 'node:path';import { fileURLToPath } from 'node:url';@@ -9,7 +8,6 @@ function fixturePath(...segments: string[]): string {return resolve(FIXTURES_DIR, ...segments);}-interface GfmExample {section: string;markdown: string;@@ -19,7 +17,6 @@ export function loadGfmExamples(): GfmExample[] {return JSON.parse(readFileSync(fixturePath('gfm', 'examples.json'), 'utf8')) as GfmExample[];}-interface MdxCrashEntry {id: string;input: string;@@ -71,7 +68,6 @@ export function loadLargeEmbedFixtures(): LargeEmbedFixture[] {) as LargeEmbedFixture[];}-export function loadPrd6955Before(): string {return readFileSync(fixturePath('regression', 'prd-6955-before.md'), 'utf8');}@@ -80,7 +76,6 @@ export function loadPrd6955CorruptedTriplicated(): string {return readFileSync(fixturePath('regression', 'prd-6955-corrupted-triplicated.md'), 'utf8');}-export interface NgPinnedCase {id: string;name: string;@@ -97,7 +92,6 @@ export function loadNgPinnedCases(): NgPinnedCase[] {) as NgPinnedCase[];}-export function loadLargeRealistic(): string {return readFileSync(fixturePath('perf', 'large-realistic.md'), 'utf8');}diff --git a/packages/core/src/markdown/fixtures/perf/generate.ts b/packages/core/src/markdown/fixtures/perf/generate.tsindex daa3ef82b..8b1eb8519 100644--- a/packages/core/src/markdown/fixtures/perf/generate.ts+++ b/packages/core/src/markdown/fixtures/perf/generate.ts@@ -1,4 +1,3 @@-import { writeFileSync } from 'node:fs';import { dirname, resolve } from 'node:path';import { fileURLToPath } from 'node:url';@@ -11,7 +10,6 @@ const BASELINE_ONLY_COUNTS = [500, 2500] as const;const SEED = 0xf1de1117;-function mulberry32(seed: number): () => number {let a = seed >>> 0;return () => {@@ -38,7 +36,6 @@ function pickWeighted<T>(rand: () => number, items: readonly [T, number][]): T {return items[items.length - 1][0];}-const WORDS = ['lorem','ipsum',@@ -156,7 +153,6 @@ function mdxBlock(rand: () => number): string {return `<${name}>\n\n${sentence(rand)}\n\n</${name}>`;}-type BlockKind = 'paragraph' | 'heading' | 'list' | 'code' | 'table' | 'mdx';const MIX: readonly [BlockKind, number][] = [@@ -195,7 +191,6 @@ function generateDocument(blockCount: number, seed: number): string {return `${blocks.join('\n\n')}\n`;}-function main(): void {for (const count of [...BLOCK_COUNTS, ...BASELINE_ONLY_COUNTS]) {const doc = generateDocument(count, SEED);diff --git a/packages/core/src/markdown/image-promoter.ts b/packages/core/src/markdown/image-promoter.tsindex 994eb6917..706fa9afb 100644--- a/packages/core/src/markdown/image-promoter.ts+++ b/packages/core/src/markdown/image-promoter.ts@@ -1,4 +1,3 @@-import type { Image, Paragraph, Root } from 'mdast';import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';import { visit } from 'unist-util-visit';diff --git a/packages/core/src/markdown/math-promoter.ts b/packages/core/src/markdown/math-promoter.tsindex bd79424c7..a5b511f25 100644--- a/packages/core/src/markdown/math-promoter.ts+++ b/packages/core/src/markdown/math-promoter.ts@@ -1,4 +1,3 @@-import type { Code, Root } from 'mdast';import type { Math as MdastMath } from 'mdast-util-math';import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';diff --git a/packages/core/src/markdown/merged-walker.ts b/packages/core/src/markdown/merged-walker.tsindex fa3cfcd86..bfd7e3109 100644--- a/packages/core/src/markdown/merged-walker.ts+++ b/packages/core/src/markdown/merged-walker.ts@@ -1,4 +1,3 @@-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 8be632ba4..4d3250d3a 100644--- a/packages/core/src/markdown/safe-url.ts+++ b/packages/core/src/markdown/safe-url.ts@@ -1,4 +1,3 @@-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/checkpoint-retention-tie.test.ts b/packages/server/src/checkpoint-retention-tie.test.tsindex 0a43a2773..8a5d82998 100644--- a/packages/server/src/checkpoint-retention-tie.test.ts+++ b/packages/server/src/checkpoint-retention-tie.test.ts@@ -1,4 +1,3 @@-import { execFileSync } from 'node:child_process';import { mkdirSync, mkdtempSync, rmSync } from 'node:fs';import { tmpdir } from 'node:os';diff --git a/packages/server/src/qa-degradation-matrix.test.ts b/packages/server/src/qa-degradation-matrix.test.tsindex 00bb6efe7..84e3e5297 100644--- a/packages/server/src/qa-degradation-matrix.test.ts+++ b/packages/server/src/qa-degradation-matrix.test.ts@@ -1,4 +1,3 @@-import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';import type * as Y from 'yjs';import { createBridgeDeriveLossReporter } from './bridge-loss-detector.ts';diff --git a/packages/server/src/qa-gc-budget-isolation.test.ts b/packages/server/src/qa-gc-budget-isolation.test.tsindex b65c4693e..a800ca9f3 100644--- a/packages/server/src/qa-gc-budget-isolation.test.ts+++ b/packages/server/src/qa-gc-budget-isolation.test.ts@@ -1,4 +1,3 @@-import { mkdirSync, mkdtempSync, rmSync } from 'node:fs';import { tmpdir } from 'node:os';import { join, resolve } from 'node:path';diff --git a/packages/server/src/qa-watcher-intake-lens.test.ts b/packages/server/src/qa-watcher-intake-lens.test.tsindex 4669d1b98..2337e6c3c 100644--- a/packages/server/src/qa-watcher-intake-lens.test.ts+++ b/packages/server/src/qa-watcher-intake-lens.test.ts@@ -1,4 +1,3 @@-import { Hocuspocus } from '@hocuspocus/server';import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';import * as Y from 'yjs';