1
Context & Corpus Input
E-Commerce / FinTech
Payment & Rate Limit Cascade
4 files (1,840 tokens). Top-K misses rate_limiter.py; Entroly Knapsack fits all 3 critical spans.
Systems / Rust
Deadlock & Eviction Race
5 files (2,650 tokens). Knapsack preserves lock protocol and eviction without memory bloat.
Fullstack / Node
JWT Token Refresh Vulnerability
4 files (1,920 tokens). Pinpoints signature replay logic across auth middleware and session store.
1 file
Fetches top source files directly via GitHub Public API to test compression client-side.
Target Query & Budget Constraints
2
Provable Optimization & Receipts
Tokens Delivered
418 / 450
Fit in budget: 100%
Token Savings
77.3%
1,422 tokens saved
Cost Avoided
$0.0043
Sonnet / GPT-4o base
Critical Catches
3 / 3
Auth + Pay + RateLimiter
VERIFIED AUDIT RECEIPT
rcpt_7f8a9e2d1c0b
Schema:
context-receipt.v1 (Merkle-CCR)
Merkle Root Hash:
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Original Corpus Digest:
a8f94d12c0193e...
Source Spans Retained:
3 fragments across 3 files
Reversibility Proof:
PASS (100% bit-exact byte recovery via handle)
Selected Fragment Handles & Proofs:
Head-to-Head Context Selection: 450 Token Budget
Why Naive FIFO and Greedy Top-K fail on multi-module real-world bugs:
| Strategy | Files Retained | Coverage | Rate Limiter Retained? | Token Cost |
|---|---|---|---|---|
| Raw FIFO First files until budget cutoff |
checkout.py (partial) |
1 / 4 modules (25%) | DROPPED | 450 tokens |
| Top-K Greedy Highest BM25 relevance score |
checkout.py + auth.py |
2 / 4 modules (50%) | DROPPED (Budget exhausted) | 442 tokens |
| ⚡ ENTROLY (Knapsack) DP 0-1 budget optimization |
checkout.py + auth.py + rate_limiter.py |
3 / 4 modules (75%) | RETAINED (Exact span fit) | 418 tokens |
The Knapsack Advantage: Greedy Top-K spent 350 tokens on non-critical comments in
checkout.py, leaving no budget for rate_limiter.py. The LLM produced an insecure fix missing the 429 backoff. Entroly extracted high-density fragments across all 3 necessary files, staying under budget.
Honest Context Accounting: Every omitted span includes an inspectable reason and marginal density score.