19 Commits

Author SHA1 Message Date
nrslib
6a28929497 fix: 通知ユーティリティのテストモック追加と check:release の通知対応
通知機能(notifySuccess/notifyError/playWarningSound)追加に伴い、
テストの vi.mock を修正。重複モックの統合、vitest 環境変数の追加、
GH API の recursive パラメータ修正、check:release に macOS 通知を追加。
2026-02-23 14:34:20 +09:00
nrs
1acd991e7e
feat: pipeline モードでの Slack 通知を強化 (#346) (#347)
* feat: pipeline モードでの Slack 通知を try/finally パターンで実装

- executePipeline の本体を try/finally で囲み、全終了パスで通知を送信
- PipelineResult でスプレッド演算子による不変状態追跡
- notifySlack ヘルパーで webhook 未設定時は即 return
- 既存の早期リターンパターンを保持したまま通知機能を追加

* refactor: executePipeline のオーケストレーションと各ステップを分離

- execute.ts: オーケストレーション + Slack 通知 (157行)
- steps.ts: 5つのステップ関数 + テンプレートヘルパー (233行)
- runPipeline で全ステップを同じ抽象レベルに揃えた
- buildResult ヘルパーで let 再代入を最小化

* test: commitAndPush の git 操作失敗時の exit code 4 テストを追加
2026-02-22 21:06:29 +09:00
Tomohisa Takaoka
a08adadfb3
fix: PR creation failure handling + use default branch for base (#345)
* fix: mark task as failed when PR creation fails

Previously, when PR creation failed (e.g. invalid base branch),
the task was still marked as 'completed' even though the PR was
not created. This fix ensures:

- postExecutionFlow returns prFailed/prError on failure
- executeAndCompleteTask marks the task as failed when PR fails
- selectAndExecuteTask runs postExecution before persisting result

The pipeline path (executePipeline) already handled this correctly
via EXIT_PR_CREATION_FAILED.

* fix: use detectDefaultBranch instead of getCurrentBranch for PR base

Previously, baseBranch for PR creation was set to HEAD's current branch
via getCurrentBranch(). When the user was on a feature branch like
'codex/pr-16-review', PRs were created with --base codex/pr-16-review,
which fails because it doesn't exist on the remote.

Now uses detectDefaultBranch() (via git symbolic-ref refs/remotes/origin/HEAD)
to always use the actual default branch (main/master) as the PR base.

Affected paths:
- resolveTask.ts (takt run)
- selectAndExecute.ts (interactive mode)
- pipeline/execute.ts (takt pipeline)
2026-02-22 20:37:14 +09:00
nrs
f557db0908
feat: support --create-worktree in pipeline mode (#361)
Pipeline mode previously ignored the --create-worktree option.
Now when --create-worktree yes is specified with --pipeline,
a worktree is created and the agent executes in the isolated directory.

- Add createWorktree field to PipelineExecutionOptions
- Pass createWorktreeOverride from routing to executePipeline
- Use confirmAndCreateWorktree when createWorktree is true
- Execute task in worktree directory (execCwd) instead of project cwd
2026-02-22 20:32:36 +09:00
Tomohisa Takaoka
1d7336950e feat: opt-in auto_fetch and base_branch config for clone
Replace the always-on syncDefaultBranch with opt-in resolveBaseBranch:

- Add auto_fetch config (default: false) — only fetch when enabled
- Add base_branch config (project and global) — fallback to current branch
- Fetch-only mode: git fetch origin without modifying local branches
- Use fetched commit hash (origin/<base_branch>) to reset clone to latest
- No more git merge --ff-only or git fetch origin main:main

Config example:
  # ~/.takt/config.yaml or .takt/config.yaml
  auto_fetch: true
  base_branch: develop

Addresses review feedback: opt-in behavior, no local branch changes,
configurable base branch with current-branch fallback.
2026-02-21 12:30:26 -08:00
nrs
dec77e069e
add-model-to-persona-providers (#324)
* takt: add-model-to-persona-providers

* refactor: loadConfigを廃止しresolveConfigValueにキー単位解決を一元化

loadConfig()による一括マージを廃止し、resolveConfigValue()でキーごとに
global/project/piece/envの優先順位を宣言的に解決する方式に移行。
providerOptionsの優先順位をglobal < piece < project < envに修正し、
sourceトラッキングでOptionsBuilderのマージ方向を制御する。
2026-02-20 11:12:46 +09:00
nrs
4f8255d509
takt: add-draft-pr-option (#323) 2026-02-20 00:35:41 +09:00
nrslib
b9a2a0329b auto PR のベースブランチをブランチ作成前の現在ブランチに設定
createPullRequest の全呼び出し箇所で base が未指定だったため、
PR が常にリポジトリデフォルトブランチ(main)向けに作成されていた。
ブランチ作成/clone作成の直前に getCurrentBranch() で元ブランチを
取得し、PR作成時に base として渡すように修正。
2026-02-08 07:51:03 +09:00
nrs
8e509e13c6
Issue/90 fix windows (#91)
* Window対応および Codexが.gitを必要とする問題があるので.gitがみつからない場合はエラーとする fix #90

* 文字化け修正
2026-02-04 13:19:00 +09:00
nrslib
38d43f2168 pieceに完全移行 2026-02-04 11:07:41 +09:00
nrslib
b944349d8f refacotr 2026-02-02 21:52:40 +09:00
nrslib
7d8ba10abb refactor 2026-02-02 17:11:42 +09:00
nrslib
710d108f53 structuring 2026-02-02 10:14:12 +09:00
nrslib
d6ac71f0e6 | 作成 | src/task/git.ts | stageAndCommit() 共通関数。git commit ロジックのDRY化 |
| 作成 | `src/workflow/instruction-context.ts` | `instruction-builder.ts` からコンテキスト組立ロジック抽出 |
| 作成 | `src/workflow/status-rules.ts` | `instruction-builder.ts` からステータスルールロジック抽出 |
| 変更 | 35ファイル | `getErrorMessage()` 統一、`projectCwd` required 化、`process.cwd()` デフォルト除去、`sacrificeMode` 削除、`loadGlobalConfig` キャッシュ、`console.log` → `blankLine()`、`executeTask` options object 化 |

resolved #44
2026-02-01 22:58:49 +09:00
nrslib
ff7cfb52f7 --workflow にてpathも指定できるように 2026-02-01 20:58:03 +09:00
nrslib
14130ee958 feat: workflowやconfig指定をオプションで受け入れpath対応にする (#81) 2026-02-01 07:45:04 +00:00
nrslib
063b0e8d70 resolved #69 2026-01-31 23:24:24 +09:00
nrslib
1e8909d512 resolved #52, resolved #59 2026-01-31 19:25:50 +09:00
nrslib
e950a3f79c resolved 52 2026-01-31 18:28:30 +09:00