How giter00/dsh-headroom works
dsh-headroom is a DeepSeek Harness plugin that compresses eligible tool output before it enters session history, while preserving exact originals for retrieval. The graph follows the documented routing and tool workflow; some implementation details are unsampled, so uncertain internal links are omitted.
Main entry points: index.js Plugin hook and tools · compress.js Content detection and routing · ccr.js CCR persistent store · kompress.js Word scoring pipeline
Components 17
Harness integration
- Plugin hook and tools
lib/index.js
Compression routing
- Content detection and routing
lib/compress.js - JSON projection
lib/compress.js - Search folding
lib/compress.js - Log folding
lib/compress.js - Table folding
lib/compress.js - Long text compression
lib/compress.js
Recovery and tools
- CCR persistent store
lib/ccr.js - Retrieval marker
lib/compress.js - headroom_retrieve
lib/index.js - headroom_stats
lib/index.js - headroom_compress
lib/index.js
Text scoring
- Word scoring pipeline
lib/kompress.js - Optional ONNX scorer
lib/kompress-onnx.js
Other components
- Harness tool runtime
- Session and model history
- Model
Connections 19
- Harness tool runtime → Plugin hook and tools: dispatches hook
- Plugin hook and tools → Harness tool runtime: continues execution
- Plugin hook and tools → Content detection and routing: routes content
- Content detection and routing → JSON projection: projects JSON
- Content detection and routing → Search folding: folds search
- Content detection and routing → Log folding: folds logs
- Content detection and routing → Table folding: folds tables
- Content detection and routing → Long text compression: compresses text
- Long text compression → Word scoring pipeline: scores words
- Word scoring pipeline → Optional ONNX scorer: scores with model
- Plugin hook and tools → CCR persistent store: stores originals
- Plugin hook and tools → Retrieval marker: adds marker
- Plugin hook and tools → Session and model history: returns compressed result
- Model → headroom_retrieve: requests original
- headroom_retrieve → CCR persistent store: reads original
- Plugin hook and tools → headroom_stats: registers tool
- headroom_stats → CCR persistent store: reads totals
- Plugin hook and tools → headroom_compress: registers tool
- headroom_compress → Content detection and routing: compresses text