mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-08-27 14:17:10 -04:00
Adds crates/headroom-core/src/transforms/code_compressor.rs (1,882 lines): the AST-aware CodeCompressor ported to Rust on tree-sitter, with grammars for Python, JavaScript, TypeScript, Go, Rust, Java, C and C++. Parity-only, like #1153. Nothing calls it: the only references outside the module are the pub mod / pub use declarations in transforms/mod.rs, and live_zone.rs still routes SourceCode to a no-op. The pyo3 bridge is untouched and no Python source changes, so the engine is unreachable from the shipped package. #1155 wires it into live-zone dispatch. Every grammar is pinned with '=' to the exact version of the corresponding Python tree-sitter-<lang> PyPI wheel. Same version on crates.io and PyPI means the same grammar.js, hence the same generated parser.c, hence node-for-node identical ASTs — the precondition for byte-parity. A canary over 9 samples x 8 languages confirmed identical node-type and line-span trees at these pins; bumping any pin requires re-running it and re-recording the fixtures. Ships 30 recorded parity fixtures, a CodeCompressorComparator in headroom-parity, and scripts/record_code_compressor_fixtures.py. Verified byte-identical to the recorded Python output: [code_aware_compressor] total=30 matched=30 skipped=0 diffed=0 Full harness on the merge result: 227 fixtures, 182 matched, 45 skipped (cache_aligner + ccr stubs), 0 diffed, exit 0 — with kompress at 21/21 under ONNX Runtime 1.24.4 (see #2591). Also verified cargo check -p headroom-core --no-default-features passes, so the static-musl path stays intact. |
||
|---|---|---|
| .. | ||
| 1e319c5e33af4af1.json | ||
| 1e496ebaf89fab96.json | ||
| 2c239d4af41282c2.json | ||
| 2d214f401618d639.json | ||
| 3e706cfb03aa3c8e.json | ||
| 5c057f7bfd56af05.json | ||
| 6c04d398f9c3014e.json | ||
| 7cee85d20b3604dd.json | ||
| 07dd1a61089c1e53.json | ||
| 36e5ff5093790e6f.json | ||
| 88fe6b4b0a9908c5.json | ||
| 095be1adad76b588.json | ||
| 411d5549bcd5f50d.json | ||
| 420dd19a087526ca.json | ||
| 716a5a2380907e71.json | ||
| 53030c7c11ce0082.json | ||
| 791805bff164ee9d.json | ||
| 921876ad5dd26cf6.json | ||
| b8fa00d165cd059a.json | ||
| b753b4725da91f71.json | ||
| b16202e9b81a5bba.json | ||
| ba9c0fda1beda6ec.json | ||
| bd14bdd440e5a1ab.json | ||
| bfcb158739b34b43.json | ||
| d72fde8ea01cb782.json | ||
| da21f7240cb20e8b.json | ||
| e8ce85f0703b083b.json | ||
| e79625ba83a6f22d.json | ||
| f8a7f62203b3d8ba.json | ||
| f9a7c264592ff8c4.json | ||