Conversation
Register --snapshot-compact as a boolean flag and implement the compactFormat() transform with four sub-passes: link collapsing, heading inlining, decorative image removal, and duplicate URL dedup. Insert in the getSnapshot pipeline between trimByDepth and collapseRepeated.
Add compactFormat() function replica to test file and comprehensive tests covering guard clauses, link collapsing, heading inlining, decorative image removal, duplicate URL dedup, combination transforms, and getSnapshot pipeline integration with snapshotCompact option.
…ion tests Add --snapshot-compact to BOOLEAN_FLAGS replica, flag parsing tests, source validation for compactFormat function existence, and update pipeline order test from four to five transforms.
Update SKILL.md with full subsection, commands/web-ctl.md with example, README.md Common Flags table, and CHANGELOG.md with detailed entry.
Replace greedy .+ with bounded [^"]+ in quoted string regexes and \S+ in URL regexes to prevent ReDoS. Remove unused childIndent variable. Add tests for blank lines, transform interaction, and dedup after collapse.
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
--snapshot-compactboolean flag that applies four token-saving transforms to ARIA snapshotslink+/url:child intolink "Title" -> /pathheading [hN] "Title" -> /pathimgnodes with empty or single-char alt textImplementation Details
compactFormat()function inscripts/web-ctl.jswith hardened regex patterns ([^"]+instead of.+to prevent ReDoS)trimByDepth -> compactFormat -> collapseRepeated -> textOnly -> trimByLinesTest Plan
npm testpasses (402/402)npm run validatepassesCloses #46