Repository navigation
refactor(tests): remove byte-normalization snapshot filters - #3061
Merged
Merged
Conversation
…shots show true ANSI Remove four snapshot-filter hacks that rewrote captured bytes for claimed cross-platform consistency, so committed snapshots now show the bytes the binary actually emits: - The line-final ANSI reset filters in setup_snapshot_settings (#125 claimed "Windows terminal strips trailing resets that Unix includes"). Snapshot tests capture pipes, and anstream's AutoStream::always() only takes the wincon path when the stream is a terminal — piped bytes are ANSI pass-through on every platform, and that was already true of anstream 0.6.21 in use when #125 landed. These filters meant committed snapshots could never show the closing reset, which misled PR #3056 into chasing a dim-bleed that existed only in filtered snapshot bytes. - readme_sync's ensure_line_resets, which re-added the stripped resets before ANSI→HTML conversion. With snapshots carrying their real resets it is a no-op: all 13 readme_sync tests pass against the committed docs without it. ensure_line_resets_with_carry stays — it compensates for clap resetting styles at wrap points in live --help-md output, which is unrelated to snapshot filtering. - The tree-sitter green-path normalization filters. They no longer match anything: removing them changes zero bytes in regenerated snapshots on macOS (the gutter grammar they were anchored on predates #3056's end-lines-at-content change). - The leading-reset strips in add_pty_filters and statusline's claude_code_snapshot_settings. The leading \x1b[0m is the binary's own deterministic write (reset before streaming child output / statusline prefix), not PTY-generated variance. Windows and Linux CI on this PR are the arbiters for the cross-platform claims; if a platform genuinely diverges, the specific filter comes back narrowed to that case with the CI evidence cited. Snapshot churn is mechanical: ANSI-stripped bodies verified byte-identical pre/post; raw diffs confined to SGR sequences at line boundaries plus known env-header drift. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
worktrunk-bot
approved these changes
Jun 12, 2026
max-sixty
added a commit
that referenced
this pull request
Jun 14, 2026
The two wide colored-table snapshots were captured before merging main and missed two cosmetic changes the merge introduced: the per-row trailing ANSI reset (#3056/#3061) and dropped empty-valued env-header entries (#3037/#3063). Table content is unchanged; only the line-final `\x1b[0m` and the snapshot env block differ, matching every other wide list snapshot. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
social4hyq
pushed a commit
to social4hyq/homebrew-core
that referenced
this pull request
Sep 20, 2026
worktrunk 0.58.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 - **Table-form `pre-*` hooks run concurrently**: A multi-entry table hook (`[pre-merge]` with several keys) now runs its commands concurrently, completing the cut-over announced in v0.37.0: every hook type has one execution semantic, where table form is concurrent and pipeline form (`[[pre-merge]]` blocks) is serial. Configs that need ordering should use pipeline form; affected configs have warned on every invocation since v0.37.0, with `wt config update` offering a serial-preserving migration. Two adjacent inconsistencies are also gone: `wt hook <post-type>` foreground runs of multi-entry table hooks now run concurrently like their background counterpart, and single-entry table aliases write to stdout like the other alias spellings, so `wt <alias> | …` works for that spelling too. (Breaking: multi-entry table-form `pre-*` hooks no longer run serially) ([#3052](max-sixty/worktrunk#3052)) - **CI column shows the PR/MR number and review state**: The CI column in `wt list --full` and the statusline shows the branch's open PR/MR reference (`#3041` on GitHub/Gitea/Azure DevOps, `!3041` on GitLab) instead of a plain dot: colored by CI status, hyperlinked to the PR, dimmed when stale or draft. Review state folds into the color, with magenta for changes requested and cyan for awaiting review. `wt list --format=json` gains `ci.number` and `ci.review_state`. ([#3041](max-sixty/worktrunk#3041), [#3044](max-sixty/worktrunk#3044)) - **Hook and alias templates render when each step runs**: Templates are syntax-checked before the first step runs and rendered as each step executes, so `{{ vars.* }}` always reads fresh values and hooks and aliases share one expansion model. Two consequences: a pipeline step with an undefined variable fails when that step is reached (earlier steps run first), and a template error in a background hook surfaces in the hook log rather than failing the foreground command. The background runner also labels template errors the way the foreground does. ([#3042](max-sixty/worktrunk#3042), [#3047](max-sixty/worktrunk#3047)) - **`wt config state cache`**: The regenerable caches (CI status, branch summaries, git-command caches, hints, the `wt switch -` target) are consolidated under `wt config state cache`; `cache clear` drops them all without prompting, since everything regenerates. `wt config state clear`, which also wipes hand-authored markers and vars, now asks for confirmation; `--yes` skips, and non-interactive runs without `--yes` cancel. The `ci-status`, `hints`, and `previous-branch` subcommands are deprecated but still work. ([#3027](max-sixty/worktrunk#3027)) - **Statusline rate-limit segment**: Above 90% of the binding window the segment shows the used percentage (`95%(8:30am–1:30pm)`) instead of the pace ratio; near the cap, what's left matters more than the rate. The pace form drops the word "pace" (`2.9×(Tue–Tue 5pm)`), and `-vv` logs each window's inputs and selection to `.git/wt/logs/trace.log` so the binding-window choice can be reconstructed. ([#3057](max-sixty/worktrunk#3057), [#3053](max-sixty/worktrunk#3053), [#3029](max-sixty/worktrunk#3029)) - **`/wt-switch-create` branch name is optional**: The Claude Code plugin command picks a branch name from the task when none is given, and the skill's workflow is one route (create, then enter) with an error-driven fallback instead of three guarded paths. Worktrees created mid-session persist after the session ends. ([#3058](max-sixty/worktrunk#3058)) ### Fixed - **Plugin worktree hooks fail before side effects**: The Claude Code plugin's `WorktreeCreate`/`WorktreeRemove` hooks validate the payload before running `wt`; a malformed payload previously created a branch named `null` or could remove the wrong worktree. `wt remove`'s help now documents that the positional argument accepts a worktree path as well as a branch name. ([#3058](max-sixty/worktrunk#3058), [#3060](max-sixty/worktrunk#3060)) - **Waiting-for-input marker covers questions, permission prompts, and turn end**: The Claude Code plugin sets the 💬 marker on `AskUserQuestion`, permission requests, and turn end. Previously only the `Notification` event set it, which never fires for the built-in question picker (and on some platforms not for permission prompts), so the marker stayed 🤖 while Claude waited. Part of [#2916](max-sixty/worktrunk#2916). ([#3023](max-sixty/worktrunk#3023), thanks @Ismael for reporting) - **`wt list --help` no longer panics when piped**: With no detectable terminal width (output piped, `COLUMNS` unset), `wt list --help` panicked with a capacity overflow, and the post-commit diffstat truncated filenames to ~10 characters. Both now handle unknown width. ([#3040](max-sixty/worktrunk#3040)) - **Deprecation warnings match `wt config update`**: A config deprecation warning now fires exactly when `wt config update` would change the file. The old detection and migration logic had drifted in several places: `ff` and `no-ff` together silently dropped `no-ff`, a scalar `forge` key was overwritten by the `[ci]` migration, an empty `[ci] platform` migrated without warning, and an empty `approved-commands = []` could be removed by an unrelated update. ([#3055](max-sixty/worktrunk#3055)) - **Migrated `[forge]` keeps `[ci]`'s spot**: The `[ci]` → `[forge]` migration rendered the new section at the end of the file and could drop comments above `[ci]`; it now takes over `[ci]`'s position, comments included, so `wt config show` and `wt config update` diffs stay minimal. ([#3051](max-sixty/worktrunk#3051)) - **`wt config state get` is read-only**: The aggregate dump resolved (and re-cached) the default branch, so running it right after `clear` silently repopulated the cache, and on a cold clone it could hit the network. It now reports the cached value or `(none)`. `wt config state default-branch get` still resolves and caches. ([#3024](max-sixty/worktrunk#3024)) ### Documentation - **Reading vs resolving cached state**: `wt config state default-branch get` resolves and caches; the aggregate `wt config state get` only reports the cache. The help text and module docs now state the split. ([#3028](max-sixty/worktrunk#3028)) ### Internal - `wt switch`/`wt remove` orchestration moved from `main.rs` to their command modules, and the hook execution call chain lost two delegation layers. ([#3049](max-sixty/worktrunk#3049), [#3036](max-sixty/worktrunk#3036)) - Config deprecations are driven by a single rule table; each rule is one function that migrates and reports what it changed. ([#3045](max-sixty/worktrunk#3045), [#3055](max-sixty/worktrunk#3055)) - `terminal_width()` returns `Option<usize>` instead of a `usize::MAX` sentinel, making the no-width case a compile-time concern. ([#3043](max-sixty/worktrunk#3043)) - Snapshot tests regenerate identically across machines: host-specific paths are guarded, host-dependent env-block markers are normalized, and help snapshots share one settings builder. ([#3009](max-sixty/worktrunk#3009), [#3026](max-sixty/worktrunk#3026), [#3037](max-sixty/worktrunk#3037), [#3061](max-sixty/worktrunk#3061)) - Nightly CI runs lib tests across the full feature powerset. ([#3059](max-sixty/worktrunk#3059)) - MSRV bumped from 1.94 to 1.95. ([#2948](max-sixty/worktrunk#2948)) ## Install worktrunk 0.58.0 ### Install prebuilt binaries via shell script ```sh curl --proto '=https' --tlsv1.2 -LsSf https://github.com/max-sixty/worktrunk/releases/download/v0.58.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.58.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.58.0 | File | Platform | Checksum | |--------|----------|----------| | [worktrunk-aarch64-apple-darwin.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.58.0/worktrunk-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.58.0/worktrunk-aarch64-apple-darwin.tar.xz.sha256) | | [worktrunk-x86_64-apple-darwin.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.58.0/worktrunk-x86_64-apple-darwin.tar.xz) | Intel macOS | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.58.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.58.0/worktrunk-x86_64-pc-windows-msvc.zip) | x64 Windows | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.58.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.58.0/worktrunk-aarch64-unknown-linux-musl.tar.xz) | ARM64 MUSL Linux | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.58.0/worktrunk-aarch64-unknown-linux-musl.tar.xz.sha256) | See merge request: Harmonybrew/homebrew-core!11501
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.
What
Removes four snapshot-filter hacks that rewrote captured bytes for claimed cross-platform consistency, so committed
.snapfiles now show the bytes the binary actually emits:tests/common/mod.rs, from Add PowerShell directive tests and fix test file cfg placement #125): stripped every line-final\x1b[0mbefore snapshotting, claiming "Windows terminal strips trailing resets that Unix includes."ensure_line_resets: re-added those stripped resets before ANSI→HTML conversion — a hack that existed only to compensate for filter 1.add_pty_filtersand statusline'sclaude_code_snapshot_settings: claimed macOS/Linux PTYs "generate ANSI codes slightly differently."Why the claims look stale
anstream::AutoStream::always()only takes the wincon path whenraw.is_terminal()— piped output is ANSI pass-through on every platform. That was already true of anstream 0.6.21, the version in use when Add PowerShell directive tests and fix test file cfg placement #125 landed, so the original claim was likely a misdiagnosis (plausibly of the CRLF template leak fixed properly in refactor(styling): end bash-gutter lines at their content, not a reopened dim #3056).\x1b[0min PTY/statusline output is the binary's own deterministic write (reset before streaming child output; statusline prefix), not PTY-layer variance. Alladd_pty_filtersusers are#[cfg(unix)]-gated, so ConPTY rewriting is not in play.Verification
test_docs_are_in_syncwith the readme_sync hack removed — the generated docs HTML is byte-identical now that snapshots carry real resets.[0m), plus known cosmetic env-header drift./var/folders/…) and Linux-shaped (TMPDIR=/tmp) temp paths.CI is the arbiter
This PR exists to let
test (windows)andtest (linux)adjudicate the cross-platform claims, which can't be settled locally. If a platform genuinely diverges anywhere, the plan is to narrow the specific filter to exactly that case and cite the CI evidence in its comment — a partial outcome is acceptable and will be reported as such.🤖 Generated with Claude Code