Repository navigation
feat(config): add codename template filter - #2641
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: abf463d495
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
abf463d to
aa97250
Compare
aa97250 to
d4c5df8
Compare
worktrunk-bot
left a comment
There was a problem hiding this comment.
A few small consistency suggestions on the new docs entries — every other bullet in the "Available template variables" list uses — as the separator, but the new codename(2) line uses :. Easier to keep them parallel. Same in the doc comment in expansion.rs.
Otherwise the change looks solid: SHA-256 with explicit u64::to_le_bytes for cross-arch stability is a nice touch, and the test_codename_outputs_are_stable pin test (with the prominent "do not silence me" comment) does exactly what's needed once users adopt this in their worktree-path.
One minor observation, not blocking: there are 6 words that appear in both CODENAME_ADJECTIVES and CODENAME_NOUNS (cedar, dawn, hazel, hollow, maple, marble). It is therefore possible — though rare — for codename(2) to render something like maple-maple. If you'd rather avoid that, you could either drop the overlapping entries from one list or special-case "adjective == noun" in codename(). Up to you; locking the wordlists in via the pin test is a good place to make that call before the first release that ships the filter.
Co-authored-by: Worktrunk Bot <[email protected]>
Co-authored-by: Worktrunk Bot <[email protected]>
Co-authored-by: Worktrunk Bot <[email protected]>
worktrunk-bot
left a comment
There was a problem hiding this comment.
CI is failing on test (linux), test (macos), and code-coverage — the snapshots and synced docs need to be regenerated after the : → — edit in src/cli/mod.rs.
Failing tests:
integration_tests::help::test_help::case_05(snapshothelp_config_long)integration_tests::help::test_help::case_18(snapshothelp_config_create)integration_tests::readme_sync::test_docs_are_in_sync—docs/content/config.mdandskills/worktrunk/reference/config.mdare out of sync
Per CLAUDE.md, after editing after_long_help:
cargo insta test --accept -- --test integration "test_help"
cargo test --test integration test_docs_are_in_sync
Sorry for not flagging this when I suggested the change — happy to push a fix commit if that's easier than running it locally.
CI failed - snapshots and synced docs need regeneration after the suggested edit
The codename template filter bullet in src/cli/mod.rs and dev/config.example.toml uses an em-dash like the surrounding bullets, but the generated docs and help snapshots still had the original colon.
|
great idea @endigma ! thank you! couple of questions:
|
|
On the wordlist question — Concrete sizes (verified against each repo's data files)
The catch with using a crate directly: So I'd lean toward your "write them out ourselves" instinct, just at a larger size. The headroom is non-linear: bumping each list to ~500 (roughly 3× the current count, well within hand-curation) gives ~250k combos for One small thing worth keeping regardless of list size: the 6-word adjective/noun overlap I flagged earlier ( |
(this is fine as-is, fwiw) I'll let @endigma decide on the questions above |
…licates (#395) ## Outcome evidence `tend-review` run [25499066953](https://github.com/max-sixty/worktrunk/actions/runs/25499066953) on worktrunk PR [#2641](max-sixty/worktrunk#2641) posted **two `APPROVED` reviews 4 seconds apart** from a single completed session — review [4244431335](max-sixty/worktrunk#2641 (review)) at 13:35:57Z and [4244431873](max-sixty/worktrunk#2641 (review)) at 13:36:01Z, both empty-body, both on the same head SHA `55ef4fba`. Only one `tend-review` run touched this SHA, so this is not the documented concurrency-cancel `Non-issue` (no SIGTERM'd siblings here). Decision chain in session log `bcfcce99-ae59-4201-a411-fe82f2b074bc.jsonl`: 1. **13:35:55Z** — bot ran a guarded combined script: `read CURRENT_HEAD/PR_STATE`, HEAD-match check, OPEN-state check, `ALREADY_POSTED` check, then `gh pr review 2641 --approve -b ""` as the script's last command. The first `APPROVED` posted at 13:35:57Z. Tool-result showed only the prelude's `echo` lines (`CURRENT_HEAD=… PR_STATE=OPEN ALREADY_POSTED=`); the approve itself produces no stdout on success. 2. **13:36:00Z** (5s later) — bot issued a bare standalone `gh pr review 2641 --approve -b ""` with no preceding text. The second `APPROVED` posted at 13:36:01Z. 3. **13:36:04Z** — bot queried `reviews[-1]`, saw the latest entry was `APPROVED`, and wrote "Approval posted on HEAD" (singular) to the conversation log, never noticing the duplicate. The prelude's silence was indistinguishable from "approve didn't fire", so the model retried "to be sure". ## Root cause The `### 5. Submit` recipe in `plugins/tend-ci-runner/skills/review/SKILL.md` shows `gh pr review --approve -b ""` with no positive confirmation. `gh pr review --approve` is silent on success, so combining it into a guarded script (where the only stdout is the prelude's `echo`) leaves the model with no visible success signal. The retry follows. ## Fix Append `&& echo "✓ approved"` to the recipe so the tool-result shows explicit confirmation, and add one sentence explaining why future maintainers should not strip the echo as cosmetic noise. One-line code change, one sentence of explanation. ## Gate assessment Evidence: https://gist.github.com/9675d1510da32c68a68c1d45137b21e0 (current month) plus prior month's gist `44ab1483b29406255dd36141650c894d`. Three cumulative occurrences of single-session duplicate-review-POST across the past two months, all from `tend-review` sessions, all on `worktrunk`: | Date | Run | PR | Review type | Notes | |---|---|---|---|---| | 2026-04-29 | [25089599666](https://github.com/max-sixty/worktrunk/actions/runs/25089599666) | [#2454](max-sixty/worktrunk#2454) (Dependabot) | 2 × `APPROVED`, empty-body | Same combined-script-then-bare-retry shape; explicitly proposed `&& echo` as the fix | | 2026-05-06 | [25454510442](https://github.com/max-sixty/worktrunk/actions/runs/25454510442) | [#1320](max-sixty/worktrunk#1320) | 2 × `COMMENTED`, byte-identical 2476-byte bodies | Different verb path (`gh api .../reviews POST`) but same single-session-duplicate-POST signature | | 2026-05-07 | [25499066953](https://github.com/max-sixty/worktrunk/actions/runs/25499066953) | [#2641](max-sixty/worktrunk#2641) | 2 × `APPROVED`, empty-body | This run; recipe-level `--approve` shape, identical to the April 29 case | - **Classification**: stochastic (model has decision points; not every replay would retry). Restricted to the recipe-level `--approve` shape: 2 cumulative occurrences (April 29, today). Across the broader single-session-duplicate-POST family: 3 occurrences. - **Gate 1 (Confidence)**: stochastic with 3 cumulative occurrences ≥ High threshold (2-3). For the narrower `--approve`-only shape, 2 occurrences also meets the High threshold. - **Gate 2 (Magnitude)**: targeted recipe fix (one line of code, one sentence of explanation) — Normal evidence bar, met by Gate 1 outcome. - **Both gates pass**, with the April 29 entry's own forward statement: "if a second occurrence appears … warrant a PR even at the stochastic tier (and 2 would also satisfy the 'High' 2-3 threshold)." ## Why now The April 29 entry recorded the exact same root cause and the exact same fix this PR applies, and put the bot on a watch-list pending a second occurrence. Today's run on PR #2641 is that second `--approve` occurrence (third cumulative across all single-session duplicate review shapes). The watch-list has tripped. ## Why not broader Scope is constrained to the `--approve` recipe because that is where the evidence concentrates and where the call site is unambiguous. The COMMENTED API path (`gh api .../reviews POST`) returns JSON on success, so the silent-success-retry mechanism does not apply directly there; if its single occurrence recurs, a follow-up PR can address that path. Same for `gh api .../dismissals -X PUT` — referenced in the new explanatory sentence as guidance, not modified directly. Smallest change that addresses the observed pattern. --------- Co-authored-by: tend-agent <[email protected]> Co-authored-by: Claude Opus 4.7 <[email protected]>
|
@max-sixty its so the directory name isn't the branch name, which can be really annoying and long for some branch naming conventions (e.g. ticket number + full sanitized title) and also my prompt already writes the branch name |
ah that makes sense. that's a clever approach I think let's try using @worktrunk-bot could you make this change, and @endigma can say if they would prefer not to |
Replaces the in-tree adjective/noun arrays (174/177, ~30k codename(2)
combos) with petname::Petnames::medium() (1198/1052, ~1.26M combos), so
`{{ branch | codename(2) }}` rarely collides on its own. Drops the
recommendation to pair codename with `| hash` from the worktree-path docs
and examples, per discussion in max-sixty#2641.
petname is pinned `=3.0.0` because a version bump that adds, removes, or
reorders words would silently change every existing user's
codename-derived `worktree-path` and orphan their on-disk worktrees.
test_codename_outputs_are_stable continues to pin the on-disk contract;
its expected values are updated for the new wordlists.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Done in 9fc5243. Switched to The @endigma — happy to revert if you'd rather keep the in-tree lists; the change is contained. |
|
Leaving the approval in place per the running-tend self-dismiss policy. The required |
|
Bigger wordlist is good in my book, I was probably going to run codename(2) with no hash anyway lol In the unlikely event of a collision, does everything error out clean so the user could just pick an ever so slightly different branch name? @worktrunk-bot can you answer this? |
|
Yep, clean error and safe to retry. The collision check runs in the planning phase, before The user-facing message (from
So if |
|
Cool bot, does this need anything else to be merged @max-sixty ? |
Bump worktrunk to **0.49.0** — minor bump (semver-checks reports a
breaking change in `GitError::UncommittedChanges`, which gained a
`dirty_files: Vec<String>` field).
## Highlights
**Improved**
- New `codename(n)` template filter — deterministic friendly worktree
names from a ~1.26M-combo pool (`{{ branch | codename(2) }}` →
`malleable-opah`).
[#2641](#2641), thanks
@endigma
- Picker preview disk cache for Log / BranchDiff / UpstreamDiff, with
background refresh for stale Log decorations.
[#2628](#2628),
[#2646](#2646)
- Picker shares one `default_branch_sha` lookup across BranchDiff items
instead of forking N rev-parse subprocesses.
[#2658](#2658)
- "X has uncommitted changes" errors now list the dirty files inline.
[#2653](#2653)
**Fixed**
- `wt switch` integrates with `cd` aliases like zoxide (uses `builtin
cd`). [#2644](#2644), thanks
@xkumiyu for reporting
- Empty hook tables no longer panic during `wt switch --create`.
[#2635](#2635), thanks @topit
for reporting
- `Repository::current_worktree()` and five sibling helpers no longer
silently leak the process CWD when called via `Repository::at(p)`.
[#2652](#2652)
- `WorkingTree::is_linked` tolerates non-git CWDs (e.g. Nix sandbox).
[#2625](#2625), thanks
@DArtagan for reporting
- Picker no longer overlays `collect` warnings on the active TUI; clears
its frame on exit in inline mode.
[#2627](#2627),
[#2626](#2626)
- Failed `git log` no longer poisons the picker's preview disk cache.
[#2651](#2651)
- `wt step prune` says "removing branch" for branch-only candidates.
[#2619](#2619)
- Claude Code Windows integration uses a `wt.sh` wrapper to avoid
colliding with Windows Terminal's `wt.exe`.
[#1754](#1754), thanks
@lucaspimentel
**Documentation**
- cmux workspace integration recipe.
[#1907](#1907), thanks
@alvistar
See
[CHANGELOG.md](https://github.com/max-sixty/worktrunk/blob/release/CHANGELOG.md)
for the full list including internal CI / test-isolation changes.
## Test plan
- [x] `cargo run -- hook pre-merge --yes` (tests + lints clean)
- [x] `cargo semver-checks check-release -p worktrunk` (one breaking
change confirmed → minor bump)
- [x] CHANGELOG entries verified by subagent against actual diffs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
codename(n)filter for generating friendly names deterministically