From 8711cf1a486bd73d5aabfb415120579ebe51fbe5 Mon Sep 17 00:00:00 2001 From: sudacode Date: Tue, 14 Jul 2026 19:57:50 -0700 Subject: [PATCH] remove redundant isVerbNonIndependent and consolidate test lanes - drop always-true isVerbNonIndependent export; collapse shouldMerge branch - remove node-compat exclusion list from bun-src-full lane - simplify test:fast (drop test:runtime:compat), test:env, test:smoke:dist scripts - rename test:launcher:env:src -> test:env in docs --- docs-site/development.md | 2 +- docs/workflow/verification.md | 2 +- package.json | 18 ++++++------------ scripts/test-lanes.ts | 9 --------- src/token-merger.test.ts | 7 +++++++ src/token-merger.ts | 9 +-------- 6 files changed, 16 insertions(+), 31 deletions(-) create mode 100644 src/token-merger.test.ts diff --git a/docs-site/development.md b/docs-site/development.md index d72f7f3d..6ffdc59c 100644 --- a/docs-site/development.md +++ b/docs-site/development.md @@ -135,7 +135,7 @@ Focused commands: bun run test:config # Source-level config schema/validation tests bun run test:launcher # Launcher regression tests (config discovery + command routing) bun run test:launcher:smoke:src # Launcher e2e smoke: launcher -> mpv IPC -> overlay start/stop wiring -bun run test:launcher:env:src # Launcher smoke + Lua plugin gate +bun run test:env # Launcher smoke + Lua plugin gate bun run test:src # Bun-managed maintained src/** discovery lane bun run test:launcher:unit:src # Bun-managed maintained launcher unit lane bun run test:scripts # Bun-managed scripts/** test lane diff --git a/docs/workflow/verification.md b/docs/workflow/verification.md index 1d427900..efdd4c12 100644 --- a/docs/workflow/verification.md +++ b/docs/workflow/verification.md @@ -17,7 +17,7 @@ Read when: selecting the right verification lane for a change one file cannot cascade into the rest of the lane. `--jobs N` parallelizes; `--single-process` restores the shared-process mode for debugging. - `bun run test:fast` is the full source gate: discovered `src/**`, launcher - unit, `scripts/**`, and the compiled runtime-compat slice. + unit, and `scripts/**`. - `.github/workflows/quality-gate.yml` is the reusable `workflow_call` gate for pull requests, stable tags, and prerelease tags. Keep common quality steps there instead of copying them into caller workflows. diff --git a/package.json b/package.json index 8e4756f4..c50a7ded 100644 --- a/package.json +++ b/package.json @@ -47,13 +47,9 @@ "docs:preview": "bun run --cwd docs-site docs:preview", "docs:test": "bun run --cwd docs-site test", "test:docs:kb": "bun test scripts/docs-knowledge-base.test.ts", - "test:config:src": "bun scripts/run-test-lane.mjs config", - "test:config:smoke:dist": "bun test dist/config/path-resolution.test.js", "test:plugin:src": "lua scripts/test-plugin-lua-compat.lua && lua scripts/test-plugin-start-gate.lua && lua scripts/test-plugin-process-start-retries.lua && lua scripts/test-plugin-restart-feedback.lua && lua scripts/test-plugin-session-bindings.lua && lua scripts/test-plugin-binary-windows.lua", "test:launcher:smoke:src": "bun test launcher/smoke.e2e.test.ts", - "test:launcher:src": "bun scripts/run-test-lane.mjs launcher && bun run test:plugin:src", - "test:core:smoke:dist": "bun test dist/cli/help.test.js dist/core/services/runtime-config.test.js dist/core/services/ipc.test.js dist/core/services/overlay-manager.test.js dist/core/services/anilist/anilist-token-store.test.js dist/core/services/startup-bootstrap.test.js dist/renderer/error-recovery.test.js dist/main/anilist-url-guard.test.js dist/window-trackers/x11-tracker.test.js", - "test:smoke:dist": "bun run test:config:smoke:dist && bun run test:core:smoke:dist", + "test:smoke:dist": "bun scripts/run-test-lane.mjs bun-src-full", "test:subtitle:src": "bun test src/core/services/subsync.test.ts src/subsync/utils.test.ts", "test:immersion:sqlite:src": "bun test src/core/services/immersion-tracker-service.test.ts src/core/services/immersion-tracker/storage-session.test.ts", "test:immersion:sqlite:dist": "bun test dist/core/services/immersion-tracker-service.test.js dist/core/services/immersion-tracker/storage-session.test.js", @@ -64,15 +60,13 @@ "test:launcher:unit:src": "bun scripts/run-test-lane.mjs bun-launcher-unit", "test:scripts": "bun scripts/run-test-lane.mjs scripts", "test:stats": "bun scripts/run-test-lane.mjs stats", - "test:launcher:env:src": "bun run test:launcher:smoke:src && bun run test:plugin:src", - "test:env": "bun run test:launcher:env:src && bun run test:immersion:sqlite:src", - "test:runtime:compat": "bun run tsc && bun test dist/core/services/ipc.test.js dist/core/services/anki-jimaku-ipc.test.js dist/core/services/overlay-manager.test.js dist/main/config-validation.test.js dist/main/runtime/registry.test.js dist/main/runtime/startup-config.test.js", - "test:node:compat": "bun run test:runtime:compat", + "test:env": "bun run test:launcher:smoke:src && bun run test:plugin:src && bun run test:immersion:sqlite:src", + "test:runtime:compat": "bun run tsc && bun scripts/run-test-lane.mjs bun-src-full", "test": "bun run test:fast", - "test:config": "bun run test:config:src", - "test:launcher": "bun run test:launcher:src", + "test:config": "bun scripts/run-test-lane.mjs config", + "test:launcher": "bun scripts/run-test-lane.mjs launcher && bun run test:plugin:src", "test:subtitle": "bun run test:subtitle:src", - "test:fast": "bun run test:src && bun run test:launcher:unit:src && bun run test:scripts && bun run test:runtime:compat", + "test:fast": "bun run test:src && bun run test:launcher:unit:src && bun run test:scripts", "generate:config-example": "bun run src/generate-config-example.ts", "verify:config-example": "bun run src/verify-config-example.ts", "start": "bun run build && electron . --start", diff --git a/scripts/test-lanes.ts b/scripts/test-lanes.ts index aa25cedf..d3cd0064 100644 --- a/scripts/test-lanes.ts +++ b/scripts/test-lanes.ts @@ -16,15 +16,6 @@ export const testLanes: Record = { 'bun-src-full': { roots: ['src'], include: ['.test.ts', '.type-test.ts'], - // Node-compat suites; their dist builds run via test:runtime:compat. - exclude: [ - 'src/core/services/anki-jimaku-ipc.test.ts', - 'src/core/services/ipc.test.ts', - 'src/core/services/overlay-manager.test.ts', - 'src/main/config-validation.test.ts', - 'src/main/runtime/registry.test.ts', - 'src/main/runtime/startup-config.test.ts', - ], }, config: { roots: ['src/config'], diff --git a/src/token-merger.test.ts b/src/token-merger.test.ts new file mode 100644 index 00000000..617c7473 --- /dev/null +++ b/src/token-merger.test.ts @@ -0,0 +1,7 @@ +import assert from 'node:assert/strict'; +import test from 'node:test'; +import * as tokenMerger from './token-merger'; + +test('does not expose the redundant verb non-independent predicate', () => { + assert.equal('isVerbNonIndependent' in tokenMerger, false); +}); diff --git a/src/token-merger.ts b/src/token-merger.ts index 1e0ecf47..d2f3bb02 100644 --- a/src/token-merger.ts +++ b/src/token-merger.ts @@ -94,10 +94,6 @@ export function isVerb(tok: Token): boolean { return [PartOfSpeech.verb, PartOfSpeech.bound_auxiliary].includes(tok.partOfSpeech); } -export function isVerbNonIndependent(): boolean { - return true; -} - export function canReceiveAuxiliary(tok: Token): boolean { return [PartOfSpeech.verb, PartOfSpeech.bound_auxiliary, PartOfSpeech.i_adjective].includes( tok.partOfSpeech, @@ -127,10 +123,7 @@ export function shouldMerge(lastStandaloneToken: Token, token: Token): boolean { if (isAuxVerb(token)) { return true; } - if (isContinuativeForm(lastStandaloneToken) && isVerbSuffix(token)) { - return true; - } - if (isVerbSuffix(token) && isVerbNonIndependent()) { + if (isVerbSuffix(token)) { return true; } }