feat(compression): headroom backend, progressive ladder, CCR, columnar packing#65
feat(compression): headroom backend, progressive ladder, CCR, columnar packing#65doramirdor wants to merge 2 commits into
Conversation
NadirClaw's TrainedVerifier was passing the cheap answer as the bare
text_pair to the tokenizer. The model was trained on a structured format
with CHEAP:/EXPENSIVE: markers, matching what the Pro production backend
uses. Without that wrapper, scores are miscalibrated against the
production tau=0.80 threshold.
This patch wraps the input in the production format:
text_pair = f"CHEAP:\n{cheap}\n\nEXPENSIVE:\n{reference or ''}"
reference_answer is now used when provided (was previously documented as
ignored). Behavior with reference_answer=None matches production: empty
string substitution.
Aligns NadirClaw with:
- https://huggingface.co/nadirclaw/cascade-verifier-v1 (model card)
- getnadir.dev/backend/app/services/verifier_model.py (production)
Repo: https://github.com/NadirRouter/NadirClaw
Service: https://getnadir.com
…r packing - optimize: pluggable backend (native|headroom), lazy fail-open headroom-ai integration; progressive staged compression (compress_progressive) with native CCR offload + fetch-back loop (ccr.py); columnar JSON-array packing (json_array_pack); whitespace fix preserves code indentation. - settings/cli/server: NADIRCLAW_OPTIMIZE adds 'progressive'; OPTIMIZE_BACKEND, target-tokens, max-stage, allow-lossy/offload knobs; serve --optimize progressive. - pyproject: optional [headroom] extra (headroom-ai). Apache-2.0 attribution in THIRD_PARTY_NOTICES.md. - docs + benchmarks + tests (ccr, progressive, json_array_pack, backends, code-safety). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Review (automated, scheduled run)Verdict: ship — solid feature add, ladder logic and fail-open behaviour check out. One operational fix needed before merge. ✅ What I ran
🔧 Blocker — base branch is a stale alias for main
Fix: retarget PR base to 👍 What I verified
|
|
Follow-up to my earlier review — retargeted this PR base from 🤖 Automated follow-up via scheduled triage. |
Context-optimizer upgrades for NadirClaw (single clean commit on top of the verifier branch).
backend= native | headroom. headroom-ai is a lazy, fail-open optional extra (pip install nadirclaw[headroom]) — absent/error falls back to native, byte-identical.compress_progressive): staged ladder native → headroom → offload, stops at a token budget.NADIRCLAW_OPTIMIZEaddsprogressive.ccr.py): deterministic offload +nadir_retrievefetch-back loop (no third-party store).json_array_pack) + whitespace fix that preserves code indentation.Base is the verifier branch so the diff is only the compression commit.
🤖 Generated with Claude Code