Repository navigation
Conversation
to_markdown was 143 lines. Each section -- the introduction, functions per file, elements per function, the top elements of a group, the per-file table and the skipped files -- is now its own function, and to_markdown puts them in order. The output is unchanged byte for byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
resolve was 109 lines. It now refuses `..`, makes the path absolute, finds the deepest part that exists, appends the rest and checks the result against the roots, each in a function of its own. The refusals that name the roots are made in one place. Every answer, refusals included, is unchanged. Co-Authored-By: Claude Opus 5.5 <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.



The two longest functions in the repository were
to_markdownincli/stats.rs(143 lines) andRoots::resolveincli/mcp/paths.rs(109 lines). Each is split so that no function is longer than 50 lines. Neither one's behaviour changes.to_markdown
md_intro,md_functions,md_elements,md_topfor one group,md_per_fileandmd_skipped.to_markdownputs them in order (17 lines). The longest of the new functions ismd_elementsat 40.Reportis built withReport::new.oinkie stats -f markdown, both with and without--per-file --top 3, over a directory that produces every section, including skipped files. The output before and after is identical byte for byte.Roots::resolve
resolve(7 lines) now reads as its steps:refuse_parent_componentsrefuses..;absolutejoins a relative path to the working directory;deepest_existingwalks up to the deepest part that exists;appendputs the rest back on, refusing to append to a file;inside_a_rootchecks the result.refusal.deepest_existingat 49 lines, about half of them the comments that explain each case of the walk..., one outside the root, a dangling symlink, one through a file, one that does not exist yet, and an existing file. Every answer, the refusal messages included, is identical. The 13 existing tests ofresolvepass.cargo test --features mcp(410 tests) and clippy with-D warningspass locally.🤖 Generated with Claude Code