Problem
ParseTree currently lives in internal/domain/valueobject/parse_tree.go and directly imports github.com/alexaandru/go-tree-sitter-bare, a CGO dependency. Because Go compiles whole packages, anything that imports valueobject pulls in the tree-sitter CGO requirement — even code that has nothing to do with parsing.
This blocks building the CLI client (cmd/client) as a static, CGO-free binary. The dependency chain is:
client → internal/application/dto → dto/connector.go → internal/domain/valueobject → parse_tree.go → go-tree-sitter-bare (CGO)
Goal
Move ParseTree (and its tree-sitter dependency) out of the domain valueobject package and into the adapter layer where it belongs (e.g. internal/adapter/outbound/treesitter). This would:
- Keep the domain layer free of infrastructure dependencies
- Allow
cmd/client to be built with CGO_ENABLED=0 as a portable static binary
- Better align with the hexagonal architecture (CGO/tree-sitter is an infrastructure concern, not a domain concept)
Scope
- Move
internal/domain/valueobject/parse_tree.go → internal/adapter/outbound/treesitter/
- Update all references across chunking adapters and treesitter interfaces
- Restore
CGO_ENABLED=0 in make build-client and cross-compile targets
Notes
Workaround applied in #: changed make build-client to use CGO_ENABLED=1 so the build works in the interim.
Problem
ParseTreecurrently lives ininternal/domain/valueobject/parse_tree.goand directly importsgithub.com/alexaandru/go-tree-sitter-bare, a CGO dependency. Because Go compiles whole packages, anything that importsvalueobjectpulls in the tree-sitter CGO requirement — even code that has nothing to do with parsing.This blocks building the CLI client (
cmd/client) as a static, CGO-free binary. The dependency chain is:Goal
Move
ParseTree(and its tree-sitter dependency) out of the domainvalueobjectpackage and into the adapter layer where it belongs (e.g.internal/adapter/outbound/treesitter). This would:cmd/clientto be built withCGO_ENABLED=0as a portable static binaryScope
internal/domain/valueobject/parse_tree.go→internal/adapter/outbound/treesitter/CGO_ENABLED=0inmake build-clientand cross-compile targetsNotes
Workaround applied in #: changed
make build-clientto useCGO_ENABLED=1so the build works in the interim.