fix: document and categorize diagnostic files in state logs#1981
Merged
fix: document and categorize diagnostic files in state logs#1981
Conversation
`verbose.log` and `diagnostic.md` (created by `-vv`) were undocumented in the state logs help text and FAQ. `verbose.log` was miscategorized as hook output in `logs get`, and `diagnostic.md` was invisible to both `logs get` and `logs clear`. Add a DIAGNOSTIC section to all output paths (human, JSON, table), update docs and FAQ inventory, and add tests for section separation and clearing. Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts: # tests/integration_tests/config_state.rs
…blank lines Deduplicate the three log section render functions into a single generic `render_log_section` parameterized by heading and filter predicate, called from `render_all_log_sections`. All three output paths (logs get, state get logs, state table) now share one code path. Fix `\s*$` in the test size/age filter consuming trailing newlines, which collapsed blank line separators between populated sections. Use `[ \t]*$` to match only horizontal whitespace. Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
worktrunk-bot
left a comment
There was a problem hiding this comment.
The JSON test snapshots (test_state_get_json_empty, test_state_get_json_comprehensive, test_state_get_json_with_logs) weren't updated to include the new "diagnostic" field. The code now emits "diagnostic": [...] in the JSON output, but the inline snapshots don't expect it — these tests will fail.
Fix: run cargo insta test --accept -- --test integration "test_state_get_json" and commit the updated snapshots.
Also — #1977 touches the exact same files with a subset of this work. One of them should be closed to avoid merge conflicts.
Main converted the JSON state tests to inline snapshots, which now need the `"diagnostic"` key added by this branch. Co-Authored-By: Claude <noreply@anthropic.com>
worktrunk-bot
approved these changes
Apr 7, 2026
max-sixty
added a commit
that referenced
this pull request
Apr 7, 2026
`\s*$` in Rust regex matches newlines, which can consume trailing `\n` and collapse blank line separators in insta inline snapshots. Use `[ \t]*$` to match only horizontal whitespace, consistent with the same fix applied in config_state.rs (#1981). Co-Authored-By: Claude <noreply@anthropic.com>
max-sixty
added a commit
that referenced
this pull request
Apr 7, 2026
Same fix as #1981 — `\s*$` in Rust regex matches newlines, so `add_filter` patterns ending with `\s*$` can consume trailing `\n` and collapse blank line separators in insta inline snapshots. Changed to `[ \t]*$` in the two remaining instances in `switch_picker.rs`. > _This was written by Claude Code on behalf of @max-sixty_ Co-authored-by: Claude <noreply@anthropic.com>
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.
verbose.loganddiagnostic.md(created by-vv) were undocumented in thewt config state logshelp text and FAQ.verbose.logwas miscategorized as hook output inlogs get, anddiagnostic.mdwas invisible to bothlogs getandlogs clear(not matched byis_wt_log_file).Adds a DIAGNOSTIC section to all output paths (human table, JSON,
logs get,state get logs), updates help text ("two kinds" → "three kinds"), and updates the FAQ file inventory.Also extracts the three identical per-section render functions into a single
render_log_sectionparameterized by heading and filter predicate —render_all_log_sectionscomposes them and is called from all three display paths.Fixes a test filter bug where
\s*$consumed trailing newlines, collapsing blank line separators between populated sections. Changed to[ \t]*$to match only horizontal whitespace.