feat: add check-tree-quality.sh with tests#13
Merged
mpawliszyn merged 1 commit intomainfrom Feb 26, 2026
Merged
Conversation
Shell script to validate structural quality of a review-tree.md file.
Takes a tree file and a diff file list. Outputs pass/fail per check.
Checks: HEAD SHA, Revision, Description Verification section,
top-level node count (default 7, configurable), file coverage
(every diff file mapped), variation structure (warn if no repeats).
Fixes from review:
- C1: gensub() replaced with POSIX match()/RSTART for macOS awk
- C2: variation pattern matches {variation comment} not just {variation}
- I1: grep -qxF for exact file path matching (no substring false positives)
- BSD sed: all sed patterns use [[:space:]] not \s
- Indent calculation: wc -c newline offset corrected
21 bats tests covering:
- Valid tree passes, unmapped file detected, threshold (default +
configurable + boundary at 7), missing HEAD/Revision/DescVerification,
variation warn (no repeats, {variation comment}, exit 0 on warn),
no warnings on valid sample, exact path matching, empty file list,
multiple failures reported together
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
228f882 to
517c3b0
Compare
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
Structural quality checker for
review-tree.md. Fourth and final script in Phase 1.Script interface
Takes a tree file and a diff file list (one path per line). Runs 6 checks, outputs pass/fail per check.
Checks
Tests (14)
180 total tests across all suites.
Phase 1 Complete
This completes all 4 Phase 1 shell scripts:
update-node-status.sh(Task 3)add-comment.sh(Task 4)coverage-report.sh(Task 5)check-tree-quality.sh(Task 6)