How dahc36/loop-review works
loop-review is a Go CLI that posts JSON review drafts as pending GitHub pull-request reviews. Its workflow reads and validates the draft, identifies the GitHub repository from a local clone, fetches pull-request state, checks comment anchors against the base-to-head diff and validates suggestions and links, then submits the review and emits IDs. The graph reflects relationships visible in the sampled source; finer validation behavior is shown as separate components where the caller is explicit.
Main entry points: post.go Post workflow · draft.go Comment validation · github.go GitHub CLI client · main.go Command entry
Components 15
CLI workflow
- Command entry
main.go - Post workflow
post.go - Review result
post.go
Draft validation
- Draft reader
draft.go - Comment model
comment.go - Comment validation
draft.go - Anchor validation
anchor.go - Suggestion validation
suggestion.go - Link validation
link.go
Local Git operations
- Repository identity
repo.go - Touched-line reader
diff.go
GitHub integration
- GitHub CLI client
github.go
Other components
- CLI user
- Git CLI
- GitHub
Connections 17
- CLI user → Command entry: runs command
main.go - Command entry → Post workflow: dispatches post
main.go - Post workflow → Draft reader: reads draft
post.go - Post workflow → Repository identity: opens clone
post.go - Post workflow → GitHub CLI client: loads pull request
post.go - Post workflow → Touched-line reader: reads touched lines
post.go - Post workflow → Comment validation: validates comments
post.go - Comment validation → Anchor validation: checks anchors
draft.go - Comment validation → Suggestion validation: checks suggestions
draft.go - Comment validation → Link validation: checks links
draft.go - Post workflow → GitHub CLI client: creates review
post.go - Post workflow → Review result: encodes result
post.go - Post workflow → Git CLI: reads diff
- Repository identity → Git CLI: reads origin
repo.go - Link validation → Git CLI: checks file refs
link.go - Touched-line reader → Git CLI: fetches and diffs
diff.go - GitHub CLI client → GitHub: GraphQL via gh
github.go