Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

# CHANGELOG

## [v3.2.66] - 2026-04-22 — WorktreeManager.psm1 テストカバレッジ拡充

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

未来日付のリリース日を実日付に合わせてください。

Line 5 の 2026-04-22 は現在時点(2026-04-21)より未来です。履歴として確定済みの記録なら、実際の公開日に揃えた方が混乱を避けられます。

🛠 修正例
-## [v3.2.66] - 2026-04-22 — WorktreeManager.psm1 テストカバレッジ拡充
+## [v3.2.66] - 2026-04-21 — WorktreeManager.psm1 テストカバレッジ拡充
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## [v3.2.66] - 2026-04-22 — WorktreeManager.psm1 テストカバレッジ拡充
## [v3.2.66] - 2026-04-21 — WorktreeManager.psm1 テストカバレッジ拡充
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` at line 5, Update the release date on the CHANGELOG entry for
v3.2.66 — locate the header line containing "## [v3.2.66] - 2026-04-22 —
WorktreeManager.psm1 テストカバレッジ拡充" and change the date portion to the actual
publication date (e.g., 2026-04-21) so the recorded release date is not in the
future.


### 🎯 概要
`scripts/lib/WorktreeManager.psm1`(375行・7関数)のテストが `Get-WorktreeBasePath` 3件のみだった問題を解消。`Get-WorktreeSummary`(`Mock -ModuleName WorktreeManager` でモック注入)と `Get-WorktreeBasePath` edge cases を追加し、14 テストケースに拡充。

### 🔧 変更対象
| ファイル | 変更内容 |
|---|---|
| `tests/unit/WorktreeManager.Tests.ps1` | `Get-WorktreeBasePath` edge cases +2件 / `Get-WorktreeSummary` 9件追加 = 計 14 テストケース |

### ✅ テスト結果
- Pester: 14/14 passed
- PSScriptAnalyzer 0 warnings (PSUseBOMForUnicodeEncodedFile 対応済み)

---

## [v3.2.65] - 2026-04-21 — New-CloudSchedule.ps1 ユニットテスト追加

### 🎯 概要
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
> **📌 v3.1.0 で Claude Code 専用ツールに整理**
> v3.1.0 より、Codex CLI / GitHub Copilot CLI の起動メニュー (S2/S3/L2/L3) は削除されました。本ツールは **Claude Code 専用の自律開発ランチャー** として位置づけを明確化し、Linux crontab 連携・セッション情報タブ・Statusline グローバル適用などの新機能に投資が集中しています。

> **☁️ v3.2.64 — 管理操作(OFFA/ONA/DELA)をプロジェクトスコープに限定**
> `[4] 管理` の全一括操作が全プロジェクトに作用していた問題を修正。現在選択中のプロジェクトのみを対象とするよう変更し、確認ダイアログにプロジェクト名を明示。v3.2.63: PSScriptAnalyzer 0警告達成 / `[1] 一覧表示` プロジェクト別フィルタ改善。詳細は [`CHANGELOG.md`](./CHANGELOG.md) を参照。
> **🧪 v3.2.66 — WorktreeManager.psm1 テストカバレッジ拡充**
> `Get-WorktreeSummary`(`Mock -ModuleName` 注入)と `Get-WorktreeBasePath` edge cases を追加し 14 テストケースに拡充。v3.2.65: New-CloudSchedule.ps1 ユニットテスト 23件追加(dot-source exit→return パッチ戦略)。詳細は [`CHANGELOG.md`](./CHANGELOG.md) を参照。

> **📨 v3.2.0 — Cron HTML メールレポート (Visual Recap Mail)**
> Cron で起動された ClaudeCode セッションの完了時に、**HTML 形式のレポートメール** を Gmail SMTP 経由で送信。アイコン+色付き表組み+実行サマリ(Monitor/Development/Verify/Improvement の出現回数/エラー検出/STABLE 達成)+次フェーズ提案を含む。送信先は `CLAUDEOS_DEFAULT_TO`(未設定時 `CLAUDEOS_SMTP_USER`)で指定し、SMTP 認証情報は `~/.env-claudeos` の Linux 環境変数で管理(config.json には書かない設計)。詳細は [`docs/common/16_HTMLメールレポート設定.md`](./docs/common/16_HTMLメールレポート設定.md) を参照。
Expand All @@ -27,8 +27,8 @@

| 項目 | 状態 |
|------|------|
| バージョン | **v3.2.65** (New-CloudSchedule.ps1 ユニットテスト 23件追加) — 旧: v3.2.64 (管理OFFA/ONA/DELA操作をプロジェクトスコープに限定) |
| テスト | **703件** — Pester (Unit 18 / Integration 11 / Smoke 1) |
| バージョン | **v3.2.66** (WorktreeManager.psm1 テストカバレッジ拡充 14件) — 旧: v3.2.65 (New-CloudSchedule.ps1 ユニットテスト 23件追加) |
| テスト | **714件** — Pester (Unit 18 / Integration 11 / Smoke 1) |
Comment on lines +30 to +31

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

README内のテスト件数表記を全セクションで統一してください。

Line 31 で 714件 に更新されていますが、同一ファイル内に 680件 や 433件 の記載が残っており、外部向け情報として不整合です。今回更新に合わせて関連箇所を一括同期した方が安全です。

As per coding guidelines **/*.md: maintain README as external-facing truth with clear organization, extensive use of tables and icons, and include architecture diagrams.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 30 - 31, README の複数箇所でテスト件数が不一致(例:
テーブル行の「バージョン/テスト」行で **714件**
に更新されている一方、別箇所に「680件」「433件」が残っている)ため、ファイル全体の外向けテスト件数表記を一括同期してください。具体的には README
内のすべてのテキスト/テーブルセルで「テスト」「件数」「714件」に言及している箇所を検索して値を 714
件に統一し、関連する表見出しや注釈(テーブルの「バージョン」「テスト」行、その他の概要セクションやサマリー)も合わせて更新して整合性を確保してください。

| CI | ✅ SUCCESS |
| ClaudeOS (Claude Code 専用) | v8 (Opus 4.7 最適化 / Token 1.35x 補正 / Agent Teams 並列 spawn / `/compact` 事前発動 / `task_budget` / 1H cache / `/ultrareview` / PreCompact hook / `/recap` fallback / Push Notification / Effort 動的切替) |
| Agents | **25体** の特化サブエージェント (2026Q2 棚卸し後、追加復元済み) |
Expand Down
1 change: 1 addition & 0 deletions TASKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
78. [DONE] [Priority:P2][Owner:Developer][Source:Manual] v3.2.63 PSScriptAnalyzer 0警告達成・一覧表示プロジェクト別フィルタ改善 — 空catchブロック $null=$_ / UTF-8 BOM / New-LoopPreset 改名 / SuppressMessage 関数内移動 / Watch-ClaudeLog $using: / Invoke-CloudList プロジェクトフィルタ
79. [DONE] [Priority:P1][Owner:Developer][Source:Manual] v3.2.64 管理操作(OFFA/ONA/DELA)をプロジェクトスコープに限定 — 全一括操作が全プロジェクトに影響する問題修正 / 確認ダイアログにプロジェクト名明示 / $script:RepoUrl フィルタ追加
80. [DONE] [Priority:P2][Owner:Developer][Source:GitHub#226] v3.2.65 New-CloudSchedule.ps1 ユニットテスト追加 — Build-CreatePrompt / New-LoopPreset の 23 テストケース / dot-source exit→return パッチ戦略 / PSScriptAnalyzer 0警告
81. [DONE] [Priority:P2][Owner:Developer][Source:GitHub#228] v3.2.66 WorktreeManager.psm1 テストカバレッジ拡充 — Get-WorktreeSummary 9件(Mock -ModuleName WorktreeManager)/ Get-WorktreeBasePath edge cases +2件 = 計 14 テストケース / PSScriptAnalyzer 0警告 / STABLE N=3達成

## Auto Extracted From Agent Teams Matrix

Expand Down
101 changes: 99 additions & 2 deletions tests/unit/WorktreeManager.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ============================================================
# ============================================================
# WorktreeManager.Tests.ps1 - WorktreeManager.psm1 unit tests
# Pester 5.x / Phase 4 unit tests
# Pester 5.x / Issue #228
# ============================================================

BeforeAll {
Expand All @@ -9,6 +9,9 @@ BeforeAll {
Import-Module $script:ModulePath -Force
}

# ============================================================
# Get-WorktreeBasePath
# ============================================================
Describe 'Get-WorktreeBasePath' {

It 'returns path ending with .worktrees when RepoRoot is supplied' {
Expand All @@ -26,4 +29,98 @@ Describe 'Get-WorktreeBasePath' {
$result | Should -Match 'my-project'
$result | Should -Match '\.worktrees$'
}

It 'handles paths with spaces correctly' {
$result = Get-WorktreeBasePath -RepoRoot 'C:\my repos\project'
$result | Should -Be (Join-Path 'C:\my repos\project' '.worktrees')
}

It 'preserves deep nested paths and appends .worktrees' {
$result = Get-WorktreeBasePath -RepoRoot 'D:\a\b\c\d\project'
$result | Should -Match 'project'
$result | Should -Match '\.worktrees$'
}
}

# ============================================================
# Get-WorktreeSummary
# ============================================================
Describe 'Get-WorktreeSummary' {

It 'returns one summary object per worktree' {
Mock -ModuleName WorktreeManager Get-Worktree {
@(
[pscustomobject]@{ Path = 'C:\repo'; Commit = 'abc1234def0'; Branch = 'main'; IsBare = $false; IsMain = $true },
[pscustomobject]@{ Path = 'C:\repo\.worktrees\feat'; Commit = 'xyz5678abc0'; Branch = 'feat/my-feat'; IsBare = $false; IsMain = $false }
)
}
$result = Get-WorktreeSummary -RepoRoot 'C:\repo'
$result.Count | Should -Be 2
}

It 'sets Label to [MAIN] for the main worktree' {
Mock -ModuleName WorktreeManager Get-Worktree {
@([pscustomobject]@{ Path = 'C:\repo'; Commit = 'abc1234def0'; Branch = 'main'; IsBare = $false; IsMain = $true })
}
$result = Get-WorktreeSummary -RepoRoot 'C:\repo'
$result[0].Label | Should -Be '[MAIN]'
}

It 'sets Label to empty string for non-main worktrees' {
Mock -ModuleName WorktreeManager Get-Worktree {
@([pscustomobject]@{ Path = 'C:\repo\.worktrees\feat'; Commit = 'abc1234def0'; Branch = 'feat/test'; IsBare = $false; IsMain = $false })
}
$result = Get-WorktreeSummary -RepoRoot 'C:\repo'
$result[0].Label | Should -Be ''
}

It 'truncates Commit hash to 7 characters' {
Mock -ModuleName WorktreeManager Get-Worktree {
@([pscustomobject]@{ Path = 'C:\repo'; Commit = 'abc1234def567'; Branch = 'main'; IsBare = $false; IsMain = $true })
}
$result = Get-WorktreeSummary -RepoRoot 'C:\repo'
$result[0].Commit | Should -Be 'abc1234'
$result[0].Commit.Length | Should -Be 7
}

It 'returns (detached) when Branch is null' {
Mock -ModuleName WorktreeManager Get-Worktree {
@([pscustomobject]@{ Path = 'C:\repo\.worktrees\detach'; Commit = 'abc1234def0'; Branch = $null; IsBare = $false; IsMain = $false })
}
$result = Get-WorktreeSummary -RepoRoot 'C:\repo'
$result[0].Branch | Should -Be '(detached)'
}

It 'returns unknown when Commit is null' {
Mock -ModuleName WorktreeManager Get-Worktree {
@([pscustomobject]@{ Path = 'C:\repo'; Commit = $null; Branch = 'main'; IsBare = $false; IsMain = $true })
}
$result = Get-WorktreeSummary -RepoRoot 'C:\repo'
$result[0].Commit | Should -Be 'unknown'
}

It 'preserves the Path property from worktree data' {
Mock -ModuleName WorktreeManager Get-Worktree {
@([pscustomobject]@{ Path = 'C:\repo\.worktrees\my-feat'; Commit = 'abc1234def0'; Branch = 'feat/x'; IsBare = $false; IsMain = $false })
}
$result = Get-WorktreeSummary -RepoRoot 'C:\repo'
$result[0].Path | Should -Be 'C:\repo\.worktrees\my-feat'
}

It 'returns empty array when no worktrees exist' {
Mock -ModuleName WorktreeManager Get-Worktree { @() }
$result = Get-WorktreeSummary -RepoRoot 'C:\repo'
@($result).Count | Should -Be 0
}

It 'each summary object has Branch Commit Path Label properties' {
Mock -ModuleName WorktreeManager Get-Worktree {
@([pscustomobject]@{ Path = 'C:\repo'; Commit = 'abc1234def0'; Branch = 'main'; IsBare = $false; IsMain = $true })
}
$result = Get-WorktreeSummary -RepoRoot 'C:\repo'
$result[0].PSObject.Properties.Name | Should -Contain 'Branch'
$result[0].PSObject.Properties.Name | Should -Contain 'Commit'
$result[0].PSObject.Properties.Name | Should -Contain 'Path'
$result[0].PSObject.Properties.Name | Should -Contain 'Label'
}
}
Loading