Skip to main content

Module context_compiler

Module context_compiler 

Source
Expand description

Context Compiler – builds minimal context packages under budget constraints.

Physical metaphor: Free Energy minimization. F = E - TS, where E = token cost, T = budget pressure, S = information (Phi).

Algorithm:

  1. LOAD ledger items + active overlays -> candidates
  2. SCORE Phi(i,t) for each candidate (Context Field)
  3. SELECT greedy knapsack with view selection
  4. DEDUP redundancy removal via Jaccard
  5. ORDER Lost-in-the-Middle reorder (LiTM profile)
  6. RENDER output in the requested mode
  7. PROVE record provenance in evidence ledger

Structs§

CompileCandidate
A candidate item ready for selection.
CompileResult
Result of a compilation run.
ExcludedItem
SelectedItem

Enums§

CompileMode
Compilation output mode.

Functions§

compile
Compile a minimal context package from candidates under budget constraints.
format_compile_result
Format the compilation result for display.