Repository navigation
refactor(docs): drop mirrored help-page close; align convert_console_blocks_in_docs error channel - #2422
Merged
Conversation
…onsole_blocks_in_docs error channel Three follow-ups from PR #2419 review. - **Bare close everywhere.** With inner snapshot wrappers gone from command pages (PR #2419), no `AUTO-GENERATED` markers nest inside the help-page region anywhere in `docs/content/*.md`. The mirrored close (`<!-- END AUTO-GENERATED from `wt cmd --help-page` -->`) was the only remaining variant of the close form; collapsed to bare `MARKER_CLOSE`. - `src/help.rs::PageMode::emit_footer()` no longer takes `subcommand`. - The help-page regex in `readme_sync.rs` matches via non-greedy `.*?` to bare `MARKER_CLOSE`, with a comment pointing at the new invariant test. - `AUTO_GENERATED_MARKER_PATTERN` strip regex built from the constants. Added `test_no_nested_auto_generated_markers` — walks `docs/content/*.md` and fails if any `AUTO-GENERATED` open ever appears inside an already-open region. This is the explicit invariant that bare-close pairing depends on; if a future change tries to introduce nesting (or restore an inner snapshot wrapper), the test catches it before the subtle "regex chops region at first inner close" failure mode lands. - **Aligned error channel.** `convert_console_blocks_in_docs` now returns `(Vec<String>, Vec<String>)` like its sibling sync steps, with per-file error capture for `read_dir`, dir entries, and `read_to_string`. The caller passes errors through the same `tag()` aggregation as everything else, so a transient I/O failure on one file no longer aborts the whole pipeline silently. Also fixes the matching clippy warning (`is_some_and(|e| e == "md")` → `is_none_or(|e| e != "md")`). - **Docs alignment.** `docs/CLAUDE.md` updated in two places where the prose still documented the mirrored close as the canonical form. Visual check via curl across 12 dev-server pages confirmed no leakage of any prior marker form. Adversarial review (subagent /popper-style) caught the stale prose; otherwise no regressions found. Net diff: +113/-49 (the growth is the new invariant test and explicit per-file error handling; structural simplification shows as -49). Co-Authored-By: Claude <[email protected]>
worktrunk-bot
left a comment
Collaborator
There was a problem hiding this comment.
Two stale docstrings still describe the mirrored close marker as the canonical form. The PR description notes the adversarial review caught the prose in docs/CLAUDE.md; these two slipped through.
tests/integration_tests/readme_sync.rs:1885-1886— inline suggestion below.src/docs.rs:34-37(MARKER_CLOSEdocstring): "The help-page emitter uses a mirrored variant (<!-- END AUTO-GENERATED from <id> -->) so two adjacent regions can be parsed without ambiguity; everything else uses this bare form." — no longer accurate; the help-page emitter now uses the bare form too. This line is outside the diff; happy to push a fix commit if you'd like.
Caught by auto-reviewer on PR #2422. - `tests/integration_tests/readme_sync.rs:1885` — `AUTO_GENERATED_MARKER_PATTERN` docstring described the close as "with or without the help-page mirrored suffix". The regex now uses bare `MARKER_CLOSE` only. - `src/docs.rs:34` — `MARKER_CLOSE` docstring described the help-page mirrored variant as the canonical close. With the bare close used everywhere, point at `test_no_nested_auto_generated_markers` as the invariant guarding non-greedy pairing instead. Co-Authored-By: Claude <[email protected]>
Owner
Author
|
Both stale docstrings fixed in d490a6d:
|
Collaborator
|
Both edits look right — |
worktrunk-bot
approved these changes
Apr 26, 2026
max-sixty
added a commit
that referenced
this pull request
Apr 26, 2026
…s page-list (#2427) Follow-up #1 from PR #2422 review: `sync_well_known_skills` and `sync_llms_txt` panicked on every failure, while every other step in `test_docs_are_in_sync` reports via `(Vec<String>, Vec<String>)`. They now use the channel so a single sync run reports all problems together. While in the file: dropped redundant `.exists()` prechecks before reads, collapsed the `if exists() then read else String::new()` pattern for `skill_file` to `unwrap_or_default()` (we write `expected` either way), and shared `docs_content_page_names` from `convert_console_blocks_in_docs` so the directory walk and underscore-prefix filter live in one place. Net diff is shorter than baseline (-3 lines). Leaf TOCTOU reads stay as one-line panics — converting them to the channel was ceremony, not improvement. > _This was written by Claude Code on behalf of Maximilian_ Co-authored-by: Claude <[email protected]>
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
Three follow-ups from #2419 review.
Bare close everywhere. With inner snapshot wrappers gone from command pages (refactor(tests): consolidate three sync tests; drop dead inner snapshot wrappers #2419), no
AUTO-GENERATEDmarkers nest inside the help-page region anywhere indocs/content/*.md. The mirrored close (<!-- END AUTO-GENERATED from \wt cmd --help-page` -->) was the only remaining variant of the close form; collapsed to bareMARKER_CLOSE`.src/help.rs::PageMode::emit_footer()no longer takessubcommand.readme_sync.rsmatches via non-greedy.*?to bareMARKER_CLOSE, with a comment pointing at the new invariant test.AUTO_GENERATED_MARKER_PATTERNstrip regex built from the constants.Added
test_no_nested_auto_generated_markers— walksdocs/content/*.mdand fails if anyAUTO-GENERATEDopen ever appears inside an already-open region. This is the explicit invariant that bare-close pairing depends on; if a future change tries to re-introduce nesting (e.g., restore an inner snapshot wrapper around terminal shortcodes), the test catches it before the subtle "regex chops region at first inner close" failure mode lands.Aligned error channel.
convert_console_blocks_in_docsnow returns(Vec<String>, Vec<String>)like its sibling sync steps, with per-file error capture forread_dir, dir entries, andread_to_string. The caller passes errors through the sametag()aggregation as everything else, so a transient I/O failure on one file no longer aborts the whole pipeline silently. Also fixes the matching clippy warning (is_some_and(|e| e == \"md\")→is_none_or(|e| e != \"md\")).Docs alignment.
docs/CLAUDE.mdupdated in two places where the prose still documented the mirrored close as the canonical form.Visual check via curl across 12 dev-server pages confirmed no leakage of any prior marker form. Adversarial review (subagent /popper-style) caught the stale prose; otherwise no regressions found.
Net diff: +113/-49 (the growth is the new invariant test and explicit per-file error handling; structural simplification shows as -49).
Test plan
cargo test --test integration readme_sync— 12 sync tests pass (was 11; +1 for the new invariant test)cargo test --test integration— full integration suite (1558 tests) passcargo test --test integration test_no_nested_auto_generated_markers— new guard test passes; manually verified it fires on synthetic nestinggit checkout docs/ && cargo test --test integration test_docs_are_in_sync && git diff --statproduces an empty diff after the first runcargo clippy --all-targets --all-features— cleancargo fmt --check— clean🤖 Generated with Claude Code