Follow-up to #66. Spike ran; this issue parks the migration so it stays live without committing engineering until evidence shows up.
Status
Parked. Feasibility proved, necessity not. Numbers and gotchas: #66 spike report.
Triggers to activate
Any one flips this from "tracked" to "do it":
Constraints to preserve
- zero runtime deps in the published package
- <100 ms cold start
- single-binary build via
bun build --compile still works
Open questions
- Native vs WASM —
web-tree-sitter clears the constraints (cold 23.8 ms, ~2.3 MB per grammar). Native bindings break single-binary. WASM is the front-runner.
- Hunk vs full file — today gitmsg sees diff hunks; tree-sitter wants full files. Either
git show both sides → parse → diff symbol tables (simpler, two extra git calls per file), or invent a hunk-friendly approach.
- Per-language order — TS first (already proven, biggest base), then Python, Go, C#. Keep regex as fallback for ungrammared languages.
- Build pipeline — vendor pre-built
.wasm, or rebuild grammars in CI against a pinned tree-sitter-cli? Spike showed vendored third-party .wasm is fragile when external C scanners are involved.
What's validated
tree-sitter-typescript via tree-sitter-wasms@0.1.13 parses real source cleanly
- 5-line query pulls only exported symbols —
exported is a built-in tree property (no per-language visibility heuristic, unlike current regex extractors)
- cold path 23.8 ms · warm parse 0.42 ms · full
src/ stress 3.15 ms/file
What's not validated
- the
git show + symbol-table-diff approach end-to-end
- rebuilding grammars from source against a pinned runtime
- bundle size impact on
bun build --compile
Non-goals
- not blocking 1.0
- not removing regex extractors when this lands — they stay as fallback
- not migrating all languages in one PR
Follow-up to #66. Spike ran; this issue parks the migration so it stays live without committing engineering until evidence shows up.
Status
Parked. Feasibility proved, necessity not. Numbers and gotchas: #66 spike report.
Triggers to activate
Any one flips this from "tracked" to "do it":
Constraints to preserve
bun build --compilestill worksOpen questions
web-tree-sitterclears the constraints (cold 23.8 ms, ~2.3 MB per grammar). Native bindings break single-binary. WASM is the front-runner.git showboth sides → parse → diff symbol tables (simpler, two extragitcalls per file), or invent a hunk-friendly approach..wasm, or rebuild grammars in CI against a pinnedtree-sitter-cli? Spike showed vendored third-party.wasmis fragile when external C scanners are involved.What's validated
tree-sitter-typescriptviatree-sitter-wasms@0.1.13parses real source cleanlyexportedis a built-in tree property (no per-language visibility heuristic, unlike current regex extractors)src/stress 3.15 ms/fileWhat's not validated
git show+ symbol-table-diff approach end-to-endbun build --compileNon-goals