feat: Add lattice diff command for branch-scoped change summaries#4
Merged
feat: Add lattice diff command for branch-scoped change summaries#4
Conversation
Implements REQ-CLI-019. Shows lattice nodes added, modified, resolved, or deleted since a given git ref. Supports text, JSON, and markdown output. - Core diff logic in src/diff.rs using git diff --name-status - Detects newly resolved requirements by comparing old/new YAML - --since flag for explicit ref (defaults to merge-base with main) - --md flag for GitHub comment-ready markdown output - 10 unit tests + 8 integration tests Closes #2 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests now gracefully skip when git history is unavailable (shallow clones). Uses helper functions to check history depth before using refs like HEAD~1. Co-Authored-By: Claude Opus 4.6 <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.
Summary
lattice diffcommand that shows lattice nodes added, modified, resolved, or deleted since a given git ref--format json), and markdown (--md)--sinceref is providedImplementation
src/diff.rs: usesgit diff --name-status <ref> -- .lattice/to detect file changes, parses YAML to extract node metadata, detects newly resolved requirements by comparing old vs new statesrc/main.rs: newDiffcommand variant with--since,--md, and--formatflagssrc/lib.rsTest plan
is_node_file,DiffResult,format_entry, markdown formattingmake pre-pushpasses (fmt + clippy + 208 tests + release build)lattice driftreports no unresolved driftCloses #2
🤖 Generated with Claude Code