voicestudio-maintainer の検証ログ
課題ごとに、依頼文と採点項目、項目ごとの点数、実行ごとの時間・トークン、Claude Code の全ログ、作られたファイルを載せています。配点を変えても計算し直せるよう、生データも置いています。
2026年11月29日 に実行(実行: claude-sonnet-5-5/採点: claude-opus-5-5)。数値は中央値です。課題は SKILL.md をもとに AI が作ったもので、スキルに有利な場面に偏ることがあります。
生データ(JSON)課題・実行ごとの測定値・採点・集計をそのまま置いています。
実行ごとの測定値
| 実行 | 結果 | 時間 | トークン | 費用 | ターン | スキル使用 | ログ |
|---|---|---|---|---|---|---|---|
| 課題 1 1 回目 スキルなし | 完了 | 141秒 | 124,316 | $0.067 | 8 | - | 全ログ |
| 課題 1 1 回目 スキルあり | 完了 | 15秒 | 111,970 | $0.058 | 8 | 使った | 全ログ |
| 課題 1 1 回目 スキルあり(名指しなし) | 完了 | 18秒 | 132,272 | $0.063 | 9 | 使った | 全ログ |
| 課題 1 2 回目 スキルあり | 完了 | 19秒 | 132,419 | $0.043 | 9 | 使った | 全ログ |
| 課題 1 2 回目 スキルなし | 完了 | 14秒 | 85,930 | $0.028 | 5 | - | 全ログ |
| 課題 1 2 回目 スキルあり(名指しなし) | 完了 | 140秒 | 155,084 | $0.051 | 11 | 使った | 全ログ |
| 課題 2 1 回目 スキルなし | 完了 | 17秒 | 53,501 | $0.051 | 5 | - | 全ログ |
| 課題 2 1 回目 スキルあり | 完了 | 16秒 | 95,359 | $0.063 | 6 | 使った | 全ログ |
| 課題 2 1 回目 スキルあり(名指しなし) | 完了 | 15秒 | 93,636 | $0.056 | 6 | 使った | 全ログ |
| 課題 2 2 回目 スキルあり | 完了 | 15秒 | 95,254 | $0.033 | 6 | 使った | 全ログ |
| 課題 2 2 回目 スキルなし | 完了 | 14秒 | 53,152 | $0.033 | 5 | - | 全ログ |
| 課題 2 2 回目 スキルあり(名指しなし) | 完了 | 17秒 | 94,200 | $0.039 | 6 | 使った | 全ログ |
「スキルあり(名指しなし)」は呼ばれやすさを測るための実行で、採点はしていません。
課題 1: CIが緑なのにテストが失敗する原因の診断と修正
依頼文
A user filed issue #88 (see docs/issue-88.md): submitting text that ends with a space makes the backend reject the job. The weird part is our CI has been green the whole time, and I'm pretty sure someone already added a test for this. Please figure out why CI didn't catch it, fix the actual bug, and make sure CI will catch this kind of failure from now on. This is a bug fix only, so don't do any release work. When you're done, tell me what was wrong and how you verified the fix.採点基準
- The final message correctly explains that CI stayed green because the test command is piped into `tee` without pipefail, so the step's exit status comes from `tee` and not from the failing tests.
- The CI workflow is changed so that a failing test fails the job (for example by adding `set -o pipefail`, setting `shell: bash`, or removing the pipe), and the log artifact upload still works.
- The root cause in the sentence splitting or job preparation is fixed, so `prepare_job("Hello world. ")` returns segments `["Hello world."]` and no empty segments come from leading or trailing whitespace.
- Running `python -m unittest discover -s backend/tests -t .` from the repo root passes, and the final message says the tests were actually run, with results.
- The version number in package.json and backend/core/version.py is unchanged, and no tag, changelog release entry, or other release step was added.
項目ごとの点数(1 = 満たした・0.5 = 一部・0 = 満たさない)
| # | 1 回目 スキルなし / スキルあり | 2 回目 スキルなし / スキルあり |
|---|---|---|
| 1 | 1 / 1 | 1 / 1 |
| 2 | 1 / 1 | 1 / 1 |
| 3 | 1 / 1 | 1 / 1 |
| 4 | 1 / 1 | 1 / 1 |
| 5 | 1 / 1 | 1 / 1 |
初期ファイル(11)
docs/issue-88.md
# Issue #88: "empty segment" error when text ends with whitespace Reported by @mira-k Steps: 1. Paste `Hello world. ` (note the trailing space) into the text box. 2. Click Generate. Expected: audio is generated. Actual: backend returns `ValueError: empty segment at index 1`. Version: 0.6.1
.github/workflows/ci.yml
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
backend-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Run backend tests
run: |
python -m unittest discover -s backend/tests -t . -v 2>&1 | tee test-output.txt
- name: Upload test log
if: always()
uses: actions/upload-artifact@v4
with:
name: test-output
path: test-output.txt
package.json
{
"name": "voicestudio",
"version": "0.6.1",
"private": true
}
backend/__init__.py
backend/core/__init__.py
backend/api/__init__.py
backend/tests/__init__.py
backend/core/version.py
__version__ = "0.6.1"
backend/core/chunking.py
import re
_SENTENCE_END = re.compile(r"(?<=[.!?])\s+")
def split_sentences(text: str) -> list[str]:
"""Split input text into sentence segments for synthesis."""
return _SENTENCE_END.split(text)
backend/api/tts.py
from backend.core.chunking import split_sentences
from backend.core.version import __version__
def prepare_job(text: str, voice: str = "default") -> dict:
"""Validate text and build a synthesis job description."""
if not text or not text.strip():
raise ValueError("text is empty")
segments = split_sentences(text)
for i, seg in enumerate(segments):
if not seg:
raise ValueError(f"empty segment at index {i}")
return {"voice": voice, "segments": segments, "version": __version__}
backend/tests/test_tts.py
import unittest
from backend.core.chunking import split_sentences
from backend.api.tts import prepare_job
class SplitTests(unittest.TestCase):
def test_basic_split(self):
self.assertEqual(split_sentences("Hi. There!"), ["Hi.", "There!"])
def test_empty_text_rejected(self):
with self.assertRaises(ValueError):
prepare_job(" ")
# Added for #88
def test_trailing_whitespace_job(self):
job = prepare_job("Hello world. ")
self.assertEqual(job["segments"], ["Hello world."])
if __name__ == "__main__":
unittest.main()
1 回目: 引き分け (達成率 100% / 100%)
両者ともCIとchunkingの修正が同一で、原因説明・検証報告・リリース作業なしも同等のため引き分け。
スキルなし100%
最終メッセージ
The trailing-space bug is fixed, and CI will now fail when tests fail. The test suite passes locally (4 tests). I haven't run the updated workflow on GitHub.
Why CI was green: someone did add the test, test_trailing_whitespace_job. It was failing the whole time with ValueError: empty segment at index 1. I confirmed this by running the suite on the original code, which exited 1. The CI step ran python -m unittest ... 2>&1 | tee test-output.txt. In a pipeline the step's exit status is the last command's, which is tee, and tee always succeeds. GitHub's default run shell doesn't enable pipefail, so the failure never reached the job result.
The bug: split_sentences split on whitespace that follows ., ! or ?. For "Hello world. " that produced ["Hello world.", ""]. prepare_job then rejected the empty segment.
Changes:
backend/core/chunking.py:split_sentencesnow strips the input and drops empty segments..github/workflows/ci.yml: the test step now usesshell: bashwithset -o pipefail. I kept theteeso the log artifact is still uploaded. I checked thatpipefailturns a failing pipeline into a non-zero exit.backend/tests/test_tts.py: I added a regression test thatsplit_sentencesignores leading and trailing whitespace. The existing #88 test stays as it was.
Verification: before the fix, the existing #88 test failed with the exact error from the issue. After the fix, all 4 tests pass.
I didn't touch the version or do any release work.
作った・変えたファイル
スキルあり100%
最終メッセージ
The trailing-space bug is fixed, and CI will now fail when tests fail. I only ran the tests locally. I haven't run the updated workflow on GitHub Actions.
Why CI was green: Someone did add a test for this, test_trailing_whitespace_job in backend/tests/test_tts.py. It has been failing the whole time. The CI step ran python -m unittest ... 2>&1 | tee test-output.txt. A pipe returns the exit status of its last command, which here is tee, and tee always succeeds. So the failing test never turned the job red.
The bug: split_sentences in backend/core/chunking.py split on whitespace that follows ., ! or ?. For "Hello world. " that left a trailing empty string, and prepare_job rejected it with empty segment at index 1.
Changes:
backend/core/chunking.py:split_sentencesnow strips the input and drops empty segments.prepare_job's empty-segment check stays as a safety net..github/workflows/ci.yml: The test step now runs underbashwithset -o pipefail, so a failing test fails the job. Theteelog upload still works.
How I verified:
- Before the fix, the test suite failed on
test_trailing_whitespace_jobwith the exact error from the issue. - After the fix, all 3 tests pass.
- With
pipefail, a failing command piped intoteenow returns non-zero, where it used to return 0.
I made no version bump or release changes. I also didn't comment on or close #88.
作った・変えたファイル
2 回目: 引き分け (達成率 100% / 100%)
両者ともpipefail原因の説明、CI修正、分割修正、テスト実行報告が同等で、実質的な差がない。
スキルなし100%
最終メッセージ
The bug is fixed and the test suite passes locally (4 tests, up from 3). I couldn't run the GitHub workflow itself here, so the CI change is checked only by reproducing the pipe behavior in a shell.
Why CI was green: someone did add a test for #88, test_trailing_whitespace_job, and it failed on the unfixed code with the exact empty segment at index 1 error. The workflow ran python -m unittest ... 2>&1 | tee test-output.txt. In a pipeline, the exit status is tee's, which is always 0, so the failing test never failed the step. I reproduced this locally: the unittest run exited 1, and the same command piped through tee exited 0.
The bug: split_sentences in backend/core/chunking.py split on whitespace that follows ., ! or ?. For "Hello world. " that produced ["Hello world.", ""]. prepare_job then rejected the empty trailing segment. The fix strips the input first and drops any empty segments.
CI fix: the test step in .github/workflows/ci.yml now sets shell: bash and runs set -o pipefail. A failing test now fails the step, and the log is still uploaded because that step has if: always().
Verification:
- I ran the existing #88 test before the fix and it failed with the exact error from the issue. It passes now.
- I added a test covering leading whitespace, repeated whitespace and a trailing newline.
- With
pipefailon, the piped test command returns the test runner's exit code instead oftee's.
I made no version or release changes.
作った・変えたファイル
スキルあり100%
最終メッセージ
What was wrong
- The bug:
split_sentencesinbackend/core/chunking.pysplit on whitespace after sentence punctuation. For"Hello world. "that gave["Hello world.", ""], andprepare_jobthen rejected the empty second segment ("empty segment at index 1"). - Why CI was green: You were right that a test already existed.
test_trailing_whitespace_jobwas added for #88, and it fails on the old code. The workflow ranpython -m unittest ... 2>&1 | tee test-output.txt. In a pipeline the step takestee's exit code, not unittest's, so the failure never reached the step. The test log was uploaded, but the job still passed.
What I changed (this is only a bug fix: no version bump or release work, and I didn't commit anything)
backend/core/chunking.py: The splitter now strips the input and drops empty segments..github/workflows/ci.yml: The test step now setsshell: bashandset -o pipefail, so a failing test fails the job. I kept thetee, so the log artifact still uploads.backend/tests/test_tts.py: I added a test for leading, trailing and newline whitespace.
How I verified
- Before the fix: The suite showed 1 error, the
ValueError: empty segment at index 1from the issue. - After the fix: All 4 tests pass locally with
python3 -m unittest discover -s backend/tests -t .. - The CI change: I only checked the pipefail behaviour in a local shell, where a failing command piped into
teenow returns exit code 1. I haven't run the workflow on GitHub, so the first PR run is the real check. Before merging, I'd confirm the job fails if you temporarily break a test.
Not checked: Python 3.11 (CI's version), because I only ran under the local python3. I also didn't comment on or close #88.
作った・変えたファイル
課題 2: コントリビューターのPR差分をマージ可否の観点でレビュー
依頼文
A contributor opened PR #57 adding an "Export to folder" button. I saved the diff at patches/pr-57.diff (it's against the current tree in this repo). Please review it against our CONTRIBUTING.md and the existing code, and tell me if it's ready to merge. If it isn't, list the blocking problems with file/line references and say concretely what the contributor needs to change. Also draft a short review comment I could post. Don't apply or merge anything, just review.採点基準
- The review says clearly that the PR is not ready to merge, and the files in the repo are unchanged (the diff was not applied and nothing was committed).
- It flags as blocking that the renderer imports Node modules (`fs`, `path`, `os`) and writes files directly, and says the work should move to main through an IPC handler exposed via the preload bridge.
- It flags the missing `toolbar.export` key in ja.json and de.json, and the hardcoded untranslated 'Exported!' alert string.
- It flags that the new test only checks source text for substrings and asks for a test of actual behavior.
- It flags the unrequested version bump from 0.6.1 to 0.7.0 in package.json and asks for it to be reverted.
- The drafted review comment is constructive, credits the contributor's work, and gives actionable requested changes without claiming anything was tested or verified when it wasn't.
項目ごとの点数(1 = 満たした・0.5 = 一部・0 = 満たさない)
| # | 1 回目 スキルなし / スキルあり | 2 回目 スキルなし / スキルあり |
|---|---|---|
| 1 | 1 / 1 | 1 / 1 |
| 2 | 1 / 1 | 1 / 1 |
| 3 | 1 / 1 | 1 / 1 |
| 4 | 1 / 1 | 1 / 1 |
| 5 | 1 / 1 | 1 / 1 |
| 6 | 1 / 1 | 1 / 1 |
初期ファイル(9)
CONTRIBUTING.md
# Contributing to VoiceStudio ## Architecture rules - `electron/src/main/` owns all filesystem and process access. - `electron/src/preload/` exposes a narrow bridge via `contextBridge`. - `electron/src/renderer/` is the React UI. It runs sandboxed with `nodeIntegration: false` and must never import Node modules such as `fs`, `path`, or `child_process`. Ask main through the preload bridge instead. ## Localization - Every user-visible string must use a translation key. - New keys must be added to **all** files in `electron/src/renderer/src/locales/`. ## Tests - New behavior needs a test of observable behavior. Tests that only read source files and check for substrings are not accepted. ## Versioning - Only maintainers change the version in `package.json`, `pyproject.toml`, and `backend/core/version.py`, as part of a release. Contributor PRs must not bump versions.
package.json
{
"name": "voicestudio",
"version": "0.6.1",
"private": true
}
electron/src/main/ipc.ts
import { ipcMain, dialog } from 'electron'
import { promises as fs } from 'fs'
import path from 'path'
export function registerIpc(): void {
ipcMain.handle('audio:save', async (_e, name: string, data: Uint8Array) => {
const { filePath } = await dialog.showSaveDialog({ defaultPath: name })
if (!filePath) return null
await fs.writeFile(filePath, data)
return path.basename(filePath)
})
}
electron/src/preload/index.ts
import { contextBridge, ipcRenderer } from 'electron'
contextBridge.exposeInMainWorld('voicestudio', {
saveAudio: (name: string, data: Uint8Array) => ipcRenderer.invoke('audio:save', name, data)
})
electron/src/renderer/src/components/Toolbar.tsx
import { useTranslation } from '../i18n'
export function Toolbar({ clip }: { clip: { name: string; data: Uint8Array } }) {
const { t } = useTranslation()
return (
<div className="toolbar">
<button onClick={() => window.voicestudio.saveAudio(clip.name, clip.data)}>
{t('toolbar.save')}
</button>
</div>
)
}
electron/src/renderer/src/locales/en.json
{
"toolbar.save": "Save"
}
electron/src/renderer/src/locales/ja.json
{
"toolbar.save": "保存"
}
electron/src/renderer/src/locales/de.json
{
"toolbar.save": "Speichern"
}
patches/pr-57.diff
From: Sam Ortiz <sam.ortiz@example.org>
Subject: [PATCH] Add Export to folder button
---
diff --git a/package.json b/package.json
--- a/package.json
+++ b/package.json
@@ -1,5 +1,5 @@
{
"name": "voicestudio",
- "version": "0.6.1",
+ "version": "0.7.0",
"private": true
}
diff --git a/electron/src/renderer/src/components/Toolbar.tsx b/electron/src/renderer/src/components/Toolbar.tsx
--- a/electron/src/renderer/src/components/Toolbar.tsx
+++ b/electron/src/renderer/src/components/Toolbar.tsx
@@ -1,12 +1,26 @@
import { useTranslation } from '../i18n'
+import fs from 'fs'
+import path from 'path'
+import os from 'os'
export function Toolbar({ clip }: { clip: { name: string; data: Uint8Array } }) {
const { t } = useTranslation()
+
+ const exportToFolder = () => {
+ const dir = path.join(os.homedir(), 'VoiceStudio Exports')
+ fs.mkdirSync(dir, { recursive: true })
+ fs.writeFileSync(path.join(dir, clip.name), clip.data)
+ alert('Exported!')
+ }
+
return (
<div className="toolbar">
<button onClick={() => window.voicestudio.saveAudio(clip.name, clip.data)}>
{t('toolbar.save')}
</button>
+ <button onClick={exportToFolder}>
+ {t('toolbar.export')}
+ </button>
</div>
)
}
diff --git a/electron/src/renderer/src/locales/en.json b/electron/src/renderer/src/locales/en.json
--- a/electron/src/renderer/src/locales/en.json
+++ b/electron/src/renderer/src/locales/en.json
@@ -1,3 +1,4 @@
{
- "toolbar.save": "Save"
+ "toolbar.save": "Save",
+ "toolbar.export": "Export to folder"
}
diff --git a/electron/tests/toolbar.test.ts b/electron/tests/toolbar.test.ts
new file mode 100644
--- /dev/null
+++ b/electron/tests/toolbar.test.ts
@@ -0,0 +1,9 @@
+import { readFileSync } from 'fs'
+import { test, expect } from 'bun:test'
+
+test('toolbar has export button', () => {
+ const src = readFileSync('electron/src/renderer/src/components/Toolbar.tsx', 'utf8')
+ expect(src).toContain('exportToFolder')
+ expect(src).toContain('toolbar.export')
+})
1 回目: 引き分け (達成率 100% / 100%)
両者とも4つの阻害要因を指摘し具体的修正案と建設的なコメント案を示しており、実質的な差はない。
スキルなし100%
最終メッセージ
Not ready to merge. It breaks four CONTRIBUTING.md rules, and the first problem would also fail at runtime. I read the diff against the current tree (Toolbar.tsx, ipc.ts, preload/index.ts, the three locale files, package.json). The diff applies cleanly to it. Line numbers below refer to patches/pr-57.diff.
Blocking problems
-
The renderer imports Node modules (
Toolbar.tsx, diff lines 20–22 and 27–32).- The patch adds
import fs from 'fs',pathandosto the renderer, then callsfs.mkdirSyncandfs.writeFileSyncinexportToFolder. - CONTRIBUTING.md (Architecture rules) forbids this. The renderer runs with
nodeIntegration: false, so these calls will fail or break the bundle. - Change needed:
- Add an
audio:exporthandler inelectron/src/main/ipc.ts, next toaudio:save. It should do the mkdir and write withfs.promises, and it can useapp.getPath(...)or adialog.showOpenDialogfolder picker. - Expose it in
electron/src/preload/index.tsas a narrow method, for exampleexportAudio(name, data). - Make the button call
window.voicestudio.exportAudio(...). Remove the three Node imports fromToolbar.tsx.
- Add an
- The patch adds
-
The main process never sanitizes
clip.name(diff line 30).path.join(dir, clip.name)accepts a name like../../something, so a write can land outside the export folder.- When you move the write into main, take
path.basename(name)or validate it there. Don't rely on the renderer.
-
A user-visible string has no translation key (diff line 31).
alert('Exported!')is hardcoded. CONTRIBUTING.md (Localization) requires a key for every user-visible string.- Use something like
t('toolbar.exported'), or better, show the result from the main-process call.
-
The new key is missing from two locale files (diff lines 45–53).
toolbar.exportis added only toen.json.de.jsonandja.jsonare not touched, and the rule says new keys go in all files.- Add
toolbar.exportto both, plus any key from item 3.
-
The test only checks source text (
electron/tests/toolbar.test.ts, diff lines 59–66).- It reads
Toolbar.tsxand asserts the file containsexportToFolderandtoolbar.export. CONTRIBUTING.md (Tests) says that kind of test is not accepted, and it checks nothing about behavior. - Change needed:
- Test the main-process handler directly. For example, with a temp directory, assert the file is written with the right bytes and that a traversal name like
../xends up inside the folder. - Or render
Toolbarwith a mockedwindow.voicestudioand assert that clicking the button callsexportAudiowith the clip.
- Test the main-process handler directly. For example, with a temp directory, assert the file is written with the right bytes and that a traversal name like
- It reads
-
The PR bumps the version (
package.json, diff lines 11–12).- It changes
0.6.1to0.7.0. Only maintainers change versions, as part of a release (CONTRIBUTING.md, Versioning). - Revert that hunk.
- It changes
Non-blocking
- The export folder is hardcoded to
~/VoiceStudio Exports. A folder picker would match what the button label suggests, and it's consistent with howaudio:saveuses a dialog. - There is no error handling. A failed write should be reported to the user, not swallowed.
Draft review comment
Thanks for the PR, Sam! The feature makes sense, but a few things need to change before we can merge:
- Architecture:
Toolbar.tsximportsfs/path/osin the renderer, which isn't allowed (see CONTRIBUTING → Architecture rules). Please move the file writing intoelectron/src/main/ipc.tsas a new handler, expose it throughelectron/src/preload/index.ts, and call it viawindow.voicestudio, likesaveAudio. Do the write in main withfs.promises, and usepath.basename(name)so a crafted clip name can't escape the export folder.- i18n:
alert('Exported!')needs a translation key, andtoolbar.export(plus any new key) must be added tode.jsonandja.json, not justen.json.- Tests:
toolbar.test.tsonly greps the source for strings, which we don't accept. Please test the behavior instead, either the main-side handler writing into a temp dir or the button calling the bridge with a mockedwindow.voicestudio.- Versioning: please drop the
package.jsonversion bump. Maintainers handle that at release time.Happy to re-review once those are updated!
I didn't apply or modify anything.
作った・変えたファイル
ファイルの変更はありません。
スキルあり100%
最終メッセージ
Not ready to merge. I reviewed patches/pr-57.diff against CONTRIBUTING.md and the current tree. It has four blocking problems. I didn't apply or merge anything.
Blocking problems
-
The renderer imports Node modules (
Toolbar.tsxdiff lines 20–22, used at 28–30).- The PR adds
import fs from 'fs',pathandosto a renderer component, then callsfs.mkdirSyncandfs.writeFileSyncthere. - CONTRIBUTING.md forbids this explicitly, because the renderer runs with
nodeIntegration: false. In the sandboxed renderer the import fails or the click does nothing. - Change needed:
- Add an IPC handler in
electron/src/main/ipc.ts, for exampleaudio:exportToFolder, that does the filesystem work, next to the existingaudio:save. - Expose it in
electron/src/preload/index.ts, for exampleexportAudio(name, data). - Make the button call
window.voicestudio.exportAudio(...).
- Add an IPC handler in
- The PR adds
-
The version is bumped (
package.jsondiff lines 11–12, 0.6.1 → 0.7.0).- Only maintainers change versions, as part of a release. Remove this hunk.
-
The locale files are incomplete (
locales/en.json, diff lines 48–53).toolbar.exportis added toen.jsononly.de.jsonandja.jsonare missing it, which breaks the rule that new keys go in all locale files.- The
alert('Exported!')string at diff line 31 is hardcoded, so it is not translated. - Change needed: add
toolbar.exporttode.jsonandja.json. Add a key for the success message, and show it throught()from the result of the IPC call.
-
The test only checks source text (
electron/tests/toolbar.test.ts, diff lines 59–65).- It reads
Toolbar.tsxand checks for the substringsexportToFolderandtoolbar.export. CONTRIBUTING.md says tests like this are not accepted. - Change needed: test the behavior. For example, unit-test the main-process export handler against a temp directory and check the file is written with the right bytes. Or render the button with a mocked
window.voicestudioand check that clicking it callsexportAudiowith the clip.
- It reads
Other problems to fix in the same pass
- Path traversal.
path.join(dir, clip.name)uses an unsanitized name. A name like../../xwrites outside the export folder. The main-process handler should usepath.basename(name)and check that the resolved path stays inside the export folder. - Silent overwrites. Files with the same name overwrite each other. Add a unique-name suffix or confirm before overwriting.
- Hardcoded folder.
~/VoiceStudio Exportsis hardcoded, and the name isn't localized. Consider asking the user for the folder throughdialog.showOpenDialogwithopenDirectory, or remember their choice. - Error handling. There is none. A failed write currently looks the same as success.
- Overlap with Save. The existing Save button already writes through
audio:save. Say how the new button differs, or reuse the same handler.
Draft review comment
Thanks for the PR, Sam. A one-click export to a folder is a useful addition. Before we can merge it, a few things need to change:
- Move the file I/O to the main process.
Toolbar.tsximportsfs,pathandos, but the renderer is sandboxed and must not use Node modules (see CONTRIBUTING.md). Please add an IPC handler inelectron/src/main/ipc.ts(likeaudio:save) and expose it throughpreload/index.ts. The button should callwindow.voicestudio.…. In the handler, usepath.basename(name)so a crafted clip name can't write outside the export folder. Also handle write errors, and avoid silently overwriting existing files.- Remove the version bump in
package.json. Versions are changed by maintainers at release time.- Add
toolbar.exporttode.jsonandja.json. Replace the hardcodedalert('Exported!')with a translated string.- Replace the test. The current one only checks that the source text contains certain strings, which we don't accept. Please test the handler's actual behavior (for example, exporting to a temp dir and checking the file), or the button's click behavior with a mocked bridge.
Happy to re-review once these are updated.
作った・変えたファイル
ファイルの変更はありません。
2 回目: 引き分け (達成率 100% / 100%)
両者とも全ブロッカー(Node import・翻訳漏れ・部分文字列テスト・版上げ)を指摘し、建設的な下書きもあり実質差なし。
スキルなし100%
最終メッセージ
Verdict: not ready to merge. There are five blocking problems.
Line numbers below refer to patches/pr-57.diff.
Blocking problems
-
The renderer imports Node modules (diff lines 20–22, 28–30).
Toolbar.tsxnow importsfs,pathandos, and writes files directly. CONTRIBUTING.md says the renderer is sandboxed withnodeIntegration: falseand must never import these modules. All filesystem access belongs inelectron/src/main/, reached through the preload bridge. In the sandboxed renderer this code would also fail at runtime or break the build.- The contributor should add an
ipcMain.handle('audio:export', …)handler inmain/ipc.ts. Next to the existingaudio:savehandler, it would do themkdirand write there. - They should expose it in
preload/index.tsasexportAudio(name, data). - The component then calls
window.voicestudio.exportAudio(...)and imports no Node modules.
- The contributor should add an
-
Path traversal and hard-coded location (line 30).
path.join(dir, clip.name)uses an unvalidated name. A name like../../.bashrcwould write outside the export folder. The main-process handler should reduce the name withpath.basenameand check that the resolved path stays inside the target directory. The folder is also hard-coded to~/VoiceStudio Exports, and the user never picks it. The button is called "Export to folder", so it should probably usedialog.showOpenDialog({properties: ['openDirectory']}), asaudio:saveuses a dialog. The contributor should confirm that with you. -
Missing translations (en.json hunk, lines 45–53).
toolbar.exportis added only toen.json. CONTRIBUTING.md requires new keys in all locale files, sode.jsonandja.jsonare missing it. Thealert('Exported!')string at line 31 is also hard-coded and user-visible, so it needs a key too. The key would be something liketoolbar.exported, added to all three files. It is also shown unconditionally, even if the write fails. The write is synchronous and has no error handling. -
The test is a source-substring check (lines 54–66). It reads
Toolbar.tsxand checks that it containsexportToFolderandtoolbar.export. CONTRIBUTING.md explicitly rejects tests like this. It needs a test of observable behavior. For example, it could call the new main-process handler with a temp directory and assert that the file is written. It should also check that a traversal name such as../xis rejected or sanitised. -
Version bump (lines 5–14).
package.jsongoes from 0.6.1 to 0.7.0. Only maintainers change versions, as part of a release. The contributor should revert this hunk.
Draft review comment
Thanks for the PR, Sam. The feature makes sense, but a few things need to change before we can merge:
- Architecture:
Toolbar.tsxcan't importfs/path/os. The renderer is sandboxed, and CONTRIBUTING.md says all filesystem access goes through main. Please add anaudio:exporthandler inelectron/src/main/ipc.ts, expose it inpreload/index.ts, and call it from the component viawindow.voicestudio.- Security:
clip.nameis joined into the path without validation, so a name like../../xwrites outside the export folder. Please usepath.basenameand verify the resolved path in main. We'd also prefer letting the user choose the folder with a directory dialog over the hard-coded~/VoiceStudio Exports.- i18n: Please add
toolbar.exporttode.jsonandja.jsonas well asen.json. The'Exported!'alert also needs a translation key, and it should only show on success, with errors handled.- Tests: The current test only checks the source for substrings, which CONTRIBUTING.md doesn't accept. Please test the behavior instead, for example by calling the export handler against a temp dir and checking the file and the traversal rejection.
- Version: Please drop the
package.jsonbump to 0.7.0. Maintainers handle versions at release time.Happy to re-review once these are addressed.
I didn't apply or modify anything.
作った・変えたファイル
ファイルの変更はありません。
スキルあり100%
最終メッセージ
Not ready to merge. PR #57 breaks four CONTRIBUTING.md rules. I reviewed the diff against the current tree and applied nothing.
Blocking problems
-
The renderer imports Node modules (
electron/src/renderer/src/components/Toolbar.tsx, diff lines 20–22 and 28–30). The PR addsfs,pathandosimports to the renderer and callsfs.mkdirSyncandfs.writeFileSyncthere. CONTRIBUTING forbids this, because the renderer runs withnodeIntegration: false. The code would fail at runtime or break the renderer build. It also writes to disk from the renderer.- Fix:
- Add an IPC handler in
electron/src/main/ipc.ts, next toaudio:save(lines 6–11), for exampleaudio:export. - Expose it in
electron/src/preload/index.tsasexportAudio(name, data). - Have the button call
window.voicestudio.exportAudio(...). - Remove the three Node imports from the renderer.
- Add an IPC handler in
- Fix:
-
The handler would write unsafely (the same lines, logic moved to main).
clip.nameis joined straight onto the export folder. A name like../../xwould escape it. The folder is also hardcoded to~/VoiceStudio Exports, and files are overwritten silently.- Fix:
- In main, reduce the name with
path.basename. - Choose the folder explicitly with
dialog.showOpenDialog({ properties: ['openDirectory'] }), or document the fixed location. - Avoid clobbering existing files.
- In main, reduce the name with
- Fix:
-
Locale keys are missing (
electron/src/renderer/src/locales/en.json, diff lines 45–53). The PR addstoolbar.exportonly toen.json.de.jsonandja.jsonare untouched, and CONTRIBUTING requires new keys in all locale files. The hardcodedalert('Exported!')at diff line 31 is also a user-visible string with no translation key.- Fix:
- Add
toolbar.exporttode.jsonandja.json. - Add a key for the success message and use
t(). - Prefer a non-blocking toast over
alert.
- Add
- Fix:
-
The test only checks source text (
electron/tests/toolbar.test.ts, diff lines 54–66). It readsToolbar.tsxand checks for the substringsexportToFolderandtoolbar.export. CONTRIBUTING explicitly rejects tests like this.- Fix: test the main-process handler's behavior instead. With
fsand the dialog mocked or a temp directory, check that the file is written, that a traversal name is sanitized, and that cancelling returns null.
- Fix: test the main-process handler's behavior instead. With
-
The PR bumps the version (
package.json, diff lines 5–14, 0.6.1 → 0.7.0). Only maintainers change versions, as part of a release.- Fix: drop this hunk.
Draft review comment
Thanks for the PR, Sam. An export-to-folder action is a useful idea. It isn't mergeable yet. Please address these:
- Don't use Node APIs in the renderer.
Toolbar.tsximportsfs,pathandos, which CONTRIBUTING forbids. Move the write into anipcMain.handle('audio:export', …)handler inmain/ipc.ts. Expose it throughpreload/index.tsand callwindow.voicestudio.exportAudio(...)from the button, the waysaveAudioworks.- Sanitize the path. In main, use
path.basename(name)so a clip name can't escape the target folder. Let the user pick the folder with a dialog, or document the fixed location, and don't overwrite existing files silently.- Localize everything. Add
toolbar.exporttode.jsonandja.json, not justen.json. Replace the hardcodedalert('Exported!')with a translated message.- Replace the test. The substring check on
Toolbar.tsxisn't accepted. Please test the IPC handler's behavior: file written, traversal name sanitized, cancel handled.- Drop the version bump in
package.json. Maintainers handle versions at release time.Happy to re-review once those are updated.
作った・変えたファイル
ファイルの変更はありません。