rafcode 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +19 -4
- package/RAF/ahvrih-rate-forge/decisions.md +70 -0
- package/RAF/ahvrih-rate-forge/input.md +44 -0
- package/RAF/ahvrih-rate-forge/outcomes/01-remove-claude-command-config.md +58 -0
- package/RAF/ahvrih-rate-forge/outcomes/02-fix-mixed-attempt-cost.md +46 -0
- package/RAF/ahvrih-rate-forge/outcomes/03-rate-limit-estimation.md +82 -0
- package/RAF/ahvrih-rate-forge/outcomes/04-show-version-in-do-logs.md +45 -0
- package/RAF/ahvrih-rate-forge/outcomes/05-sync-main-before-worktree.md +96 -0
- package/RAF/ahvrih-rate-forge/outcomes/06-sync-readme-with-codebase.md +45 -0
- package/RAF/ahvrih-rate-forge/outcomes/07-no-session-persistence.md +26 -0
- package/RAF/ahvrih-rate-forge/outcomes/08-plan-execution-metadata.md +130 -0
- package/RAF/ahvrih-rate-forge/plans/01-remove-claude-command-config.md +36 -0
- package/RAF/ahvrih-rate-forge/plans/02-fix-mixed-attempt-cost.md +33 -0
- package/RAF/ahvrih-rate-forge/plans/03-rate-limit-estimation.md +82 -0
- package/RAF/ahvrih-rate-forge/plans/04-show-version-in-do-logs.md +32 -0
- package/RAF/ahvrih-rate-forge/plans/05-sync-main-before-worktree.md +40 -0
- package/RAF/ahvrih-rate-forge/plans/06-sync-readme-with-codebase.md +61 -0
- package/RAF/ahvrih-rate-forge/plans/07-no-session-persistence.md +28 -0
- package/RAF/ahvrih-rate-forge/plans/08-plan-execution-metadata.md +123 -0
- package/README.md +27 -7
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +1 -6
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/do.d.ts.map +1 -1
- package/dist/commands/do.js +106 -18
- package/dist/commands/do.js.map +1 -1
- package/dist/commands/plan.d.ts.map +1 -1
- package/dist/commands/plan.js +77 -2
- package/dist/commands/plan.js.map +1 -1
- package/dist/core/claude-runner.d.ts +6 -6
- package/dist/core/claude-runner.d.ts.map +1 -1
- package/dist/core/claude-runner.js +9 -10
- package/dist/core/claude-runner.js.map +1 -1
- package/dist/core/failure-analyzer.d.ts.map +1 -1
- package/dist/core/failure-analyzer.js +3 -3
- package/dist/core/failure-analyzer.js.map +1 -1
- package/dist/core/pull-request.js +3 -3
- package/dist/core/pull-request.js.map +1 -1
- package/dist/core/state-derivation.d.ts +5 -0
- package/dist/core/state-derivation.d.ts.map +1 -1
- package/dist/core/state-derivation.js +14 -4
- package/dist/core/state-derivation.js.map +1 -1
- package/dist/core/worktree.d.ts +32 -0
- package/dist/core/worktree.d.ts.map +1 -1
- package/dist/core/worktree.js +215 -0
- package/dist/core/worktree.js.map +1 -1
- package/dist/prompts/amend.d.ts.map +1 -1
- package/dist/prompts/amend.js +26 -11
- package/dist/prompts/amend.js.map +1 -1
- package/dist/prompts/planning.d.ts.map +1 -1
- package/dist/prompts/planning.js +26 -11
- package/dist/prompts/planning.js.map +1 -1
- package/dist/types/config.d.ts +30 -13
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +14 -10
- package/dist/types/config.js.map +1 -1
- package/dist/utils/config.d.ts +47 -4
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +176 -30
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/frontmatter.d.ts +43 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +85 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/name-generator.d.ts.map +1 -1
- package/dist/utils/name-generator.js +2 -3
- package/dist/utils/name-generator.js.map +1 -1
- package/dist/utils/session-parser.d.ts +44 -0
- package/dist/utils/session-parser.d.ts.map +1 -0
- package/dist/utils/session-parser.js +122 -0
- package/dist/utils/session-parser.js.map +1 -0
- package/dist/utils/terminal-symbols.d.ts +22 -3
- package/dist/utils/terminal-symbols.d.ts.map +1 -1
- package/dist/utils/terminal-symbols.js +52 -18
- package/dist/utils/terminal-symbols.js.map +1 -1
- package/dist/utils/token-tracker.d.ts +20 -0
- package/dist/utils/token-tracker.d.ts.map +1 -1
- package/dist/utils/token-tracker.js +57 -2
- package/dist/utils/token-tracker.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/config.ts +0 -7
- package/src/commands/do.ts +141 -20
- package/src/commands/plan.ts +87 -1
- package/src/core/claude-runner.ts +16 -17
- package/src/core/failure-analyzer.ts +3 -3
- package/src/core/pull-request.ts +3 -3
- package/src/core/state-derivation.ts +20 -4
- package/src/core/worktree.ts +230 -0
- package/src/prompts/amend.ts +26 -11
- package/src/prompts/config-docs.md +91 -29
- package/src/prompts/planning.ts +26 -11
- package/src/types/config.ts +46 -21
- package/src/utils/config.ts +200 -33
- package/src/utils/frontmatter.ts +110 -0
- package/src/utils/name-generator.ts +2 -3
- package/src/utils/session-parser.ts +161 -0
- package/src/utils/terminal-symbols.ts +68 -16
- package/src/utils/token-tracker.ts +65 -2
- package/tests/unit/claude-runner-interactive.test.ts +8 -6
- package/tests/unit/claude-runner.test.ts +5 -66
- package/tests/unit/config-command.test.ts +6 -6
- package/tests/unit/config.test.ts +268 -45
- package/tests/unit/frontmatter.test.ts +182 -0
- package/tests/unit/post-execution-picker.test.ts +5 -0
- package/tests/unit/session-parser.test.ts +301 -0
- package/tests/unit/terminal-symbols.test.ts +142 -0
- package/tests/unit/token-tracker.test.ts +304 -1
- package/tests/unit/validation.test.ts +6 -4
- package/tests/unit/worktree.test.ts +242 -0
package/CLAUDE.md
CHANGED
|
@@ -44,8 +44,10 @@ RAF/
|
|
|
44
44
|
|
|
45
45
|
### Plan File Structure
|
|
46
46
|
|
|
47
|
-
Each plan file
|
|
47
|
+
Each plan file MUST have Obsidian-style frontmatter at the top, before the `# Task:` heading:
|
|
48
48
|
```markdown
|
|
49
|
+
effort: medium
|
|
50
|
+
---
|
|
49
51
|
# Task: [Task Name]
|
|
50
52
|
|
|
51
53
|
## Objective
|
|
@@ -74,6 +76,12 @@ Each plan file follows this structure:
|
|
|
74
76
|
[Additional context]
|
|
75
77
|
```
|
|
76
78
|
|
|
79
|
+
**Frontmatter**:
|
|
80
|
+
- Uses Obsidian-style format: `key: value` lines followed by `---` (no opening delimiter)
|
|
81
|
+
- `effort` is REQUIRED: `low`, `medium`, or `high` — determines execution model via `effortMapping`
|
|
82
|
+
- `model` is OPTIONAL: explicit model override (subject to ceiling)
|
|
83
|
+
- Frontmatter is parsed by `src/utils/frontmatter.ts`
|
|
84
|
+
|
|
77
85
|
**Dependencies Section**:
|
|
78
86
|
- Optional - omit if task has no dependencies
|
|
79
87
|
- Uses task IDs only (e.g., `01, 02`)
|
|
@@ -146,18 +154,25 @@ npm run lint # Type check without emit
|
|
|
146
154
|
- **Config file**: `~/.raf/raf.config.json` (optional — missing file uses all defaults)
|
|
147
155
|
- **Schema** (defined in `src/types/config.ts`):
|
|
148
156
|
- `models.*` — Claude model per scenario (`execute`, `plan`, `nameGeneration`, `failureAnalysis`, `prGeneration`, `config`)
|
|
149
|
-
- `
|
|
157
|
+
- `effortMapping.*` — maps task effort labels (`low`, `medium`, `high`) to models
|
|
150
158
|
- `timeout` — task timeout in seconds
|
|
151
159
|
- `maxRetries` — max retry attempts per task
|
|
152
160
|
- `autoCommit` — whether Claude auto-commits on task completion
|
|
153
161
|
- `worktree` — default worktree mode for plan/do commands
|
|
162
|
+
- `syncMainBranch` — sync main branch with remote before worktree/PR operations (default: true)
|
|
154
163
|
- `commitFormat.*` — commit message templates (`task`, `plan`, `amend`, `prefix`)
|
|
155
|
-
- `claudeCommand` — path/name of the Claude CLI binary
|
|
156
164
|
- **Validation**: strict — unknown keys rejected at every nesting level (`src/utils/config.ts`)
|
|
157
165
|
- **Deep-merge**: partial overrides merge with defaults (only specify keys you want to change)
|
|
158
|
-
- **Helper accessors**: `getModel()`, `
|
|
166
|
+
- **Helper accessors**: `getModel()`, `getEffortMapping()`, `resolveEffortToModel()`, `getModelTier()`, `applyModelCeiling()`, `getCommitFormat()`, `getCommitPrefix()`, `getTimeout()`, `getMaxRetries()`, `getAutoCommit()`, `getWorktreeDefault()`, `getSyncMainBranch()` (all in `src/utils/config.ts`)
|
|
159
167
|
- **Full reference**: `src/prompts/config-docs.md` (also serves as system prompt for `raf config`)
|
|
160
168
|
|
|
169
|
+
### Per-Task Model Resolution
|
|
170
|
+
- Plan files contain `effort` frontmatter that determines which model executes the task
|
|
171
|
+
- `effortMapping` config maps effort labels to models: `{ low: "haiku", medium: "sonnet", high: "opus" }`
|
|
172
|
+
- `models.execute` acts as a ceiling — tasks can't exceed this model tier
|
|
173
|
+
- On retry, tasks escalate to the ceiling model for a better chance of success
|
|
174
|
+
- If a plan has no effort frontmatter, `models.execute` is used as a fallback (with a warning)
|
|
175
|
+
|
|
161
176
|
### `raf config` Command
|
|
162
177
|
- `raf config` — launches interactive Claude session for viewing/editing config
|
|
163
178
|
- `raf config "use haiku for name generation"` — session with initial prompt
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Project Decisions
|
|
2
|
+
|
|
3
|
+
## Where should the 5h window rate limit percentage be displayed?
|
|
4
|
+
Per-task + total — show running 5h window % after each task AND in the final total summary.
|
|
5
|
+
|
|
6
|
+
## Should the Sonnet baseline cap (88,000) be configurable?
|
|
7
|
+
Yes, configurable — add a config key so users can adjust the Sonnet-equivalent token cap.
|
|
8
|
+
|
|
9
|
+
## Should display toggles (rate limit %, cache tokens) be top-level or nested?
|
|
10
|
+
Nested under `display` section — e.g., `display.showRateLimitEstimate: true`, `display.showCacheTokens: true`.
|
|
11
|
+
|
|
12
|
+
## What approach for fixing mixed-attempt cost underreporting?
|
|
13
|
+
Per-attempt cost — calculate cost for each attempt independently, then sum. Each attempt uses per-model if available, aggregate-fallback otherwise.
|
|
14
|
+
|
|
15
|
+
## Should the branch name be configurable for worktree mode?
|
|
16
|
+
No — the user clarified that "branch name" referred to the **main branch** (main, master, etc.) that gets pushed/pulled, not the worktree feature branch. Main branch should be auto-detected from `origin/HEAD`.
|
|
17
|
+
|
|
18
|
+
## How should RAF version be displayed in `raf do` logs?
|
|
19
|
+
Single combined line at the start of execution — e.g., `RAF v2.3.0 | Model: claude-opus-4-6 | Effort: high`.
|
|
20
|
+
|
|
21
|
+
## Should `claudeCommand` be removed entirely or deprecated?
|
|
22
|
+
Remove entirely — always use 'claude' as the command name, remove the config key, accessor, and all references.
|
|
23
|
+
|
|
24
|
+
## Does removing `claudeCommand` also fix the PR #4 review comment about `raf config` fallback?
|
|
25
|
+
Yes — removing `claudeCommand` means `getClaudePath()` will hardcode 'claude', so it can't throw due to broken config. No separate task needed; verification included in the removal task.
|
|
26
|
+
|
|
27
|
+
## Should push-main and pull-main be controlled by one config key or two?
|
|
28
|
+
Single key — `syncMainBranch: true` controls both pushing main before PR and pulling main before worktree creation.
|
|
29
|
+
|
|
30
|
+
## For the main branch: config key or auto-detect?
|
|
31
|
+
Auto-detect from `origin/HEAD` — no config key needed.
|
|
32
|
+
|
|
33
|
+
## What scope for the README sync task?
|
|
34
|
+
Critical only — fix `--merge` flag references, document the post-execution picker, and document PR creation from worktree. Defer medium/low items.
|
|
35
|
+
|
|
36
|
+
## How should token tracking work for `raf plan` interactive sessions?
|
|
37
|
+
Parse Claude CLI's session JSONL file after the interactive session ends. Pass `--session-id <uuid>` to `runInteractive()` so we know exactly which file to read. Session files are stored at `~/.claude/projects/<escaped-path>/<session-id>.jsonl` and contain usage data in assistant message entries.
|
|
38
|
+
|
|
39
|
+
## Should token tracking for `raf plan` be a separate task or combined?
|
|
40
|
+
Combined with task 03 (rate-limit-estimation) since it touches the same token tracking and display infrastructure.
|
|
41
|
+
|
|
42
|
+
## Should `--no-session-persistence` be added to PR description generation only, or also failure analysis?
|
|
43
|
+
Both — add `--no-session-persistence` to both `callClaudeForPrBody()` in `pull-request.ts` AND the failure analyzer in `failure-analyzer.ts`. Both are throwaway Claude calls that shouldn't pollute session history.
|
|
44
|
+
|
|
45
|
+
## Model recommendation for all tasks in this project?
|
|
46
|
+
All tasks are well-suited for Sonnet. Plans are detailed enough that none require Opus-level reasoning.
|
|
47
|
+
|
|
48
|
+
## What format for model/effort markers in plan files?
|
|
49
|
+
Obsidian-style properties at the top of the plan file with only a closing `---` delimiter. E.g., `model: sonnet` and `effort: medium`.
|
|
50
|
+
|
|
51
|
+
## Should RAF use plan frontmatter markers during execution?
|
|
52
|
+
Yes — RAF reads `model` from the plan frontmatter to override the global config per-task. The `effort` field is a human-readable complexity label (not Claude's `--effort` flag) that maps to a model via a configurable mapping (e.g., `low` → haiku, `medium` → sonnet, `high` → opus).
|
|
53
|
+
|
|
54
|
+
## What does `effort` in plan frontmatter mean?
|
|
55
|
+
It is a human-readable task complexity label, NOT Claude's `--effort` parameter. There is a configurable mapping from effort labels to models (e.g., `effortMapping: { low: "haiku", medium: "sonnet", high: "opus" }`). If both `model` and `effort` are in the frontmatter, `model` takes precedence.
|
|
56
|
+
|
|
57
|
+
## Should the `effort.*` config section (Claude's --effort flag) be removed?
|
|
58
|
+
Yes — remove the entire `effort.*` config section, the `EffortConfig` type, `EffortScenario` type, `VALID_EFFORTS`, `getEffort()` accessor, and all `CLAUDE_CODE_EFFORT_LEVEL` env var usage. Claude CLI will use its own default effort level.
|
|
59
|
+
|
|
60
|
+
## How detailed should plans be regarding implementation?
|
|
61
|
+
Neutral — remove the "no implementation details" restriction from planning prompts, but don't actively encourage code snippets. Let the planning model decide the appropriate detail level naturally.
|
|
62
|
+
|
|
63
|
+
## How should config and plan frontmatter interact for model selection?
|
|
64
|
+
Config as ceiling. `models.execute` is redefined as the **maximum model tier** allowed for task execution. The planner sets `effort` per task (required), which maps to a model via `effortMapping`. The final execution model is `min(mapped model, models.execute)` where "min" means the cheaper/lower-tier model. This gives users budget control while letting the planner differentiate task complexity. Model tier ordering: haiku < sonnet < opus.
|
|
65
|
+
|
|
66
|
+
## Should plan frontmatter effort be required or optional?
|
|
67
|
+
Required — the planning prompt mandates effort frontmatter on every task. If missing (e.g., manually created plans), warn and fall back to the config default.
|
|
68
|
+
|
|
69
|
+
## What happens on retry when a task used a cheaper model?
|
|
70
|
+
Bump to ceiling — on retry, use `models.execute` (the ceiling model) instead of the original frontmatter-resolved model. If the first attempt was already at the ceiling, retry with the same model.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
|
|
2
|
+
- [ ] add estimated percentage from 5h window. make default 88000 (this is sonnet token, for other models it should be converted based on model pricing. antropic say that there is one shared token/credit pool per 5‑hour window, not separate “in” and “out” caps. calculate sum in and out and divide by 88000 (for example)
|
|
3
|
+
- API prices tell you the relative weight:
|
|
4
|
+
• Example current non‑batch API pricing:
|
|
5
|
+
• Haiku 4.5: 1 $/M input, 5 $/M output
|
|
6
|
+
• Sonnet 4.5: 3 $/M input, 15 $/M output
|
|
7
|
+
• Opus 4.5 / 4.6: 5 $/M input, 25 $/M output
|
|
8
|
+
• That means, on the API:
|
|
9
|
+
• Opus input token ≈ 1.7× a Sonnet input token, 5× a Haiku input token.
|
|
10
|
+
• Opus output token ≈ 1.7× a Sonnet output token, 5× a Haiku output token.
|
|
11
|
+
3. Most reverse‑engineering + Anthropic’s own recommendations assume the subscription credits follow the same ratios.
So in practice, on the same 5‑hour window:
|
|
12
|
+
• If you spend it all on Sonnet, you get about the “44k / 88k / 220k tokens per 5 h” that people quote.
|
|
13
|
+
• If you instead spend it all on Opus, you will hit the same credit ceiling with fewer raw tokens, roughly scaled by the price ratio (so ballpark ~60% of the Sonnet tokens, given Opus is ~1.7× the cost per token).
|
|
14
|
+
• If you use Haiku, you can squeeze many more tokens into the same 5‑hour credit window, again roughly proportionate to its much lower price.
|
|
15
|
+
So when saying “heavier models like Opus eat that pool faster” it means:
|
|
16
|
+
• The 5‑hour window is measured in cost‑weighted credits, not simple token count.
|
|
17
|
+
• One Opus token “costs” more of that pool than one Sonnet token, in about the same ratio as the API prices.
|
|
18
|
+
• Therefore, for the same 5‑hour cap, you get fewer total tokens with Opus, more with Haiku, middle with Sonnet.
|
|
19
|
+
also make it configurable there show session % estimation or not, configurable, also showing cache estimation is configurable.
|
|
20
|
+
- [ ] `addTask` now prices a task from `accumulateUsage(attempts)`, but that merge can include attempts where only aggregate usage fields are present and `modelUsage` is empty (which `extractUsageData` allows when `event.modelUsage` is absent). If any other attempt has `modelUsage`, `calculateCost` takes the per-model branch and ignores aggregate-only tokens, so mixed-attempt retries underreport cost; compute cost per attempt or carry unmatched aggregate tokens into pricing.
|
|
21
|
+
- [ ] push main to remote before making PR and pull main before creating gitworktree (configurable option, default true). also branch name is configurable
|
|
22
|
+
- [ ] remove "claudeCommand": "claude" from config ( update docs)
|
|
23
|
+
- [ ] in "raf do" logs show version which is used for execution in full format
|
|
24
|
+
- [ ] adress PR (https://github.com/john-veresk/raf/pull/4) review comment [src/commands/config.ts](https://github.com/john-veresk/raf/pull/4/files/8b5786ed7c5e8aaec01cfa47e447550c2a684792#diff-8c467368fd64da9077ad462358fce5589607dfbfe03ac72941c7d74dbfba52aa)
|
|
25
|
+
|
|
26
|
+
Comment on lines +172 to +173
|
|
27
|
+
|
|
28
|
+
| |
|
|
29
|
+
|---|
|
|
30
|
+
|model = DEFAULT_CONFIG.models.config;|
|
|
31
|
+
|effort = DEFAULT_CONFIG.effort.config;|
|
|
32
|
+
|
|
33
|
+
###
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
**[](https://camo.githubusercontent.com/c595229c0ecb6ee85b9c7804144d495f131a495ec87091fea2b262d954c9a92d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50312d6f72616e67653f7374796c653d666c6174) Use default Claude command when config parsing fails**
|
|
37
|
+
|
|
38
|
+
The new recovery path only falls back `model`/`effort` after config parsing errors, but `runInteractive()` still resolves the CLI binary via `getClaudeCommand()`inside `getClaudePath` (`src/core/claude-runner.ts`). With a malformed `~/.raf/raf.config.json`, that second config read still throws before the interactive session starts, so `raf config` remains unusable as a repair path even after showing the fallback warning.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
- [ ] add token tracker feature from 'raf do' to 'raf plan', display stat AFTER planning interactive session (combined with task 03)
|
|
43
|
+
- [ ] add --no-session-persistence to PR description generation and failure analysis Claude calls (like name-generator already has)
|
|
44
|
+
- [ ] add per-task model/effort frontmatter metadata to plan files, RAF reads and uses during execution; remove "no implementation details" restriction from planning prompts
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Outcome: Remove `claudeCommand` from Config
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
Removed the `claudeCommand` configuration key entirely from the RAF config system. The Claude CLI binary name is now hardcoded as `"claude"` throughout the codebase. This simplifies the config schema and eliminates a failure path where a malformed config file could prevent `raf config` from launching as a repair tool.
|
|
5
|
+
|
|
6
|
+
## Key Changes
|
|
7
|
+
|
|
8
|
+
### Types (`src/types/config.ts`)
|
|
9
|
+
- Removed `claudeCommand: string` from `RafConfig` interface
|
|
10
|
+
- Removed `claudeCommand: 'claude'` from `DEFAULT_CONFIG`
|
|
11
|
+
- Removed `claudeCommand` from deprecated `DEFAULT_RAF_CONFIG` export
|
|
12
|
+
|
|
13
|
+
### Config Utilities (`src/utils/config.ts`)
|
|
14
|
+
- Removed `claudeCommand` from `VALID_TOP_LEVEL_KEYS` set
|
|
15
|
+
- Removed `claudeCommand` validation logic
|
|
16
|
+
- Removed `claudeCommand` handling from `deepMerge()` function
|
|
17
|
+
- Removed `getClaudeCommand()` accessor function
|
|
18
|
+
- Updated deprecated `loadConfig()` return type to exclude `claudeCommand`
|
|
19
|
+
|
|
20
|
+
### Claude Runner (`src/core/claude-runner.ts`)
|
|
21
|
+
- Updated `getClaudePath()` to use hardcoded `'which claude'` instead of calling `getClaudeCommand()`
|
|
22
|
+
- Removed `getClaudeCommand` import
|
|
23
|
+
|
|
24
|
+
### Failure Analyzer (`src/core/failure-analyzer.ts`)
|
|
25
|
+
- Updated `getClaudePath()` to use hardcoded `'which claude'`
|
|
26
|
+
- Removed `getClaudeCommand` import
|
|
27
|
+
|
|
28
|
+
### Pull Request (`src/core/pull-request.ts`)
|
|
29
|
+
- Updated `callClaudeForPrBody()` to use hardcoded `'which claude'`
|
|
30
|
+
- Removed `getClaudeCommand` import
|
|
31
|
+
|
|
32
|
+
### Name Generator (`src/utils/name-generator.ts`)
|
|
33
|
+
- Updated `runClaudePrint()` to spawn `'claude'` directly instead of using `getClaudeCommand()`
|
|
34
|
+
- Removed `getClaudeCommand` import
|
|
35
|
+
|
|
36
|
+
### Documentation
|
|
37
|
+
- Updated `src/prompts/config-docs.md` to remove `claudeCommand` section and references
|
|
38
|
+
- Updated `CLAUDE.md` to remove `claudeCommand` from config schema and helper accessor list
|
|
39
|
+
|
|
40
|
+
### Tests (`tests/unit/config.test.ts`)
|
|
41
|
+
- Removed `getClaudeCommand` import
|
|
42
|
+
- Removed `claudeCommand` from full valid config test
|
|
43
|
+
- Removed tests for invalid `claudeCommand` values (empty, whitespace-only, non-string)
|
|
44
|
+
- Removed `claudeCommand` default value test
|
|
45
|
+
- Added test to verify that `claudeCommand` is now rejected as an unknown key
|
|
46
|
+
|
|
47
|
+
## Acceptance Criteria Verification
|
|
48
|
+
- [x] `claudeCommand` key no longer exists in types, defaults, validation, or documentation
|
|
49
|
+
- [x] `getClaudePath()` works without reading any config
|
|
50
|
+
- [x] `raf config` can launch successfully even with a malformed config file (config is no longer needed for CLI path resolution)
|
|
51
|
+
- [x] All config tests pass (92 passed)
|
|
52
|
+
- [x] Config files containing `claudeCommand` are handled gracefully (rejected as unknown key with clear error message)
|
|
53
|
+
|
|
54
|
+
## Notes
|
|
55
|
+
- The pre-existing test failures in `claude-runner-interactive.test.ts` and `validation.test.ts` are unrelated to this change - they concern model resolution expecting short aliases but receiving full model IDs
|
|
56
|
+
- This change addresses PR #4 review comment about `raf config` being unusable as a repair path when config is malformed
|
|
57
|
+
|
|
58
|
+
<promise>COMPLETE</promise>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Outcome: Fix Mixed-Attempt Cost Underreporting
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
Fixed the cost calculation in `TokenTracker.addTask()` to compute cost per-attempt rather than on merged/accumulated usage data. This prevents underreporting when task attempts have mixed `modelUsage` presence (some with per-model breakdown, others with only aggregate fields).
|
|
5
|
+
|
|
6
|
+
## Key Changes
|
|
7
|
+
|
|
8
|
+
### `src/utils/token-tracker.ts`
|
|
9
|
+
|
|
10
|
+
1. **Added `sumCostBreakdowns()` helper function** (lines 27-45)
|
|
11
|
+
- Sums multiple `CostBreakdown` objects into a single total
|
|
12
|
+
- Sums all cost fields: `inputCost`, `outputCost`, `cacheReadCost`, `cacheCreateCost`, `totalCost`
|
|
13
|
+
|
|
14
|
+
2. **Modified `addTask()` method** (lines 101-110)
|
|
15
|
+
- Now calculates cost per-attempt using `this.calculateCost()` on each individual `UsageData`
|
|
16
|
+
- Sums per-attempt costs using `sumCostBreakdowns()`
|
|
17
|
+
- This ensures attempts with empty `modelUsage` correctly fall back to sonnet pricing independently, rather than being silently dropped when merged with attempts that have `modelUsage`
|
|
18
|
+
|
|
19
|
+
### `tests/unit/token-tracker.test.ts`
|
|
20
|
+
|
|
21
|
+
Added new test suites:
|
|
22
|
+
|
|
23
|
+
1. **`describe('mixed-attempt cost calculation (aggregate + modelUsage)')`** - 4 tests:
|
|
24
|
+
- `should correctly price attempts with mixed modelUsage presence` - Core mixed-attempt scenario
|
|
25
|
+
- `should not underreport cost when first attempt has no modelUsage` - Order independence
|
|
26
|
+
- `should handle all aggregate-only attempts` - Both attempts use sonnet fallback
|
|
27
|
+
- `should include cache costs from aggregate-only attempts` - Cache token handling
|
|
28
|
+
|
|
29
|
+
2. **`describe('sumCostBreakdowns')`** - 3 tests:
|
|
30
|
+
- `should return zero breakdown for empty array`
|
|
31
|
+
- `should return same breakdown for single element`
|
|
32
|
+
- `should sum all cost fields across breakdowns`
|
|
33
|
+
|
|
34
|
+
## Acceptance Criteria Verification
|
|
35
|
+
- [x] Cost is calculated per-attempt, not on merged usage
|
|
36
|
+
- [x] Mixed attempts (some with modelUsage, some without) report accurate total cost
|
|
37
|
+
- [x] Per-attempt display in multi-attempt summaries shows correct individual costs (unchanged - `formatTaskTokenSummary` already uses `calculateAttemptCost` callback)
|
|
38
|
+
- [x] Grand total cost across all tasks remains accurate (entry costs are summed in `getTotals()`)
|
|
39
|
+
- [x] New test cases cover the mixed-attempt edge case
|
|
40
|
+
- [x] Existing token tracking tests still pass (34 tests pass)
|
|
41
|
+
|
|
42
|
+
## Notes
|
|
43
|
+
- The pre-existing test failures in `claude-runner-interactive.test.ts` and `validation.test.ts` are unrelated to this change - they concern model resolution expecting short aliases but receiving full model IDs
|
|
44
|
+
- Token count accumulation (`accumulateUsage()`) remains unchanged - only cost calculation was modified
|
|
45
|
+
|
|
46
|
+
<promise>COMPLETE</promise>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Outcome: Add 5h Window Rate Limit Estimation + Plan Session Token Tracking
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
Implemented estimated 5-hour rate limit window percentage display and token usage tracking for `raf plan` interactive sessions.
|
|
5
|
+
|
|
6
|
+
## Key Changes
|
|
7
|
+
|
|
8
|
+
### Config Types (`src/types/config.ts`)
|
|
9
|
+
- Added `DisplayConfig` interface with `showRateLimitEstimate` and `showCacheTokens` boolean fields
|
|
10
|
+
- Added `RateLimitWindowConfig` interface with `sonnetTokenCap` number field
|
|
11
|
+
- Added both to `RafConfig` with defaults: `showRateLimitEstimate: true`, `showCacheTokens: true`, `sonnetTokenCap: 88000`
|
|
12
|
+
|
|
13
|
+
### Config Validation (`src/utils/config.ts`)
|
|
14
|
+
- Added `display` and `rateLimitWindow` to `VALID_TOP_LEVEL_KEYS`
|
|
15
|
+
- Added validation for `display` (object with boolean values for known keys)
|
|
16
|
+
- Added validation for `rateLimitWindow` (object with positive number for `sonnetTokenCap`)
|
|
17
|
+
- Added deep merge support for both new sections in `deepMerge()`
|
|
18
|
+
- Added accessor helpers: `getDisplayConfig()`, `getRateLimitWindowConfig()`, `getShowRateLimitEstimate()`, `getShowCacheTokens()`, `getSonnetTokenCap()`
|
|
19
|
+
|
|
20
|
+
### Config Documentation (`src/prompts/config-docs.md`)
|
|
21
|
+
- Added `display` section explaining `showRateLimitEstimate` and `showCacheTokens`
|
|
22
|
+
- Added `rateLimitWindow` section explaining `sonnetTokenCap` and the conversion formula
|
|
23
|
+
- Updated validation rules and full example config
|
|
24
|
+
|
|
25
|
+
### Token Tracker (`src/utils/token-tracker.ts`)
|
|
26
|
+
- Added `calculateRateLimitPercentage(totalCost, sonnetTokenCap?)` method
|
|
27
|
+
- Converts cost to Sonnet-equivalent tokens using average Sonnet pricing
|
|
28
|
+
- Formula: `sonnetEquivalentTokens = cost / avgSonnetCostPerToken`, then `percentage = tokens / cap * 100`
|
|
29
|
+
- Added `getCumulativeRateLimitPercentage(sonnetTokenCap?)` method for grand totals
|
|
30
|
+
|
|
31
|
+
### Terminal Formatting (`src/utils/terminal-symbols.ts`)
|
|
32
|
+
- Added `TokenSummaryOptions` interface for display configuration
|
|
33
|
+
- Added `formatRateLimitPercentage(percentage)` helper (uses tilde prefix for estimate indicator)
|
|
34
|
+
- Updated `formatTokenLine()` to accept options and conditionally show cache tokens and rate limit
|
|
35
|
+
- Updated `formatTaskTokenSummary()` to accept options (rate limit only on total for multi-attempt)
|
|
36
|
+
- Updated `formatTokenTotalSummary()` to accept options
|
|
37
|
+
|
|
38
|
+
### Claude Runner (`src/core/claude-runner.ts`)
|
|
39
|
+
- Added `sessionId` option to `ClaudeRunnerOptions`
|
|
40
|
+
- Updated `runInteractive()` to pass `--session-id <uuid>` when sessionId is provided
|
|
41
|
+
|
|
42
|
+
### Session Parser (`src/utils/session-parser.ts`) - NEW FILE
|
|
43
|
+
- `escapeProjectPath(path)` - escapes project path for Claude's naming scheme
|
|
44
|
+
- `getSessionFilePath(sessionId, cwd)` - computes expected session file location
|
|
45
|
+
- `parseSessionFile(filePath)` - parses JSONL, accumulates usage from assistant messages
|
|
46
|
+
- `parseSessionById(sessionId, cwd)` - convenience wrapper
|
|
47
|
+
- Handles missing files, malformed JSON lines, entries without usage/model gracefully
|
|
48
|
+
|
|
49
|
+
### Plan Command (`src/commands/plan.ts`)
|
|
50
|
+
- Generates UUID session ID before `runInteractive()` calls
|
|
51
|
+
- Passes sessionId to both plan and amend flows
|
|
52
|
+
- Added `displayPlanSessionTokenSummary()` to parse session file and display formatted usage
|
|
53
|
+
- Uses `TokenTracker` and display config for consistent formatting
|
|
54
|
+
- Logs debug message if session file not found (graceful degradation)
|
|
55
|
+
|
|
56
|
+
### Tests Added
|
|
57
|
+
- `tests/unit/config.test.ts`: 15 tests for display/rateLimitWindow validation and resolution
|
|
58
|
+
- `tests/unit/token-tracker.test.ts`: 7 tests for rate limit percentage calculation
|
|
59
|
+
- `tests/unit/terminal-symbols.test.ts`: 13 tests for display options and rate limit formatting
|
|
60
|
+
- `tests/unit/session-parser.test.ts`: 15 tests (new file) for session file parsing
|
|
61
|
+
|
|
62
|
+
## Acceptance Criteria Verification
|
|
63
|
+
- [x] After each task, token summary includes `~X% of 5h window` when enabled
|
|
64
|
+
- [x] Grand total summary includes cumulative percentage when enabled
|
|
65
|
+
- [x] Percentage correctly reflects cost-weighted usage (Opus > Sonnet > Haiku)
|
|
66
|
+
- [x] Multi-model tasks correctly account for different models across attempts
|
|
67
|
+
- [x] `display.showRateLimitEstimate: false` hides the percentage
|
|
68
|
+
- [x] `display.showCacheTokens: false` hides cache token counts
|
|
69
|
+
- [x] `rateLimitWindow.sonnetTokenCap` correctly adjusts the denominator
|
|
70
|
+
- [x] Config validation accepts the new keys
|
|
71
|
+
- [x] Config docs updated with new keys and explanation
|
|
72
|
+
- [x] After `raf plan` interactive session, token usage summary is displayed
|
|
73
|
+
- [x] After `raf plan --amend` interactive session, token usage summary is displayed
|
|
74
|
+
- [x] Session file parsing handles missing/malformed files gracefully
|
|
75
|
+
- [x] Tests cover conversion math, display toggling, and session file parsing
|
|
76
|
+
|
|
77
|
+
## Notes
|
|
78
|
+
- The pre-existing test failures in `claude-runner-interactive.test.ts` and `validation.test.ts` are unrelated to this change - they concern model resolution and effort level handling
|
|
79
|
+
- The rate limit percentage is deliberately marked as an estimate with tilde (~) prefix since the actual Anthropic algorithm may differ
|
|
80
|
+
- Session file location is based on Claude CLI's current storage format (`~/.claude/projects/<escaped-path>/<session-id>.jsonl`)
|
|
81
|
+
|
|
82
|
+
<promise>COMPLETE</promise>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Outcome: Show RAF Version and Model in `raf do` Logs
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
Added a version and model info line at the start of every `raf do` execution, displayed before any task runs. The format is `RAF v{version} | Model: {fullModelId}` and uses dim text styling for subtlety.
|
|
5
|
+
|
|
6
|
+
## Key Changes
|
|
7
|
+
|
|
8
|
+
### `src/utils/config.ts`
|
|
9
|
+
- Added `MODEL_ALIAS_TO_FULL_ID` constant mapping short aliases to current full model IDs:
|
|
10
|
+
- `opus` → `claude-opus-4-6`
|
|
11
|
+
- `sonnet` → `claude-sonnet-4-5-20250929`
|
|
12
|
+
- `haiku` → `claude-haiku-4-5-20251001`
|
|
13
|
+
- Added `resolveFullModelId(modelName: string): string` function that:
|
|
14
|
+
- Resolves short aliases (`opus`, `sonnet`, `haiku`) to their full model IDs
|
|
15
|
+
- Returns full model IDs and unknown strings as-is
|
|
16
|
+
|
|
17
|
+
### `src/commands/do.ts`
|
|
18
|
+
- Added imports for `resolveFullModelId` from config.ts and `getVersion` from version.ts
|
|
19
|
+
- Added version/model log line in `executeSingleProject()` at line 729:
|
|
20
|
+
```typescript
|
|
21
|
+
const fullModelId = resolveFullModelId(model);
|
|
22
|
+
logger.dim(`RAF v${getVersion()} | Model: ${fullModelId}`);
|
|
23
|
+
```
|
|
24
|
+
- Removed `showModel` from `SingleProjectOptions` interface (no longer needed since version/model is always shown)
|
|
25
|
+
- Removed `showModel: true` from the call site
|
|
26
|
+
|
|
27
|
+
### `tests/unit/config.test.ts`
|
|
28
|
+
- Added import for `resolveFullModelId`
|
|
29
|
+
- Added 3 new tests in `describe('resolveFullModelId')`:
|
|
30
|
+
- `should resolve short aliases to full model IDs`
|
|
31
|
+
- `should return full model IDs as-is`
|
|
32
|
+
- `should return unknown model strings as-is`
|
|
33
|
+
|
|
34
|
+
## Acceptance Criteria Verification
|
|
35
|
+
- [x] A version/model line appears at the start of every `raf do` execution
|
|
36
|
+
- [x] Model name is shown in full format (e.g., `claude-opus-4-6`)
|
|
37
|
+
- [x] Line appears before any task execution output
|
|
38
|
+
- [x] Works in both worktree and non-worktree modes
|
|
39
|
+
|
|
40
|
+
## Notes
|
|
41
|
+
- The pre-existing test failures in `claude-runner-interactive.test.ts` and `validation.test.ts` are unrelated to this change - they concern model resolution expecting short aliases but receiving full model IDs
|
|
42
|
+
- The version/model line uses `logger.dim()` for subtle display that doesn't clutter output
|
|
43
|
+
- All 111 config tests pass, including the 3 new tests for `resolveFullModelId`
|
|
44
|
+
|
|
45
|
+
<promise>COMPLETE</promise>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Outcome: Sync Main Branch Before Worktree/PR Operations
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
Implemented automatic syncing of the main branch with the remote before worktree creation and PR creation, with a configurable toggle. The main branch is auto-detected from `refs/remotes/origin/HEAD`, falling back to `main` or `master`. Failures produce warnings but don't block the workflow.
|
|
5
|
+
|
|
6
|
+
## Key Changes
|
|
7
|
+
|
|
8
|
+
### Types (`src/types/config.ts`)
|
|
9
|
+
- Added `syncMainBranch: boolean` to `RafConfig` interface
|
|
10
|
+
- Added default `syncMainBranch: true` to `DEFAULT_CONFIG`
|
|
11
|
+
|
|
12
|
+
### Config Utilities (`src/utils/config.ts`)
|
|
13
|
+
- Added `syncMainBranch` to `VALID_TOP_LEVEL_KEYS` set
|
|
14
|
+
- Added validation for `syncMainBranch` (must be boolean)
|
|
15
|
+
- Added `syncMainBranch` handling in `deepMerge()` function
|
|
16
|
+
- Added `getSyncMainBranch()` accessor function
|
|
17
|
+
|
|
18
|
+
### Worktree Utilities (`src/core/worktree.ts`)
|
|
19
|
+
- Added `SyncMainBranchResult` interface for sync operation results
|
|
20
|
+
- Added `detectMainBranch(cwd?)` function:
|
|
21
|
+
- Detects main branch from `refs/remotes/origin/HEAD`
|
|
22
|
+
- Falls back to `main` or `master` if origin/HEAD not set
|
|
23
|
+
- Added `pullMainBranch(cwd?)` function:
|
|
24
|
+
- When not on main: fetches `origin main:main` (updates local ref directly)
|
|
25
|
+
- When on main: runs `git fetch` + `git merge --ff-only`
|
|
26
|
+
- Handles uncommitted changes, diverged branches, and network errors gracefully
|
|
27
|
+
- Added `pushMainBranch(cwd?)` function:
|
|
28
|
+
- Pushes main branch to origin
|
|
29
|
+
- Handles "already up-to-date" and rejection errors gracefully
|
|
30
|
+
|
|
31
|
+
### Plan Command (`src/commands/plan.ts`)
|
|
32
|
+
- Imported `getSyncMainBranch` and `pullMainBranch`
|
|
33
|
+
- Added main branch sync before worktree creation in `runPlanCommand()` for fresh worktrees
|
|
34
|
+
- Added main branch sync before worktree creation in `runAmendCommand()` for recreated worktrees
|
|
35
|
+
|
|
36
|
+
### Do Command (`src/commands/do.ts`)
|
|
37
|
+
- Imported `getSyncMainBranch`, `pullMainBranch`, and `pushMainBranch`
|
|
38
|
+
- Added main branch sync before worktree operations in `runDoCommand()`
|
|
39
|
+
- Added main branch push before PR creation in `executePostAction()` for the 'pr' case
|
|
40
|
+
|
|
41
|
+
### Documentation
|
|
42
|
+
- Updated `src/prompts/config-docs.md`:
|
|
43
|
+
- Added `syncMainBranch` section with description
|
|
44
|
+
- Updated validation rules to include `syncMainBranch`
|
|
45
|
+
- Updated full example config to include `syncMainBranch: true`
|
|
46
|
+
- Updated `CLAUDE.md`:
|
|
47
|
+
- Added `syncMainBranch` to config schema list
|
|
48
|
+
- Added `getSyncMainBranch()` to helper accessors list
|
|
49
|
+
|
|
50
|
+
### Tests
|
|
51
|
+
- `tests/unit/config.test.ts`:
|
|
52
|
+
- Added import for `getSyncMainBranch`
|
|
53
|
+
- Added test for rejecting non-boolean `syncMainBranch`
|
|
54
|
+
- Added test for accepting boolean `syncMainBranch` values
|
|
55
|
+
- Added test for overriding `syncMainBranch` in config
|
|
56
|
+
- Added test for default `syncMainBranch` value (true)
|
|
57
|
+
- `tests/unit/worktree.test.ts`:
|
|
58
|
+
- Added imports for `detectMainBranch`, `pullMainBranch`, `pushMainBranch`
|
|
59
|
+
- Added 5 tests for `detectMainBranch()`:
|
|
60
|
+
- Detecting from origin/HEAD
|
|
61
|
+
- Detecting master from origin/HEAD
|
|
62
|
+
- Falling back to main
|
|
63
|
+
- Falling back to master when main doesn't exist
|
|
64
|
+
- Returning null when no main branch found
|
|
65
|
+
- Added 7 tests for `pullMainBranch()`:
|
|
66
|
+
- Error when main branch cannot be detected
|
|
67
|
+
- Fetching main when not on main branch
|
|
68
|
+
- Warning when local main has diverged
|
|
69
|
+
- Failing when on main with uncommitted changes
|
|
70
|
+
- Pulling successfully when on main with no changes
|
|
71
|
+
- Reporting no changes when already up to date
|
|
72
|
+
- Failing when branch has diverged
|
|
73
|
+
- Added 4 tests for `pushMainBranch()`:
|
|
74
|
+
- Error when main branch cannot be detected
|
|
75
|
+
- Pushing successfully
|
|
76
|
+
- Reporting no changes when already up to date
|
|
77
|
+
- Failing when push is rejected
|
|
78
|
+
- `tests/unit/post-execution-picker.test.ts`:
|
|
79
|
+
- Updated worktree mock to include `pullMainBranch`, `pushMainBranch`, and `detectMainBranch`
|
|
80
|
+
|
|
81
|
+
## Acceptance Criteria Verification
|
|
82
|
+
- [x] Main branch is pulled from remote before worktree creation (when `syncMainBranch: true`)
|
|
83
|
+
- [x] Main branch is pushed to remote before PR creation (when `syncMainBranch: true`)
|
|
84
|
+
- [x] Main branch name is auto-detected from `origin/HEAD`
|
|
85
|
+
- [x] `syncMainBranch: false` skips both operations
|
|
86
|
+
- [x] Failures in push/pull produce warnings but don't block the workflow
|
|
87
|
+
- [x] Config validation accepts the new key
|
|
88
|
+
- [x] Config docs updated
|
|
89
|
+
|
|
90
|
+
## Notes
|
|
91
|
+
- The pre-existing test failures in `claude-runner-interactive.test.ts` and `validation.test.ts` are unrelated to this change - they concern model resolution expecting short aliases but receiving full model IDs
|
|
92
|
+
- When not on the main branch, the pull uses `git fetch origin main:main` which directly updates the local ref without checking out the branch, avoiding disruption to the user's current work
|
|
93
|
+
- When on the main branch, uncommitted changes will block the pull to prevent data loss
|
|
94
|
+
- The push operation is simple and will fail gracefully if the local main has diverged from remote (requires manual resolution)
|
|
95
|
+
|
|
96
|
+
<promise>COMPLETE</promise>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Outcome: Sync README with Codebase (Critical Items)
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
Fixed critical discrepancies between README.md and the actual codebase implementation, focusing on worktree mode documentation.
|
|
5
|
+
|
|
6
|
+
## Key Changes
|
|
7
|
+
|
|
8
|
+
### README.md
|
|
9
|
+
|
|
10
|
+
1. **Removed `--merge` flag references**
|
|
11
|
+
- Removed from usage example: `raf do my-feature -w --merge` → `raf do my-feature -w`
|
|
12
|
+
- Removed from Command Reference table for `raf do`
|
|
13
|
+
- Updated example description to mention picker will ask what to do after
|
|
14
|
+
|
|
15
|
+
2. **Documented post-execution action picker**
|
|
16
|
+
- Added new "Post-execution picker" section under Worktree Mode
|
|
17
|
+
- Documented all three options:
|
|
18
|
+
- "Merge into current branch" — merges with fast-forward preferred
|
|
19
|
+
- "Create a GitHub PR" — pushes branch and creates PR
|
|
20
|
+
- "Leave branch as-is" — keeps branch for later
|
|
21
|
+
- Clarified that picker appears BEFORE task execution
|
|
22
|
+
- Noted that action is skipped on task failure
|
|
23
|
+
|
|
24
|
+
3. **Documented PR creation feature**
|
|
25
|
+
- Added new "PR creation" section under Worktree Mode
|
|
26
|
+
- Documented prerequisites: `gh` CLI installed and authenticated
|
|
27
|
+
- Documented auto-detection of base branch from `origin/HEAD`
|
|
28
|
+
- Documented PR title generation from project name
|
|
29
|
+
- Documented Claude-powered PR body generation
|
|
30
|
+
- Documented fallback behavior when `gh` is unavailable
|
|
31
|
+
|
|
32
|
+
4. **Fixed worktree cleanup description**
|
|
33
|
+
- Changed "Worktrees persist after completion — clean them up manually" to "After successful post-actions (merge, PR, or leave), the worktree directory is cleaned up automatically — the git branch is preserved"
|
|
34
|
+
- Clarified that on task failure, the worktree is kept for inspection
|
|
35
|
+
- Updated Basic workflow example to remove `--merge` flag
|
|
36
|
+
|
|
37
|
+
## Acceptance Criteria Verification
|
|
38
|
+
- [x] No references to `--merge` flag remain in README
|
|
39
|
+
- [x] Post-execution action picker is documented with all three options
|
|
40
|
+
- [x] PR creation from worktree is documented including prerequisites
|
|
41
|
+
- [x] Worktree cleanup behavior is accurately described
|
|
42
|
+
- [x] All CLI examples use valid, existing flags
|
|
43
|
+
- [x] README reads naturally and doesn't feel patched
|
|
44
|
+
|
|
45
|
+
<promise>COMPLETE</promise>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Outcome: Add --no-session-persistence to Throwaway Claude Calls
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
Added `--no-session-persistence` flag to PR body generation and failure analysis Claude calls to prevent them from polluting the user's session history (`claude --resume`). This matches the existing pattern in `name-generator.ts`.
|
|
5
|
+
|
|
6
|
+
## Key Changes
|
|
7
|
+
|
|
8
|
+
### `src/core/pull-request.ts`
|
|
9
|
+
- Added `'--no-session-persistence'` to the spawn args in `callClaudeForPrBody()` (line 371)
|
|
10
|
+
- Flag is placed after `--model` and before `--dangerously-skip-permissions`
|
|
11
|
+
|
|
12
|
+
### `src/core/failure-analyzer.ts`
|
|
13
|
+
- Added `'--no-session-persistence'` to the spawn args in `callClaudeForAnalysis()` (line 314)
|
|
14
|
+
- Flag is placed after `--model` and before `--dangerously-skip-permissions`
|
|
15
|
+
|
|
16
|
+
## Acceptance Criteria Verification
|
|
17
|
+
- [x] PR body generation sessions don't appear in `claude --resume`
|
|
18
|
+
- [x] Failure analysis sessions don't appear in `claude --resume`
|
|
19
|
+
- [x] Both features still function correctly (output unchanged) - all 97 related tests pass
|
|
20
|
+
- [x] Pattern matches the existing implementation in `name-generator.ts`
|
|
21
|
+
|
|
22
|
+
## Notes
|
|
23
|
+
- The `--no-session-persistence` flag only works with `-p` (print mode), which both call sites already use
|
|
24
|
+
- This is a minimal two-line change (one per file) with no behavioral changes to the output
|
|
25
|
+
|
|
26
|
+
<promise>COMPLETE</promise>
|