Skip to content

refactor(deprecation): Vec<DeprecationKind> + config-table combinators - #2946

Merged
max-sixty merged 2 commits into
mainfrom
deprecation-refactor
May 30, 2026
Merged

max-sixty merged 2 commits into
mainfrom
deprecation-refactor

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Two behavior-neutral refactors of the config-deprecation layer (src/config/deprecation.rs). No warning text, migration output, or snapshot changes — the full pre-merge gate is green.

1. Deprecations struct → Vec<DeprecationKind>. Each detected pattern becomes a DeprecationKind variant carrying exactly the payload its warning needs. format_deprecation_warnings collapses from one if-block per field (~127 lines) into a single match over the kinds, and is_empty is now just Vec::is_empty(). detect_deprecations_from_doc pushes kinds in warning-emission order, so iterating the Vec reproduces the prior output byte-for-byte. The silent -create → -start hook rename deliberately gets no variant, so it still emits no warning. The approved_commands field read in wt config update becomes a matches!(k, DeprecationKind::ApprovedCommands) predicate.

2. Config-table scope walks → two combinators. The repeated "top-level + per-project" walk (~10 sites) is replaced by any_config_table (detect, short-circuits on first true) and for_each_config_table_mut (migrate, ORs per-scope changes). The closure receives the scope key (None for top-level, Some(key) for [projects.*]) so callers can build display paths. find_approved_commands_from_doc and remove_approved_commands_doc stay bespoke — neither fits the combinator shape cleanly.

CLAUDE.md's "add a deprecation" checklist is updated to match the new shape (and fixes a stale migrate_negated_bool_in_section reference).

This was written by Claude Code on behalf of max

max-sixty and others added 2 commits May 28, 2026 20:14
…tors

Replace the repeated "top-level + per-project" config-table walk (~10
sites) with two combinators: `any_config_table` (detect, short-circuits
on first true) and `for_each_config_table_mut` (migrate, ORs per-scope
changes). The closure receives the scope key (`None` for top-level,
`Some(key)` for `[projects.*]`) so callers can build display paths.

`find_approved_commands_from_doc` (projects-only) and
`remove_approved_commands_doc` (two-phase collect/remove that also empties
the `[projects]` table) stay bespoke — neither fits cleanly.

Behavior-neutral: full gate green, all warning text unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…onKind>

`Deprecations` becomes `Vec<DeprecationKind>`, where each variant carries
the display payload its warning needs. `format_deprecation_warnings`
collapses from one if-block per field (~127 lines) to a single match over
the kinds, and `is_empty` is now just `Vec::is_empty()`. Kinds are pushed
in `detect_deprecations_from_doc` in warning-emission order, so iterating
the Vec reproduces the prior output byte-for-byte.

The commit-generation kind keeps its `CommitGenerationDeprecations`
payload (top-level flag + project keys). The silent `-create` → `-start`
rename gets NO variant, so it still emits no warning. The
`approved_commands` field read in `wt config update` becomes a
`matches!(k, DeprecationKind::ApprovedCommands)` predicate.

Test sites that asserted on individual fields now query the Vec via a
`has_kind` helper or build it with explicit kinds. CLAUDE.md's "add a
deprecation" checklist is updated for the new shape (also fixes a stale
`migrate_negated_bool_in_section` reference).

Behavior-neutral: full gate green, no warning text or snapshot changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 3549f21 into main May 30, 2026
35 checks passed
@max-sixty
max-sixty deleted the deprecation-refactor branch May 30, 2026 21:46
@max-sixty max-sixty mentioned this pull request Jun 2, 2026
max-sixty added a commit that referenced this pull request Jun 2, 2026
v0.56.0.

`cargo semver-checks` reports a breaking library API change: the config-deprecation refactor (#2946) replaced the public `Deprecations` struct with a `Vec<DeprecationKind>` alias, removing the struct shape. Not intentional public API, but it forces a minor bump pre-1.0.

## CHANGELOG

### Improved

- **`wt list` JSON output includes `repo_url`**: Each item now carries `repo_url`, the repository's web URL derived from the primary remote (absent when there's no parseable forge remote). It's the local checkout's repo — distinct from `ci.repo_url`, which is the repo a PR/MR targets. ([#2941](#2941), thanks @bendrucker)

### Fixed

- **Bare-repo prompts**: Two UX fixes. `wt config create --project` run in a bare repo with no linked worktrees now explains the next step (`wt switch <branch>` first, then create from inside the worktree) instead of failing with a generic "no worktree found". And the bare-repo worktree-path prompt no longer fires for symbolic identifiers (`-`, `@`, `^`, `pr:`/`mr:`), where the example paths would be misleading — it waits for the next switch to a concrete branch name. ([#2951](#2951), thanks @ammachado)

- **Context gauge spacing in the Claude Code statusline**: The context-gauge moon emoji rendered flush against the percent (`🌕42%`). Most terminals draw the emoji double-width and bleed it into the next cell, so the moon collided with the digits; it now carries a trailing space (`🌕 42%`). ([#2944](#2944))

- **Console storm on Windows**: Detached background hook processes were created with `DETACHED_PROCESS`, which could flash a burst of console windows. They now use `CREATE_NO_WINDOW` and spawn fully hidden. ([#2959](#2959), thanks @nathanbabcock)

### Documentation

- **Codex commit-generation model bumped to `gpt-5.4-mini`**: The recommended `[commit.generation]` command for Codex — shown by `wt config create` and in the LLM-commits docs — now uses `gpt-5.4-mini` (was `gpt-5.1-codex-mini`). ([#2949](#2949))

### Internal

- **Config-deprecation layer refactor**: The deprecation detector now returns a `Vec<DeprecationKind>` instead of a struct of per-field flags, and the per-section config-table walks collapse into two combinators. Behavior-neutral — warning text and migration output are byte-for-byte unchanged. ([#2946](#2946))

> _This was written by Claude Code on behalf of max_
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
worktrunk 0.56.0

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## Release Notes

### Improved

- **`wt list` JSON output includes `repo_url`**: Each item now carries `repo_url`, the repository's web URL derived from the primary remote (absent when there's no parseable forge remote). It's the local checkout's repo — distinct from `ci.repo_url`, which is the repo a PR/MR targets. ([#2941](max-sixty/worktrunk#2941), thanks @bendrucker)

### Fixed

- **Bare-repo prompts**: Two UX fixes. `wt config create --project` run in a bare repo with no linked worktrees now explains the next step (`wt switch <branch>` first, then create from inside the worktree) instead of failing with a generic "no worktree found". And the bare-repo worktree-path prompt no longer fires for symbolic identifiers (`-`, `@`, `^`, `pr:`/`mr:`), where the example paths would be misleading — it waits for the next switch to a concrete branch name. ([#2951](max-sixty/worktrunk#2951), thanks @ammachado)

- **Context gauge spacing in the Claude Code statusline**: The context-gauge moon emoji rendered flush against the percent (`🌕42%`). Most terminals draw the emoji double-width and bleed it into the next cell, so the moon collided with the digits; it now carries a trailing space (`🌕 42%`). ([#2944](max-sixty/worktrunk#2944))

- **Console storm on Windows**: Detached background hook processes were created with `DETACHED_PROCESS`, which could flash a burst of console windows. They now use `CREATE_NO_WINDOW` and spawn fully hidden. ([#2959](max-sixty/worktrunk#2959), thanks @nathanbabcock)

### Documentation

- **Codex commit-generation model bumped to `gpt-5.4-mini`**: The recommended `[commit.generation]` command for Codex — shown by `wt config create` and in the LLM-commits docs — now uses `gpt-5.4-mini` (was `gpt-5.1-codex-mini`). ([#2949](max-sixty/worktrunk#2949))

### Internal

- **Config-deprecation layer refactor**: The deprecation detector now returns a `Vec<DeprecationKind>` instead of a struct of per-field flags, and the per-section config-table walks collapse into two combinators. Behavior-neutral — warning text and migration output are byte-for-byte unchanged. ([#2946](max-sixty/worktrunk#2946))

## Install worktrunk 0.56.0

### Install prebuilt binaries via shell script

```sh
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-installer.sh | sh && wt config shell install
```

### Install prebuilt binaries via powershell script

```sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-installer.ps1 | iex"; git-wt config shell install
```

### Install prebuilt binaries via Homebrew

```sh
brew install worktrunk && wt config shell install
```

## Download worktrunk 0.56.0

|  File  | Platform | Checksum |
|--------|----------|----------|
| [worktrunk-aarch64-apple-darwin.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-aarch64-apple-darwin.tar.xz.sha256) |
| [worktrunk-x86_64-apple-darwin.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-x86_64-apple-darwin.tar.xz) | Intel macOS | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-x86_64-apple-darwin.tar.xz.sha256) |
| [worktrunk-x86_64-pc-windows-msvc.zip](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-x86_64-pc-windows-msvc.zip) | x64 Windows | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-x86_64-pc-windows-msvc.zip.sha256) |
| [worktrunk-aarch64-unknown-linux-musl.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-aarch64-unknown-linux-musl.tar.xz) | ARM64 MUSL Linux | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-aarch64-unknown-linux-musl.tar.xz.sha256) |
| [worktrunk-x86_64-unknown-linux-musl.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-x86_64-unknown-linux-musl.tar.xz) | x64 MUSL Linux | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.56.0/worktrunk-x86_64-unknown-linux-musl.tar.xz.sha256) |



### Install via Cargo

```sh
cargo install worktrunk && wt config shell install
```

### Install via Winget (Windows)

```sh
winget install max-sixty.worktrunk && git-wt config shell install
```

### Install via AUR (Arch Linux)

```sh
paru worktrunk-bin && wt config shell install
```
</pre>
  <p>View the full release notes at <a href="https://github.com/max-sixty/worktrunk/releases/tag/v0.56.0">https://github.com/max-sixty/worktrunk/releases/tag/v0.56.0</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!10277
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants