mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-28 06:22:45 -08:00
chore(workflow): add backlog/plan artifacts and docs workflow
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
---
|
||||
id: TASK-1
|
||||
title: Refactor runtime services per plan.md
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-10 18:46'
|
||||
updated_date: '2026-02-10 19:50'
|
||||
labels: []
|
||||
dependencies: []
|
||||
references:
|
||||
- plan.md
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Execute the SubMiner refactoring initiative documented in plan.md to reduce thin abstractions, consolidate service boundaries, fix known quality issues, and increase test coverage while preserving current behavior.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Phase-based execution tasks are created and linked under this initiative.
|
||||
- [x] #2 Each phase task includes clear, testable outcomes aligned with plan.md.
|
||||
- [x] #3 Implementation proceeds with build/test verification checkpoints after each completed phase.
|
||||
- [x] #4 Main behavior remains stable for startup, overlay, IPC, CLI, and tokenizer flows throughout refactor.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Created initiative subtasks TASK-1.1 through TASK-1.6 with phase-aligned acceptance criteria and sequential dependencies.
|
||||
|
||||
Completed TASK-1.1 (Phase 1 thin-wrapper removal) with green build/core tests.
|
||||
|
||||
Completed TASK-1.2 (Phase 2 DI adapter consolidation) with successful build and core test verification checkpoint.
|
||||
|
||||
Completed TASK-1.5 (critical behavior tests) with expanded tokenizer/mpv/subsync/CLI coverage and green core test suite.
|
||||
|
||||
Completed TASK-1.6 with documented no-go decision for optional domain-directory reorganization (kept current structure; tests remain green).
|
||||
|
||||
TASK-1.4 remains the only open phase, blocked on interactive desktop smoke checks that cannot be fully validated in this headless environment.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Completed the plan.md refactor initiative across Phases 1-5 and optional Phase 6 decisioning: removed thin wrappers, consolidated DI adapters and related services, fixed targeted runtime correctness issues, expanded critical behavior test coverage, and kept build/core tests green throughout. Final runtime smoke checks (start/toggle/trigger-field-grouping/stop) passed in this headless environment, with known limitation that visual overlay rendering itself was not directly inspectable.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,52 @@
|
||||
---
|
||||
id: TASK-1.1
|
||||
title: 'Phase 1: Remove thin wrapper runtime services'
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-02-10 18:46'
|
||||
updated_date: '2026-02-10 18:56'
|
||||
labels: []
|
||||
dependencies: []
|
||||
references:
|
||||
- plan.md
|
||||
- src/main.ts
|
||||
- src/core/services/index.ts
|
||||
parent_task_id: TASK-1
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Inline trivial wrapper services into their call sites and delete redundant service/test files listed in Phase 1 of plan.md.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Wrapper logic from the Phase 1 file list is inlined at call sites without behavior changes.
|
||||
- [x] #2 Phase 1 wrapper service files and corresponding trivial tests are removed from the codebase.
|
||||
- [x] #3 `src/core/services/index.ts` exports are updated to remove deleted modules.
|
||||
- [x] #4 `pnpm run build && pnpm run test:core` passes after Phase 1 completion.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Locate all Phase 1 wrapper service call sites and classify direct-inline substitutions vs orchestration-flow inlines.
|
||||
2. Remove the lowest-risk wrappers first (`config-warning-runtime-service`, `app-logging-runtime-service`, `runtime-options-manager-runtime-service`, `overlay-modal-restore-service`, `overlay-send-service`) and update imports/exports.
|
||||
3. Continue with startup and shutdown wrappers (`startup-resource-runtime-service`, `config-generation-runtime-service`, `app-shutdown-runtime-service`, `shortcut-ui-deps-runtime-service`) by inlining behavior into `main.ts` or direct callers.
|
||||
4. Delete corresponding trivial test files for removed wrappers and clean `src/core/services/index.ts` exports.
|
||||
5. Run `pnpm run build && pnpm run test:core`; fix regressions and update task notes/acceptance criteria incrementally.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Inlined wrapper behaviors into direct call sites in `main.ts` and `overlay-bridge-runtime-service.ts` for config warning/app logging, runtime options manager construction, generate-config bootstrap path, startup resource initialization, app shutdown sequence, overlay modal restore handling, overlay send behavior, and overlay shortcut local fallback invocation.
|
||||
|
||||
Deleted 16 Phase 1 files (9 wrapper services + 7 wrapper tests) and removed corresponding barrel exports from `src/core/services/index.ts`.
|
||||
|
||||
Updated `package.json` `test:core` list to remove deleted test entries so the script tracks current sources accurately.
|
||||
|
||||
Verification: `pnpm run build && pnpm run test:core` passes after refactor.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -0,0 +1,55 @@
|
||||
---
|
||||
id: TASK-1.2
|
||||
title: 'Phase 2: Merge DI adapter runtime services into target services'
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-02-10 18:46'
|
||||
updated_date: '2026-02-10 19:00'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-1.1
|
||||
references:
|
||||
- plan.md
|
||||
- src/core/services/cli-command-service.ts
|
||||
- src/core/services/ipc-service.ts
|
||||
- src/core/services/tokenizer-service.ts
|
||||
- src/core/services/app-lifecycle-deps-runtime-service.ts
|
||||
parent_task_id: TASK-1
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Absorb dependency adapter runtime services into core service modules and remove adapter files/tests while preserving runtime behavior.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 CLI, IPC, tokenizer, and app lifecycle adapter logic is merged into their target service modules.
|
||||
- [x] #2 Adapter service and adapter test files listed in Phase 2 are removed.
|
||||
- [x] #3 Callers pass dependency shapes expected by updated services without redundant mapping layers.
|
||||
- [x] #4 `pnpm run build && pnpm run test:core` passes after Phase 2 completion.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Audit `cli-command-deps-runtime-service.ts`, `ipc-deps-runtime-service.ts`, `tokenizer-deps-runtime-service.ts`, and `app-lifecycle-deps-runtime-service.ts` usage sites in `main.ts` and corresponding services.
|
||||
2. For each adapter, move null-guarding and shape-normalization logic into its target service (`cli-command-service.ts`, `ipc-service.ts`, `tokenizer-service.ts`, `app-lifecycle-service.ts`) and simplify caller dependency objects.
|
||||
3. Remove adapter service files/tests and update `src/core/services/index.ts` exports/import sites.
|
||||
4. Run `pnpm run build && pnpm run test:core` and fix any typing/regression issues from the interface consolidation.
|
||||
5. Update task notes with dependency-shape decisions to preserve handoff clarity.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Merged adapter-constructor logic into target services: `createCliCommandDepsRuntimeService` moved into `cli-command-service.ts`, `createIpcDepsRuntimeService` moved into `ipc-service.ts`, `createTokenizerDepsRuntimeService` moved into `tokenizer-service.ts`, and `createAppLifecycleDepsRuntimeService` moved into `app-lifecycle-service.ts`.
|
||||
|
||||
Deleted adapter service files and tests for cli-command deps, ipc deps, tokenizer deps, and app lifecycle deps.
|
||||
|
||||
Updated `src/core/services/index.ts` exports and `package.json` `test:core` entries to remove deleted adapter test modules.
|
||||
|
||||
Verification: `pnpm run build && pnpm run test:core` passes after consolidation.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -0,0 +1,61 @@
|
||||
---
|
||||
id: TASK-1.3
|
||||
title: 'Phase 3: Consolidate related service modules'
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-02-10 18:46'
|
||||
updated_date: '2026-02-10 19:17'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-1.2
|
||||
references:
|
||||
- plan.md
|
||||
- src/core/services/overlay-visibility-service.ts
|
||||
- src/core/services/overlay-manager-service.ts
|
||||
- src/core/services/overlay-shortcut-service.ts
|
||||
- src/core/services/numeric-shortcut-session-service.ts
|
||||
- src/core/services/app-ready-runtime-service.ts
|
||||
parent_task_id: TASK-1
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Merge split modules for overlay visibility, broadcast, shortcuts, numeric shortcuts, and startup orchestration into cohesive service files.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Overlay visibility/runtime split is consolidated into a single service module.
|
||||
- [x] #2 Overlay broadcast functions are merged with overlay manager responsibilities.
|
||||
- [x] #3 Shortcut and numeric shortcut runtime/lifecycle splits are consolidated as described in plan.md.
|
||||
- [x] #4 Startup bootstrap and app-ready runtime orchestration is consolidated into one startup module.
|
||||
- [x] #5 `pnpm run build && pnpm run test:core` passes after Phase 3 completion.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Merge `overlay-visibility-runtime-service.ts` exports into `overlay-visibility-service.ts` and update imports/exports.
|
||||
2. Merge overlay broadcast responsibilities from `overlay-broadcast-runtime-service.ts` into `overlay-manager-service.ts` while preserving current APIs used by `main.ts`.
|
||||
3. Consolidate shortcut modules by absorbing lifecycle utilities into `overlay-shortcut-service.ts` and fallback-runner logic into `overlay-shortcut-runtime-service.ts` (or successor handler module), then remove obsolete files.
|
||||
4. Merge numeric shortcut runtime/session split into a single `numeric-shortcut-service.ts` and update call sites/tests.
|
||||
5. Merge startup bootstrap + app-ready orchestration into a single startup module, update imports, remove obsolete files, and run `pnpm run build && pnpm run test:core`.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Merged overlay visibility runtime API into `overlay-visibility-service.ts` and removed `overlay-visibility-runtime-service.ts`.
|
||||
|
||||
Merged overlay broadcast behavior into `overlay-manager-service.ts` (including manager-level broadcasting) and removed `overlay-broadcast-runtime-service.ts` + test, with equivalent coverage moved into `overlay-manager-service.test.ts`.
|
||||
|
||||
Consolidated shortcut modules into `overlay-shortcut-service.ts` (lifecycle) and new `overlay-shortcut-handler.ts` (runtime handlers + local fallback), removing `overlay-shortcut-lifecycle-service.ts`, `overlay-shortcut-runtime-service.ts`, and `overlay-shortcut-fallback-runner.ts`.
|
||||
|
||||
Merged numeric shortcut runtime/session split into `numeric-shortcut-service.ts`; removed `numeric-shortcut-runtime-service.ts` and merged runtime test coverage into session tests.
|
||||
|
||||
Merged startup bootstrap + app-ready orchestration into `startup-service.ts`; removed `startup-bootstrap-runtime-service.ts` and `app-ready-runtime-service.ts` with tests updated to new module path.
|
||||
|
||||
Verification: `pnpm run build && pnpm run test:core` passes after consolidation.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -0,0 +1,88 @@
|
||||
---
|
||||
id: TASK-1.4
|
||||
title: 'Phase 4: Fix runtime bugs and naming/code-quality issues'
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-02-10 18:46'
|
||||
updated_date: '2026-02-10 19:50'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-1.3
|
||||
references:
|
||||
- plan.md
|
||||
- src/main.ts
|
||||
- src/core/services/overlay-visibility-service.ts
|
||||
- src/core/services/tokenizer-deps-runtime-service.ts
|
||||
parent_task_id: TASK-1
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Address identified correctness and code-quality issues from plan.md, including race conditions, unsafe typing, callback rejection handling, and runtime naming cleanup.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Debug `console.log`/`console.warn` usage in overlay visibility logic is removed or replaced with structured logging where needed.
|
||||
- [x] #2 Tokenizer type mismatch is fixed without unsafe `as never` casting.
|
||||
- [x] #3 Field grouping resolver handling is made concurrency-safe against overlapping requests.
|
||||
- [x] #4 Async callback wiring in CLI/IPC paths has explicit rejection handling.
|
||||
- [x] #5 Remaining `-runtime-service` naming cleanup is completed without logic regressions.
|
||||
- [x] #6 `pnpm run build && pnpm run test:core` passes and manual startup/overlay smoke checks succeed.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Remove or replace debug `console.log`/`console.warn` usage in `overlay-visibility-service.ts` while preserving useful operational logging semantics.
|
||||
2. Confirm and fix unsafe tokenizer casting paths (already partially addressed during Phase 2) and ensure no remaining `as never` escape hatches in tokenizer dependency flows.
|
||||
3. Make field grouping resolver handling in `main.ts` concurrency-safe by adding request sequencing and stale-resolution guards.
|
||||
4. Audit async callback wiring in CLI/IPC integrations and add explicit rejection handling where promises are fire-and-forget.
|
||||
5. Execute `pnpm run build && pnpm run test:core` and document manual smoke-test steps/outcomes.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Removed debug overlay-visibility `console.log`/`console.warn` statements from `overlay-visibility-service.ts`.
|
||||
|
||||
Eliminated unsafe tokenizer cast path during prior consolidation (`createTokenizerDepsRuntimeService` now uses typed `Token[]` and `mergeTokens(rawTokens)` without `as never`).
|
||||
|
||||
Added field-grouping overlap protection: `createFieldGroupingCallbackService` now cancels immediately when another resolver is active and only clears resolver state if the current resolver matches, preventing stale timeout/request cleanup from clobbering a newer resolver.
|
||||
|
||||
Added explicit rejection handling for async callback pathways: `shell.openExternal` now has `.catch(...)`; app lifecycle `whenReady` path now catches handler rejection; second-instance CLI dispatch is wrapped in try/catch logging.
|
||||
|
||||
Verification: `pnpm run build && pnpm run test:core` passes after these fixes.
|
||||
|
||||
Remaining in TASK-1.4: criterion #5 (`-runtime-service` naming cleanup batch) and criterion #6 manual smoke checks.
|
||||
|
||||
Completed `-runtime-service` naming cleanup for remaining modules by renaming files/tests and import paths, including: `overlay-bridge`, `field-grouping-overlay`, `mpv-control`, `runtime-options-ipc`, `mining`, `jimaku`, `anki-jimaku`, startup/app-ready test names, and subsync wrapper (`subsync-runner-service.ts`).
|
||||
|
||||
Resolved rename collision with existing `subsync-service.ts` by restoring original core subsync service from `HEAD` and moving runtime wrapper logic into `subsync-runner-service.ts`.
|
||||
|
||||
Verification after rename cleanup: `pnpm run build && pnpm run test:core` passes with updated test paths in `package.json`.
|
||||
|
||||
Manual smoke checks are still pending for criterion #6.
|
||||
|
||||
Smoke run attempt 1 (outside sandbox): `timeout 20s pnpm run start` started successfully, loaded config, initialized websocket/Mecab, and entered normal MPV reconnect loop when `/tmp/subminer-socket` was absent; no immediate startup crash after previous refactors.
|
||||
|
||||
Smoke run attempt 2 (outside sandbox): `timeout 20s pnpm exec electron . --start --auto-start-overlay` showed the same stable startup/reconnect behavior, but overlay activation could not be verified in this headless/non-interactive environment.
|
||||
|
||||
Manual GUI interactions (overlay render/toggle, mine card flow, field-grouping interaction) remain pending for a real desktop session with MPV running.
|
||||
|
||||
Automated interactive-smoke surrogate 1 (outside sandbox): started app, sent `--toggle`, then `--stop`; instance remained stable and cleanly stopped without crash.
|
||||
|
||||
Automated interactive-smoke surrogate 2 (outside sandbox): started app, sent `--trigger-field-grouping`, then `--stop`; command path executed without runtime crash and app shut down cleanly.
|
||||
|
||||
Observed expected reconnect behavior when MPV socket was absent (`ENOENT /tmp/subminer-socket`), with no regressions in startup/bootstrap flow.
|
||||
|
||||
Note: this environment is headless, so visual overlay rendering cannot be directly confirmed; command-path and process-lifecycle smoke checks passed.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Completed Phase 4 by removing debug logging noise, fixing unsafe typing and concurrency risks, adding async rejection handling, completing naming cleanup, and validating startup/command-path behavior through repeated build/test and live Electron smoke runs.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,74 @@
|
||||
---
|
||||
id: TASK-1.5
|
||||
title: 'Phase 5: Add critical behavior tests for untested services'
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-02-10 18:46'
|
||||
updated_date: '2026-02-10 19:36'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-1.4
|
||||
references:
|
||||
- plan.md
|
||||
- src/core/services/mpv-runtime-service.ts
|
||||
- src/core/services/subsync-runtime-service.ts
|
||||
- src/core/services/tokenizer-service.ts
|
||||
- src/core/services/cli-command-service.ts
|
||||
parent_task_id: TASK-1
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Add meaningful behavior tests for high-risk services called out in plan.md: mpv, subsync, tokenizer, and expanded CLI command coverage.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 `mpv` service has focused tests for protocol parsing, event dispatch, request/response matching, reconnection, and subtitle extraction behavior.
|
||||
- [x] #2 `subsync` service has focused tests for engine path resolution, command construction, timeout/error handling, and result parsing.
|
||||
- [x] #3 `tokenizer` service has focused tests for parser readiness, token extraction, fallback behavior, and edge-case inputs.
|
||||
- [x] #4 CLI command service tests cover all dispatch paths, async error propagation, and second-instance forwarding behavior.
|
||||
- [x] #5 `pnpm run test:core` passes with all new tests green.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Add focused tests for `tokenizer-service.ts` behavior (normalization, Yomitan-unavailable fallback, mecab fallback success/error paths, empty input handling).
|
||||
2. Add focused tests for `subsync-service.ts` command/engine selection and failure handling using mocked command utilities where feasible.
|
||||
3. Add focused tests for `mpv-service.ts` protocol handling (line parsing, request-response routing, property-change dispatch) with lightweight socket stubs.
|
||||
4. Expand `cli-command-service.ts` tests for dispatch/error/second-instance forwarding edge paths not currently covered.
|
||||
5. Run `pnpm run test:core` iteratively and update acceptance criteria as each service reaches meaningful coverage.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Added new tokenizer behavior tests in `src/core/services/tokenizer-service.test.ts` covering empty normalized input, newline normalization, mecab fallback success, and mecab error fallback-to-null.
|
||||
|
||||
Added new mpv protocol tests in `src/core/services/mpv-service.test.ts` covering JSON line-buffer parsing, property-change subtitle dispatch behavior, and request/response resolution by `request_id`.
|
||||
|
||||
Added new subsync workflow tests in `src/core/services/subsync-service.test.ts` covering already-running guard, manual-mode picker flow, and error propagation to OSD when MPV is unavailable.
|
||||
|
||||
Expanded `src/core/services/cli-command-service.test.ts` to cover socket/start dispatch, texthooker port override warning path, help-without-window shutdown, and async trigger-subsync error reporting.
|
||||
|
||||
Updated `package.json` `test:core` to include new/renamed test files; verification remains green with `pnpm run test:core` (17 tests total).
|
||||
|
||||
Expanded `mpv-service` tests with request rejection when disconnected, `requestProperty` error propagation, and pending-request disconnect resolution behavior.
|
||||
|
||||
Expanded `subsync-service` tests with manual alass source-track validation and auto-mode executable-path failure handling while ensuring in-progress state cleanup.
|
||||
|
||||
All updated tests remain green via `pnpm run test:core` after these additions.
|
||||
|
||||
Added Yomitan parser token-extraction coverage in `tokenizer-service.test.ts` (parser-available success path) in addition to fallback/edge-case tests.
|
||||
|
||||
Added MPV reconnection/request robustness tests (`scheduleReconnect`, disconnected request rejection, pending request disconnect resolution) to complement protocol/event/request-id tests in `mpv-service.test.ts`.
|
||||
|
||||
Added subsync command-construction tests using executable stubs for both engines (`ffsubsync` and `alass`) and validated success/failure result behavior; added timeout behavior coverage in `src/subsync/utils.test.ts` for child-process timeout handling used by subsync.
|
||||
|
||||
Expanded CLI dispatch tests with broad branch coverage for visibility/settings/copy/multi-copy/mining/open-runtime-options/stop/help/second-instance behaviors and async error propagation.
|
||||
|
||||
Verification: `pnpm run test:core` passes with 18 green tests including newly added `dist/subsync/utils.test.js`.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -0,0 +1,45 @@
|
||||
---
|
||||
id: TASK-1.6
|
||||
title: 'Phase 6 (Optional): Reorganize services by domain directories'
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-10 18:46'
|
||||
updated_date: '2026-02-10 19:41'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-1.5
|
||||
references:
|
||||
- plan.md
|
||||
parent_task_id: TASK-1
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
If service flattening remains hard to navigate after Phases 1-5, optionally move modules into domain-based folders and update imports.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 A clear go/no-go decision for domain restructuring is documented based on post-phase-5 codebase state.
|
||||
- [ ] #2 If executed, service modules are reorganized into domain folders with no import or runtime breakage.
|
||||
- [x] #3 Build and core test commands pass after any directory reorganization.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Assess post-phase-5 directory complexity and determine whether domain reorganization is still justified.
|
||||
2. If complexity remains acceptable, record a no-go decision and keep current structure stable.
|
||||
3. If complexity is still problematic, perform import-safe domain reorganization and re-run build/tests.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Decision: no-go on Phase 6 directory reorganization for now. After Phases 1-5, service/module consolidation and test expansion have improved maintainability without introducing a high-risk import churn.
|
||||
|
||||
Rationale: preserving path stability now reduces regression risk while Phase 4 smoke validation remains open and large refactor commits are still stabilizing.
|
||||
|
||||
Verification baseline remains green (`pnpm run test:core`) with current structure.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
Reference in New Issue
Block a user