Files
SubMiner/backlog/tasks/task-61 - Ensure-parser-utility-scripts-exit-immediately-after-output.md
kyasuda 457e6f0f10 feat(tokenizer): refine Yomitan grouping and parser tooling
- map segmented Yomitan lines into single logical tokens and improve candidate selection heuristics

- limit frequency lookup to selected token text with POS-based exclusions and add debug logging hook

- add standalone Yomitan parser test script, deterministic utility-script shutdown, and docs/backlog updates
2026-02-16 17:41:24 -08:00

30 lines
1.3 KiB
Markdown

---
id: TASK-61
title: Ensure parser utility scripts exit immediately after output
status: Done
assignee: []
created_date: '2026-02-16 22:35'
updated_date: '2026-02-16 22:37'
labels: []
dependencies: []
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Update `scripts/test-yomitan-parser.ts` and `scripts/get_frequency.ts` so they clean up Electron parser resources and terminate immediately after producing results, avoiding hangs.
<!-- SECTION:DESCRIPTION:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 `scripts/test-yomitan-parser.ts` exits promptly after printing output.
- [x] #2 `scripts/get_frequency.ts` exits promptly after printing output.
- [x] #3 Electron-related resources (parser window/app loop) are cleaned up on both success and error paths.
<!-- AC:END -->
## Final Summary
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Added deterministic shutdown to both utility scripts. `scripts/get_frequency.ts` now destroys parser windows in a `finally` block, calls `app.quit()` when Electron is loaded, and uses explicit `.then/.catch` exits so the process terminates immediately after output with correct exit codes. `scripts/test-yomitan-parser.ts` now mirrors this pattern with runtime cleanup (`shutdownYomitanRuntime`) and explicit process exit handling.
<!-- SECTION:FINAL_SUMMARY:END -->