How hfnissum-byte/hunkpick works
Hunkpick is a Node.js CLI that resolves Git content conflicts by generating possible merges, filtering invalid candidates, and asking a model to choose among them; code applies confidence gates. The main flow starts with conflict discovery, rebuilds and parses conflicts, then generates line/token or JSON-key candidates for validation and judgment. Users can inspect a report, apply gated results, or review choices interactively. The graph follows README-documented stages and indexed imports; unsampled details are represented only where the README supports them.
Main entry points: hunkpick.mjs CLI orchestration · pipeline.mjs Candidate pipeline · judge.mjs Model request and verdicts · candidates.mjs Line and token merges
Components 14
CLI and outcomes
- CLI orchestration
hunkpick.mjs
Conflict processing
- Git conflict access
lib/git.mjs - Conflict parsing
lib/conflicts.mjs - Candidate pipeline
lib/pipeline.mjs - Line and token merges
lib/candidates.mjs - JSON key merge
lib/structured.mjs - Syntax validation
lib/validate.mjs
Model judgment
- Model request and verdicts
lib/judge.mjs - TypeSafe client
lib/typesafe.mjs
Human review
- Review state and rendering
lib/review.mjs - Terminal display helpers
lib/ui.mjs
Other components
- User
- TypeSafe API
- Working tree files
Connections 17
- User → CLI orchestration: runs options
README.md - CLI orchestration → Git conflict access: discovers conflicts
hunkpick.mjs - CLI orchestration → Candidate pipeline: builds outcomes
README.md - Candidate pipeline → Git conflict access: reads stages
lib/pipeline.mjs - Candidate pipeline → Conflict parsing: parses conflicts
lib/pipeline.mjs - Candidate pipeline → Line and token merges: generates candidates
lib/pipeline.mjs - Candidate pipeline → JSON key merge: merges JSON
lib/pipeline.mjs - Candidate pipeline → Syntax validation: checks candidates
lib/pipeline.mjs - JSON key merge → Line and token merges: reuses array merge
lib/structured.mjs - CLI orchestration → Model request and verdicts: requests verdicts
hunkpick.mjs - Model request and verdicts → Line and token merges: summarizes differences
lib/judge.mjs - Model request and verdicts → TypeSafe client: sends request
lib/judge.mjs - TypeSafe client → TypeSafe API: posts judgment
lib/typesafe.mjs - CLI orchestration → Review state and rendering: starts review
hunkpick.mjs - Review state and rendering → Terminal display helpers: uses display helpers
lib/review.mjs - CLI orchestration → Working tree files: writes accepted results
hunkpick.mjs - CLI orchestration → User: reports results
README.md