Repository navigation
feat(hooks)\!: rename pre-start/post-start to pre-create/post-create - #2359
Closed
worktrunk-bot wants to merge 2 commits into
Closed
worktrunk-bot wants to merge 2 commits into
worktrunk-bot wants to merge 2 commits into
Conversation
Closes #1571. The previous rename from post-create → pre-start (v0.32.0) was intended to clarify blocking vs. background semantics, but the `-start` suffix stayed confusing — "start" of what? This finishes the job by renaming around the natural axis: "pre-create" blocks before worktree creation, "post-create" runs after in the background. Canonical names (old → new): - pre-start → pre-create (blocking, runs before worktree exists) - post-start → post-create (background, runs after switch) Deprecation is consistent with existing patterns: TOML migration in `src/config/deprecation.rs` rewrites old keys before serde sees them, `wt config update` emits a `.new` file with migrated content, and CLI `wt hook pre-start` continues to work as an alias for backward compat. Known silent-flip risk: user configs with the previous deprecated `post-create` alias (which meant blocking under the pre-start canonical name) will now parse as the new canonical post-create (background). The deprecated alias has been gone long enough that few configs are expected to still use it; maintainer has accepted the risk. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Co-Authored-By: Claude Opus 4.7 <[email protected]>
Collaborator
Author
|
Closing in favor of the two-PR sequence per @max-sixty's choice in #1571 (comment). Superseded by upcoming PR to convert the |
4 tasks done
max-sixty
pushed a commit
to max-sixty/tend
that referenced
this pull request
Apr 21, 2026
## Summary Extend the bang-escape workaround in `running-in-ci` to cover PR and issue titles. PR #318 restored the warning for comment bodies (via `--body-file`); titles are still uncovered because `gh pr create` has no `--title-file` flag, so a conventional-commits breaking-change marker in a title like `feat(hooks)` followed by `!:` gets preprocessor-rewritten and ships with a literal backslash before the bang. ## Evidence First wild post-#318 occurrence: `worktrunk-bot` opened [max-sixty/worktrunk#2359](max-sixty/worktrunk#2359) at 2026-04-21T18:40:19Z. Raw API confirms the title is stored with a backslash before the bang: ``` $ gh api repos/max-sixty/worktrunk/pulls/2359 --jq '.title' | cat -A feat(hooks)\!: rename pre-start/post-start to pre-create/post-create$ ``` The corresponding commit message on the same branch is clean — `git commit` uses `-F`/file internally, so the `!` survives there. Only `gh pr create --title "feat(hooks)!: ..."` hit the preprocessor. ## Fix Add one paragraph after the existing `--body-file` guidance documenting the command-substitution workaround. `$(cat /tmp/pr-title.txt)` is evaluated by bash after the preprocessor's string scan, so the bang in the file stays literal. Same pattern covers `gh pr edit --title`, `gh issue create --title`, and `gh issue edit --title`. ## Gate assessment - **Evidence level**: Critical — public-facing PR title corruption, 1 occurrence (#2359). - **Cumulative this month**: prior occurrence was in a comment body ([worktrunk#2309](max-sixty/worktrunk#2309 (comment))) which PR #318 fixed; this is a different shape not yet covered. - **Structural vs. stochastic**: structural. Any bot PR with `!` in its title reproduces deterministically until the skill documents the workaround. - **Change type**: targeted fix (one paragraph, no structural changes). - **Both gates pass**: Critical + structural + proportionate fix. Evidence gist: [review-reviewers evidence: max-sixty/worktrunk 2026-04](https://gist.github.com/44ab1483b29406255dd36141650c894d). Triggering run: https://github.com/max-sixty/tend/actions/runs/24741474472 Co-authored-by: continuous-bot <[email protected]> Co-authored-by: Claude Opus 4.7 <[email protected]>
max-sixty
pushed a commit
that referenced
this pull request
Apr 22, 2026
…2361) ## Summary - Converts the `post-create` → `pre-start` silent migration into a fatal load error. Paves the way to later reclaim `post-create` as a background-semantics counterpart to `post-start` without the silent flip risk. - Project config: rejects with `ConfigError`. User config: surfaces as `LoadError::Validation` and best-effort load continues without the file. - `wt config show` renders the error inline instead of hiding it. Marked as **draft for consideration** — this is step 1 of the two-PR sequence discussed in [#1571 (comment)](#1571 (comment)). A follow-up PR (one release later) would perform the actual `pre-start` → `pre-create` / `post-start` → `post-create` rename. Supersedes the closed [#2359](#2359). ## Test plan - [x] `cargo test --lib --bins` (601 passing) - [x] `cargo test --test integration` (1540 passing; 10 `case_4` failures are local `nu`-not-installed environmental, unrelated to this PR) - [x] `cargo clippy --all-targets --all-features` clean - [x] New integration tests: `test_post_create_in_project_config_is_fatal` and `test_post_create_in_user_config_warns_and_skips` --------- Co-authored-by: worktrunk-bot <[email protected]> Co-authored-by: Claude Opus 4.7 <[email protected]>
This was referenced Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1571. Renames hook names around the natural blocking-vs-background axis:
pre-start→pre-create(blocking, before worktree exists)post-start→post-create(background, after switch)The previous
post-create → pre-startrename (v0.32.0) clarified blocking vs. background, but "start" stayed ambiguous — start of what? This finishes the job:pre-createblocks before creation,post-createruns after in the background.Deprecation strategy (matches existing patterns)
src/config/deprecation.rs): pre-serde rewrite ofpre-start→pre-createandpost-start→post-create, both flat (pre-start = "...") and table ([pre-start]) forms.wt config update: writes a.newfile with migrated content and a deprecation warning.wt hook pre-start/post-startcontinue to work.Silent-flip risk
User configs with the previous deprecated
post-createalias (which meant blocking, under the pre-start canonical name) will now parse as the new canonicalpost-create(background). The deprecated alias has been gone long enough that few configs are expected to still use it, and the maintainer has accepted this risk per the request in #1571.Test plan
cargo test --test integration— 1540 passedcargo test --lib --bins— all passcargo fmt+cargo clippy— cleancargo test --features shell-integration-tests— passes minus pre-existing nushell (case_4) failures due tonunot installed in this environment (confirmed pre-existing on main).Marked draft for consideration per issue #1571.
🤖 Generated with Claude Code