GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Stage 1: ファイル I/O を本物実装し path-guard で workspace 防御を導入 by ymnao · Pull Request #6 · ymnao/scripta Conversation
|
| File | Description |
|---|---|
| vitest.config.ts | renderer/jsdom と main/node のテストプロジェクト分離 |
| src/lib/errors.ts | Node errno / path-guard 系エラーの翻訳パターン追加 |
| src/lib/errors.test.ts | 追加したエラー翻訳・transient 判定のテスト追加 |
| src/lib/commands.ts | workspaceSet コマンドを renderer から呼べるよう追加 |
| src/components/layout/Sidebar.tsx | フォルダ選択時に workspaceSet を先に実行して race 回避 |
| src/components/layout/AppLayout.tsx | hydrate 時に workspaceSet を行い、失敗時に main 側登録も巻き戻し |
| src/components/layout/AppLayout.test.tsx | commands mock に workspaceSet 追加 |
| src/components/demo/sample-markdown.ts | Stage 0b デモ用サンプルの削除 |
| src/components/demo/DemoView.tsx | Stage 0b デモビューの削除 |
| src/test-utils/api-mock.ts | window.api.workspaceSet のデフォルトモック追加 |
| src/App.tsx | ?demo=1 経路の削除 |
| package.json | write-file-atomic と型定義を追加 |
| pnpm-lock.yaml | 依存追加に伴う lock 更新 |
| electron/preload/index.ts | preload API に workspaceSet を公開 |
| electron/preload/api.ts | Api 型に workspaceSet を追加 |
| electron/main/utils/path-guard.ts | workspace root/transient write path 管理とガード実装追加 |
| electron/main/utils/path-guard.test.ts | path-guard の単体テスト追加 |
| electron/main/utils/fs-errors.ts | 旧 Tauri 互換の fs エラーメッセージ生成を集約 |
| electron/main/ipc/workspace.ts | ウィンドウ単位 workspace 登録 + ref-count 管理の IPC 実装追加 |
| electron/main/ipc/workspace.test.ts | workspace IPC ロジックの単体テスト追加 |
| electron/main/ipc/watcher.ts | Stage 1 の no-op 明示コメント追加 |
| electron/main/ipc/settings.ts | settings を settings.json へ永続化(atomic write) |
| electron/main/ipc/settings.test.ts | settings 永続化の単体テスト追加 |
| electron/main/ipc/index.ts | workspace IPC の登録を追加 |
| electron/main/ipc/fs.ts | fs IPC を実ファイル I/O + path-guard 前提に置換 |
| electron/main/ipc/fs.test.ts | fs IPC 実装の単体テスト追加 |
| electron/main/ipc/dialog.ts | SaveDialog の選択先を transient write path として登録 |
| electron/main/index.ts | window close 時の workspace cleanup と bootstrap 方針コメント追加 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
【1. workspace ref-count のパス比較が表記揺れに弱い (must)】 windowWorkspaces は raw 文字列で path を持っており、symlink 経由 / 大文字小文字差 / /var → /private/var などで「同じ実体なのに ref-count で別物扱い」となり、 他 window がまだ使っているのに unregister が走る事故があった。 - path-guard に canonicalize() を export(validatePath + realpath 正規化) - workspace.ts は Map に canonical 形だけを保存し、比較もすべて canonical 同士 - symlink 経由で別パスを送っても同一 workspace と扱われることを ref-count テストで検証 【2. path-guard.ts のコメントが現状と矛盾 (nits)】 旧 bootstrap 経路の説明が残っていたため、現状(renderer 側 AppLayout が workspaceSet で申告する)に合わせて書き直し。 【3. path-guard が validatePath を呼ばずフットガン (recommend)】 isPathAllowed / assertPathAllowed が realpath だけ呼んでいたため、呼び出し側が 誤って相対パスを渡すと cwd 解釈で false-positive になりうる API だった。 内部で validatePath を呼ぶように修正。fs IPC 側の validate と二重になるが冪等。 相対パスで throw するテストも追加。 【4. fs.ts の pathExistsAt が ENOENT 以外も握りつぶす (recommend)】 EACCES / EPERM 等でも false を返していたため、rename/delete が「実際は 権限問題なのに Source not found / Not found」と誤分類するバグがあった。 ENOENT のみ false 扱いにし、他は呼び出し側に伝播するよう修正。 fileExistsImpl も同様に修正。 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 27 out of 28 changed files in this pull request and generated 4 comments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
【1. workspace:set IPC が renderer から任意 path を許す権限昇格 (must)】
renderer が侵害された場合、workspaceSet("/") のような任意絶対パスで
allowedRoots を拡張し path-guard を迂回できる経路があった。
ユーザーの OS ネイティブな folder picker を経由しない権限昇格を防ぐ。
- workspace.ts に approvedWorkspacePaths Set + approveWorkspacePath /
isWorkspacePathApproved を追加。承認は canonical 形で記録する
- workspace:set IPC ハンドラで「approved 集合内 OR null」のみ通し、
未承認 path は throw(path === null は unregister なので常に許可)
- dialog:open-directory が成功した時点で main 側が approveWorkspacePath を
呼ぶ。「OS ネイティブ folder picker を通った」事実が承認の根拠
- 起動時に saved workspacePath を approve する approveSavedWorkspaceFromSettings
を main/index.ts に追加(register はせず approve のみ)
- settings.ts に getWorkspacePathFromSettings を復活(前回削除したが
この用途で再度必要)
- 内部 API setActiveWorkspaceForWindow は approve チェックを行わない
(テスト・bootstrap 用、信頼できる呼び出し元限定)
【2. POSIX 固定パス test が Windows で落ちる (recommend)】
validatePath("/tmp/test.md") を expected "/tmp/test.md" で比較する describe を
describe.skipIf(process.platform === "win32") で skip。
【3-4. fs.symlink を使うテストが Windows で EPERM になる (recommend)】
Developer Mode 無効の Windows で symlink が EPERM になり pnpm test が不安定に
なる問題。各 symlink 利用 it を it.skipIf(process.platform === "win32") で skip。
- path-guard.test.ts: 「blocks symlink-based escape from the workspace」
「blocks symlink-based escape via intermediate directories」
- workspace.test.ts: 「ref-counts via canonical path so symlink-aliased ...」
+ 新規 「treats symlink-aliased paths as the same approval」
approveWorkspacePath / isWorkspacePathApproved の動作を検証する 6 ケースの
テストを workspace.test.ts に追加。
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 27 out of 28 changed files in this pull request and generated 3 comments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
レビュー指摘 3 件はすべて transient write path 機構の同根の問題だったので
統合的に再設計する。
【1. consume タイミングが早すぎて withRetry でリトライ不能 (must)】
旧設計は assertPathAllowed 内で「チェック時点」に consume していたため、
書き込みが EBUSY/EAGAIN 等で失敗→ renderer 側 withRetry が再試行すると
2 回目以降は Permission denied になり、SaveDialog 経由のエクスポートが
リトライ不能だった。
- assertWritePathAllowed を新設し、check のみで consume しない
- consumeTransientWritePath を別関数として export し、書き込み成功後に
fs.ts 側で明示的に呼ぶ
- 失敗時は consume されず、withRetry の再試行で同じ transient が使える
【2. transient が write 以外の IPC にも適用されていた (must)】
旧 assertPathAllowed は read/list/rename/delete でも transient を見て
許可してしまっていた。transient は本来「ユーザー意図的な書き込み」用の
capability なので write 系のみで参照すべき。
- assertPathAllowed (read 系用) は transient を見ず allowedRoots のみ判定
- assertWritePathAllowed (write 系用) のみ transient を考慮
- fs.ts: writeFile / writeNewFile のみ assertWritePathAllowed を使い、
read/list/createFile/createDirectory/rename/delete は assertPathAllowed のまま
【3. 未使用 transient が累積し cleanup されない (must)】
旧設計はプロセス全体の Set に入れていたため、SaveDialog をキャンセル
/中断しただけでも transient が残り、別ウィンドウからも消費可能で、
window close 時の cleanup もなかった。
- transientWritePaths を Map<webContentsId, Set<string>> に変更
- registerTransientWritePath(windowId, path) で window 単位に管理
- dialog:save は event.sender.id を使って ownership を持たせる
- main/index.ts の window.on("closed") で
clearTransientWritePathsForWindow を呼び、未消費 capability を破棄
- 別ウィンドウの transient は assertWritePathAllowed で reject される
(cross-window leakage 防止)
fs.ts の writeFile/writeNewFile は senderId を受け取るシグネチャに変更
(IPC ハンドラが event.sender.id を渡す)。
retry-friendly / window 隔離 / read 系で transient 不可視 を検証する
テスト 7 ケースを追加。
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 27 out of 28 changed files in this pull request and generated 3 comments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
【1. EMFILE が NON_TRANSIENT に無く無駄リトライ (must)】
src/lib/errors.ts の isTransientError は NON_TRANSIENT に含まれないエラーを
すべて transient 扱いでリトライするが、EMFILE(FD 枯渇)はリトライしても
回復しないことが多く、無駄なリトライが続いていた。
- NON_TRANSIENT に \\bEMFILE\\b と /too many open files/i を追加
- isTransientError("EMFILE: ...") / "Too many open files" が false を返す
ことを検証するテストを追加
【2. settings 経由の workspacePath 改ざんで承認境界を迂回できる (must)】
bootstrap で settings.json の workspacePath を無条件で approveWorkspacePath
していたため、renderer から settings:set("workspacePath", "/") のように
任意値を書き込めると(あるいは settings.json が改ざんされると)、次回起動で
任意ディレクトリが「承認済み」になる抜け穴があった。
- settings.ts に RESERVED_KEYS = {"workspacePath"} を導入し、settings:set /
settings:delete ハンドラで該当キーを reject(renderer から書き込み不能化)
- persistWorkspacePath を main 専用 export として追加
- workspace:set ハンドラで approve 通過後に persistWorkspacePath(path) を呼び、
「承認済み path だけが永続化される」整合性を保つ
- フロント側 saveWorkspacePath を廃止:
- src/lib/store.ts から export 削除(settings:set("workspacePath", ...) は
今や reject される)
- AppLayout.tsx の saveWorkspacePath 呼び出し 2 箇所を削除
- AppLayout.tsx の userSetWorkspaceRef も用途消失で削除
- 関連テスト(store.test.ts / AppLayout.test.tsx mock)も更新
【3. SaveDialog の親ウィンドウと sender がズレる (recommend)】
dialog.ts の getParentWindow は focused / first を使っていたため、複数ウィンドウ時に
「event.sender の window」と「dialog の親ウィンドウ」がズレ、SaveDialog の
transient capability 所有者と UI 上の親が食い違う可能性があった。
- BrowserWindow.fromWebContents(event.sender) を最優先する getOwnerWindow に変更
- showOpenDialog / showSaveDialog の signature に event を追加し、
全ハンドラで sender 由来の window を親に使う
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 29 out of 30 changed files in this pull request and generated 2 comments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
レビュー指摘 2 件への対応。両方とも settings store の prototype pollution 系。
【1. getValue が `key in data` で Object.prototype 由来も拾う (must)】
`getValue("toString")` のような Object.prototype 由来のキーで true となり、
IPC 経由で関数(structured clone 不可)を返して例外/DoS になる可能性があった。
__proto__ と絡むと prototype pollution の足掛かりにもなる。
- getValue を Object.hasOwn(data, key) ベースに変更(own property のみ)
- store cache を Object.create(null) で null-prototype object として作成
(`emptyStore()` ヘルパーに集約)
- load() が JSON.parse 結果から「安全なキー」だけを cache に取り込む
(別バージョン / 手書き改ざんで __proto__ 等が入っていても無視)
【2. settings:set / delete が任意キー名で prototype pollution 可能 (must)】
renderer から __proto__ / constructor / prototype を指定すると main プロセスの
状態を汚染できる経路があった。
- isSafeSettingsKey(key) を導入(識別子相当 ^[A-Za-z_][A-Za-z0-9_]*$ のみ許可、
かつ FORBIDDEN_SETTINGS_KEYS = {"__proto__","constructor","prototype"} を
明示的に拒否、非文字列も拒否)
- settings:set / settings:delete ハンドラで isSafeSettingsKey を通らないキーを
throw(reserved-key の reject の前段に配置)
- settings:get は throw せず null を返す(renderer 側は「未設定」で defaults に
フォールバックする既存挙動と整合)
- 引数型を `key: unknown` にして type-level でも信用しないことを明示
isSafeSettingsKey / 危険キー拒否 / load() のフィルタ / Object.hasOwn セマンティクス
をそれぞれ検証する 8 ケースのテストを追加。
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 29 out of 30 changed files in this pull request and generated 5 comments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
【1. Sidebar の workspaceSet(null) ロールバックが既存 workspace を破壊 (must)】
workspace:set ハンドラは既に atomic(permission 通過 → persistWorkspacePath →
setActiveWorkspaceForWindow)で、失敗時は main 側 state が変化しない。
それなのに Sidebar.handleOpenFolder の catch で workspaceSet(null) を呼ぶと、
別 workspace が開いていた window で「新規切替に失敗しただけなのに、開いて
いた既存 workspace まで un-register + settings から削除」されてしまう。
- catch 内の workspaceSet(null) を撤去。失敗時は既存状態を維持
- toast 通知は維持
【2. AppLayout hydrate の workspaceSet(null) が unmount 後にも実行されうる (recommend)】
cancelled = true(unmount / window close)の状態でも try/catch の catch ブロックは
走るため、ユーザーの保存済み workspacePath を意図せず削除する副作用が起こりうる。
- catch ブロック先頭に `if (cancelled) return;` を追加
- 「このウィンドウがまだ生きている時のみ」main 側 state を巻き戻す形に
【3. path-guard.test.ts:101 の POSIX 固定パスが Windows で落ちる (must)】
`/this/path/does/not/exist` を path.resolve すると Windows では drive 付きの
パスになり、`toEqual([phantom])` が失敗する。
- このケースを `it.skipIf(process.platform === "win32")` で Windows skip
- realpathBestEffort の fall-through 経路自体は OS 非依存。Windows 用テストは
drive 付き assertion で別途書き起こす必要があるが、必要になった時点で追加
【4-5. test のパス区切り依存(split("/"))を basename() に置換 (recommend)】
`dirB.split("/").slice(-1)[0]` のような split("/") は Windows パス(\)で
意図した basename にならない。
- workspace.test.ts と path-guard.test.ts の split("/") を `node:path` の
basename() に置換
- import に basename を追加
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 29 out of 30 changed files in this pull request and generated 2 comments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
レビュー指摘 2 件はどちらも fs IPC の path 正規化に関する同根の問題。 【1. TOCTOU: 判定と I/O で違うパスを使っていた (must)】 旧実装は assertPathAllowed / assertWritePathAllowed が「内部で realpath 正規化したパスで判定」する一方、実 I/O は `validatePath` の戻り値(symlink を 含み得るパス)に対して行っていた。チェック後に symlink が差し替えられると、 workspace 外への read/write が成立する余地があった。 【2. 重複正規化: assert 内と impl 内で validatePath/realpath が二重 (recommend)】 writeFileImpl 等の hot path で、validatePath → assertWritePathAllowed の流れで realpath syscall(cache 経由でも Map look up + LRU 更新)が二重に走っていた。 両者を一括で解消する設計変更: - assertPathAllowed / assertWritePathAllowed の戻り値を `void` から `string` (canonical = validatePath + realpathBestEffort 済みパス)に変更。判定で使った 実体を呼び出し側に返す - fs.ts の全 impl は assert 系から canonical を受け取り、実 I/O(fsp.readFile, fsp.writeFile, fsp.rename, shell.trashItem 等)にもこの canonical を使う。 判定と I/O が同一パスになるので TOCTOU で symlink 差し替え攻撃が成立しない - impl 内の `validatePath(path)` 呼び出しを撤去し、二重正規化を解消 - listDirectoryImpl の entry.path も canonical 基準で組み立てる (fs.test.ts の期待値も canonicalize した workspaceDir で計算) - deleteEntryImpl が shell.trashItem に canonical を渡すことで、symlink 差し替え 攻撃で workspace 外のファイルを誤削除しないことを test で担保 isPathAllowed(boolean 副作用なし版)は引き続き try/catch で false に寄せる契約。 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 29 out of 30 changed files in this pull request and generated 2 comments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
【1. listDirectoryImpl の path 表記が renderer の workspacePath とズレる (must)】 前 commit で listDirectoryImpl が assertPathAllowed から canonical を受け取り I/O 安全性は得たが、戻り値の FileEntry.path も `join(canonical, entry.name)` に してしまったため、renderer 側 workspacePath(raw 入力)との表記がズレ、 macOS の /var → /private/var や symlink workspace で FileTree の `replacePrefix(workspacePath, ...)` / `startsWith(workspacePath)` 等が崩れる (絶対パス扱いされる)回帰があった。 - I/O は引き続き canonical で行う(TOCTOU 防止は維持) - 戻り値の path は `resolve(path)` した入力表記を base に組み立てる (symlink 解決はせず、renderer が保持している workspacePath と整合させる) - fs.test.ts の listDirectoryImpl 期待値も入力 (workspaceDir) base に戻す 【2. cachedRealpathSync の同期 I/O によるブロッキング (recommend)】 Stage 1 のスコープ内では現状の sync + LRU で実用上問題ないと判断(cache hit 率 が高い、Stage 1 完了判定の機能パリティに直接影響しない)。将来課題として コメントに明記: - 深いパス階層 / network FS / 大量ファイルアクセス時のブロックは認識 - `fs.promises.realpath` への async 化は assertPathAllowed / canonicalize / 全 fs IPC ハンドラまで波及する API 変更を伴うため Stage 2 以降で検討 - 現状は LRU 256 entries + 通常運用での hit 率の高さで実用上の問題を回避 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 29 out of 30 changed files in this pull request and generated 2 comments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
【1. AppLayout 初期復元の catch が workspaceSet 失敗時にも保存値を削除 (must)】 旧実装は catch 内で常に workspaceSet(null) を呼んでいたため、最初の workspaceSet(settings.workspacePath) 自体が失敗(settings 永続化失敗・ 未承認扱い等)したケースでも、保存済み workspacePath を消してしまっていた。 workspace:set ハンドラが atomic(permission OK → persist → register)に なっているので、初期段階の失敗時は main 側 state が変わっておらず、 ロールバックは不要かつ有害。 - registeredOnMain フラグで「workspaceSet が成功して main 側 state が 更新されたか」を追跡 - catch 内では `if (registeredOnMain)` の場合のみ workspaceSet(null) で巻き戻す - workspaceSet 失敗 → 何もしない(既存設定を維持) - listDirectory 失敗 → main 側 state を巻き戻し、fail-closed の整合性を保つ - cancelled チェックは引き続き先頭で行い、unmount 後の副作用を防ぐ 【2. consumeTransientWritePath が canonical 受け取り時にも再正規化 (recommend)】 呼び出し側(fs.ts の write 系 impl)は assertWritePathAllowed の戻り値 (既に canonical)を渡しているのに、関数内部で再度 canonicalize(realpath sync)を呼んでいた。fs:write 成功は hot path なので無駄。 - consumeTransientWritePath を「canonical 前提」API に変更:内部の canonicalize 呼び出しを撤去し、引数名も canonicalPath に - ドキュメントコメントで「assertWritePathAllowed の戻り値や canonicalize() の 結果を渡すこと、raw は silently false を返す」と明示 - fs.ts の呼び出し側は既に canonical を渡しているので変更不要 - path-guard.test.ts の consume テストを `canonicalize(target)` を渡す形に更新 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 29 out of 30 changed files in this pull request and generated no new comments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
#75) * chore: 依存関係をまとめて更新 + brace-expansion DoS 対応 (Dependabot) Dependabot 8 PR と Dependabot alert #6 を統合: - @codemirror/view: ^6.42.1 → ^6.43.0 (#69) - @uiw/react-codemirror: ^4.25.9 → ^4.25.10 (#69) - dompurify: ^3.4.2 → ^3.4.5 (#71) - lucide-react: ^1.8.0 → ^1.16.0 (#65) - zustand: ^5.0.12 → ^5.0.13 (#67) - @types/node: ^25.7.0 → ^25.9.1 (#72) - @types/react: ^19.2.7 → ^19.2.15 (#68) - @vitejs/plugin-react: ^6.0.1 → ^6.0.2 (#64) - vite: ^8.0.12 → ^8.0.13 (#64) - vitest: ^4.1.6 → ^4.1.7 (#70) 加えて pnpm overrides に brace-expansion: ^5.0.6 を追加し GHSA-jxxr-4gwj-5jf2 (DoS, >=5.0.0 <5.0.6) に対応。transitive dep として minimatch 等から間接的に入るため override で強制する。 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * fix: @codemirror/view を self-ref override で transitive 強制統一 CI typecheck で 6.42.1 と 6.43.0 が共存し EditorView の private property declaration (dispatchTransactions) が衝突していた。@codemirror/autocomplete / commands / lang-html 等の transitive 依存が古い 6.42.1 を pin していたため、 state と同じ self-ref パターン (`$@codemirror/view`) で direct dep 6.43.0 へ強制統一する。 lockfile で @codemirror/[email protected] が 0 件 (6.43.0 のみ 6 箇所) になることを確認。 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * fix: brace-expansion override の selector を v5 系に scope (Copilot 指摘) PR #75 Copilot レビュー対応 (must): `brace-expansion: ^5.0.6` の package-name-only override は、advisory 対象 (GHSA-jxxr-4gwj-5jf2, >=5.0.0 <5.0.6) 範囲外の v1/v2 系を要求する transitive dep も強制的に v5.0.6 にマージしてしまい、semver 互換性が破壊されていた (実際 override 前は v1.1.14 / v2.1.1 が transitive で要求されていた)。 selector を `brace-expansion@^5.0.0` に絞り、v5 系のみ 5.0.6 へ固定する形に 変更。lockfile では v1.1.14 / v2.1.1 / v5.0.6 が共存し、advisory 対象範囲 だけが scope 外の 5.0.6 に強制される正しい状態に戻る。 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
/code-review で検出した 7 件全てに対応。最重要は self-counting 解消 (scripts/check-tauri-residue.sh → scripts/check-legacy-residue.sh)。 Fix #1: self-counting で Phase 5 green 化が原理的に不可能だった問題: - scripts/check-tauri-residue.sh → check-legacy-residue.sh にリネーム - ci.yml job tauri-residue → legacy-residue にリネーム - package.json check:tauri-residue → check:legacy-residue にリネーム - ci.yml コメントから "Tauri" / "WKWebView" verbatim を排除 - 結果: 88 行 (うち 4 行 self-reference) → 84 行 baseline と一致 Fix #2: pnpm verify が CI と divergence していた問題: - verify chain に typecheck:e2e + build を追加 - check:legacy-residue は意図 fail のため verify には含めない (CLAUDE.md で「補助」として別行案内) Fix #3: PATHS の coverage gap: - pnpm-workspace.yaml (CLAUDE.md 上 canonical config) 追加 - vite.config.e2e.ts 追加 - tsconfig.json (root) 追加 - docs/tauri-purge-inventory.md §2.1 にも追従 Fix #4: WebKit 扱いの inventory との非整合: - script ヘッダで WebKit 除外の意図を明記 (-webkit- prefix FP 回避) - inventory §2.1 / §2.5 / §2.6 で CI ガードとの差分を明記 (ime.ts:4 等 WebKit 系コメントは CI 非対象 → Phase 3 で手動チェック) Fix #5: git grep exit ≥2 (pathspec error / 非 git repo 等) を silently success として扱っていた問題: - if RESULT=$(...) を捨て、明示的に EXIT=$? を捕捉 - case 0 / 1 / *) で 3 分岐 (match / no-match / error) - error 時は stderr 出力 + exit 2 Fix #6: continue-on-error は workflow 成否にのみ作用し job の check-run は failure のまま残るため、branch protection の required status checks に追加すると merge blocking される: - workflow コメントに caveat を追記 - 「Phase 5 完了まで required 化しない」運用を明示 Fix #7: :(exclude)scripts/check-tauri-residue.sh の dead code 化: - 新ファイル名 :(exclude)scripts/check-legacy-residue.sh に更新 - 「PATHS に scripts/ を含めないため現状 no-op、defensive 配置」コメント 追記 検証: - bash scripts/check-legacy-residue.sh → 84 行検出 (PR 直前と一致) - pnpm verify (format / lint / typecheck / typecheck:e2e / test / test:e2e / build) 全 pass Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
* chore: Tauri 残骸検出 CI ガードを追加 (#82 Phase 1 PR-2) Issue #82 サブタスク D。Phase 2-5 の削除・置換進捗を質的に追跡する CI ガードを設置する。 変更: - scripts/check-tauri-residue.sh: 13 種の FORBIDDEN keyword (tauri / wkwebview / __TAURI / webviewWindow / @tauri-apps / src-tauri / tauri:// / tauri-plugin / data-tauri- / convertFileSrc / WebviewWindow / appWindow / tauri.conf) を git grep で検出。1 hit でも exit 1。対象スコープは docs/tauri-purge-inventory.md §2.1 と同期。-webkit- prefix CSS の false positive は keyword に WebKit を含めないことで除外 - package.json: check:tauri-residue script + verify script を追加 (verify = format && lint && typecheck && test && test:e2e の chain を codify。check:tauri-residue は Phase 5 完了時に verify へ合流予定) - .github/workflows/ci.yml: tauri-residue job を追加。Phase 1 時点 では既存残骸 84 行が検出され意図 fail するため continue-on-error: true で merge を blocking しない運用。Phase 5 完了 PR で除去 - CLAUDE.md: 「コミット前の検証」を pnpm verify に集約 ローカル実行: 84 行検出で exit 1 (期待動作)。inventory §2.2 の 集計 (B 14 行 + 残り A/C/D) と整合。 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * chore: PR #103 code-review 7 件反映 (CI ガード設計欠陥修正) /code-review で検出した 7 件全てに対応。最重要は self-counting 解消 (scripts/check-tauri-residue.sh → scripts/check-legacy-residue.sh)。 Fix #1: self-counting で Phase 5 green 化が原理的に不可能だった問題: - scripts/check-tauri-residue.sh → check-legacy-residue.sh にリネーム - ci.yml job tauri-residue → legacy-residue にリネーム - package.json check:tauri-residue → check:legacy-residue にリネーム - ci.yml コメントから "Tauri" / "WKWebView" verbatim を排除 - 結果: 88 行 (うち 4 行 self-reference) → 84 行 baseline と一致 Fix #2: pnpm verify が CI と divergence していた問題: - verify chain に typecheck:e2e + build を追加 - check:legacy-residue は意図 fail のため verify には含めない (CLAUDE.md で「補助」として別行案内) Fix #3: PATHS の coverage gap: - pnpm-workspace.yaml (CLAUDE.md 上 canonical config) 追加 - vite.config.e2e.ts 追加 - tsconfig.json (root) 追加 - docs/tauri-purge-inventory.md §2.1 にも追従 Fix #4: WebKit 扱いの inventory との非整合: - script ヘッダで WebKit 除外の意図を明記 (-webkit- prefix FP 回避) - inventory §2.1 / §2.5 / §2.6 で CI ガードとの差分を明記 (ime.ts:4 等 WebKit 系コメントは CI 非対象 → Phase 3 で手動チェック) Fix #5: git grep exit ≥2 (pathspec error / 非 git repo 等) を silently success として扱っていた問題: - if RESULT=$(...) を捨て、明示的に EXIT=$? を捕捉 - case 0 / 1 / *) で 3 分岐 (match / no-match / error) - error 時は stderr 出力 + exit 2 Fix #6: continue-on-error は workflow 成否にのみ作用し job の check-run は failure のまま残るため、branch protection の required status checks に追加すると merge blocking される: - workflow コメントに caveat を追記 - 「Phase 5 完了まで required 化しない」運用を明示 Fix #7: :(exclude)scripts/check-tauri-residue.sh の dead code 化: - 新ファイル名 :(exclude)scripts/check-legacy-residue.sh に更新 - 「PATHS に scripts/ を含めないため現状 no-op、defensive 配置」コメント 追記 検証: - bash scripts/check-legacy-residue.sh → 84 行検出 (PR 直前と一致) - pnpm verify (format / lint / typecheck / typecheck:e2e / test / test:e2e / build) 全 pass Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.