update docs

This commit is contained in:
2026-02-22 02:15:12 -08:00
parent 4be3ecf7ac
commit c480fe6ad4
39 changed files with 139 additions and 338 deletions

View File

@@ -4,7 +4,7 @@ title: Run post-refactor dead code prune and cleanup
status: Done
assignee: []
created_date: '2026-02-21 07:15'
updated_date: '2026-02-22 04:01'
updated_date: '2026-02-22 07:49'
labels:
- cleanup
- maintainability
@@ -13,6 +13,7 @@ dependencies:
- TASK-96
- TASK-97
priority: medium
ordinal: 70000
---
## Description

View File

@@ -5,7 +5,7 @@ status: Done
assignee:
- codex-task101-docs-archive
created_date: '2026-02-21 07:15'
updated_date: '2026-02-22 03:01'
updated_date: '2026-02-22 07:49'
labels:
- documentation
- maintainability
@@ -16,6 +16,7 @@ dependencies:
- TASK-99
- TASK-100
priority: low
ordinal: 72000
---
## Description

View File

@@ -1,10 +1,10 @@
---
id: TASK-102
title: Restore Jellyfin session migration contract and build green
status: To Do
status: Done
assignee: []
created_date: '2026-02-22 07:12'
updated_date: '2026-02-22 07:12'
updated_date: '2026-02-22 07:51'
labels:
- bug
- jellyfin
@@ -12,6 +12,7 @@ labels:
dependencies:
- TASK-93
priority: high
ordinal: 99000
---
## Description

View File

@@ -1,17 +1,18 @@
---
id: TASK-107
title: Fix post-rebase overlay toggle regression
status: In Progress
status: Done
assignee:
- codex
created_date: '2026-02-21 23:34'
updated_date: '2026-02-21 23:45'
updated_date: '2026-02-22 07:49'
labels:
- bug
- overlay
- regression
dependencies: []
priority: high
ordinal: 98000
---
## Description
@@ -37,19 +38,12 @@ Need root-cause fix so both overlay modes render and interactive/keybind behavio
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 Toggling visible overlay shows subtitle content again.
- [ ] #2 Toggling invisible overlay restores interactive subtitle behavior.
- [ ] #3 Overlay keybinds work after overlay toggle in both modes.
- [ ] #4 Added regression coverage for broken toggle path.
- [x] #1 Toggling visible overlay shows subtitle content again.
- [x] #2 Toggling invisible overlay restores interactive subtitle behavior.
- [x] #3 Overlay keybinds work after overlay toggle in both modes.
- [x] #4 Added regression coverage for broken toggle path.
<!-- AC:END -->
## Definition of Done
<!-- DOD:BEGIN -->
- [ ] #1 Focused overlay/runtime tests pass.
- [ ] #2 No new type/build regressions introduced by fix.
- [ ] #3 Task notes include root cause and validation commands.
<!-- DOD:END -->
## Implementation Notes
<!-- SECTION:NOTES:BEGIN -->
@@ -60,3 +54,10 @@ Need root-cause fix so both overlay modes render and interactive/keybind behavio
- Added regression test `src/core/services/overlay-window-config.test.ts` to guard sandbox setting.
- Validation: `bun test src/core/services/overlay-window-config.test.ts src/renderer/error-recovery.test.ts`; `bun run build`.
<!-- SECTION:NOTES:END -->
## Definition of Done
<!-- DOD:BEGIN -->
- [x] #1 Focused overlay/runtime tests pass.
- [x] #2 No new type/build regressions introduced by fix.
- [x] #3 Task notes include root cause and validation commands.
<!-- DOD:END -->

View File

@@ -4,6 +4,7 @@ title: Fix AniList OAuth callback token handling in setup window
status: Done
assignee: []
created_date: '2026-02-19 16:56'
updated_date: '2026-02-22 07:49'
labels:
- anilist
- oauth
@@ -11,6 +12,7 @@ labels:
dependencies: []
parent_task_id: TASK-29
priority: high
ordinal: 97000
---
## Description
@@ -28,16 +30,18 @@ Need robust callback handling for both query and hash access_token forms and gra
- [x] #3 No unsafe navigation regressions in AniList setup window
<!-- AC:END -->
## Definition of Done
<!-- DOD:BEGIN -->
- [x] #1 Build passes
- [x] #2 Targeted AniList runtime tests pass
<!-- DOD:END -->
## Implementation Notes
<!-- SECTION:NOTES:BEGIN -->
<!-- SECTION:IMPLEMENTATION_NOTES:BEGIN -->
- Added robust AniList callback token parsing for query/hash and `subminer://anilist-setup?...` deep links.
- Added app-level protocol handling (`open-url` + second-instance argv deep link parsing) so browser callback buttons resolve even when setup window is not navigating.
- Added/updated targeted AniList setup runtime tests and verified build + runtime test pass.
<!-- SECTION:IMPLEMENTATION_NOTES:END -->
<!-- SECTION:NOTES:END -->
## Definition of Done
<!-- DOD:BEGIN -->
- [x] #1 Build passes
- [x] #2 Targeted AniList runtime tests pass
<!-- DOD:END -->

View File

@@ -5,13 +5,14 @@ status: Done
assignee:
- codex
created_date: '2026-02-18 11:35'
updated_date: '2026-02-21 04:57'
updated_date: '2026-02-22 07:49'
labels:
- architecture
- refactor
- maintainability
dependencies: []
priority: high
ordinal: 90000
---
## Description

View File

@@ -4,13 +4,14 @@ title: Make startup config loading strict with clear user-facing errors
status: Done
assignee: []
created_date: '2026-02-18 11:35'
updated_date: '2026-02-21 23:26'
updated_date: '2026-02-22 07:49'
labels:
- config
- ux
- reliability
dependencies: []
priority: medium
ordinal: 82000
---
## Description

View File

@@ -4,13 +4,14 @@ title: Consolidate launcher mpv socket readiness primitives
status: Done
assignee: []
created_date: '2026-02-18 11:35'
updated_date: '2026-02-21 20:19'
updated_date: '2026-02-22 07:49'
labels:
- launcher
- mpv
- refactor
dependencies: []
priority: medium
ordinal: 85000
---
## Description

View File

@@ -4,7 +4,7 @@ title: Add launcher regression tests for config discovery and command branching
status: Done
assignee: []
created_date: '2026-02-18 11:35'
updated_date: '2026-02-21 20:21'
updated_date: '2026-02-22 07:49'
labels:
- launcher
- tests
@@ -12,6 +12,7 @@ labels:
dependencies:
- TASK-70
priority: medium
ordinal: 84000
---
## Description

View File

@@ -4,13 +4,14 @@ title: Move mpv OSD log writes to buffered async path
status: Done
assignee: []
created_date: '2026-02-18 11:35'
updated_date: '2026-02-21 23:48'
updated_date: '2026-02-22 07:49'
labels:
- logging
- performance
- main-process
dependencies: []
priority: low
ordinal: 79000
---
## Description

View File

@@ -4,7 +4,7 @@ title: Decompose anki-integration orchestrator into workflow services
status: Done
assignee: []
created_date: '2026-02-18 11:43'
updated_date: '2026-02-21 21:16'
updated_date: '2026-02-22 07:49'
labels:
- anki
- refactor
@@ -12,6 +12,7 @@ labels:
dependencies:
- TASK-57
priority: high
ordinal: 83000
---
## Description

View File

@@ -7,13 +7,14 @@ status: Done
assignee:
- '@opencode'
created_date: '2026-02-18 11:43'
updated_date: '2026-02-21 23:47'
updated_date: '2026-02-22 07:49'
labels:
- tokenizer
- subtitles
- refactor
dependencies: []
priority: high
ordinal: 80000
---
## Description

View File

@@ -4,7 +4,7 @@ title: Modularize config definitions and validation by domain
status: Done
assignee: []
created_date: '2026-02-18 11:43'
updated_date: '2026-02-22 00:06'
updated_date: '2026-02-22 07:49'
labels:
- config
- refactor
@@ -13,6 +13,7 @@ dependencies:
- TASK-69
- TASK-72
priority: high
ordinal: 78000
---
## Description

View File

@@ -5,7 +5,7 @@ status: Done
assignee:
- '@sudacode'
created_date: '2026-02-18 11:43'
updated_date: '2026-02-22 00:10'
updated_date: '2026-02-22 07:49'
labels:
- main-process
- state-management
@@ -13,6 +13,7 @@ labels:
dependencies:
- TASK-71
priority: medium
ordinal: 77000
---
## Description

View File

@@ -5,13 +5,14 @@ status: Done
assignee:
- opencode-task80-ipc-contract
created_date: '2026-02-18 11:43'
updated_date: '2026-02-22 00:56'
updated_date: '2026-02-22 07:49'
labels:
- ipc
- type-safety
- reliability
dependencies: []
priority: medium
ordinal: 75000
---
## Description

View File

@@ -5,7 +5,7 @@ status: Done
assignee:
- opencode-task81-launcher-modules
created_date: '2026-02-18 11:43'
updated_date: '2026-02-22 01:09'
updated_date: '2026-02-22 07:49'
labels:
- launcher
- cli
@@ -15,6 +15,7 @@ dependencies:
- TASK-73
- TASK-74
priority: medium
ordinal: 74000
---
## Description

View File

@@ -5,7 +5,7 @@ status: Done
assignee:
- codex-task82-smoke-20260222T002523Z-3j7u
created_date: '2026-02-18 11:43'
updated_date: '2026-02-22 00:55'
updated_date: '2026-02-22 07:49'
labels:
- testing
- e2e
@@ -14,6 +14,7 @@ labels:
dependencies:
- TASK-74
priority: high
ordinal: 76000
---
## Description

View File

@@ -5,10 +5,11 @@ status: Done
assignee:
- opencode-task84-keybindings-gating
created_date: '2026-02-19 08:41'
updated_date: '2026-02-22 01:35'
updated_date: '2026-02-22 07:49'
labels: []
dependencies: []
priority: medium
ordinal: 73000
---
## Description

View File

@@ -4,13 +4,14 @@ title: Refactor large files for maintainability and readability
status: Done
assignee: []
created_date: '2026-02-19 09:46'
updated_date: '2026-02-21 07:11'
updated_date: '2026-02-22 07:49'
labels:
- architecture
- refactor
- maintainability
dependencies: []
priority: medium
ordinal: 88000
---
## Description

View File

@@ -4,10 +4,11 @@ title: Update default subtitle background RGBA
status: Done
assignee: []
created_date: '2026-02-20 05:43'
updated_date: '2026-02-20 05:44'
updated_date: '2026-02-22 07:49'
labels: []
dependencies: []
priority: low
ordinal: 95000
---
## Description

View File

@@ -4,10 +4,11 @@ title: Normalize narrow Unicode whitespace in tokenizer input
status: Done
assignee: []
created_date: '2026-02-20 06:17'
updated_date: '2026-02-20 06:20'
updated_date: '2026-02-22 07:49'
labels: []
dependencies: []
priority: medium
ordinal: 94000
---
## Description

View File

@@ -4,10 +4,11 @@ title: Add config toggle to preserve visible overlay subtitle line breaks
status: Done
assignee: []
created_date: '2026-02-20 06:35'
updated_date: '2026-02-20 11:10'
updated_date: '2026-02-22 07:49'
labels: []
dependencies: []
priority: medium
ordinal: 93000
---
## Description

View File

@@ -4,10 +4,11 @@ title: Store Jellyfin token in encrypted local token store like AniList
status: Done
assignee: []
created_date: '2026-02-20 02:22'
updated_date: '2026-02-20 02:22'
updated_date: '2026-02-22 07:49'
labels: []
dependencies: []
priority: medium
ordinal: 96000
---
## Description

View File

@@ -4,7 +4,7 @@ title: Synchronize TASK-85 closure tracking and child-task status
status: Done
assignee: []
created_date: '2026-02-20 12:06'
updated_date: '2026-02-21 07:11'
updated_date: '2026-02-22 07:49'
labels:
- process
- refactor
@@ -12,6 +12,7 @@ labels:
dependencies:
- TASK-85
priority: high
ordinal: 89000
---
## Description

View File

@@ -4,7 +4,7 @@ title: Reduce main.ts to thin composition root
status: Done
assignee: []
created_date: '2026-02-20 12:06'
updated_date: '2026-02-21 04:12'
updated_date: '2026-02-22 07:49'
labels:
- architecture
- refactor
@@ -13,6 +13,7 @@ dependencies:
- TASK-71
- TASK-85
priority: high
ordinal: 92000
---
## Description

View File

@@ -1,78 +0,0 @@
---
id: TASK-95
title: Decompose remaining oversized core hotspots
status: Done
assignee:
- codex-task95-hotspots
created_date: '2026-02-20 12:06'
updated_date: '2026-02-21 03:29'
labels:
- architecture
- refactor
- maintainability
dependencies:
- TASK-85
references:
- docs/plans/2026-02-21-task-95-hotspot-decomposition-plan.md
priority: high
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Three core files remain materially oversized and unfinished: `src/anki-integration.ts`, `src/config/service.ts`, and `src/core/services/immersion-tracker-service.ts`. Complete decomposition into focused collaborators/modules with behavior preserved and regression coverage.
<!-- SECTION:DESCRIPTION:END -->
## Action Steps
<!-- SECTION:PLAN:BEGIN -->
1. Capture per-file baseline LOC and key responsibilities (constructor orchestration, phase lifecycle, persistence/sync/event flow).
2. For `src/anki-integration.ts`: extract facade collaborators by domain (config/field resolution/media/card creation/notifications) and reduce class surface to orchestration.
3. For `src/config/service.ts`: split lifecycle phases into explicit modules (`load`, `migrate`, `validate`, `warnings`) and keep API stable.
4. For `src/core/services/immersion-tracker-service.ts`: separate state/reducer, persistence adapter, and sync/reporting orchestration.
5. Add focused tests for extracted modules and preserve existing integration-level assertions.
6. Run full build + config/core tests + file-budget checks; record before/after LOC metrics.
7. Update `TASK-85` AC/DoD linkage to mark completed sub-scope with evidence.
<!-- SECTION:PLAN:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 `src/anki-integration.ts`, `src/config/service.ts`, and `src/core/services/immersion-tracker-service.ts` are each reduced with clear collaborator boundaries.
- [x] #2 Public behavior remains unchanged (existing config/core tests pass).
- [x] #3 New seam tests cover extracted collaborators/modules.
- [x] #4 File-budget report reflects measurable LOC reduction on all three hotspots.
<!-- AC:END -->
## Implementation Plan
<!-- SECTION:PLAN:BEGIN -->
Execution plan of record: `docs/plans/2026-02-21-task-95-hotspot-decomposition-plan.md`
1. Capture baseline LOC and file-budget status for the 3 hotspot files.
2. Add characterization seam tests before extraction in each domain (Anki, Config, Immersion).
3. Decompose each hotspot behind stable facades by extracting focused collaborators/modules.
4. Use parallel subagents for independent hotspot workstreams; integrate safely on shared boundaries.
5. Run required gates (`bun run build`, `bun run test:config:dist`, `bun run test:core:dist`, `bun run check:file-budgets`).
6. Record before/after LOC plus ownership map; update TASK-95 AC/DoD and TASK-85 progress evidence.
<!-- SECTION:PLAN:END -->
## Implementation Notes
<!-- SECTION:NOTES:BEGIN -->
Baseline LOC (before): `src/anki-integration.ts` 1722, `src/config/service.ts` 1591, `src/core/services/immersion-tracker-service.ts` 1470.
After LOC: `src/anki-integration.ts` 1315 (-407), `src/config/service.ts` 99 (-1492), `src/core/services/immersion-tracker-service.ts` 1109 (-361).
Module ownership map: Anki -> `src/anki-integration/field-grouping-merge.ts`; Config -> `src/config/{load.ts,parse.ts,warnings.ts,resolve.ts}`; Immersion -> `src/core/services/immersion-tracker/{types.ts,reducer.ts,queue.ts,maintenance.ts,query.ts}`.
Seam tests added: `src/anki-integration.test.ts` (field-grouping merge seams), `src/config/config.test.ts` (loader/strict reload/warning determinism seams), `src/core/services/immersion-tracker-service.test.ts` (queue/reducer/month-key seams).
Verification gates passed: `bun run build`, `bun run test:config:dist` (43 pass), `bun run test:core:dist` (204 pass, 10 skipped, 0 fail), `bun run check:file-budgets` (warning-mode report with all three hotspot LOC reduced).
<!-- SECTION:NOTES:END -->
## Definition of Done
<!-- DOD:BEGIN -->
- [x] #1 Refactor notes include before/after LOC and module ownership map for all three files.
- [x] #2 `bun run build`, `bun run test:config:dist`, `bun run test:core:dist` pass.
- [x] #3 `TASK-85` progress/AC reflects this completion slice with evidence links.
<!-- DOD:END -->

View File

@@ -4,7 +4,7 @@ title: Suppress MPV IPC connect-request info log spam
status: Done
assignee: []
created_date: '2026-02-21 04:38'
updated_date: '2026-02-21 04:40'
updated_date: '2026-02-22 07:49'
labels:
- logging
- mpv
@@ -12,6 +12,7 @@ labels:
- quality
dependencies: []
priority: high
ordinal: 91000
---
## Description

View File

@@ -1,52 +0,0 @@
---
id: TASK-96
title: Decouple secondary subtitle lifecycle from visible/invisible overlays
status: To Do
assignee: []
created_date: '2026-02-21 04:41'
updated_date: '2026-02-21 04:41'
labels:
- subtitles
- overlay
- architecture
dependencies: []
priority: high
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Secondary subtitle behavior should not depend on visible/invisible overlay state transitions. Introduce an independent lifecycle so secondary subtitle rendering, visibility mode (`always`/`hover`/`never`), and positioning stay stable even when primary overlays are toggled or rebound.
<!-- SECTION:DESCRIPTION:END -->
## Suggestions
<!-- SECTION:SUGGESTIONS:BEGIN -->
- Isolate secondary subtitle state management from primary overlay window orchestration.
- Route secondary subtitle updates through a dedicated service/controller boundary.
- Keep MPV secondary subtitle property handling independent from overlay visibility toggles.
<!-- SECTION:SUGGESTIONS:END -->
## Action Steps
<!-- SECTION:PLAN:BEGIN -->
1. Inventory existing coupling points between secondary subtitle updates and overlay visibility/bounds services.
2. Introduce explicit secondary subtitle lifecycle state and transitions.
3. Refactor event wiring so visible/invisible overlay toggles do not mutate secondary subtitle state.
4. Validate display modes (`always`/`hover`/`never`) continue to work with independent lifecycle.
5. Add regression tests for overlay toggles, reconnect/restart, and mode-switch behavior.
<!-- SECTION:PLAN:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 Toggling visible or invisible overlays does not alter secondary subtitle lifecycle state.
- [ ] #2 Secondary subtitle display mode behavior remains correct across overlay state transitions.
- [ ] #3 Secondary subtitle behavior survives MPV reconnect/restart without overlay-coupling regressions.
- [ ] #4 Automated tests cover decoupled lifecycle behavior and prevent re-coupling.
<!-- AC:END -->
## Definition of Done
<!-- DOD:BEGIN -->
- [ ] #1 Relevant unit/integration tests pass
- [ ] #2 Documentation/comments updated where lifecycle ownership changed
<!-- DOD:END -->

View File

@@ -5,7 +5,7 @@ status: Done
assignee:
- '@codex-task96-config-resolve'
created_date: '2026-02-21 07:15'
updated_date: '2026-02-21 20:10'
updated_date: '2026-02-22 07:49'
labels:
- architecture
- refactor
@@ -13,6 +13,7 @@ labels:
dependencies:
- TASK-85
priority: high
ordinal: 86000
---
## Description

View File

@@ -1,52 +0,0 @@
---
id: TASK-97
title: Add intro skip playback control
status: To Do
assignee: []
created_date: '2026-02-21 04:41'
updated_date: '2026-02-21 04:41'
labels:
- playback
- ux
dependencies: []
priority: medium
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Add an intro skip control so users can jump past opening sequences quickly during playback. Start with a reliable manual control (shortcut/action) and clear user feedback after seek.
<!-- SECTION:DESCRIPTION:END -->
## Suggestions
<!-- SECTION:SUGGESTIONS:BEGIN -->
- Add a configurable skip duration (for example 60/75/90 seconds).
- Expose skip intro via keybinding and optional UI action in overlay/help.
- Show transient confirmation (OSD/overlay message) after skip action.
<!-- SECTION:SUGGESTIONS:END -->
## Action Steps
<!-- SECTION:PLAN:BEGIN -->
1. Define config and keybinding surface for intro skip duration and trigger.
2. Implement intro skip command that performs bounded seek in active playback session.
3. Wire command to user trigger path (keyboard + optional on-screen action if present).
4. Emit user feedback after successful skip (current time + skipped duration).
5. Add tests for command dispatch, seek bounds, and config fallback behavior.
<!-- SECTION:PLAN:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 User can trigger intro skip during playback with configured shortcut/action.
- [ ] #2 Skip performs bounded seek and never seeks before start or beyond stream duration.
- [ ] #3 Skip duration is configurable with sane default.
- [ ] #4 User receives visible confirmation after skip.
- [ ] #5 Automated tests cover config + seek behavior.
<!-- AC:END -->
## Definition of Done
<!-- DOD:BEGIN -->
- [ ] #1 Playback control tests pass
- [ ] #2 User-facing config/docs updated for intro skip control
<!-- DOD:END -->

View File

@@ -5,7 +5,7 @@ status: Done
assignee:
- opencode
created_date: '2026-02-21 07:15'
updated_date: '2026-02-21 10:07'
updated_date: '2026-02-22 07:49'
labels:
- architecture
- type-safety
@@ -14,6 +14,7 @@ dependencies:
- TASK-94
- TASK-71
priority: high
ordinal: 87000
---
## Description

View File

@@ -0,0 +1,60 @@
---
id: TASK-98
title: Add mpv OSD hovered-token highlighting from Electron token state
status: Done
assignee: []
created_date: '2026-02-21 23:16'
updated_date: '2026-02-22 07:49'
labels:
- mpv
- subtitles
- electron
- ux
dependencies: []
priority: high
ordinal: 81000
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Implement hovered-token highlighting in mpv subtitle OSD by reusing token/hover state that already exists in Electron overlays. When pointer hovers a token in overlay, propagate hovered token identity to mpv subtitle rendering path so the corresponding mpv subtitle token is color-highlighted consistently.
<!-- SECTION:DESCRIPTION:END -->
## Suggestions
<!-- SECTION:SUGGESTIONS:BEGIN -->
- Extend Electron->main IPC hover payload to include stable token index/id usable by mpv renderer.
- Keep mpv highlight style configurable through existing subtitle style settings where possible.
- Reset mpv highlight state on subtitle changes and hover leave events.
<!-- SECTION:SUGGESTIONS:END -->
## Action Steps
<!-- SECTION:PLAN:BEGIN -->
1. Identify current overlay hover event source and token identity payload shape.
2. Extend main runtime message path to carry hovered token to mpv OSD renderer service.
3. Update mpv subtitle ASS rendering to apply hover color override to matching token span.
4. Add regression tests for hover enter/move/leave and subtitle replacement edge cases.
5. Verify behavior in plugin flow (`--texthooker` -> `--start`) and normal overlay mode.
<!-- SECTION:PLAN:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Hovering a token in Electron overlay highlights corresponding token in mpv subtitle OSD.
- [x] #2 Hover leave (or subtitle switch) clears mpv hovered-token highlight reliably.
- [x] #3 No regressions in existing token color annotations (known/N+1/frequency/JLPT).
- [x] #4 Automated tests cover hover payload propagation + mpv rendering highlight behavior.
<!-- AC:END -->
## Final Summary
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Implemented invisible-overlay-only hovered token highlighting in mpv using a dedicated `osd-overlay` ASS layer. Renderer now tags token spans with stable token indices and reports hover index changes (`subtitle-token-hover:set`) through preload IPC. Main caches latest tokenized subtitle payload, tracks hovered token index, and pushes/clears ASS highlight overlay via new runtime helper `src/main/runtime/mpv-hover-highlight.ts`. Added regression tests for ASS/command generation and IPC dependency wiring. Validation: `bun run build`, `node --test dist/main/runtime/mpv-hover-highlight.test.js dist/core/services/ipc.test.js`, `node --test dist/renderer/subtitle-render.test.js`.
<!-- SECTION:FINAL_SUMMARY:END -->
## Definition of Done
<!-- DOD:BEGIN -->
- [x] #1 Relevant unit/integration tests pass
- [x] #2 Docs/config notes updated for any new setting or payload contract
<!-- DOD:END -->

View File

@@ -1,109 +0,0 @@
---
id: TASK-98
title: Shift core tests to source level and trim dist coupling
status: Done
assignee:
- opencode
created_date: '2026-02-21 07:15'
updated_date: '2026-02-22 02:35'
labels:
- testing
- maintainability
- developer-experience
dependencies:
- TASK-95
priority: medium
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Core test flow is heavily coupled to `dist/` artifacts, increasing cycle time and reducing test clarity. Move the majority of tests to source-level execution while retaining minimal dist smoke coverage.
<!-- SECTION:DESCRIPTION:END -->
## Action Steps
<!-- SECTION:PLAN:BEGIN -->
1. Catalog current test commands and classify tests: source-level candidates vs required dist smoke tests.
2. Introduce/standardize source-level test runners for core suites.
3. Migrate high-volume `dist/core/services/*` tests to source-level equivalents.
4. Keep a small dist smoke suite for packaging/runtime sanity only.
5. Update `package.json` scripts and CI workflow steps to use new split.
6. Capture timing comparison (before/after) for local and CI runs.
7. Run verification gate for both lanes: source-level tests + dist smoke tests.
<!-- SECTION:PLAN:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Majority of core regression tests run from source-level entrypoints.
- [x] #2 Dist suite reduced to explicit smoke scope with documented purpose.
- [x] #3 CI still validates packaged/runtime assumptions via smoke lane.
- [x] #4 Total default test cycle time improves measurably.
<!-- AC:END -->
## Implementation Plan
<!-- SECTION:PLAN:BEGIN -->
1) Baseline current dist-coupled matrix and capture `time bun run test:fast` before timing.
2) Update `package.json` scripts so default regression lanes (`test:config`, `test:core`, `test:fast`) run source-level tests (`bun test src/...`) instead of `dist` artifacts.
3) Introduce explicit `test:smoke:dist` command for minimal compiled/runtime smoke checks; keep launcher smoke behavior intact.
4) Update `.github/workflows/ci.yml` and `.github/workflows/release.yml` to run source lane as primary + dist smoke lane as secondary.
5) Document command matrix in `docs/development.md`, rerun timing commands, capture before/after delta in task notes, then finalize AC/DoD.
Detailed execution plan: `docs/plans/2026-02-21-task-98-source-tests-dist-smoke-split.md`
<!-- SECTION:PLAN:END -->
## Implementation Notes
<!-- SECTION:NOTES:BEGIN -->
Execution updates (2026-02-21):
- Default regression lane moved to source entrypoints in `package.json`:
- `test:config` -> `test:config:src` (`bun test src/config/config.test.ts src/config/path-resolution.test.ts`)
- `test:core` -> `test:core:src` (`bun test` over curated core list)
- `test:fast` -> source config + source core
- Dist coupling trimmed to explicit smoke lane:
- `test:smoke:dist` -> `test:config:smoke:dist` + `test:core:smoke:dist`
- Smoke scope validates compiled/runtime assumptions across config, IPC/electron interop (`overlay-manager`, `anilist-token-store`), startup, renderer, main URL guard, and x11 tracker.
- CI/release wiring updated:
- `.github/workflows/ci.yml`: `test:fast` (source) before build; `test:smoke:dist` after build.
- `.github/workflows/release.yml` quality-gate: source tests, build, dist smoke.
- Docs updated in `docs/development.md` with source-vs-dist command matrix and smoke rationale.
- Timing evidence (repro commands):
- Before: `time bun run test:fast` (dist-coupled) => `1.438 total`
- After: `time bun run test:fast` (source lane) => `1.017 total`
- Delta: ~`0.421s` faster (~29.3% reduction).
- Dist smoke timing: `time bun run test:smoke:dist` => `0.206 total`.
- Verification:
- PASS: `bun run test:config:src && bun run test:core:src`
- PASS: `bun run test:smoke:dist`
- BLOCKED (pre-existing unrelated workspace errors): `bun run build` currently fails in `src/main.ts` and `src/main/runtime/composers/mpv-runtime-composer.test.ts` from in-flight TASK-96/97 changes present in working tree; not introduced by TASK-98 edits.
2026-02-22 closure verification (current HEAD):
- PASS: `bun run test:fast` (source lane)
- PASS: `bun run build`
- PASS: `bun run test:smoke:dist` (post-build dist smoke lane)
- Timing repro (current HEAD):
- `/usr/bin/time -p bun run test:fast` => `real 2.18`
- `/usr/bin/time -p bun run test:smoke:dist` => `real 0.21`
- Policy re-check: `package.json` keeps source defaults (`test:config`, `test:core`, `test:fast`) and explicit dist smoke (`test:smoke:dist`); CI/release still run source tests before build and dist smoke after build.
<!-- SECTION:NOTES:END -->
## Final Summary
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Closed TASK-98 by validating the source-first/dist-smoke test split on current HEAD. Verified `test:fast`, `build`, and `test:smoke:dist` all pass; confirmed CI/release order remains source tests before build and dist smoke after build; captured reproducible timing evidence for the active lanes.
<!-- SECTION:FINAL_SUMMARY:END -->
## Definition of Done
<!-- DOD:BEGIN -->
- [x] #1 Test command matrix documented in task notes.
- [x] #2 CI config updated and passing with new source/dist split.
- [x] #3 Performance delta captured with reproducible timing commands.
<!-- DOD:END -->

View File

@@ -4,7 +4,7 @@ title: Expand maintainability guardrails and runtime cycle checks
status: Done
assignee: []
created_date: '2026-02-21 07:15'
updated_date: '2026-02-22 03:02'
updated_date: '2026-02-22 07:49'
labels:
- quality
- architecture
@@ -13,6 +13,7 @@ dependencies:
- TASK-96
- TASK-97
priority: medium
ordinal: 71000
---
## Description